Просмотр исходного кода

Merge branch 'master' of http://121.36.46.135:3000/mes-x13/mescloud

hzd 3 недель назад
Родитель
Сommit
bfae17b03a

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
api.http


+ 10 - 0
src/main/java/com/jeesite/modules/mes/entity/MesProductRecord.java

@@ -84,6 +84,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	private String oprnoTitle;
 	private String source;;//修改来源
 	private String oprno2;
+	private String oprnoName; // 工位名称
 	private List imgList = ListUtils.newArrayList();
 	private List fileList = ListUtils.newArrayList();
 
@@ -91,6 +92,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	@ExcelFields({
 			@ExcelField(title="工件码", attrName="sn", align= ExcelField.Align.CENTER, sort=10),
 			@ExcelField(title="工位号", attrName="oprno", align= ExcelField.Align.CENTER, sort=20),
+			@ExcelField(title="工位名称", attrName="oprnoName", align= ExcelField.Align.CENTER, sort=25),
 			@ExcelField(title="工艺号", attrName="craft", align= ExcelField.Align.CENTER, sort=30),
 			@ExcelField(title="报文名称", attrName="title", align= ExcelField.Align.CENTER, sort=40),
 			@ExcelField(title="结果", attrName="content", align= ExcelField.Align.CENTER, sort=50),
@@ -354,4 +356,12 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setFileList(List fileList) {
 		this.fileList = fileList;
 	}
+
+	public String getOprnoName() {
+		return oprnoName;
+	}
+
+	public void setOprnoName(String oprnoName) {
+		this.oprnoName = oprnoName;
+	}
 }

+ 28 - 0
src/main/java/com/jeesite/modules/mes/service/MesProductRecordService.java

@@ -13,6 +13,8 @@ import com.jeesite.common.config.Global;
 import com.jeesite.common.lang.StringUtils;
 import com.jeesite.common.mybatis.mapper.query.QueryType;
 import com.jeesite.common.service.ServiceException;
+import com.jeesite.modules.file.entity.FileUpload;
+import com.jeesite.modules.file.service.FileUploadService;
 import com.jeesite.modules.file.utils.FileUploadUtils;
 import com.jeesite.modules.mes.dao.*;
 import com.jeesite.modules.mes.entity.*;
@@ -47,6 +49,9 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 	private MesProductCateService mesProductCateService;
 
 	@Autowired
+	private FileUploadService fileUploadService;
+	@Autowired
+
 	private MesTemplateItemsService mesTemplateItemsService;
 
 	@Autowired
@@ -533,6 +538,29 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 		return "RSNS";
 	}
 
