ソースを参照

feat(customer):
- 在CustomerDeptTreeVo中添加部门管理相关字段
- 修复CustomerInfoServiceImpl中的部门ID引用错误
- 新增订单发货服务按订单ID查询发货记录功能
- 修改订单统计接口增加用户ID参数支持
- 优化订单分配服务中子订单数量和金额计算逻辑
- 新增订单状态流转记录相关实体、业务对象和服务接口
- 在订单发货服务中添加物流单号查询保护机制
- 新增暂存订单支付类型枚举值
- 优化订单主服务中商品分配信息查询性能
- 在订单支付流程中支持多种支付方式处理

hurx 3 週間 前
コミット
c2ce701de0
27 ファイル変更1057 行追加91 行削除
  1. 6 1
      ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/enums/OrderPayType.java
  2. 7 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/CustomerBusinessInfo.java
  3. 7 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/CustomerBusinessInfoBo.java
  4. 2 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerBusinessInfoVo.java
  5. 4 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerDeptTreeVo.java
  6. 13 3
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerDeptServiceImpl.java
  7. 1 1
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerInfoServiceImpl.java
  8. 2 2
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoServiceImpl.java
  9. 113 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/controller/OrderStatusLogController.java
  10. 6 1
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/controller/pc/PcOrderController.java
  11. 36 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/controller/pc/PcOrderDeliverController.java
  12. 104 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/OrderStatusLog.java
  13. 96 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/bo/OrderStatusLogBo.java
  14. 2 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/vo/OrderProductVo.java
  15. 126 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/vo/OrderStatusLogVo.java
  16. 1 1
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/mapper/OrderMainMapper.java
  17. 16 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/mapper/OrderStatusLogMapper.java
  18. 2 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/IOrderDeliverService.java
  19. 1 1
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/IOrderMainService.java
  20. 79 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/IOrderStatusLogService.java
  21. 30 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderAssignmentServiceImpl.java
  22. 70 30
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderDeliverServiceImpl.java
  23. 167 51
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderMainServiceImpl.java
  24. 157 0
      ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderStatusLogServiceImpl.java
  25. 1 0
      ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMainMapper.xml
  26. 1 0
      ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderProductMapper.xml
  27. 7 0
      ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderStatusLogMapper.xml

+ 6 - 1
ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/enums/OrderPayType.java

