Преглед изворни кода

1.修改单订单多零件订单计划状态更新问题
2.线边库逻辑问题修改
3.取托盘夹具问题修改

yejian пре 3 година
родитељ
комит
059c9bb6d6

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

@@ -329,8 +329,7 @@ public class TaskWorkNode {
                                 agvParam.putAll(agvData);
                                 //缓存执行当前节点传参
                                 msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNode.getId(), agvParam.toJSONString());
-
-                                String zoneType = (null == msgUtil.redis_get(ParameterKey.ZONE_TYPE)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.ZONE_TYPE)).toString());
+                                String zoneType = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
                                 if(zoneType.equals(ParameterKey.ZONE_SFX)){
                                     agvData.put("transferType","agv");
                                     R addAgvTask = externalApiService.processTransferJob(agvData);
@@ -1086,7 +1085,7 @@ public class TaskWorkNode {
 
                 ProductionresourcePosition position = null;
                 for(ProductionresourcePosition productionresourcePosition : jbwBList){
-                    String zoneType = (null == msgUtil.redis_get(ParameterKey.ZONE_TYPE)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.ZONE_TYPE)).toString());
+                    String zoneType = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
                     if(zoneType.equals(ParameterKey.ZONE_SFX)){
                         if(productionresourcePosition.getCode().equals(DictionaryKey.SFX_JBW_RELATION.get(startAgvStationCode))){
                             position = productionresourcePosition;

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

@@ -1491,22 +1491,33 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
                 //删除正在执行的缓存
                 msgUtil.redis_del(Arrays.asList(new String[]{CacheKey.PRESOURCE_CURRENT_TASK + "_" + task.getResourceId(), CacheKey.PRESOURCE_CURRENT_TASK_OBJECT + "_" + task.getResourceId(), CacheKey.TASK_CURRENT_NODE + "_" + task.getResourceId()}));
 
-                if ("1".equals(task.getLastProcedureFlag())) {
-                    //计划完成
-                    Plan plan = planMapper.selectById(task.getPlanId());
-                    plan.setProduceStatus("4");
-                    plan.setPlanStatus("3");
-                    planMapper.updateById(plan);
 
-                    //订单完成
-                    Order order = orderMapper.selectById(task.getOrderId());
-                    order.setCompleteNum((order.getCompleteNum() == null ? 0 : order.getCompleteNum()) + 1);
-                    order.setProduceStatus("3");//完成
-                    orderMapper.updateAllById(order);
+
+                if ("1".equals(task.getLastProcedureFlag())) {
 
                     //设置结束标志
                     currWorkpiece.setIsEnd("1");
                     workpieceService.updateById(currWorkpiece);
+                    // 查询是否是该计划最后一个工件
+                    List<TWorkpiece> plaWworkpieces = workpieceService.list(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getPlanId,task.getPlanId()).eq(TWorkpiece::getIsEnd,"0"));
+
+                    //计划完成
+                    if(plaWworkpieces.size() == 0){
+                        Plan plan = planMapper.selectById(task.getPlanId());
+                        plan.setProduceStatus("4");
+                        plan.setPlanStatus("3");
+                        planMapper.updateById(plan);
+                    }
+
+                    //订单完成
+                    // 查询是否是该订单最后一个工件
+                    List<TWorkpiece> orderWorkpieces = workpieceService.list(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getPlanId,task.getPlanId()).eq(TWorkpiece::getIsEnd,"0"));
+                    if(orderWorkpieces.size() == 0){
+                        Order order = orderMapper.selectById(task.getOrderId());
+                        order.setCompleteNum((order.getCompleteNum() == null ? 0 : order.getCompleteNum()) + 1);
+                        order.setProduceStatus("3");//完成
+                        orderMapper.updateAllById(order);
+                    }
 
                     //设置计划结束
 //                planMapper.updateproduceStatusFinish();

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

@@ -622,8 +622,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
             if(targetStorge!=null&&CollectionUtil.isNotEmpty(jbwBList)){
                 ProductionresourcePosition position = null;
                 for(ProductionresourcePosition productionresourcePosition : jbwBList){
-
-                    String zoneType = (null == msgUtil.redis_get(ParameterKey.ZONE_TYPE)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.ZONE_TYPE)).toString());
+                    String zoneType = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
                     if(zoneType.equals(ParameterKey.ZONE_SFX)){
                         if(productionresourcePosition.getCode().equals(DictionaryKey.SFX_JBW_RELATION.get(startAgvStationCode))){
                             position = productionresourcePosition;
@@ -784,7 +783,8 @@ public class RobotNodeServiceImpl implements NodeOperationService {
      * @return
      */
     private List<StockInfo>getLikuStockList(TTask task){
-        List <StockInfo> returnList = null;
+        List<StockInfo> returnList = null;
+        List<StockInfo> oneTray = null;
 
         List<Productionresource> productionresources = productionresourceBizMapper.selectList(Wraps.<Productionresource>lbQ().like(Productionresource::getCode,DictionaryKey.YJ_ZONE_XBK.get("plateAndClamp")));
         List<Long> productionresourceIds = productionresources.stream().map(t->t.getId()).collect(Collectors.toList());
@@ -794,6 +794,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
         List<BomProcedureTray>trayList = procedureTrayService.list(Wraps.<BomProcedureTray>lbQ().in(BomProcedureTray::getProcedureId, task.getProcedureId()));
         List<Long>trayIdList = trayList.stream().map(t->t.getTrayId()).collect(Collectors.toList());
         // 判断夹具是否有可用的,查询330个库位信息中是否还有夹具
+
         List<StockInfo> allStockList = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getGoodsId,trayIdList).in(StockInfo::getStorgeId,startProductionresourcePositionIds).orderByAsc(StockInfo::getStorgeId));
         if(CollectionUtil.isNotEmpty(allStockList)){
             Map<Long,List<StockInfo>>map = allStockList.stream().collect(groupingBy(StockInfo::getStorgeId));
@@ -802,14 +803,25 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 k = key;
                 //优先有托盘夹具的
                 List<StockInfo> stockInfoList = map.get(key);
-                if(stockInfoList!=null&&stockInfoList.size()==2){
-                    returnList = stockInfoList;
-                    break;
+                if(stockInfoList!=null&&stockInfoList.size()==2 ){
+
+                    // mofify by yejian on 20220722 for 初始化判断是否有子盘可用先判断去除上料完成后的工件在线边库暂存的问题,解决示范线问题,云箭子盘从立库拿不存在这个问题
+                    // 判断除了子盘夹具外是否还有工件在上面
+                    List<StockInfo> allStockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getStorgeId,stockInfoList.get(0).getStorgeId()).orderByAsc(StockInfo::getStorgeId));
+                    if(allStockInfos.size() == 2){
+                        returnList = stockInfoList;
+                        break;
+                    }else if(allStockInfos.size() == 1){
+                        if(CollectionUtil.isEmpty(oneTray)){
+                            oneTray = stockInfoList;
+                        }
+                    }
                 }
             }
+            // mofify by yejian on 20220722 for 修改只有一个子盘的出库
             //只有托盘的
-            if(returnList==null){//取齐总一个
-                returnList = map.get(k);
+            if(returnList == null){
+                returnList = oneTray;
             }
         }
         return returnList;

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

@@ -271,7 +271,7 @@ public class MsgUtil implements ApplicationContextAware {
                     int count =  callBackJson.getString(taskNode.getId().toString()+"count")==null?-1:Integer.parseInt(callBackJson.getString(taskNode.getId().toString()+"count"));
                     int limit =5;
                     if(!callBackJson.containsKey(YunjianConstant.YUNJIAN_ROBORT_CACHE_FLAG)) {
-                        limit =2;
+                        limit =1;
                     }
 
                     if(count<limit){//