|
@@ -1,17 +1,38 @@
|
|
|
package com.github.zuihou.business.productionResourceCenter.service.impl;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.github.zuihou.business.DemoLine.DemoCacheKey;
|
|
|
+import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
|
+import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
|
+import com.github.zuihou.business.edgeLibrary.service.StorgeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TTask;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureProgramGroupMapper;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureProgramGroup;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourcePositionMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.NodeOperationService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
|
|
|
+import com.github.zuihou.business.util.MsgUtil;
|
|
|
+import com.github.zuihou.common.util.StringUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
+
|
|
|
+import static java.util.stream.Collectors.groupingBy;
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
@@ -20,33 +41,332 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
@Autowired
|
|
|
private ProductionresourcePositionService productionresourcePositionService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StorgeService storgeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TaskNodeService taskNodeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MsgUtil msgUtil;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ProductionresourcePositionMapper productionresourcePositionMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private BomProcedureProgramGroupMapper bomProcedureProgramGroupMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WorkpieceService workpieceService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private BomProcedureService bomProcedureService;
|
|
|
+
|
|
|
+ //关联线边库
|
|
|
+ private String[] zxzxXBKarr = null;
|
|
|
+
|
|
|
+ //关联接驳位
|
|
|
+ private String[] jbwarr = null;
|
|
|
+
|
|
|
+ private String ZK_ip_zlzx = "192.168.170.61";
|
|
|
+
|
|
|
+ //智能单元
|
|
|
+ private String ZK_ip_zndy = "192.168.170.81";
|
|
|
+
|
|
|
+ private String ZK_ip_rxx = "192.168.170.71";
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void initResource(TaskNode taskNode, TTask task, Map dataMap) {
|
|
|
|
|
|
- Map map = productionresourcePositionService.getProductionresourcePositionMap();
|
|
|
- List<ProductionresourcePosition> productionresourcePositionList = (List<ProductionresourcePosition>)map.get((long)taskNode.getResourceId());
|
|
|
-
|
|
|
+ //Map map = productionresourcePositionService.getProductionresourcePositionMap();
|
|
|
+ //List<ProductionresourcePosition> productionresourcePositionList = (List<ProductionresourcePosition>)map.get((long)taskNode.getResourceId());
|
|
|
+ String functionName = dataMap.get("functionName").toString();
|
|
|
//获取种类
|
|
|
- String categoryName = dataMap.get("categoryName").toString();
|
|
|
- switch(categoryName){
|
|
|
- case "上下料站" : break;
|
|
|
- case "WMS" : break;
|
|
|
- case "打标机" : break;
|
|
|
- case "smu50" : break;
|
|
|
- case "清洗烘干机" : break;
|
|
|
- case "三坐标检测仪" : break;
|
|
|
-
|
|
|
+ if ("WMS_OUT".equals(functionName)) {
|
|
|
+ this.zxzxXBKarr = new String[]{DemoLineConstant.NODE_RESOURCE_ZLZX_XBK};
|
|
|
+ this.jbwarr = new String[]{DemoLineConstant.JBW_A, DemoLineConstant.JBW_B};
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean checkCondition(TaskNode taskNode) {
|
|
|
- return false;
|
|
|
+ public Map checkCondition(TaskNode taskNode, TTask task, Map<String, Object> dataMap) {
|
|
|
+ //业务类型
|
|
|
+ String bizType = dataMap.get("bizType") == null ? "" : dataMap.get("bizType").toString();
|
|
|
+ //具体的搬运类型
|
|
|
+ String carryType = dataMap.get("carryType") == null ? "" : dataMap.get("carryType").toString();
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("taskNode", taskNode);
|
|
|
+ map.put("task", task);
|
|
|
+ map.put("bizType", bizType);
|
|
|
+
|
|
|
+ String categoryName = dataMap.get("categoryName").toString();
|
|
|
+ String functionName = dataMap.get("functionName").toString();
|
|
|
+
|
|
|
+ switch (categoryName) {
|
|
|
+ case "WMS":
|
|
|
+ //WMS出库
|
|
|
+ if ("WMS_OUT".equals(functionName)) {
|
|
|
+ List<ProductionresourcePosition> xbkList = productionresourcePositionService.getFreeProductionresourcePositionByNos(zxzxXBKarr);
|
|
|
+ List<ProductionresourcePosition> jbwList = productionresourcePositionService.getFreeProductionresourcePositionByNos(jbwarr);
|
|
|
+ Map<String, List<ProductionresourcePosition>> jbwMap = jbwList.stream().collect(groupingBy(ProductionresourcePosition::getCode));
|
|
|
+ if (CollectionUtil.isNotEmpty(xbkList) && jbwMap.containsKey(DemoLineConstant.JBW_B) && jbwMap.containsKey(DemoLineConstant.JBW_A)) {
|
|
|
+ //获取下一个节点,用于锁定
|
|
|
+ TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode, 1);
|
|
|
+ //预占A接驳位
|
|
|
+ List<ProductionresourcePosition> jbwAList = jbwMap.get(DemoLineConstant.JBW_A);
|
|
|
+ Storge storgeA = storgeService.getById(jbwAList.get(0).getStorgeId());
|
|
|
+ storgeA.setCompleteBatchNo(task.getCompleteBatchNo());
|
|
|
+ storgeService.lockStorge(storgeA, nextTaskNode.getId());
|
|
|
+ //获取接驳位A位置
|
|
|
+ map.put("toStorge", storgeA);
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_METERIAL_RK);
|
|
|
+ map.put("locationName", "Location-8002");
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_WMS_TYPE, DemoLineConstant.DEMOLINE_WMS_CHUKU);//出库
|
|
|
+ Map jsonMap = new HashMap();
|
|
|
+ jsonMap.put("productNo", task.getMeterialId());
|
|
|
+ jsonMap.put("productCount", "1");
|
|
|
+ List<Map> list = new ArrayList<>();
|
|
|
+ list.add(jsonMap);
|
|
|
+ map.put("boxes", JSONArray.parseArray(JSONObject.toJSONString(list)));
|
|
|
+
|
|
|
+ //除去接驳位之后,B、C随机一个
|
|
|
+ List<ProductionresourcePosition> jbwBCList = jbwMap.get(DemoLineConstant.JBW_B);
|
|
|
+ //随机选第一个接驳位
|
|
|
+ ProductionresourcePosition p = jbwBCList.get(0);
|
|
|
+ //预占库位为下个节点准备
|
|
|
+ Storge jbwstorge = storgeService.getById(p.getStorgeId());
|
|
|
+
|
|
|
+ //锁定接驳位库位,锁定的业务ID是下一个节点的ID
|
|
|
+ jbwstorge.setCompleteBatchNo(task.getCompleteBatchNo());
|
|
|
+ storgeService.lockStorge(jbwstorge, nextTaskNode.getId());
|
|
|
+ msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JBW + "" + nextTaskNode.getId().toString(), jbwstorge, 1, TimeUnit.DAYS);
|
|
|
+
|
|
|
+ //锁定线边库
|
|
|
+ ProductionresourcePosition xbkP = xbkList.get(0);
|
|
|
+ Storge storgeXbk = storgeService.getById(xbkP.getStorgeId());
|
|
|
+ //获取到运料的节点。
|
|
|
+ TaskNode next6TaskNode = taskNodeService.getNextNTaskNode(taskNode, 6);
|
|
|
+ storgeXbk.setCompleteBatchNo(task.getCompleteBatchNo());
|
|
|
+ storgeService.lockStorge(storgeXbk, next6TaskNode.getId());
|
|
|
+ msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZLZX_XBK + next6TaskNode.getId(), storgeXbk, 1, TimeUnit.DAYS);
|
|
|
+ //记录产品流转到的库位
|
|
|
+ msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), storgeA, 1, TimeUnit.DAYS);
|
|
|
+ }
|
|
|
+ //条件
|
|
|
+ map.put("result", (CollectionUtil.isNotEmpty(xbkList) && jbwMap.containsKey(DemoLineConstant.JBW_B) && jbwMap.containsKey(DemoLineConstant.JBW_A)));
|
|
|
+ }
|
|
|
+ //WMS入库
|
|
|
+ else if ("WMS_IN".equals(functionName)) {
|
|
|
+ //WMS入库
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_GOODS_TYPE, DemoLineConstant.DEMOLINE_GOODS_TYPE_CHENGPIN);//成品
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_WMS_TYPE, DemoLineConstant.DEMOLINE_WMS_RUKU);//入库
|
|
|
+ //TODO临时这样写
|
|
|
+ Map queryMap = new HashMap();
|
|
|
+ String jbwarr[] = {DemoLineConstant.JBW_A};
|
|
|
+ queryMap.put("codes", StringUtil.changeIdsArrToSubQueryStr(jbwarr));
|
|
|
+ List<ProductionresourcePosition> jbwAList = productionresourcePositionMapper.getPPList(queryMap);
|
|
|
+ if (CollectionUtil.isNotEmpty(jbwAList)) {
|
|
|
+ Storge jbwAstorge = storgeService.getById(jbwAList.get(0).getStorgeId());
|
|
|
+ map.put("fromStorge", jbwAstorge);
|
|
|
+ }
|
|
|
+ map.put("locationName", "Location-8002");
|
|
|
+ Map jsonMap = new HashMap();
|
|
|
+ jsonMap.put("productNo", task.getBomId());
|
|
|
+ jsonMap.put("productCount", "1");
|
|
|
+ List<Map> list = new ArrayList<>();
|
|
|
+ list.add(jsonMap);
|
|
|
+ map.put("boxes", JSONArray.parseArray(JSONObject.toJSONString(list)));
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_METERIAL_CK);
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "上下料站":
|
|
|
+ //托盘夹具放入上下料站
|
|
|
+ if ("QSTATION_OUT".equals(functionName)) {
|
|
|
+ //1、取出质量中心机器人
|
|
|
+ Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
|
|
|
+ //重新锁定一下机器人的库位,更新一下被锁定的业务ID(由于搬运拆成两个节点)
|
|
|
+ //storgeService.lockStorge(jqrStorge, taskNode.getId());
|
|
|
+ //2、取出上下料站
|
|
|
+ Storge sxlzstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.SXLZ + taskNode.getId());
|
|
|
+ map.put("zkIp", ZK_ip_zlzx);
|
|
|
+ //3、把起始终点库位存放到map,用于接口
|
|
|
+ map.put("fromStorge", jqrStorge);
|
|
|
+ map.put("toStorge", sxlzstorge);
|
|
|
+ //出入库类型
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_TRAY_CRK);
|
|
|
+
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
|
|
|
+ map.put("Data", sxlzstorge);
|
|
|
+ //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
|
|
|
+ map.put("result", true);
|
|
|
+ //4、记录机器人的库位,下一个步骤使用
|
|
|
+// msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
|
|
|
+ }
|
|
|
+ else if ("QSTATION_OUT".equals(functionName)) {
|
|
|
+ map.put("zkIp", ZK_ip_zndy);
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
|
|
|
+ //前序绑定的sum50
|
|
|
+ Object sum50Storge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_SUM50_ZNDY + taskNode.getId());
|
|
|
+ if (sum50Storge != null) {//前序是绑定到sum50
|
|
|
+ sum50Storge = (Storge) sum50Storge;
|
|
|
+ //目的地为机器人手臂
|
|
|
+ map.put("toStorge", sum50Storge);
|
|
|
+ map.put("Data", sum50Storge);
|
|
|
+ msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sum50Storge, 1, TimeUnit.DAYS);
|
|
|
+ } else {
|
|
|
+ //前序绑定的线边库
|
|
|
+ Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK + taskNode.getId());
|
|
|
+ if (xbkStorge != null) {
|
|
|
+ xbkStorge = (Storge) xbkStorge;
|
|
|
+ //目的地为线边库
|
|
|
+ map.put("toStorge", xbkStorge);
|
|
|
+ map.put("Data", xbkStorge);
|
|
|
+ //临时存放到了线边库的标志
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
|
|
|
+ //临时存放到了智能单元的线边库
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
+ //
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "打标机":
|
|
|
+ if("DBJ_PRINT".equals(functionName)){
|
|
|
+ //打标
|
|
|
+ map.put("zkIp", ZK_ip_rxx);
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "print");
|
|
|
+ //获取打标唯一码
|
|
|
+ String unionCode = workpieceService.getUnionCode(task.getCompleteBatchNo());
|
|
|
+ map.put("Data", unionCode);//打标内容
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "smu50":
|
|
|
+ if ("SMU50_IN".equals(functionName)) {
|
|
|
+ map.put("zkIp", ZK_ip_zndy);
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
|
|
|
+ //前序绑定的sum50
|
|
|
+ Object sum50Storge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_SUM50_ZNDY + taskNode.getId());
|
|
|
+ if (sum50Storge != null) {//前序是绑定到sum50
|
|
|
+ sum50Storge = (Storge) sum50Storge;
|
|
|
+ //目的地为机器人手臂
|
|
|
+ map.put("toStorge", sum50Storge);
|
|
|
+ map.put("Data", sum50Storge);
|
|
|
+ msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sum50Storge, 1, TimeUnit.DAYS);
|
|
|
+ } else {
|
|
|
+ //前序绑定的线边库
|
|
|
+ Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK + taskNode.getId());
|
|
|
+ if (xbkStorge != null) {
|
|
|
+ xbkStorge = (Storge) xbkStorge;
|
|
|
+ //目的地为线边库
|
|
|
+ map.put("toStorge", xbkStorge);
|
|
|
+ map.put("Data", xbkStorge);
|
|
|
+ //临时存放到了线边库的标志
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
|
|
|
+ //临时存放到了智能单元的线边库
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
+ //
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+ else if ("SMU50_FILE".equals(functionName)) {
|
|
|
+ Map queryMap = new HashMap<>();
|
|
|
+ queryMap.put("procedureId", task.getProcedureId());
|
|
|
+ queryMap.put("haveFile", "1");
|
|
|
+ List<BomProcedureProgramGroup> bomProcedureProgramGroupList = bomProcedureProgramGroupMapper.getProgramGroupList(queryMap);
|
|
|
+ List<Map<String, String>> fileList = new ArrayList<Map<String, String>>();
|
|
|
+ bomProcedureProgramGroupList.forEach(i -> {
|
|
|
+ Map<String, String> m = new HashMap<>();
|
|
|
+ m.put("fileName", i.getSubmittedFileName());
|
|
|
+ fileList.add(m);
|
|
|
+ });
|
|
|
+ if (fileList != null && fileList.size() > 0) {//先按一个处理
|
|
|
+ String fileName = bomProcedureProgramGroupList.get(0).getSubmittedFileName();
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "uploadProgram");
|
|
|
+ map.put("Data", JSONArray.parseArray(JSONObject.toJSONString(fileList)));
|
|
|
+ msgUtil.redis_set(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo(), fileName, 1, TimeUnit.DAYS);
|
|
|
+
|
|
|
+ }
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+ else if ("SMU50_EXEC".equals(functionName)) {
|
|
|
+ //执行程序,分多次执行
|
|
|
+ String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
|
|
|
+ : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
|
|
|
+
|
|
|
+// if (DemoLineConstant.DEMOLINE_WORK_SPACE1.equals(zoneNo)) {
|
|
|
+// map.put("zkIp",ZK_ip_zndy);
|
|
|
+// }else{
|
|
|
+// map.put("zkIp",ZK_ip_rxx);
|
|
|
+// }
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "execProgram");
|
|
|
+ //当前执行数量
|
|
|
+// int currCount = msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_CURRCOUNT + task.getCompleteBatchNo()) == null ? 0 : Integer.parseInt(msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_CURRCOUNT + task.getCompleteBatchNo()).toString());
|
|
|
+ String fileName = msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo()) == null ? "" : msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo()).toString();
|
|
|
+ String fileNames[] = fileName.split(",");
|
|
|
+// if (currCount < fileNames.length) {
|
|
|
+// String uploadFileName = fileNames[currCount];
|
|
|
+// Map<String, String> m = new HashMap<>();
|
|
|
+// m.put("fileName", uploadFileName);
|
|
|
+// map.put("data", JSONArray.parseArray(JSONObject.toJSONString(m)));
|
|
|
+// map.put(DemoLineConstant.DEMOLINE_EXEPRO_FLAG, "1");
|
|
|
+// //当前执行数量
|
|
|
+// msgUtil.redis_set(DemoCacheKey.DEMOLINE_PROGRAME_CURRCOUNT + task.getCompleteBatchNo(), ++currCount, 1, TimeUnit.DAYS);
|
|
|
+// }
|
|
|
+// Map fileMap = new HashMap();
|
|
|
+// fileMap.put("fileName", fileName);
|
|
|
+ map.put("Data", fileName);
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "清洗烘干机":
|
|
|
+ if ("RX_CLEAN".equals(functionName)) {
|
|
|
+ //清洗,PLC接口
|
|
|
+ map.put("zkIp", ZK_ip_rxx);
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "Clean");
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "三坐标检测仪":
|
|
|
+ if ("SZB_CHECK".equals(functionName)) {
|
|
|
+ map.put("zkIp", ZK_ip_zlzx);
|
|
|
+ map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "testwork");
|
|
|
+ //查出工序三坐标相关
|
|
|
+ BomProcedure procedure = bomProcedureService.getById(task.getProcedureId());
|
|
|
+
|
|
|
+ Map queryMap = new HashMap();
|
|
|
+ String unionCode = workpieceService.getUnionCode(task.getCompleteBatchNo());
|
|
|
+ queryMap.put("WorkId", unionCode);
|
|
|
+ queryMap.put("WorkType", StringUtil.isNotEmpty(procedure.getProgramTestPrograme()) ? procedure.getProgramTestPrograme() : "1111");
|
|
|
+
|
|
|
+ map.put("Data", JSONObject.toJSONString(queryMap));
|
|
|
+
|
|
|
+ map.put("result", true);
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void operation(TaskNode taskNode) {
|
|
|
+ public void operation(Map<String, Object> map) {
|
|
|
|
|
|
}
|
|
|
|
|
@@ -56,11 +376,10 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void move() {
|
|
|
+ public void move(Storge fromStorage, Storge toStorage) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
public void storage() {
|
|
|
|
|
|
}
|