Bläddra i källkod

选择机床库位时,筛选工艺工序上绑定的库位

wudingsheng 1 månad sedan
förälder
incheckning
8405911436

+ 1 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/edgeLibrary/service/impl/StockInfoServiceImpl.java

@@ -116,8 +116,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         if("1".equals(bean.getGoodsType())){
             Tray byId = trayService.getById(bean.getSpecId());
             Storge byId1 = storgeService.getById(bean.getStorgeId());
-            isFalse(!StringUtils.equals(byId1.getLatheTypeCode(),byId.getLatheTypeCode()), "托盘拉丁类型和库位拉丁类型不匹配!!!");
-            //throw new RuntimeException("托盘拉丁类型和库位拉丁类型不匹配!!!");
+            isFalse(byId1.getLatheTypeCode()!=null && !StringUtils.equals(byId1.getLatheTypeCode(),byId.getLatheTypeCode()), "托盘拉丁类型和库位拉丁类型不匹配!!!");
         }
 
         String no = codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_UNIQUE);

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

@@ -22,8 +22,10 @@ import com.github.zuihou.business.operationManagementCenter.service.TaskService;
 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.entity.BBom;
 import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureProductionresource;
 import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
 import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionresourceMapper;
 import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
@@ -101,6 +103,8 @@ public class CacheRobotStrategy implements RobotStrategy {
 
     @Autowired
     private BomProcedureMapper bomProcedureMapper;
+    @Autowired
+    private BomProcedureProductionresourceMapper bomProcedureProductionresourceMapper;
 
     @Autowired
     private StockInfoMapper stockInfoMapper;
@@ -548,10 +552,14 @@ public class CacheRobotStrategy implements RobotStrategy {
                             returnMap.put("store", targetStorge);
                             returnMap.put("targetxbk", "0");
                         }else if (targetList.size() > 1){
+                            //查询工艺设备绑定库位
+                            BomProcedureProductionresource bomProcedureProductionresource = bomProcedureProductionresourceMapper.selectOne(Wraps.<BomProcedureProductionresource>lbQ().eq(BomProcedureProductionresource::getResourceId, targetResourceId).eq(BomProcedureProductionresource::getProcedureId, taskNode.getProcedureId()));
+
                             //针对一个机床多个母盘点位
                             List<Long> collect = targetList.stream().map(ProductionresourcePosition::getStorgeId).collect(Collectors.toList());
                             List<Storge> list = storgeService.list(Wraps.<Storge>lbQ().in(Storge::getId, collect));
-                            Storge storge = list.stream().filter(p -> p.getLatheTypeCode().equals(latheTypeCode)).collect(Collectors.toList()).get(0);
+                            //筛选 拉丁类型相同并且工艺设备绑定库位
+                            Storge storge = list.stream().filter(p -> p.getLatheTypeCode().equals(latheTypeCode) && bomProcedureProductionresource.getStorgeId()!=null && p.getId().equals(bomProcedureProductionresource.getStorgeId())).collect(Collectors.toList()).get(0);
                             returnMap.put("storeResourceId", storge.getResourceId());
                             returnMap.put("store", storge);
                             returnMap.put("targetxbk", "0");

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/BomProcedureProductionresourceMapper.xml

@@ -41,7 +41,7 @@
         imcs_tenant_productionresource pr
         LEFT JOIN imcs_p_productionresource_conf pc ON pr.id = pc.resource_id
         ) b ON a.resource_id = b.id
-        left join imcs_p_productionresource_position ss on ss.id=a.storge_id
+        left join imcs_s_storge ss on ss.id=a.storge_id
         WHERE
         1 = 1
         <if test="id != null and id != '' ">

+ 2 - 2
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/entity/BomProcedureProductionresource.java

@@ -107,9 +107,9 @@ public class BomProcedureProductionresource extends Entity<Long> {
     @Excel(name = "资源业务ID")
     private Long resourceBusinessId;
 
-    @ApiModelProperty(value = "imcs_p_productionresource_position的ID")
+    @ApiModelProperty(value = "imcs_s_storge的ID")
     @TableField("storge_id")
-    @Excel(name = "imcs_p_productionresource_position的ID")
+    @Excel(name = "imcs_s_storge的ID")
     private Long storgeId;
 
     @ApiModelProperty(value = "资源业务")