|
|
@@ -403,7 +403,7 @@ public class MesProductRecordController extends BaseController {
|
|
|
}
|
|
|
|
|
|
if(mesProductRecord.getIsNewRecord()){
|
|
|
- MesProductRecord mpr = mesProductRecordService.findBySn(mesProductRecord.getSn());
|
|
|
+ MesProductRecord mpr = mesProductRecordService.findBySn(mesProductRecord.getSn(),mesProductRecord.getLineSn());
|
|
|
if(mpr != null){
|
|
|
return renderResult(Global.FALSE, text("产品记录已存在!"));
|
|
|
}
|
|
|
@@ -2933,13 +2933,14 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
public CommonResp queryProduct(HttpServletRequest request) {
|
|
|
CommonResp<String> resp = new CommonResp<>();
|
|
|
String sn = request.getParameter("sn");
|
|
|
- if(StringUtils.isEmpty(sn)){
|
|
|
+ String lineSn= request.getParameter("lineSn");
|
|
|
+ if(StringUtils.isEmpty(sn)&&StringUtils.isEmpty(lineSn)){
|
|
|
resp.setResult(Global.FALSE);
|
|
|
resp.setMessage("参数错误");
|
|
|
return resp;
|
|
|
}
|
|
|
// String cate = "ZHXT";
|
|
|
- MesProductRecord mesProductRecord = mesProductRecordService.findBySn(sn);
|
|
|
+ MesProductRecord mesProductRecord = mesProductRecordService.findBySn(sn,lineSn);
|
|
|
if(ObjectUtils.isEmpty(mesProductRecord)){
|
|
|
resp.setData("0");
|
|
|
}else{
|
|
|
@@ -2954,7 +2955,7 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
@ResponseBody
|
|
|
public CommonResp createProduct(HttpServletRequest request) {
|
|
|
CommonResp<String> resp = new CommonResp<>();
|
|
|
-// String mesProductCatesn = request.getParameter("mesProductCatesn");//产线编号
|
|
|
+ String lineSn = request.getParameter("lineSn");//产线编号
|
|
|
String sn = request.getParameter("sn");//工件码
|
|
|
if(StringUtils.isEmpty(sn)){
|
|
|
resp.setResult(Global.FALSE);
|
|
|
@@ -2969,9 +2970,14 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
- List<MesProductCate> mesProductCateLists = mesProductCateService.getCateBySn(sn);
|
|
|
- for(MesProductCate mesProductModel : mesProductCateLists){
|
|
|
- String cate = mesProductModel.getSn();
|
|
|
+ String productCate = mesLineService.findInfoCate(lineSn);
|
|
|
+ MesProductCate mesProductCate = mesProductCateService.getCateBySn(sn, productCate);
|
|
|
+ if(ObjectUtils.isEmpty(mesProductCate)){
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
+ resp.setMessage("工件码类型未配置");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+ String cate = mesProductCate.getSn();
|
|
|
|
|
|
MesLine mesLine = new MesLine();
|
|
|
mesLine.setProductCate(cate);
|
|
|
@@ -2988,10 +2994,10 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
resp.setMessage("该工件已创建订单,勿重复操作");
|
|
|
return resp;
|
|
|
}
|
|
|
-
|
|
|
+ System.out.println("==="+mesLine1.getId());
|
|
|
// 获取上线工位
|
|
|
MesLineProcess mesLineProcess = new MesLineProcess();
|
|
|
- mesLineProcess.setLineId(mesLine.getId());
|
|
|
+ mesLineProcess.setLineId(mesLine1.getId());
|
|
|
mesLineProcess.setType("4");
|
|
|
MesLineProcess mesLineProcess1 = mesLineProcessService.findInfo(mesLineProcess);
|
|
|
if(ObjectUtils.isEmpty(mesLineProcess1)){
|
|
|
@@ -3024,7 +3030,7 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
resp.setResult(Global.FALSE);
|
|
|
resp.setMessage("该工件创建订单失败");
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
return resp;
|
|
|
}
|
|
|
@@ -3241,13 +3247,16 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
public CommonResp checkProduct(HttpServletRequest request) {
|
|
|
CommonResp<Map<String, Object>> resp = new CommonResp<>();
|
|
|
String sn = request.getParameter("sn");
|
|
|
+ String lineSn = request.getParameter("lineSn");//XT,mp.zp
|
|
|
if(StringUtils.isEmpty(sn)){
|
|
|
resp.setResult(Global.FALSE);
|
|
|
resp.setMessage("参数错误");
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
- List<MesProductCate> mesProductCate = mesProductCateService.getCateBySn(sn);
|
|
|
+ String productCate = mesLineService.findInfoCate(lineSn);
|
|
|
+
|
|
|
+ MesProductCate mesProductCate = mesProductCateService.getCateBySn(sn, productCate);
|
|
|
if(ObjectUtils.isEmpty(mesProductCate)){
|
|
|
resp.setResult(Global.FALSE);
|
|
|
resp.setMessage("工件码格式错误");
|
|
|
@@ -3259,7 +3268,8 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
MesProductRecord mesProductRecord = new MesProductRecord();
|
|
|
mesProductRecord.getSqlMap().getWhere()
|
|
|
.and("craft", QueryType.EQ,"100000")
|
|
|
- .and("sn", QueryType.EQ,sn);
|
|
|
+ .and("sn", QueryType.EQ,sn)
|
|
|
+ .and("line_sn", QueryType.EQ,lineSn);
|
|
|
List<MesProductRecord> lists = mesProductRecordService.findList(mesProductRecord);
|
|
|
map.put("lists", lists);
|
|
|
resp.setData(map);
|
|
|
@@ -3273,6 +3283,7 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
public CommonResp editProduct(HttpServletRequest request) {
|
|
|
CommonResp<String> resp = new CommonResp<>();
|
|
|
String sn = request.getParameter("sn");
|
|
|
+ String lineSn = request.getParameter("lineSn");
|
|
|
String oprno = request.getParameter("oprno");
|
|
|
String content = request.getParameter("content");
|
|
|
if(StringUtils.isEmpty(sn) || StringUtils.isEmpty(oprno) || StringUtils.isEmpty(content)){
|
|
|
@@ -3286,9 +3297,7 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
- String cate = "ZHXT";
|
|
|
-
|
|
|
- MesProductRecord mesProductRecord2 = mesProductRecordService.findBySn(sn);
|
|
|
+ MesProductRecord mesProductRecord2 = mesProductRecordService.findBySn(sn,lineSn);
|
|
|
if(ObjectUtils.isEmpty(mesProductRecord2)){
|
|
|
resp.setResult(Global.FALSE);
|
|
|
resp.setMessage("工件信息不存在");
|
|
|
@@ -3298,6 +3307,7 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
mesProductRecord.setCraft("100000");
|
|
|
mesProductRecord.setOprno(oprno);
|
|
|
mesProductRecord.setSn(sn);
|
|
|
+ mesProductRecord.setLineSn(lineSn);
|
|
|
MesProductRecord mesProductRecord1 = mesProductRecordService.findInfo(mesProductRecord);
|
|
|
String contentOld = mesProductRecord1.getContent();
|
|
|
mesProductRecord1.setContent(content);
|