|
|
@@ -106,7 +106,6 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
@Autowired
|
|
|
private WorkpieceMapper workpieceMapper;
|
|
|
|
|
|
- private Map<String, Object> map = Maps.newHashMap();
|
|
|
|
|
|
private Map<String, Object> queryMap = Maps.newHashMap();
|
|
|
|
|
|
@@ -154,9 +153,9 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
public void initResource(TaskNode taskNode, TTask task, Map dataMap) {
|
|
|
//获取当前设备模型
|
|
|
String moduleName = dataMap.get("moduleName") == null ? "" : dataMap.get("moduleName").toString();
|
|
|
- if(StringUtil.isNotEmpty(moduleName)) {
|
|
|
+ if (StringUtil.isNotEmpty(moduleName)) {
|
|
|
Module module = moduleService.getOne(new LbqWrapper<Module>().eq(Module::getName, moduleName).eq(Module::getStatus, 1));
|
|
|
- if(null != module){
|
|
|
+ if (null != module) {
|
|
|
deviceArr = new String[]{module.getNo()};
|
|
|
deviceList = productionresourcePositionService.getFreeProductionresourcePositionByNos(deviceArr);
|
|
|
}
|
|
|
@@ -178,17 +177,18 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
bomzZone = zoneService.getById(bomZzoneId);
|
|
|
|
|
|
String paramKey = zZone.getNo() + "_plc";
|
|
|
- instructionUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
|
|
|
+ instructionUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS) ? "" : ((Map<String, String>) msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
|
|
|
// TODO 后续删除代码,目前条用模拟接口
|
|
|
// if("framework".equals(zZone.getNo())){
|
|
|
// instructionUrl = instructionUrl.replace("8086","8083");
|
|
|
// }else{
|
|
|
- instructionUrl = instructionUrl.replace("8081","8083");
|
|
|
+ instructionUrl = instructionUrl.replace("8081", "8083");
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Map checkCondition(TaskNode taskNode, TTask task, Map<String, Object> dataMap) {
|
|
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
|
// //业务类型
|
|
|
// String bizType = dataMap.get("bizType") == null ? "" : dataMap.get("bizType").toString();
|
|
|
// //具体的搬运类型
|
|
|
@@ -211,7 +211,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
String moduleName = dataMap.get("moduleName") == null ? "" : dataMap.get("moduleName").toString();
|
|
|
|
|
|
//采集接口判断当前设备是否在线
|
|
|
- if(!taskNodeService.getRunStatus(task.getResourceId())){
|
|
|
+ if (!taskNodeService.getRunStatus(task.getResourceId())) {
|
|
|
map.put("result", false);
|
|
|
map.put("msg", DictionaryKey.NodeException.RUNNING_FALSE);
|
|
|
return map;
|
|
|
@@ -236,20 +236,20 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
// }
|
|
|
|
|
|
//获取设备指令集合
|
|
|
- List<ModuleInstruction> moduleInstructions = (List<ModuleInstruction>)dataMap.get("instructions");
|
|
|
+ List<ModuleInstruction> moduleInstructions = (List<ModuleInstruction>) dataMap.get("instructions");
|
|
|
|
|
|
switch (moduleName.toLowerCase()) {
|
|
|
case "打标机":
|
|
|
//执行打标程序
|
|
|
- if("2".equals(functionType) && moduleInstructions.size() == 1){
|
|
|
- instructionUrl = instructionUrl.replace("8083","8081");
|
|
|
+ if ("2".equals(functionType) && moduleInstructions.size() == 1) {
|
|
|
+ instructionUrl = instructionUrl.replace("8083", "8081");
|
|
|
//打标
|
|
|
// map.put("zkIp", ZK_ip_rxx);
|
|
|
// map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "print");
|
|
|
//获取打标指令编码imcs_t_workpiece
|
|
|
map.put("method", moduleInstructions.get(0).getCode());
|
|
|
- map.put("url",plcInfo.get("url"));
|
|
|
- map.put("port",plcInfo.get("port"));
|
|
|
+ map.put("url", plcInfo.get("url"));
|
|
|
+ map.put("port", plcInfo.get("port"));
|
|
|
//获取打标唯一码
|
|
|
String unionCode = workpieceService.getUnionCode(task.getCompleteBatchNo());
|
|
|
|
|
|
@@ -277,40 +277,48 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
}
|
|
|
break;
|
|
|
case "机床":
|
|
|
- Productionresource productionresource = productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
|
|
|
- map.put("url",productionresource.getIp());
|
|
|
- map.put("port",productionresource.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>>();
|
|
|
+ Productionresource productionresource = productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId, taskNode.getTargetResourceId()));
|
|
|
+ map.put("url", productionresource.getIp());
|
|
|
+ map.put("port", productionresource.getPort());
|
|
|
+ if ("1".equals(functionType)) {// 目前只有西门子机床需要文件上传,启动程序,西门子通过给plc信号来启动
|
|
|
+ //程序文件上传
|
|
|
+ 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);
|
|
|
+ String submittedFileName = i.getSubmittedFileName();
|
|
|
//m.put("fileName", filePath.replace("/", "\\"));
|
|
|
m.put("fileName", filePath);
|
|
|
+ m.put("submittedFileName", submittedFileName);
|
|
|
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);
|
|
|
+ // C:/data/projects/uploadfile/file/0000/2025/07/CNC01.MPF
|
|
|
+ // /data/projects/uploadfile/
|
|
|
+ String filepath = fileList.get(0).get("fileName"); // C:/data/projects/uploadfile/CNC01.MPF
|
|
|
+ filepath = filepath.split("/file")[0] + "/" + fileList.get(0).get("submittedFileName");// C:/data/projects/uploadfile/
|
|
|
+
|
|
|
+ data.put("fileName", filepath);
|
|
|
+ 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, productionresource.getModuleId()));
|
|
|
TWorkpiece workpiece = workpieceService.getOne(new LbqWrapper<TWorkpiece>().eq(TWorkpiece::getCompleteBatchNo, task.getCompleteBatchNo()).last("limit 1"));
|
|
|
BBom bom = bBomMapper.selectById(workpiece.getBomId());
|
|
|
- data.put("remotePath", bom.getDrawingNo()+"\\OP"+bom.getNo());
|
|
|
+ data.put("remotePath", bom.getDrawingNo() + "\\OP" + bom.getNo());
|
|
|
//msgUtil.redis_set(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo(), fileName, 1, TimeUnit.DAYS);
|
|
|
- if(StringUtil.isNotEmpty(productionresource.getModeSpecification()) && productionresource.getModeSpecification().contains("HEIDENHAIN")){
|
|
|
+ if (StringUtil.isNotEmpty(productionresource.getModeSpecification()) && productionresource.getModeSpecification().contains("HEIDENHAIN")) {
|
|
|
//缓存程序编号信息
|
|
|
JSONObject uploadInfo = new JSONObject();
|
|
|
- uploadInfo.put("url", productionresource.getIp());
|
|
|
+ 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);
|
|
|
+ msgUtil.redis_set(DemoLineConstant.DEMOLINE_HEIDENHAIN_FILE_URL + "_" + task.getId(), uploadInfo.toJSONString(), 30, TimeUnit.DAYS);
|
|
|
data.put("fileName", "");
|
|
|
}
|
|
|
|
|
|
@@ -318,54 +326,52 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
map.put("data", data);
|
|
|
map.put("result", true);
|
|
|
}
|
|
|
- }
|
|
|
- else if ("2".equals(functionType)) {
|
|
|
+ } else if ("2".equals(functionType)) {
|
|
|
//执行加工程序,分多次执行
|
|
|
//String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
|
|
|
- // : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
|
|
|
+ // : 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()));
|
|
|
+ List<BomProcedureProgram> procedureProgramList = bomProcedureProgramMapper.selectList(Wraps.<BomProcedureProgram>lbQ().eq(BomProcedureProgram::getProcedureId, task.getProcedureId()));
|
|
|
//执行程序默认按单文件处理
|
|
|
//String fileName = "";
|
|
|
//String fileNames[] = fileName.split(",");
|
|
|
JSONObject data = new JSONObject();
|
|
|
TWorkpiece workpiece = workpieceService.getOne(new LbqWrapper<TWorkpiece>().eq(TWorkpiece::getCompleteBatchNo, task.getCompleteBatchNo()).last("limit 1"));
|
|
|
BBom bom = bBomMapper.selectById(workpiece.getBomId());
|
|
|
- String remotePath = bom.getDrawingNo()+"\\OP"+bom.getNo();
|
|
|
- data.put("remotePath", remotePath+ "\\" +procedureProgramList.get(0).getSubmittedFileName());
|
|
|
+ String remotePath = bom.getDrawingNo() + "\\OP" + bom.getNo();
|
|
|
+ data.put("remotePath", 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);
|
|
|
}
|
|
|
- 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 "清洗烘干机":
|
|
|
@@ -376,56 +382,56 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
//map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "Clean");
|
|
|
//获取打标指令编码
|
|
|
map.put("method", moduleInstructions.get(0).getCode());
|
|
|
- map.put("url",plcInfo.get("url"));
|
|
|
- map.put("port",plcInfo.get("port"));
|
|
|
+ map.put("url", plcInfo.get("url"));
|
|
|
+ map.put("port", plcInfo.get("port"));
|
|
|
map.put("result", true);
|
|
|
map.remove("data");
|
|
|
// map.put("data", new HashMap<>());
|
|
|
- }else if("4".equals(functionType)){
|
|
|
+ } else if ("4".equals(functionType)) {
|
|
|
map.put("method", moduleInstructions.get(0).getCode());
|
|
|
- map.put("url",plcInfo.get("url"));
|
|
|
- map.put("port",plcInfo.get("port"));
|
|
|
+ map.put("url", plcInfo.get("url"));
|
|
|
+ map.put("port", plcInfo.get("port"));
|
|
|
map.put("result", true);
|
|
|
- map.put("specialCallBackMyselfFlag",true);
|
|
|
+ map.put("specialCallBackMyselfFlag", true);
|
|
|
map.remove("data");
|
|
|
}
|
|
|
break;
|
|
|
case "清洗吹干机":
|
|
|
if ("2".equals(functionType) && moduleInstructions.size() == 1) {
|
|
|
map.put("method", moduleInstructions.get(0).getCode());
|
|
|
- map.put("url",plcInfo.get("url"));
|
|
|
- map.put("port",plcInfo.get("port"));
|
|
|
+ map.put("url", plcInfo.get("url"));
|
|
|
+ map.put("port", plcInfo.get("port"));
|
|
|
map.put("result", true);
|
|
|
map.remove("data");
|
|
|
- }else if("4".equals(functionType)){
|
|
|
+ } else if ("4".equals(functionType)) {
|
|
|
//无清洗业务
|
|
|
map.put("method", moduleInstructions.get(0).getCode());
|
|
|
- map.put("url",plcInfo.get("url"));
|
|
|
- map.put("port",plcInfo.get("port"));
|
|
|
+ map.put("url", plcInfo.get("url"));
|
|
|
+ map.put("port", plcInfo.get("port"));
|
|
|
map.put("result", true);
|
|
|
- map.put("specialCallBackMyselfFlag",true);
|
|
|
+ map.put("specialCallBackMyselfFlag", true);
|
|
|
map.remove("data");
|
|
|
}
|
|
|
break;
|
|
|
case "三坐标检测仪":
|
|
|
//坐标检测类型判断
|
|
|
- if ("2".equals(functionType) && moduleInstructions.size()==1) {
|
|
|
+ if ("2".equals(functionType) && moduleInstructions.size() == 1) {
|
|
|
//map.put("zkIp", ZK_ip_zlzx);
|
|
|
//map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "testwork");
|
|
|
//查出工序三坐标相关
|
|
|
BomProcedure procedure = bomProcedureService.getById(task.getProcedureId());
|
|
|
JSONObject data = new JSONObject();
|
|
|
// 判断是工件坐标系还是质量测量
|
|
|
- if("1".equals(procedure.getThreeDimensionalConf())){
|
|
|
+ if ("1".equals(procedure.getThreeDimensionalConf())) {
|
|
|
/*data.put("workId", task.getCompleteBatchNo() + "-" + task.getProcedureNo());*/
|
|
|
//data.put("workId", task.getCompleteBatchNo() + "_" + taskNode.getId());
|
|
|
data.put("workId", taskNode.getCompleteBatchNo());
|
|
|
- data.put("procedureNo",task.getProcedureNo());
|
|
|
+ data.put("procedureNo", task.getProcedureNo());
|
|
|
/*data.put("workType", procedure.getThreeDimensionalPrograme());*/
|
|
|
data.put("workProgramName", procedure.getThreeDimensionalPrograme());
|
|
|
String location = DictionaryKey.ZEISS_LOCATION.get("M");
|
|
|
//data.put("stationId","M");
|
|
|
- data.put("location",location);
|
|
|
+ data.put("location", location);
|
|
|
// begin modify by yejian on 20220507 for 更新tasknode表中nodetype,方便三坐标测量完成后回调后快速查找测量结果
|
|
|
taskNode.setNodeType("3");
|
|
|
taskNodeService.updateById(taskNode);
|
|
|
@@ -433,6 +439,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
String programPath = filePath + "/ProgramName/name.txt";
|
|
|
List<String> content = SmbShareFileUtil.readShareFileContent(programPath, userName, password, fileIp);
|
|
|
//List<String> content = Stream.of("0").collect(Collectors.toList());
|
|
|
+
|
|
|
if(content.size()>0 && content.get(0).equals("0")){
|
|
|
String programName = procedure.getThreeDimensionalPrograme();
|
|
|
SmbShareFileUtil.writeShareFileContent(programPath, Stream.of(programName).collect(Collectors.toList()), userName, password, fileIp );
|
|
|
@@ -441,7 +448,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
return map;
|
|
|
}
|
|
|
}
|
|
|
- if("1".equals(procedure.getThreeDimensionalDeviationConf())){
|
|
|
+ if ("1".equals(procedure.getThreeDimensionalDeviationConf())) {
|
|
|
data.put("workId", task.getCompleteBatchNo() + "-" + task.getProcedureNo());
|
|
|
data.put("workType", procedure.getThreeDimensionalDeviationPrograme());
|
|
|
// begin modify by yejian on 20220928 for 更新tasknode表中nodetype,方便三坐标工件坐标系测量后更新坐标系偏移量表
|
|
|
@@ -453,8 +460,8 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
|
|
|
//map.put("data", JSONObject.toJSONString(queryMap));
|
|
|
map.put("method", moduleInstructions.get(0).getCode());
|
|
|
- map.put("url",plcInfo.get("url"));
|
|
|
- map.put("port",plcInfo.get("port"));
|
|
|
+ map.put("url", plcInfo.get("url"));
|
|
|
+ map.put("port", plcInfo.get("port"));
|
|
|
map.put("data", data);
|
|
|
map.put("result", true);
|
|
|
}
|
|
|
@@ -467,19 +474,29 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
|
|
|
@Override
|
|
|
public Map operation(JSONObject jsonObject, JSONObject bizJsonObject, Map<String, Object> conMap) {
|
|
|
- //获取节点指令操作名称
|
|
|
- String method = conMap.get("method").toString();
|
|
|
- String hostSyetemUrl = "http://20.20.47.108:8090/";
|
|
|
- switch(method){
|
|
|
- case "execProgram": hostSyetemUrl = hostSyetemUrl + "/api/StartNCProgram"; break;
|
|
|
- case "clean": hostSyetemUrl = hostSyetemUrl + "/api/StartCleanMachine"; break;
|
|
|
- case "dry": hostSyetemUrl = hostSyetemUrl + "/api/StartDryMachine"; break;
|
|
|
- case "print": hostSyetemUrl = hostSyetemUrl + "/api/StartLabelMachine"; break;
|
|
|
- case "measuring": hostSyetemUrl = hostSyetemUrl + "/api/StartCoordinateMeasuringMachine";break;
|
|
|
+ //获取节点指令操作名称
|
|
|
+ String method = conMap.get("method").toString();
|
|
|
+ String hostSyetemUrl = "http://20.20.47.108:8090/";
|
|
|
+ switch (method) {
|
|
|
+ case "execProgram":
|
|
|
+ hostSyetemUrl = hostSyetemUrl + "/api/StartNCProgram";
|
|
|
+ break;
|
|
|
+ case "clean":
|
|
|
+ hostSyetemUrl = hostSyetemUrl + "/api/StartCleanMachine";
|
|
|
+ break;
|
|
|
+ case "dry":
|
|
|
+ hostSyetemUrl = hostSyetemUrl + "/api/StartDryMachine";
|
|
|
+ break;
|
|
|
+ case "print":
|
|
|
+ hostSyetemUrl = hostSyetemUrl + "/api/StartLabelMachine";
|
|
|
+ break;
|
|
|
+ case "measuring":
|
|
|
+ hostSyetemUrl = hostSyetemUrl + "/api/StartCoordinateMeasuringMachine";
|
|
|
+ break;
|
|
|
|
|
|
- }
|
|
|
- conMap.put("instructionUrl", hostSyetemUrl);
|
|
|
- return conMap;
|
|
|
+ }
|
|
|
+ conMap.put("instructionUrl", hostSyetemUrl);
|
|
|
+ return conMap;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -488,42 +505,43 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 设备动态逻辑判断处理
|
|
|
+ * 设备动态逻辑判断处理
|
|
|
*
|
|
|
* @param deviceList
|
|
|
* @param useXbk
|
|
|
* @return
|
|
|
*/
|
|
|
- private ProductionresourcePosition logical(List<ProductionresourcePosition> deviceList, boolean useXbk){
|
|
|
- //设备不存在
|
|
|
- if(deviceList == null || deviceList.size() == 0){
|
|
|
- map.put("msg", DictionaryKey.NodeException.NO_RESOURCE);
|
|
|
- return null;
|
|
|
- }
|
|
|
- //资源临界判断
|
|
|
- int current_running_num = storgeService.getstorgeByZone(zone_id.toString());
|
|
|
- if(current_running_num == DictionaryKey.RESOURCE_MAX_NUM){
|
|
|
- map.put("msg", DictionaryKey.NodeException.NO_RESOURCE);
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- deviceList = deviceList.stream().filter(position->position.getStatus()=="1" && position.getLockStatus()=="1").collect(Collectors.toList());
|
|
|
- //设备被锁定
|
|
|
- if(deviceList.size() == 0) {
|
|
|
- if(useXbk){
|
|
|
- if(xbkList.size() == 0){
|
|
|
- map.put("msg", DictionaryKey.NodeException.RESOURCE_LOCK);
|
|
|
- return null;
|
|
|
- }
|
|
|
- map.put("useXbk", true);
|
|
|
- return xbkList.get(0);
|
|
|
- }
|
|
|
- map.put("msg", DictionaryKey.NodeException.RESOURCE_LOCK);
|
|
|
- return null;
|
|
|
- }
|
|
|
- //设备托盘、夹具条件不满足 待定
|
|
|
-
|
|
|
- return deviceList.get(0);
|
|
|
+ private ProductionresourcePosition logical(List<ProductionresourcePosition> deviceList, boolean useXbk) {
|
|
|
+// //设备不存在
|
|
|
+// if (deviceList == null || deviceList.size() == 0) {
|
|
|
+// map.put("msg", DictionaryKey.NodeException.NO_RESOURCE);
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// //资源临界判断
|
|
|
+// int current_running_num = storgeService.getstorgeByZone(zone_id.toString());
|
|
|
+// if (current_running_num == DictionaryKey.RESOURCE_MAX_NUM) {
|
|
|
+// map.put("msg", DictionaryKey.NodeException.NO_RESOURCE);
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+//
|
|
|
+// deviceList = deviceList.stream().filter(position -> position.getStatus() == "1" && position.getLockStatus() == "1").collect(Collectors.toList());
|
|
|
+// //设备被锁定
|
|
|
+// if (deviceList.size() == 0) {
|
|
|
+// if (useXbk) {
|
|
|
+// if (xbkList.size() == 0) {
|
|
|
+// map.put("msg", DictionaryKey.NodeException.RESOURCE_LOCK);
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// map.put("useXbk", true);
|
|
|
+// return xbkList.get(0);
|
|
|
+// }
|
|
|
+// map.put("msg", DictionaryKey.NodeException.RESOURCE_LOCK);
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// //设备托盘、夹具条件不满足 待定
|
|
|
+//
|
|
|
+// return deviceList.get(0);
|
|
|
+ return null ;
|
|
|
}
|
|
|
|
|
|
}
|