|
@@ -48,6 +48,7 @@ import com.github.zuihou.tenant.entity.ProductionlineUser;
|
|
|
import com.github.zuihou.tenant.service.CodeRuleService;
|
|
|
import com.github.zuihou.tenant.service.ProductionlineService;
|
|
|
import com.github.zuihou.tenant.service.ProductionlineUserService;
|
|
|
+import com.github.zuihou.tenant.service.ProductionresourceService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
@@ -211,6 +212,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
private PlateMapper plateMapper;
|
|
|
|
|
|
|
|
|
+
|
|
|
private static Logger logger = LoggerFactory.getLogger(TaskNodeServiceImpl.class);
|
|
|
|
|
|
//获取子二级节点
|
|
@@ -287,7 +289,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
- * @param taskBatchNo计划ID
|
|
|
+ * @param taskBatchNo 计划ID
|
|
|
* @param sysUser
|
|
|
*/
|
|
|
@Override
|
|
@@ -329,7 +331,6 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
// taskNode.setAutoNode(autoNode).setAutoNodeCode(autoNode.getCode()).setCompleteBatchNo(t.getCompleteBatchNo())
|
|
|
// .setNodeNo(autoNode.getNodeNo()).setExeStatus("1").setPrority(autoCode.getWeight());
|
|
|
taskNode.setTaskId(t.getId()).setOrderId(t.getOrderId())
|
|
|
- .setResourceId(getResourceIdByAutoCode(t, autoCode))
|
|
|
.setTaskNodeNo(codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_TASK_NODE));
|
|
|
taskNode.setAutoNode(autoCode).setNodeNo(autoCode.getNo()).setCompleteBatchNo(t.getCompleteBatchNo())
|
|
|
.setExeStatus("1").setPrority(autoCode.getWeight());
|
|
@@ -337,9 +338,19 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
// taskNode.setInterfaceType(autoNode.getInterfaceType().getKey());
|
|
|
// }
|
|
|
//依据设备类型判断调用接口类型
|
|
|
- if("1".equals(taskNode.getAutoNode().getCategory()) || "3".equals(taskNode.getAutoNode().getCategory())){
|
|
|
+ if("1".equals(taskNode.getAutoNode().getCategory())){
|
|
|
+ taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_PLC);
|
|
|
+ //加工设备的设备ID来源于加工任务设备
|
|
|
+ taskNode.setResourceId(taskNode.getTaskId());
|
|
|
+ }else if("3".equals(taskNode.getAutoNode().getCategory())){
|
|
|
taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_PLC);
|
|
|
- }else if("2".equals(taskNode.getAutoNode().getCategory())){
|
|
|
+ //根据配置确定操作设备ID
|
|
|
+ //String resourceType = autoCode.getResourceId()!=null? autoCode.getResourceId().toString() : null;
|
|
|
+ if(null!= autoCode.getResourceId()) {
|
|
|
+ taskNode.setResourceId(getResourceIdByAutoCode(autoCode.getResourceId().toString()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if("2".equals(taskNode.getAutoNode().getCategory())){
|
|
|
taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_AGV);
|
|
|
}else if("4".equals(taskNode.getAutoNode().getCategory())){
|
|
|
taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_WMS);
|
|
@@ -387,12 +398,13 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
|
|
|
/**
|
|
|
* 获取具体的生产资源
|
|
|
- * @param autoCode
|
|
|
+ * @param resourceType
|
|
|
* @return
|
|
|
*/
|
|
|
- private Long getResourceIdByAutoCode(TTask task, ResourceAutoCode autoCode){
|
|
|
- Long resourceId = autoCode.getCategory()=="1"? task.getResourceId(): 0L;
|
|
|
- return resourceId;
|
|
|
+ private Long getResourceIdByAutoCode(String resourceType){
|
|
|
+ String robotName = DictionaryKey.YJ_ROBOT_NODES.get(resourceType);
|
|
|
+ Productionresource productionresource = productionresourceBizMapper.selectOne(new LbqWrapper<Productionresource>().eq(Productionresource::getName, robotName));
|
|
|
+ return productionresource.getId();
|
|
|
}
|
|
|
|
|
|
|