Explorar o código

客户端工作记录新增测试压与泄露值

yutianhao hai 22 horas
pai
achega
4450cc41df

+ 31 - 13
src/main/java/com/jeesite/modules/mes/entity/MesProductRecord.java

@@ -57,7 +57,7 @@ import java.util.List;
 		orderBy="a.id"
 )
 public class MesProductRecord extends DataEntity<MesProductRecord> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private String sn;		// 产品二维码
 	private String oprno;		// 工位号
@@ -84,6 +84,8 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	private String oprnoTitle;
 	private String source;;//修改来源
 	private String oprno2;
+	private String testPressure; // 测试压
+	private String leakVal; // 泄漏值
 	private List imgList = ListUtils.newArrayList();
 	private List fileList = ListUtils.newArrayList();
 
@@ -105,11 +107,11 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public MesProductRecord() {
 		this(null);
 	}
-	
+
 	public MesProductRecord(String id){
 		super(id);
 	}
-	
+
 	@Size(min=0, max=50, message="产品二维码长度不能超过 50 个字符")
 	public String getSn() {
 		return sn;
@@ -118,7 +120,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setSn(String sn) {
 		this.sn = sn;
 	}
-	
+
 	@Size(min=0, max=20, message="工位号长度不能超过 20 个字符")
 	public String getOprno() {
 		return oprno;
@@ -127,7 +129,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setOprno(String oprno) {
 		this.oprno = oprno;
 	}
-	
+
 	@Size(min=0, max=30, message="工艺号长度不能超过 30 个字符")
 	public String getCraft() {
 		return craft;
@@ -136,7 +138,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setCraft(String craft) {
 		this.craft = craft;
 	}
-	
+
 	public Integer getSerial() {
 		return serial;
 	}
@@ -144,7 +146,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setSerial(Integer serial) {
 		this.serial = serial;
 	}
-	
+
 	@Size(min=0, max=50, message="报文类型长度不能超过 50 个字符")
 	public String getMessageType() {
 		return messageType;
@@ -153,7 +155,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setMessageType(String messageType) {
 		this.messageType = messageType;
 	}
-	
+
 	@Size(min=0, max=30, message="工件类型长度不能超过 30 个字符")
 	public String getCateSn() {
 		return cateSn;
@@ -162,7 +164,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setCateSn(String cateSn) {
 		this.cateSn = cateSn;
 	}
-	
+
 	@Size(min=0, max=50, message="物料批次二维码长度不能超过 50 个字符")
 	public String getMaterielSn() {
 		return materielSn;
@@ -171,7 +173,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setMaterielSn(String materielSn) {
 		this.materielSn = materielSn;
 	}
-	
+
 	@Size(min=0, max=1000, message="结果长度不能超过 1000 个字符")
 	public String getContent() {
 		return content;
@@ -180,7 +182,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setContent(String content) {
 		this.content = content;
 	}
-	
+
 	@Size(min=0, max=255, message="备注长度不能超过 255 个字符")
 	public String getRemark() {
 		return remark;
@@ -189,7 +191,7 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setRemark(String remark) {
 		this.remark = remark;
 	}
-	
+
 	@Size(min=0, max=64, message="父级id长度不能超过 64 个字符")
 	public String getPid() {
 		return pid;
@@ -323,6 +325,22 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 		this.oprnoTitle = oprnoTitle;
 	}
 
+	public String getTestPressure() {
+		return testPressure;
+	}
+
+	public void setTestPressure(String testPressure) {
+		this.testPressure = testPressure;
+	}
+
+	public String getLeakVal() {
+		return leakVal;
+	}
+
+	public void setLeakVal(String leakVal) {
+		this.leakVal = leakVal;
+	}
+
 	public String getSource() {
 		return source;
 	}
@@ -354,4 +372,4 @@ public class MesProductRecord extends DataEntity<MesProductRecord> {
 	public void setFileList(List fileList) {
 		this.fileList = fileList;
 	}
-}
+}

+ 42 - 11
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -2868,20 +2868,51 @@ public class MesProductRecordController extends BaseController {
 		mesProductRecord.getSqlMap().getOrder().setOrderBy("a.update_date DESC");
 
 		Page<MesProductRecord> page = mesProductRecordService.findPage(mesProductRecord);
-//		for (int i=0;i<page.getList().size();i++){
-//			MesProductRecord mesProductRecord1 = new MesProductRecord();
-//			mesProductRecord1.setSn(page.getList().get(i).getSn());
-//			mesProductRecord1.setOprno(page.getList().get(i).getOprno());
-//			mesProductRecord1.setLineSn(page.getList().get(i).getLineSn());
-//			mesProductRecord1.setCraft("400001");
-//			MesProductRecord mesProductRecord2 = mesProductRecordService.findInfo(mesProductRecord1);
-//			if(!ObjectUtils.isEmpty(mesProductRecord2)){
-//				page.getList().get(i).setMaterielSn(mesProductRecord2.getMaterielSn());
-//			}
-//		}
+		if (page != null && page.getList() != null) {
+			for (MesProductRecord record : page.getList()) {
+				fillQmWorkFields(record);
+			}
+		}
 		return page;
 	}
 
+	/** 工作记录展示:从 mes_product_qm 补齐测试压、泄漏值 */
+	private void fillQmWorkFields(MesProductRecord record) {
+		if (record == null || StringUtils.isEmpty(record.getSn()) || StringUtils.isEmpty(record.getOprno())) {
+			return;
+		}
+		try {
+			MesProductQm query = new MesProductQm();
+			query.setComponentNum(record.getSn());
+			query.setOprno(record.getOprno());
+			query.getSqlMap().getOrder().setOrderBy("a.test_time DESC");
+			MesProductQm qm = mesProductQmService.findInfo(query);
+			if (ObjectUtils.isEmpty(qm)) {
+				return;
+			}
+			record.setTestPressure(joinValueUnit(qm.getTestPressure(), qm.getTestPressureUnit()));
+			record.setLeakVal(joinValueUnit(qm.getLeakVal(), qm.getLeakValUnit()));
+			// 作业人员:过站记录无 updateBy 时,用气密上传时的登录工号
+			if (StringUtils.isEmpty(record.getUpdateBy()) && !StringUtils.isEmpty(qm.getWorkNum())) {
+				record.setUpdateBy(qm.getWorkNum());
+			}
+		} catch (Exception e) {
+			logger.info("补齐气密字段失败 sn={}, oprno={}, err={}", record.getSn(), record.getOprno(), e.getMessage());
+		}
+	}
+
+	private String joinValueUnit(String value, String unit) {
+		String v = value == null ? "" : value.trim();
+		String u = unit == null ? "" : unit.trim();
+		if (v.isEmpty()) {
+			return u;
+		}
+		if (u.isEmpty()) {
+			return v;
+		}
+		return v + u;
+	}
+
 	@RequestMapping(value = "winfo")
 	public String winfo(MesProductRecord mesProductRecord,Model model, HttpServletRequest request, HttpServletResponse response) {
 		MesProductRecord mesProductRecord1 = new MesProductRecord();

+ 5 - 3
src/main/resources/views/modules/mes/mesProductRecordWork.html

@@ -45,8 +45,10 @@ $('#dataGrid').dataGrid({
 			return '<a href="${ctx}/mes/mesProductRecord/winfo?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:'materielSn', index:'a.materielSn', width:150, align:"center"},
+		{header:'${text("作业人员")}', name:'updateBy', index:'a.update_by', width:150, align:"center"},
 		{header:'${text("日期")}', name:'updateDate', index:'a.update_date', width:160, align:"center" },
+		{header:'${text("测试压")}', name:'testPressure', index:'a.testPressure', width:120, align:"center", sortable:false},
+		{header:'${text("泄漏值")}', name:'leakVal', index:'a.leakVal', width:120, align:"center", sortable:false},
 		{header:'${text("工位结果")}', name:'content', index:'a.content', width:100, align:"center"},
 	],
 	// treeGrid: true,			// 启用树结构表格
@@ -56,7 +58,7 @@ $('#dataGrid').dataGrid({
 	// expandNodeClearPostData: 'sn,oprno,craft,serial,messageType,materielSn,remark,updateDate',// 展开节点清理请求参数数据(一般设置查询条件的字段属性,否则在查询后,不能展开子节点数据)
 	// 加载成功后执行事件
 	ajaxSuccess: function(data){
-		
+
 	}
 });
 function device(){
@@ -68,4 +70,4 @@ $('#btnExport').click(function(){
 		downloadFile:true
 	});
 });
-</script>
+</script>