From c946f7a3442c4050ef34fb857341a7b2d948ae6d Mon Sep 17 00:00:00 2001 From: 19173159168 Date: Mon, 25 Aug 2025 22:24:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E7=BB=93=E6=9D=9F=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=EF=BC=9B=E8=BD=A6=E8=BE=86=E6=8A=A5=E6=8D=9F=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ZcCarDamageServiceImpl.java | 18 +- .../com/ruoyi/orders/domain/ZcOrderSub.java | 12 +- .../com/ruoyi/orders/dto/RefundRequest.java | 67 ++++++ .../ruoyi/orders/mapper/ZcOrderSubMapper.java | 1 + .../orders/service/IZcOrderSubService.java | 7 + .../service/impl/ZcOrderMainServiceImpl.java | 218 ++++++++++++++++-- .../service/impl/ZcOrderSubServiceImpl.java | 5 + .../java/com/ruoyi/orders/util/OrderUtil.java | 37 +++ .../src/main/resources/application-dev.yml | 2 + .../mapper/operation/ZcCarDamageMapper.xml | 9 +- .../mapper/orders/ZcOrderMainMapper.xml | 2 +- .../mapper/orders/ZcOrderSubMapper.xml | 6 +- .../operation/carDamage/carDamage.html | 12 +- .../templates/operation/carDamage/edit.html | 85 ++++--- .../templates/orders/order/edit.html | 8 +- 15 files changed, 421 insertions(+), 68 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/orders/dto/RefundRequest.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/orders/util/OrderUtil.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarDamageServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarDamageServiceImpl.java index a2dd74e..4da5f0b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarDamageServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/operation/service/impl/ZcCarDamageServiceImpl.java @@ -2,12 +2,15 @@ package com.ruoyi.operation.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.operation.domain.ZcCar; +import com.ruoyi.operation.service.IZcCarService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.operation.mapper.ZcCarDamageMapper; import com.ruoyi.operation.domain.ZcCarDamage; import com.ruoyi.operation.service.IZcCarDamageService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; /** * 车辆报损记录Service业务层处理 @@ -20,7 +23,8 @@ public class ZcCarDamageServiceImpl implements IZcCarDamageService { @Autowired private ZcCarDamageMapper zcCarDamageMapper; - + @Autowired + private IZcCarService zcCarService; /** * 查询车辆报损记录 * @@ -64,11 +68,21 @@ public class ZcCarDamageServiceImpl implements IZcCarDamageService * @param zcCarDamage 车辆报损记录 * @return 结果 */ + @Transactional @Override public int updateZcCarDamage(ZcCarDamage zcCarDamage) { zcCarDamage.setUpdateTime(DateUtils.getNowDate()); - return zcCarDamageMapper.updateZcCarDamage(zcCarDamage); + zcCarDamage.setAuditTime(DateUtils.getNowDate()); + int flag = zcCarDamageMapper.updateZcCarDamage(zcCarDamage); + if (flag > 0 && "1".equals(zcCarDamage.getDamageStatus().toString()) ) { + // 车辆报损记录审核通过,车辆状态改为下架 + ZcCar zcCar = new ZcCar(); + zcCar.setId(zcCarDamage.getCarId()); + zcCar.setStatus("1"); + zcCarService.changeStatus(zcCar); + } + return flag; } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/orders/domain/ZcOrderSub.java b/ruoyi-admin/src/main/java/com/ruoyi/orders/domain/ZcOrderSub.java index a020a9d..13de065 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/orders/domain/ZcOrderSub.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/orders/domain/ZcOrderSub.java @@ -53,6 +53,8 @@ public class ZcOrderSub extends BaseEntity @Excel(name = "支付ID") private String paymentId; + private String refundId; + /** 实际支付时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "实际支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @@ -155,7 +157,15 @@ public class ZcOrderSub extends BaseEntity this.paidAt = paidAt; } - public Date getPaidAt() + public String getRefundId() { + return refundId; + } + + public void setRefundId(String refundId) { + this.refundId = refundId; + } + + public Date getPaidAt() { return paidAt; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/orders/dto/RefundRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/orders/dto/RefundRequest.java new file mode 100644 index 0000000..97cd97f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/orders/dto/RefundRequest.java @@ -0,0 +1,67 @@ +package com.ruoyi.orders.dto; + +import java.math.BigDecimal; + +/** + * 退款请求数据传输对象 + */ +public class RefundRequest { + private Long companyId; // 公司ID + private String outTradeNo; // 商户订单号 + private String outRefundNo; // 商户退款单号 + private BigDecimal totalFee; // 订单金额(分) + private BigDecimal refundFee; // 退款金额(分) + private String refundDesc; // 退款原因 + + // 构造函数 + public RefundRequest() {} + + // getter和setter方法 + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getOutTradeNo() { + return outTradeNo; + } + + public void setOutTradeNo(String outTradeNo) { + this.outTradeNo = outTradeNo; + } + + public String getOutRefundNo() { + return outRefundNo; + } + + public void setOutRefundNo(String outRefundNo) { + this.outRefundNo = outRefundNo; + } + + public BigDecimal getRefundFee() { + return refundFee; + } + + public void setRefundFee(BigDecimal refundFee) { + this.refundFee = refundFee; + } + + public BigDecimal getTotalFee() { + return totalFee; + } + + public void setTotalFee(BigDecimal totalFee) { + this.totalFee = totalFee; + } + + public String getRefundDesc() { + return refundDesc; + } + + public void setRefundDesc(String refundDesc) { + this.refundDesc = refundDesc; + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/orders/mapper/ZcOrderSubMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/orders/mapper/ZcOrderSubMapper.java index e4f751a..3d8fdb9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/orders/mapper/ZcOrderSubMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/orders/mapper/ZcOrderSubMapper.java @@ -19,6 +19,7 @@ public interface ZcOrderSubMapper */ public ZcOrderSub selectZcOrderSubBySuborderId(Long suborderId); + public ZcOrderSub selectZcOrderSub(ZcOrderSub zcOrderSub); /** * 查询租车子订单列表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/orders/service/IZcOrderSubService.java b/ruoyi-admin/src/main/java/com/ruoyi/orders/service/IZcOrderSubService.java index 55b6407..54234d1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/orders/service/IZcOrderSubService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/orders/service/IZcOrderSubService.java @@ -19,6 +19,13 @@ public interface IZcOrderSubService */ public ZcOrderSub selectZcOrderSubBySuborderId(Long suborderId); + /** + * 查询租车订单 + * + * @param zcOrderSub + * @return 租车子订单 + */ + public ZcOrderSub selectZcOrderSub(ZcOrderSub zcOrderSub); /** * 查询租车子订单列表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/orders/service/impl/ZcOrderMainServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/orders/service/impl/ZcOrderMainServiceImpl.java index 18d6346..5d50391 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/orders/service/impl/ZcOrderMainServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/orders/service/impl/ZcOrderMainServiceImpl.java @@ -1,16 +1,34 @@ package com.ruoyi.orders.service.impl; import java.math.BigDecimal; +import java.util.HashMap; import java.util.List; + import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.operation.domain.ZcCar; import com.ruoyi.operation.service.IZcCarService; import com.ruoyi.operation.util.CarStatusEnum; +import com.ruoyi.orders.dto.RefundRequest; +import com.ruoyi.orders.service.IZcOrderSubService; import com.ruoyi.orders.util.OrderStatusEnum; +import com.ruoyi.orders.util.OrderUtil; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.MediaType; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; + import com.ruoyi.common.utils.StringUtils; import org.springframework.transaction.annotation.Transactional; import com.ruoyi.orders.domain.ZcOrderSub; @@ -28,11 +46,20 @@ import com.ruoyi.common.core.text.Convert; @Service public class ZcOrderMainServiceImpl implements IZcOrderMainService { - @Autowired - private ZcOrderMainMapper zcOrderMainMapper; + private static final Logger logger = LoggerFactory.getLogger(ZcOrderMainServiceImpl.class); + @Autowired + private ZcOrderMainMapper zcOrderMainMapper; + @Autowired + private IZcOrderSubService zcOrderSubService; @Autowired private IZcCarService zcCarService; + @Autowired + private ObjectMapper objectMapper; + + @Value(value = "${pay.refundUrl}") + private String refundUrl; + /** * 查询租车订单 * @@ -125,31 +152,178 @@ public class ZcOrderMainServiceImpl implements IZcOrderMainService @Transactional @Override public int updateManualEndOrder(Long orderId) { - ZcOrderMain queryOrder = zcOrderMainMapper.selectZcOrderMainByOrderId(orderId); - //订单手动结束逻辑待完善 - //1、修改订单状态,2计算逾期费用(如果有逾期),3、释放车辆状态 - //1、修改订单状态 - ZcOrderMain zcOrderMain =new ZcOrderMain(); - zcOrderMain.setOrderId(orderId); - zcOrderMain.setOrderStatus(OrderStatusEnum.MANUAL_END.getCode()); - zcOrderMain.setUpdateBy(ShiroUtils.getSysUser().getLoginName()); - zcOrderMain.setUpdateTime(DateUtils.getNowDate()); - // 2计算逾期费用 - long overdueDays = DateUtils.daysBetween(DateUtils.getNowDate(),queryOrder.getEndRentTime()); - if(overdueDays > 0) { - zcOrderMain.setOverdueDays(overdueDays); - zcOrderMain.setOverdueAmount(zcOrderMain.getOverdueFee().multiply(new BigDecimal(zcOrderMain.getOverdueDays()))); + // 1. 参数校验 + if (orderId == null) { + logger.warn("订单ID不能为空"); + return 0; } - zcOrderMain.setEndOrderTime(DateUtils.getNowDate()); - int flag = zcOrderMainMapper.updateZcOrderMain(zcOrderMain); - if(flag > 0){ - //3释放车辆状态 + + // 2. 查询原订单信息 + ZcOrderMain queryOrder = zcOrderMainMapper.selectZcOrderMainByOrderId(orderId); + if (queryOrder == null) { + logger.warn("未找到订单ID为 {} 的订单", orderId); + return 0; + } + + try { + // 3. 先处理押金退款 + boolean refundSuccess = processDepositRefund(orderId, queryOrder); + if (!refundSuccess) { + logger.error("退款处理失败,订单ID: {}", orderId); + throw new RuntimeException("退款处理失败"); + } + + // 4. 退款成功后,更新订单状态 + ZcOrderMain zcOrderMain = new ZcOrderMain(); + zcOrderMain.setOrderId(orderId); + zcOrderMain.setOrderStatus(OrderStatusEnum.MANUAL_END.getCode()); + zcOrderMain.setUpdateBy(ShiroUtils.getSysUser().getLoginName()); + zcOrderMain.setUpdateTime(DateUtils.getNowDate()); + zcOrderMain.setEndOrderTime(DateUtils.getNowDate()); + + // 5. 计算逾期费用 + long overdueDays = DateUtils.daysBetween(queryOrder.getEndRentTime(), DateUtils.getNowDate()); + if (overdueDays > 0) { + zcOrderMain.setOverdueDays(overdueDays); + zcOrderMain.setOverdueAmount(queryOrder.getOverdueFee().multiply(new BigDecimal(overdueDays))); + } else { + zcOrderMain.setOverdueDays(0L); + zcOrderMain.setOverdueAmount(BigDecimal.ZERO); + } + + // 6. 更新订单状态 + int flag = zcOrderMainMapper.updateZcOrderMain(zcOrderMain); + if (flag <= 0) { + logger.error("更新订单状态失败,订单ID: {}", orderId); + throw new RuntimeException("更新订单状态失败"); + } + + // 7. 释放车辆状态 ZcCar zcCar = new ZcCar(); - zcCar.setId(zcOrderMain.getVehicleId()); + zcCar.setId(queryOrder.getVehicleId()); zcCar.setStatus(CarStatusEnum.CAR_STATUS_0.getCode()); zcCarService.updateZcCar(zcCar); + + logger.info("手动结束订单处理完成,订单ID: {}", orderId); + return flag; + } catch (Exception e) { + logger.error("手动结束订单处理异常,订单ID: " + orderId, e); + throw new RuntimeException("手动结束订单处理失败: " + e.getMessage(), e); + } + } + + /** + * 处理押金退款 + * @param orderId 订单ID + * @param queryOrder 原订单信息 + * @return 退款是否成功 + */ + private boolean processDepositRefund(Long orderId, ZcOrderMain queryOrder) { + // 查询押金子订单 + ZcOrderSub depositSub = new ZcOrderSub(); + depositSub.setOrderId(orderId); + depositSub.setSuborderType(OrderUtil.DEPOSIT); + ZcOrderSub querySub = zcOrderSubService.selectZcOrderSub(depositSub); + + if (querySub != null) { + // 创建退款子订单 + String suborderNo = OrderUtil.generateSubOrderNo(OrderUtil.FD_PREFIX); + + ZcOrderSub refundSub = new ZcOrderSub(); + refundSub.setOrderId(orderId); + refundSub.setSuborderNo(suborderNo); + refundSub.setSuborderType(OrderUtil.FD_DEPOSIT); + // 计算实际退款金额(押金减去逾期费用) + BigDecimal overdueAmount = BigDecimal.ZERO; + long overdueDays = DateUtils.daysBetween(queryOrder.getEndRentTime(), DateUtils.getNowDate()); + if (overdueDays > 0) { + overdueAmount = queryOrder.getOverdueFee().multiply(new BigDecimal(overdueDays)); + } + BigDecimal refundAmount = querySub.getAmount().subtract(overdueAmount); + if (refundAmount.compareTo(BigDecimal.ZERO) < 0) { + refundAmount = BigDecimal.ZERO; + } + refundSub.setAmount(refundAmount); + refundSub.setPaymentMethod(querySub.getPaymentMethod()); + refundSub.setCreatedAt(DateUtils.getNowDate()); + refundSub.setPaymentId(querySub.getPaymentId()); + refundSub.setRefundId(suborderNo); + refundSub.setCreateTime(DateUtils.getNowDate()); + + // 调用退款接口并检查结果 + boolean bool = callRefundApi(querySub, suborderNo, refundAmount, queryOrder.getOperatorId()); + if(bool) { + // 创建退款成功子订单 + zcOrderSubService.insertZcOrderSub(refundSub); + } + return bool; + } + return true; // 如果没有押金子订单,认为退款成功 + } + + /** + * 调用退款接口 + * @param querySub 原始押金子订单 + * @param refundNo 退款单号 + * @param refundAmount 退款金额 + * @param operatorId 运营商ID + * @return 退款是否成功 + */ + private boolean callRefundApi(ZcOrderSub querySub, String refundNo, BigDecimal refundAmount, Long operatorId) { + try { + // 准备退款请求参数 + RefundRequest refundRequest = new RefundRequest(); + refundRequest.setCompanyId(operatorId);// 运营商id + refundRequest.setOutTradeNo(querySub.getPaymentId()); // 子订单押金payment_id + refundRequest.setOutRefundNo(refundNo);// 退款子订单编号 + refundRequest.setRefundDesc("手动结束订单退款");// 退款描述 + refundRequest.setTotalFee(new BigDecimal(0)); + refundRequest.setRefundFee(refundAmount); // 退款金额 + + // 发送HTTP请求调用退款接口 + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + HttpEntity requestEntity = new HttpEntity<>(refundRequest, headers); + + // 打印请求参数便于调试 + String jsonParams = objectMapper.writeValueAsString(refundRequest); + logger.info("退款请求参数: {}", jsonParams); + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity response = restTemplate.postForEntity(refundUrl, requestEntity, String.class); + + // 处理退款接口响应 + if (response.getStatusCode() == HttpStatus.OK) { + // 解析响应内容,检查return_code是否为SUCCESS + String responseBody = response.getBody(); + if (responseBody != null) { + try { + // 使用ObjectMapper解析JSON响应 + Map responseMap = objectMapper.readValue(responseBody, Map.class); + Object returnCode = responseMap.get("return_code"); + if ("SUCCESS".equals(returnCode)) { + logger.info("退款成功,退款单号: {}", refundNo); + return true; + } else { + logger.error("退款失败,退款单号: {},响应: {}", refundNo, responseBody); + return false; + } + } catch (Exception jsonEx) { + logger.error("解析退款接口响应异常,退款单号: {},响应: {}", refundNo, responseBody, jsonEx); + return false; + } + } else { + logger.error("退款接口返回空响应,退款单号: {}", refundNo); + return false; + } + } else { + logger.error("退款失败,退款单号: {},响应: {}", refundNo, response.getBody()); + return false; + } + } catch (Exception e) { + logger.error("调用退款接口异常,退款单号: " + refundNo, e); + return false; } - return flag; } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/orders/service/impl/ZcOrderSubServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/orders/service/impl/ZcOrderSubServiceImpl.java index 2ebb9f6..051718a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/orders/service/impl/ZcOrderSubServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/orders/service/impl/ZcOrderSubServiceImpl.java @@ -33,6 +33,11 @@ public class ZcOrderSubServiceImpl implements IZcOrderSubService return zcOrderSubMapper.selectZcOrderSubBySuborderId(suborderId); } + @Override + public ZcOrderSub selectZcOrderSub(ZcOrderSub zcOrderSub) { + return zcOrderSubMapper.selectZcOrderSub(zcOrderSub); + } + /** * 查询租车子订单列表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/orders/util/OrderUtil.java b/ruoyi-admin/src/main/java/com/ruoyi/orders/util/OrderUtil.java new file mode 100644 index 0000000..1b7e9b8 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/orders/util/OrderUtil.java @@ -0,0 +1,37 @@ +package com.ruoyi.orders.util; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.UUID; + +public class OrderUtil { + + + /** + * 子订单类型suborderType + */ + public static final String RENTCAR= "RENTCAR"; //租车 + public static final String RENTBATTEY= "RENTBATTEY"; //租电 + public static final String DEPOSIT= "DEPOSIT"; //押金 + public static final String FD_DEPOSIT= "FD_DEPOSIT"; //退押金 + + /** 押金订单号前缀 */ + public static final String YJ_PREFIX = "YJ"; + public static final String ZD_PREFIX = "ZD"; + public static final String ZC_PREFIX = "ZC"; + public static final String YQ_PREFIX = "YQ"; + public static final String ZF_PREFIX = "ZF"; + /** 退款订单号前缀 */ + public static final String FD_PREFIX = "FD"; + + /** 生成子订单号用于支付 + * @return 唯一订单号字符串 + */ + public static String generateSubOrderNo(String prefix) { + // 使用时间戳+UUID后缀确保唯一性 + String timestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")); + String uuidSuffix = UUID.randomUUID().toString().replace("-", "").substring(0, 6).toUpperCase(); + return prefix + timestamp + uuidSuffix; // sub代表子订单号 + } + +} diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index 0dcee59..fbc249c 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -83,3 +83,5 @@ renren: expire: 604800 header: token +pay: + refundUrl: http://115.190.8.52:8019/api/payment/refund \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/operation/ZcCarDamageMapper.xml b/ruoyi-admin/src/main/resources/mapper/operation/ZcCarDamageMapper.xml index daa5758..16e5a6e 100644 --- a/ruoyi-admin/src/main/resources/mapper/operation/ZcCarDamageMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/operation/ZcCarDamageMapper.xml @@ -54,7 +54,6 @@ and a.damage_type = #{damageType} and a.damage_reason = #{damageReason} and a.submitter_name like concat('%', #{submitterName}, '%') - and a.submit_time = #{submitTime} and a.damage_status = #{damageStatus} and a.auditor_name like concat('%', #{auditorName}, '%') and a.audit_time = #{auditTime} @@ -64,7 +63,13 @@ and a.extend2 = #{extend2} and a.extend3 = #{extend3} and c.operator_id = #{operatorId} - and c.store_name = #{storeName} + and c.store_name = #{storeName} + + and date_format(a.submit_time,'%y%m%d') >= date_format(#{beginSubmitTime},'%y%m%d') + + + and date_format(a.submit_time,'%y%m%d') <= date_format(#{endSubmitTime},'%y%m%d') + diff --git a/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderMainMapper.xml b/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderMainMapper.xml index 5ecac43..023a264 100644 --- a/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderMainMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderMainMapper.xml @@ -126,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and date_format(a.first_order_time,'%y%m%d') >= date_format(#{params.beginFirstOrderTime},'%y%m%d') - + and date_format(a.first_order_time,'%y%m%d') <= date_format(#{params.endFirstOrderTime},'%y%m%d') diff --git a/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderSubMapper.xml b/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderSubMapper.xml index a1369ba..72d17d9 100644 --- a/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderSubMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/orders/ZcOrderSubMapper.xml @@ -55,7 +55,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where suborder_id = #{suborderId} - + + insert into zc_order_sub diff --git a/ruoyi-admin/src/main/resources/templates/operation/carDamage/carDamage.html b/ruoyi-admin/src/main/resources/templates/operation/carDamage/carDamage.html index 9849b8a..d9a96f5 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/carDamage/carDamage.html +++ b/ruoyi-admin/src/main/resources/templates/operation/carDamage/carDamage.html @@ -43,6 +43,12 @@ +
  • + + + - + +
  •  搜索  重置 @@ -167,8 +173,10 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('审核 '); - actions.push('删除'); + if (row.damageStatus == '0'){ + actions.push('报损审核 '); + } + // actions.push('删除'); return actions.join(''); } }] diff --git a/ruoyi-admin/src/main/resources/templates/operation/carDamage/edit.html b/ruoyi-admin/src/main/resources/templates/operation/carDamage/edit.html index dd2481a..308febe 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/carDamage/edit.html +++ b/ruoyi-admin/src/main/resources/templates/operation/carDamage/edit.html @@ -8,70 +8,85 @@
    - -
    - + +
    +
    - +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    - +
    - +
    - +
    - +
    - - +
    -
    - + + + +
    +
    -
    +
    -
    - +
    +
    - +
    - +
    -
    - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - +
    diff --git a/ruoyi-admin/src/main/resources/templates/orders/order/edit.html b/ruoyi-admin/src/main/resources/templates/orders/order/edit.html index f7d29aa..74ceb0d 100644 --- a/ruoyi-admin/src/main/resources/templates/orders/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/orders/order/edit.html @@ -176,6 +176,7 @@ var suborderTypeDatas = [[${@dict.getType('key_order_suborder_type')}]]; var paymentMethodDatas = [[${@dict.getType('key_order_payment_method')}]]; var imgTypeDatas = [[${@dict.getType('key_order_img_type')}]]; + var payStatusDatas = [[${@dict.getType('key_order_pay_status')}]]; $("#form-order-edit").validate({ focusCleanup: true }); @@ -262,7 +263,10 @@ { field: 'payStatus', align: 'center', - title: '支付状态' + title: '支付状态', + formatter: function(value, row, index) { + return $.table.selectDictLabel(payStatusDatas, value); + } }, { field: 'paidAt', @@ -329,7 +333,7 @@ function manualEndOrder(){ var orderId = $("#orderId").val(); - $.modal.confirm("确认手动结束该订单", function() { + $.modal.confirm("确认手动结束该订单
    请确认车辆是否己归还,如未归还需要进行车辆丢失报损。
    结束此订单不再计算租车费用,己支付租金不做退款。
    ", function() { $.operate.post(prefix + "/manualEndOrder", { "orderId": orderId}, function(result) { if (result.code == web_status.SUCCESS) { $.modal.msgSuccess("操作成功");