张田野 3 дней назад
Родитель
Сommit
575ae71442

+ 7 - 3
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -1572,7 +1572,7 @@ public class MesProductRecordController extends BaseController {
 
 		}
 
-		// OP350:OP320生产完成满1小时才允许加工
+		// OP350:OP320生产完成后满 OP320.guHuaTime(分钟)才允许加工
 		if (oprno.equals("OP350")) {
 			String isOpen350 = Global.getConfig("mes.OP350OneTime.isOpen");
 			if ("1".equalsIgnoreCase(isOpen350)) {
@@ -1585,9 +1585,13 @@ public class MesProductRecordController extends BaseController {
 				op320DeviceTimeQuery.getSqlMap().getOrder().setOrderBy("a.end_date desc");
 				MesDeviceTime op320DeviceTime = mesDeviceTimeService.findInfo(op320DeviceTimeQuery);
 				if (!ObjectUtils.isEmpty(op320DeviceTime) && op320DeviceTime.getEndDate() != null) {
-					long oneHourInMillis = 1L * 60 * 60 * 1000;
+					String guHuaTime = Global.getConfig("OP320.guHuaTime");
+					if (StringUtils.isEmpty(guHuaTime)) {
+						guHuaTime = "150"; // 与 ProductGh 默认一致,单位:分钟
+					}
+					long waitInMillis = Integer.parseInt(guHuaTime.trim()) * 60L * 1000L;
 					long timeDifference = System.currentTimeMillis() - op320DeviceTime.getEndDate().getTime();
-					op320TimeOk = timeDifference >= oneHourInMillis;
+					op320TimeOk = timeDifference >= waitInMillis;
 				}
 				if (!op320TimeOk) {
 					return "RSG1";

+ 8 - 1
src/main/java/com/jeesite/modules/utils/ErrorMsg.java

@@ -1,5 +1,8 @@
 package com.jeesite.modules.utils;
 
+import com.jeesite.common.config.Global;
+import com.jeesite.common.lang.StringUtils;
+
 public class ErrorMsg {
     public static String getErrorMsg(String processMsgRet,String lx){
         String lmsg = "该工件本工位不可加工";
@@ -57,7 +60,11 @@ public class ErrorMsg {
             } else if (processMsgRet.equalsIgnoreCase("PZ")) {
                 lmsg = "请先上传照片";
             } else if (processMsgRet.equalsIgnoreCase("G1")) {
-                lmsg = "OP320生产完成未满1小时,本工位不可加工";
+                String guHuaTime = Global.getConfig("OP320.guHuaTime");
+                if (StringUtils.isEmpty(guHuaTime)) {
+                    guHuaTime = "150";
+                }
+                lmsg = "OP320生产完成未满" + guHuaTime.trim() + "分钟,本工位不可加工";
             } else if (processMsgRet.equalsIgnoreCase("G2")) {
                 lmsg = "OP360生产完成未满2小时,本工位不可加工";
             } else if (processMsgRet.equalsIgnoreCase("SJ")) {