Commit d3374e8d1a233e595abf2246389af0a920509e9f
1 parent
2c19fc91
二厂库位分配去除高度大于等于
Showing
10 changed files
with
171 additions
and
79 deletions
src/main/java/com/huaheng/api/wcs/service/taskAssignService/TaskAssignServiceImpl.java
@@ -185,6 +185,9 @@ public class TaskAssignServiceImpl implements TaskAssignService { | @@ -185,6 +185,9 @@ public class TaskAssignServiceImpl implements TaskAssignService { | ||
185 | //获取一个最近的空闲库位(优先找外侧) | 185 | //获取一个最近的空闲库位(优先找外侧) |
186 | destinationLocation = locationService.getEmptyLocation(insideLocation, isSelfCreated); | 186 | destinationLocation = locationService.getEmptyLocation(insideLocation, isSelfCreated); |
187 | } | 187 | } |
188 | + if (destinationLocation == null) { | ||
189 | + return AjaxResult.error("移库获取一个目标库位为空"); | ||
190 | + } | ||
188 | AjaxResult ajaxResult = transferTaskService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); | 191 | AjaxResult ajaxResult = transferTaskService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); |
189 | if (ajaxResult.getCode() == 400) { | 192 | if (ajaxResult.getCode() == 400) { |
190 | return AjaxResult.error(ajaxResult.getMsg()); | 193 | return AjaxResult.error(ajaxResult.getMsg()); |
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java
@@ -237,8 +237,9 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -237,8 +237,9 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
237 | @Override | 237 | @Override |
238 | @Transactional(rollbackFor = Exception.class) | 238 | @Transactional(rollbackFor = Exception.class) |
239 | public String doubleRk(String roadWay, int high, Integer frequencyLocation, Integer emptyContainerTask, boolean isFlammable, String taskNo, boolean bypass) { | 239 | public String doubleRk(String roadWay, int high, Integer frequencyLocation, Integer emptyContainerTask, boolean isFlammable, String taskNo, boolean bypass) { |
240 | - boolean isSecondFactory = isSecondFactory();//是否是二厂一期项目 | 240 | + //boolean isSecondFactory = isSecondFactory();//是否是二厂项目 |
241 | int reserveNumber = 0; | 241 | int reserveNumber = 0; |
242 | + //二厂,分拣任务回库的时候,也要判断预留库位 | ||
242 | if (!bypass) { | 243 | if (!bypass) { |
243 | reserveNumber = getReserveNumber(roadWay); | 244 | reserveNumber = getReserveNumber(roadWay); |
244 | } | 245 | } |
@@ -263,12 +264,13 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -263,12 +264,13 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
263 | .eq(Location::getContainerCode, "") | 264 | .eq(Location::getContainerCode, "") |
264 | .eq(Location::getSelfCreated, NO_TSELFCREATED) | 265 | .eq(Location::getSelfCreated, NO_TSELFCREATED) |
265 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 266 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
267 | + .eq(Location::getHigh, high) | ||
266 | .last(" limit 20"); | 268 | .last(" limit 20"); |
267 | - if (isSecondFactory) { | ||
268 | - wrapper.ge(Location::getHigh, high); | ||
269 | - } else { | ||
270 | - wrapper.eq(Location::getHigh, high); | ||
271 | - } | 269 | + //if (isSecondFactory) { |
270 | + // wrapper.ge(Location::getHigh, high); | ||
271 | + //} else { | ||
272 | + // wrapper.eq(Location::getHigh, high); | ||
273 | + //} | ||
272 | List<Location> totalLocationList = locationService.list(wrapper); | 274 | List<Location> totalLocationList = locationService.list(wrapper); |
273 | if (totalLocationList.size() <= reserveNumber) { | 275 | if (totalLocationList.size() <= reserveNumber) { |
274 | return "可能是库位不够用了,请检查预留库位数"; | 276 | return "可能是库位不够用了,请检查预留库位数"; |
@@ -280,17 +282,18 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -280,17 +282,18 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
280 | .eq(Location::getStatus, STATUS_LOCATION_EMPTY) | 282 | .eq(Location::getStatus, STATUS_LOCATION_EMPTY) |
281 | .eq(Location::getRowFlag, ROW_OUT)//外侧 | 283 | .eq(Location::getRowFlag, ROW_OUT)//外侧 |
282 | .eq(Location::getContainerCode, "") | 284 | .eq(Location::getContainerCode, "") |
285 | + .eq(Location::getHigh, high) | ||
283 | .eq(Location::getSelfCreated, NO_TSELFCREATED) | 286 | .eq(Location::getSelfCreated, NO_TSELFCREATED) |
284 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 287 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
285 | .orderByAsc(Location::getHigh) | 288 | .orderByAsc(Location::getHigh) |
286 | .orderByAsc(Location::getILayer) | 289 | .orderByAsc(Location::getILayer) |
287 | .orderByAsc(Location::getId) | 290 | .orderByAsc(Location::getId) |
288 | .last(" limit 20"); | 291 | .last(" limit 20"); |
289 | - if (isSecondFactory) { | ||
290 | - locationLambda.ge(Location::getHigh, high); | ||
291 | - } else { | ||
292 | - locationLambda.eq(Location::getHigh, high); | ||
293 | - } | 292 | + //if (isSecondFactory) { |
293 | + // locationLambda.ge(Location::getHigh, high); | ||
294 | + //} else { | ||
295 | + // locationLambda.eq(Location::getHigh, high); | ||
296 | + //} | ||
294 | 297 | ||
295 | List<Location> locationList = locationService.list(locationLambda); | 298 | List<Location> locationList = locationService.list(locationLambda); |
296 | List<Location> removeLocaationList = new ArrayList<>(); | 299 | List<Location> removeLocaationList = new ArrayList<>(); |
@@ -315,15 +318,16 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -315,15 +318,16 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
315 | .eq(Location::getContainerCode, "") | 318 | .eq(Location::getContainerCode, "") |
316 | .eq(Location::getSelfCreated, NO_TSELFCREATED) | 319 | .eq(Location::getSelfCreated, NO_TSELFCREATED) |
317 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 320 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
321 | + .eq(Location::getHigh, high) | ||
318 | .orderByAsc(Location::getHigh) | 322 | .orderByAsc(Location::getHigh) |
319 | .orderByAsc(Location::getILayer) | 323 | .orderByAsc(Location::getILayer) |
320 | .orderByAsc(Location::getId) | 324 | .orderByAsc(Location::getId) |
321 | .last(" limit 20"); | 325 | .last(" limit 20"); |
322 | - if (isSecondFactory) { | ||
323 | - locationLambda2.ge(Location::getHigh, high); | ||
324 | - } else { | ||
325 | - locationLambda2.eq(Location::getHigh, high); | ||
326 | - } | 326 | + //if (isSecondFactory) { |
327 | + // locationLambda2.ge(Location::getHigh, high); | ||
328 | + //} else { | ||
329 | + // locationLambda2.eq(Location::getHigh, high); | ||
330 | + //} | ||
327 | 331 | ||
328 | locationList = locationService.list(locationLambda2); | 332 | locationList = locationService.list(locationLambda2); |
329 | removeLocaationList = new ArrayList<>(); | 333 | removeLocaationList = new ArrayList<>(); |
@@ -350,7 +354,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -350,7 +354,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
350 | //自建单据 | 354 | //自建单据 |
351 | @Override | 355 | @Override |
352 | public String isSelfCreated(String roadWay, int high, Integer frequencyLocation, boolean bypass) { | 356 | public String isSelfCreated(String roadWay, int high, Integer frequencyLocation, boolean bypass) { |
353 | - boolean isSecondFactory = isSecondFactory(); | 357 | + //boolean isSecondFactory = isSecondFactory(); |
354 | int reserveNumber = 0; | 358 | int reserveNumber = 0; |
355 | if (!bypass) { | 359 | if (!bypass) { |
356 | reserveNumber = getReserveNumber(roadWay); | 360 | reserveNumber = getReserveNumber(roadWay); |
@@ -363,12 +367,13 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -363,12 +367,13 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
363 | .eq(Location::getContainerCode, "") | 367 | .eq(Location::getContainerCode, "") |
364 | .eq(Location::getSelfCreated, SELFCREATED) | 368 | .eq(Location::getSelfCreated, SELFCREATED) |
365 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 369 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
370 | + .eq(Location::getHigh, high) | ||
366 | .last(" limit 20"); | 371 | .last(" limit 20"); |
367 | - if (isSecondFactory) { | ||
368 | - wrapper.ge(Location::getHigh, high); | ||
369 | - } else { | ||
370 | - wrapper.eq(Location::getHigh, high); | ||
371 | - } | 372 | + //if (isSecondFactory) { |
373 | + // wrapper.ge(Location::getHigh, high); | ||
374 | + //} else { | ||
375 | + // wrapper.eq(Location::getHigh, high); | ||
376 | + //} | ||
372 | List<Location> totalLocationList = locationService.list(wrapper); | 377 | List<Location> totalLocationList = locationService.list(wrapper); |
373 | //双伸位预留库位数不够了就排除掉该巷道 | 378 | //双伸位预留库位数不够了就排除掉该巷道 |
374 | if (totalLocationList.size() <= reserveNumber) { | 379 | if (totalLocationList.size() <= reserveNumber) { |
@@ -382,17 +387,18 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -382,17 +387,18 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
382 | .eq(Location::getRowFlag, ROW_OUT)//外侧 | 387 | .eq(Location::getRowFlag, ROW_OUT)//外侧 |
383 | .eq(Location::getContainerCode, "") | 388 | .eq(Location::getContainerCode, "") |
384 | .eq(Location::getSelfCreated, SELFCREATED) | 389 | .eq(Location::getSelfCreated, SELFCREATED) |
390 | + .eq(Location::getHigh, high) | ||
385 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 391 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
386 | .orderByAsc(Location::getHigh) | 392 | .orderByAsc(Location::getHigh) |
387 | .orderByAsc(Location::getILayer) | 393 | .orderByAsc(Location::getILayer) |
388 | .orderByAsc(Location::getId) | 394 | .orderByAsc(Location::getId) |
389 | .last(" limit 20"); | 395 | .last(" limit 20"); |
390 | 396 | ||
391 | - if (isSecondFactory) { | ||
392 | - locationLambda.ge(Location::getHigh, high); | ||
393 | - } else { | ||
394 | - locationLambda.eq(Location::getHigh, high); | ||
395 | - } | 397 | + //if (isSecondFactory) { |
398 | + // locationLambda.ge(Location::getHigh, high); | ||
399 | + //} else { | ||
400 | + // locationLambda.eq(Location::getHigh, high); | ||
401 | + //} | ||
396 | List<Location> locationList = locationService.list(locationLambda); | 402 | List<Location> locationList = locationService.list(locationLambda); |
397 | List<Location> removeLocaationList = new ArrayList<>(); | 403 | List<Location> removeLocaationList = new ArrayList<>(); |
398 | if (locationList != null && !locationList.isEmpty()) { | 404 | if (locationList != null && !locationList.isEmpty()) { |
@@ -417,15 +423,16 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -417,15 +423,16 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
417 | .eq(Location::getContainerCode, "") | 423 | .eq(Location::getContainerCode, "") |
418 | .eq(Location::getSelfCreated, SELFCREATED) | 424 | .eq(Location::getSelfCreated, SELFCREATED) |
419 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 425 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
426 | + .eq(Location::getHigh, high) | ||
420 | .orderByAsc(Location::getHigh) | 427 | .orderByAsc(Location::getHigh) |
421 | .orderByAsc(Location::getILayer) | 428 | .orderByAsc(Location::getILayer) |
422 | .orderByAsc(Location::getId) | 429 | .orderByAsc(Location::getId) |
423 | .last(" limit 20"); | 430 | .last(" limit 20"); |
424 | - if (isSecondFactory) { | ||
425 | - locationLambda2.ge(Location::getHigh, high); | ||
426 | - } else { | ||
427 | - locationLambda2.eq(Location::getHigh, high); | ||
428 | - } | 431 | + //if (isSecondFactory) { |
432 | + // locationLambda2.ge(Location::getHigh, high); | ||
433 | + //} else { | ||
434 | + // locationLambda2.eq(Location::getHigh, high); | ||
435 | + //} | ||
429 | locationList = locationService.list(locationLambda2); | 436 | locationList = locationService.list(locationLambda2); |
430 | removeLocaationList = new ArrayList<>(); | 437 | removeLocaationList = new ArrayList<>(); |
431 | if (locationList != null && !locationList.isEmpty()) { | 438 | if (locationList != null && !locationList.isEmpty()) { |
@@ -459,7 +466,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -459,7 +466,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
459 | @Override | 466 | @Override |
460 | public String isFlammable(String roadWay, int high, Integer frequencyLocation, String taskNo, boolean bypass) { | 467 | public String isFlammable(String roadWay, int high, Integer frequencyLocation, String taskNo, boolean bypass) { |
461 | int flammableLayer = 3; | 468 | int flammableLayer = 3; |
462 | - boolean isSecondFactory = isSecondFactory(); | 469 | + //boolean isSecondFactory = isSecondFactory(); |
463 | int reserveNumber = 0; | 470 | int reserveNumber = 0; |
464 | if (!bypass) { | 471 | if (!bypass) { |
465 | reserveNumber = getReserveNumber(roadWay); | 472 | reserveNumber = getReserveNumber(roadWay); |
@@ -471,14 +478,15 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -471,14 +478,15 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
471 | .eq(Location::getStatus, STATUS_LOCATION_EMPTY) | 478 | .eq(Location::getStatus, STATUS_LOCATION_EMPTY) |
472 | .eq(Location::getContainerCode, "") | 479 | .eq(Location::getContainerCode, "") |
473 | .eq(Location::getSelfCreated, NO_TSELFCREATED) | 480 | .eq(Location::getSelfCreated, NO_TSELFCREATED) |
481 | + .eq(Location::getHigh, high) | ||
474 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 482 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
475 | .last(" limit 20"); | 483 | .last(" limit 20"); |
476 | 484 | ||
477 | - if (isSecondFactory) { | ||
478 | - wrapper.ge(Location::getHigh, high); | ||
479 | - } else { | ||
480 | - wrapper.eq(Location::getHigh, high); | ||
481 | - } | 485 | + //if (isSecondFactory) { |
486 | + // wrapper.ge(Location::getHigh, high); | ||
487 | + //} else { | ||
488 | + // wrapper.eq(Location::getHigh, high); | ||
489 | + //} | ||
482 | List<Location> totalLocationList = locationService.list(wrapper); | 490 | List<Location> totalLocationList = locationService.list(wrapper); |
483 | if (totalLocationList.size() <= reserveNumber) { | 491 | if (totalLocationList.size() <= reserveNumber) { |
484 | return "可能是库位不够用了,请检查预留库位数"; | 492 | return "可能是库位不够用了,请检查预留库位数"; |
@@ -491,14 +499,15 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -491,14 +499,15 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
491 | .eq(Location::getRowFlag, ROW_OUT)//外侧 | 499 | .eq(Location::getRowFlag, ROW_OUT)//外侧 |
492 | .eq(Location::getContainerCode, "") | 500 | .eq(Location::getContainerCode, "") |
493 | .eq(Location::getSelfCreated, NO_TSELFCREATED) | 501 | .eq(Location::getSelfCreated, NO_TSELFCREATED) |
502 | + .eq(Location::getHigh, high) | ||
494 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 503 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
495 | .last("ORDER BY (CASE WHEN iLayer > " + flammableLayer + " THEN iLayer ELSE iLayer + 20 END) ASC LIMIT 20"); | 504 | .last("ORDER BY (CASE WHEN iLayer > " + flammableLayer + " THEN iLayer ELSE iLayer + 20 END) ASC LIMIT 20"); |
496 | 505 | ||
497 | - if (isSecondFactory) { | ||
498 | - locationLambda.ge(Location::getHigh, high); | ||
499 | - } else { | ||
500 | - locationLambda.eq(Location::getHigh, high); | ||
501 | - } | 506 | + //if (isSecondFactory) { |
507 | + // locationLambda.ge(Location::getHigh, high); | ||
508 | + //} else { | ||
509 | + // locationLambda.eq(Location::getHigh, high); | ||
510 | + //} | ||
502 | 511 | ||
503 | List<Location> locationList = locationService.list(locationLambda); | 512 | List<Location> locationList = locationService.list(locationLambda); |
504 | List<Location> removeLocaationList = new ArrayList<>(); | 513 | List<Location> removeLocaationList = new ArrayList<>(); |
@@ -521,14 +530,15 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -521,14 +530,15 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
521 | .eq(Location::getStatus, STATUS_LOCATION_EMPTY) | 530 | .eq(Location::getStatus, STATUS_LOCATION_EMPTY) |
522 | .eq(Location::getRowFlag, ROW_IN) | 531 | .eq(Location::getRowFlag, ROW_IN) |
523 | .eq(Location::getContainerCode, "") | 532 | .eq(Location::getContainerCode, "") |
533 | + .eq(Location::getHigh, high) | ||
524 | .eq(Location::getSelfCreated, NO_TSELFCREATED) | 534 | .eq(Location::getSelfCreated, NO_TSELFCREATED) |
525 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) | 535 | .eq(Location::getOnlyEmptyContainer, NO_EMPTY_CONTAINER_LOCATION) |
526 | .last("ORDER BY (CASE WHEN iLayer > " + flammableLayer + " THEN iLayer ELSE iLayer + 20 END) ASC LIMIT 20"); | 536 | .last("ORDER BY (CASE WHEN iLayer > " + flammableLayer + " THEN iLayer ELSE iLayer + 20 END) ASC LIMIT 20"); |
527 | - if (isSecondFactory) { | ||
528 | - locationLambda2.ge(Location::getHigh, high); | ||
529 | - } else { | ||
530 | - locationLambda2.eq(Location::getHigh, high); | ||
531 | - } | 537 | + //if (isSecondFactory) { |
538 | + // locationLambda2.ge(Location::getHigh, high); | ||
539 | + //} else { | ||
540 | + // locationLambda2.eq(Location::getHigh, high); | ||
541 | + //} | ||
532 | locationList = locationService.list(locationLambda2); | 542 | locationList = locationService.list(locationLambda2); |
533 | removeLocaationList = new ArrayList<>(); | 543 | removeLocaationList = new ArrayList<>(); |
534 | if (locationList != null && !locationList.isEmpty()) { | 544 | if (locationList != null && !locationList.isEmpty()) { |
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
@@ -234,7 +234,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService | @@ -234,7 +234,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService | ||
234 | if (StringUtils.isNotEmpty(taskHeader.getToLocation()) && !locationCode.equals(taskHeader.getToLocation())) { | 234 | if (StringUtils.isNotEmpty(taskHeader.getToLocation()) && !locationCode.equals(taskHeader.getToLocation())) { |
235 | int updateCount2 = locationService.updateStatusNew(taskHeader.getToLocation(), warehouseCode, QuantityConstant.STATUS_LOCATION_EMPTY, QuantityConstant.STATUS_LOCATION_LOCK); | 235 | int updateCount2 = locationService.updateStatusNew(taskHeader.getToLocation(), warehouseCode, QuantityConstant.STATUS_LOCATION_EMPTY, QuantityConstant.STATUS_LOCATION_LOCK); |
236 | if (updateCount2 != 1) { | 236 | if (updateCount2 != 1) { |
237 | - throw new ServiceException("重复分配库位时,解锁库位失败!"); | 237 | + throw new ServiceException("重复分配库位时,解锁库位失败!" + taskHeader.getToLocation()); |
238 | } | 238 | } |
239 | //解除右侧库位禁用状态和对应4个库位标记 | 239 | //解除右侧库位禁用状态和对应4个库位标记 |
240 | locationService.unbanRightLocationAndUnmark(container.getContainerType(), taskHeader.getToLocation()); | 240 | locationService.unbanRightLocationAndUnmark(container.getContainerType(), taskHeader.getToLocation()); |
@@ -273,7 +273,9 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService | @@ -273,7 +273,9 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService | ||
273 | //获取一个最近的空闲库位(优先找外侧) | 273 | //获取一个最近的空闲库位(优先找外侧) |
274 | destinationLocation = locationService.getEmptyLocation(insideLocation, isSelfCreated); | 274 | destinationLocation = locationService.getEmptyLocation(insideLocation, isSelfCreated); |
275 | } | 275 | } |
276 | - | 276 | + if (destinationLocation == null) { |
277 | + throw new ServiceException("创建移库任务失败,目标库位无法分配,可能是库位已经全满了"); | ||
278 | + } | ||
277 | //创建移库任务 | 279 | //创建移库任务 |
278 | AjaxResult ajaxResult = transferTaskService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); | 280 | AjaxResult ajaxResult = transferTaskService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); |
279 | preTaskNo = (Integer) ajaxResult.getData(); | 281 | preTaskNo = (Integer) ajaxResult.getData(); |
src/main/java/com/huaheng/framework/config/ShiroConfig.java
@@ -300,6 +300,7 @@ public class ShiroConfig { | @@ -300,6 +300,7 @@ public class ShiroConfig { | ||
300 | //filterChainDefinitionMap.put("/receipt/receiving/saveBatch", "anon"); | 300 | //filterChainDefinitionMap.put("/receipt/receiving/saveBatch", "anon"); |
301 | //filterChainDefinitionMap.put("/config/zone/getAllFlatLocation", "anon"); | 301 | //filterChainDefinitionMap.put("/config/zone/getAllFlatLocation", "anon"); |
302 | //filterChainDefinitionMap.put("/mobile/getModules2", "anon"); | 302 | //filterChainDefinitionMap.put("/mobile/getModules2", "anon"); |
303 | + //filterChainDefinitionMap.put("/inventory/inventoryHeader/listEmptyContainer", "anon"); | ||
303 | 304 | ||
304 | 305 | ||
305 | // 系统权限列表 | 306 | // 系统权限列表 |
src/main/java/com/huaheng/mobile/invenory/MobileInventoryController.java
@@ -32,8 +32,11 @@ import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService; | @@ -32,8 +32,11 @@ import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService; | ||
32 | import com.huaheng.pc.inventory.inventoryTransaction.domain.InventoryTransaction; | 32 | import com.huaheng.pc.inventory.inventoryTransaction.domain.InventoryTransaction; |
33 | import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService; | 33 | import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService; |
34 | import com.huaheng.pc.report.excelReport.mapper.ExcelReportMapper; | 34 | import com.huaheng.pc.report.excelReport.mapper.ExcelReportMapper; |
35 | +import com.huaheng.pc.task.taskDetail.domain.TaskDetail; | ||
36 | +import com.huaheng.pc.task.taskDetail.service.TaskDetailService; | ||
35 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; | 37 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
36 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; | 38 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
39 | +import com.huaheng.pc.task.taskHeader.service.TaskHeaderServiceImpl; | ||
37 | import com.huaheng.pc.task.taskHeader.service.TransferTaskService; | 40 | import com.huaheng.pc.task.taskHeader.service.TransferTaskService; |
38 | import com.huaheng.pc.task.taskHeader.service.WorkTaskService; | 41 | import com.huaheng.pc.task.taskHeader.service.WorkTaskService; |
39 | import io.swagger.annotations.Api; | 42 | import io.swagger.annotations.Api; |
@@ -62,7 +65,10 @@ import java.util.stream.Collectors; | @@ -62,7 +65,10 @@ import java.util.stream.Collectors; | ||
62 | @RequestMapping("/mobile/inventory") | 65 | @RequestMapping("/mobile/inventory") |
63 | @Api(tags = {"手机立体库库存相关"}, value = "手机立体库库存相关MobileInventoryController") | 66 | @Api(tags = {"手机立体库库存相关"}, value = "手机立体库库存相关MobileInventoryController") |
64 | public class MobileInventoryController extends BaseController { | 67 | public class MobileInventoryController extends BaseController { |
65 | - | 68 | + @Resource |
69 | + private TaskDetailService taskDetailService; | ||
70 | + @Resource | ||
71 | + private TaskHeaderService taskHeaderService; | ||
66 | @Resource | 72 | @Resource |
67 | private InventoryHeaderService inventoryService; | 73 | private InventoryHeaderService inventoryService; |
68 | @Resource | 74 | @Resource |
@@ -89,6 +95,8 @@ public class MobileInventoryController extends BaseController { | @@ -89,6 +95,8 @@ public class MobileInventoryController extends BaseController { | ||
89 | private CycleCountDetailChildService cycleCountDetailChildService; | 95 | private CycleCountDetailChildService cycleCountDetailChildService; |
90 | @Resource | 96 | @Resource |
91 | private CycleCountHeaderMapper cycleCountHeaderMapper; | 97 | private CycleCountHeaderMapper cycleCountHeaderMapper; |
98 | + @Autowired | ||
99 | + private TaskHeaderServiceImpl taskHeaderServiceImpl; | ||
92 | 100 | ||
93 | @PostMapping("/getInventoryInfo") | 101 | @PostMapping("/getInventoryInfo") |
94 | //@ApiOperation("移动端获得库存详情") | 102 | //@ApiOperation("移动端获得库存详情") |
@@ -172,6 +180,7 @@ public class MobileInventoryController extends BaseController { | @@ -172,6 +180,7 @@ public class MobileInventoryController extends BaseController { | ||
172 | @Autowired | 180 | @Autowired |
173 | private RedisTemplate<String, String> redisTemplate; | 181 | private RedisTemplate<String, String> redisTemplate; |
174 | 182 | ||
183 | + @ApiLogger(apiName = "PDA完成平库任务", from = "PDA") | ||
175 | @PostMapping("/completeTaskListByWMS") | 184 | @PostMapping("/completeTaskListByWMS") |
176 | @ResponseBody | 185 | @ResponseBody |
177 | public AjaxResult completeTaskListByWMS(@RequestBody List<TaskIds> taskDetails) { | 186 | public AjaxResult completeTaskListByWMS(@RequestBody List<TaskIds> taskDetails) { |
@@ -180,18 +189,23 @@ public class MobileInventoryController extends BaseController { | @@ -180,18 +189,23 @@ public class MobileInventoryController extends BaseController { | ||
180 | 189 | ||
181 | List<TaskHeader> tasks = taskService.getTasksByIds(taskIds); | 190 | List<TaskHeader> tasks = taskService.getTasksByIds(taskIds); |
182 | 191 | ||
183 | - // 筛选出未完成的任务 | ||
184 | - List<Integer> pendingTaskIds = tasks.stream() | 192 | + // 筛选出未完成的任务的ID |
193 | + Integer[] pendingTaskIds = tasks.stream() | ||
185 | .filter(task -> task.getStatus() != QuantityConstant.TASK_STATUS_COMPLETED) | 194 | .filter(task -> task.getStatus() != QuantityConstant.TASK_STATUS_COMPLETED) |
186 | .map(TaskHeader::getId) | 195 | .map(TaskHeader::getId) |
187 | - .collect(Collectors.toList()); | ||
188 | - | 196 | + .distinct() // 确保ID是唯一的 |
197 | + .toArray(Integer[]::new); | ||
189 | 198 | ||
190 | // 如果没有未完成的任务,直接返回 | 199 | // 如果没有未完成的任务,直接返回 |
191 | - if (pendingTaskIds.isEmpty()) { | 200 | + if (pendingTaskIds.length == 0) { |
192 | return AjaxResult.success("任务已完成"); | 201 | return AjaxResult.success("任务已完成"); |
193 | } | 202 | } |
194 | - return taskService.completeTaskByWMS(taskIds, null); | 203 | + |
204 | + for (Integer taskId : pendingTaskIds) { | ||
205 | + taskService.completeTaskByWMS(new Integer[]{taskId}, null); | ||
206 | + } | ||
207 | + return AjaxResult.success("任务完成"); | ||
208 | + | ||
195 | } | 209 | } |
196 | 210 | ||
197 | 211 |
src/main/java/com/huaheng/mobile/receipt/MobileBatchReceiptController.java
@@ -25,6 +25,8 @@ import com.huaheng.pc.config.receiptType.domain.ReceiptType; | @@ -25,6 +25,8 @@ import com.huaheng.pc.config.receiptType.domain.ReceiptType; | ||
25 | import com.huaheng.pc.config.receiptType.service.ReceiptTypeService; | 25 | import com.huaheng.pc.config.receiptType.service.ReceiptTypeService; |
26 | import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader; | 26 | import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader; |
27 | import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService; | 27 | import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService; |
28 | +import com.huaheng.pc.monitor.apilog.domain.ApiLog; | ||
29 | +import com.huaheng.pc.monitor.apilog.service.IApiLogService; | ||
28 | import com.huaheng.pc.receipt.receiptContainerDetail.service.ReceiptContainerDetailService; | 30 | import com.huaheng.pc.receipt.receiptContainerDetail.service.ReceiptContainerDetailService; |
29 | import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; | 31 | import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; |
30 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; | 32 | import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; |
@@ -99,6 +101,8 @@ public class MobileBatchReceiptController { | @@ -99,6 +101,8 @@ public class MobileBatchReceiptController { | ||
99 | @Resource | 101 | @Resource |
100 | private InventoryHeaderService inventoryHeaderService; | 102 | private InventoryHeaderService inventoryHeaderService; |
101 | 103 | ||
104 | + @Resource | ||
105 | + private IApiLogService apiLogService; | ||
102 | 106 | ||
103 | @PostMapping("/scanContainer") | 107 | @PostMapping("/scanContainer") |
104 | @ApiOperation("移动端入库扫描容器") | 108 | @ApiOperation("移动端入库扫描容器") |
@@ -537,9 +541,9 @@ public class MobileBatchReceiptController { | @@ -537,9 +541,9 @@ public class MobileBatchReceiptController { | ||
537 | 541 | ||
538 | 542 | ||
539 | @PostMapping("/callBox") | 543 | @PostMapping("/callBox") |
540 | - @ApiOperation("移动端呼叫料盒") | ||
541 | - @ApiLogger(apiName = "PDA呼叫料盒", from = "WCS") | ||
542 | - @Log(title = "移动端呼叫料盒", action = BusinessType.OTHER) | 544 | + @ApiOperation("PDA呼叫料盒") |
545 | + @ApiLogger(apiName = "PDA呼叫料盒", from = "PDA") | ||
546 | + @Log(title = "PDA呼叫料盒", action = BusinessType.OTHER) | ||
543 | @Transactional(rollbackFor = Exception.class) | 547 | @Transactional(rollbackFor = Exception.class) |
544 | public AjaxResult callBox(@RequestBody @ApiParam(value = "物料号") Map<String, String> param) { | 548 | public AjaxResult callBox(@RequestBody @ApiParam(value = "物料号") Map<String, String> param) { |
545 | String containerCode = param.get("containerCode"); | 549 | String containerCode = param.get("containerCode"); |
@@ -577,12 +581,16 @@ public class MobileBatchReceiptController { | @@ -577,12 +581,16 @@ public class MobileBatchReceiptController { | ||
577 | } | 581 | } |
578 | } | 582 | } |
579 | 583 | ||
580 | - | ||
581 | Location location = locationService.getOne(new LambdaQueryWrapper<Location>().eq(Location::getCode, destinationLocation)); | 584 | Location location = locationService.getOne(new LambdaQueryWrapper<Location>().eq(Location::getCode, destinationLocation)); |
582 | - Container container = containerService.getOne(new LambdaQueryWrapper<Container>().eq(Container::getCode, containerCode).eq(Container::getWarehouseCode, "CS0001").last("limit 1")); | ||
583 | - if (container == null) { | 585 | + List<Container> list = containerService.list(new LambdaQueryWrapper<Container>().eq(Container::getCode, containerCode)); |
586 | + if (list.isEmpty()) { | ||
584 | return AjaxResult.error("容器不存在"); | 587 | return AjaxResult.error("容器不存在"); |
585 | } | 588 | } |
589 | + if (list.size() > 1) { | ||
590 | + return AjaxResult.error("容器大于1"); | ||
591 | + } | ||
592 | + Container container = list.get(0); | ||
593 | + | ||
586 | if (location == null) { | 594 | if (location == null) { |
587 | return AjaxResult.error("库位不存在"); | 595 | return AjaxResult.error("库位不存在"); |
588 | } | 596 | } |
@@ -639,10 +647,10 @@ public class MobileBatchReceiptController { | @@ -639,10 +647,10 @@ public class MobileBatchReceiptController { | ||
639 | TaskHeader taskHeader = new TaskHeader(); | 647 | TaskHeader taskHeader = new TaskHeader(); |
640 | taskHeader.setWarehouseCode(location.getWarehouseCode()); | 648 | taskHeader.setWarehouseCode(location.getWarehouseCode()); |
641 | taskHeader.setCompanyCode(companyCode);//货主 | 649 | taskHeader.setCompanyCode(companyCode);//货主 |
642 | - if (type == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { | 650 | + if (type == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) {//补充入库 |
643 | taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | 651 | taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); |
644 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT); | 652 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT); |
645 | - } else if (type == QuantityConstant.TASK_TYPE_WHOLERECEIPT) { | 653 | + } else if (type == QuantityConstant.TASK_TYPE_WHOLERECEIPT) {//整盘入库 |
646 | taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | 654 | taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); |
647 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_WHOLERECEIPT); | 655 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_WHOLERECEIPT); |
648 | } else { | 656 | } else { |
@@ -669,9 +677,20 @@ public class MobileBatchReceiptController { | @@ -669,9 +677,20 @@ public class MobileBatchReceiptController { | ||
669 | throw new ServiceException("补充入库主表生成失败!"); | 677 | throw new ServiceException("补充入库主表生成失败!"); |
670 | } | 678 | } |
671 | 679 | ||
680 | + addApiLog("PDA呼叫料盒", taskHeader.getContainerCode() + "/" + taskHeader.getFromLocation()); | ||
672 | return AjaxResult.success(taskHeader.getId()); | 681 | return AjaxResult.success(taskHeader.getId()); |
673 | } | 682 | } |
674 | 683 | ||
684 | + public void addApiLog(String name, String requestBody) { | ||
685 | + ApiLog apiLog = new ApiLog(); | ||
686 | + apiLog.setApiName(name); | ||
687 | + apiLog.setRequestBody(requestBody); | ||
688 | + apiLog.setRequestTime(new Date()); | ||
689 | + apiLog.setRequestFrom("MOM"); | ||
690 | + apiLog.setResponseBy("WMS"); | ||
691 | + apiLog.setResponseBody("成功"); | ||
692 | + apiLogService.save(apiLog); | ||
693 | + } | ||
675 | 694 | ||
676 | @PostMapping("/searchReceipt") | 695 | @PostMapping("/searchReceipt") |
677 | @ApiOperation("移动端查询入库单") | 696 | @ApiOperation("移动端查询入库单") |
src/main/java/com/huaheng/pc/config/container/service/ContainerServiceImpl.java
@@ -139,9 +139,7 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container | @@ -139,9 +139,7 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container | ||
139 | .eq(Location::getZoneCode, "L") | 139 | .eq(Location::getZoneCode, "L") |
140 | .isNotNull(Location::getContainerCode) | 140 | .isNotNull(Location::getContainerCode) |
141 | .notInSql(Location::getContainerCode, "SELECT h.containerCode FROM task_header h WHERE h.status < 100") | 141 | .notInSql(Location::getContainerCode, "SELECT h.containerCode FROM task_header h WHERE h.status < 100") |
142 | - .notInSql(Location::getCode, "SELECT b.locationCode FROM inventory_detail b") | ||
143 | - .notInSql(Location::getCode, "SELECT r.locationCode FROM receipt_container_detail r WHERE r.status != 20") | ||
144 | - .notInSql(Location::getCode, "SELECT s.locationCode FROM shipment_container_detail s WHERE s.status != 20"); | 142 | + .notInSql(Location::getCode, "SELECT b.locationCode FROM inventory_detail b"); |
145 | 143 | ||
146 | if (zoneCode != null && !zoneCode.isEmpty()) { | 144 | if (zoneCode != null && !zoneCode.isEmpty()) { |
147 | queryWrapper.eq(Location::getZoneCode, zoneCode); | 145 | queryWrapper.eq(Location::getZoneCode, zoneCode); |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
@@ -42,6 +42,7 @@ import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; | @@ -42,6 +42,7 @@ import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; | ||
42 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; | 42 | import com.huaheng.pc.task.taskHeader.domain.TaskHeader; |
43 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; | 43 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
44 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderServiceImpl; | 44 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderServiceImpl; |
45 | +import lombok.extern.slf4j.Slf4j; | ||
45 | import org.apache.shiro.authz.annotation.RequiresPermissions; | 46 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
46 | import org.springframework.beans.BeanUtils; | 47 | import org.springframework.beans.BeanUtils; |
47 | import org.springframework.stereotype.Controller; | 48 | import org.springframework.stereotype.Controller; |
@@ -59,6 +60,7 @@ import java.util.stream.Collectors; | @@ -59,6 +60,7 @@ import java.util.stream.Collectors; | ||
59 | /** | 60 | /** |
60 | * 库存控制层 | 61 | * 库存控制层 |
61 | */ | 62 | */ |
63 | +@Slf4j | ||
62 | @Controller | 64 | @Controller |
63 | @RequestMapping("/inventory/inventoryHeader") | 65 | @RequestMapping("/inventory/inventoryHeader") |
64 | public class InventoryHeaderController extends BaseController { | 66 | public class InventoryHeaderController extends BaseController { |
@@ -416,6 +418,7 @@ public class InventoryHeaderController extends BaseController { | @@ -416,6 +418,7 @@ public class InventoryHeaderController extends BaseController { | ||
416 | */ | 418 | */ |
417 | @PostMapping("/listEmptyContainer") | 419 | @PostMapping("/listEmptyContainer") |
418 | @ResponseBody | 420 | @ResponseBody |
421 | + @ApiLogger(apiName = "PDA呼叫空托盘出库", from = "PDA") | ||
419 | public TableDataInfo listEmptyContainer(String zoneCode, String containerCode, String locationCode) { | 422 | public TableDataInfo listEmptyContainer(String zoneCode, String containerCode, String locationCode) { |
420 | containerCode = containerCode == null ? "" : containerCode.trim(); | 423 | containerCode = containerCode == null ? "" : containerCode.trim(); |
421 | locationCode = locationCode == null ? "" : locationCode.trim(); | 424 | locationCode = locationCode == null ? "" : locationCode.trim(); |
src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
@@ -3,8 +3,10 @@ package com.huaheng.pc.shipment.shippingCombination.service; | @@ -3,8 +3,10 @@ package com.huaheng.pc.shipment.shippingCombination.service; | ||
3 | 3 | ||
4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | +import com.huaheng.common.constant.QuantityConstant; | ||
6 | import com.huaheng.common.exception.service.ServiceException; | 7 | import com.huaheng.common.exception.service.ServiceException; |
7 | import com.huaheng.common.utils.StringUtils; | 8 | import com.huaheng.common.utils.StringUtils; |
9 | +import com.huaheng.framework.web.service.ConfigService; | ||
8 | import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; | 10 | import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; |
9 | import com.huaheng.pc.config.FilterConfigDetail.service.FilterConfigDetailService; | 11 | import com.huaheng.pc.config.FilterConfigDetail.service.FilterConfigDetailService; |
10 | import com.huaheng.pc.config.cinvcType.domain.CinvcType; | 12 | import com.huaheng.pc.config.cinvcType.domain.CinvcType; |
@@ -59,10 +61,47 @@ public class ShippingCombinationService { | @@ -59,10 +61,47 @@ public class ShippingCombinationService { | ||
59 | MaterialTypeService materialTypeService; | 61 | MaterialTypeService materialTypeService; |
60 | @Resource | 62 | @Resource |
61 | ShipmentHeaderService shipmentHeaderService; | 63 | ShipmentHeaderService shipmentHeaderService; |
62 | - | 64 | + @Resource |
65 | + private ConfigService configService; | ||
63 | 66 | ||
64 | //根据分配规则查找库存 | 67 | //根据分配规则查找库存 |
65 | public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail, boolean isAuto, boolean isFlatWarehouse, boolean openExhibitionRestrictions) { | 68 | public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail, boolean isAuto, boolean isFlatWarehouse, boolean openExhibitionRestrictions) { |
69 | + //一厂一期物料相同就合并 | ||
70 | + String version = configService.getKey(QuantityConstant.PROJECT_VERSION); | ||
71 | + if (version.equals("1")) { | ||
72 | + return getInventoryVersion1(shipmentDetail, isAuto, isFlatWarehouse, openExhibitionRestrictions); | ||
73 | + } else { | ||
74 | + return getInventoryVersion2(shipmentDetail, isAuto, isFlatWarehouse, openExhibitionRestrictions); | ||
75 | + } | ||
76 | + | ||
77 | + } | ||
78 | + | ||
79 | + | ||
80 | + //一期 | ||
81 | + public List<InventoryDetail> getInventoryVersion1(ShipmentDetail shipmentDetail, boolean isAuto, boolean isFlatWarehouse, boolean openExhibitionRestrictions) { | ||
82 | + String materialCode = shipmentDetail.getMaterialCode(); | ||
83 | + checkNotEmpty(materialCode, "出库明细没有物料编码"); | ||
84 | + String containerCode = shipmentDetail.getContainerCode(); | ||
85 | + String receiptCode = shipmentDetail.getReceiptCode(); | ||
86 | + ShipmentHeader shipmentHeader = shipmentHeaderService.getById(shipmentDetail.getShipmentId()); | ||
87 | + String warehouse = shipmentHeader.getWarehouse(); | ||
88 | + | ||
89 | + LambdaQueryWrapper<InventoryDetail> wrapper = Wrappers.lambdaQuery(); | ||
90 | + wrapper.eq(InventoryDetail::getMaterialCode, materialCode) | ||
91 | + .eq(StringUtils.isNotEmpty(warehouse), InventoryDetail::getWarehouse, warehouse)//原仓库 | ||
92 | + .eq(StringUtils.isNotEmpty(containerCode), InventoryDetail::getContainerCode, containerCode) //托盘号 | ||
93 | + .eq(StringUtils.isNotEmpty(receiptCode), InventoryDetail::getReceiptCode, receiptCode)//入库单号 | ||
94 | + .ne(isFlatWarehouse, InventoryDetail::getZoneCode, "L")//如果用平库组盘功能,只能出平库的库存 | ||
95 | + .orderByAsc(InventoryDetail::getCreated); // 添加根据创建时间生序排序 | ||
96 | + List<InventoryDetail> list = inventoryDetailService.list(wrapper); | ||
97 | + if (list.isEmpty()) { | ||
98 | + return list; | ||
99 | + } | ||
100 | + return list; | ||
101 | + } | ||
102 | + | ||
103 | + //二期和二厂 | ||
104 | + public List<InventoryDetail> getInventoryVersion2(ShipmentDetail shipmentDetail, boolean isAuto, boolean isFlatWarehouse, boolean openExhibitionRestrictions) { | ||
66 | String materialCode = shipmentDetail.getMaterialCode(); | 105 | String materialCode = shipmentDetail.getMaterialCode(); |
67 | checkNotEmpty(materialCode, "出库明细没有物料编码"); | 106 | checkNotEmpty(materialCode, "出库明细没有物料编码"); |
68 | 107 | ||
@@ -139,7 +178,6 @@ public class ShippingCombinationService { | @@ -139,7 +178,6 @@ public class ShippingCombinationService { | ||
139 | .thenComparing(InventoryDetail::getReceiptCode)); | 178 | .thenComparing(InventoryDetail::getReceiptCode)); |
140 | } | 179 | } |
141 | return list; | 180 | return list; |
142 | - | ||
143 | } | 181 | } |
144 | 182 | ||
145 | //判断是否是展会物料,仓库是否符合 | 183 | //判断是否是展会物料,仓库是否符合 |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
@@ -644,6 +644,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -644,6 +644,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
644 | 644 | ||
645 | @Transactional(rollbackFor = Exception.class) | 645 | @Transactional(rollbackFor = Exception.class) |
646 | public void combineInventory(TaskHeader task) { | 646 | public void combineInventory(TaskHeader task) { |
647 | + | ||
648 | + //一期项目,物料编码相同就合并 | ||
649 | + String version = configService.getKey(QuantityConstant.PROJECT_VERSION); | ||
650 | + boolean isVersionOne = version.equals("1"); | ||
651 | + | ||
647 | InventoryHeader inventoryHeader = inventoryHeaderService.getOne(new LambdaQueryWrapper<InventoryHeader>() | 652 | InventoryHeader inventoryHeader = inventoryHeaderService.getOne(new LambdaQueryWrapper<InventoryHeader>() |
648 | .eq(InventoryHeader::getLocationCode, task.getToLocation()) | 653 | .eq(InventoryHeader::getLocationCode, task.getToLocation()) |
649 | .eq(InventoryHeader::getContainerCode, task.getContainerCode())); | 654 | .eq(InventoryHeader::getContainerCode, task.getContainerCode())); |
@@ -654,15 +659,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -654,15 +659,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
654 | 659 | ||
655 | for (int i = 0; i < inventoryDetailList.size() - 1; i++) { | 660 | for (int i = 0; i < inventoryDetailList.size() - 1; i++) { |
656 | for (int j = inventoryDetailList.size() - 1; j > i; j--) { | 661 | for (int j = inventoryDetailList.size() - 1; j > i; j--) { |
657 | - InventoryDetail inventoryDetail = inventoryDetailList.get(i); | ||
658 | - InventoryDetail inventoryDetail2 = inventoryDetailList.get(j); | ||
659 | - if ( | ||
660 | - | ||
661 | - inventoryDetail.getMaterialCode().equals(inventoryDetail2.getMaterialCode()) | ||
662 | - && inventoryDetail.getNoticeCode().equals(inventoryDetail2.getNoticeCode()) | ||
663 | - && inventoryDetail.getMaterialColor().equals(inventoryDetail2.getMaterialColor()) | ||
664 | - && inventoryDetail.getRemarks().equals(inventoryDetail2.getRemarks()) | ||
665 | - && inventoryDetail.getPaintStatus().equals(inventoryDetail2.getPaintStatus())) { | 662 | + InventoryDetail detail1 = inventoryDetailList.get(i); |
663 | + InventoryDetail detail2 = inventoryDetailList.get(j); | ||
664 | + if (isVersionOne ? detail1.getMaterialCode().equals(detail2.getMaterialCode()) : | ||
665 | + detail1.getMaterialCode().equals(detail2.getMaterialCode()) && | ||
666 | + detail1.getNoticeCode().equals(detail2.getNoticeCode()) && | ||
667 | + detail1.getMaterialColor().equals(detail2.getMaterialColor()) && | ||
668 | + detail1.getRemarks().equals(detail2.getRemarks()) && | ||
669 | + detail1.getPaintStatus().equals(detail2.getPaintStatus())) { | ||
666 | 670 | ||
667 | 671 | ||
668 | //如果都相同的话,合并库存, | 672 | //如果都相同的话,合并库存, |