Pārlūkot izejas kodu

HELLER代码优化

lxb 1 gadu atpakaļ
vecāks
revīzija
714d635483

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -1903,7 +1903,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         String robotType = callBackJson.getString(YunjianConstant.YUNJIAN_ROBORT_CACHE_FLAG);
         String robotStepKey = taskNode.getId() + "count";
         String robotStep = callBackJson.getString(robotStepKey);
-        logger.info("节点{}机器人类型{},机器人执行工步{},机器人执行第几步{}", taskNode.getId(), robotType, robotStepKey, robotStep);
+        logger.warn("节点{}机器人类型{},机器人执行工步{},机器人执行第几步{}", taskNode.getId(), robotType, robotStepKey, robotStep);
         String xbkFlag = callBackJson.getString(YunjianConstant.YUNJIAN_XBKFLAG);
         logger.info("节点{}是否线边库逻辑{}", taskNode.getId(), xbkFlag);
 

+ 27 - 6
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -27,10 +27,7 @@ import com.github.zuihou.business.operationManagementCenter.dao.TTaskMapper;
 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.BomProcedureMapper;
-import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureProductionresourceMapper;
-import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureTrayMapper;
+import com.github.zuihou.business.productionReadyCenter.dao.*;
 import com.github.zuihou.business.productionReadyCenter.entity.*;
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureTrayService;
@@ -61,6 +58,7 @@ import org.apache.poi.ss.formula.functions.T;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
@@ -152,6 +150,15 @@ public class RobotNodeServiceImpl implements NodeOperationService {
     @Autowired
     private BomProcedureProductionresourceMapper bomProcedureProductionresourceMapper;
 
+    @Autowired
+    private BomProcedureProgramMapper bomProcedureProgramMapper;
+
+    @Value("${zuihou.file.storage-path}")
+    private String storagePath;
+
+    @Value("${zuihou.file.uriPrefix}")
+    private String uriPath;
+
     private Map<String, Object> map = Maps.newHashMap();
 
     private String ZK_ip_zlzx = "192.168.170.61";
@@ -790,14 +797,28 @@ public class RobotNodeServiceImpl implements NodeOperationService {
 
                         Map locationMap = new HashMap();
 
+                        locationMap.put("location",targetStorge.getPointId());
+
                         if(taskNode.getTargetResourceId() !=null){
                             Productionresource productionresource =  productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
                             if(!Objects.isNull(productionresource) && StringUtil.isNotEmpty(productionresource.getModeSpecification()) && productionresource.getModeSpecification().contains("HELLER")){
-                                locationMap.put("fileName","3");
+
+                                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);
+                                        m.put("fileName", filePath.replace("/", "\\"));
+                                        fileList.add(m);
+                                    });
+                                    locationMap.put("fileName",fileList.get(0).get("fileName"));
+                                }
                             }
                         }
 
-                        locationMap.put("location",targetStorge.getPointId());
                         dataMap.put("data", locationMap);
 
                         dataMap.put("toStorge", targetStorge);