Ver código fonte

优化后台,增加PDAGP12拍照质量校验和提交工位结果

sunxianglong 1 mês atrás
pai
commit
133e8f9018

+ 24 - 10
src/main/java/com/jeesite/modules/mes/web/MesProductGp12Controller.java

@@ -17,9 +17,11 @@ import com.jeesite.modules.mes.resp.ParamsResp;
 import com.jeesite.modules.mes.service.MesProductRecordService;
 import com.jeesite.modules.sys.entity.User;
 import com.jeesite.modules.sys.utils.UserUtils;
+import com.jeesite.modules.utils.ErrorMsg;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.validation.annotation.Validated;
@@ -56,6 +58,11 @@ public class MesProductGp12Controller extends BaseController {
 
 	@Autowired
 	private MesProductRecordService mesProductRecordService;
+
+	@Lazy
+	@Autowired
+	private MesProductRecordController mesProductRecordController;
+
 	/**
 	 * 获取数据
 	 */
@@ -196,7 +203,23 @@ public class MesProductGp12Controller extends BaseController {
 		List<MesProductGp12> list = mesProductGp12Service.findList(mesProductGp12);
 		if (list.size() > 0){return renderResult(Global.FALSE, "该记录已存在");}
 
+		String stationOprno = oprno;
+		if (stationOprno.length() == 5) {
+			stationOprno = stationOprno + "A";
+		}
+		String userCode = "";
+		User user = UserUtils.getUser();
+		if (user != null && StringUtils.isNotBlank(user.getUserCode())) {
+			userCode = user.getUserCode();
+		}
 
+		// 提交工位结果前先做质量校验,通过后才允许继续
+		String ret = mesProductRecordController.checkQualityCommon(stationOprno, sn, lineSn, userCode);
+		String checkret = ret.substring(3, 5);
+		if (!"UD".equals(checkret)) {
+			String lx = ret.substring(0, 3);
+			return renderResult(Global.FALSE, ErrorMsg.getErrorMsg(checkret, lx));
+		}
 
 		// 向数据库添加数据
 		MesProductGp12 entry = new MesProductGp12();
@@ -208,16 +231,7 @@ public class MesProductGp12Controller extends BaseController {
 
 		FileUploadUtils.saveFileUpload(entry, entry.getId(), "mesProductGp12_image");
 
-		// 图片提交成功后,将该工位结果提交为 OK
-		String stationOprno = oprno;
-		if (stationOprno.length() == 5) {
-			stationOprno = stationOprno + "A";
-		}
-		String userCode = "";
-		User user = UserUtils.getUser();
-		if (user != null && StringUtils.isNotBlank(user.getUserCode())) {
-			userCode = user.getUserCode();
-		}
+		// 质量校验通过且图片提交成功后,将该工位结果提交为 OK
 		try {
 			List<ParamsResp> params = new ArrayList<>();
 			List<BindMaterialResp> bmlists = new ArrayList<>();

+ 6 - 6
src/main/resources/config/application.yml

@@ -53,8 +53,8 @@ jdbc:
   # Mysql 数据库配置
   type: mysql
   driver: com.mysql.cj.jdbc.Driver
-  url: jdbc:mysql://127.0.0.1:3306/mes_cloud_ljr?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
-#  url: jdbc:mysql://10.0.20.10:3306/mes_cloud_ljr?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+#  url: jdbc:mysql://127.0.0.1:3306/mes_cloud_ljr?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+  url: jdbc:mysql://10.0.20.10:3306/mes_cloud_ljr?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
 #  url: jdbc:mysql://192.168.22.99:3306/mes_cloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
 #  username: mes_cloud
 #  password: YD57bSRabiyWBwkZ
@@ -1106,7 +1106,7 @@ mes:
       password: oPCuA_123
     # FSW Modbus TCP 握手(工件码质量校验 + 过程参数采集)
     modbus:
-      enabled: true
+#      enabled: true
       host: 10.0.40.101
       port: 502
       unitId: 1
@@ -1115,21 +1115,21 @@ mes:
   # 框架气密 S7 采集(OP360)
   framework:
     qm:
-      enabled: true
+#      enabled: true
       plc:
         ip: 10.0.20.96
       oprno: OP360
       lineSn: XT
   # 涂胶 S7 采集(OP220)
   tj:
-    enabled: true
+#    enabled: true
     plc:
       ip: 10.0.40.100
     oprno: OP220
     lineSn: XT
     # 涂胶 S7 采集(OP240B)
     b:
-      enabled: true
+#      enabled: true
       plc:
         ip: 10.0.40.100
       oprno: OP240

+ 1 - 0
src/main/resources/views/modules/mes/mesProductFswList.html

@@ -105,6 +105,7 @@ $('#dataGrid').dataGrid({
 		{header:'${text("焊接压力")}', name:'pressure', index:'a.pressure', width:150, align:"left"},
 		{header:'${text("偏移量")}', name:'pyl', index:'a.pyl', width:150, align:"left"},
 		{header:'${text("B轴角度")}', name:'jd', index:'a.jd', width:150, align:"left"},
+		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
 		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
 			var actions = [];
 			//<% if(hasPermi('mes:mesProductFsw:edit')){ %>

+ 1 - 0
src/main/resources/views/modules/mes/mesProductQmzcList.html

@@ -140,6 +140,7 @@ $('#dataGrid').dataGrid({
 		{header:'${text("框架保压时间")}', name:'bysj', index:'a.bysj', width:150, align:"left"},
 		{header:'${text("框架测试结果")}', name:'result', index:'a.result', width:150, align:"left"},
 		{header:'${text("水冷板测试结果")}', name:'ylbResult', index:'a.ylb_result', width:150, align:"left"},
+		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
 		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
 			var actions = [];
 			//<% if(hasPermi('mes:mesProductQmzc:edit')){ %>

+ 1 - 0
src/main/resources/views/modules/mes/mesProductTjList.html

@@ -70,6 +70,7 @@ $('#dataGrid').dataGrid({
 		{header:'${text("涂胶速度")}', name:'tjSpeed', index:'a.tj_speed', width:150, align:"left"},
 		{header:'${text("涂胶长度")}', name:'tjLength', index:'a.tj_length', width:150, align:"left"},
 		{header:'${text("涂胶序号")}', name:'tjData', index:'a.tj_data', width:150, align:"left"},
+		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
 		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
 			var actions = [];
 			//<% if(hasPermi('mes:mesProductTj:edit')){ %>

+ 1 - 0
src/main/resources/views/modules/mes/mesProductVoltageList.html

@@ -91,6 +91,7 @@ $('#dataGrid').dataGrid({
 		{header:'${text("电阻")}', name:'resistance', index:'a.resistance', width:150, align:"left"},
 		{header:'${text("检测结果")}', name:'result', index:'a.result', width:150, align:"left"},
 		{header:'${text("检测次数")}', name:'time', index:'a.time', width:150, align:"left"},
+		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
 		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
 			var actions = [];
 			//<% if(hasPermi('mes:mesProductVoltage:edit')){ %>

+ 1 - 0
src/main/resources/views/modules/mes/mesScrewInfoList.html

@@ -73,6 +73,7 @@ $('#dataGrid').dataGrid({
 		{header:'${text("产线编号")}', name:'lineSn', index:'a.line_sn', width:150, align:"left"},
 		{header:'${text("批次")}', name:'batch', index:'a.batch', width:150, align:"left"},
 		{header:'${text("总数")}', name:'count', index:'a.count', width:150, align:"center"},
+		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
 		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
 			var actions = [];
 			//<% if(hasPermi('mes:mesScrewInfo:edit')){ %>