src/main/java/com/ruoyi/procurementrecord/dto/Details.java
@@ -16,4 +16,16 @@ //单价 private BigDecimal unitPrice; private BigDecimal totalPrice; /** * 每箱数量 */ private Integer boxNum; /** * 每箱规格 */ private String cartonSpecifications; /** * 美元每件 */ private BigDecimal dollarPrice; } src/main/java/com/ruoyi/procurementrecord/dto/ProcurementAddDto.java
@@ -2,6 +2,7 @@ import lombok.Data; import java.math.BigDecimal; import java.util.List; /** src/main/java/com/ruoyi/procurementrecord/dto/ProcurementPageDto.java
@@ -156,6 +156,22 @@ */ @Excel(name = "不含税总价") private BigDecimal taxExclusiveTotalPrice; /** * 每箱数量 */ @Excel(name = "每箱数量") private Integer boxNum; /** * 每箱规格 */ @Excel(name = "每箱规格") private String cartonSpecifications; /** * 美元每件 */ @Excel(name = "美元每件") private BigDecimal dollarPrice; /** * 报表日报 */ src/main/java/com/ruoyi/procurementrecord/dto/ProcurementPageDtoCopy.java
@@ -167,6 +167,22 @@ */ @Excel(name = "不含税总价") private BigDecimal taxExclusiveTotalPrice; /** * 每箱数量 */ @Excel(name = "每箱数量") private Integer boxNum; /** * 每箱规格 */ @Excel(name = "每箱规格") private String cartonSpecifications; /** * 美元每件 */ @Excel(name = "美元每件") private BigDecimal dollarPrice; /** * 报表日报 */ src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java
@@ -123,13 +123,16 @@ /** * 每箱数量 */ @Excel(name = "每箱数量") private Integer boxNum; /** * 每箱规格 */ @Excel(name = "每箱规格") private String cartonSpecifications; /** * 美元每件 */ @Excel(name = "美元每件") private BigDecimal dollarPrice; } src/main/java/com/ruoyi/procurementrecord/pojo/ProcurementRecordStorage.java
@@ -95,4 +95,17 @@ */ @TableField(fill = FieldFill.INSERT) private Long tenantId; /** * 每箱数量 */ private Integer boxNum; /** * 每箱规格 */ private String cartonSpecifications; /** * 美元每件 */ private BigDecimal dollarPrice; } src/main/java/com/ruoyi/procurementrecord/service/ProcurementRecordService.java
@@ -57,5 +57,5 @@ CustomStorage detailManagementByCustom(ProcurementManagementUpdateDto procurementDto); ProcurementRecordStorage detail(ProcurementUpdateDto procurementDto); ProcurementPageDto detail(ProcurementUpdateDto procurementDto); } src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -22,6 +22,7 @@ import com.ruoyi.sales.pojo.SalesLedgerProduct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -575,21 +576,6 @@ @Override public IPage<CustomStorage> listPageCopyByCustom(Page page, CustomStorage customStorage) { // LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); // customStorageLambdaQueryWrapper.groupBy(CustomStorage::getProductCategory, CustomStorage::getSpecificationModel,CustomStorage::getTaxInclusiveUnitPrice); // if(customStorage != null){ // if(!StringUtils.isEmpty(customStorage.getSupplierName())){ // customStorageLambdaQueryWrapper.like(CustomStorage::getSupplierName, customStorage.getSupplierName()); // } // // 筛选入库时间 // if(customStorage.getInboundDate() != null){ // customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getInboundDate()); // } // if(!StringUtils.isEmpty(customStorage.getProductCategory())){ // customStorageLambdaQueryWrapper.like(CustomStorage::getProductCategory, customStorage.getProductCategory()); // } // } // customStorageLambdaQueryWrapper.orderByDesc(CustomStorage::getInboundDate); IPage<CustomStorage> pageList = customStorageMapper.listPageCopyByCustom(page, customStorage); List<CustomStorage> procurementPageDtoCopyList = pageList.getRecords(); @@ -668,9 +654,20 @@ } @Override public ProcurementRecordStorage detail(ProcurementUpdateDto procurementDto) { if(procurementDto == null) return null; return procurementRecordMapper.selectById(procurementDto.getId()); public ProcurementPageDto detail(ProcurementUpdateDto procurementDto) { ProcurementPageDto procurementPageDto = new ProcurementPageDto(); if(procurementDto == null) return procurementPageDto; ProcurementRecordStorage procurementRecordStorage = procurementRecordMapper.selectById(procurementDto.getId()); if(procurementRecordStorage == null) return procurementPageDto; BeanUtils.copyProperties(procurementRecordStorage, procurementPageDto); SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(procurementRecordStorage.getSalesLedgerProductId()); if(salesLedgerProduct != null){ procurementPageDto.setProductCategory(salesLedgerProduct.getProductCategory()); procurementPageDto.setSpecificationModel(salesLedgerProduct.getSpecificationModel()); procurementPageDto.setUnit(salesLedgerProduct.getUnit()); procurementPageDto.setTaxInclusiveUnitPrice(salesLedgerProduct.getTaxInclusiveUnitPrice()); } return procurementPageDto; } @Override @@ -695,18 +692,12 @@ .createTime(LocalDateTime.now()) .createUser(loginUser.getUserId()) .updateTime(LocalDateTime.now()) .boxNum(detail.getBoxNum()) .cartonSpecifications(detail.getCartonSpecifications()) .dollarPrice(detail.getDollarPrice()) .updateUser(loginUser.getUserId()) .createBy(procurementDto.getNickName()); this.save(procurementRecordBuilder.build()); // 入库成功减掉采购数量 // LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); // salesLedgerProductLambdaQueryWrapper.eq(SalesLedgerProduct::getId, detail.getId()); // SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectOne(salesLedgerProductLambdaQueryWrapper); // if(salesLedgerProduct == null){ // throw new RuntimeException("未找到该商品"); // } // salesLedgerProduct.setQuantity(salesLedgerProduct.getQuantity().subtract(detail.getInboundQuantity())); // salesLedgerProductMapper.updateById(salesLedgerProduct); } return 1; } src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -50,7 +50,10 @@ t1.create_time, t1.update_time, t1.create_by, t2.warn_num t2.warn_num, t1.box_num, t1.carton_specifications, t1.dollar_price from procurement_record_storage t1 left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 left join purchase_ledger t3 on t3.id = t2.sales_ledger_id @@ -140,7 +143,10 @@ t1.create_time, t1.update_time, t1.create_by, t2.warn_num t2.warn_num, t1.box_num, t1.carton_specifications, t1.dollar_price from procurement_record_storage t1 left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 left join purchase_ledger t3 on t3.id = t2.sales_ledger_id @@ -195,7 +201,10 @@ t1.update_time, t1.create_time as cTime, t1.update_time as uTime, t1.create_by t1.create_by, t1.box_num, t1.carton_specifications, t1.dollar_price from procurement_record_storage t1 left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 left join purchase_ledger t3 on t3.id = t2.sales_ledger_id src/main/resources/mapper/procurementrecord/ProcurementRecordOutMapper.xml
@@ -19,7 +19,10 @@ t1.create_by, t2.warn_num, t4.unit_price, t4.unit_price * t1.inbound_num as totalPrice t4.unit_price * t1.inbound_num as totalPrice, t4.box_num, t4.carton_specifications, t4.dollar_price from procurement_record_out t1 left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 left join purchase_ledger t3 on t3.id = t2.sales_ledger_id @@ -52,11 +55,15 @@ t1.inbound_num, t1.create_time, t1.create_time as time, t1.create_by t1.create_by, t4.box_num, t4.carton_specifications, t4.dollar_price from procurement_record_out t1 left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id left join purchase_ledger t3 on t3.id = t2.sales_ledger_id where t1.type = 1 left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id where t1.type = 1 </select> <select id="listOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto">