Ver Fonte

x13-配置OP420等待OP390时长

张田野 há 2 semanas atrás
pai
commit
9e2f52b2db

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

@@ -3431,6 +3431,36 @@ public class MesProductRecordController extends BaseController {
 
 
 			if (CommonUitl.formatOprno(oprno).equals("OP420")){
+				// OP390 加工完成(100000=OK)后,需等待配置时长才能 OP420 扫码
+				String waitOp390Check = Global.getConfig("mes.op420.wait.op390.check", "0");
+				if ("1".equals(waitOp390Check)) {
+					int waitMinutes = 15;
+					try {
+						waitMinutes = Integer.parseInt(Global.getConfig("mes.op420.wait.op390.minutes", "15").trim());
+					} catch (Exception e) {
+						waitMinutes = 15;
+					}
+					MesProductRecord op390Query = new MesProductRecord();
+					op390Query.setSn(sn);
+					op390Query.setOprno("OP390");
+					op390Query.setCraft("100000");
+					op390Query.setContent("OK");
+					op390Query.setLineSn(lineSn);
+					MesProductRecord op390Record = mesProductRecordService.findInfo(op390Query);
+					if (ObjectUtils.isEmpty(op390Record) || op390Record.getUpdateDate() == null) {
+						hashMap.put("Message", "OP390未加工");
+						hashMap.put("Result", "Fail");
+						return hashMap;
+					}
+					long differenceInMillis = System.currentTimeMillis() - op390Record.getUpdateDate().getTime();
+					long needMillis = waitMinutes * 60L * 1000L;
+					if (differenceInMillis < needMillis) {
+						hashMap.put("Message", "静置" + waitMinutes + "分钟时间未到");
+						hashMap.put("Result", "Fail");
+						return hashMap;
+					}
+				}
+
 				MesDeviceTime mesDeviceTime = new MesDeviceTime();
 				mesDeviceTime.setSn(sn);
 				mesDeviceTime.setProductCate(lineSn);

+ 6 - 2
src/main/resources/views/modules/mes/mesTorsionalProcessList.html

@@ -39,7 +39,7 @@
 				<div class="form-group">
 					<label class="control-label">${text('结果')}:</label>
 					<div class="control-inline">
-						<#form:input path="result" maxlength="50" class="form-control width-120"/>
+						<#form:select path="result" dictType="mes_torsional_result" blankOption="true" class="form-control width-120"/>
 					</div>
 				</div>
 				<div class="form-group">
@@ -74,7 +74,11 @@ $('#dataGrid').dataGrid({
 		{header:'${text("扭矩")}', name:'torque', index:'a.torque', width:150, align:"center"},
 		{header:'${text("number")}', name:'number', index:'a.number', width:150, align:"center"},
 		{header:'${text("角度")}', name:'angle', index:'a.angle', width:150, align:"center"},
-		{header:'${text("结果")}', name:'result', index:'a.result', width:150, align:"center"},
+		{header:'${text("结果")}', name:'result', index:'a.result', width:150, align:"center", formatter: function(val){
+			// 库内仍为 p/f,页面映射为 OK/NG;大小写兼容
+			var key = (val == null || val === '') ? '' : ('' + val).toLowerCase();
+			return js.getDictLabel(${@DictUtils.getDictListJson('mes_torsional_result')}, key, val || '', true);
+		}},
 		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
 		{header:'${text("创建人")}', name:'createBy', index:'a.create_by', width:150, align:"center"},
 		// {header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){