Commit e34edde1585d74281acfbc561852faa17204ef22
1 parent
b0071572
库存筛选排序,先按照入库日期排,然后排内外侧
Showing
6 changed files
with
22 additions
and
0 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java
... | ... | @@ -137,6 +137,9 @@ public class InventoryDetail implements Serializable { |
137 | 137 | /** 巷道 */ |
138 | 138 | @ApiModelProperty(value = "巷道") |
139 | 139 | private Integer roadWay; |
140 | + /** 内外侧 */ | |
141 | + @ApiModelProperty(value = "内外侧") | |
142 | + private Integer rowFlag; | |
140 | 143 | /** 备用字段1 */ |
141 | 144 | @Excel(name = "备用字段1", width = 15) |
142 | 145 | @ApiModelProperty(value = "备用字段1") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryHeader.java
... | ... | @@ -81,6 +81,9 @@ public class InventoryHeader implements Serializable { |
81 | 81 | /** 巷道 */ |
82 | 82 | @ApiModelProperty(value = "巷道") |
83 | 83 | private Integer roadWay; |
84 | + /** 内外侧 */ | |
85 | + @ApiModelProperty(value = "内外侧") | |
86 | + private Integer rowFlag; | |
84 | 87 | /** 备用字段1 */ |
85 | 88 | @Excel(name = "备用字段1", width = 15) |
86 | 89 | @ApiModelProperty(value = "备用字段1") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
... | ... | @@ -508,6 +508,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
508 | 508 | return Result.error("增加库存,没有找到库位" + locationCode); |
509 | 509 | } |
510 | 510 | Integer roadWay = location.getRoadWay(); |
511 | + Integer rowFlag = location.getRowFlag(); | |
511 | 512 | String zoneType = zone.getType(); |
512 | 513 | InventoryDetail inventoryDetail = new InventoryDetail(); |
513 | 514 | inventoryDetail.setInventoryHeaderId(inventoryHeader.getId()); |
... | ... | @@ -524,6 +525,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
524 | 525 | inventoryDetail.setMaterialUnit(material.getUnit()); |
525 | 526 | inventoryDetail.setQty(qty); |
526 | 527 | inventoryDetail.setRoadWay(roadWay); |
528 | + inventoryDetail.setRowFlag(rowFlag); | |
527 | 529 | inventoryDetail.setInventoryStatus(QuantityConstant.QUALITY_GOOD); |
528 | 530 | inventoryDetail.setReceiptDate(new Date()); |
529 | 531 | if (!inventoryDetailService.save(inventoryDetail)) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java
... | ... | @@ -490,6 +490,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
490 | 490 | } |
491 | 491 | |
492 | 492 | @Override |
493 | + @Transactional | |
493 | 494 | public boolean updateInventory(String containerCode, String locationCode, String warehouseCode) { |
494 | 495 | InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); |
495 | 496 | if (inventoryHeader == null) { |
... | ... | @@ -526,6 +527,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
526 | 527 | inventoryDetail1.setZoneCode(zoneCode); |
527 | 528 | inventoryDetail1.setZoneType(zoneType); |
528 | 529 | inventoryDetail1.setRoadWay(toLocation.getRoadWay()); |
530 | + inventoryDetail1.setRowFlag(toLocation.getRowFlag()); | |
529 | 531 | updateInventoryDetailList.add(inventoryDetail1); |
530 | 532 | } |
531 | 533 | success = inventoryDetailService.updateBatchById(updateInventoryDetailList); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/IShipmentCombinationService.java
... | ... | @@ -19,6 +19,8 @@ public interface IShipmentCombinationService { |
19 | 19 | |
20 | 20 | List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail); |
21 | 21 | |
22 | + List<InventoryDetail> groupInventorysByRowFlag(List<InventoryDetail> inventoryDetailList); | |
23 | + | |
22 | 24 | List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail, String containerCode); |
23 | 25 | |
24 | 26 | List<InventoryDetail> getAllInventorys(ShipmentDetail shipmentDetail); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -3,6 +3,7 @@ package org.jeecg.modules.wms.shipment.shipmentCombination.service.impl; |
3 | 3 | import java.math.BigDecimal; |
4 | 4 | import java.util.ArrayList; |
5 | 5 | import java.util.Collections; |
6 | +import java.util.Comparator; | |
6 | 7 | import java.util.List; |
7 | 8 | import java.util.stream.Collectors; |
8 | 9 | |
... | ... | @@ -174,10 +175,19 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
174 | 175 | } |
175 | 176 | inventoryDetailList = inventoryDetailList.stream().filter(t -> result.getResult().contains(t.getRoadWay())).collect(Collectors.toList()); |
176 | 177 | } |
178 | + | |
179 | + inventoryDetailList = groupInventorysByRowFlag(inventoryDetailList); | |
177 | 180 | return inventoryDetailList; |
178 | 181 | } |
179 | 182 | |
180 | 183 | @Override |
184 | + public List<InventoryDetail> groupInventorysByRowFlag(List<InventoryDetail> inventoryDetailList) { | |
185 | + List<InventoryDetail> inventoryDetails = inventoryDetailList.stream() | |
186 | + .sorted(Comparator.comparing(InventoryDetail::getReceiptDate).thenComparing(InventoryDetail::getRowFlag)).collect(Collectors.toList()); | |
187 | + return inventoryDetails; | |
188 | + } | |
189 | + | |
190 | + @Override | |
181 | 191 | public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail, String containerCode) { |
182 | 192 | String warehouseCode = shipmentDetail.getWarehouseCode(); |
183 | 193 | String companyCode = shipmentDetail.getCompanyCode(); |
... | ... |