|
@@ -10,15 +10,17 @@ 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.modelingCenter.entity.MModuleField;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.dao.OrderMapper;
|
|
|
import com.github.zuihou.business.operationManagementCenter.dao.OrderQualityMapper;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.entity.Order;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.entity.OrderQuality;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.entity.TTask;
|
|
|
-import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.dao.WorkpieceMapper;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.entity.*;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureProgramMapper;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.BBom;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureMeterial;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureProgram;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
|
|
@@ -93,6 +95,12 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
private ZZoneService zoneService;
|
|
|
@Autowired
|
|
|
private ProductionresourceBizMapper productionresourceBizMapper;
|
|
|
+ @Autowired
|
|
|
+ private BBomMapper bBomMapper;
|
|
|
+ @Autowired
|
|
|
+ private OrderMapper orderMapper;
|
|
|
+ @Autowired
|
|
|
+ private WorkpieceMapper workpieceMapper;
|
|
|
|
|
|
private Map<String, Object> map = Maps.newHashMap();
|
|
|
|
|
@@ -116,6 +124,11 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
private Long zone_id;
|
|
|
private Map<String, String> plcInfo;
|
|
|
private ZZone zZone;
|
|
|
+
|
|
|
+ private Long bomZzoneId;
|
|
|
+
|
|
|
+ private ZZone bomzZone;
|
|
|
+
|
|
|
private String instructionUrl;
|
|
|
|
|
|
@Override
|
|
@@ -142,6 +155,11 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
// 判断该节点使用那条线的plc
|
|
|
plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
+
|
|
|
+ BBom bom = bBomMapper.selectById(task.getBomId());
|
|
|
+ bomZzoneId = bom.getZoneId();
|
|
|
+ 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());
|
|
|
// TODO 后续删除代码,目前条用模拟接口
|
|
@@ -210,18 +228,32 @@ public class MachineNodeServiceImpl implements NodeOperationService {
|
|
|
//打标
|
|
|
// 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"));
|
|
|
//获取打标唯一码
|
|
|
String unionCode = workpieceService.getUnionCode(task.getCompleteBatchNo());
|
|
|
+
|
|
|
+ Order order = orderMapper.selectById(task.getOrderId());
|
|
|
+ TWorkpiece tWorkpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo, task.getCompleteBatchNo()));
|
|
|
+
|
|
|
JSONObject data = new JSONObject();
|
|
|
//默认配置 后期可改可去
|
|
|
- data.put("workId", "1");
|
|
|
- data.put("labelContent", unionCode);
|
|
|
- data.put("workId", "1");
|
|
|
- map.put("data", data);//打标内容
|
|
|
+
|
|
|
+ if("capsule".equals(zZone.getNo())){
|
|
|
+ data.put("typeNo", "C");
|
|
|
+ }else if("framework".equals(zZone.getNo())){
|
|
|
+ data.put("typeNo", "K");
|
|
|
+ }
|
|
|
+ // TODO工件增加流水号
|
|
|
+ data.put("smalltypeNo", "2");
|
|
|
+ data.put("orderNo", order.getOrderNo());
|
|
|
+ data.put("taskNo", task.getTaskNo());
|
|
|
+ data.put("productNo", tWorkpiece.getUniqueCode());
|
|
|
+ data.put("batchNo", "000001");
|
|
|
+ data.put("serialNo", "000001");
|
|
|
+ map.put("data", data);
|
|
|
map.put("result", true);
|
|
|
}
|
|
|
break;
|