+	public boolean checkOP500Photo(String sn,String lineSn){
+
+		MesProductRecord mesProductRecord=new MesProductRecord();
+		mesProductRecord.setSn(sn);
+		mesProductRecord.setLineSn(lineSn);
+		mesProductRecord.setOprno("OP500A");
+		mesProductRecord.setCraft("100000");
+		MesProductRecord mesProductRecord1 = findInfo(mesProductRecord);
+		if (mesProductRecord1==null){
+			return false;
+		}
+
+		FileUpload fu = new FileUpload();
+		fu.setBizKey(mesProductRecord1.getId());
+		fu.setBizType("mesProductRecord_image");
+		List<FileUpload> finfo = fileUploadService.findList(fu);
+		if (finfo.isEmpty()){
+			return false;
+		}
+		return true;
+	}
+
+
 	// 多个件同时工作
 	@Transactional
 	public void updateMultipleRecords(String sn, String oprno, String craft, String content, String userCode, List<ParamsResp> paramsResps,String lineSn,List<BindMaterialResp> bmlists){

+ 26 - 2
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -362,7 +362,22 @@ public class MesProductRecordController extends BaseController {
 			if(!ObjectUtils.isEmpty(mt)){
 				page.getList().get(i).setMessageType(mt.getCate());
 				page.getList().get(i).setTitle(mt.getTitle());
-
+			}
+			// 根据工位号和产线编号查询工位名称
+			MesProductRecord record = page.getList().get(i);
+			if(!StringUtils.isEmpty(record.getOprno()) && !StringUtils.isEmpty(record.getLineSn())){
+				// 先用原始工位号查询,查不到再尝试补A查询
+				MesLineProcess lpQuery = new MesLineProcess();
+				lpQuery.setOprno(record.getOprno());
+				lpQuery.setLineSn(record.getLineSn());
+				MesLineProcess mesLineProcess = mesLineProcessService.findInfo(lpQuery);
+				if(ObjectUtils.isEmpty(mesLineProcess) && record.getOprno().length() == 5){
+					lpQuery.setOprno(record.getOprno() + "A");
+					mesLineProcess = mesLineProcessService.findInfo(lpQuery);
+				}
+				if(!ObjectUtils.isEmpty(mesLineProcess)){
+					record.setOprnoName(mesLineProcess.getTitle());
+				}
 			}
 		}
 		return page;
@@ -3700,13 +3715,13 @@ public class MesProductRecordController extends BaseController {
 			return CommonUitl.getXml("NG;参数错误;");
 		}
 
+
 		String[] commands = commandString.split(";", -1);
 		// 01--序号检查  04--结果上传  05--序号过站
 		if (!commands[0].equals("01") && !commands[0].equals("04") && !commands[0].equals("05")) {
 			return CommonUitl.getXml("NG;命令错误;");
 		} else {
 			if (("01").equals(commands[0])) {
-
 				if (commands.length != 8 ) {
 					return CommonUitl.getXml("NG;长度错误;");
 				}
@@ -3715,12 +3730,20 @@ public class MesProductRecordController extends BaseController {
 				String lineSn = "XT";
 				String oldOprno = oprno;
 				oprno = CommonUitl.formatOprno(oprno);
+
+
 				if (StringUtils.isEmpty(sn)) {
 					return CommonUitl.getXml("NG;工件码不能为空;");
 				}
 				if (StringUtils.isEmpty(oprno)) {
 					return CommonUitl.getXml("NG;工位号不能为空;");
 				}
+				boolean checkOP500Photo = mesProductRecordService.checkOP500Photo(sn, lineSn);
+
+				if (!checkOP500Photo){
+					return CommonUitl.getXml("OP500未拍照或未加工");
+				}
+
 				String userCode = commands[1];
 				String ret = checkQualityResult(oldOprno, sn, lineSn, userCode);
 				if (ret.equals("RSUD")) {
@@ -3756,6 +3779,7 @@ public class MesProductRecordController extends BaseController {
 		return CommonUitl.getXml("NG;参数错误;");
 	}
 
+
 	@PostMapping(value = "cc")
 	@ResponseBody
 	public String cc(HttpServletRequest request) {

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

@@ -54,8 +54,8 @@ jdbc:
   # Mysql 数据库配置
   type: mysql
   driver: com.mysql.cj.jdbc.Driver
-  url: jdbc:mysql://127.0.0.1:3306/mescloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
-#  url: jdbc:mysql://192.168.21.99:3306/mescloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+#  url: jdbc:mysql://127.0.0.1:3306/mescloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+  url: jdbc:mysql://192.168.21.99:3306/mescloud?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_x13?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
   username: mescloud
   password: 8neywEN86NLam3ts

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

@@ -116,6 +116,7 @@ $('#dataGrid').dataGrid({
 			return '<a href="${ctx}/mes/mesProductRecord/info?id='+row.id+'" class="btnList" data-title="${text("查看生产记录")}">'+(val||row.id)+'</a>';
 		}},
 		{header:'${text("工位号")}', name:'oprno', index:'a.oprno', width:90, align:"center"},
+		{header:'${text("工位名称")}', name:'oprnoName', index:'oprnoName', width:120, align:"center",sortable:false},
 		{header:'${text("工艺号")}', name:'craft', index:'a.craft', width:90, align:"center"},
 		{header:'${text("报文名称")}', name:'title', index:'b.title', width:180, align:"center",sortable:false},
 		{header:'${text("结果")}', name:'content', index:'a.content', width:80, align:"center"},