Forráskód Böngészése

fix: 优化工装夹具呼叫,在不满足条件的时候,工装提示无工装可用,优化关机机器人查询问题

wang.sq@aliyun.com 6 hónapja
szülő
commit
9236793cf8

+ 5 - 5
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/edgeLibrary/service/impl/StorgeServiceImpl.java

@@ -619,7 +619,7 @@ public class StorgeServiceImpl extends SuperCacheServiceImpl<StorgeMapper, Storg
      */
     @Override
     public boolean szbStockHandle(boolean isFetched, TaskNode taskNode){
-        List<Storge> storgeList = baseMapper.selectList(new LbqWrapper<Storge>().in(Storge::getPointId, Arrays.asList(DictionaryKey.ZEISS_LOCATION.get("M"))));
+        List<Storge> storgeList = baseMapper.selectList(new LbqWrapper<Storge>().eq(Storge::getLockStatus, "1").in(Storge::getPointId, Arrays.asList(DictionaryKey.ZEISS_LOCATION.get("M"))));
 
         if(storgeList.isEmpty()){
             throw new BizException("没有查询到可用的三坐标数据,点位"+DictionaryKey.ZEISS_LOCATION.get("M") );
@@ -633,8 +633,8 @@ public class StorgeServiceImpl extends SuperCacheServiceImpl<StorgeMapper, Storg
         if(isFetched) {
             //todo wang.sq三坐标调用地址释放, $需要换地址$
             // 查询三坐标是否允许取
-            //String fetchStatus = msgUtil.getCcsData("/api/GetMiddleThreeCoordinates", params, taskNode);
-            String fetchStatus = "{\"taskID\":null,\"taskNodeID\":null,\"result\":\"true\",\"resultMsg\":\"设备已离线:192.168.0.10\",\"concurrency\":\"false\",\"data\":null}";
+            String fetchStatus = msgUtil.getCcsData("/api/GetMiddleThreeCoordinates", params, taskNode);
+            //String fetchStatus = "{\"taskID\":null,\"taskNodeID\":null,\"result\":\"true\",\"resultMsg\":\"设备已离线:192.168.0.10\",\"concurrency\":\"false\",\"data\":null}";
 
             JSONObject fetchObject = JSONObject.parseObject(fetchStatus);
             logger.warn("三坐标节点{}取查询接口返回{}", taskNode.getId(), fetchObject.toJSONString());
@@ -656,8 +656,8 @@ public class StorgeServiceImpl extends SuperCacheServiceImpl<StorgeMapper, Storg
             //三坐标中间放操作
             // 查询三坐标是否允许放
             //todo wang.sq三坐标调用地址释放$需要换地址$
-            //String sendStatus = msgUtil.getCcsData("/api/QueryThreeCoordinatesFreePos", params, taskNode);
-            String sendStatus = "{\"taskID\":null,\"taskNodeID\":null,\"result\":\"true\",\"resultMsg\":\"设备已离线:192.168.0.10\",\"concurrency\":\"false\",\"data\":null}";
+            String sendStatus = msgUtil.getCcsData("/api/QueryThreeCoordinatesFreePos", params, taskNode);
+            //String sendStatus = "{\"taskID\":null,\"taskNodeID\":null,\"result\":\"true\",\"resultMsg\":\"设备已离线:192.168.0.10\",\"concurrency\":\"false\",\"data\":null}";
 
             JSONObject sendObject = JSONObject.parseObject(sendStatus);
             logger.warn("三坐标节点{}放查询接口返回{}", taskNode.getId(), sendObject.toJSONString());

+ 4 - 3
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -598,9 +598,10 @@ public class TaskWorkNode {
                                                 }
 
                                                 //todo $需要换地址$
+                                                //returnData = "{\"result\": \"true\"}";
                                                 HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
-                                                //returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
-                                                returnData = "{\"result\": \"true\"}";
+                                                returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
+
                                             }
 
                                         }
@@ -675,7 +676,7 @@ public class TaskWorkNode {
                             log.setExeResult("0").setManual("0").setFeedback("节点" + taskNode.getId() + "操作响应超时");
                         } else {
                             //设备不在线默认存储为空
-                            log.setExeResult("0").setManual("0").setFeedback(null);
+                            log.setExeResult("0").setManual("0").setFeedback(conMap.get("resultmsg")==null ? null : conMap.get("resultmsg").toString());
                         }
                     }
                 }

