From 96fd9fe05e85c8cdb2c55905c89dbe1e778c348b Mon Sep 17 00:00:00 2001 From: sunhaoyuan <2269400447@qq.com> Date: Thu, 13 Nov 2025 16:47:53 +0800 Subject: [PATCH] 11.13 --- .../controller/admin/RescueInfoSystem.java | 2 ++ .../module/rescue/domain/RescueInfo.java | 36 ++++++++++++++++--- .../mapper/rescue/RescueInfoMapper.xml | 3 +- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java index d3c15b70..b82c1a95 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/controller/admin/RescueInfoSystem.java @@ -221,6 +221,8 @@ public class RescueInfoSystem extends BaseController { rescueInfoIPage.getRecords().forEach(item -> { item.setSetMoneyYuan(Double.valueOf(Optional.ofNullable(item.getSetMoney()).orElse(0L)) / 100); item.setPayMoneyYuan(Double.valueOf(Optional.ofNullable(item.getPayMoney()).orElse(0L)) / 100); + // ⭐ 关键:这里把施救里程数算出来 + item.calcRescueScale(); }); list.addAll(rescueInfoIPage.getRecords()); pageNo++; diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueInfo.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueInfo.java index ce33797e..8a91743c 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueInfo.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/domain/RescueInfo.java @@ -9,10 +9,13 @@ import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import lombok.Data; import javax.validation.constraints.NotEmpty; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.Date; import java.util.List; import java.util.Set; + /** * 【请填写功能名称】对象 rescue_info * @@ -42,7 +45,7 @@ public class RescueInfo extends TenantBaseDO private String licenseNum; @Excel(name = "司机姓名") private String driverName; - @Excel(name = "司机手机号") +// @Excel(name = "司机手机号") private String driverPhoneNum; @Excel(name = "司机车牌号") private String driverCarNum; @@ -65,9 +68,9 @@ public class RescueInfo extends TenantBaseDO @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone="GMT+8") @Excel(name = "救援时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") private Date rescueTime; - @Excel(name = "救援开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") +// @Excel(name = "救援开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") private Date rescueStartTime; - @Excel(name = "救援结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") +// @Excel(name = "救援结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm") private Date rescueEndTime; /** 救援类型 */ @@ -108,7 +111,7 @@ public class RescueInfo extends TenantBaseDO private String carBrand; /** 目的地详细描述 */ - @Excel(name = "目的地") +// @Excel(name = "目的地") private String destinationInfo; /** 目的地经度 */ @@ -129,12 +132,31 @@ public class RescueInfo extends TenantBaseDO @Excel(name = "路段") private String sectionRoad; //开始的公里数 + @Excel(name = "出发里程表") private Double startScale; //结束的公里数 + @Excel(name = "结束里程表") private Double endScale; + // 施救里程数(数据库没有) + @Excel(name = "施救里程数") + @TableField(exist = false) + private Double rescueScale; + // 可选:写个便捷方法专门算这个字段 + public void calcRescueScale() { + if (startScale == null || endScale == null) { + this.rescueScale = null; + return; + } + this.rescueScale = BigDecimal.valueOf(endScale) + .subtract(BigDecimal.valueOf(startScale)) + .setScale(2, RoundingMode.HALF_UP) + .doubleValue(); + } + //放空公里数 private Double emptyNum; //过关费 + @Excel(name = "过关费") private Double checkpointMoney; private Long deptId; @JsonFormat(pattern = "yyyy-MM-dd HH:mm") @@ -299,6 +321,7 @@ public class RescueInfo extends TenantBaseDO /** * 来源 */ + @Excel(name = "来源") private String source; /** @@ -412,18 +435,23 @@ public class RescueInfo extends TenantBaseDO private String orderSigningRealName; @TableField(exist = false) + @Excel(name = "是否确认收款", readConverterExp = "0=否,1=是") private String ifConfirmPay; @TableField(exist = false) + @Excel(name = "收款账号") private String accountNumber; @TableField(exist = false) + @Excel(name = "确认收款人") private String confirmPaymentPersonName; @TableField(exist = false) + @Excel(name = "确认收款时间") private String confirmPaymentTime; @TableField(exist = false) + @Excel(name = "确认收款备注") private String confirmPaymentPersonRemark; @TableField(exist = false) diff --git a/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml b/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml index c37465c8..04662e59 100644 --- a/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml +++ b/dl-module-rescue/src/main/resources/mapper/rescue/RescueInfoMapper.xml @@ -325,6 +325,7 @@ roi.order_signing_charge_name, roi.order_signing_remark, roi.if_confirm_pay, + roi.account_number, roi.confirm_payment_person_name, roi.confirm_payment_time, roi.confirm_payment_person_remark @@ -2059,7 +2060,7 @@ AND ri.rescue_time <= #{endTimeStr} - AND di.driver_type <= #{driverType} + AND di.driver_type = #{driverType} GROUP BY di.id, ri.driver_name