Commit 528166e43dcbd053627f49200a3a2122bfe23ef5
1 parent
b15edb4a
refactor(mes): 新增 mes_order_status 字典,替代 mes_qc_iqc_status
- 新增 MesOrderStatusEnum(草稿 0/已确认 1/审批中 2/已审批 3/已完成 4/已取消 5) - DictTypeConstants:MES_QC_IQC_STATUS → MES_ORDER_STATUS - IQC/IPQC/RQC ServiceImpl:import 及枚举引用更新,PREPARE → DRAFT,FINISHED 值由 1 → 4 - IQC/IPQC/RQC DO:status 字段 JavaDoc 更新,注明当前使用状态(DRAFT/FINISHED)与预留状态 - 新增 mes_qc_order_status.sql:字典数据初始化 + 存量 status=1 迁移至 status=4
Showing
8 changed files
with
32 additions
and
22 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/qc/ipqc/MesQcIpqcDO.java
| ... | ... | @@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| 5 | 5 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.workstation.MesMdWorkstationDO; |
| 6 | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderDO; |
| 7 | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateDO; |
| 8 | +import cn.iocoder.yudao.module.mes.enums.MesOrderStatusEnum; | |
| 8 | 9 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 9 | 10 | import com.baomidou.mybatisplus.annotation.TableId; |
| 10 | 11 | import com.baomidou.mybatisplus.annotation.TableName; |
| ... | ... | @@ -184,7 +185,8 @@ public class MesQcIpqcDO extends BaseDO { |
| 184 | 185 | /** |
| 185 | 186 | * 状态 |
| 186 | 187 | * |
| 187 | - * 枚举 {@link cn.iocoder.yudao.module.mes.enums.qc.MesQcIqcStatusEnum} | |
| 188 | + * 枚举 {@link MesOrderStatusEnum} | |
| 189 | + * 当前使用:{@link MesOrderStatusEnum#DRAFT}、{@link MesOrderStatusEnum#FINISHED} | |
| 188 | 190 | */ |
| 189 | 191 | private Integer status; |
| 190 | 192 | /** | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/qc/iqc/MesQcIqcDO.java
| ... | ... | @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.md.vendor.MesMdVendorDO; |
| 6 | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateDO; |
| 7 | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeDO; |
| 8 | 8 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeLineDO; |
| 9 | +import cn.iocoder.yudao.module.mes.enums.MesOrderStatusEnum; | |
| 9 | 10 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcSourceDocTypeEnum; |
| 10 | 11 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 11 | 12 | import com.baomidou.mybatisplus.annotation.TableId; |
| ... | ... | @@ -169,7 +170,8 @@ public class MesQcIqcDO extends BaseDO { |
| 169 | 170 | /** |
| 170 | 171 | * 状态 |
| 171 | 172 | * |
| 172 | - * 枚举 {@link cn.iocoder.yudao.module.mes.enums.qc.MesQcIqcStatusEnum} | |
| 173 | + * 枚举 {@link MesOrderStatusEnum} | |
| 174 | + * 当前使用:{@link MesOrderStatusEnum#DRAFT}、{@link MesOrderStatusEnum#FINISHED} | |
| 173 | 175 | */ |
| 174 | 176 | private Integer status; |
| 175 | 177 | /** | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/qc/rqc/MesQcRqcDO.java
| ... | ... | @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.mes.dal.dataobject.qc.rqc; |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | 4 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| 5 | 5 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateDO; |
| 6 | +import cn.iocoder.yudao.module.mes.enums.MesOrderStatusEnum; | |
| 6 | 7 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 7 | 8 | import com.baomidou.mybatisplus.annotation.TableId; |
| 8 | 9 | import com.baomidou.mybatisplus.annotation.TableName; |
| ... | ... | @@ -123,7 +124,8 @@ public class MesQcRqcDO extends BaseDO { |
| 123 | 124 | /** |
| 124 | 125 | * 状态 |
| 125 | 126 | * |
| 126 | - * 枚举 {@link cn.iocoder.yudao.module.mes.enums.qc.MesQcIqcStatusEnum} | |
| 127 | + * 枚举 {@link MesOrderStatusEnum} | |
| 128 | + * 当前使用:{@link MesOrderStatusEnum#DRAFT}、{@link MesOrderStatusEnum#FINISHED} | |
| 127 | 129 | */ |
| 128 | 130 | private Integer status; |
| 129 | 131 | /** | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/DictTypeConstants.java
| ... | ... | @@ -28,7 +28,7 @@ public interface DictTypeConstants { |
| 28 | 28 | String MES_PRO_LINK_TYPE = "mes_pro_link_type"; // MES 工序关系类型 |
| 29 | 29 | String MES_TIME_UNIT_TYPE = "mes_time_unit_type"; // MES 时间单位 |
| 30 | 30 | String MES_IPQC_TYPE = "mes_ipqc_type"; // MES IPQC 检验类型 |
| 31 | - String MES_QC_IQC_STATUS = "mes_qc_iqc_status"; // MES 检验单状态 | |
| 31 | + String MES_ORDER_STATUS = "mes_order_status"; // MES 单据状态(IQC/IPQC/OQC/RQC 通用) | |
| 32 | 32 | String MES_QC_CHECK_RESULT = "mes_qc_check_result"; // MES 检测结果 |
| 33 | 33 | String MES_QC_SOURCE_DOC_TYPE = "mes_qc_source_doc_type"; // MES 来源单据类型 |
| 34 | 34 | String MES_DV_CYCLE_TYPE = "mes_dv_cycle_type"; // MES 点检保养周期类型 | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/qc/MesQcIqcStatusEnum.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/MesOrderStatusEnum.java
| 1 | -package cn.iocoder.yudao.module.mes.enums.qc; | |
| 1 | +package cn.iocoder.yudao.module.mes.enums; | |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.core.ArrayValuable; |
| 4 | 4 | import lombok.AllArgsConstructor; |
| ... | ... | @@ -7,18 +7,22 @@ import lombok.Getter; |
| 7 | 7 | import java.util.Arrays; |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | - * MES 检验单状态枚举 | |
| 10 | + * MES 单据状态枚举 | |
| 11 | 11 | * |
| 12 | 12 | * @author 芋道源码 |
| 13 | 13 | */ |
| 14 | 14 | @Getter |
| 15 | 15 | @AllArgsConstructor |
| 16 | -public enum MesQcIqcStatusEnum implements ArrayValuable<Integer> { | |
| 16 | +public enum MesOrderStatusEnum implements ArrayValuable<Integer> { | |
| 17 | 17 | |
| 18 | - PREPARE(0, "草稿"), | |
| 19 | - FINISHED(1, "已完成"); | |
| 18 | + DRAFT(0, "草稿"), | |
| 19 | + CONFIRMED(1, "已确认"), | |
| 20 | + APPROVING(2, "审批中"), | |
| 21 | + APPROVED(3, "已审批"), | |
| 22 | + FINISHED(4, "已完成"), | |
| 23 | + CANCELLED(5, "已取消"); | |
| 20 | 24 | |
| 21 | - public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesQcIqcStatusEnum::getType).toArray(Integer[]::new); | |
| 25 | + public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesOrderStatusEnum::getType).toArray(Integer[]::new); | |
| 22 | 26 | |
| 23 | 27 | /** |
| 24 | 28 | * 状态值 | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/ipqc/MesQcIpqcServiceImpl.java
| ... | ... | @@ -11,7 +11,7 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.qc.ipqc.MesQcIpqcDO; |
| 11 | 11 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateDO; |
| 12 | 12 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.ipqc.MesQcIpqcMapper; |
| 13 | 13 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcDefectLevelEnum; |
| 14 | -import cn.iocoder.yudao.module.mes.enums.qc.MesQcIqcStatusEnum; | |
| 14 | +import cn.iocoder.yudao.module.mes.enums.MesOrderStatusEnum; | |
| 15 | 15 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcTypeEnum; |
| 16 | 16 | import cn.iocoder.yudao.module.mes.service.md.workstation.MesMdWorkstationService; |
| 17 | 17 | import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkOrderService; |
| ... | ... | @@ -76,7 +76,7 @@ public class MesQcIpqcServiceImpl implements MesQcIpqcService { |
| 76 | 76 | // 2. 插入主表 |
| 77 | 77 | MesQcIpqcDO ipqc = BeanUtils.toBean(createReqVO, MesQcIpqcDO.class); |
| 78 | 78 | ipqc.setItemId(workOrder.getProductId()); |
| 79 | - ipqc.setTemplateId(template.getId()).setStatus(MesQcIqcStatusEnum.PREPARE.getType()); | |
| 79 | + ipqc.setTemplateId(template.getId()).setStatus(MesOrderStatusEnum.DRAFT.getType()); | |
| 80 | 80 | ipqcMapper.insert(ipqc); |
| 81 | 81 | |
| 82 | 82 | // 3. 从模板指标自动生成检验行 |
| ... | ... | @@ -112,7 +112,7 @@ public class MesQcIpqcServiceImpl implements MesQcIpqcService { |
| 112 | 112 | // 2. 更新状态为已完成 |
| 113 | 113 | MesQcIpqcDO updateObj = new MesQcIpqcDO(); |
| 114 | 114 | updateObj.setId(id); |
| 115 | - updateObj.setStatus(MesQcIqcStatusEnum.FINISHED.getType()); | |
| 115 | + updateObj.setStatus(MesOrderStatusEnum.FINISHED.getType()); | |
| 116 | 116 | ipqcMapper.updateById(updateObj); |
| 117 | 117 | |
| 118 | 118 | // TODO @芋艿:IPQC 完成时的 PRO/WM 联动(报工反馈更新、产品产出单拆分),待 WM 模块迁移后对接 |
| ... | ... | @@ -149,7 +149,7 @@ public class MesQcIpqcServiceImpl implements MesQcIpqcService { |
| 149 | 149 | */ |
| 150 | 150 | private MesQcIpqcDO validateIpqcStatusPrepare(Long id) { |
| 151 | 151 | MesQcIpqcDO ipqc = validateIpqcExists(id); |
| 152 | - if (ObjUtil.notEqual(ipqc.getStatus(), MesQcIqcStatusEnum.PREPARE.getType())) { | |
| 152 | + if (ObjUtil.notEqual(ipqc.getStatus(), MesOrderStatusEnum.DRAFT.getType())) { | |
| 153 | 153 | throw exception(QC_IPQC_NOT_PREPARE); |
| 154 | 154 | } |
| 155 | 155 | return ipqc; | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/iqc/MesQcIqcServiceImpl.java
| ... | ... | @@ -13,7 +13,7 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateItemD |
| 13 | 13 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.iqc.MesQcIqcMapper; |
| 14 | 14 | import cn.iocoder.yudao.module.mes.enums.MesBizTypeConstants; |
| 15 | 15 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcDefectLevelEnum; |
| 16 | -import cn.iocoder.yudao.module.mes.enums.qc.MesQcIqcStatusEnum; | |
| 16 | +import cn.iocoder.yudao.module.mes.enums.MesOrderStatusEnum; | |
| 17 | 17 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcTypeEnum; |
| 18 | 18 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; |
| 19 | 19 | import cn.iocoder.yudao.module.mes.service.md.vendor.MesMdVendorService; |
| ... | ... | @@ -79,7 +79,7 @@ public class MesQcIqcServiceImpl implements MesQcIqcService { |
| 79 | 79 | iqc.setTemplateId(templateId); |
| 80 | 80 | iqc.setCheckQuantity(createReqVO.getQualifiedQuantity().add(createReqVO.getUnqualifiedQuantity())); |
| 81 | 81 | iqc.setInspectorUserId(inspectorUserId); |
| 82 | - iqc.setStatus(MesQcIqcStatusEnum.PREPARE.getType()); | |
| 82 | + iqc.setStatus(MesOrderStatusEnum.DRAFT.getType()); | |
| 83 | 83 | iqcMapper.insert(iqc); |
| 84 | 84 | |
| 85 | 85 | // 3. 从模板指标自动生成检验行 |
| ... | ... | @@ -118,7 +118,7 @@ public class MesQcIqcServiceImpl implements MesQcIqcService { |
| 118 | 118 | |
| 119 | 119 | // 2. 更新状态为已完成 |
| 120 | 120 | MesQcIqcDO updateObj = new MesQcIqcDO() |
| 121 | - .setId(id).setStatus(MesQcIqcStatusEnum.FINISHED.getType()); | |
| 121 | + .setId(id).setStatus(MesOrderStatusEnum.FINISHED.getType()); | |
| 122 | 122 | iqcMapper.updateById(updateObj); |
| 123 | 123 | |
| 124 | 124 | // 3. 回写来源单据 |
| ... | ... | @@ -180,7 +180,7 @@ public class MesQcIqcServiceImpl implements MesQcIqcService { |
| 180 | 180 | */ |
| 181 | 181 | private MesQcIqcDO validateIqcStatusPrepare(Long id) { |
| 182 | 182 | MesQcIqcDO iqc = validateIqcExists(id); |
| 183 | - if (ObjUtil.notEqual(iqc.getStatus(), MesQcIqcStatusEnum.PREPARE.getType())) { | |
| 183 | + if (ObjUtil.notEqual(iqc.getStatus(), MesOrderStatusEnum.DRAFT.getType())) { | |
| 184 | 184 | throw exception(QC_IQC_NOT_PREPARE); |
| 185 | 185 | } |
| 186 | 186 | return iqc; | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/rqc/MesQcRqcServiceImpl.java
| ... | ... | @@ -10,7 +10,7 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.qc.defectrecord.MesQcDefectRec |
| 10 | 10 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.rqc.MesQcRqcDO; |
| 11 | 11 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.template.MesQcTemplateDO; |
| 12 | 12 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.rqc.MesQcRqcMapper; |
| 13 | -import cn.iocoder.yudao.module.mes.enums.qc.MesQcIqcStatusEnum; | |
| 13 | +import cn.iocoder.yudao.module.mes.enums.MesOrderStatusEnum; | |
| 14 | 14 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcTypeEnum; |
| 15 | 15 | import cn.iocoder.yudao.module.mes.service.qc.defectrecord.MesQcDefectRecordService; |
| 16 | 16 | import cn.iocoder.yudao.module.mes.service.qc.template.MesQcTemplateService; |
| ... | ... | @@ -60,7 +60,7 @@ public class MesQcRqcServiceImpl implements MesQcRqcService { |
| 60 | 60 | |
| 61 | 61 | // 2. 插入主表 |
| 62 | 62 | MesQcRqcDO rqc = BeanUtils.toBean(createReqVO, MesQcRqcDO.class) |
| 63 | - .setStatus(MesQcIqcStatusEnum.PREPARE.getType()); | |
| 63 | + .setStatus(MesOrderStatusEnum.DRAFT.getType()); | |
| 64 | 64 | rqcMapper.insert(rqc); |
| 65 | 65 | |
| 66 | 66 | // 3. 从模板指标自动生成检验行 |
| ... | ... | @@ -94,7 +94,7 @@ public class MesQcRqcServiceImpl implements MesQcRqcService { |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | // 2. 更新状态为已完成 |
| 97 | - MesQcRqcDO updateObj = new MesQcRqcDO().setId(id).setStatus(MesQcIqcStatusEnum.FINISHED.getType()); | |
| 97 | + MesQcRqcDO updateObj = new MesQcRqcDO().setId(id).setStatus(MesOrderStatusEnum.FINISHED.getType()); | |
| 98 | 98 | rqcMapper.updateById(updateObj); |
| 99 | 99 | |
| 100 | 100 | // TODO @芋艿:WM 模块迁移后,更新来源退料/退货单行的质量状态 |
| ... | ... | @@ -131,7 +131,7 @@ public class MesQcRqcServiceImpl implements MesQcRqcService { |
| 131 | 131 | */ |
| 132 | 132 | private MesQcRqcDO validateRqcStatusPrepare(Long id) { |
| 133 | 133 | MesQcRqcDO rqc = validateRqcExists(id); |
| 134 | - if (ObjUtil.notEqual(rqc.getStatus(), MesQcIqcStatusEnum.PREPARE.getType())) { | |
| 134 | + if (ObjUtil.notEqual(rqc.getStatus(), MesOrderStatusEnum.DRAFT.getType())) { | |
| 135 | 135 | throw exception(QC_RQC_NOT_PREPARE); |
| 136 | 136 | } |
| 137 | 137 | return rqc; | ... | ... |