|
@@ -364,6 +364,99 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
map.put("result", true);
|
|
|
}
|
|
|
|
|
|
+ break;
|
|
|
+ case "smu50":
|
|
|
+ Productionresource productionresource2 = productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
|
|
|
+ map.put("url",productionresource2.getIp());
|
|
|
+ map.put("port",productionresource2.getPort());
|
|
|
+ if ("1".equals(functionType)) {
|
|
|
+ //程序文件上传
|
|
|
+ List<BomProcedureProgram>procedureProgramList = bomProcedureProgramMapper.selectList(Wraps.<BomProcedureProgram>lbQ().eq(BomProcedureProgram::getProcedureId,task.getProcedureId()));
|
|
|
+
|
|
|
+ List<Map<String, String>> fileList = new ArrayList<Map<String, String>>();
|
|
|
+ if (procedureProgramList != null && procedureProgramList.size() > 0) {
|
|
|
+ //文件上传只允许单个文件
|
|
|
+ procedureProgramList.forEach(i -> {
|
|
|
+ Map<String, String> m = new HashMap<>();
|
|
|
+ String filePath = i.getFilePath().replace(uriPath, storagePath);
|
|
|
+ m.put("fileName", filePath.replace("/", "\\"));
|
|
|
+ fileList.add(m);
|
|
|
+ });
|
|
|
+ //map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "uploadProgram");
|
|
|
+ map.put("method", "UploadFile");
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ data.put("fileName", fileList.get(0).get("fileName"));
|
|
|
+ msgUtil.redis_set("UploadFile_Path"+"_"+task.getId(), uriPath+","+storagePath+","+fileList.get(0).get("fileName"), 1, TimeUnit.DAYS);
|
|
|
+ Module module = moduleService.getOne(new LbqWrapper<Module>().eq(Module::getId, productionresource2.getModuleId()));
|
|
|
+ data.put("remotePath", module.getCncFilePath());
|
|
|
+ //msgUtil.redis_set(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo(), fileName, 1, TimeUnit.DAYS);
|
|
|
+ /*if(productionresource.getModeSpecification().contains("HEIDENHAIN")){
|
|
|
+ //缓存程序编号信息
|
|
|
+ JSONObject uploadInfo = new JSONObject();
|
|
|
+ uploadInfo.put("url", productionresource.getIp());
|
|
|
+ uploadInfo.put("port", productionresource.getPort());
|
|
|
+ uploadInfo.put("data", data);
|
|
|
+ msgUtil.redis_set(DemoLineConstant.DEMOLINE_HEIDENHAIN_FILE_URL+"_"+task.getId(), uploadInfo.toJSONString(), 30, TimeUnit.DAYS);
|
|
|
+ data.put("fileName", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(productionresource.getModeSpecification().contains("HELLER")) data.put("HELLER","HELLER"); //内部调用标识*/
|
|
|
+ map.put("data", data);
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if ("2".equals(functionType)) {
|
|
|
+ if("执行清洗".equals(taskNode.getNodeName())){
|
|
|
+ map.put("method", "StartCleanMachine");
|
|
|
+ map.put("url",plcInfo.get("url"));
|
|
|
+ map.put("port",plcInfo.get("port"));
|
|
|
+ map.put("result", true);
|
|
|
+ map.remove("data");
|
|
|
+ }else{
|
|
|
+ //执行加工程序,分多次执行
|
|
|
+ //String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
|
|
|
+ // : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
|
|
|
+ //map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "execProgram");
|
|
|
+ //当前执行数量
|
|
|
+ //String fileName = msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo()) == null ? "" : msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo()).toString();
|
|
|
+ List<BomProcedureProgram> procedureProgramList = bomProcedureProgramMapper.selectList(Wraps.<BomProcedureProgram>lbQ().eq(BomProcedureProgram::getProcedureId,task.getProcedureId()));
|
|
|
+ //执行程序默认按单文件处理
|
|
|
+ //String fileName = "";
|
|
|
+ //String fileNames[] = fileName.split(",");
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ data.put("remotePath", procedureProgramList.get(0).getSubmittedFileName());
|
|
|
+
|
|
|
+ map.put("data", data);
|
|
|
+ map.put("method", "StartNCProgram");
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if ("3".equals(functionType)){
|
|
|
+ // 加工前写入工件坐标系 根据taskid查找工件三坐标测量的工件坐标系,可能存在装夹一次未果的情况,所以取最后一条数据
|
|
|
+ // TODO 工件坐标系根据机场不同系统,不同通讯协议调用不同的接口
|
|
|
+ OrderQuality orderQuality = orderQualityMapper.selectOne(Wraps.<OrderQuality>lbQ().eq(OrderQuality::getProcedureId,task.getProcedureId()).eq(OrderQuality::getWorkpieceId,task.getCompleteBatchNo()));
|
|
|
+ if(null == orderQuality){
|
|
|
+ // 简单处理的方式,直接将坐标偏移全部设置成0
|
|
|
+ queryMap.put("x", "0");
|
|
|
+ queryMap.put("y", "0");
|
|
|
+ queryMap.put("z", "0");
|
|
|
+ queryMap.put("a", "0");
|
|
|
+ queryMap.put("b", "0");
|
|
|
+ queryMap.put("c", "0");
|
|
|
+ }else{
|
|
|
+ queryMap.put("x", String.valueOf(orderQuality.getSketchyXaxisOffset()));
|
|
|
+ queryMap.put("y", String.valueOf(orderQuality.getSketchyYaxisOffset()));
|
|
|
+ queryMap.put("z", String.valueOf(orderQuality.getSketchyZaxisOffset()));
|
|
|
+ queryMap.put("a", String.valueOf(orderQuality.getSketchyAaxisOffset()));
|
|
|
+ queryMap.put("b", String.valueOf(orderQuality.getSketchyBaxisOffset()));
|
|
|
+ queryMap.put("c", String.valueOf(orderQuality.getSketchyCaxisOffset()));
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("method", "SendLinShift");
|
|
|
+ map.put("data", queryMap);
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
case "smg80":
|
|
|
Productionresource productionresource1 = productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
|