|
|
@@ -159,6 +159,9 @@ public class MesProductRecordController extends BaseController {
|
|
|
private MesProductHeliumService mesProductHeliumService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private MesProductHfService mesProductHfService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private MesBatchSnService mesBatchSnService;
|
|
|
@Autowired
|
|
|
private MesTorsionalProcessService mesTorsionalProcessService;
|
|
|
@@ -3248,6 +3251,118 @@ public class MesProductRecordController extends BaseController {
|
|
|
return renderResult(Global.TRUE, text("操作成功!"));
|
|
|
}
|
|
|
|
|
|
+ // ========== 气密检漏客户端(op110)接口 ==========
|
|
|
+ // 加工前质量校验,客户端用参数 ucode 传用户(无登录 session)
|
|
|
+ @PostMapping(value = "pccheck")
|
|
|
+ @ResponseBody
|
|
|
+ public CommonResp pccheck(HttpServletRequest request) {
|
|
|
+ mesLogService.apisave(request);
|
|
|
+ CommonResp<String> resp = new CommonResp<>();
|
|
|
+ String sn = request.getParameter("sn");
|
|
|
+ String oprno = request.getParameter("oprno");
|
|
|
+ String lineSn = request.getParameter("lineSn");
|
|
|
+ String userCode = request.getParameter("ucode");
|
|
|
+ String oldOprno = oprno;
|
|
|
+ oprno = CommonUitl.formatOprno(oprno);
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(sn) || StringUtils.isEmpty(oprno) || StringUtils.isEmpty(lineSn)){
|
|
|
+ resp.setMessage("参数错误");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+ String ret = checkQualityResult(oldOprno,sn,lineSn,userCode);
|
|
|
+ if(ret.equals("RSUD")){
|
|
|
+ // 开始工作,记录开工时间
|
|
|
+ MesDeviceTime mesDeviceTime = new MesDeviceTime();
|
|
|
+ mesDeviceTime.setOprno(oldOprno);
|
|
|
+ mesDeviceTime.setSn(sn);
|
|
|
+ mesDeviceTime.setStartDate(new Date());
|
|
|
+ mesDeviceTime.setProductCate(lineSn);
|
|
|
+ try{
|
|
|
+ mesDeviceTimeService.add(mesDeviceTime);
|
|
|
+ }catch (Exception e){
|
|
|
+ ret = "RSNS";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ret.equals("RSUD")){
|
|
|
+ resp.setMessage("工件可以加工");
|
|
|
+ resp.setResult(Global.TRUE);
|
|
|
+ }else{
|
|
|
+ String lx = ret.substring(0,2);
|
|
|
+ String processMsgRet = ret.substring(2,4);
|
|
|
+ String lmsg = ErrorMsg.getErrorMsg(processMsgRet,lx);
|
|
|
+ resp.setMessage(lmsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ resp.setData(ret.replace("RS",""));
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 结果+漏点上传,漏点索引串 ldFlag 存入 mes_product_hf 表
|
|
|
+ @PostMapping(value = "pcresult")
|
|
|
+ @ResponseBody
|
|
|
+ @Transactional
|
|
|
+ public String pcresult(HttpServletRequest request) {
|
|
|
+ mesLogService.apisave(request);
|
|
|
+ String sn = request.getParameter("sn");
|
|
|
+ String oprno = request.getParameter("oprno");
|
|
|
+ String lineSn = request.getParameter("lineSn");
|
|
|
+ String result = request.getParameter("result");
|
|
|
+ String userCode = request.getParameter("ucode");
|
|
|
+ String remark = request.getParameter("remark");
|
|
|
+ String craft = "100000";
|
|
|
+
|
|
|
+ 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("结果错误!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ try{
|
|
|
+ // 保存漏点:检漏工位且 ldFlag 非空时,把漏点索引串存入 mes_product_hf
|
|
|
+ List<String> ldoprnos = ListUtils.newArrayList();
|
|
|
+ ldoprnos.add("OP080"); // TIG手工焊
|
|
|
+ ldoprnos.add("OP110"); // 捡漏一序
|
|
|
+ ldoprnos.add("OP130"); // TIG手工焊
|
|
|
+ ldoprnos.add("OP160"); // 捡漏二序
|
|
|
+ ldoprnos.add("OP180"); // 箱体气密一序
|
|
|
+ ldoprnos.add("OP185"); // 水道气密一序
|
|
|
+ ldoprnos.add("OP230"); // 箱体气密二序
|
|
|
+ ldoprnos.add("OP235"); // 水道气密二序
|
|
|
+ if(ldoprnos.contains(CommonUitl.formatOprno(oprno))){
|
|
|
+ String ldFlag = request.getParameter("ldFlag");
|
|
|
+ if(!StringUtils.isEmpty(ldFlag)){
|
|
|
+ MesProductHf mesProductHf = new MesProductHf();
|
|
|
+ mesProductHf.setSn(sn);
|
|
|
+ mesProductHf.setOprno(oprno);
|
|
|
+ mesProductHf.setLineSn(lineSn);
|
|
|
+ mesProductHf.setHfFlag(ldFlag);
|
|
|
+ mesProductHf.setResult(result);
|
|
|
+ mesProductHfService.save(mesProductHf);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 主结果落库,复用 T09 现有 updateRecordResult
|
|
|
+ List<ParamsResp> params = new ArrayList<>();
|
|
|
+ ParamsResp paramsResp1 = new ParamsResp();
|
|
|
+ paramsResp1.setCraft("400001");
|
|
|
+ paramsResp1.setResult("OK");
|
|
|
+ paramsResp1.setVal(userCode);
|
|
|
+ params.add(paramsResp1); // 绑定用户
|
|
|
+
|
|
|
+ List<BindMaterialResp> bmlists = mesLineProcessMaterialService.getBindMaterial(oprno, lineSn);
|
|
|
+ mesProductRecordService.updateRecordResult(sn,oprno,craft,"",result,userCode,params,lineSn,true,bmlists);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return renderResult(Global.FALSE, text("操作失败!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ return renderResult(Global.TRUE, text("操作成功!"));
|
|
|
+ }
|
|
|
+
|
|
|
// 绑定底护板
|
|
|
@PostMapping(value = "binddhb")
|
|
|
@ResponseBody
|