diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java
index 03c414b..2b39c2e 100644
--- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java
+++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java
@@ -211,4 +211,9 @@ public class MesConstants {
*/
public static final String MES_MATERIAL_ACTIVE_FLAG_NORMAL = "1";//正常
public static final String MES_MATERIAL_ACTIVE_FLAG_STOP = "0";//停用
+
+ /**
+ * 采购订单采购状态
+ */
+ public static final String MES_PURCHASE_ORDER_STATUS_TOPURCHASE = "1";//待采购
}
diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java
index 4de137b..f6ed17b 100644
--- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java
+++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java
@@ -32,16 +32,17 @@ public class Seq {
private static AtomicInteger productOutstockSeq = new AtomicInteger(1);
// 成品出库记录标识
- public static final String productInstockCode = "PI";
-
+ public static final String productOutstockCode = "PO";
// 成品入库记录序列类型
+
public static final String productInstockSeqType = "PRODUCTINSTOCK";
// 成品入库记录接口序列数
private static AtomicInteger productInstockSeq = new AtomicInteger(1);
// 成品入库记录标识
- public static final String productOutstockCode = "PO";
+ public static final String productInstockCode = "PI";
+
// 原材料出库记录序列类型
@@ -270,6 +271,17 @@ public class Seq {
// 仓储盘点记录标识
public static final String wmsInventoryCheckSeqCode = "IC";
+
+ // 停用物料信息的物料编码
+ public static final String stopUsingSeqType = "";
+
+ // 停用物料信息的接口序列数
+ private static AtomicInteger stopUsingSeq = new AtomicInteger(1);
+
+ // 停用物料信息的记录标识
+ public static final String stopUsingCode = "DEL";
+
+
/**
* 获取通用序列号
*
@@ -376,6 +388,8 @@ public class Seq {
atomicInt = wmsInventoryCheckSeq;
}else if (mesBindBarcodeSeqType.equals(type)) {
atomicInt = mesBindBarcodeSeq;
+ }else if (stopUsingSeqType.equals(type)) {
+ atomicInt = stopUsingSeq;
}
return getId(atomicInt, 3, code);
}
diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java
index 7478820..405833b 100644
--- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java
+++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java
@@ -7,6 +7,7 @@ import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
+import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.MesOrderBind;
@@ -94,6 +95,18 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
// throw new ServiceException("此物料已经有采购订单和销售订单绑定信息,不能修改");
// }
+ MesBaseMaterialInfo dbMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(mesBaseMaterialInfo.getMaterialId());
+ String dbActiveFlag = dbMaterialInfo.getActiveFlag();
+ if (!dbActiveFlag.equals(mesBaseMaterialInfo.getActiveFlag())) {
+ if (dbActiveFlag.equals(MesConstants.MES_MATERIAL_ACTIVE_FLAG_NORMAL)) {
+ mesBaseMaterialInfo.setOldMaterialCode(mesBaseMaterialInfo.getMaterialCode());
+ mesBaseMaterialInfo.setMaterialCode(Seq.getId(Seq.stopUsingSeqType, Seq.stopUsingCode));
+ }
+
+ if (!dbActiveFlag.equals(MesConstants.MES_MATERIAL_ACTIVE_FLAG_NORMAL)) {
+ throw new ServiceException("非正常状态的物料信息不能再修改状态");
+ }
+ }
mesBaseMaterialInfo.setUpdateTime(DateUtils.getNowDate());
mesBaseMaterialInfo.setUpdateBy(SecurityUtils.getUsername());
diff --git a/hw-ui/src/views/mes/materialinfo/index.vue b/hw-ui/src/views/mes/materialinfo/index.vue
index abc55c6..696a1e1 100644
--- a/hw-ui/src/views/mes/materialinfo/index.vue
+++ b/hw-ui/src/views/mes/materialinfo/index.vue
@@ -147,6 +147,7 @@
+
@@ -241,7 +242,7 @@
-
+
+
+