hzd 12 hodín pred
rodič
commit
7f12a9375a

+ 20 - 1
src/main/java/com/jeesite/modules/mes/entity/MesProductModifyRecord.java

@@ -20,6 +20,8 @@ import com.jeesite.common.utils.excel.annotation.ExcelFields;
 		@Column(name="sn", attrName="sn", label="工件码"),
 		@Column(name="oprno", attrName="oprno", label="工位号"),
 		@Column(name="craft", attrName="craft", label="工艺号"),
+		@Column(name="line_sn", attrName="lineSn", label="产线编号"),
+		@Column(name="materiel_sn", attrName="materielSn", label="绑定内容"),
 		@Column(name="content_old", attrName="contentOld", label="原结果"),
 		@Column(name="content", attrName="content", label="结果"),
 		@Column(name="source", attrName="source", label="来源", isUpdateForce=true),
@@ -38,6 +40,8 @@ public class MesProductModifyRecord extends DataEntity<MesProductModifyRecord> {
 	private String contentOld;		// 原结果
 	private String content;		// 结果
 	private String source;		// 来源
+	private String lineSn;
+	private String materielSn;
 
 	@ExcelFields({
 		@ExcelField(title="工件码", attrName="sn", align=Align.CENTER, sort=20),
@@ -111,5 +115,20 @@ public class MesProductModifyRecord extends DataEntity<MesProductModifyRecord> {
 	public void setSource(String source) {
 		this.source = source;
 	}
-	
+
+	public String getLineSn() {
+		return lineSn;
+	}
+
+	public void setLineSn(String lineSn) {
+		this.lineSn = lineSn;
+	}
+
+	public String getMaterielSn() {
+		return materielSn;
+	}
+
+	public void setMaterielSn(String materielSn) {
+		this.materielSn = materielSn;
+	}
 }

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

@@ -126,6 +126,8 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 
 	@Autowired
 	private MesProductModelService mesProductModelService;
+    @Autowired
+    private MesProductModifyRecordService mesProductModifyRecordService;
 
 	@Override
 	public void save(MesProductRecord mesProductRecord) {
@@ -603,6 +605,7 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 
 		// 更新过程参数
 		for (MesProductRecord mesProductRecord : lists){
+			String oldcontent = mesProductRecord.getContent();
 			if(crafts.size() > 0 && crafts.contains(mesProductRecord.getCraft())){ // 更新参数
 				for(ParamsResp paramsResp:paramsResps){
 					if(paramsResp.getCraft().equals(mesProductRecord.getCraft())){
@@ -613,6 +616,20 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 						}
 						mesProductRecord.setSource("0");
 						super.update(mesProductRecord);
+
+						// 修改记录
+						MesProductModifyRecord mesProductModifyRecord1 = new MesProductModifyRecord();
+						mesProductModifyRecord1.setOprno(oldOprno);
+						mesProductModifyRecord1.setSn(mesProductRecord.getSn());
+						mesProductModifyRecord1.setCraft(mesProductRecord.getCraft());
+						mesProductModifyRecord1.setLineSn(mesProductRecord.getLineSn());
+						mesProductModifyRecord1.setContent(paramsResp.getResult());
+						mesProductModifyRecord1.setContentOld(oldcontent);
+						mesProductModifyRecord1.setSource("0");
+						mesProductModifyRecord1.setMaterielSn(mesProductRecord.getMaterielSn());
+						mesProductModifyRecord1.setCreateBy(userCode);
+						mesProductModifyRecord1.setUpdateBy(userCode);
+						mesProductModifyRecordService.save(mesProductModifyRecord1);
 						break;
 					}
 				}
@@ -626,6 +643,20 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 				mesProductRecord.setMaterielSn(mesLineProcess1.getDevices());
 				mesProductRecord.setContent("OK");
 				super.update(mesProductRecord);
+
+				// 修改记录
+				MesProductModifyRecord mesProductModifyRecord1 = new MesProductModifyRecord();
+				mesProductModifyRecord1.setOprno(oldOprno);
+				mesProductModifyRecord1.setSn(mesProductRecord.getSn());
+				mesProductModifyRecord1.setCraft(mesProductRecord.getCraft());
+				mesProductModifyRecord1.setLineSn(mesProductRecord.getLineSn());
+				mesProductModifyRecord1.setContent("OK");
+				mesProductModifyRecord1.setContentOld(oldcontent);
+				mesProductModifyRecord1.setSource("0");
+				mesProductModifyRecord1.setMaterielSn(mesProductRecord.getMaterielSn());
+				mesProductModifyRecord1.setCreateBy(userCode);
+				mesProductModifyRecord1.setUpdateBy(userCode);
+				mesProductModifyRecordService.save(mesProductModifyRecord1);
 			}else if(mesProductRecord.getCraft().equals("400003")){
 				if(oldOprno.length() == 6){
 					mesProductRecord.setOprno(oldOprno);
@@ -633,6 +664,20 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
 				mesProductRecord.setMaterielSn(mesLineProcess1.getGzs());
 				mesProductRecord.setContent("OK");
 				super.update(mesProductRecord);
+
+				// 修改记录
+				MesProductModifyRecord mesProductModifyRecord1 = new MesProductModifyRecord();
+				mesProductModifyRecord1.setOprno(oldOprno);
+				mesProductModifyRecord1.setSn(mesProductRecord.getSn());
+				mesProductModifyRecord1.setCraft(mesProductRecord.getCraft());
+				mesProductModifyRecord1.setLineSn(mesProductRecord.getLineSn());
+				mesProductModifyRecord1.setContent("OK");
+				mesProductModifyRecord1.setContentOld(oldcontent);
+				mesProductModifyRecord1.setSource("0");
+				mesProductModifyRecord1.setMaterielSn(mesProductRecord.getMaterielSn());
+				mesProductModifyRecord1.setCreateBy(userCode);
+				mesProductModifyRecord1.setUpdateBy(userCode);
+				mesProductModifyRecordService.save(mesProductModifyRecord1);
 			}
 
 			// 更新主结果

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

@@ -295,10 +295,13 @@ public class MesProductRecordController extends BaseController {
 		mesProductRecord.setMaterielSn("");
 		mesProductRecord.setSource("1");
 		mesProductRecordService.update(mesProductRecord);
+
 		//添加产品修改记录
 		MesProductModifyRecord mesProductModifyRecord = new MesProductModifyRecord();
 		mesProductModifyRecord.setSn(mesProductRecord.getSn());
 		mesProductModifyRecord.setOprno(mesProductRecord.getOprno());
+		mesProductModifyRecord.setLineSn(mesProductRecord.getLineSn());
+		mesProductModifyRecord.setMaterielSn(mesProductRecord.getMaterielSn());
 		mesProductModifyRecord.setCraft(mesProductRecord.getCraft());
 		mesProductModifyRecord.setContentOld(contentOld);
 		mesProductModifyRecord.setContent(mesProductRecord.getContent());
@@ -321,6 +324,8 @@ public class MesProductRecordController extends BaseController {
 		MesProductModifyRecord mesProductModifyRecord = new MesProductModifyRecord();
 		mesProductModifyRecord.setSn(mesProductRecord.getSn());
 		mesProductModifyRecord.setOprno(mesProductRecord.getOprno());
+		mesProductModifyRecord.setLineSn(mesProductRecord.getLineSn());
+		mesProductModifyRecord.setMaterielSn(mesProductRecord.getMaterielSn());
 		mesProductModifyRecord.setCraft(mesProductRecord.getCraft());
 		mesProductModifyRecord.setContentOld(contentOld);
 		mesProductModifyRecord.setContent(mesProductRecord.getContent());
@@ -399,6 +404,8 @@ public class MesProductRecordController extends BaseController {
 			MesProductModifyRecord mesProductModifyRecord = new MesProductModifyRecord();
 			mesProductModifyRecord.setSn(mesProductRecord.getSn());
 			mesProductModifyRecord.setOprno(mesProductRecord.getOprno());
+			mesProductModifyRecord.setLineSn(mesProductRecord.getLineSn());
+			mesProductModifyRecord.setMaterielSn(mesProductRecord.getMaterielSn());
 			mesProductModifyRecord.setCraft(mesProductRecord.getCraft());
 			mesProductModifyRecord.setContentOld(contentOld);
 			mesProductModifyRecord.setContent(mesProductRecord.getContent());
@@ -3486,6 +3493,8 @@ public class MesProductRecordController extends BaseController {
 		MesProductModifyRecord mesProductModifyRecord = new MesProductModifyRecord();
 		mesProductModifyRecord.setSn(sn);
 		mesProductModifyRecord.setOprno(oprno);
+		mesProductModifyRecord.setLineSn(mesProductRecord1.getLineSn());
+		mesProductModifyRecord.setMaterielSn("");
 		mesProductModifyRecord.setCraft("100000");
 		mesProductModifyRecord.setContentOld(contentOld);
 		mesProductModifyRecord.setContent(content);