|
@@ -316,7 +316,8 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if (zoneType.equals(ParameterKey.ZONE_YJ)){
|
|
|
+ }
|
|
|
+ else if (zoneType.equals(ParameterKey.ZONE_YJ)){
|
|
|
|
|
|
Order order = orderMapper.selectById(task.getOrderId());
|
|
|
Plan plan = planMapper.selectById(task.getPlanId());
|
|
@@ -326,7 +327,7 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
logger.warn("【进入YJ_MQ队列判断】,节点对象:{}",JSONObject.toJSONString(taskNode));
|
|
|
//如果是三坐标检测
|
|
|
if("3".equals(taskNode.getNodeType())){
|
|
|
- // TODO 后续改成动态拼接
|
|
|
+/* // TODO 后续改成动态拼接
|
|
|
//组装接口参数
|
|
|
JSONObject jsonParam = new JSONObject();
|
|
|
jsonParam.put("tagname","DB200.20");
|
|
@@ -340,17 +341,43 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
//String measuringResultFile = SmbShareFileUtil.findNewMeasuringFiles(fileIp,userName,password,filePath + date + "/");
|
|
|
String measuringResultFile = "";
|
|
|
//List<String> fileContents = new ArrayList<>();
|
|
|
- logger.warn("获取检测结果文件路径{}", measuringResultFile);
|
|
|
+ logger.warn("获取检测结果文件路径{}", measuringResultFile);*/
|
|
|
+
|
|
|
+ log.info("======三坐标测量结果======");
|
|
|
+
|
|
|
OrderQuality orderQuality = new OrderQuality();
|
|
|
TTaskTestUnqualifiedBom taskTestUnqualifiedBom = new TTaskTestUnqualifiedBom();
|
|
|
|
|
|
TWorkpiece workpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,task.getCompleteBatchNo()));
|
|
|
- logger.warn("三坐标测量结果{}", measuringResult);
|
|
|
- if(measuringResult == 0){
|
|
|
+ // 根据库位id查询存储在此库位的信息工装夹具信息,查询工装所需要的检测程序名
|
|
|
+ List<StockInfo> list = stockInfoService.list(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId, workpiece.getStorgeId()));
|
|
|
+ List<Long> getGoodsIds = list.stream().map(StockInfo::getGoodsId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<MToolClamp> mToolClamps = mToolClampService.listByIds(getGoodsIds);
|
|
|
+ // 拼接上传给plc的参数, 图号-零件号-源工序号-是否毛坯件-使用的检测程序
|
|
|
+ String toPlcPar = bom.getDrawingNo()+"&"
|
|
|
+ +workpiece.getUniqueCode()+"&"
|
|
|
+ +bom.getNo()+"&1&"
|
|
|
+ +mToolClamps.get(0).getDetectionProgram()+"&"
|
|
|
+ +task.getTaskNo()+"&"
|
|
|
+ +task.getExecutorId()+"&"
|
|
|
+ +task.getOrderNo()+"&"
|
|
|
+ +task.getBomBatchNo();
|
|
|
+
|
|
|
+ orderQuality = orderQualityMapper.selectOne(Wraps.<OrderQuality>lbQ().eq(OrderQuality::getDetectionCommand, toPlcPar ));
|
|
|
+
|
|
|
+ int measuringResult = 1;
|
|
|
+ if(orderQuality !=null ){
|
|
|
//fileContents.add("OK");
|
|
|
- orderQuality.setOkFlag("OK");
|
|
|
- workpiece.setTestResult("1");
|
|
|
- taskTestUnqualifiedBom.setTestResult("1");
|
|
|
+ if(orderQuality.getOkFlag().equals("OK")){
|
|
|
+ measuringResult = 0;
|
|
|
+ workpiece.setTestResult("1");
|
|
|
+ taskTestUnqualifiedBom.setTestResult("1");
|
|
|
+ }else {
|
|
|
+ orderQuality.setOkFlag("NG");
|
|
|
+ workpiece.setTestResult("0");
|
|
|
+ taskTestUnqualifiedBom.setTestResult("0");
|
|
|
+ }
|
|
|
}else{
|
|
|
//fileContents.add("NG");
|
|
|
orderQuality.setOkFlag("NG");
|
|
@@ -361,9 +388,13 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
|
|
|
orderQuality.setOrderNo(order.getOrderNo()).setOrderId(order.getId()).setTaskId(task.getId())
|
|
|
.setWorkpieceId(task.getCompleteBatchNo()).setWorkpieceName(bom.getName()).setProcedureId(task.getProcedureId())
|
|
|
- .setProcedureName(task.getProcedureName()).setMeasuringType(1).setMeasuringReport(measuringResultFile);
|
|
|
+ .setProcedureName(task.getProcedureName()).setMeasuringType(1);
|
|
|
|
|
|
- orderQualityMapper.insert(orderQuality);
|
|
|
+ if(orderQuality.getId()!=null){
|
|
|
+ orderQualityMapper.updateById(orderQuality);
|
|
|
+ }else {
|
|
|
+ orderQualityMapper.insert(orderQuality);
|
|
|
+ }
|
|
|
|
|
|
taskTestUnqualifiedBom.setTaskId(task.getId()).setTaskNo(task.getTaskNo()).setOrderId(order.getId()).setOrderNo(order.getOrderNo())
|
|
|
.setPlanId(plan.getId()).setPlanNo(plan.getPlanNo()).setProcedureId(task.getProcedureId()).setBomId(task.getBomId())
|
|
@@ -407,9 +438,9 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if ("5".equals(taskNode.getNodeType())){
|
|
|
- logger.info("======三坐标检测===={}",JSONObject.toJSONString(taskNode));
|
|
|
- log.info("======三坐标检测===={}",JSONObject.toJSONString(taskNode));
|
|
|
+ }
|
|
|
+ else if ("5".equals(taskNode.getNodeType())){
|
|
|
+ log.info("=========三坐标检测-工件坐标系========{}",JSONObject.toJSONString(taskNode));
|
|
|
|
|
|
// 工件坐标系检测 三坐标测量偏移量数据添加
|
|
|
BomProcedure procedure = bomProcedureService.getById(task.getProcedureId());
|