@@ -10,7 +10,12 @@ public enum OrderPayType {
     /**
     /**
      * 信用支付
      * 信用支付
      */
      */
-    CREDIT_PAY("0", "信用支付");
+    CREDIT_PAY("0", "信用支付"),
+
+    /**
+     * 暂存订单
+     */
+    TEMP_ORDER("9", "暂存订单");
 
 
     private final String code;
     private final String code;
     private final String info;
     private final String info;

+ 7 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/CustomerBusinessInfo.java

@@ -4,7 +4,9 @@ import org.dromara.common.tenant.core.TenantEntity;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
+
 import java.util.Date;
 import java.util.Date;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 
 
 import java.io.Serial;
 import java.io.Serial;
@@ -84,6 +86,11 @@ public class CustomerBusinessInfo extends TenantEntity {
      */
      */
     private String businessLicense;
     private String businessLicense;
 
 
+    /**
+     * 法人证件路径
+     */
+    private String legalPersonCardUrl;
+
     /**
     /**
      * 工商地址-详细地址
      * 工商地址-详细地址
      */
      */

+ 7 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/CustomerBusinessInfoBo.java

@@ -8,7 +8,9 @@ import io.github.linpeilie.annotations.AutoMapper;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import jakarta.validation.constraints.*;
 import jakarta.validation.constraints.*;
+
 import java.util.Date;
 import java.util.Date;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 
 
 /**
 /**
@@ -82,6 +84,11 @@ public class CustomerBusinessInfoBo extends BaseEntity {
      */
      */
     private String businessLicense;
     private String businessLicense;
 
 
+    /**
+     * 法人证件路径
+     */
+    private String legalPersonCardUrl;
+
     /**
     /**
      * 工商地址-详细地址
      * 工商地址-详细地址
      */
      */

+ 2 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerBusinessInfoVo.java

@@ -103,6 +103,8 @@ public class CustomerBusinessInfoVo implements Serializable {
     @ExcelProperty(value = "营业执照路径")
     @ExcelProperty(value = "营业执照路径")
     private String businessLicense;
     private String businessLicense;
 
 
+    private String legalPersonCardUrl;
+
     /**
     /**
      * 工商地址-详细地址
      * 工商地址-详细地址
      */
      */

+ 4 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/CustomerDeptTreeVo.java

@@ -20,6 +20,10 @@ public class CustomerDeptTreeVo implements Serializable {
     private Long bindAddress;
     private Long bindAddress;
     private String bindAddressStr;
     private String bindAddressStr;
     private String bindStatus;
     private String bindStatus;
+    private Long deptManage;
+    private String isLimit;
+    private BigDecimal recharge;
+    private Long expenseTypeId;
     private String status;      // 来自 sys_dept(启用/停用)
     private String status;      // 来自 sys_dept(启用/停用)
 
 
     // 可选:是否叶子节点(前端有时需要)
     // 可选:是否叶子节点(前端有时需要)

+ 13 - 3
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerDeptServiceImpl.java

@@ -181,6 +181,10 @@ public class CustomerDeptServiceImpl extends ServiceImpl<CustomerDeptMapper, Cus
         vo.setMonthLimit(cd.getMonthLimit());
         vo.setMonthLimit(cd.getMonthLimit());
         vo.setBindAddress(cd.getBindAddress());
         vo.setBindAddress(cd.getBindAddress());
         vo.setBindStatus(cd.getBindStatus());
         vo.setBindStatus(cd.getBindStatus());
+        vo.setDeptManage(cd.getDeptManage());
+        vo.setIsLimit(cd.getIsLimit());
+        vo.setRecharge(cd.getRecharge());
+        vo.setExpenseTypeId(cd.getExpenseTypeId());
 
 
         // 地址拼接(安全处理 null)
         // 地址拼接(安全处理 null)
         CustomerShippingAddressVo addressVo = addressVoMap.get(cd.getBindAddress());
         CustomerShippingAddressVo addressVo = addressVoMap.get(cd.getBindAddress());
@@ -297,12 +301,18 @@ public class CustomerDeptServiceImpl extends ServiceImpl<CustomerDeptMapper, Cus
         }
         }
 
 
         // 设置更新字段(可封装为方法)
         // 设置更新字段(可封装为方法)
-        customerDeptVo.setBindStatus(bo.getBindStatus());
-        customerDeptVo.setBindAddress(bo.getBindAddress());
         customerDeptVo.setStatus(bo.getStatus());
         customerDeptVo.setStatus(bo.getStatus());
         customerDeptVo.setYearlyBudget(bo.getYearlyBudget());
         customerDeptVo.setYearlyBudget(bo.getYearlyBudget());
-        customerDeptVo.setUsedBudget(bo.getUsedBudget());
         customerDeptVo.setMonthLimit(bo.getMonthLimit());
         customerDeptVo.setMonthLimit(bo.getMonthLimit());
+        customerDeptVo.setUsedBudget(bo.getUsedBudget());
+        customerDeptVo.setBindStatus(bo.getBindStatus());
+        customerDeptVo.setBindAddress(bo.getBindAddress());
+        customerDeptVo.setIsLimit(bo.getIsLimit());
+        customerDeptVo.setSelectYear(bo.getSelectYear());
+        customerDeptVo.setExpenseTypeId(bo.getExpenseTypeId());
+        customerDeptVo.setDeptManage(bo.getDeptManage());
+        customerDeptVo.setRecharge(bo.getRecharge());
+        customerDeptVo.setResidueYearlyBudget(bo.getResidueYearlyBudget());
 
 
         // 转换为实体类并更新
         // 转换为实体类并更新
         CustomerDept entity = MapstructUtils.convert(customerDeptVo, CustomerDept.class);
         CustomerDept entity = MapstructUtils.convert(customerDeptVo, CustomerDept.class);

+ 1 - 1
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerInfoServiceImpl.java

@@ -1067,7 +1067,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
 
 
         // 创建系统用户
         // 创建系统用户
         RemoteUserBo remoteUserBo = new RemoteUserBo();
         RemoteUserBo remoteUserBo = new RemoteUserBo();
-        remoteUserBo.setDeptId(deptVo.getDeptId());
+        remoteUserBo.setDeptId(dept.getDeptId());
         remoteUserBo.setUserName(bo.getPurchasePhone());
         remoteUserBo.setUserName(bo.getPurchasePhone());
         remoteUserBo.setNickName(bo.getPurchaseName());
         remoteUserBo.setNickName(bo.getPurchaseName());
         remoteUserBo.setPhonenumber(bo.getPurchasePhone());
         remoteUserBo.setPhonenumber(bo.getPurchasePhone());

+ 2 - 2
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoServiceImpl.java

@@ -1058,8 +1058,8 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
 
 
         if (supplierInfoList != null) {
         if (supplierInfoList != null) {
             supplierInfoList.stream()
             supplierInfoList.stream()
-                .filter(supplier -> supplier.getId() != null && supplier.getSupplierName() != null)
-                .forEach(supplier -> resultMap.put(supplier.getId(), supplier.getSupplierName()));
+                .filter(supplier -> supplier.getId() != null && supplier.getEnterpriseName() != null)
+                .forEach(supplier -> resultMap.put(supplier.getId(), supplier.getEnterpriseName()));
         }
         }
 
 
         return resultMap;
         return resultMap;

+ 113 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/controller/OrderStatusLogController.java

@@ -0,0 +1,113 @@
+package org.dromara.order.controller;
+
+import java.util.List;
+
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.constraints.*;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
+import org.dromara.common.log.annotation.Log;
+import org.dromara.common.web.core.BaseController;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.excel.utils.ExcelUtil;
+import org.dromara.order.domain.vo.OrderStatusLogVo;
+import org.dromara.order.domain.bo.OrderStatusLogBo;
+import org.dromara.order.service.IOrderStatusLogService;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+/**
+ * 订单状态流转记录
+ * 前端访问路由地址为:/order/orderStatusLog
+ *
+ * @author LionLi
+ * @date 2026-03-23
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/orderStatusLog")
+public class OrderStatusLogController extends BaseController {
+
+    private final IOrderStatusLogService orderStatusLogService;
+
+    /**
+     * 查询订单状态流转记录列表
+     */
+    //@SaCheckPermission("order:orderStatusLog:list")
+    @GetMapping("/list")
+    public TableDataInfo<OrderStatusLogVo> list(OrderStatusLogBo bo, PageQuery pageQuery) {
+        return orderStatusLogService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出订单状态流转记录列表
+     */
+    //@SaCheckPermission("order:orderStatusLog:export")
+    @Log(title = "订单状态流转记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(OrderStatusLogBo bo, HttpServletResponse response) {
+        List<OrderStatusLogVo> list = orderStatusLogService.queryList(bo);
+        ExcelUtil.exportExcel(list, "订单状态流转记录", OrderStatusLogVo.class, response);
+    }
+
+    /**
+     * 获取订单状态流转记录详细信息
+     *
+     * @param id 主键
+     */
+    //@SaCheckPermission("order:orderStatusLog:query")
+    @GetMapping("/{id}")
+    public R<OrderStatusLogVo> getInfo(@NotNull(message = "主键不能为空")
+                                       @PathVariable("id") Long id) {
+        return R.ok(orderStatusLogService.queryById(id));
+    }
+
+    /**
+     * 新增订单状态流转记录
+     */
+    //@SaCheckPermission("order:orderStatusLog:add")
+    @Log(title = "订单状态流转记录", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody OrderStatusLogBo bo) {
+        return toAjax(orderStatusLogService.insertByBo(bo));
+    }
+
+    /**
+     * 修改订单状态流转记录
+     */
+    //@SaCheckPermission("order:orderStatusLog:edit")
+    @Log(title = "订单状态流转记录", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody OrderStatusLogBo bo) {
+        return toAjax(orderStatusLogService.updateByBo(bo));
+    }
+
+    /**
+     * 删除订单状态流转记录
+     *
+     * @param ids 主键串
+     */
+    //@SaCheckPermission("order:orderStatusLog:remove")
+    @Log(title = "订单状态流转记录", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable("ids") Long[] ids) {
+        return toAjax(orderStatusLogService.deleteWithValidByIds(List.of(ids), true));
+    }
+
+    @Log(title = "订单状态流转记录", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping("/selectNewOne")
+    public R<OrderStatusLogVo> selectNewOne(@Validated(AddGroup.class) @RequestBody OrderStatusLogBo bo) {
+        return R.ok(orderStatusLogService.selectNewOne(bo));
+    }
+}

+ 6 - 1
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/controller/pc/PcOrderController.java

@@ -92,8 +92,11 @@ public class PcOrderController extends BaseController {
     public TableDataInfo<OrderMainVo> list(OrderMainBo bo, PageQuery pageQuery) {
     public TableDataInfo<OrderMainVo> list(OrderMainBo bo, PageQuery pageQuery) {
         // 获取当前登录用户的企业ID
         // 获取当前登录用户的企业ID
         Long customerId = LoginHelper.getLoginUser().getCustomerId();
         Long customerId = LoginHelper.getLoginUser().getCustomerId();
+
+        Long userId = LoginHelper.getLoginUser().getUserId();
         // 强制设置企业ID,防止越权访问
         // 强制设置企业ID,防止越权访问
         bo.setCustomerId(customerId);
         bo.setCustomerId(customerId);
+        bo.setUserId(userId);
         bo.setIsSplitChild(SysPlatformYesNo.NO.getCode());
         bo.setIsSplitChild(SysPlatformYesNo.NO.getCode());
 
 
         return orderMainService.queryPageList(bo, pageQuery);
         return orderMainService.queryPageList(bo, pageQuery);
@@ -103,7 +106,9 @@ public class PcOrderController extends BaseController {
     public R<OrderCountVo> countOrder() {
     public R<OrderCountVo> countOrder() {
         // 获取当前登录用户的企业ID
         // 获取当前登录用户的企业ID
         Long customerId = LoginHelper.getLoginUser().getCustomerId();
         Long customerId = LoginHelper.getLoginUser().getCustomerId();
-        return R.ok(orderMainService.countOrderNum(customerId));
+
+        Long userId = LoginHelper.getLoginUser().getUserId();
+        return R.ok(orderMainService.countOrderNum(customerId, userId));
     }
     }
 
 
     /**
     /**

+ 36 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/controller/pc/PcOrderDeliverController.java

@@ -0,0 +1,36 @@
+package org.dromara.order.controller.pc;
+
+import lombok.RequiredArgsConstructor;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.order.domain.bo.OrderDeliverBo;
+import org.dromara.order.domain.vo.OrderDeliverVo;
+import org.dromara.order.service.IOrderDeliverService;
+import org.dromara.order.utils.kd100.domain.TrackVO;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/pcOrderDeliver")
+public class PcOrderDeliverController {
+
+    private final IOrderDeliverService orderDeliverService;
+
+    @GetMapping("/selectOrderDeliverByOrderId")
+    public TableDataInfo<OrderDeliverVo> list(OrderDeliverBo bo) {
+        return orderDeliverService.selectOrderDeliverByOrderId(bo.getOrderId());
+    }
+
+    /**
+     * 查询订单物流信息列表
+     */
+    @GetMapping("/queryTrack")
+    public TrackVO queryTrack(OrderDeliverBo bo) {
+        return orderDeliverService.queryTrack(bo);
+    }
+}

+ 104 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/OrderStatusLog.java

@@ -0,0 +1,104 @@
+package org.dromara.order.domain;
+
+import org.dromara.common.tenant.core.TenantEntity;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.dromara.common.translation.annotation.Translation;
+import org.dromara.common.translation.constant.TransConstant;
+
+import java.io.Serial;
+
+/**
+ * 订单状态流转记录对象 order_status_log
+ *
+ * @author LionLi
+ * @date 2026-03-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("order_status_log")
+public class OrderStatusLog extends TenantEntity {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+
+    /**
+     * 订单ID (关联订单主表)
+     */
+    private Long orderId;
+
+    /**
+     * 客户编号
+     */
+    private String customerNo;
+
+    /**
+     * 客户ID (关联客户主表)
+     */
+    private Long customerId;
+
+    /**
+     * 状态类型(发货方式)
+     */
+    private String deliverMethod;
+
+    /**
+     * 状态名称
+     */
+    private String statusName;
+
+    /**
+     * 驳回原因
+     */
+    private String turnDown;
+
+    /**
+     * 图片路径 (多张逗号分隔或JSON)
+     */
+    private String images;
+
+    /**
+     * 物流单号
+     */
+    private String logisticNos;
+
+    /**
+     * 下一审批人
+     */
+    private String nextApprover;
+
+    /**
+     * 是否审批流程中 (1:否, 0:是)
+     */
+    private String isApprovalProcess;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    private String status;
+
+    /**
+     * 删除标志(0代表存在 2代表删除)
+     */
+    @TableLogic
+    private String delFlag;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 96 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/bo/OrderStatusLogBo.java

@@ -0,0 +1,96 @@
+package org.dromara.order.domain.bo;
+
+import org.dromara.order.domain.OrderStatusLog;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import jakarta.validation.constraints.*;
+import org.dromara.common.translation.annotation.Translation;
+import org.dromara.common.translation.constant.TransConstant;
+
+/**
+ * 订单状态流转记录业务对象 order_status_log
+ *
+ * @author LionLi
+ * @date 2026-03-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = OrderStatusLog.class, reverseConvertGenerate = false)
+public class OrderStatusLogBo extends BaseEntity {
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+
+    /**
+     * 订单ID (关联订单主表)
+     */
+    private Long orderId;
+
+    /**
+     * 客户编号
+     */
+    private String customerNo;
+
+    /**
+     * 客户ID (关联客户主表)
+     */
+    private Long customerId;
+
+    /**
+     * 状态类型(发货方式)
+     */
+    private String deliverMethod;
+
+    /**
+     * 状态名称
+     */
+    private String statusName;
+
+    /**
+     * 驳回原因
+     */
+    private String turnDown;
+
+    /**
+     * 图片路径 (多张逗号分隔或JSON)
+     */
+    private String images;
+
+    /**
+     * 物流单号
+     */
+    private String logisticNos;
+
+    /**
+     * 下一审批人
+     */
+    private String nextApprover;
+
+    /**
+     * 是否审批流程中 (1:否, 0:是)
+     */
+    private String isApprovalProcess;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    private String status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 2 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/vo/OrderProductVo.java

@@ -241,5 +241,7 @@ public class OrderProductVo implements Serializable {
     //品牌名称
     //品牌名称
     private String brandName;
     private String brandName;
 
 
+    private String assigneeName;
+
 
 
 }
 }

+ 126 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/domain/vo/OrderStatusLogVo.java

@@ -0,0 +1,126 @@
+package org.dromara.order.domain.vo;
+
+import org.dromara.common.translation.annotation.Translation;
+import org.dromara.common.translation.constant.TransConstant;
+import org.dromara.order.domain.OrderStatusLog;
+import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
+import cn.idev.excel.annotation.ExcelProperty;
+import org.dromara.common.excel.annotation.ExcelDictFormat;
+import org.dromara.common.excel.convert.ExcelDictConvert;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+
+
+/**
+ * 订单状态流转记录视图对象 order_status_log
+ *
+ * @author LionLi
+ * @date 2026-03-23
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = OrderStatusLog.class)
+public class OrderStatusLogVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @ExcelProperty(value = "主键ID")
+    private Long id;
+
+    /**
+     * 订单编号
+     */
+    @ExcelProperty(value = "订单编号")
+    private String orderNo;
+
+    /**
+     * 订单ID (关联订单主表)
+     */
+    @ExcelProperty(value = "订单ID (关联订单主表)")
+    private Long orderId;
+
+    /**
+     * 客户编号
+     */
+    @ExcelProperty(value = "客户编号")
+    private String customerNo;
+
+    /**
+     * 客户ID (关联客户主表)
+     */
+    @ExcelProperty(value = "客户ID (关联客户主表)")
+    private Long customerId;
+
+    /**
+     * 状态类型(发货方式)
+     */
+    @ExcelProperty(value = "状态类型(发货方式)", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(dictType = "deliver_method")
+    private String deliverMethod;
+
+    /**
+     * 状态名称
+     */
+    @ExcelProperty(value = "状态名称")
+    private String statusName;
+
+    /**
+     * 驳回原因
+     */
+    @ExcelProperty(value = "驳回原因")
+    private String turnDown;
+
+    /**
+     * 图片路径 (多张逗号分隔或JSON)
+     */
+    @ExcelProperty(value = "图片路径 (多张逗号分隔或JSON)")
+    private String images;
+
+    /**
+     * 图片路径 (多张逗号分隔或JSON)Url
+     */
+    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "images")
+    private String imagesUrl;
+    /**
+     * 物流单号
+     */
+    @ExcelProperty(value = "物流单号")
+    private String logisticNos;
+
+    /**
+     * 下一审批人
+     */
+    @ExcelProperty(value = "下一审批人")
+    private String nextApprover;
+
+    /**
+     * 是否审批流程中 (1:否, 0:是)
+     */
+    @ExcelProperty(value = "是否审批流程中 (1:否, 0:是)", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(dictType = "sys_platform_yes_no")
+    private String isApprovalProcess;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+
+}

+ 1 - 1
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/mapper/OrderMainMapper.java

@@ -26,7 +26,7 @@ public interface OrderMainMapper extends BaseMapperPlus<OrderMain, OrderMainVo>
      * @param customerId 客户ID
      * @param customerId 客户ID
      * @return 订单统计VO
      * @return 订单统计VO
      */
      */
-    OrderCountVo countOrderNum(@Param("customerId") Long customerId);
+    OrderCountVo countOrderNum(@Param("customerId") Long customerId, @Param("userId") Long userId);
 
 
     /**
     /**
      * 查询客户的所有已完成订单(主信息 + 评价状态)
      * 查询客户的所有已完成订单(主信息 + 评价状态)

+ 16 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/mapper/OrderStatusLogMapper.java

@@ -0,0 +1,16 @@
+package org.dromara.order.mapper;
+
+import org.apache.ibatis.annotations.Select;
+import org.dromara.order.domain.OrderStatusLog;
+import org.dromara.order.domain.vo.OrderStatusLogVo;
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+
+/**
+ * 订单状态流转记录Mapper接口
+ *
+ * @author LionLi
+ * @date 2026-03-23
+ */
+public interface OrderStatusLogMapper extends BaseMapperPlus<OrderStatusLog, OrderStatusLogVo> {
+
+}

+ 2 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/IOrderDeliverService.java

@@ -39,6 +39,8 @@ public interface IOrderDeliverService extends IService<OrderDeliver> {
      */
      */
     TableDataInfo<OrderDeliverVo> queryPageList(OrderDeliverBo bo, PageQuery pageQuery);
     TableDataInfo<OrderDeliverVo> queryPageList(OrderDeliverBo bo, PageQuery pageQuery);
 
 
+    TableDataInfo<OrderDeliverVo> selectOrderDeliverByOrderId(Long orderId);
+
 
 
     /**
     /**
      * 查询订单发货物流信息
      * 查询订单发货物流信息

+ 1 - 1
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/IOrderMainService.java

@@ -41,7 +41,7 @@ public interface IOrderMainService extends IService<OrderMain> {
      */
      */
     TableDataInfo<OrderMainVo> queryPageList(OrderMainBo bo, PageQuery pageQuery);
     TableDataInfo<OrderMainVo> queryPageList(OrderMainBo bo, PageQuery pageQuery);
 
 
-    OrderCountVo countOrderNum(Long customerId);
+    OrderCountVo countOrderNum(Long customerId, Long userId);
 
 
     /**
     /**
      * 查询符合条件的订单主信息列表
      * 查询符合条件的订单主信息列表

+ 79 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/IOrderStatusLogService.java

@@ -0,0 +1,79 @@
+package org.dromara.order.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.dromara.order.domain.OrderStatusLog;
+import org.dromara.order.domain.vo.OrderStatusLogVo;
+import org.dromara.order.domain.bo.OrderStatusLogBo;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 订单状态流转记录Service接口
+ *
+ * @author LionLi
+ * @date 2026-03-23
+ */
+public interface IOrderStatusLogService extends IService<OrderStatusLog> {
+
+    /**
+     * 查询订单状态流转记录
+     *
+     * @param id 主键
+     * @return 订单状态流转记录
+     */
+    OrderStatusLogVo queryById(Long id);
+
+    /**
+     * 分页查询订单状态流转记录列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 订单状态流转记录分页列表
+     */
+    TableDataInfo<OrderStatusLogVo> queryPageList(OrderStatusLogBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的订单状态流转记录列表
+     *
+     * @param bo 查询条件
+     * @return 订单状态流转记录列表
+     */
+    List<OrderStatusLogVo> queryList(OrderStatusLogBo bo);
+
+    /**
+     * 新增订单状态流转记录
+     *
+     * @param bo 订单状态流转记录
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(OrderStatusLogBo bo);
+
+    /**
+     * 修改订单状态流转记录
+     *
+     * @param bo 订单状态流转记录
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(OrderStatusLogBo bo);
+
+
+    /**
+     * 查询最新一条订单状态流转记录
+     *
+     * @param bo 订单状态流转记录
+     * @return 订单状态流转记录
+     */
+    OrderStatusLogVo selectNewOne(OrderStatusLogBo bo);
+
+    /**
+     * 校验并批量删除订单状态流转记录信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 30 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderAssignmentServiceImpl.java

@@ -300,8 +300,38 @@ public class OrderAssignmentServiceImpl extends ServiceImpl<OrderAssignmentMappe
             AssigneeKey key = entry.getKey();
             AssigneeKey key = entry.getKey();
             List<OrderProductAssignRule> groupRules = entry.getValue();
             List<OrderProductAssignRule> groupRules = entry.getValue();
 
 
+            //新增变量,用于累加当前子订单的商品总数量
+            long childTotalQuantity = 0L;
+            BigDecimal childTotalAmount = BigDecimal.ZERO; // 初始化金额为 0
+
+            //子订单商品数量 因为是整行分配,直接累加父商品行的 orderQuantity 即可
+            for (OrderProductAssignRule rule : groupRules) {
+                OrderProduct parentItem = itemMap.get(rule.getItemId());
+                if (parentItem != null) {
+                    // 累加数量
+                    if (parentItem.getOrderQuantity() != null) {
+                        childTotalQuantity += parentItem.getOrderQuantity();
+                    }
+                    // 累加金额 (通常使用 subtotal 小计,如果没有则用 orderPrice * quantity)
+                    if (parentItem.getSubtotal() != null) {
+                        childTotalAmount = childTotalAmount.add(parentItem.getSubtotal());
+                    } else if (parentItem.getOrderPrice() != null && parentItem.getOrderQuantity() != null) {
+                        // 兜底计算:单价 * 数量
+                        childTotalAmount = childTotalAmount.add(
+                            parentItem.getOrderPrice().multiply(new BigDecimal(parentItem.getOrderQuantity()))
+                        );
+                    }
+                }
+            }
+
             // 创建子订单(从主订单拷贝必要字段)
             // 创建子订单(从主订单拷贝必要字段)
             OrderMain childOrder = copyParentToChild(parentOrder, key.id(), key.type());
             OrderMain childOrder = copyParentToChild(parentOrder, key.id(), key.type());
+
+            // 用刚才累加的正确数量,覆盖掉从父订单继承的数量
+            childOrder.setProductQuantity(childTotalQuantity);
+            childOrder.setTotalAmount(childTotalAmount);      // 修正总金额
+            childOrder.setPayableAmount(childTotalAmount);
+
             orderMainMapper.insert(childOrder);
             orderMainMapper.insert(childOrder);
             Long childOrderId = childOrder.getId();
             Long childOrderId = childOrder.getId();
 
 

+ 70 - 30
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderDeliverServiceImpl.java

@@ -13,6 +13,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.common.core.enums.OrderStatus;
 import org.dromara.common.core.enums.OrderStatus;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.ObjectUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -21,15 +22,15 @@ import org.dromara.customer.api.RemoteCustomerService;
 import org.dromara.order.domain.OrderDeliver;
 import org.dromara.order.domain.OrderDeliver;
 import org.dromara.order.domain.OrderDeliverProduct;
 import org.dromara.order.domain.OrderDeliverProduct;
 import org.dromara.order.domain.OrderMain;
 import org.dromara.order.domain.OrderMain;
+import org.dromara.order.domain.OrderStatusLog;
 import org.dromara.order.domain.bo.OrderDeliverBo;
 import org.dromara.order.domain.bo.OrderDeliverBo;
 import org.dromara.order.domain.bo.OrderDeliverProductBo;
 import org.dromara.order.domain.bo.OrderDeliverProductBo;
+import org.dromara.order.domain.bo.OrderStatusLogBo;
 import org.dromara.order.domain.vo.OrderDeliverProductVo;
 import org.dromara.order.domain.vo.OrderDeliverProductVo;
 import org.dromara.order.domain.vo.OrderDeliverVo;
 import org.dromara.order.domain.vo.OrderDeliverVo;
+import org.dromara.order.domain.vo.OrderMainVo;
 import org.dromara.order.domain.vo.OrderQuantitySummary;
 import org.dromara.order.domain.vo.OrderQuantitySummary;
-import org.dromara.order.mapper.OrderDeliverMapper;
-import org.dromara.order.mapper.OrderDeliverProductMapper;
-import org.dromara.order.mapper.OrderMainMapper;
-import org.dromara.order.mapper.OrderProductMapper;
+import org.dromara.order.mapper.*;
 import org.dromara.order.service.IOrderDeliverService;
 import org.dromara.order.service.IOrderDeliverService;
 import org.dromara.order.utils.kd100.Kd100Util;
 import org.dromara.order.utils.kd100.Kd100Util;
 import org.dromara.order.utils.kd100.domain.QueryTrackDTO;
 import org.dromara.order.utils.kd100.domain.QueryTrackDTO;
@@ -67,8 +68,11 @@ public class OrderDeliverServiceImpl extends ServiceImpl<OrderDeliverMapper, Ord
 
 
     private final OrderMainMapper orderMainMapper;
     private final OrderMainMapper orderMainMapper;
 
 
+
     private final OrderProductMapper orderProductMapper;
     private final OrderProductMapper orderProductMapper;
 
 
+    private final OrderStatusLogMapper orderStatusLogMapper;
+
     private final OrderDeliverProductMapper orderDeliverProductMapper;
     private final OrderDeliverProductMapper orderDeliverProductMapper;
 
 
     /**
     /**
@@ -100,31 +104,59 @@ public class OrderDeliverServiceImpl extends ServiceImpl<OrderDeliverMapper, Ord
     }
     }
 
 
     @Override
     @Override
-    public TrackVO queryTrack(OrderDeliverBo bo) {
+    public TableDataInfo<OrderDeliverVo> selectOrderDeliverByOrderId(Long orderId) {
+        if (orderId == null) {
+            return TableDataInfo.build(new ArrayList<>());
+        }
 
 
-        // 1. 参数校验
-        if (!StringUtils.isNotBlank(bo.getLogisticNo())) {
-            log.warn("物流单号不能为空,bo={}", bo);
-            throw new IllegalArgumentException("物流单号不能为空");
+        // 1. 构建查询订单ID的条件:当前订单ID 或 父订单ID为当前订单ID
+        List<Long> targetOrderIds = orderMainMapper.selectObjs(
+            new LambdaQueryWrapper<OrderMain>()
+                .select(OrderMain::getId) // 只查询ID字段,减少网络传输
+                .and(wrapper -> wrapper
+                    .eq(OrderMain::getId, orderId) // 自己是父订单
+                    .or()
+                    .eq(OrderMain::getParentOrderId, orderId) // 或者是该父订单的子订单
+                )
+        ).stream().map(obj -> (Long) obj).collect(Collectors.toList());
+
+        if (CollectionUtils.isEmpty(targetOrderIds)) {
+            return TableDataInfo.build(new ArrayList<>());
         }
         }
 
 
-        // 2. 构建查询 DTO
-        QueryTrackDTO dto = QueryTrackDTO.builder()
-            .com(bo.getLogisticsCompanyCode())
-            .num(bo.getLogisticNo())
-            .phone(bo.getPhone())
-            .build();
+        // 2. 查询发货记录
+        List<OrderDeliverVo> orderDeliverVos = baseMapper.selectVoList(
+            new LambdaQueryWrapper<OrderDeliver>()
+                .in(OrderDeliver::getOrderId, targetOrderIds)
+        );
 
 
-        // 3. 调用物流查询
-        try {
-            log.info("开始查询物流信息,单号: {}, 公司代码: {}", dto.getNum(), dto.getCom());
-            TrackVO trackVO = Kd100Util.queryTrack(dto);
-            return trackVO;
+        return TableDataInfo.build(orderDeliverVos);
+    }
 
 
-        } catch (Exception e) {
-            log.error("查询物流信息失败,dto={}", dto, e);
-            throw new ServiceException("物流信息查询失败,请稍后重试");
+    @Override
+    public TrackVO queryTrack(OrderDeliverBo bo) {
+        TrackVO trackVO = null;
+        // 1. 参数校验
+        if (StringUtils.isNotBlank(bo.getLogisticNo())) {
+            // 2. 构建查询 DTO
+            QueryTrackDTO dto = QueryTrackDTO.builder()
+                .com(bo.getLogisticsCompanyCode())
+                .num(bo.getLogisticNo())
+                .phone(bo.getPhone())
+                .build();
+
+            // 3. 调用物流查询
+            try {
+                log.info("开始查询物流信息,单号: {}, 公司代码: {}", dto.getNum(), dto.getCom());
+                trackVO = Kd100Util.queryTrack(dto);
+                return trackVO;
+
+            } catch (Exception e) {
+                log.error("查询物流信息失败,dto={}", dto, e);
+                throw new ServiceException("物流信息查询失败,请稍后重试");
+            }
         }
         }
+        return trackVO;
     }
     }
 
 
     /**
     /**
@@ -194,9 +226,6 @@ public class OrderDeliverServiceImpl extends ServiceImpl<OrderDeliverMapper, Ord
                 throw new RuntimeException("订单不存在: " + orderId);
                 throw new RuntimeException("订单不存在: " + orderId);
             }
             }
 
 
-            // 获取当前的已发货数量 (假设订单主表有 delivered_qty 字段)
-            // 如果你的架构是查 OrderProduct 汇总表,请确保那个汇总表也是实时准确的
-            // 强烈建议:订单主表 OrderMain 应该有一个 delivered_total_qty 字段
             Long currentDeliveredQty = orderMain.getQuantityShipped().longValue();
             Long currentDeliveredQty = orderMain.getQuantityShipped().longValue();
             if (currentDeliveredQty == null) currentDeliveredQty = 0L;
             if (currentDeliveredQty == null) currentDeliveredQty = 0L;
 
 
@@ -269,6 +298,17 @@ public class OrderDeliverServiceImpl extends ServiceImpl<OrderDeliverMapper, Ord
                 }
                 }
             }
             }
 
 
+            if ("0".equals(bo.getDeliverMethod())) {
+                OrderStatusLog orderStatusLog = new OrderStatusLog();
+                orderStatusLog.setOrderNo(orderMain.getOrderNo());
+                orderStatusLog.setOrderId(orderMain.getId());
+                orderStatusLog.setCustomerId(orderMain.getCustomerId());
+                orderStatusLog.setStatusName("已下单");
+                orderStatusLog.setDeliverMethod("0");
+                orderStatusLog.setLogisticNos(deliver.getLogisticNo());
+                orderStatusLogMapper.insert(orderStatusLog);
+            }
+
             log.info("新增订单发货单成功:{}, 订单新状态:{}", bo.getId(), newStatus);
             log.info("新增订单发货单成功:{}, 订单新状态:{}", bo.getId(), newStatus);
             return true;
             return true;
 
 
@@ -354,10 +394,10 @@ public class OrderDeliverServiceImpl extends ServiceImpl<OrderDeliverMapper, Ord
             validEntityBeforeSave(update);
             validEntityBeforeSave(update);
             boolean flag = baseMapper.updateById(update) > 0;
             boolean flag = baseMapper.updateById(update) > 0;
 
 
-            if (flag) {
-                // 保存商品明细(编辑时先删除再新增)
-                saveOrderDeliverProducts(bo.getId(), bo.getOrderDeliverProducts(), true);
-            }
+//            if (flag) {
+//                // 保存商品明细(编辑时先删除再新增)
+//                saveOrderDeliverProducts(bo.getId(), bo.getOrderDeliverProducts(), true);
+//            }
             log.info("修改订单发货主成功:{}", bo.getId());
             log.info("修改订单发货主成功:{}", bo.getId());
             return flag;
             return flag;
         } catch (Exception e) {
         } catch (Exception e) {

+ 167 - 51
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderMainServiceImpl.java

@@ -11,17 +11,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.dromara.common.core.enums.AssigneeTypeConstants;
 import org.dromara.common.core.enums.OrderPayType;
 import org.dromara.common.core.enums.OrderPayType;
 import org.dromara.common.core.enums.OrderStatus;
 import org.dromara.common.core.enums.OrderStatus;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.exception.api.ZhongcheException;
 import org.dromara.common.core.exception.api.ZhongcheException;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.ObjectUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.redis.utils.SequenceUtils;
 import org.dromara.common.redis.utils.SequenceUtils;
 import org.dromara.customer.api.RemoteCustomerSalesService;
 import org.dromara.customer.api.RemoteCustomerSalesService;
 import org.dromara.customer.api.RemoteCustomerService;
 import org.dromara.customer.api.RemoteCustomerService;
+import org.dromara.customer.api.RemotePartnerInfoService;
+import org.dromara.customer.api.RemoteSupplierInfoService;
 import org.dromara.customer.api.domain.vo.RemoteCustomerSalesVo;
 import org.dromara.customer.api.domain.vo.RemoteCustomerSalesVo;
 import org.dromara.external.api.zhongche.RemoteZhongChePullService;
 import org.dromara.external.api.zhongche.RemoteZhongChePullService;
 import org.dromara.external.api.zhongche.domain.bo.OrderConfirmBo;
 import org.dromara.external.api.zhongche.domain.bo.OrderConfirmBo;
@@ -44,6 +48,7 @@ import org.dromara.order.utils.kd100.domain.TrackData;
 import org.dromara.order.utils.kd100.domain.TrackVO;
 import org.dromara.order.utils.kd100.domain.TrackVO;
 import org.dromara.product.api.RemoteProductShoppingCartService;
 import org.dromara.product.api.RemoteProductShoppingCartService;
 import org.dromara.system.api.*;
 import org.dromara.system.api.*;
+import org.dromara.system.api.model.LoginUser;
 import org.mybatis.spring.MyBatisSystemException;
 import org.mybatis.spring.MyBatisSystemException;
 import org.springframework.dao.DuplicateKeyException;
 import org.springframework.dao.DuplicateKeyException;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -75,6 +80,12 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
     @DubboReference
     @DubboReference
     private RemoteCustomerService remoteCustomerService;
     private RemoteCustomerService remoteCustomerService;
 
 
+    @DubboReference
+    private RemoteSupplierInfoService remoteSupplierInfoService;
+
+    @DubboReference
+    private RemotePartnerInfoService remotePartnerInfoService;
+
     @DubboReference
     @DubboReference
     private RemoteCustomerSalesService remoteCustomerSalesService;
     private RemoteCustomerSalesService remoteCustomerSalesService;
 
 
@@ -131,7 +142,77 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
 
 
         // 2. 查询关联的商品列表--并且查询商品已发货数量与未发货数量
         // 2. 查询关联的商品列表--并且查询商品已发货数量与未发货数量
         List<OrderProductVo> orderProductVoList = orderProductMapper.selectProductsWithDelivered(orderMainVo.getId());
         List<OrderProductVo> orderProductVoList = orderProductMapper.selectProductsWithDelivered(orderMainVo.getId());
+        if (orderProductVoList != null && !orderProductVoList.isEmpty()) {
+            // 2. 收集所有需要处理的 childOrderId (去重)
+            List<Long> childOrderIds = orderProductVoList.stream()
+                .map(OrderProductVo::getAssignedChildOrderId)
+                .filter(Objects::nonNull)
+                .distinct()
+                .collect(Collectors.toList());
+
+            if (!childOrderIds.isEmpty()) {
+                // 3. 批量查询子订单信息 (避免 N+1 数据库查询)
+                List<OrderMainVo> childOrderList = baseMapper.selectVoByIds(childOrderIds);
+
+                // 将子订单放入 Map 方便快速查找: Key = childOrderId, Value = OrderMainVo
+                Map<Long, OrderMainVo> childOrderMap = childOrderList.stream()
+                    .collect(Collectors.toMap(OrderMainVo::getId, Function.identity(), (k1, k2) -> k1));
+
+                // 4. 按分配类型分组收集 ID,准备批量调用远程服务
+                List<Long> customerIds = new ArrayList<>();
+                List<Long> supplierIds = new ArrayList<>();
+                List<Long> partnerIds = new ArrayList<>();
+
+                for (OrderMainVo childOrder : childOrderList) {
+                    if (childOrder.getAssigneeId() == null) continue;
+
+                    String type = childOrder.getAssigneeType();
+                    if (AssigneeTypeConstants.CUSTOMER.getCode().equals(type)) {
+                        customerIds.add(childOrder.getAssigneeId());
+                    } else if (AssigneeTypeConstants.SUPPLIER.getCode().equals(type)) {
+                        supplierIds.add(childOrder.getAssigneeId());
+                    } else if (AssigneeTypeConstants.PARTNER.getCode().equals(type)) {
+                        partnerIds.add(childOrder.getAssigneeId());
+                    }
+                }
+
+                // 5. 【优化点3】批量调用远程服务 (每种类型只调用一次)
+                Map<Long, String> customerNameMap = Collections.emptyMap();
+                Map<Long, String> supplierNameMap = Collections.emptyMap();
+                Map<Long, String> partnerNameMap = Collections.emptyMap();
+
+                if (!customerIds.isEmpty()) {
+                    customerNameMap = remoteCustomerService.selectCustomerNameByIds(new HashSet<>(customerIds));
+                }
+                if (!supplierIds.isEmpty()) {
+                    supplierNameMap = remoteSupplierInfoService.selectSupplierNameByIds(new HashSet<>(supplierIds));
+                }
+                if (!partnerIds.isEmpty()) {
+                    partnerNameMap = remotePartnerInfoService.selectPartnerNameByIds(new HashSet<>(partnerIds));
+                }
 
 
+                // 6. 【优化点4】内存组装数据
+                for (OrderProductVo productVo : orderProductVoList) {
+                    Long childOrderId = productVo.getAssignedChildOrderId();
+                    if (childOrderId != null) {
+                        OrderMainVo childOrder = childOrderMap.get(childOrderId);
+                        if (childOrder != null && childOrder.getAssigneeId() != null) {
+                            String assigneeName = null;
+                            String type = childOrder.getAssigneeType();
+
+                            if (AssigneeTypeConstants.CUSTOMER.getCode().equals(type)) {
+                                assigneeName = customerNameMap.get(childOrder.getAssigneeId());
+                            } else if (AssigneeTypeConstants.SUPPLIER.getCode().equals(type)) {
+                                assigneeName = supplierNameMap.get(childOrder.getAssigneeId());
+                            } else if (AssigneeTypeConstants.PARTNER.getCode().equals(type)) {
+                                assigneeName = partnerNameMap.get(childOrder.getAssigneeId());
+                            }
+                            productVo.setAssigneeName(assigneeName);
+                        }
+                    }
+                }
+            }
+        }
         // 3. 组装数据
         // 3. 组装数据
         orderMainVo.setOrderProductList(orderProductVoList);
         orderMainVo.setOrderProductList(orderProductVoList);
 
 
@@ -193,8 +274,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
     }
     }
 
 
     @Override
     @Override
-    public OrderCountVo countOrderNum(Long customerId) {
-        return baseMapper.countOrderNum(customerId);
+    public OrderCountVo countOrderNum(Long customerId, Long userId) {
+        return baseMapper.countOrderNum(customerId, userId);
     }
     }
 
 
     @Override
     @Override
@@ -489,6 +570,12 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public Long insertOrder(PcSubmitOrderBo bo, OrderMainBo mainBo) {
     public Long insertOrder(PcSubmitOrderBo bo, OrderMainBo mainBo) {
         RemoteCustomerSalesVo remoteCustomerSalesVo = remoteCustomerSalesService.selectCustomerSalesInfoByCustomerId(mainBo.getCustomerId());
         RemoteCustomerSalesVo remoteCustomerSalesVo = remoteCustomerSalesService.selectCustomerSalesInfoByCustomerId(mainBo.getCustomerId());
+
+        LoginUser userInfo = remoteUserService.getUserInfo(mainBo.getUserId(), "000000");
+        if (ObjectUtils.isNotEmpty(userInfo)) {
+            mainBo.setUserDept(userInfo.getDeptName());
+            mainBo.setCreateDept(userInfo.getDeptId());
+        }
         if (null != remoteCustomerSalesVo) {
         if (null != remoteCustomerSalesVo) {
             Long salesPersonId = remoteCustomerSalesVo.getSalesPersonId();//销售人员id
             Long salesPersonId = remoteCustomerSalesVo.getSalesPersonId();//销售人员id
             Long serviceStaffId = remoteCustomerSalesVo.getServiceStaffId();//服务人员
             Long serviceStaffId = remoteCustomerSalesVo.getServiceStaffId();//服务人员
@@ -647,18 +734,24 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public Boolean orderPay(Long customerId, Long orderId, String payType) {
     public Boolean orderPay(Long customerId, Long orderId, String payType) {
-        // 参数校验
+        // 1. 参数校验
         if (orderId == null) {
         if (orderId == null) {
             throw new ServiceException("订单ID不能为空");
             throw new ServiceException("订单ID不能为空");
         }
         }
         if (customerId == null) {
         if (customerId == null) {
             throw new ServiceException("客户ID不能为空");
             throw new ServiceException("客户ID不能为空");
         }
         }
-        if (payType == null || !OrderPayType.CREDIT_PAY.getCode().equals(payType)) {
-            throw new ServiceException("仅支持信用支付方式");
+        if (payType == null) {
+            throw new ServiceException("请选择支付方式");
+        }
+
+        // 校验支付方式是否合法 (可选,增强健壮性)
+        if (!Objects.equals(payType, OrderPayType.CREDIT_PAY.getCode()) &&
+            !Objects.equals(payType, OrderPayType.TEMP_ORDER.getCode())) {
+            throw new ServiceException("不支持的支付方式");
         }
         }
 
 
-        // 查询订单
+        // 2. 查询订单
         OrderMainVo orderMainVo = baseMapper.selectVoById(orderId);
         OrderMainVo orderMainVo = baseMapper.selectVoById(orderId);
         if (orderMainVo == null) {
         if (orderMainVo == null) {
             throw new ServiceException("订单不存在");
             throw new ServiceException("订单不存在");
@@ -672,61 +765,84 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
             throw new ServiceException("订单金额无效");
             throw new ServiceException("订单金额无效");
         }
         }
 
 
-        // 查询客户信用销售信息
-        RemoteCustomerSalesVo salesInfo = remoteCustomerSalesService.selectCustomerSalesInfoByCustomerId(customerId);
-        if (salesInfo == null) {
-            throw new ServiceException("客户信用信息未配置,无法使用信用支付");
-        }
+        // 3. 根据支付方式执行不同逻辑
+        if (Objects.equals(payType, OrderPayType.CREDIT_PAY.getCode())) {
 
 
-        // 获取可用额度:剩余额度 + 临时额度
-        BigDecimal remainingQuota = Optional.ofNullable(salesInfo.getRemainingQuota()).orElse(BigDecimal.ZERO);
-        BigDecimal temporaryQuota = Optional.ofNullable(salesInfo.getTemporaryQuota()).orElse(BigDecimal.ZERO);
+            // 查询客户信用销售信息
+            RemoteCustomerSalesVo salesInfo = remoteCustomerSalesService.selectCustomerSalesInfoByCustomerId(customerId);
+            if (salesInfo == null) {
+                throw new ServiceException("客户信用信息未配置,无法使用信用支付");
+            }
 
 
+            // 获取可用额度:剩余额度 + 临时额度
+            BigDecimal remainingQuota = Optional.ofNullable(salesInfo.getRemainingQuota()).orElse(BigDecimal.ZERO);
+            BigDecimal temporaryQuota = Optional.ofNullable(salesInfo.getTemporaryQuota()).orElse(BigDecimal.ZERO);
+            BigDecimal availableCredit = remainingQuota.add(temporaryQuota);
 
 
-        // 临时额度可用于支付
-        BigDecimal availableCredit = remainingQuota.add(temporaryQuota);
+            // 判断额度是否足够
+            if (availableCredit.compareTo(totalAmount) < 0) {
+                throw new ServiceException("信用额度不足,无法完成支付");
+            }
 
 
-        // 判断额度是否足够
-        if (availableCredit.compareTo(totalAmount) < 0) {
-            throw new ServiceException("信用额度不足,无法完成支付");
-        }
+            // 扣减逻辑:优先扣减临时额度,再扣剩余额度
+            BigDecimal newRemainingQuota = remainingQuota;
+            BigDecimal newTemporaryQuota = temporaryQuota;
 
 
-        // 扣减逻辑:优先扣减临时额度,再扣剩余额度
-        BigDecimal newRemainingQuota = remainingQuota;
-        BigDecimal newTemporaryQuota = temporaryQuota;
+            if (temporaryQuota.compareTo(totalAmount) >= 0) {
+                // 临时额度足够,只扣临时额度
+                newTemporaryQuota = temporaryQuota.subtract(totalAmount);
+            } else {
+                // 临时额度不足,先清空临时额度,再扣剩余额度
+                BigDecimal remainingToDeduct = totalAmount.subtract(temporaryQuota);
+                newTemporaryQuota = BigDecimal.ZERO;
+                newRemainingQuota = remainingQuota.subtract(remainingToDeduct);
 
 
-        if (temporaryQuota.compareTo(totalAmount) >= 0) {
-            // 临时额度足够,只扣临时额度
-            newTemporaryQuota = temporaryQuota.subtract(totalAmount);
-        } else {
-            // 临时额度不足,先清空临时额度,再扣剩余额度
-            BigDecimal remainingToDeduct = totalAmount.subtract(temporaryQuota);
-            newTemporaryQuota = BigDecimal.ZERO;
-            newRemainingQuota = remainingQuota.subtract(remainingToDeduct);
-
-            // 理论上不会为负(前面已校验总额度足够),但防御性检查
-            if (newRemainingQuota.compareTo(BigDecimal.ZERO) < 0) {
-                throw new ServiceException("信用额度计算异常,请联系管理员");
+                if (newRemainingQuota.compareTo(BigDecimal.ZERO) < 0) {
+                    throw new ServiceException("信用额度计算异常,请联系管理员");
+                }
             }
             }
-        }
 
 
-        // 更新对象
-        salesInfo.setRemainingQuota(newRemainingQuota);
-        salesInfo.setTemporaryQuota(newTemporaryQuota);
+            // 更新额度对象
+            salesInfo.setRemainingQuota(newRemainingQuota);
+            salesInfo.setTemporaryQuota(newTemporaryQuota);
 
 
-        // 执行更新
-        boolean updated = remoteCustomerSalesService.updateCustomerSalesInfo(salesInfo);
-        if (!updated) {
-            throw new RuntimeException("信用额度更新失败,请重试");
-        }
-        OrderMain order = new OrderMain();
-        order.setId(orderId);
-        order.setPayType(payType);
-        order.setOrderStatus(OrderStatus.PENDING_CONFIRMATION.getCode());
-        Boolean result = baseMapper.updateById(order) > 0;
-        if (!result) {
-            throw new RuntimeException("订单支付失败");
+            // 执行额度更新
+            boolean updated = remoteCustomerSalesService.updateCustomerSalesInfo(salesInfo);
+            if (!updated) {
+                throw new RuntimeException("信用额度更新失败,请重试");
+            }
+
+            // 更新订单状态为:已支付
+            OrderMain order = new OrderMain();
+            order.setId(orderId);
+            order.setPayType(payType);
+            order.setPaymentStatus("1"); // 1: 已支付
+            order.setOrderStatus(OrderStatus.PENDING_CONFIRMATION.getCode()); // 待确认
+
+            int updateCount = baseMapper.updateById(order);
+            if (updateCount <= 0) {
+                throw new RuntimeException("订单支付状态更新失败");
+            }
+
+        } else if (Objects.equals(payType, OrderPayType.TEMP_ORDER.getCode())) {
+
+            // 2. 更新订单状态为:暂存/待支付
+            OrderMain order = new OrderMain();
+            order.setId(orderId);
+            order.setPayType(payType);
+
+            // 根据需求:支付方式改为暂存订单,状态为待支付
+            order.setPaymentStatus("0");
+
+            // 订单状态设为待支付
+            order.setOrderStatus(OrderStatus.PENDING_PAYMENT.getCode());
+
+            int updateCount = baseMapper.updateById(order);
+            if (updateCount <= 0) {
+                throw new ServiceException("订单暂存失败");
+            }
         }
         }
+
         return true;
         return true;
     }
     }
 
 

+ 157 - 0
ruoyi-modules/ruoyi-order/src/main/java/org/dromara/order/service/impl/OrderStatusLogServiceImpl.java

@@ -0,0 +1,157 @@
+package org.dromara.order.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.dromara.order.domain.bo.OrderStatusLogBo;
+import org.dromara.order.domain.vo.OrderStatusLogVo;
+import org.dromara.order.domain.OrderStatusLog;
+import org.dromara.order.mapper.OrderStatusLogMapper;
+import org.dromara.order.service.IOrderStatusLogService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * 订单状态流转记录Service业务层处理
+ *
+ * @author LionLi
+ * @date 2026-03-23
+ */
+@Slf4j
+@RequiredArgsConstructor
+@Service
+public class OrderStatusLogServiceImpl extends ServiceImpl<OrderStatusLogMapper, OrderStatusLog> implements IOrderStatusLogService {
+
+    private final OrderStatusLogMapper baseMapper;
+
+    /**
+     * 查询订单状态流转记录
+     *
+     * @param id 主键
+     * @return 订单状态流转记录
+     */
+    @Override
+    public OrderStatusLogVo queryById(Long id) {
+        return baseMapper.selectVoById(id);
+    }
+
+    /**
+     * 分页查询订单状态流转记录列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 订单状态流转记录分页列表
+     */
+    @Override
+    public TableDataInfo<OrderStatusLogVo> queryPageList(OrderStatusLogBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<OrderStatusLog> lqw = buildQueryWrapper(bo);
+        Page<OrderStatusLogVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的订单状态流转记录列表
+     *
+     * @param bo 查询条件
+     * @return 订单状态流转记录列表
+     */
+    @Override
+    public List<OrderStatusLogVo> queryList(OrderStatusLogBo bo) {
+        LambdaQueryWrapper<OrderStatusLog> lqw = buildQueryWrapper(bo);
+        return baseMapper.selectVoList(lqw);
+    }
+
+    private LambdaQueryWrapper<OrderStatusLog> buildQueryWrapper(OrderStatusLogBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<OrderStatusLog> lqw = Wrappers.lambdaQuery();
+        lqw.orderByAsc(OrderStatusLog::getId);
+        lqw.eq(StringUtils.isNotBlank(bo.getOrderNo()), OrderStatusLog::getOrderNo, bo.getOrderNo());
+        lqw.eq(bo.getOrderId() != null, OrderStatusLog::getOrderId, bo.getOrderId());
+        lqw.eq(StringUtils.isNotBlank(bo.getCustomerNo()), OrderStatusLog::getCustomerNo, bo.getCustomerNo());
+        lqw.eq(bo.getCustomerId() != null, OrderStatusLog::getCustomerId, bo.getCustomerId());
+        lqw.eq(StringUtils.isNotBlank(bo.getDeliverMethod()), OrderStatusLog::getDeliverMethod, bo.getDeliverMethod());
+        lqw.like(StringUtils.isNotBlank(bo.getStatusName()), OrderStatusLog::getStatusName, bo.getStatusName());
+        lqw.eq(StringUtils.isNotBlank(bo.getTurnDown()), OrderStatusLog::getTurnDown, bo.getTurnDown());
+        lqw.eq(StringUtils.isNotBlank(bo.getImages()), OrderStatusLog::getImages, bo.getImages());
+        lqw.eq(StringUtils.isNotBlank(bo.getLogisticNos()), OrderStatusLog::getLogisticNos, bo.getLogisticNos());
+        lqw.eq(StringUtils.isNotBlank(bo.getNextApprover()), OrderStatusLog::getNextApprover, bo.getNextApprover());
+        lqw.eq(StringUtils.isNotBlank(bo.getIsApprovalProcess()), OrderStatusLog::getIsApprovalProcess, bo.getIsApprovalProcess());
+        lqw.eq(StringUtils.isNotBlank(bo.getStatus()), OrderStatusLog::getStatus, bo.getStatus());
+        lqw.eq(StringUtils.isNotBlank(bo.getPlatformCode()), OrderStatusLog::getPlatformCode, bo.getPlatformCode());
+        return lqw;
+    }
+
+    /**
+     * 新增订单状态流转记录
+     *
+     * @param bo 订单状态流转记录
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(OrderStatusLogBo bo) {
+        OrderStatusLog add = MapstructUtils.convert(bo, OrderStatusLog.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改订单状态流转记录
+     *
+     * @param bo 订单状态流转记录
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(OrderStatusLogBo bo) {
+        OrderStatusLog update = MapstructUtils.convert(bo, OrderStatusLog.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    @Override
+    public OrderStatusLogVo selectNewOne(OrderStatusLogBo bo) {
+        LambdaQueryWrapper<OrderStatusLog> wrapper = new LambdaQueryWrapper<>();
+
+        wrapper.eq(OrderStatusLog::getOrderId, bo.getOrderId())
+            .eq(OrderStatusLog::getCustomerId, bo.getCustomerId())
+            .eq(OrderStatusLog::getLogisticNos, bo.getLogisticNos());
+        wrapper.orderByDesc(OrderStatusLog::getId).last("limit 1");
+
+        return baseMapper.selectVoOne(wrapper);
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(OrderStatusLog entity) {
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除订单状态流转记录信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if (isValid) {
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+}

+ 1 - 0
ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMainMapper.xml

@@ -43,6 +43,7 @@
                SUM(CASE WHEN order_status = '4' THEN 1 ELSE 0 END) AS pendingReceiptCount
                SUM(CASE WHEN order_status = '4' THEN 1 ELSE 0 END) AS pendingReceiptCount
         FROM order_main
         FROM order_main
         WHERE customer_id = #{customerId}
         WHERE customer_id = #{customerId}
+          AND user_id = #{userId}
           AND is_split_child = '1'
           AND is_split_child = '1'
           AND del_flag = '0'
           AND del_flag = '0'
     </select>
     </select>

+ 1 - 0
ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderProductMapper.xml

@@ -29,6 +29,7 @@
                op.return_amount                                      AS returnAmount,
                op.return_amount                                      AS returnAmount,
                op.pre_delivery_date                                  AS preDeliveryDate,
                op.pre_delivery_date                                  AS preDeliveryDate,
                op.assignment_status                                  AS assignmentStatus,
                op.assignment_status                                  AS assignmentStatus,
+               op.assigned_child_order_id                            AS assignedChildOrderId,
                op.status                                             AS status,
                op.status                                             AS status,
                op.del_flag                                           AS delFlag,
                op.del_flag                                           AS delFlag,
                op.remark                                             AS remark
                op.remark                                             AS remark

+ 7 - 0
ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderStatusLogMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.dromara.order.mapper.OrderStatusLogMapper">
+
+</mapper>