|
|
@@ -538,18 +538,23 @@ public class MesProductRecordController extends BaseController {
|
|
|
@PostMapping(value = "save")
|
|
|
@ResponseBody
|
|
|
public String save(@Validated MesProductRecord mesProductRecord,HttpServletRequest request) {
|
|
|
- if(mesProductRecord.getIsNewRecord() && mesProductRecord.getLineSn().isEmpty()){ // 新增
|
|
|
- return renderResult(Global.FALSE, text("产线编号不能为空!"));
|
|
|
+// if(mesProductRecord.getIsNewRecord() && mesProductRecord.getLineSn().isEmpty()){ // 新增
|
|
|
+// return renderResult(Global.FALSE, text("产线编号不能为空!"));
|
|
|
+// }
|
|
|
+
|
|
|
+ if(mesProductRecord.getIsNewRecord() && mesProductRecord.getSn().isEmpty()){ // 新增
|
|
|
+ return renderResult(Global.FALSE, text("工件码不能为空!"));
|
|
|
}
|
|
|
|
|
|
- List<ParamsResp> params = new ArrayList<>();
|
|
|
- if(mesProductRecord.getLineSn().equals("XT")){
|
|
|
- if(mesProductRecord.getIsNewRecord() && mesProductRecord.getSn().isEmpty()){ // 新增
|
|
|
- return renderResult(Global.FALSE, text("工件码不能为空!"));
|
|
|
- }
|
|
|
- }else{
|
|
|
+ MesProductModel mesProductModel = mesProductModelService.checkSnObj(mesProductRecord.getSn());
|
|
|
+ if(mesProductModel == null){
|
|
|
+ return renderResult(Global.FALSE, text("工件码格式错误!"));
|
|
|
}
|
|
|
|
|
|
+ mesProductRecord.setLineSn(mesProductModel.getLineSn());
|
|
|
+
|
|
|
+ List<ParamsResp> params = new ArrayList<>();
|
|
|
+
|
|
|
MesLine ml = new MesLine();
|
|
|
ml.setSn(mesProductRecord.getLineSn());
|
|
|
ml.setStatus("0");
|
|
|
@@ -563,16 +568,16 @@ public class MesProductRecordController extends BaseController {
|
|
|
return renderResult(Global.FALSE, text("产品编号重复!"));
|
|
|
}
|
|
|
|
|
|
- // 检验工件码
|
|
|
- String checkProductSn = Global.getConfig("mes.check.productSn");
|
|
|
- if(checkProductSn.equals("1")){
|
|
|
- if(!CommonUitl.checkProductSnQgx(mesProductRecord.getSn())){
|
|
|
- return renderResult(Global.FALSE, text("工件码格式不正确!"));
|
|
|
- }
|
|
|
- }
|
|
|
+// // 检验工件码
|
|
|
+// String checkProductSn = Global.getConfig("mes.check.productSn");
|
|
|
+// if(checkProductSn.equals("1")){
|
|
|
+// if(!CommonUitl.checkProductSnQgx(mesProductRecord.getSn())){
|
|
|
+// return renderResult(Global.FALSE, text("工件码格式不正确!"));
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
try{
|
|
|
- mesProductRecord.setOprno("OP010");
|
|
|
+ mesProductRecord.setOprno("OP035");
|
|
|
mesProductRecord.setContent("OK");
|
|
|
mesProductRecord.setCateSn(cateSn);
|
|
|
List<MesLaserMaterial> mlists = new ArrayList<>();
|
|
|
@@ -2921,7 +2926,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
}
|
|
|
|
|
|
// 生成镭雕码
|
|
|
- String sn = mesProductPreService.getNewSn("1");
|
|
|
+ String sn = mesProductPreService.getNewSn(lineSn,"1");
|
|
|
if(sn.isEmpty()){
|
|
|
resp.setMessage("没有符合要求的镭雕码可生成");
|
|
|
return resp;
|
|
|
@@ -3119,13 +3124,19 @@ public class MesProductRecordController extends BaseController {
|
|
|
sn = mesProductHmbService.formatHmbSn(sn,oprno,lineSn);
|
|
|
|
|
|
try{
|
|
|
- if(CommonUitl.formatOprno(oldOprno).equals("OP125")){ // 弧焊二序,检查后面板码是否已被绑定
|
|
|
+ if(CommonUitl.formatOprno(oldOprno).equals("OP115")){ // 弧焊二序,检查后面板码是否已被绑定
|
|
|
// 检验工件码
|
|
|
String checkProductSn = Global.getConfig("mes.check.productSn");
|
|
|
if(checkProductSn.equals("1")){
|
|
|
- if(!CommonUitl.checkProductSnHmb(wsn)){
|
|
|
- return renderResult(Global.FALSE, text("后面板码式不正确"));
|
|
|
+// if(!CommonUitl.checkProductSnHmb(wsn)){
|
|
|
+// return renderResult(Global.FALSE, text("后面板码式不正确"));
|
|
|
+// }
|
|
|
+
|
|
|
+ MesProductModel mesProductModel = mesProductModelService.checkSnObj(wsn);
|
|
|
+ if(mesProductModel == null){
|
|
|
+ return renderResult(Global.FALSE, text("工件码格式错误!"));
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 检查前工件码是否已绑定后面板码
|
|
|
@@ -3152,6 +3163,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
}
|
|
|
|
|
|
mesProductHmb1.setQsn(sn);
|
|
|
+ mesProductHmb1.setLineSn(lineSn);
|
|
|
mesProductHmbService.save(mesProductHmb1);
|
|
|
}
|
|
|
mesProductRecordService.updateRecord(sn,oldOprno,craft,wsn,"OK",userCode,lineSn);
|
|
|
@@ -3188,7 +3200,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
sn = mesProductHmbService.formatHmbSn(sn,oprno,lineSn);
|
|
|
|
|
|
try{
|
|
|
- if(CommonUitl.formatOprno(oldOprno).equals("OP125")){ // 弧焊二序,检查后面板码是否已被绑定
|
|
|
+ if(CommonUitl.formatOprno(oldOprno).equals("OP115")){ // 弧焊二序,检查后面板码是否已被绑定
|
|
|
MesProductHmb mesProductHmb = new MesProductHmb();
|
|
|
mesProductHmb.setSn(wsn);
|
|
|
mesProductHmb.setQsn(sn);
|
|
|
@@ -3293,8 +3305,8 @@ public class MesProductRecordController extends BaseController {
|
|
|
String checkret = ret.substring(3,5);
|
|
|
if(checkret.equals("UD")){
|
|
|
String newRet = "UD";
|
|
|
- if(CommonUitl.formatOprno(oprno).equals("OP190")){
|
|
|
- String check = Global.getConfig("mes.check.op190");
|
|
|
+ if(CommonUitl.formatOprno(oprno).equals("OP170")){
|
|
|
+ String check = Global.getConfig("mes.check.op170");
|
|
|
if(check.equals("1")){
|
|
|
MesProductOprno mesProductOprno = new MesProductOprno();
|
|
|
mesProductOprno.setSn(hmbSn);
|
|
|
@@ -3302,18 +3314,18 @@ public class MesProductRecordController extends BaseController {
|
|
|
mesProductOprno.setOprno(CommonUitl.formatOprno(oprno));
|
|
|
MesProductOprno mesProductOprno1 = mesProductOprnoService.findInfo(mesProductOprno);
|
|
|
if(ObjectUtils.isEmpty(mesProductOprno1)){
|
|
|
- if(!oldOprno.equals("OP190A") && !oldOprno.equals("OP190B")){
|
|
|
+ if(!oldOprno.equals("OP170A") && !oldOprno.equals("OP170B")){
|
|
|
newRet = "QQ"; // 本工位前工序未加工或加工NG
|
|
|
}
|
|
|
}else{
|
|
|
- if(oldOprno.equals("OP190C") || oldOprno.equals("OP190D")){
|
|
|
+ if(oldOprno.equals("OP170C") || oldOprno.equals("OP170D")){
|
|
|
if(StringUtils.isEmpty(mesProductOprno1.getResult1()) || !mesProductOprno1.getResult1().equals("OK")){
|
|
|
newRet = "QQ"; // 本工位前工序未加工或加工NG
|
|
|
}
|
|
|
if(StringUtils.isEmpty(mesProductOprno1.getResult2()) || !mesProductOprno1.getResult2().equals("OK")){
|
|
|
newRet = "QQ"; // 本工位前工序未加工或加工NG
|
|
|
}
|
|
|
- } else if(oldOprno.equals("OP190E") || oldOprno.equals("OP190F")){
|
|
|
+ } else if(oldOprno.equals("OP170E") || oldOprno.equals("OP170F")){
|
|
|
if(StringUtils.isEmpty(mesProductOprno1.getResult1()) || !mesProductOprno1.getResult1().equals("OK")){
|
|
|
newRet = "QQ"; // 本工位前工序未加工或加工NG
|
|
|
}
|
|
|
@@ -3731,7 +3743,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
User user = UserUtils.getUser();
|
|
|
String userCode = user.getUserCode();
|
|
|
|
|
|
- if(CommonUitl.formatOprno(oldOprno).equals("OP210")){ // 半成品包装
|
|
|
+ if(CommonUitl.formatOprno(oldOprno).equals("OP195")){ // 半成品包装
|
|
|
// 检查追溯记录
|
|
|
MesProductRecord mesProductRecord = new MesProductRecord();
|
|
|
mesProductRecord.getSqlMap().getWhere().and("a.sn",QueryType.EQ,sn);
|
|
|
@@ -3843,7 +3855,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
String userCode = user.getUserCode();
|
|
|
|
|
|
try{
|
|
|
- if(CommonUitl.formatOprno(oldOprno).equals("OP210")){ // 半成品打包
|
|
|
+ if(CommonUitl.formatOprno(oldOprno).equals("OP195")){ // 半成品打包
|
|
|
String batchSn = request.getParameter("batchSn"); //批次码
|
|
|
String batchCount = Global.getConfig("mes.bcbatch.count"); //全局半成数量
|
|
|
if(batchCount.isEmpty()){
|
|
|
@@ -3892,7 +3904,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
|
|
|
//打包:工件码与批次码绑定
|
|
|
List<String> dboprnos = ListUtils.newArrayList();
|
|
|
- dboprnos.add("OP280");
|
|
|
+ dboprnos.add("OP265");
|
|
|
if(dboprnos.contains(CommonUitl.formatOprno(oldOprno))){
|
|
|
String batchSn = request.getParameter("batchSn"); //批次码
|
|
|
//依据工件码查出对应mes_product
|
|
|
@@ -3942,7 +3954,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
// String plcIp2 = "192.168.90.86"; // plc6 东侧
|
|
|
// String db = "DB7010.7.0";
|
|
|
// 西op055A
|
|
|
- if (oldOprno.equals("OP055A")) {
|
|
|
+ if (oldOprno.equals("OP065A")) {
|
|
|
// S7PLC s7PLCWest = new S7PLC(EPlcType.S1500, plcIp1);
|
|
|
// s7PLCWest.writeBoolean(db, true);
|
|
|
Op55PlcSignal op55PlcSignal = op55PlcSignalService.get("123456");
|
|
|
@@ -4717,7 +4729,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
return resp;
|
|
|
}
|
|
|
if("XT".equals(lineSn) && sn.length() == 28){
|
|
|
- sn = mesProductHmbService.formatHmbSn(sn,"OP130",lineSn);
|
|
|
+ sn = mesProductHmbService.formatHmbSn(sn,"OP115",lineSn);
|
|
|
}
|
|
|
|
|
|
MesProductRecord mesProductRecord = mesProductRecordService.findBySnCate(sn,cate);
|
|
|
@@ -4736,16 +4748,26 @@ public class MesProductRecordController extends BaseController {
|
|
|
public CommonResp createProduct(HttpServletRequest request) {
|
|
|
CommonResp<String> resp = new CommonResp<>();
|
|
|
String sn = request.getParameter("sn");
|
|
|
- String lineSn = request.getParameter("lineSn");
|
|
|
- if(StringUtils.isEmpty(lineSn)){
|
|
|
- lineSn = "XT"; // Compatibility with clients that only submit sn.
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+// String lineSn = request.getParameter("lineSn");
|
|
|
+// if(StringUtils.isEmpty(lineSn)){
|
|
|
+// lineSn = "XT"; // Compatibility with clients that only submit sn.
|
|
|
+// }
|
|
|
if(StringUtils.isEmpty(sn)){
|
|
|
resp.setResult(Global.FALSE);
|
|
|
resp.setMessage("参数错误");
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
+ MesProductModel mesProductModel = mesProductModelService.checkSnObj(sn);
|
|
|
+ if(mesProductModel == null){
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
+ resp.setMessage("工件码格式错误");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+ String lineSn = mesProductModel.getLineSn();
|
|
|
String cate = mesLineService.findInfoCate(lineSn);
|
|
|
if(StringUtils.isEmpty(cate)){
|
|
|
resp.setResult(Global.FALSE);
|
|
|
@@ -4753,15 +4775,15 @@ public class MesProductRecordController extends BaseController {
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
- // 检验工件码
|
|
|
- String checkProductSn = Global.getConfig("mes.check.productSn");
|
|
|
- if(checkProductSn.equals("1")){
|
|
|
- if(!CommonUitl.checkProductSnQgx(sn) && !CommonUitl.checkProductSnHmb(sn)){
|
|
|
- resp.setResult(Global.FALSE);
|
|
|
- resp.setMessage("工件码格式不正确");
|
|
|
- return resp;
|
|
|
- }
|
|
|
- }
|
|
|
+// // 检验工件码
|
|
|
+// String checkProductSn = Global.getConfig("mes.check.productSn");
|
|
|
+// if(checkProductSn.equals("1")){
|
|
|
+// if(!CommonUitl.checkProductSnQgx(sn) && !CommonUitl.checkProductSnHmb(sn)){
|
|
|
+// resp.setResult(Global.FALSE);
|
|
|
+// resp.setMessage("工件码格式不正确");
|
|
|
+// return resp;
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
MesProductRecord mesProductRecord2 = mesProductRecordService.findBySnCate(sn,cate);
|
|
|
if(!ObjectUtils.isEmpty(mesProductRecord2)){
|
|
|
@@ -4772,7 +4794,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
|
|
|
MesProductRecord mesProductRecord = new MesProductRecord();
|
|
|
mesProductRecord.setSn(sn);
|
|
|
- mesProductRecord.setOprno("OP010");
|
|
|
+ mesProductRecord.setOprno("OP035");
|
|
|
mesProductRecord.setLineSn(lineSn);
|
|
|
mesProductRecord.setContent("UDF");
|
|
|
mesProductRecord.setCateSn(cate);
|