Browse Source

入库任务调用wms参数调整

wudingsheng 2 weeks ago
parent
commit
10181a79af

+ 25 - 4
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/wms/service/impl/WmsTransferTaskServiceImpl.java

@@ -20,6 +20,7 @@ import com.github.zuihou.business.externalApi.entity.WmsAgvInfoDetail;
 import com.github.zuihou.business.operationManagementCenter.dao.OrderMapper;
 import com.github.zuihou.business.operationManagementCenter.entity.Order;
 import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionresourceMapper;
+import com.github.zuihou.business.util.AgvParamNormalizer;
 import com.github.zuihou.business.util.MsgUtil;
 import com.github.zuihou.business.wms.ApiCallLog;
 import com.github.zuihou.business.wms.WmsTransferTask;
@@ -79,7 +80,7 @@ public class WmsTransferTaskServiceImpl extends SuperCacheServiceImpl<WmsTransfe
     private ZZoneProductionresourceMapper zZoneProductionresourceMapper;
     @Autowired
     private ApiCallLogService apiCallLogService;
-    @Value("${hz.wms}")
+    @Value("${hz.wms.inTask}")
     private String url;
 
     @Autowired
@@ -135,13 +136,33 @@ public class WmsTransferTaskServiceImpl extends SuperCacheServiceImpl<WmsTransfe
             q.put("storgeId", from.getId());
             List<StockInfo> stockList = Optional.ofNullable(stockInfoMapper.getListByGoodsId(q))
                     .orElse(Collections.emptyList());
-
-            List<WmsMaterialDto> matList = new ArrayList<>(stockList.size());
-            for (StockInfo vo : stockList) {
+            // trayNo
+            String trayNo = stockList.stream()
+                    .filter(s -> "1".equals(s.getGoodsType()))
+                    .map(StockInfo::getBrandNo)   // 假设 trayNo 存在于 goodsCode 字段
+                    .findFirst()
+                    .orElse(null);
+
+            // boxNo
+            String boxNo = stockList.stream()
+                    .filter(s -> "7".equals(s.getGoodsType()))
+                    .map(StockInfo::getBrandNo)   // 假设 boxNo 存在于 goodsCode 字段
+                    .findFirst()
+                    .orElse(null);
+
+            // 过滤掉 1 和 7
+            List<StockInfo> otherList = stockList.stream()
+                    .filter(s -> "1".equals(s.getGoodsType()) && "7".equals(s.getGoodsType()))
+                    .collect(java.util.stream.Collectors.toList());
+
+            List<WmsMaterialDto> matList = new ArrayList<>(otherList.size());
+            for (StockInfo vo : otherList) {
                 WmsMaterialDto dto = new WmsMaterialDto();
                 dto.setMaterialName(vo.getBrandName());
                 dto.setMaterialCode(vo.getBrandNo());
                 dto.setQuantity(vo.getNum());
+                dto.setTrayNo(trayNo);
+                dto.setBoxNo(boxNo);
                 matList.add(dto);
             }
 

+ 2 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/externalApi/dto/WmsMaterialDto.java

@@ -7,4 +7,6 @@ public class WmsMaterialDto {
     private String materialCode;
     private String materialName;
     private Integer quantity;
+    private String trayNo;
+    private String boxNo;
 }