From da0e9fff7f8ba1bd163836240ebb9935fa5c25ef Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期二, 27 一月 2026 13:47:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New
---
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
index 52035d8..88fb41b 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -77,6 +77,7 @@
private ProductionProductInputMapper productionProductInputMapper;
private QualityInspectMapper qualityInspectMapper;
private ShippingInfoMapper shippingInfoMapper;
+ private ShippingInfoServiceImpl shippingInfoService;
private StockUtils stockUtils;
@@ -97,6 +98,18 @@
// .eq(SalesLedgerProduct::getType, salesLedgerProduct.getType());
List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductMapper.selectSalesLedgerProductList(salesLedgerProduct);
if(!CollectionUtils.isEmpty(salesLedgerProducts)){
+ salesLedgerProducts.forEach(item -> {
+ // 鍙戣揣淇℃伅
+ ShippingInfo shippingInfo = shippingInfoMapper.selectOne(new LambdaQueryWrapper<ShippingInfo>()
+ .eq(ShippingInfo::getSalesLedgerProductId, item.getId())
+ .orderByDesc(ShippingInfo::getCreateTime)
+ .last("limit 1"));
+ if(shippingInfo != null){
+ item.setShippingDate(shippingInfo.getShippingDate());
+ item.setShippingCarNumber(shippingInfo.getShippingCarNumber());
+ item.setShippingStatus(shippingInfo.getStatus());
+ }
+ });
// 寮�绁�
InvoiceRegistrationProductDto invoiceRegistrationProductDto = new InvoiceRegistrationProductDto();
invoiceRegistrationProductDto.setSalesLedgerId(salesLedgerProduct.getSalesLedgerId().intValue());
@@ -120,16 +133,7 @@
ledgerProduct.setInvoiceAmount(invoiceAmount);
ledgerProduct.setNoInvoiceNum(noInvoiceNum);
ledgerProduct.setNoInvoiceAmount(noInvoiceAmount);
- // 鍙戣揣淇℃伅
- ShippingInfo shippingInfo = shippingInfoMapper.selectOne(new LambdaQueryWrapper<ShippingInfo>()
- .eq(ShippingInfo::getSalesLedgerProductId, ledgerProduct.getId())
- .orderByDesc(ShippingInfo::getCreateTime)
- .last("limit 1"));
- if(shippingInfo != null){
- ledgerProduct.setShippingDate(shippingInfo.getShippingDate());
- ledgerProduct.setShippingCarNumber(shippingInfo.getShippingCarNumber());
- ledgerProduct.setShippingStatus(shippingInfo.getStatus());
- }
+
}
}
@@ -150,6 +154,12 @@
if (deletedProducts.isEmpty()) {
return 0; // 娌℃湁鍙垹闄ょ殑鏁版嵁
}
+ //鍒犻櫎鍙戣揣淇℃伅
+ List<ShippingInfo> shippingInfos = shippingInfoMapper.selectList(new LambdaQueryWrapper<ShippingInfo>()
+ .in(ShippingInfo::getSalesLedgerProductId, Arrays.asList(ids)));
+ if(!CollectionUtils.isEmpty(shippingInfos)){
+ shippingInfoService.delete(shippingInfos.stream().map(ShippingInfo::getId).collect(Collectors.toList()));
+ }
// 鍙兘灞炰簬澶氫釜涓昏〃
Set<Long> mainIds = deletedProducts.stream()
--
Gitblit v1.9.3