|
@@ -193,6 +193,9 @@ public class MesProductRecordController extends BaseController {
|
|
|
private MesPdaScanRecordService mesPdaScanRecordService;
|
|
private MesPdaScanRecordService mesPdaScanRecordService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private MesQualityService mesQualityService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
private MesOp050RecordService mesOp050RecordService;
|
|
private MesOp050RecordService mesOp050RecordService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private MesDingTalkAlertService mesDingTalkAlertService;
|
|
private MesDingTalkAlertService mesDingTalkAlertService;
|
|
@@ -4518,8 +4521,10 @@ public class MesProductRecordController extends BaseController {
|
|
|
|
|
|
|
|
// 当为OP050时直接放行
|
|
// 当为OP050时直接放行
|
|
|
if("OP050A".equals(oldOprno)){
|
|
if("OP050A".equals(oldOprno)){
|
|
|
- mesOp050RecordService.saveIfAbsent(sn, oldOprno, lineSn, userCode);
|
|
|
|
|
- resp.setMessage("工件可以加工");
|
|
|
|
|
|
|
+ //查询一下
|
|
|
|
|
+
|
|
|
|
|
+ String messs = mesOp050RecordService.saveIfAbsent(sn, oldOprno, lineSn, userCode);
|
|
|
|
|
+ resp.setMessage(messs);
|
|
|
resp.setResult(Global.TRUE);
|
|
resp.setResult(Global.TRUE);
|
|
|
return resp;
|
|
return resp;
|
|
|
}
|
|
}
|
|
@@ -5050,14 +5055,18 @@ public class MesProductRecordController extends BaseController {
|
|
|
|
|
|
|
|
CommonResp resp = new CommonResp<>();
|
|
CommonResp resp = new CommonResp<>();
|
|
|
|
|
|
|
|
|
|
+ //抽检首件检是否合格
|
|
|
|
|
+ resp = checkShiftFirstQualityNg(request);
|
|
|
|
|
+ if ("false".equals(resp.getResult())){
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 查询工位是否有数据
|
|
// 查询工位是否有数据
|
|
|
resp =pdaQueryIsSn(request);
|
|
resp =pdaQueryIsSn(request);
|
|
|
if ("false".equals(resp.getResult())){
|
|
if ("false".equals(resp.getResult())){
|
|
|
return resp;
|
|
return resp;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
resp = pccheck(request);
|
|
resp = pccheck(request);
|
|
|
String sn = request.getParameter("sn");
|
|
String sn = request.getParameter("sn");
|
|
|
String oprno = request.getParameter("oprno");
|
|
String oprno = request.getParameter("oprno");
|
|
@@ -5078,6 +5087,9 @@ public class MesProductRecordController extends BaseController {
|
|
|
|
|
|
|
|
if ("true".equals(resp.getResult())){
|
|
if ("true".equals(resp.getResult())){
|
|
|
try {
|
|
try {
|
|
|
|
|
+ if ("OP050A".equals(oprno)){
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
// 将二维码放置在工位
|
|
// 将二维码放置在工位
|
|
|
// MesProductRecord mesProductRecord = new MesProductRecord();
|
|
// MesProductRecord mesProductRecord = new MesProductRecord();
|
|
|
// mesProductRecord.setSn(sn);
|
|
// mesProductRecord.setSn(sn);
|
|
@@ -5108,9 +5120,6 @@ public class MesProductRecordController extends BaseController {
|
|
|
// 新增表 工件码 工位号 ucode
|
|
// 新增表 工件码 工位号 ucode
|
|
|
resp.setResult(Global.TRUE);
|
|
resp.setResult(Global.TRUE);
|
|
|
resp.setMessage("扫码成功");
|
|
resp.setMessage("扫码成功");
|
|
|
- /*if ("OP050A".equals(oprno)){
|
|
|
|
|
- resp.setMessage("扫码成功,请进行检查,工件码:"+sn);
|
|
|
|
|
- }*/
|
|
|
|
|
return resp;
|
|
return resp;
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
resp.setResult(Global.FALSE);
|
|
resp.setResult(Global.FALSE);
|
|
@@ -5126,6 +5135,52 @@ public class MesProductRecordController extends BaseController {
|
|
|
return resp;
|
|
return resp;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private CommonResp<String> checkShiftFirstQualityNg(HttpServletRequest request) {
|
|
|
|
|
+ CommonResp<String> resp = new CommonResp<>();
|
|
|
|
|
+ String lineSn = request.getParameter("lineSn");
|
|
|
|
|
+ String oprno = request.getParameter("oprno");
|
|
|
|
|
+ if (StringUtils.isEmpty(lineSn) || StringUtils.isEmpty(oprno)){
|
|
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
|
|
+ resp.setMessage("参数错误");
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MesShiftDataResp shift = mesShiftService.getCurShift();
|
|
|
|
|
+ if (shift == null || StringUtils.isBlank(shift.getStart()) || StringUtils.isBlank(shift.getEnd())) {
|
|
|
|
|
+ resp.setResult(Global.TRUE);
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String qualityOprno = oprno;
|
|
|
|
|
+ if (qualityOprno.length() == 5) {
|
|
|
|
|
+ qualityOprno += "A";
|
|
|
|
|
+ }
|
|
|
|
|
+ String formattedOprno = CommonUitl.formatOprno(qualityOprno);
|
|
|
|
|
+ List<String> oprnos = new ArrayList<>();
|
|
|
|
|
+ oprnos.add(qualityOprno);
|
|
|
|
|
+ if (!StringUtils.equals(qualityOprno, formattedOprno)) {
|
|
|
|
|
+ oprnos.add(formattedOprno);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MesQuality mesQuality = new MesQuality();
|
|
|
|
|
+ mesQuality.setLineSn(lineSn);
|
|
|
|
|
+ mesQuality.setType(MesQuality.TYPE_FIRST);
|
|
|
|
|
+ mesQuality.setResult("NG");
|
|
|
|
|
+ mesQuality.getSqlMap().getWhere()
|
|
|
|
|
+ .and("a.oprno", QueryType.IN, oprnos)
|
|
|
|
|
+ .and("a.update_date", QueryType.GTE, shift.getStart())
|
|
|
|
|
+ .and("a.update_date", QueryType.LT, shift.getEnd());
|
|
|
|
|
+ long ngCount = mesQualityService.findCount(mesQuality);
|
|
|
|
|
+ if (ngCount > 0) {
|
|
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
|
|
+ resp.setMessage("该工位首件检查不合格");
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ resp.setResult(Global.TRUE);
|
|
|
|
|
+ return resp;
|
|
|
|
|
+ }
|
|
|
//pda根据工件码查询信息
|
|
//pda根据工件码查询信息
|
|
|
@PostMapping(value = "pdaQueryBySn")
|
|
@PostMapping(value = "pdaQueryBySn")
|
|
|
@ResponseBody
|
|
@ResponseBody
|