Commit d1fe987d9d97c76a9713370d85e4ad596c8ebd41

Authored by 易文鹏
1 parent f72a1307

feat:批次管控的物料,出库时优先按先进先出规则

src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java
... ... @@ -214,9 +214,11 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
214 214 }
215 215 }
216 216 }
  217 +
217 218 if (locationList != null) {
218 219 locationList.removeAll(removeLocaationList);
219 220 }
  221 +
220 222 // 如果没有外侧库位可分配了,再查内侧的库位
221 223 if (locationList == null || locationList.isEmpty()) {
222 224 locationLambda = Wrappers.lambdaQuery();
... ... @@ -245,17 +247,21 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
245 247 }
246 248  
247 249 //频繁库位
248   - if (frequencyLocation == 1) {
249   - locationLambda.orderByAsc(Location::getFrequencyLocation); //升序
250   - } else if (frequencyLocation == 2) {
251   - //常用
252   - locationLambda.ge(Location::getFrequencyLocation, 2);//大于等于2
253   - locationLambda.orderByAsc(Location::getFrequencyLocation);
  250 + //if (frequencyLocation == 1) {
  251 + // locationLambda.orderByAsc(Location::getFrequencyLocation); //升序
  252 + //} else if (frequencyLocation == 2) {
  253 + // //常用
  254 + // locationLambda.ge(Location::getFrequencyLocation, 2);//大于等于2
  255 + // locationLambda.orderByAsc(Location::getFrequencyLocation);
  256 + //} else {
  257 + // //不常用
  258 + // locationLambda.orderByDesc(Location::getFrequencyLocation);//倒序
  259 + //}
  260 + if (isFlammable) {
  261 + locationLambda.last("ORDER BY " + str + ", (CASE WHEN iLayer >= 4 THEN iLayer ELSE iLayer + 10 END) ASC");
254 262 } else {
255   - //不常用
256   - locationLambda.orderByDesc(Location::getFrequencyLocation);//倒序
  263 + locationLambda.orderByAsc(Location::getILayer);
257 264 }
258   - locationLambda.orderByAsc(Location::getILayer);
259 265 locationList = locationService.list(locationLambda);
260 266  
261 267 removeLocaationList = new ArrayList<>();
... ...
src/main/java/com/huaheng/framework/config/ShiroConfig.java
... ... @@ -276,11 +276,11 @@ public class ShiroConfig {
276 276 filterChainDefinitionMap.put("/mobile/receipt/batch/**", "anon");
277 277  
278 278 //todo pda出入库查询,测试后注释
279   - filterChainDefinitionMap.put("/receipt/receiptHeader/listPda", "anon");
280   - filterChainDefinitionMap.put("/receipt/receiptDetail/list", "anon");
281   - filterChainDefinitionMap.put("/task/taskHeader/getTaskByTaskId", "anon");
282   - filterChainDefinitionMap.put("/task/taskHeader/getTaskByShipmentCode", "anon");
283   - filterChainDefinitionMap.put("/mobile/inventory/completeTaskListByWMS", "anon");
  279 + //filterChainDefinitionMap.put("/receipt/receiptHeader/listPda", "anon");
  280 + //filterChainDefinitionMap.put("/receipt/receiptDetail/list", "anon");
  281 + //filterChainDefinitionMap.put("/task/taskHeader/getTaskByTaskId", "anon");
  282 + //filterChainDefinitionMap.put("/task/taskHeader/getTaskByShipmentCode", "anon");
  283 + //filterChainDefinitionMap.put("/mobile/inventory/completeTaskListByWMS", "anon");
284 284  
285 285  
286 286 // 系统权限列表
... ...
src/main/java/com/huaheng/pc/config/material/domain/Material.java
... ... @@ -390,7 +390,7 @@ public class Material implements Serializable {
390 390 private String policy;
391 391  
392 392 /**
393   - * 是否批次 (是/否
  393 + * 是否批次 (是 or NULL
394 394 */
395 395 @TableField(value = "isBatch")
396 396 private String isBatch;
... ...
src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
... ... @@ -63,6 +63,9 @@ public class ShippingCombinationService {
63 63 checkNotEmpty(inventorySts, "出库详情没有物料品质");
64 64 Material material = getMaterialByCode(materialCode);
65 65 String policy = Optional.ofNullable(material.getPolicy()).orElse("");
  66 + String isBatchMaterial = Optional.ofNullable(material.getIsBatch()).orElse("");
  67 +
  68 +
66 69 LambdaQueryWrapper<InventoryDetail> wrapper = Wrappers.lambdaQuery();
67 70 wrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode)
68 71 .eq(InventoryDetail::getCompanyCode, companyCode)
... ... @@ -80,6 +83,12 @@ public class ShippingCombinationService {
80 83 if (isFlatWarehouse) {
81 84 wrapper.ne(InventoryDetail::getZoneCode, "L");
82 85 }
  86 +
  87 + //批次管控的物料,出库时优先按先进先出规则
  88 + if (StringUtils.isEmpty(isBatchMaterial) || !isBatchMaterial.equals("是")) {
  89 + //不是批次批次管控的物料走这里
  90 + wrapper.orderByDesc(InventoryDetail::getQty);
  91 + }
83 92 wrapper.orderByAsc(InventoryDetail::getCreated);
84 93 List<InventoryDetail> list = inventoryDetailService.list(wrapper);
85 94  
... ... @@ -89,14 +98,14 @@ public class ShippingCombinationService {
89 98 if (policy.equals("PL") || noticeNo.contains("展会")) {
90 99 return list;
91 100 }
92   - return getInventoryWithoutNotice(companyCode, materialCode, inventorySts, receiptCode, containerCode, batch, isFlatWarehouse);
  101 + return getInventoryWithoutNotice(companyCode, materialCode, inventorySts, receiptCode, containerCode, batch, isFlatWarehouse, isBatchMaterial);
93 102 }
94 103 return list;
95 104 }
96 105  
97 106  
98 107 // 提取方法,用于构建没有通知单号的查询条件
99   - private List<InventoryDetail> getInventoryWithoutNotice(String companyCode, String materialCode, String inventorySts, String receiptCode, String containerCode, String batch, boolean isFlatWarehouse) {
  108 + private List<InventoryDetail> getInventoryWithoutNotice(String companyCode, String materialCode, String inventorySts, String receiptCode, String containerCode, String batch, boolean isFlatWarehouse, String isBatchMaterial) {
100 109 LambdaQueryWrapper<InventoryDetail> wrapper = Wrappers.lambdaQuery();
101 110 wrapper.eq(InventoryDetail::getMaterialCode, materialCode)
102 111 .eq(InventoryDetail::getCompanyCode, companyCode)
... ... @@ -108,6 +117,10 @@ public class ShippingCombinationService {
108 117 if (isFlatWarehouse) {
109 118 wrapper.ne(InventoryDetail::getZoneCode, "L");
110 119 }
  120 + if (StringUtils.isEmpty(isBatchMaterial) || !isBatchMaterial.equals("是")) {
  121 + wrapper.orderByDesc(InventoryDetail::getQty);
  122 + }
  123 + wrapper.orderByAsc(InventoryDetail::getCreated);
111 124 return inventoryDetailService.list(wrapper);
112 125 }
113 126  
... ...