+ 8 - 5
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl2.java

@@ -1028,7 +1028,7 @@ public class RobotNodeServiceImpl2 implements NodeOperationService {
         **/
         dataMap = robotStrategy.robotCheck(taskNode, robotInfo, flikustockInfos, bomProcedure, dataMap);
 
-        dataMap.put("instructionUrl", instructionUrl);
+        dataMap.put("instructionUrl", instructionUrl==null? "":instructionUrl);
         return dataMap;
     }
 
@@ -1053,10 +1053,13 @@ public class RobotNodeServiceImpl2 implements NodeOperationService {
         List<Tray> newTrayList = trayService.selectUsersByIds(trayIdList);
 
         // 查询出同类型,并且同一条产线的工装信息
-        List<String> trayNoList = newTrayList.stream().map(t->t.getNo()).distinct().collect(Collectors.toList());
-        QueryWrapper queryWrapper = new QueryWrapper();
-        queryWrapper.in("no" , trayNoList);
-        List<MToolClamp> mToolClamplist = toolClampService.list(queryWrapper);
+        List<MToolClamp> mToolClamplist = new ArrayList<>();
+        if(!newTrayList.isEmpty()){
+            List<String> trayNoList = newTrayList.stream().map(t->t.getNo()).distinct().collect(Collectors.toList());
+            QueryWrapper queryWrapper = new QueryWrapper();
+            queryWrapper.in("no" , trayNoList);
+            mToolClamplist = toolClampService.list(queryWrapper);
+        }
 
         // 合并托盘,工装id集合,查询库存满足的信息
         List<Long> trayAndMToolClamplist = newTrayList.stream().map(t->t.getId()).collect(Collectors.toList());

+ 15 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/strategy/impl/CacheRobotStrategy.java

@@ -36,6 +36,7 @@ import com.github.zuihou.common.constant.ParameterKey;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
+import com.github.zuihou.exception.BizException;
 import com.github.zuihou.tenant.service.ProductionresourceService;
 import com.google.common.collect.Maps;
 import lombok.extern.slf4j.Slf4j;
@@ -151,6 +152,7 @@ public class CacheRobotStrategy implements RobotStrategy {
 
         if (targetStorge == null) {
             dataMap.put("result", false);
+            dataMap.put("resultmsg","目标点位不满足,线边库不符号要求存放");
             return dataMap;
         }
         String targetXbk = !returnMap.containsKey("targetxbk") ? null : returnMap.get("targetxbk").toString();
@@ -169,7 +171,17 @@ public class CacheRobotStrategy implements RobotStrategy {
         //TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode,1);
 
         //锁定机器人抓手
-        Storge jqrStorge = storgeService.getById(jqrMap.get(DemoLineConstant.DEMOLINE_RJQR_ZS).get(0).getStorgeId());
+        Storge jqrStorge = null;
+        try {
+            jqrStorge = storgeService.getById(jqrMap.get(DemoLineConstant.DEMOLINE_RJQR_ZS).get(0).getStorgeId());
+
+            if(jqrStorge == null){
+                throw new BizException("没有查询到可执行的关节机器人");
+            }
+        }catch (Exception e){
+            throw new BizException("没有查询到可执行的关节机器人");
+        }
+
         jqrStorge.setCompleteBatchNo(taskNode.getCompleteBatchNo());
         storgeService.lockStorge(jqrStorge, taskNode.getId());
 
@@ -380,7 +392,9 @@ public class CacheRobotStrategy implements RobotStrategy {
             }
         }
 
+
         if ("1".equals(xbkFlag)) {
+
             ProductionresourcePosition position = xbkList.get(0);
             targetStorge = storgeService.getById(position.getStorgeId());
             returnMap.put("storeResourceId", position.getResourceId());

+ 8 - 6
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/util/MsgUtil.java

@@ -66,6 +66,7 @@ import org.springframework.web.client.RestTemplate;
 import javax.annotation.Resource;
 import java.io.*;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.security.Key;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
@@ -411,6 +412,7 @@ public class MsgUtil implements ApplicationContextAware {
                     // 拼接上传给plc的参数, 图号-零件号-源工序号-是否毛坯件-使用的检测程序
                     String toPlcPar = bBom.getDrawingNo()+"&"+tWorkpiece.getUniqueCode()+"&"+bBom.getNo()+"&"+"1"+"&"+mToolClamps.get(0).getDetectionProgram();
 
+                    //获取偏差值数据
                     Map<String, List<String>> stringListMap = SmbShareFileUtil.processExcelFiles(threeDimensionalResultAddress, toPlcPar,"xlsx");
 
                     if (!stringListMap.isEmpty()) {
@@ -435,12 +437,12 @@ public class MsgUtil implements ApplicationContextAware {
                                 BigDecimal aOffset = new BigDecimal(stringsList.size()>=6? stringsList.get(3):"");
                                 BigDecimal bOffset = new BigDecimal(stringsList.size()>=6? stringsList.get(4):"");
                                 BigDecimal cOffset = new BigDecimal(stringsList.size()>=6? stringsList.get(5):"");
-                                orderQuality.setExactXaxisOffset(xOffset);
-                                orderQuality.setExactYaxisOffset(yOffset);
-                                orderQuality.setExactZaxisOffset(zOffset);
-                                orderQuality.setExactAaxisOffset(aOffset);
-                                orderQuality.setExactBaxisOffset(bOffset);
-                                orderQuality.setExactCaxisOffset(cOffset);
+                                orderQuality.setExactXaxisOffset(xOffset.setScale(5, RoundingMode.HALF_UP));
+                                orderQuality.setExactYaxisOffset(yOffset.setScale(5, RoundingMode.HALF_UP));
+                                orderQuality.setExactZaxisOffset(zOffset.setScale(5, RoundingMode.HALF_UP));
+                                orderQuality.setExactAaxisOffset(aOffset.setScale(5, RoundingMode.HALF_UP));
+                                orderQuality.setExactBaxisOffset(bOffset.setScale(5, RoundingMode.HALF_UP));
+                                orderQuality.setExactCaxisOffset(cOffset.setScale(5, RoundingMode.HALF_UP));
 
                                 list1.add(orderQuality);
                             }

+ 2 - 2
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/DictionaryKey.java

@@ -94,7 +94,7 @@ public interface DictionaryKey {
 //            put("2", "保障中心_伺服舵机");
 //            put("3", "框体_机器人");
             // 331
-            put("1", "精密_地轨机器人");
+            put("1", "涡轴线_线前地轨机器人");
             // 示范线配置
 //            put("1", "柔性线_机器人_手抓");
 //            put("2", "质量中心_机器人");
@@ -137,7 +137,7 @@ public interface DictionaryKey {
             put("舱体类加工单元", "CT_01,CT_02,CT_03");
             put("plateAndClamp", "FMS_XBK");
             put("FMS2.0", "FMS_XBK");
-            put("精密铣削加工单元", "CT_01");
+            put("涡轴柔性加工单元", "CT_01");
 
             // 示范线配置
 //            put("质量中心-capsule", "XBK_01");

+ 1 - 1
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/util/SmbShareFileUtil.java

@@ -382,7 +382,7 @@ public class SmbShareFileUtil {
           return   resultMap ;
         }
 
-        File[] files = folder.listFiles((dir, name) -> (dir.isFile() && name.contains(containsName) && name.substring(0,name.lastIndexOf(".")).contains(containsSuffix)));
+        File[] files = folder.listFiles((dir, name) -> (  name.contains(containsName) && name.substring(name.lastIndexOf(".")).contains(containsSuffix)) );
 
         if (files == null || files.length == 0) {
             logger.info("没有找到需要处理的 Excel 文件。");