From 9018d8eef17c48eb877b20308924e615c0731d6a Mon Sep 17 00:00:00 2001 From: 19173159168 Date: Fri, 8 Aug 2025 22:37:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ZcRentCarRuleController.java | 13 ++ .../mapper/ZcRentCarRuleBatteryMapper.java | 2 + .../service/IZcRentCarRuleBatteryService.java | 2 + .../impl/ZcRentCarRuleBatteryServiceImpl.java | 5 +- .../com/ruoyi/orders/domain/ZcOrderMain.java | 173 +++++++++++++++--- .../operation/ZcRentCarRuleBatteryMapper.xml | 4 +- .../mapper/orders/ZcOrderMainMapper.xml | 15 +- .../templates/operation/rentCarRule/edit.html | 84 ++++----- .../operation/rentCarRule/rentCarRule.html | 2 +- .../templates/orders/order/edit.html | 16 +- .../templates/orders/order/order.html | 114 +++++++++--- 11 files changed, 316 insertions(+), 114 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcRentCarRuleController.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcRentCarRuleController.java index fc2ca58..4987d4b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcRentCarRuleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/controller/ZcRentCarRuleController.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Random; +import java.util.stream.Collectors; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.operation.domain.Company; @@ -142,6 +143,18 @@ public class ZcRentCarRuleController extends BaseController ZcRentCarRule zcRentCarRule = zcRentCarRuleService.selectZcRentCarRuleById(id); mmap.put("zcRentCarRule", zcRentCarRule); + + Company company = companyList.stream() + .filter(c -> c.getId() != null && c.getId().equals(zcRentCarRule.getOperatingCompanyId())) + .findFirst() + .orElse(null); + mmap.put("company", company); + // 查询已绑定的电池规则 + List batteryRules = zcRentCarRuleBatteryService.selectModelRuleByCarRuleId(id); + String modelRuleNames = batteryRules.stream() + .map(String::valueOf) + .collect(Collectors.joining(",")); + mmap.put("modelRuleNames", modelRuleNames); return prefix + "/edit"; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcRentCarRuleBatteryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcRentCarRuleBatteryMapper.java index afcbefe..4e35575 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcRentCarRuleBatteryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/mapper/ZcRentCarRuleBatteryMapper.java @@ -29,6 +29,8 @@ public interface ZcRentCarRuleBatteryMapper public List selectZcRentCarRuleBatteryList(ZcRentCarRuleBattery zcRentCarRuleBattery); List selectBatteryRuleIdsByCarRuleId(Long carRuleId); + + List selectModelRuleByCarRuleId(Long carRuleId); /** * 新增租车规则租电规则关联 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcRentCarRuleBatteryService.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcRentCarRuleBatteryService.java index 4d863d6..56dbd1a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcRentCarRuleBatteryService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/IZcRentCarRuleBatteryService.java @@ -28,6 +28,8 @@ public interface IZcRentCarRuleBatteryService public List selectZcRentCarRuleBatteryList(ZcRentCarRuleBattery zcRentCarRuleBattery); List selectBatteryRuleIdsByCarRuleId(Long carRuleId); + + List selectModelRuleByCarRuleId(Long carRuleId); /** * 新增租车规则租电规则关联 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcRentCarRuleBatteryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcRentCarRuleBatteryServiceImpl.java index e0a1dab..5d9457c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcRentCarRuleBatteryServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcRentCarRuleBatteryServiceImpl.java @@ -50,7 +50,10 @@ public class ZcRentCarRuleBatteryServiceImpl implements IZcRentCarRuleBatterySer public List selectBatteryRuleIdsByCarRuleId(Long carRuleId) { return zcRentCarRuleBatteryMapper.selectBatteryRuleIdsByCarRuleId(carRuleId); } - + @Override + public List selectModelRuleByCarRuleId(Long carRuleId) { + return zcRentCarRuleBatteryMapper.selectModelRuleByCarRuleId(carRuleId); + } /** * 新增租车规则租电规则关联 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/orders/domain/ZcOrderMain.java b/ruoyi-admin/src/main/java/com/ruoyi/orders/domain/ZcOrderMain.java index 9c2e6a0..1955035 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/orders/domain/ZcOrderMain.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/orders/domain/ZcOrderMain.java @@ -53,6 +53,9 @@ public class ZcOrderMain extends BaseEntity private Long vehicleId; + /** 车辆型号ID */ + private Long carModelId; + /** 客户id */ private Long customerId; @@ -64,6 +67,9 @@ public class ZcOrderMain extends BaseEntity @Excel(name = "客户联系电话") private String customerPhone; + /** 电池类型 */ + private String batteryType; + /** 租赁类型(时租/日租/按天数/以租代售) */ @Excel(name = "租赁类型",dictType = "key_order_rental_type") private String rentalType; @@ -84,6 +90,9 @@ public class ZcOrderMain extends BaseEntity @Excel(name = "逾期金额(元)") private BigDecimal overdueFee; + @Excel(name = "逾期计费类型") + private String overdueType; + /** 是否开通免押 */ @Excel(name = "是否开通免押") private Integer isDepositFree; @@ -97,11 +106,27 @@ public class ZcOrderMain extends BaseEntity @Excel(name = "首次下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date firstOrderTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "取车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date pickCarTime; + /** 开始计费时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "开始计费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date startRentTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "预计还车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date endRentTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "申请还车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date reqEndRentTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "实际还车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date actEndRentTime; + /** 逾期天数 */ @Excel(name = "逾期天数") private Long overdueDays; @@ -120,6 +145,14 @@ public class ZcOrderMain extends BaseEntity /** 租电套餐id */ private Long rentBatteyRuleId; + /** 订单总金额 */ + private BigDecimal orderAmount; + /** 订单结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "订单结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date endOrderTime; + + /** 删除标志(0代表存在 2代表删除) */ private String delFlag; @@ -377,36 +410,118 @@ public class ZcOrderMain extends BaseEntity this.licensePlate = licensePlate; } + public Long getCarModelId() { + return carModelId; + } + + public void setCarModelId(Long carModelId) { + this.carModelId = carModelId; + } + + public String getBatteryType() { + return batteryType; + } + + public void setBatteryType(String batteryType) { + this.batteryType = batteryType; + } + + public Date getPickCarTime() { + return pickCarTime; + } + + public void setPickCarTime(Date pickCarTime) { + this.pickCarTime = pickCarTime; + } + + public Date getEndRentTime() { + return endRentTime; + } + + public void setEndRentTime(Date endRentTime) { + this.endRentTime = endRentTime; + } + + public Date getReqEndRentTime() { + return reqEndRentTime; + } + + public void setReqEndRentTime(Date reqEndRentTime) { + this.reqEndRentTime = reqEndRentTime; + } + + public Date getActEndRentTime() { + return actEndRentTime; + } + + public void setActEndRentTime(Date actEndRentTime) { + this.actEndRentTime = actEndRentTime; + } + + public BigDecimal getOrderAmount() { + return orderAmount; + } + + public void setOrderAmount(BigDecimal orderAmount) { + this.orderAmount = orderAmount; + } + + public Date getEndOrderTime() { + return endOrderTime; + } + + public void setEndOrderTime(Date endOrderTime) { + this.endOrderTime = endOrderTime; + } + + public String getOverdueType() { + return overdueType; + } + + public void setOverdueType(String overdueType) { + this.overdueType = overdueType; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("orderId", getOrderId()) - .append("orderNo", getOrderNo()) - .append("orderStatus", getOrderStatus()) - .append("operatorId", getOperatorId()) - .append("storeId", getStoreId()) - .append("vehicleId", getVehicleId()) - .append("customerId", getCustomerId()) - .append("customerName", getCustomerName()) - .append("customerPhone", getCustomerPhone()) - .append("rentalType", getRentalType()) - .append("rentalDays", getRentalDays()) - .append("rentalPrice", getRentalPrice()) - .append("depositPrice", getDepositPrice()) - .append("overdueFee", getOverdueFee()) - .append("isDepositFree", getIsDepositFree()) - .append("isAutoDeduct", getIsAutoDeduct()) - .append("firstOrderTime", getFirstOrderTime()) - .append("startRentTime", getStartRentTime()) - .append("overdueDays", getOverdueDays()) - .append("renewalTimes", getRenewalTimes()) - .append("chargeTimes", getChargeTimes()) - .append("rentCarRuleId", getRentCarRuleId()) - .append("rentBatteyRuleId", getRentBatteyRuleId()) - .append("delFlag", getDelFlag()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .append("zcOrderSubList", getZcOrderSubList()) - .toString(); + return new ToStringBuilder(this) + .append("orderId", orderId) + .append("orderNo", orderNo) + .append("orderStatus", orderStatus) + .append("operatorId", operatorId) + .append("operatorName", operatorName) + .append("storeName", storeName) + .append("storeId", storeId) + .append("licensePlate", licensePlate) + .append("vehicleId", vehicleId) + .append("carModelId", carModelId) + .append("customerId", customerId) + .append("customerName", customerName) + .append("customerPhone", customerPhone) + .append("batteryType", batteryType) + .append("rentalType", rentalType) + .append("rentalDays", rentalDays) + .append("rentalPrice", rentalPrice) + .append("depositPrice", depositPrice) + .append("overdueFee", overdueFee) + .append("overdueType", overdueType) + .append("isDepositFree", isDepositFree) + .append("isAutoDeduct", isAutoDeduct) + .append("firstOrderTime", firstOrderTime) + .append("pickCarTime", pickCarTime) + .append("startRentTime", startRentTime) + .append("endRentTime", endRentTime) + .append("reqEndRentTime", reqEndRentTime) + .append("actEndRentTime", actEndRentTime) + .append("overdueDays", overdueDays) + .append("renewalTimes", renewalTimes) + .append("chargeTimes", chargeTimes) + .append("rentCarRuleId", rentCarRuleId) + .append("rentBatteyRuleId", rentBatteyRuleId) + .append("orderAmount", orderAmount) + .append("endOrderTime", endOrderTime) + .append("delFlag", delFlag) + .append("zcOrderSubList", zcOrderSubList) + .toString(); } } diff --git a/ruoyi-admin/src/main/resources/mapper/operation/ZcRentCarRuleBatteryMapper.xml b/ruoyi-admin/src/main/resources/mapper/operation/ZcRentCarRuleBatteryMapper.xml index b3e2b1a..f1edd18 100644 --- a/ruoyi-admin/src/main/resources/mapper/operation/ZcRentCarRuleBatteryMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/operation/ZcRentCarRuleBatteryMapper.xml @@ -38,7 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + insert into zc_rent_car_rule_battery diff --git a/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderMainMapper.xml b/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderMainMapper.xml index 36e6d75..e29fb07 100644 --- a/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderMainMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderMainMapper.xml @@ -11,23 +11,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + @@ -58,11 +67,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select order_id, order_no, order_status, operator_id, store_id, vehicle_id, customer_id, customer_name, customer_phone, rental_type, rental_days, rental_price, deposit_price, overdue_fee, is_deposit_free, is_auto_deduct, first_order_time, start_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, del_flag, create_time, update_time from zc_order_main + select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, order_amount, end_order_time, del_flag, create_time, update_time from zc_order_main +
-
- - -
+
- +
- +
- +
- +
-
- - -
- +
-
- - -
- +
-
- - -
+
- +
-
+
+
+
+
+ +
+
-