From 7a923e32e55e9c34830690341469cc170f65092e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 16 十一月 2026 09:32:35 +0800
Subject: [PATCH] feat: 完善销售和投标业务流程

---
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessService.java                        |    4 
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidProgressMapper.java                          |   16 +
 sql/mysql/20261113_qc_iqc_vendor_batch_code_rule.sql                                                                            |   34 +++
 sql/mysql/20261112_crm_bid_management_menu.sql                                                                                  |    3 
 sql/mysql/20261114_sales_notice_delivery_metrics.sql                                                                            |    4 
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondServiceImpl.java                           |   99 +++++++++
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/salesnotice/MesWmSalesNoticeServiceImpl.java              |   35 ---
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeSaveReqVO.java    |    8 
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/mps/MesProMpsServiceImpl.java                            |    5 
 sql/mysql/20261112_crm_bid_progress.sql                                                                                         |   23 ++
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondService.java                               |    5 
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesService.java                  |    7 
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidBondMapper.java                              |    4 
 yudao-module-mes/src/main/resources/templates/wm/sales-delivery.docx                                                            |    0 
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java              |   35 ++
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeRespVO.java       |   10 
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/vo/MesProProcessImportRespVO.java       |   14 +
 yudao-module-crm/src/test/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondQuotationBindingTest.java                  |   10 
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/MesWmSalesNoticeController.java      |    6 
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/MesProProcessController.java            |   25 ++
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/bidbond/CrmBidProgressDO.java                         |   21 ++
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/salesnotice/MesWmSalesNoticeDO.java                |    4 
 sql/mysql/20261113_sales_menu_order.sql                                                                                         |   16 +
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/CrmBidBondController.java                   |   17 +
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/returnsales/MesWmReturnSalesController.java      |   23 -
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/vo/MesProProcessImportExcelVO.java      |   25 ++
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeLedgerRespVO.java |    4 
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/vo/CrmBidProgressReqVO.java                 |   14 +
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessServiceImpl.java                    |   66 ++++++
 sql/mysql/20261113_mes_process_import_menu.sql                                                                                  |    8 
 30 files changed, 471 insertions(+), 74 deletions(-)

