|
@@ -4742,7 +4742,6 @@ public class MesProductRecordController extends BaseController {
|
|
|
|
|
|
|
|
@PostMapping(value = "qmresult")
|
|
@PostMapping(value = "qmresult")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
- @Transactional
|
|
|
|
|
public String qmresult(MesProductQmReq mesProductQmReq,HttpServletRequest request) {
|
|
public String qmresult(MesProductQmReq mesProductQmReq,HttpServletRequest request) {
|
|
|
mesLogService.apisavexz(request);
|
|
mesLogService.apisavexz(request);
|
|
|
String ldFlagParam = request.getParameter("ldFlag");
|
|
String ldFlagParam = request.getParameter("ldFlag");
|
|
@@ -4814,15 +4813,14 @@ public class MesProductRecordController extends BaseController {
|
|
|
mesProductQm.setTitle(title);
|
|
mesProductQm.setTitle(title);
|
|
|
mesProductQm.setRemark(remark);
|
|
mesProductQm.setRemark(remark);
|
|
|
mesProductQm.setLineSn(lineSn);
|
|
mesProductQm.setLineSn(lineSn);
|
|
|
- mesProductQmService.add(mesProductQm);
|
|
|
|
|
|
|
+ MesProductHf mesProductHf = null;
|
|
|
if(result.equals("NG")){
|
|
if(result.equals("NG")){
|
|
|
- MesProductHf mesProductHf = new MesProductHf();
|
|
|
|
|
|
|
+ mesProductHf = new MesProductHf();
|
|
|
mesProductHf.setSn(sn);
|
|
mesProductHf.setSn(sn);
|
|
|
mesProductHf.setOprno(oprno);
|
|
mesProductHf.setOprno(oprno);
|
|
|
mesProductHf.setLineSn(lineSn);
|
|
mesProductHf.setLineSn(lineSn);
|
|
|
mesProductHf.setHfFlag(ldFlag);
|
|
mesProductHf.setHfFlag(ldFlag);
|
|
|
mesProductHf.setResult(result);
|
|
mesProductHf.setResult(result);
|
|
|
- mesProductHfService.save(mesProductHf);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<ParamsResp> params = new ArrayList<>();
|
|
List<ParamsResp> params = new ArrayList<>();
|
|
@@ -4832,10 +4830,15 @@ public class MesProductRecordController extends BaseController {
|
|
|
}
|
|
}
|
|
|
// 2.判断物料批次是否符合绑定
|
|
// 2.判断物料批次是否符合绑定
|
|
|
List<BindMaterialResp> bmlists = new ArrayList<>();
|
|
List<BindMaterialResp> bmlists = new ArrayList<>();
|
|
|
- mesProductRecordService.updateRecordResult(null,sn,oprno,"100000","",content,userCode,params,lineSn,true,bmlists,"0");
|
|
|
|
|
|
|
+ mesProductQmService.addQmResultAndUpdateStation(mesProductQm, mesProductHf, sn, oprno, content,
|
|
|
|
|
+ userCode, params, lineSn, bmlists);
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
- return renderResult(Global.FALSE, text("操作失败!"));
|
|
|
|
|
|
|
+ String msg = e.getMessage();
|
|
|
|
|
+ if(StringUtils.isEmpty(msg)){
|
|
|
|
|
+ msg = "操作失败!";
|
|
|
|
|
+ }
|
|
|
|
|
+ return renderResult(Global.FALSE, text(msg));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return renderResult(Global.TRUE, text("操作成功!"));
|
|
return renderResult(Global.TRUE, text("操作成功!"));
|
|
@@ -4902,15 +4905,14 @@ public class MesProductRecordController extends BaseController {
|
|
|
mesProductQm.setCsDuration(cs);
|
|
mesProductQm.setCsDuration(cs);
|
|
|
mesProductQm.setByDuration(by);
|
|
mesProductQm.setByDuration(by);
|
|
|
mesProductQm.setCqDuration(cq);
|
|
mesProductQm.setCqDuration(cq);
|
|
|
- mesProductQmService.add(mesProductQm);
|
|
|
|
|
|
|
+ MesProductHf mesProductHf = null;
|
|
|
if(result.equals("NG")){
|
|
if(result.equals("NG")){
|
|
|
- MesProductHf mesProductHf = new MesProductHf();
|
|
|
|
|
|
|
+ mesProductHf = new MesProductHf();
|
|
|
mesProductHf.setSn(sn);
|
|
mesProductHf.setSn(sn);
|
|
|
mesProductHf.setOprno(oprno);
|
|
mesProductHf.setOprno(oprno);
|
|
|
mesProductHf.setLineSn(lineSn);
|
|
mesProductHf.setLineSn(lineSn);
|
|
|
mesProductHf.setHfFlag(ldFlag);
|
|
mesProductHf.setHfFlag(ldFlag);
|
|
|
mesProductHf.setResult(result);
|
|
mesProductHf.setResult(result);
|
|
|
- mesProductHfService.save(mesProductHf);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<ParamsResp> params = new ArrayList<>();
|
|
List<ParamsResp> params = new ArrayList<>();
|
|
@@ -4920,10 +4922,12 @@ public class MesProductRecordController extends BaseController {
|
|
|
}
|
|
}
|
|
|
// 2.判断物料批次是否符合绑定
|
|
// 2.判断物料批次是否符合绑定
|
|
|
List<BindMaterialResp> bmlists = new ArrayList<>();
|
|
List<BindMaterialResp> bmlists = new ArrayList<>();
|
|
|
- mesProductRecordService.updateRecordResult(null,sn,oprno,"100000","",content,userCode,params,lineSn,true,bmlists,"0");
|
|
|
|
|
|
|
+ mesProductQmService.addQmResultAndUpdateStation(mesProductQm, mesProductHf, sn, oprno, content,
|
|
|
|
|
+ userCode, params, lineSn, bmlists);
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
logger.error("xzqmresult fail sn="+sn+" oprno="+oprno, e);
|
|
logger.error("xzqmresult fail sn="+sn+" oprno="+oprno, e);
|
|
|
- resp.setErrMsg("操作失败");
|
|
|
|
|
|
|
+ String msg = e.getMessage();
|
|
|
|
|
+ resp.setErrMsg(StringUtils.isEmpty(msg) ? "操作失败" : msg);
|
|
|
resp.setIsSuccess(false);
|
|
resp.setIsSuccess(false);
|
|
|
return resp;
|
|
return resp;
|
|
|
}
|
|
}
|