src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -8,8 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.basic.mapper.ProductModelMapper; import com.ruoyi.basic.pojo.ProductModel; import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; import com.ruoyi.common.enums.StockInUnQualifiedRecordTypeEnum; import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; import com.ruoyi.framework.web.domain.R; import com.ruoyi.procurementrecord.utils.StockUtils; import com.ruoyi.production.dto.ProductStructureDto; @@ -44,7 +44,10 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; @@ -344,6 +347,7 @@ */ public void deleteProductionData(List<Long> productIds) { //批量查询productOrder if (productIds != null && !productIds.isEmpty()) { List<ProductOrder> productOrders = productOrderMapper.selectList( new LambdaQueryWrapper<ProductOrder>() .in(ProductOrder::getSaleLedgerProductId, productIds) @@ -431,6 +435,7 @@ .in(ProductOrder::getSaleLedgerProductId, productIds)); } } } @Override public IPage<SalesLedgerProductDto> listPage(Page page, SalesLedgerProductDto salesLedgerProduct) { src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
@@ -67,7 +67,7 @@ //扣减库存 if(!"已发货".equals(byId.getStatus())){ SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(byId.getSalesLedgerProductId()); stockUtils.substractStock(salesLedgerProduct.getProductModelId(), salesLedgerProduct.getQuantity(), stockUtils.substractStock(salesLedgerProduct.getProductModelId(), byId.getShippedQty(), StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode(), req.getId(),salesLedgerProduct.getBatchNo(),salesLedgerProduct.getCustomer() ); } src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -61,10 +61,10 @@ and sl.customer_name like concat('%',#{c.customerName},'%') </if> <if test="c.productCategory != null and c.productCategory != ''"> and slp.product_category like concat('%',#{c.productCategory},'%') and p.product_name like concat('%',#{c.productCategory},'%') </if> <if test="c.specificationModel != null and c.specificationModel != ''"> and slp.specification_model like concat('%',#{c.specificationModel},'%') and pm.model like concat('%',#{c.specificationModel},'%') </if> <if test="c.startTime != null and c.endTime != null"> and po.create_time between #{c.startTime} and #{c.endTime}