|
|
@@ -2938,6 +2938,83 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
|
|
|
return renderResult(Global.TRUE, text("操作成功!"));
|
|
|
}
|
|
|
|
|
|
+ @PostMapping(value = "pdaresult2")
|
|
|
+ @ResponseBody
|
|
|
+ public String pdaresult2(HttpServletRequest request) {
|
|
|
+ String sn = request.getParameter("sn");
|
|
|
+ String oprno = request.getParameter("oprno");
|
|
|
+ String lineSn = request.getParameter("lineSn");
|
|
|
+ String result = request.getParameter("result");
|
|
|
+
|
|
|
+ String craft = "100000";
|
|
|
+ String remark = request.getParameter("remark");
|
|
|
+ String oldOprno = oprno;
|
|
|
+ if(oldOprno.length()==5){
|
|
|
+ oldOprno += "A";
|
|
|
+ }
|
|
|
+ String mesProductRecord_image = request.getParameter("mesProductRecord_image");
|
|
|
+// if(com.alibaba.druid.util.StringUtils.isEmpty(mesProductRecord_image)){
|
|
|
+// return renderResult(Global.FALSE, text("图片不能为空!"));
|
|
|
+// }
|
|
|
+ if(StringUtils.isEmpty(sn) || StringUtils.isEmpty(oprno) || StringUtils.isEmpty(result) || StringUtils.isEmpty(lineSn)){
|
|
|
+ return renderResult(Global.FALSE, text("参数错误!"));
|
|
|
+ }
|
|
|
+ if(!result.equals("OK") && !result.equals("NG")){
|
|
|
+ return renderResult(Global.FALSE, text("结果错误!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ User user = UserUtils.getUser();
|
|
|
+ String userCode = user.getUserCode();
|
|
|
+
|
|
|
+ List<ParamsResp> params = new ArrayList<>();
|
|
|
+
|
|
|
+ // 获取工位配置
|
|
|
+ MesLineProcess mesLineProcess1 = mesLineProcessService.findInfoByOprnoLineSn(oprno,lineSn);
|
|
|
+ if(ObjectUtils.isEmpty(mesLineProcess1)){
|
|
|
+ return renderResult(Global.FALSE, text("子工位未配置!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ try{
|
|
|
+ // OP110提交OK时,同步将OP110~OP180工位结果都提交为OK
|
|
|
+ if("OP110".equals(CommonUitl.formatOprno(oprno)) && "OK".equals(result)){
|
|
|
+ String[] relatedOprnos = new String[]{"OP110", "OP120", "OP130", "OP140", "OP150", "OP160", "OP170", "OP180"};
|
|
|
+ for(String relatedOprno : relatedOprnos){
|
|
|
+ MesLineProcess mlp = "OP110".equals(relatedOprno)
|
|
|
+ ? mesLineProcess1
|
|
|
+ : mesLineProcessService.findInfoByOprnoLineSn(relatedOprno, lineSn);
|
|
|
+ if(ObjectUtils.isEmpty(mlp)){
|
|
|
+ return renderResult(Global.FALSE, text(relatedOprno + "子工位未配置!"));
|
|
|
+ }
|
|
|
+ // OP120-OP180提交前检查模板,缺失则补建
|
|
|
+ if(!"OP110".equals(relatedOprno)){
|
|
|
+ checkTempalte(sn, relatedOprno, lineSn);
|
|
|
+ }
|
|
|
+ String res = updateQualityCommon(mlp, relatedOprno, lineSn, sn, craft, "OK", userCode, params,
|
|
|
+ "OP110".equals(relatedOprno) ? remark : null);
|
|
|
+ String checkret = res.substring(2,4);
|
|
|
+ if(!checkret.equals("OK")){
|
|
|
+ String lx = res.substring(0,2)+" ";
|
|
|
+ String lmsg = ErrorMsg.getErrorMsg(checkret,lx);
|
|
|
+ return renderResult(Global.FALSE, text(lmsg));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ String res = updateQualityCommon(mesLineProcess1,oprno,lineSn,sn,craft,result,userCode,params,remark);
|
|
|
+ String checkret = res.substring(2,4);
|
|
|
+ if(!checkret.equals("OK")){
|
|
|
+ String lx = res.substring(0,2)+" ";
|
|
|
+ String lmsg = ErrorMsg.getErrorMsg(checkret,lx);
|
|
|
+ return renderResult(Global.FALSE, text(lmsg));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return renderResult(Global.FALSE, text("操作失败!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ return renderResult(Global.TRUE, text("操作成功!"));
|
|
|
+ }
|
|
|
+
|
|
|
//OP080热处理
|
|
|
@PostMapping(value = "pdaRcl")
|
|
|
@ResponseBody
|