Commit d0d57d0c5a17468499812c7bf44b8bb80c8a087a
1 parent
49d4bfe8
添加查询方法
Showing
4 changed files
with
43 additions
and
0 deletions
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java
@@ -49,6 +49,16 @@ public interface InventoryDetailService extends IService<InventoryDetail> { | @@ -49,6 +49,16 @@ public interface InventoryDetailService extends IService<InventoryDetail> { | ||
49 | */ | 49 | */ |
50 | List<InventoryDetail> expiringInventoryHandle(List<InventoryDetail> inventoryDetails,String expiring,String days); | 50 | List<InventoryDetail> expiringInventoryHandle(List<InventoryDetail> inventoryDetails,String expiring,String days); |
51 | 51 | ||
52 | + /** | ||
53 | + * 查询可用库存 通过入库单编码 | ||
54 | + * @param receiptCode | ||
55 | + * @param warehouseCode | ||
56 | + * @return | ||
57 | + */ | ||
58 | + InventoryDetail findGoodInventoryByReceiptCode(String materialCode,String receiptCode, String warehouseCode); | ||
59 | + | ||
60 | + InventoryDetail findGoodInventoryByReceiptCode(String materialCode,String receiptCode); | ||
61 | + | ||
52 | } | 62 | } |
53 | 63 | ||
54 | 64 |
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
@@ -314,6 +314,21 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -314,6 +314,21 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
314 | } | 314 | } |
315 | return returnInventory; | 315 | return returnInventory; |
316 | } | 316 | } |
317 | + | ||
318 | + @Override | ||
319 | + public InventoryDetail findGoodInventoryByReceiptCode(String materialCode,String receiptCode, String warehouseCode) { | ||
320 | + LambdaQueryWrapper<InventoryDetail> query = Wrappers.lambdaQuery(); | ||
321 | + query.eq(InventoryDetail::getReceiptCode,receiptCode) | ||
322 | + .eq(InventoryDetail::getWarehouseCode,warehouseCode) | ||
323 | + .eq(InventoryDetail::getMaterialCode,materialCode) | ||
324 | + .eq(InventoryDetail::getTaskQty,BigDecimal.ZERO) | ||
325 | + .last("LIMIT 1"); | ||
326 | + return this.getOne(query); | ||
327 | + } | ||
328 | + @Override | ||
329 | + public InventoryDetail findGoodInventoryByReceiptCode(String materialCode,String receiptCode) { | ||
330 | + return findGoodInventoryByReceiptCode(receiptCode,ShiroUtils.getWarehouseCode()); | ||
331 | + } | ||
317 | } | 332 | } |
318 | 333 | ||
319 | 334 |
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/service/ShipmentContainerDetailService.java
@@ -16,4 +16,8 @@ public interface ShipmentContainerDetailService extends IService<ShipmentContain | @@ -16,4 +16,8 @@ public interface ShipmentContainerDetailService extends IService<ShipmentContain | ||
16 | * @return | 16 | * @return |
17 | */ | 17 | */ |
18 | List<ShipmentContainerDetail> selectByShippingContainerId(Integer shippingContainerId); | 18 | List<ShipmentContainerDetail> selectByShippingContainerId(Integer shippingContainerId); |
19 | + | ||
20 | + List<ShipmentContainerDetail> findByShipmentCode(String shipmentCode); | ||
21 | + | ||
22 | + List<ShipmentContainerDetail> findByShipmentCode(String shipmentCode,String warehouseCode); | ||
19 | } | 23 | } |
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/service/ShipmentContainerDetailServiceImpl.java
@@ -2,6 +2,7 @@ package com.huaheng.pc.shipment.shipmentContainerDetail.service; | @@ -2,6 +2,7 @@ package com.huaheng.pc.shipment.shipmentContainerDetail.service; | ||
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.utils.security.ShiroUtils; | ||
5 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
6 | import javax.annotation.Resource; | 7 | import javax.annotation.Resource; |
7 | import java.util.List; | 8 | import java.util.List; |
@@ -32,4 +33,17 @@ public class ShipmentContainerDetailServiceImpl extends ServiceImpl<ShipmentCont | @@ -32,4 +33,17 @@ public class ShipmentContainerDetailServiceImpl extends ServiceImpl<ShipmentCont | ||
32 | lambdaQueryWrapper.eq(ShipmentContainerDetail::getShippingContainerId, shippingContainerId); | 33 | lambdaQueryWrapper.eq(ShipmentContainerDetail::getShippingContainerId, shippingContainerId); |
33 | return list(lambdaQueryWrapper); | 34 | return list(lambdaQueryWrapper); |
34 | } | 35 | } |
36 | + | ||
37 | + @Override | ||
38 | + public List<ShipmentContainerDetail> findByShipmentCode(String shipmentCode) { | ||
39 | + return findByShipmentCode(shipmentCode, ShiroUtils.getWarehouseCode()); | ||
40 | + } | ||
41 | + | ||
42 | + @Override | ||
43 | + public List<ShipmentContainerDetail> findByShipmentCode(String shipmentCode, String warehouseCode) { | ||
44 | + LambdaQueryWrapper<ShipmentContainerDetail> query = Wrappers.lambdaQuery(); | ||
45 | + query.eq(ShipmentContainerDetail::getShipmentCode,shipmentCode) | ||
46 | + .eq(ShipmentContainerDetail::getWarehouseCode,warehouseCode); | ||
47 | + return this.list(query); | ||
48 | + } | ||
35 | } | 49 | } |