diff --git a/sql/mysql/20261112_crm_bid_management_menu.sql b/sql/mysql/20261112_crm_bid_management_menu.sql
new file mode 100644
index 0000000..eb983ac
--- /dev/null
+++ b/sql/mysql/20261112_crm_bid_management_menu.sql
@@ -0,0 +1,3 @@
+-- 閿�鍞晶鎶曟爣椤甸潰缁熶竴鏄剧ず涓烘姇鏍囩鐞嗭紝淇濈暀鍘熻彍鍗� ID銆佽矾鐢卞拰鏉冮檺銆�
+UPDATE system_menu SET name = '鎶曟爣绠$悊' WHERE id = 602630;
+UPDATE system_menu SET name = REPLACE(name, '鎶曟爣淇濊瘉閲�', '鎶曟爣绠$悊') WHERE id IN (602631, 602632, 602633, 602634);
diff --git a/sql/mysql/20261112_crm_bid_progress.sql b/sql/mysql/20261112_crm_bid_progress.sql
new file mode 100644
index 0000000..57160a1
--- /dev/null
+++ b/sql/mysql/20261112_crm_bid_progress.sql
@@ -0,0 +1,23 @@
+-- 鎶曟爣缁撴灉鐢变笓闂ㄥ姩浣滅櫥璁帮紝淇濈暀姣忔寮�鏍囧強閲嶆柊鎶曟爣鐨勬祦姘淬��
+CREATE TABLE IF NOT EXISTS `crm_bid_progress` (
+  `id` BIGINT NOT NULL AUTO_INCREMENT,
+  `bid_bond_id` BIGINT NOT NULL,
+  `action` VARCHAR(20) NOT NULL COMMENT 'CREATED/FOLLOW_UP/WON/LOST/REBID',
+  `from_result` TINYINT DEFAULT NULL,
+  `to_result` TINYINT NOT NULL,
+  `quotation_round` INT DEFAULT NULL,
+  `remark` VARCHAR(500) DEFAULT NULL,
+  `creator` VARCHAR(64) DEFAULT '',
+  `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  `updater` VARCHAR(64) DEFAULT '',
+  `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  `deleted` BIT(1) NOT NULL DEFAULT b'0',
+  PRIMARY KEY (`id`),
+  KEY `idx_bid_bond_id` (`bid_bond_id`, `id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='鎶曟爣杩囩▼娴佹按';
+
+-- 鏃у崟鎹彧琛ヤ竴鏉″鍏ュ揩鐓э紝涓嶄吉閫犲巻鍙茶窡杩涘姩浣溿��
+INSERT INTO `crm_bid_progress` (`bid_bond_id`, `action`, `from_result`, `to_result`, `quotation_round`, `remark`, `creator`, `create_time`)
+SELECT b.`id`, 'IMPORTED', NULL, b.`bid_result`, b.`quotation_round`, '鍘嗗彶鍗曟嵁瀵煎叆鏃剁殑鐘舵�佸揩鐓�', b.`creator`, b.`create_time`
+FROM `crm_bid_bond` b
+WHERE b.`deleted` = b'0' AND NOT EXISTS (SELECT 1 FROM `crm_bid_progress` p WHERE p.`bid_bond_id` = b.`id`);
diff --git a/sql/mysql/20261113_mes_process_import_menu.sql b/sql/mysql/20261113_mes_process_import_menu.sql
new file mode 100644
index 0000000..a0cf149
--- /dev/null
+++ b/sql/mysql/20261113_mes_process_import_menu.sql
@@ -0,0 +1,8 @@
+-- 宸ュ簭璁剧疆鏂板 Excel 瀵煎叆鏉冮檺锛屾部鐢ㄧ幇鏈夊伐搴忚彍鍗曘��
+INSERT INTO system_menu (id, name, permission, type, sort, parent_id, path, icon,
+                         component, component_name, status, visible, keep_alive, always_show,
+                         creator, create_time, updater, update_time, deleted)
+VALUES (5716, '宸ュ簭瀵煎叆', 'mes:pro-process:import', 3, 6, 5710, '', '',
+        '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0')
+ON DUPLICATE KEY UPDATE name = VALUES(name), permission = VALUES(permission),
+                        parent_id = VALUES(parent_id), deleted = b'0';
diff --git a/sql/mysql/20261113_qc_iqc_vendor_batch_code_rule.sql b/sql/mysql/20261113_qc_iqc_vendor_batch_code_rule.sql
new file mode 100644
index 0000000..3caf476
--- /dev/null
+++ b/sql/mysql/20261113_qc_iqc_vendor_batch_code_rule.sql
@@ -0,0 +1,34 @@
+-- 琛ラ綈鏉ユ枡妫�楠屼緵搴斿晢鎵规鍙风殑缂栫爜瑙勫垯銆�
+INSERT INTO mes_md_auto_code_rule
+    (code, name, description, max_length, padded, status, creator, create_time, updater, update_time, deleted)
+SELECT 'QC_IQC_VENDOR_BATCH_CODE', '鏉ユ枡妫�楠屼緵搴斿晢鎵规鍙�', '鏉ユ枡妫�楠屼緵搴斿晢鎵规鍙疯嚜鍔ㄧ紪鐮�',
+       14, b'0', 0, '1', NOW(), '1', NOW(), b'0'
+WHERE NOT EXISTS (
+    SELECT 1 FROM mes_md_auto_code_rule WHERE code = 'QC_IQC_VENDOR_BATCH_CODE' AND deleted = 0
+);
+
+SET @vendor_batch_rule_id = (
+    SELECT id FROM mes_md_auto_code_rule
+    WHERE code = 'QC_IQC_VENDOR_BATCH_CODE' AND deleted = 0 LIMIT 1
+);
+
+INSERT INTO mes_md_auto_code_part
+    (rule_id, sort, type, length, fix_character, serial_start_no, serial_step,
+     cycle_flag, cycle_method, creator, create_time, updater, update_time, deleted)
+SELECT @vendor_batch_rule_id, 1, 3, 3, 'VB_', NULL, NULL, NULL, NULL,
+       '1', NOW(), '1', NOW(), b'0'
+WHERE NOT EXISTS (SELECT 1 FROM mes_md_auto_code_part WHERE rule_id = @vendor_batch_rule_id AND sort = 1 AND deleted = 0);
+
+INSERT INTO mes_md_auto_code_part
+    (rule_id, sort, type, length, date_format, serial_start_no, serial_step,
+     cycle_flag, cycle_method, creator, create_time, updater, update_time, deleted)
+SELECT @vendor_batch_rule_id, 2, 2, 8, 'yyyyMMdd', NULL, NULL, NULL, NULL,
+       '1', NOW(), '1', NOW(), b'0'
+WHERE NOT EXISTS (SELECT 1 FROM mes_md_auto_code_part WHERE rule_id = @vendor_batch_rule_id AND sort = 2 AND deleted = 0);
+
+INSERT INTO mes_md_auto_code_part
+    (rule_id, sort, type, length, serial_start_no, serial_step,
+     cycle_flag, cycle_method, creator, create_time, updater, update_time, deleted)
+SELECT @vendor_batch_rule_id, 3, 4, 3, 1, 1, b'1', 3,
+       '1', NOW(), '1', NOW(), b'0'
+WHERE NOT EXISTS (SELECT 1 FROM mes_md_auto_code_part WHERE rule_id = @vendor_batch_rule_id AND sort = 3 AND deleted = 0);
diff --git a/sql/mysql/20261113_sales_menu_order.sql b/sql/mysql/20261113_sales_menu_order.sql
new file mode 100644
index 0000000..be9da4d
--- /dev/null
+++ b/sql/mysql/20261113_sales_menu_order.sql
@@ -0,0 +1,16 @@
+-- 钀ラ攢绠$悊鑿滃崟鎸変笟鍔℃祦绋嬫帓搴忥紱淇濈暀鍘熻彍鍗� ID銆佺粍浠跺拰鏉冮檺銆�
+UPDATE system_menu SET sort = CASE id
+  WHEN 2701 THEN 10 WHEN 1075495 THEN 20 WHEN 1075496 THEN 30
+  WHEN 1075497 THEN 40 WHEN 1075498 THEN 50 WHEN 2524 THEN 90
+  WHEN 2404 THEN 10 WHEN 2546 THEN 20 WHEN 2391 THEN 30
+  WHEN 2416 THEN 40 WHEN 2618 THEN 50
+  WHEN 2410 THEN 10 WHEN 602512 THEN 20 WHEN 602630 THEN 30
+  WHEN 2398 THEN 40 WHEN 2638 THEN 50
+  WHEN 2428 THEN 10 WHEN 2422 THEN 20 WHEN 1063093 THEN 30
+  WHEN 1075660 THEN 40
+  WHEN 1065000 THEN 10 WHEN 1065100 THEN 20 WHEN 2560 THEN 30
+  ELSE sort END,
+  parent_id = CASE WHEN id = 602630 THEN 1075496 ELSE parent_id END
+WHERE id IN (2701,1075495,1075496,1075497,1075498,2524,
+  2404,2546,2391,2416,2618,2410,602512,602630,2398,2638,
+  2428,2422,1063093,1075660,1065000,1065100,2560);
diff --git a/sql/mysql/20261114_sales_notice_delivery_metrics.sql b/sql/mysql/20261114_sales_notice_delivery_metrics.sql
new file mode 100644
index 0000000..ff9408e
--- /dev/null
+++ b/sql/mysql/20261114_sales_notice_delivery_metrics.sql
@@ -0,0 +1,4 @@
+-- 鍙戣揣浣撶Н鍜岄噸閲忎粎鐢ㄤ簬鐗╂祦璁板綍锛屼笉鍙備笌璐㈠姟璁$畻銆�
+ALTER TABLE mes_wm_sales_notice
+    ADD COLUMN delivery_volume DECIMAL(18,3) NULL COMMENT '鍙戣揣浣撶Н锛堢珛鏂圭背锛�' AFTER logistics_company,
+    ADD COLUMN delivery_weight DECIMAL(18,3) NULL COMMENT '鍙戣揣閲嶉噺锛堝崈鍏嬶級' AFTER delivery_volume;
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/CrmBidBondController.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/CrmBidBondController.java
index db23637..4d8296c 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/CrmBidBondController.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/CrmBidBondController.java
@@ -9,6 +9,8 @@
 import cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo.CrmBidBondRespVO;
 import cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo.CrmBidBondSaleOrderRespVO;
 import cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo.CrmBidBondSaveReqVO;
+import cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo.CrmBidProgressReqVO;
+import cn.iocoder.yudao.module.crm.dal.dataobject.bidbond.CrmBidProgressDO;
 import cn.iocoder.yudao.module.crm.service.bidbond.CrmBidBondService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
@@ -50,6 +52,21 @@
         return success(true);
     }
 
+    @PostMapping("/progress")
+    @Operation(summary = "鐧昏鎶曟爣杩囩▼")
+    @PreAuthorize("@ss.hasPermission('crm:bid-bond:update')")
+    public CommonResult<Boolean> recordProgress(@Valid @RequestBody CrmBidProgressReqVO reqVO) {
+        bidBondService.recordProgress(reqVO.getId(), reqVO.getAction(), reqVO.getRemark());
+        return success(true);
+    }
+
+    @GetMapping("/progress-list")
+    @Operation(summary = "鎶曟爣杩囩▼娴佹按")
+    @PreAuthorize("@ss.hasPermission('crm:bid-bond:query')")
+    public CommonResult<List<CrmBidProgressDO>> getProgressList(@RequestParam("id") Long id) {
+        return success(bidBondService.getProgressList(id));
+    }
+
     @DeleteMapping("/delete")
     @Operation(summary = "鍒犻櫎鎶曟爣淇濊瘉閲戣褰�")
     @Parameter(name = "id", description = "缂栧彿", required = true)
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/vo/CrmBidProgressReqVO.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/vo/CrmBidProgressReqVO.java
new file mode 100644
index 0000000..cd0d12d
--- /dev/null
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/bidbond/vo/CrmBidProgressReqVO.java
@@ -0,0 +1,14 @@
+package cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Data
+public class CrmBidProgressReqVO {
+    @NotNull(message = "鎶曟爣缂栧彿涓嶈兘涓虹┖")
+    private Long id;
+    @NotBlank(message = "杩囩▼鍔ㄤ綔涓嶈兘涓虹┖")
+    private String action;
+    private String remark;
+}
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/bidbond/CrmBidProgressDO.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/bidbond/CrmBidProgressDO.java
new file mode 100644
index 0000000..fa06d31
--- /dev/null
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/bidbond/CrmBidProgressDO.java
@@ -0,0 +1,21 @@
+package cn.iocoder.yudao.module.crm.dal.dataobject.bidbond;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@TableName("crm_bid_progress")
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CrmBidProgressDO extends BaseDO {
+    @TableId
+    private Long id;
+    private Long bidBondId;
+    private String action;
+    private Integer fromResult;
+    private Integer toResult;
+    private Integer quotationRound;
+    private String remark;
+}
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidBondMapper.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidBondMapper.java
index b2868da..237cad0 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidBondMapper.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidBondMapper.java
@@ -7,6 +7,7 @@
 import cn.iocoder.yudao.module.crm.dal.dataobject.bidbond.CrmBidBondDO;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
 
 import java.util.Collection;
 import java.util.List;
@@ -29,6 +30,9 @@
                 .orderByDesc(CrmBidBondDO::getId));
     }
 
+    @Select("SELECT * FROM crm_bid_bond WHERE id = #{id} AND deleted = 0 FOR UPDATE")
+    CrmBidBondDO selectByIdForUpdate(Long id);
+
     default CrmBidBondDO selectByNo(String no) {
         return selectOne(CrmBidBondDO::getNo, no);
     }
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidProgressMapper.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidProgressMapper.java
new file mode 100644
index 0000000..7cfbeef
--- /dev/null
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/bidbond/CrmBidProgressMapper.java
@@ -0,0 +1,16 @@
+package cn.iocoder.yudao.module.crm.dal.mysql.bidbond;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.crm.dal.dataobject.bidbond.CrmBidProgressDO;
+import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
+@Mapper
+public interface CrmBidProgressMapper extends BaseMapperX<CrmBidProgressDO> {
+    default List<CrmBidProgressDO> selectByBidBondId(Long bidBondId) {
+        return selectList(new LambdaQueryWrapperX<CrmBidProgressDO>()
+                .eq(CrmBidProgressDO::getBidBondId, bidBondId)
+                .orderByAsc(CrmBidProgressDO::getId));
+    }
+}
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondService.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondService.java
index ed2aeac..1b2e97d 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondService.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondService.java
@@ -6,6 +6,7 @@
 import cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo.CrmBidBondSaleOrderRespVO;
 import cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo.CrmBidBondSaveReqVO;
 import cn.iocoder.yudao.module.crm.dal.dataobject.bidbond.CrmBidBondDO;
+import cn.iocoder.yudao.module.crm.dal.dataobject.bidbond.CrmBidProgressDO;
 import jakarta.validation.Valid;
 
 import java.util.List;
@@ -21,6 +22,10 @@
 
     void deleteBidBond(Long id);
 
+    void recordProgress(Long id, String action, String remark);
+
+    List<CrmBidProgressDO> getProgressList(Long id);
+
     CrmBidBondDO getBidBond(Long id);
 
     CrmBidBondRespVO getBidBondDetail(Long id);
diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondServiceImpl.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondServiceImpl.java
index 846ec7f..1088a2a 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondServiceImpl.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondServiceImpl.java
@@ -10,9 +10,11 @@
 import cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo.CrmBidBondSaleOrderRespVO;
 import cn.iocoder.yudao.module.crm.controller.admin.bidbond.vo.CrmBidBondSaveReqVO;
 import cn.iocoder.yudao.module.crm.dal.dataobject.bidbond.CrmBidBondDO;
+import cn.iocoder.yudao.module.crm.dal.dataobject.bidbond.CrmBidProgressDO;
 import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO;
 import cn.iocoder.yudao.module.crm.dal.dataobject.quotation.CrmSaleQuotationDO;
 import cn.iocoder.yudao.module.crm.dal.mysql.bidbond.CrmBidBondMapper;
+import cn.iocoder.yudao.module.crm.dal.mysql.bidbond.CrmBidProgressMapper;
 import cn.iocoder.yudao.module.crm.dal.mysql.quotation.CrmSaleQuotationMapper;
 import cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants;
 import cn.iocoder.yudao.module.crm.enums.bidbond.CrmBidBondRefundStatusEnum;
@@ -51,6 +53,8 @@
     @Resource
     private CrmBidBondMapper bidBondMapper;
     @Resource
+    private CrmBidProgressMapper bidProgressMapper;
+    @Resource
     private CrmSaleQuotationMapper saleQuotationMapper;
     @Resource
     private CrmCustomerService customerService;
@@ -60,6 +64,9 @@
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Long createBidBond(CrmBidBondSaveReqVO createReqVO) {
+        if (!CrmBidResultEnum.PENDING.getResult().equals(createReqVO.getBidResult())) {
+            throw new ServiceException(400, "鏂版姇鏍囧繀椤诲厛鐧昏涓哄緟寮�鏍囷紝璇峰湪杩囩▼璺熻繘涓櫥璁扮粨鏋�");
+        }
         CrmBidBondDO bond = validateAndBuild(createReqVO);
         bond.setId(null);
         bond.setNo(generateBondNo());
@@ -68,6 +75,7 @@
         if (bond.getQuotationId() != null) {
             saleQuotationMapper.bindBidBond(bond.getQuotationId(), bond.getId(), bond.getNo());
         }
+        insertProgress(bond, "CREATED", null, CrmBidResultEnum.PENDING.getResult(), null);
         return bond.getId();
     }
 
@@ -75,6 +83,13 @@
     @Transactional(rollbackFor = Exception.class)
     public void updateBidBond(CrmBidBondSaveReqVO updateReqVO) {
         CrmBidBondDO oldBond = validateBidBondExists(updateReqVO.getId());
+        if (!Objects.equals(oldBond.getBidResult(), updateReqVO.getBidResult())) {
+            throw new ServiceException(400, "涓爣缁撴灉鍙兘閫氳繃鎶曟爣杩囩▼璺熻繘鐧昏");
+        }
+        if (CrmBidResultEnum.WON.getResult().equals(oldBond.getBidResult())
+                && !Objects.equals(oldBond.getQuotationId(), updateReqVO.getQuotationId())) {
+            throw new ServiceException(400, "宸蹭腑鏍囨姇鏍囦笉鑳芥洿鎹㈡姤浠峰崟");
+        }
         CrmBidBondDO updateObj = validateAndBuild(updateReqVO);
         updateObj.setId(updateReqVO.getId());
         // 鍗曞彿涓嶅厑璁镐慨鏀癸紝淇濇寔鍘熷��
@@ -93,6 +108,10 @@
     @Transactional(rollbackFor = Exception.class)
     public void deleteBidBond(Long id) {
         CrmBidBondDO bond = validateBidBondExists(id);
+        if (!CrmBidResultEnum.PENDING.getResult().equals(bond.getBidResult())
+                || bidProgressMapper.selectByBidBondId(id).size() > 1) {
+            throw new ServiceException(400, "宸叉湁鎶曟爣杩囩▼璁板綍锛屼笉鑳藉垹闄�");
+        }
         if (CrmBidResultEnum.WON.getResult().equals(bond.getBidResult()) && bond.getQuotationId() != null) {
             throw ServiceExceptionUtil.exception(ErrorCodeConstants.BID_BOND_DELETE_FAIL_WON);
         }
@@ -101,6 +120,72 @@
             saleQuotationMapper.bindBidBond(bond.getQuotationId(), null, null);
         }
         bidBondMapper.deleteById(id);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void recordProgress(Long id, String action, String remark) {
+        CrmBidBondDO bond = bidBondMapper.selectByIdForUpdate(id);
+        if (bond == null) throw new ServiceException(400, "鎶曟爣璁板綍涓嶅瓨鍦�");
+        int from = bond.getBidResult();
+        int target;
+        switch (action) {
+            case "FOLLOW_UP" -> {
+                if (from == CrmBidResultEnum.WON.getResult()) throw new ServiceException(400, "宸蹭腑鏍囨姇鏍囦笉鑳界户缁窡杩涘紑鏍囪繃绋�");
+                target = from;
+            }
+            case "WON" -> {
+                if (from != CrmBidResultEnum.PENDING.getResult()) throw new ServiceException(400, "鍙湁寰呭紑鏍囨姇鏍囧彲浠ョ櫥璁颁腑鏍�");
+                target = CrmBidResultEnum.WON.getResult();
+            }
+            case "LOST" -> {
+                if (from != CrmBidResultEnum.PENDING.getResult()) throw new ServiceException(400, "鍙湁寰呭紑鏍囨姇鏍囧彲浠ョ櫥璁版湭涓爣");
+                target = CrmBidResultEnum.LOST.getResult();
+            }
+            case "REBID" -> {
+                if (from != CrmBidResultEnum.LOST.getResult()) throw new ServiceException(400, "鍙湁鏈腑鏍囨姇鏍囧彲浠ラ噸鏂版姇鏍�");
+                CrmSaleQuotationDO quotation = saleQuotationMapper.selectById(bond.getQuotationId());
+                List<CrmBidProgressDO> history = bidProgressMapper.selectByBidBondId(id);
+                int lastRound = history.stream().filter(e -> "LOST".equals(e.getAction())
+                                || ("IMPORTED".equals(e.getAction()) && Objects.equals(e.getToResult(), CrmBidResultEnum.LOST.getResult())))
+                        .map(CrmBidProgressDO::getQuotationRound).filter(Objects::nonNull)
+                        .max(Integer::compareTo).orElse(0);
+                if (quotation == null || quotation.getRevisionNo() == null || quotation.getRevisionNo() <= lastRound) {
+                    throw new ServiceException(400, "璇峰厛瀹屾垚涓嬩竴杞姤浠凤紝鍐嶉噸鏂版姇鏍�");
+                }
+                target = CrmBidResultEnum.PENDING.getResult();
+            }
+            default -> throw new ServiceException(400, "涓嶆敮鎸佺殑鎶曟爣杩囩▼鍔ㄤ綔");
+        }
+        if (remark == null || remark.isBlank()) throw new ServiceException(400, "璇峰~鍐欐湰娆¤窡杩涜鏄�");
+        if (remark.length() > 500) throw new ServiceException(400, "璺熻繘璇存槑涓嶈兘瓒呰繃500瀛�");
+        CrmSaleQuotationDO quotation = saleQuotationMapper.selectById(bond.getQuotationId());
+        bond.setBidResult(target);
+        bond.setQuotationRound(quotation != null ? quotation.getRevisionNo() : bond.getQuotationRound());
+        if (target == CrmBidResultEnum.WON.getResult()) {
+            bond.setRefundStatus(CrmBidBondRefundStatusEnum.NO_NEED.getStatus());
+            bond.setRefundAmount(null);
+            bond.setRefundDate(null);
+        }
+        bidBondMapper.updateByIdIncludingNulls(bond);
+        insertProgress(bond, action, from, target, remark);
+    }
+
+    @Override
+    public List<CrmBidProgressDO> getProgressList(Long id) {
+        validateBidBondExists(id);
+        return bidProgressMapper.selectByBidBondId(id);
+    }
+
+    private void insertProgress(CrmBidBondDO bond, String action, Integer from, Integer to, String remark) {
+        CrmBidProgressDO event = new CrmBidProgressDO();
+        event.setBidBondId(bond.getId());
+        event.setAction(action);
+        event.setFromResult(from);
+        event.setToResult(to);
+        event.setQuotationRound(bond.getQuotationRound());
+        event.setRemark(remark);
+        bidProgressMapper.insert(event);
     }
 
     @Override
@@ -194,9 +279,9 @@
                         "涓爣缁撴灉涓恒�愭湭涓爣銆戞椂涓嶈兘鍏宠仈閿�鍞鍗昜" + order.getNo()
                                 + "]銆傚宸蹭腑鏍囷紝璇峰厛灏嗕腑鏍囩粨鏋滄敼涓恒�愬凡涓爣銆戯紱濡傜‘鏈腑鏍囷紝璇锋竻绌哄叧鑱旈攢鍞鍗曘��");
             }
-            // 閫変腑閿�鍞鍗曡鏄庡凡涓爣锛屽緟寮�鏍囨椂鑷姩缃负宸蹭腑鏍�
             if (CrmBidResultEnum.PENDING.getResult().equals(bidResult)) {
-                bidResult = CrmBidResultEnum.WON.getResult();
+                throw new ServiceException(ErrorCodeConstants.BID_BOND_SALE_ORDER_NOT_APPROVE.getCode(),
+                        "寰呭紑鏍囨椂涓嶈兘鍏宠仈閿�鍞鍗曪紝璇峰厛鏄庣‘涓爣缁撴灉銆�");
             }
             saleOrderNo = order.getNo();
         }
@@ -223,14 +308,10 @@
      * 鏍¢獙骞跺姞杞藉叧鑱旀姤浠峰崟
      */
     private CrmSaleQuotationDO validateQuotation(CrmBidBondSaveReqVO reqVO, Integer bidResult) {
-        // 涓爣鏃舵姤浠峰崟蹇呭~锛屼繚璇佷腑鏍囧悗鍙互鎹杞悎鍚�
-        if (CrmBidResultEnum.WON.getResult().equals(bidResult) && reqVO.getQuotationId() == null) {
-            throw new ServiceException(ErrorCodeConstants.BID_BOND_WON_QUOTATION_REQUIRED.getCode(),
-                    "涓爣缁撴灉涓恒�愬凡涓爣銆戞椂蹇呴』鍏宠仈鎶ヤ环鍗曪紝鍚﹀垯鏃犳硶鍑鎶ヤ环鍗曡浆鍚堝悓銆�"
-                            + "璇烽�夋嫨鏈涓爣鐨勯攢鍞姤浠峰崟鍚庨噸鏂颁繚瀛樸��");
-        }
+        // 鎶曟爣璁板綍蹇呴』缁戝畾鏈鎶ヤ环锛屽緟寮�鏍囦笌鏈腑鏍囦篃闇�瑕佷繚鐣欐姤浠峰叧鑱斻��
         if (reqVO.getQuotationId() == null) {
-            return null;
+            throw new ServiceException(ErrorCodeConstants.BID_BOND_WON_QUOTATION_REQUIRED.getCode(),
+                    "鎶曟爣璁板綍蹇呴』鍏宠仈鏈閿�鍞姤浠峰崟锛岃閫夋嫨鎶ヤ环鍗曞悗閲嶆柊淇濆瓨銆�");
         }
         CrmSaleQuotationDO quotation = saleQuotationMapper.selectById(reqVO.getQuotationId());
         if (quotation == null) {
diff --git a/yudao-module-crm/src/test/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondQuotationBindingTest.java b/yudao-module-crm/src/test/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondQuotationBindingTest.java
index 7683042..5708f92 100644
--- a/yudao-module-crm/src/test/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondQuotationBindingTest.java
+++ b/yudao-module-crm/src/test/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondQuotationBindingTest.java
@@ -51,6 +51,12 @@
         });
         ReflectionTestUtils.setField(service, "customerService", customerService);
         ReflectionTestUtils.setField(service, "bidBondMapper", bondMapper);
+        ReflectionTestUtils.setField(service, "bidProgressMapper",
+                stub(cn.iocoder.yudao.module.crm.dal.mysql.bidbond.CrmBidProgressMapper.class,
+                        (proxy, method, args) -> {
+                            if ("insert".equals(method.getName())) return 1;
+                            throw new AssertionError(method.getName());
+                        }));
     }
 
     private void bindQuotation(CrmSaleQuotationDO quotation) {
@@ -98,13 +104,13 @@
     }
 
     @Test
-    void wonRequiresQuotation() {
+    void createCannotSetResultDirectly() {
         bindQuotation(new CrmSaleQuotationDO().setId(5L).setNo("BJ5").setCustomerId(1L).setStatus(2));
         CrmBidBondSaveReqVO req = baseReq();
         req.setBidResult(1);
 
         ServiceException ex = assertThrows(ServiceException.class, () -> service.createBidBond(req));
-        assertEquals(BID_BOND_WON_QUOTATION_REQUIRED.getCode(), ex.getCode());
+        assertEquals(400, ex.getCode());
     }
 
     @Test
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/MesProProcessController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/MesProProcessController.java
index 386e475..dd1e11c 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/MesProProcessController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/MesProProcessController.java
@@ -10,6 +10,8 @@
 import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessPageReqVO;
 import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessRespVO;
 import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessSaveReqVO;
+import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessImportExcelVO;
+import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessImportRespVO;
 import cn.iocoder.yudao.module.mes.dal.dataobject.pro.process.MesProProcessDO;
 import cn.iocoder.yudao.module.mes.service.pro.process.MesProProcessService;
 import io.swagger.v3.oas.annotations.Operation;
@@ -21,6 +23,7 @@
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
 import java.util.List;
@@ -98,4 +101,26 @@
         ExcelUtils.write(response, "鐢熶骇宸ュ簭.xls", "鏁版嵁", MesProProcessRespVO.class, data);
     }
 
+    @GetMapping("/get-import-template")
+    @Operation(summary = "涓嬭浇宸ュ簭瀵煎叆妯℃澘")
+    @PreAuthorize("@ss.hasPermission('mes:pro-process:import')")
+    public void importTemplate(HttpServletResponse response) throws IOException {
+        MesProProcessImportExcelVO example = new MesProProcessImportExcelVO();
+        example.setCode("PROCESS001");
+        example.setName("绀轰緥宸ュ簭");
+        example.setBillingType(2);
+        example.setWageRate(new java.math.BigDecimal("12.50"));
+        example.setStdTimeModeName("鏈惎鐢�");
+        example.setStatus(CommonStatusEnum.ENABLE.getStatus());
+        ExcelUtils.write(response, "宸ュ簭瀵煎叆妯℃澘.xls", "宸ュ簭璁剧疆", MesProProcessImportExcelVO.class, List.of(example));
+    }
+
+    @PostMapping("/import")
+    @Operation(summary = "瀵煎叆宸ュ簭")
+    @PreAuthorize("@ss.hasPermission('mes:pro-process:import')")
+    public CommonResult<MesProProcessImportRespVO> importProcess(@RequestParam("file") MultipartFile file,
+            @RequestParam(value = "updateSupport", defaultValue = "false") boolean updateSupport) throws IOException {
+        return success(processService.importProcessList(ExcelUtils.read(file, MesProProcessImportExcelVO.class), updateSupport));
+    }
+
 }
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/vo/MesProProcessImportExcelVO.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/vo/MesProProcessImportExcelVO.java
new file mode 100644
index 0000000..f24e5be
--- /dev/null
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/vo/MesProProcessImportExcelVO.java
@@ -0,0 +1,25 @@
+package cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import lombok.Data;
+import java.math.BigDecimal;
+
+@Data
+public class MesProProcessImportExcelVO {
+    @ExcelProperty("宸ュ簭缂栫爜锛堝繀濉級") private String code;
+    @ExcelProperty("宸ュ簭鍚嶇О锛堝繀濉級") private String name;
+    @ExcelProperty("璁¤垂绫诲瀷锛堝繀濉細1璁℃椂/2璁′欢锛�") private Integer billingType;
+    @ExcelProperty("宸ヨ祫瀹氶锛堝繀濉級") private BigDecimal wageRate;
+    @ExcelProperty("杈呭姪宸ユ椂灏忔椂宸ヨ祫") private BigDecimal auxHourlyRate;
+    // 鍥哄畾鍒楀簭鍙蜂互鍏煎鏃фā鏉匡細鏃у垪鏍囬涓衡�滄爣鍑嗗伐鏃惰绠楁柟寮忥紙0/1/2/3锛夆�濄��
+    @ExcelProperty(value = "鏍囧噯宸ユ椂璁$畻鏂瑰紡锛堟湭鍚敤/杞�熋楄妭璺�/绾块�熷害鐩村彇/婊¢�熺櫨鍒嗘瘮脳鑺傝窛锛�", index = 5) private String stdTimeModeName;
+    @ExcelProperty("鏍囧噯宸ユ椂鎶樼畻绯绘暟") private BigDecimal stdTimeFactor;
+    @ExcelProperty("鏈哄彴婊¤浆閫�") private BigDecimal maxRpm;
+    @ExcelProperty("杞�熷弬鏁扮紪鐮�") private String stdRpmParamCode;
+    @ExcelProperty("鑺傝窛鍙傛暟缂栫爜") private String stdPitchParamCode;
+    @ExcelProperty("绾块�熷害鍙傛暟缂栫爜") private String stdSpeedParamCode;
+    @ExcelProperty("杞�熺櫨鍒嗘瘮鍙傛暟缂栫爜") private String stdPercentParamCode;
+    @ExcelProperty("鐘舵�侊紙0鍚敤/1鍋滅敤锛涚暀绌洪粯璁ゅ惎鐢級") private Integer status;
+    @ExcelProperty("宸ヨ壓瑕佹眰") private String attention;
+    @ExcelProperty("澶囨敞") private String remark;
+}
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/vo/MesProProcessImportRespVO.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/vo/MesProProcessImportRespVO.java
new file mode 100644
index 0000000..742d8f6
--- /dev/null
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/process/vo/MesProProcessImportRespVO.java
@@ -0,0 +1,14 @@
+package cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo;
+
+import lombok.Builder;
+import lombok.Data;
+import java.util.List;
+import java.util.Map;
+
+@Data
+@Builder
+public class MesProProcessImportRespVO {
+    private List<String> createCodes;
+    private List<String> updateCodes;
+    private Map<String, String> failureCodes;
+}
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/returnsales/MesWmReturnSalesController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/returnsales/MesWmReturnSalesController.java
index 37d4fd4..cdd8d84 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/returnsales/MesWmReturnSalesController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/returnsales/MesWmReturnSalesController.java
@@ -109,21 +109,14 @@
         return success(true);
     }
 
-    @PutMapping("/finish")
-    @Operation(summary = "鎵ц閫�璐�")
-    @Parameter(name = "id", description = "缂栧彿", required = true)
+    @PutMapping("/confirm-inbound")
+    @Operation(summary = "璐ㄦ鍚庣‘璁ら��璐у叆搴�")
     @PreAuthorize("@ss.hasPermission('mes:wm-return-sales:finish')")
-    public CommonResult<Boolean> finishReturnSales(@RequestParam("id") Long id) {
-        returnSalesService.finishReturnSales(id);
-        return success(true);
-    }
-
-    @PutMapping("/stock")
-    @Operation(summary = "鎵ц涓婃灦")
-    @Parameter(name = "id", description = "缂栧彿", required = true)
-    @PreAuthorize("@ss.hasPermission('mes:wm-return-sales:stock')")
-    public CommonResult<Boolean> stockReturnSales(@RequestParam("id") Long id) {
-        returnSalesService.stockReturnSales(id);
+    public CommonResult<Boolean> confirmReturnSales(@RequestParam("id") Long id,
+            @RequestParam("warehouseId") Long warehouseId,
+            @RequestParam("locationId") Long locationId,
+            @RequestParam("areaId") Long areaId) {
+        returnSalesService.confirmReturnSales(id, warehouseId, locationId, areaId);
         return success(true);
     }
 
@@ -158,4 +151,4 @@
                         vo.setClientName(customer.getName())));
     }
 
-}
\ No newline at end of file
+}
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/MesWmSalesNoticeController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/MesWmSalesNoticeController.java
index f9b315a..ce0a1f2 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/MesWmSalesNoticeController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/MesWmSalesNoticeController.java
@@ -162,6 +162,8 @@
                 row.setRecipientName(notice.getRecipientName());
                 row.setRecipientAddress(notice.getRecipientAddress());
                 row.setLogisticsCompany(notice.getLogisticsCompany());
+                row.setDeliveryVolume(notice.getDeliveryVolume());
+                row.setDeliveryWeight(notice.getDeliveryWeight());
                 row.setExpressFee(notice.getExpressFee());
                 row.setInvoiceStatus(notice.getInvoiceStatus());
                 row.setStatus(notice.getStatus());
@@ -233,6 +235,8 @@
         fields.put("recipientTelephone", notice.getRecipientTelephone());
         fields.put("recipientAddress", notice.getRecipientAddress());
         fields.put("logisticsCompany", notice.getLogisticsCompany());
+        fields.put("deliveryVolume", notice.getDeliveryVolume() == null ? "" : notice.getDeliveryVolume().toPlainString());
+        fields.put("deliveryWeight", notice.getDeliveryWeight() == null ? "" : notice.getDeliveryWeight().toPlainString());
         fields.put("expressFee", notice.getExpressFee() == null ? "0.00" : notice.getExpressFee().toPlainString());
         fields.put("creator", resolveCreatorName(notice.getCreator()));
         fields.put("remark", notice.getRemark());
@@ -332,4 +336,4 @@
         });
     }
 
-}
\ No newline at end of file
+}
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeLedgerRespVO.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeLedgerRespVO.java
index d5a0b5c..c5bc15d 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeLedgerRespVO.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeLedgerRespVO.java
@@ -33,6 +33,10 @@
     private String recipientAddress;
     @Schema(description = "鐗╂祦鍏徃")
     private String logisticsCompany;
+    @Schema(description = "鍙戣揣浣撶Н锛堢珛鏂圭背锛�")
+    private BigDecimal deliveryVolume;
+    @Schema(description = "鍙戣揣閲嶉噺锛堝崈鍏嬶級")
+    private BigDecimal deliveryWeight;
     @Schema(description = "蹇�掕垂")
     private BigDecimal expressFee;
     @Schema(description = "寮�绁ㄧ姸鎬侊細0鏈紑绁� 1閮ㄥ垎寮�绁� 2宸插紑绁�")
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeRespVO.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeRespVO.java
index 96529bb..e44c641 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeRespVO.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeRespVO.java
@@ -59,6 +59,14 @@
     @ExcelProperty("鐗╂祦鍏徃")
     private String logisticsCompany;
 
+    @Schema(description = "鍙戣揣浣撶Н锛堢珛鏂圭背锛�")
+    @ExcelProperty("鍙戣揣浣撶Н锛坢鲁锛�")
+    private BigDecimal deliveryVolume;
+
+    @Schema(description = "鍙戣揣閲嶉噺锛堝崈鍏嬶級")
+    @ExcelProperty("鍙戣揣閲嶉噺锛坘g锛�")
+    private BigDecimal deliveryWeight;
+
     @Schema(description = "蹇�掕垂", example = "25.00")
     @ExcelProperty("蹇�掕垂")
     private BigDecimal expressFee;
@@ -83,4 +91,4 @@
     @ExcelProperty("鍒涘缓鏃堕棿")
     private LocalDateTime createTime;
 
-}
\ No newline at end of file
+}
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeSaveReqVO.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeSaveReqVO.java
index d839f34..7ad6d47 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeSaveReqVO.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/salesnotice/vo/MesWmSalesNoticeSaveReqVO.java
@@ -52,6 +52,14 @@
     @Size(max = 128, message = "鐗╂祦鍏徃鍚嶇О涓嶈兘瓒呰繃 128 涓瓧绗�")
     private String logisticsCompany;
 
+    @Schema(description = "鍙戣揣浣撶Н锛堢珛鏂圭背锛�")
+    @DecimalMin(value = "0", message = "鍙戣揣浣撶Н涓嶈兘灏忎簬 0")
+    private BigDecimal deliveryVolume;
+
+    @Schema(description = "鍙戣揣閲嶉噺锛堝崈鍏嬶級")
+    @DecimalMin(value = "0", message = "鍙戣揣閲嶉噺涓嶈兘灏忎簬 0")
+    private BigDecimal deliveryWeight;
+
     @Schema(description = "蹇�掕垂", example = "25.00")
     @DecimalMin(value = "0", message = "蹇�掕垂涓嶈兘灏忎簬 0")
     private BigDecimal expressFee;
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/salesnotice/MesWmSalesNoticeDO.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/salesnotice/MesWmSalesNoticeDO.java
index 6181009..4bfa47c 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/salesnotice/MesWmSalesNoticeDO.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/salesnotice/MesWmSalesNoticeDO.java
@@ -70,6 +70,10 @@
      * 鐗╂祦鍏徃
      */
     private String logisticsCompany;
+    /** 鍙戣揣浣撶Н锛堢珛鏂圭背锛� */
+    private BigDecimal deliveryVolume;
+    /** 鍙戣揣閲嶉噺锛堝崈鍏嬶級 */
+    private BigDecimal deliveryWeight;
     /**
      * 蹇�掕垂
      */
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/mps/MesProMpsServiceImpl.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/mps/MesProMpsServiceImpl.java
index d932d68..114e75e 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/mps/MesProMpsServiceImpl.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/mps/MesProMpsServiceImpl.java
@@ -17,6 +17,7 @@
 import cn.iocoder.yudao.module.mes.dal.mysql.pro.mps.MesProMpsMapper;
 import cn.iocoder.yudao.module.mes.dal.mysql.pro.feedback.MesProFeedbackMapper;
 import cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder.MesProWorkOrderMapper;
+import cn.iocoder.yudao.module.mes.enums.md.autocode.MesMdAutoCodeRuleCodeEnum;
 import cn.iocoder.yudao.module.mes.dal.dataobject.pro.feedback.MesProFeedbackDO;
 import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProductBomDO;
 import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProductDO;
@@ -597,9 +598,9 @@
      */
     private String generateWorkOrderCode() {
         try {
-            return autoCodeRecordService.generateAutoCode("WO");
+            return autoCodeRecordService.generateAutoCode(MesMdAutoCodeRuleCodeEnum.PRO_WORK_ORDER_CODE.getCode());
         } catch (Exception e) {
-            log.warn("[generateWorkOrderCode] 缂栫爜瑙勫垯 WO 涓嶅瓨鍦紝浣跨敤鏃堕棿鎴崇敓鎴�");
+            log.warn("[generateWorkOrderCode] 鐢熶骇宸ュ崟缂栫爜鐢熸垚澶辫触锛屼娇鐢ㄦ椂闂存埑鐢熸垚", e);
             return "WO" + System.currentTimeMillis();
         }
     }
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessService.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessService.java
index 790308d..95d6ca0 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessService.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessService.java
@@ -3,6 +3,8 @@
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessPageReqVO;
 import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessSaveReqVO;
+import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessImportExcelVO;
+import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessImportRespVO;
 import cn.iocoder.yudao.module.mes.dal.dataobject.pro.process.MesProProcessDO;
 
 import jakarta.validation.Valid;
@@ -66,6 +68,8 @@
      */
     PageResult<MesProProcessDO> getProcessPage(MesProProcessPageReqVO pageReqVO);
 
+    MesProProcessImportRespVO importProcessList(List<MesProProcessImportExcelVO> rows, boolean updateSupport);
+
     /**
      * 鑾峰緱鎸囧畾鐘舵�佺殑鐢熶骇宸ュ簭鍒楄〃
      *
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessServiceImpl.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessServiceImpl.java
index 3dd668a..2b1c487 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessServiceImpl.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/process/MesProProcessServiceImpl.java
@@ -7,6 +7,8 @@
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessPageReqVO;
 import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessSaveReqVO;
+import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessImportExcelVO;
+import cn.iocoder.yudao.module.mes.controller.admin.pro.process.vo.MesProProcessImportRespVO;
 import cn.iocoder.yudao.module.mes.dal.dataobject.pro.process.MesProProcessDO;
 import cn.iocoder.yudao.module.mes.dal.mysql.pro.process.MesProProcessMapper;
 import cn.iocoder.yudao.module.mes.enums.pro.MesProProcessBillingTypeEnum;
@@ -20,6 +22,11 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Map;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
@@ -159,6 +166,65 @@
     }
 
     @Override
+    public MesProProcessImportRespVO importProcessList(List<MesProProcessImportExcelVO> rows, boolean updateSupport) {
+        if (CollUtil.isEmpty(rows)) {
+            throw new cn.iocoder.yudao.framework.common.exception.ServiceException(400, "瀵煎叆鏂囦欢娌℃湁宸ュ簭鏁版嵁");
+        }
+        MesProProcessImportRespVO result = MesProProcessImportRespVO.builder()
+                .createCodes(new ArrayList<>()).updateCodes(new ArrayList<>())
+                .failureCodes(new LinkedHashMap<>()).build();
+        Set<String> seenCodes = new HashSet<>();
+        for (int index = 0; index < rows.size(); index++) {
+            MesProProcessImportExcelVO row = rows.get(index);
+            String code = row.getCode() == null ? "" : row.getCode().trim();
+            String key = code.isEmpty() ? "绗� " + (index + 2) + " 琛�" : code;
+            try {
+                if (code.isEmpty() || row.getName() == null || row.getName().isBlank()) {
+                    throw new IllegalArgumentException("宸ュ簭缂栫爜鍜屽悕绉颁笉鑳戒负绌�");
+                }
+                if (!seenCodes.add(code)) throw new IllegalArgumentException("鏂囦欢鍐呭伐搴忕紪鐮侀噸澶�");
+                if (row.getBillingType() == null || row.getWageRate() == null) {
+                    throw new IllegalArgumentException("璁¤垂绫诲瀷鍜屽伐璧勫畾棰濅笉鑳戒负绌�");
+                }
+                if (row.getStatus() != null && row.getStatus() != 0 && row.getStatus() != 1) {
+                    throw new IllegalArgumentException("鐘舵�佸彧鑳藉~鍐� 0 鎴� 1");
+                }
+                MesProProcessSaveReqVO save = BeanUtils.toBean(row, MesProProcessSaveReqVO.class);
+                save.setStdTimeMode(parseStdTimeMode(row.getStdTimeModeName()));
+                save.setCode(code);
+                save.setName(row.getName().trim());
+                save.setStatus(row.getStatus() == null ? 0 : row.getStatus());
+                MesProProcessDO existing = processMapper.selectByCode(code);
+                if (existing == null) {
+                    createProcess(save);
+                    result.getCreateCodes().add(code);
+                } else if (updateSupport) {
+                    save.setId(existing.getId());
+                    updateProcess(save);
+                    result.getUpdateCodes().add(code);
+                } else {
+                    throw new IllegalArgumentException("宸ュ簭缂栫爜宸插瓨鍦紝鍕鹃�夎鐩栧悗鍙洿鏂�");
+                }
+            } catch (RuntimeException ex) {
+                result.getFailureCodes().put(key, ex.getMessage());
+            }
+        }
+        return result;
+    }
+
+    private Integer parseStdTimeMode(String value) {
+        if (value == null || value.isBlank()) return null;
+        String normalized = value.trim().replace(" ", "").replace("锛�", "脳").replace("*", "脳");
+        return switch (normalized) {
+            case "0", "鏈惎鐢�" -> 0;
+            case "1", "杞�熋楄妭璺�" -> 1;
+            case "2", "绾块�熷害鐩村彇" -> 2;
+            case "3", "婊¢�熺櫨鍒嗘瘮脳鑺傝窛" -> 3;
+            default -> throw new IllegalArgumentException("鏍囧噯宸ユ椂璁$畻鏂瑰紡璇峰~鍐欙細鏈惎鐢ㄣ�佽浆閫熋楄妭璺濄�佺嚎閫熷害鐩村彇銆佹弧閫熺櫨鍒嗘瘮脳鑺傝窛");
+        };
+    }
+
+    @Override
     public List<MesProProcessDO> getProcessListByStatus(Integer status) {
         return processMapper.selectListByStatus(status);
     }
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesService.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesService.java
index 139fad6..0b1a575 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesService.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesService.java
@@ -74,12 +74,7 @@
      */
     void submitReturnSales(Long id);
 
-    /**
-     * 鎵ц閫�璐э紙寰呮墽琛� -> 寰呬笂鏋讹級
-     *
-     * @param id 缂栧彿
-     */
-    void finishReturnSales(Long id);
+    void confirmReturnSales(Long id, Long warehouseId, Long locationId, Long areaId);
 
     /**
      * 鎵ц涓婃灦锛堝緟涓婃灦 -> 宸插畬鎴愶級锛屾洿鏂板簱瀛樺彴璐�
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java
index af8ffcd..d226616 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnsales/MesWmReturnSalesServiceImpl.java
@@ -12,6 +12,7 @@
 import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
 import cn.iocoder.yudao.module.mes.controller.admin.wm.returnsales.vo.MesWmReturnSalesPageReqVO;
 import cn.iocoder.yudao.module.mes.controller.admin.wm.returnsales.vo.MesWmReturnSalesSaveReqVO;
+import cn.iocoder.yudao.module.mes.controller.admin.wm.returnsales.vo.detail.MesWmReturnSalesDetailSaveReqVO;
 import cn.iocoder.yudao.module.mes.dal.dataobject.mdm.MesMdmItemDO;
 import cn.iocoder.yudao.module.mes.dal.dataobject.wm.returnsales.MesWmReturnSalesDO;
 import cn.iocoder.yudao.module.mes.dal.dataobject.wm.returnsales.MesWmReturnSalesDetailDO;
@@ -147,20 +148,40 @@
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void finishReturnSales(Long id) {
-        // 1.1 鏍¢獙瀛樺湪 + 寰呮墽琛岀姸鎬�
-        MesWmReturnSalesDO returnSales = validateReturnSalesExists(id);
+    public void confirmReturnSales(Long id, Long warehouseId, Long locationId, Long areaId) {
+        if (warehouseId == null || locationId == null || areaId == null) {
+            throw new cn.iocoder.yudao.framework.common.exception.ServiceException(400, "璇烽�夋嫨鍏ュ簱浠撳簱銆佸簱鍖哄拰搴撲綅");
+        }
+        MesWmReturnSalesDO returnSales = returnSalesMapper.selectByIdForUpdate(id);
+        if (returnSales == null) throw exception(WM_RETURN_SALES_NOT_EXISTS);
         if (ObjUtil.notEqual(MesWmReturnSalesStatusEnum.APPROVING.getStatus(), returnSales.getStatus())) {
             throw exception(WM_RETURN_SALES_STATUS_NOT_APPROVING);
         }
-        // 1.2 鏍¢獙鑷冲皯鏈変竴鏉¤
         List<MesWmReturnSalesLineDO> lines = returnSalesLineService.getReturnSalesLineListByReturnId(id);
-        if (CollUtil.isEmpty(lines)) {
-            throw exception(WM_RETURN_SALES_NO_LINE);
+        if (CollUtil.isEmpty(lines)) throw exception(WM_RETURN_SALES_NO_LINE);
+        if (CollUtil.isNotEmpty(returnSalesDetailService.getReturnSalesDetailListByReturnId(id))) {
+            throw new cn.iocoder.yudao.framework.common.exception.ServiceException(400, "閫�璐у崟宸叉湁涓婃灦鏄庣粏锛岃鎸夊師娴佺▼瀹屾垚");
         }
-        // 2. 鎵ц閫�璐э紙寰呮墽琛� -> 寰呬笂鏋讹級
+        // 鏄庣粏鏈嶅姟浼氭牎楠岃川妫�缁撴灉銆佸簱浣嶅眰绾с�佹贩鏀捐鍒欏拰鎵规銆�
         returnSalesMapper.updateById(new MesWmReturnSalesDO()
                 .setId(id).setStatus(MesWmReturnSalesStatusEnum.APPROVED.getStatus()));
+        for (MesWmReturnSalesLineDO line : lines) {
+            if (line.getNcrDispositionId() != null
+                    && Objects.equals(line.getQualityStatus(), MesWmQualityStatusEnum.FAIL.getStatus())) continue;
+            if (ObjUtil.notEqual(line.getQualityStatus(), MesWmQualityStatusEnum.PASS.getStatus())) {
+                throw exception(WM_RETURN_SALES_LINE_NOT_QUALIFIED);
+            }
+            MesWmReturnSalesDetailSaveReqVO detail = new MesWmReturnSalesDetailSaveReqVO();
+            detail.setReturnId(id);
+            detail.setLineId(line.getId());
+            detail.setItemId(line.getItemId());
+            detail.setQuantity(line.getQuantity());
+            detail.setWarehouseId(warehouseId);
+            detail.setLocationId(locationId);
+            detail.setAreaId(areaId);
+            returnSalesDetailService.createReturnSalesDetail(detail);
+        }
+        stockReturnSales(id);
     }
 
     @Override
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/salesnotice/MesWmSalesNoticeServiceImpl.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/salesnotice/MesWmSalesNoticeServiceImpl.java
index 885dec8..9a8c76f 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/salesnotice/MesWmSalesNoticeServiceImpl.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/salesnotice/MesWmSalesNoticeServiceImpl.java
@@ -153,38 +153,11 @@
             throw exception(WM_SALES_NOTICE_LINE_EMPTY);
         }
 
-        // 2. 鍏ㄥ眬鍏嶅鎵癸細鐩存帴杩涘叆寰呭嚭搴�
-        if (bpmProcessInstanceApi.isGlobalAutoApprove()) {
-            salesNoticeMapper.updateById(new MesWmSalesNoticeDO()
-                    .setId(id).setProcessInstanceId("").setStatus(APPROVED.getStatus()));
-            reserveSaleOrderOutStatus(notice);
-            return;
-        }
-
-        // 3. 蹇呴』閫夋嫨娴佺▼锛屼笖鍒嗙被涓嬪瓨鍦ㄦ縺娲荤殑娴佺▼瀹氫箟
-        if (StrUtil.isBlank(processDefinitionKey)) {
-            throw exception(WM_SALES_NOTICE_SUBMIT_PROCESS_KEY_REQUIRED);
-        }
-        validateSalesNoticeApproveCategoryAndProcessDefinition();
-        ProcessDefinition processDefinition = bpmProcessDefinitionService.getActiveProcessDefinition(processDefinitionKey);
-        // 鍖哄垎銆孠ey 涓嶅瓨鍦�/宸插仠鐢ㄣ�嶄笌銆屾祦绋嬪瓨鍦ㄤ絾涓嶅睘浜庡彂璐у鎵瑰垎绫汇�嶏紝鍒嗗埆缁欏嚭鍙墽琛岀殑鎻愮ず
-        if (processDefinition == null) {
-            throw exception(WM_SALES_NOTICE_BPM_PROCESS_KEY_INVALID, processDefinitionKey);
-        }
-        boolean inDeliveryCategory = bpmProcessDefinitionService
-                .getProcessDefinitionInfoListByCategory(SALES_DELIVERY_APPROVE_CATEGORY_CODE).stream()
-                .anyMatch(info -> Objects.equals(info.getProcessDefinitionId(), processDefinition.getId()));
-        if (!inDeliveryCategory) {
-            throw exception(WM_SALES_NOTICE_BPM_PROCESS_DEFINITION_NOT_IN_CATEGORY,
-                    StrUtil.blankToDefault(processDefinition.getName(), processDefinitionKey));
-        }
-
-        // 4. 鍒涘缓瀹℃壒娴佺▼瀹炰緥锛岃繘鍏ュ鎵逛腑
-        String processInstanceId = bpmProcessInstanceApi.createProcessInstance(userId, new BpmProcessInstanceCreateReqDTO()
-                .setProcessDefinitionKey(processDefinitionKey).setBusinessKey(String.valueOf(id))
-                .setVariables(Map.of("businessNo", notice.getCode())));
+        // 鍙戣揣閫氱煡鐢变粨搴撶‘璁ゅ悗鐩存帴鍑哄簱锛屼笉鍐嶅惎鍔ㄥ鎵规祦绋嬨��
         salesNoticeMapper.updateById(new MesWmSalesNoticeDO()
-                .setId(id).setProcessInstanceId(processInstanceId).setStatus(APPROVING.getStatus()));
+                .setId(id).setProcessInstanceId("").setStatus(APPROVED.getStatus()));
+        reserveSaleOrderOutStatus(notice);
+
     }
 
     @Override
diff --git a/yudao-module-mes/src/main/resources/templates/wm/sales-delivery.docx b/yudao-module-mes/src/main/resources/templates/wm/sales-delivery.docx
index 3f905e5..cef939b 100644
--- a/yudao-module-mes/src/main/resources/templates/wm/sales-delivery.docx
+++ b/yudao-module-mes/src/main/resources/templates/wm/sales-delivery.docx
Binary files differ

--
Gitblit v1.9.3