Commit 1ea8dd17984f3fe89513c3a8492fba8ae91e8e04

Authored by YunaiV
1 parent b7479013

✨ feat(mes): 更新销售出库单状态枚举及相关逻辑

新增待填写运单状态,优化销售出库单状态描述,调整相关方法注释以提高可读性。同时,更新前端表单以支持填写运单功能,确保用户体验一致性。
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/wm/MesWmProductSalesStatusEnum.java
1 1 package cn.iocoder.yudao.module.mes.enums.wm;
2 2  
3 3 import cn.iocoder.yudao.framework.common.core.ArrayValuable;
  4 +import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProductSalesSaveReqVO;
4 5 import cn.iocoder.yudao.module.mes.enums.MesOrderStatusConstants;
  6 +import cn.iocoder.yudao.module.mes.service.wm.productsales.MesWmProductSalesService;
5 7 import lombok.AllArgsConstructor;
6 8 import lombok.Getter;
7 9  
... ... @@ -10,30 +12,46 @@ import java.util.Arrays;
10 12 /**
11 13 * MES 销售出库单状态枚举
12 14 *
  15 + * 对应字典 mes_wm_product_sales_status
  16 + *
13 17 * @author 芋道源码
14 18 */
15 19 @Getter
16 20 @AllArgsConstructor
17 21 public enum MesWmProductSalesStatusEnum implements ArrayValuable<Integer> {
18 22  
  23 + // (草稿)提交 =》(待拣货)执行拣货 =》(待填写运单)填写运单;=》(待执行出库)执行出库=》(已完成)
  24 +
19 25 /**
20 26 * 草稿
  27 + *
  28 + * 对应方法:{@link MesWmProductSalesService#createProductSales(MesWmProductSalesSaveReqVO)}
21 29 */
22 30 PREPARE(MesOrderStatusConstants.PREPARE, "草稿"),
23 31 /**
24 32 * 待拣货
  33 + *
  34 + * 对应方法:{@link MesWmProductSalesService#submitProductSales(Long)}
25 35 */
26 36 APPROVING(MesOrderStatusConstants.APPROVING, "待拣货"),
  37 + // TODO @AI:在 APPROVING、APPROVED 之间加一个 10,SHIPPING,待填写运单;执行填写运单方法:{@link MesWmProductSalesService#shippingProductSales(Long)}
  38 + // TODO @AI:pick 这个方法要改成 stock;
27 39 /**
28   - * 待出库
  40 + * 待执行出库
  41 + *
  42 + * 对应方法:{@link MesWmProductSalesService#pickProductSales(Long)}
29 43 */
30   - APPROVED(MesOrderStatusConstants.APPROVED, "待出库"),
  44 + APPROVED(MesOrderStatusConstants.APPROVED, "待执行出库"),
31 45 /**
32 46 * 已完成
  47 + *
  48 + * 对应方法:{@link MesWmProductSalesService#executeProductSales(Long)}
33 49 */
34 50 FINISHED(MesOrderStatusConstants.FINISHED, "已完成"),
35 51 /**
36 52 * 已取消
  53 + *
  54 + * 对应方法:{@link MesWmProductSalesService#cancelProductSales(Long)}
37 55 */
38 56 CANCELED(MesOrderStatusConstants.CANCELLED, "已取消");
39 57  
... ...
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesServiceImpl.java
... ... @@ -117,6 +117,7 @@ public class MesWmProductSalesServiceImpl implements MesWmProductSalesService {
117 117 .setId(id).setStatus(MesWmProductSalesStatusEnum.APPROVING.getStatus()));
118 118 }
119 119  
  120 + // TODO @AI:前后端方法名,都改成 stock;保持整体都是对齐的;
120 121 @Override
121 122 @Transactional(rollbackFor = Exception.class)
122 123 public void pickProductSales(Long id) {
... ... @@ -126,6 +127,7 @@ public class MesWmProductSalesServiceImpl implements MesWmProductSalesService {
126 127 throw exception(WM_PRODUCT_SALES_CANNOT_PICK);
127 128 }
128 129 // 校验每行明细数量之和是否等于行出库数量
  130 + // TODO @AI:这里挪成独立的 checkQuantiy 接口,不在这个方法里,保持对齐;然后前端调用;类似 /Users/yunai/Java/yudao-all-in-one/yudao-ui-admin-vue3/src/views/mes/wm/returnvendor/ReturnVendorForm.vue 这种;
129 131 List<MesWmProductSalesLineDO> lines = productSalesLineService.getProductSalesLineListBySalesId(id);
130 132 for (MesWmProductSalesLineDO line : lines) {
131 133 List<MesWmProductSalesDetailDO> details = productSalesDetailService.getProductSalesDetailListByLineId(line.getId());
... ...