소스 검색

OP320,OP360静置

day01-init 2 주 전
부모
커밋
d377bb9f66

+ 48 - 0
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -1413,6 +1413,9 @@ public class MesProductRecordController extends BaseController {
 		if(mesLineProcess1.getRepeat().equals("1") && (ret.equals(bs+"OK") || ret.equals(bs+"NG"))){ // 可重复工作
 			ret = "RSUD";
 		}
+
+
+
 //		//判断是否属于可做三次气密检测的工位    mes_qm_maxNumber次数    	mes_qm_oprnos工位
 //	   String qmOprnos = Global.getConfig("mes_qm_oprnos");
 //		if(!StringUtils.isEmpty(qmOprnos) && qmOprnos.contains(CommonUitl.formatOprno(oldOprno))){
@@ -1564,6 +1567,51 @@ public class MesProductRecordController extends BaseController {
 
 		}
 
+		// OP350:OP320生产完成满1小时才允许加工
+		if (oprno.equals("OP350")) {
+			String isOpen350 = Global.getConfig("mes.OP350OneTime.isOpen");
+			if ("1".equalsIgnoreCase(isOpen350)) {
+				boolean op320TimeOk = false;
+				MesDeviceTime op320DeviceTimeQuery = new MesDeviceTime();
+				op320DeviceTimeQuery.setSn(sn);
+				op320DeviceTimeQuery.setProductCate(lineSn);
+				op320DeviceTimeQuery.getSqlMap().getWhere().and("a.oprno", QueryType.RIGHT_LIKE, "OP320");
+				op320DeviceTimeQuery.getSqlMap().getWhere().and("end_date", QueryType.IS_NOT_NULL, null);
+				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;
+					long timeDifference = System.currentTimeMillis() - op320DeviceTime.getEndDate().getTime();
+					op320TimeOk = timeDifference >= oneHourInMillis;
+				}
+				if (!op320TimeOk) {
+					return "RSG1";
+				}
+			}
+		}
+
+		// OP380:OP360生产完成满2小时才允许加工
+		if (oprno.equals("OP380")) {
+			String isOpen380 = Global.getConfig("mes.OP380TwoTime.isOpen");
+			if ("1".equalsIgnoreCase(isOpen380)) {
+				boolean op360TimeOk = false;
+				MesDeviceTime op360DeviceTimeQuery = new MesDeviceTime();
+				op360DeviceTimeQuery.setSn(sn);
+				op360DeviceTimeQuery.setProductCate(lineSn);
+				op360DeviceTimeQuery.getSqlMap().getWhere().and("a.oprno", QueryType.RIGHT_LIKE, "OP360");
+				op360DeviceTimeQuery.getSqlMap().getWhere().and("end_date", QueryType.IS_NOT_NULL, null);
+				op360DeviceTimeQuery.getSqlMap().getOrder().setOrderBy("a.end_date desc");
+				MesDeviceTime op360DeviceTime = mesDeviceTimeService.findInfo(op360DeviceTimeQuery);
+				if (!ObjectUtils.isEmpty(op360DeviceTime) && op360DeviceTime.getEndDate() != null) {
+					long twoHoursInMillis = 2L * 60 * 60 * 1000;
+					long timeDifference = System.currentTimeMillis() - op360DeviceTime.getEndDate().getTime();
+					op360TimeOk = timeDifference >= twoHoursInMillis;
+				}
+				if (!op360TimeOk) {
+					return "RSG2";
+				}
+			}
+		}
 		// CCD工位 OP510 NG样件开班点检(时间窗口与气密一致,开始时间提前1小时)
 		if ("OP510".equals(oprno1)) {
 			String ccdCheck = Global.getConfig("mes.ccd.check");

+ 3 - 3
src/main/java/com/jeesite/modules/scheduling/ProductGh.java

@@ -39,8 +39,8 @@ public class ProductGh {
             String[] states = new String[6];
             states[0] = "OP320"; // 恒温静置
             states[1] = "OP320A";
-            states[2] = "OP360";
-            states[3] = "OP360A";
+            states[2] = "OP370";
+            states[3] = "OP370A";
             states[4] = "OP410";
             states[5] = "OP410A";
             mesDeviceTime.getSqlMap().getWhere().and("oprno", QueryType.IN,states).and("interval",QueryType.EQ,0);
@@ -57,7 +57,7 @@ public class ProductGh {
                 if (CommonUitl.formatOprno(deviceTime.getOprno()).equals("OP320")) {
                     guHuatTime = Global.getConfig("OP320.guHuaTime");
                 } else if (CommonUitl.formatOprno(deviceTime.getOprno()).equals("OP370")) {
-                    guHuatTime = Global.getConfig("OP360.guHuaTime");
+                    guHuatTime = Global.getConfig("OP370.guHuaTime");
                 } else if (CommonUitl.formatOprno(deviceTime.getOprno()).equals("OP410")) {
                     guHuatTime = Global.getConfig("OP410.guHuaTime");
                 }

+ 4 - 0
src/main/java/com/jeesite/modules/utils/ErrorMsg.java

@@ -56,6 +56,10 @@ public class ErrorMsg {
                 lmsg = "恒温4h未扫码";
             } else if (processMsgRet.equalsIgnoreCase("PZ")) {
                 lmsg = "请先上传照片";
+            } else if (processMsgRet.equalsIgnoreCase("G1")) {
+                lmsg = "OP320生产完成未满1小时,本工位不可加工";
+            } else if (processMsgRet.equalsIgnoreCase("G2")) {
+                lmsg = "OP360生产完成未满2小时,本工位不可加工";
             } else if (processMsgRet.equalsIgnoreCase("SJ")) {
                 lmsg = "OKNG样件未进行开班点检";
             } else if (processMsgRet.equalsIgnoreCase("YH")) {