|
@@ -23,10 +23,12 @@ import com.github.zuihou.business.productionReadyCenter.service.BomProcedureServ
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourcePositionMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.ZZoneProductionresource;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.NodeOperationService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ZZoneProductionresourceService;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
|
|
|
import com.github.zuihou.business.util.MsgUtil;
|
|
|
import com.github.zuihou.common.constant.DictionaryKey;
|
|
|
import com.github.zuihou.common.util.StringUtil;
|
|
@@ -87,6 +89,8 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
|
|
|
@Autowired
|
|
|
private ZZoneProductionresourceService zZoneProductionresourceService;
|
|
|
+ @Autowired
|
|
|
+ private ZZoneService zoneService;
|
|
|
|
|
|
private Map<String, Object> map = Maps.newHashMap();
|
|
|
|
|
@@ -108,6 +112,8 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
private List<ProductionresourcePosition> deviceList;
|
|
|
|
|
|
private Long zone_id;
|
|
|
+ private Map<String, String> plcInfo;
|
|
|
+ private ZZone zZone;
|
|
|
|
|
|
@Override
|
|
|
public void initResource(TaskNode taskNode, TTask task, Map dataMap) {
|
|
@@ -126,6 +132,11 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
//获取产线ID
|
|
|
ZZoneProductionresource zZoneProductionresource = zZoneProductionresourceService.getOne(new LbqWrapper<ZZoneProductionresource>().eq(ZZoneProductionresource::getResourceId, taskNode.getResourceId()));
|
|
|
zone_id = zZoneProductionresource.getZoneId();
|
|
|
+
|
|
|
+
|
|
|
+ zZone = zoneService.getById(zone_id);
|
|
|
+ // 判断该节点使用那条线的plc
|
|
|
+ plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -188,12 +199,15 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
// map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "print");
|
|
|
//获取打标指令编码
|
|
|
map.put("method", moduleInstructions.get(0).getCode());
|
|
|
+ map.put("url",plcInfo.get("url"));
|
|
|
+ map.put("port",plcInfo.get("port"));
|
|
|
//获取打标唯一码
|
|
|
String unionCode = workpieceService.getUnionCode(task.getCompleteBatchNo());
|
|
|
JSONObject data = new JSONObject();
|
|
|
//默认配置 后期可改可去
|
|
|
data.put("workId", "1");
|
|
|
data.put("labelContent", unionCode);
|
|
|
+ data.put("workId", "1");
|
|
|
map.put("data", data);//打标内容
|
|
|
map.put("result", true);
|
|
|
}
|
|
@@ -213,6 +227,8 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
});
|
|
|
//map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "uploadProgram");
|
|
|
map.put("method", "UploadFile");
|
|
|
+ map.put("url",task.getIp());
|
|
|
+ map.put("port",task.getPort());
|
|
|
JSONObject data = new JSONObject();
|
|
|
data.put("fileName", fileList.get(0).get("fileName"));
|
|
|
map.put("data", data);
|
|
@@ -284,6 +300,8 @@ 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("result", true);
|
|
|
}
|
|
|
break;
|
|
@@ -301,6 +319,8 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
data.put("workType", "1111");
|
|
|
//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("data", data);
|
|
|
map.put("result", true);
|
|
|
}
|