|
|
@@ -12,6 +12,7 @@ import com.github.zuihou.business.operationManagementCenter.entity.*;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.TaskService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BBom;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
|
|
|
@@ -112,6 +113,8 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
@Autowired
|
|
|
private PlanMapper planMapper;
|
|
|
@Autowired
|
|
|
+ private BomProcedureMapper bomProcedureMapper;
|
|
|
+ @Autowired
|
|
|
private WorkpieceMapper workpieceMapper;
|
|
|
@Autowired
|
|
|
private TTaskTestUnqualifiedBomMapper taskTestUnqualifiedBomMapper;
|
|
|
@@ -172,6 +175,7 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
|
|
|
if(n<taskNodeList.size()-1){ //尚未执行到最后一个
|
|
|
TaskNode nextTaskNode = taskNodeList.get(n+1);
|
|
|
+ //TaskNode beforeNode = taskNodeService.getNextNTaskNode(taskNode, -1);
|
|
|
|
|
|
String zoneType = (null == redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
|
|
|
if(zoneType.equals(ParameterKey.ZONE_SFX)){
|
|
|
@@ -296,11 +300,11 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
Order order = orderMapper.selectById(task.getOrderId());
|
|
|
Plan plan = planMapper.selectById(task.getPlanId());
|
|
|
BBom bom = bBomMapper.selectById(task.getBomId());
|
|
|
-
|
|
|
- //
|
|
|
+ //获取配置工序
|
|
|
+ BomProcedure bomProcedure = bomProcedureMapper.selectById(task.getProcedureId());
|
|
|
|
|
|
//如果是三坐标检测
|
|
|
- if("3".equals(nextTaskNode.getNodeType())){
|
|
|
+ if("3".equals(taskNode.getNodeType())){
|
|
|
// TODO 后续改成动态拼接
|
|
|
//组装接口参数
|
|
|
ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,taskNode.getResourceId()));
|
|
|
@@ -322,60 +326,43 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
// TODO 改成虚拟端口,后续删除
|
|
|
plcUrl = plcUrl.replace("8081","8083");
|
|
|
|
|
|
-
|
|
|
String instructionUrl = plcUrl + "/api/GetTagValue";
|
|
|
System.out.println("instructionUrl=" + instructionUrl);
|
|
|
System.out.println("jsonParam=" + jsonParam);
|
|
|
String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
|
|
|
-
|
|
|
- // TODO modify by yejian on 20220525 for 添加三坐标模拟
|
|
|
- Random random = new Random();
|
|
|
- Boolean measuringFlag = random.nextBoolean();
|
|
|
-// int measuringResult = measuringFlag ? 0 : 1;
|
|
|
- int measuringResult = 1;
|
|
|
- String measuringResultFile = filePath + taskNode.getCompleteBatchNo() + "_" + task.getProcedureNo() + ".csv";
|
|
|
- List<String> fileContents = new ArrayList<>();
|
|
|
+ //获取检测结果
|
|
|
+ int measuringResult = Integer.parseInt(returnData);
|
|
|
+ //_pdfFileGraphic
|
|
|
+ String measuringResultFile = filePath + bomProcedure.getThreeDimensionalPrograme() + "_" + taskNode.getProcedureNo() + "_" + task.getCompleteBatchNo() + "_" + taskNode.getId() +".pdf";
|
|
|
+ //List<String> fileContents = new ArrayList<>();
|
|
|
OrderQuality orderQuality = new OrderQuality();
|
|
|
TTaskTestUnqualifiedBom taskTestUnqualifiedBom = new TTaskTestUnqualifiedBom();
|
|
|
|
|
|
TWorkpiece workpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,task.getCompleteBatchNo()));
|
|
|
logger.info("三坐标测量结果{}", measuringResult);
|
|
|
if(measuringResult == 0){
|
|
|
- fileContents.add("OK");
|
|
|
+ //fileContents.add("OK");
|
|
|
orderQuality.setOkFlag("OK");
|
|
|
workpiece.setTestResult("1");
|
|
|
taskTestUnqualifiedBom.setTestResult("1");
|
|
|
}else{
|
|
|
- fileContents.add("NG");
|
|
|
+ //fileContents.add("NG");
|
|
|
orderQuality.setOkFlag("NG");
|
|
|
workpiece.setTestResult("0");
|
|
|
taskTestUnqualifiedBom.setTestResult("0");
|
|
|
}
|
|
|
- SmbShareFileUtil.writeShareFileContent(measuringResultFile,fileContents,userName,password,fileIp);
|
|
|
+ //SmbShareFileUtil.writeShareFileContent(measuringResultFile,fileContents,userName,password,fileIp);
|
|
|
|
|
|
+ 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);
|
|
|
|
|
|
- orderQuality.setOrderNo(order.getOrderNo());
|
|
|
- orderQuality.setOrderId(order.getId());
|
|
|
- orderQuality.setTaskId(task.getId());
|
|
|
- orderQuality.setWorkpieceId(task.getCompleteBatchNo());
|
|
|
- orderQuality.setWorkpieceName(bom.getName());
|
|
|
- orderQuality.setProcedureId(task.getProcedureId());
|
|
|
- orderQuality.setProcedureName(task.getProcedureName());
|
|
|
- orderQuality.setMeasuringType(1);
|
|
|
- orderQuality.setMeasuringReport(measuringResultFile);
|
|
|
orderQualityMapper.insert(orderQuality);
|
|
|
|
|
|
- taskTestUnqualifiedBom.setTaskId(task.getId());
|
|
|
- taskTestUnqualifiedBom.setTaskNo(task.getTaskNo());
|
|
|
- taskTestUnqualifiedBom.setOrderId(order.getId());
|
|
|
- taskTestUnqualifiedBom.setOrderNo(order.getOrderNo());
|
|
|
- taskTestUnqualifiedBom.setPlanId(plan.getId());
|
|
|
- taskTestUnqualifiedBom.setPlanNo(plan.getPlanNo());
|
|
|
- taskTestUnqualifiedBom.setProcedureId(task.getProcedureId());
|
|
|
- taskTestUnqualifiedBom.setBomId(task.getBomId());
|
|
|
- taskTestUnqualifiedBom.setBomName(bom.getName());
|
|
|
- taskTestUnqualifiedBom.setUniqueCode(workpiece.getUniqueCode());
|
|
|
- taskTestUnqualifiedBom.setBomNum(1);
|
|
|
+ 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())
|
|
|
+ .setBomName(bom.getName()).setUniqueCode(workpiece.getUniqueCode()).setBomNum(1);
|
|
|
+
|
|
|
taskTestUnqualifiedBomMapper.insert(taskTestUnqualifiedBom);
|
|
|
|
|
|
workpieceMapper.updateById(workpiece);
|
|
|
@@ -412,7 +399,7 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else if ("5".equals(nextTaskNode.getNodeType())){
|
|
|
+ }else if ("5".equals(taskNode.getNodeType())){
|
|
|
// 工件坐标系检测
|
|
|
String nginxRemoteFilePath = "";
|
|
|
String findFileName = taskNode.getCompleteBatchNo()+ "_" + task.getProcedureNo();
|