maven
2025-11-10 65d2410369591a9128acd4832b362e673772f409
yys  优化仓储物流整体逻辑
已添加3个文件
已修改16个文件
681 ■■■■■ 文件已修改
src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/dto/ProcurementAddDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/dto/ProcurementPageDto.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/dto/ProcurementPageDtoCopy.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/mapper/CustomStorageMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/mapper/ProcurementRecordMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/pojo/ProcurementRecordOut.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/pojo/ProcurementRecordStorage.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/service/ProcurementRecordService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-native.yml 219 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/SalesLedgerWorkMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/controller/ProcurementRecordController.java
@@ -7,6 +7,7 @@
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.procurementrecord.dto.*;
import com.ruoyi.procurementrecord.pojo.CustomStorage;
import com.ruoyi.procurementrecord.service.ProcurementRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -33,7 +34,7 @@
    @GetMapping("/productlist")
    @Log(title = "采购入库-入库管理-新增入库查询", businessType = BusinessType.OTHER)
    public AjaxResult list(ProcurementDto procurementDto) {
        List<ProcurementDto> result =procurementRecordService.listProcurementBySalesLedgerId(procurementDto);
        List<ProcurementDto> result = procurementRecordService.listProcurementBySalesLedgerId(procurementDto);
        return AjaxResult.success(result);
    }
@@ -44,6 +45,13 @@
        procurementDto.setType(1);
        procurementDto.setTypeName("采购入库");
        return AjaxResult.success(procurementRecordService.add(procurementDto));
    }
    @PostMapping("/addCustom")
    @Log(title = "自定义入库-入库管理-新增入库", businessType = BusinessType.INSERT)
    @Transactional
    public AjaxResult addCustom(@RequestBody List<CustomStorage> customStorage) {
        return procurementRecordService.addCustom(customStorage);
    }
    @PostMapping("/update")
@@ -71,16 +79,47 @@
    @Log(title = "采购入库-入库管理-入库查询", businessType = BusinessType.OTHER)
    @ApiOperation(value = "入库查询")
    public AjaxResult listPage(Page page, ProcurementPageDto procurementDto) {
        IPage<ProcurementPageDto> result =procurementRecordService.listPage(page, procurementDto);
        IPage<ProcurementPageDto> result = procurementRecordService.listPage(page, procurementDto);
        return AjaxResult.success(result);
    }
    @GetMapping("/listPageByProduction")
    @Log(title = "生产入库-入库管理-入库查询", businessType = BusinessType.OTHER)
    @ApiOperation(value = "入库查询")
    public AjaxResult listPageByProduction(Page page, ProcurementPageDto procurementDto) {
        IPage<ProcurementPageDto> result = procurementRecordService.listPageByProduction(page, procurementDto);
        return AjaxResult.success(result);
    }
    @GetMapping("/listPageByCustom")
    @Log(title = "自定义入库-入库管理-入库查询", businessType = BusinessType.OTHER)
    @ApiOperation(value = "入库查询")
    public AjaxResult listPageByCustom(Page page, CustomStorage customStorage) {
        IPage<CustomStorage> result = procurementRecordService.listPageByCustom(page, customStorage);
        return AjaxResult.success(result);
    }
    @GetMapping("/listPageCopy")
    @Log(title = "采购入库-入库管理-入库查询", businessType = BusinessType.OTHER)
    @Log(title = "采购入库-库存管理-分页查询", businessType = BusinessType.OTHER)
    public AjaxResult listPageCopy(Page page, ProcurementPageDto procurementDto) {
        IPage<ProcurementPageDtoCopy> result =procurementRecordService.listPageCopy(page, procurementDto);
        IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopy(page, procurementDto);
        return AjaxResult.success(result);
    }
    @GetMapping("/listPageCopyByProduction")
    @Log(title = "生产入库-库存管理-分页查询", businessType = BusinessType.OTHER)
    public AjaxResult listPageCopyByProduction(Page page, ProcurementPageDto procurementDto) {
        IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(page, procurementDto);
        return AjaxResult.success(result);
    }
    @GetMapping("/listPageCopyByCustom")
    @Log(title = "自定义入库-库存管理-分页查询", businessType = BusinessType.OTHER)
    public AjaxResult listPageCopyByCustom(Page page, CustomStorage customStorage) {
        IPage<CustomStorage> result = procurementRecordService.listPageCopyByCustom(page, customStorage);
        return AjaxResult.success(result);
    }
    @GetMapping("/getReportList")
    @Log(title = "库存报表查询", businessType = BusinessType.OTHER)
    public AjaxResult getReportList(Page page, ProcurementPageDto procurementDto) {
src/main/java/com/ruoyi/procurementrecord/dto/ProcurementAddDto.java
@@ -16,7 +16,7 @@
    private String nickName;
    /**
     * å…¥åº“类型 1-采购 2-生产
     * å…¥åº“类型 1-采购 2-生产 3-自定义
     */
    private Integer type;
src/main/java/com/ruoyi/procurementrecord/dto/ProcurementPageDto.java
@@ -33,10 +33,25 @@
    private String inboundBatches;
    /**
     * åˆåŒå·
     * é‡‡è´­åˆåŒå·
     */
    private String purchaseContractNumber;
    /**
     * é”€å”®åˆåŒå·
     */
    private String salesContractNo;
    /**
     * å®¢æˆ·åˆåŒå·
     */
    private String customerContractNo;
    /**
     * å®¢æˆ·åç§°
     */
    private String customerName;
    private String salesLedgerProductId;
    /**
src/main/java/com/ruoyi/procurementrecord/dto/ProcurementPageDtoCopy.java
@@ -32,6 +32,22 @@
     */
    private String purchaseContractNumber;
    /**
     * é”€å”®åˆåŒå·
     */
    private String salesContractNo;
    /**
     * å®¢æˆ·åˆåŒå·
     */
    private String customerContractNo;
    /**
     * å®¢æˆ·åç§°
     */
    private String customerName;
    private String salesLedgerProductId;
    /**
src/main/java/com/ruoyi/procurementrecord/mapper/CustomStorageMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package com.ruoyi.procurementrecord.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.procurementrecord.pojo.CustomStorage;
/**
 * @author :yys
 * @date : 2025/11/10 13:11
 */
public interface CustomStorageMapper extends BaseMapper<CustomStorage> {
}
src/main/java/com/ruoyi/procurementrecord/mapper/ProcurementRecordMapper.java
@@ -31,4 +31,8 @@
    List<ProcurementPageDtoCopy> listCopy();
    List<ProcurementPageDto> list();
    IPage<ProcurementPageDto> listPageByProduction(Page page, @Param("req") ProcurementPageDto procurementDto);
    IPage<ProcurementPageDtoCopy> listPageCopyByProduction(Page page, @Param("req") ProcurementPageDto procurementDto);
}
src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,89 @@
package com.ruoyi.procurementrecord.pojo;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
 * @author :yys
 * @date : 2025/11/10 11:51
 */
@TableName("custom_storage")
@Data
public class CustomStorage {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    // å…¥åº“æ—¶é—´
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inboundDate;
    // ç‰©å“ç±»åž‹
    private String itemType;
    // å…¥åº“批次
    private String inboundBatches;
    // å…¥åº“数量
    private BigDecimal inboundNum;
    // ä¾›åº”商名称
    private String supplierName;
    // äº§å“å¤§ç±»
    private String productCategory;
    // è§„格型号
    private String specificationModel;
    // å•位
    private String unit;
    // å«ç¨Žå•ä»·
    private BigDecimal taxInclusiveUnitPrice;
    // å«ç¨Žæ€»ä»·
    private BigDecimal taxInclusiveTotalPrice;
    // ç¨Žçއ(%)
    private BigDecimal taxRate;
    // ä¸å«ç¨Žæ€»ä»·
    private BigDecimal taxExclusiveTotalPrice;
    /**
     * å‡ºå‡ºåº“用户
     */
    private String createBy;
    /**
     * å…¥åº“用户id
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    /**
     * å…¥åº“æ—¶é—´
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * ä¿®æ”¹è€…
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    /**
     * ä¿®æ”¹æ—¶é—´
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * ç§Ÿæˆ·ID
     */
    @TableField(fill = FieldFill.INSERT)
    private Long tenantId;
}
src/main/java/com/ruoyi/procurementrecord/pojo/ProcurementRecordOut.java
@@ -54,21 +54,25 @@
    /**
     * å…¥åº“用户id
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    /**
     * å…¥åº“æ—¶é—´
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    /**
     * ä¿®æ”¹è€…
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    /**
     * ä¿®æ”¹æ—¶é—´
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    /**
src/main/java/com/ruoyi/procurementrecord/pojo/ProcurementRecordStorage.java
@@ -59,21 +59,25 @@
    /**
     * å…¥åº“用户id
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    /**
     * å…¥åº“æ—¶é—´
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    /**
     * ä¿®æ”¹è€…
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    /**
     * ä¿®æ”¹æ—¶é—´
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    /**
src/main/java/com/ruoyi/procurementrecord/service/ProcurementRecordService.java
@@ -3,7 +3,9 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.procurementrecord.dto.*;
import com.ruoyi.procurementrecord.pojo.CustomStorage;
import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage;
import javax.servlet.http.HttpServletResponse;
@@ -34,4 +36,14 @@
    void exportCopy(HttpServletResponse response);
    Map<String, Object> getReportList(Page page, ProcurementPageDto procurementDto);
    IPage<ProcurementPageDto> listPageByProduction(Page page, ProcurementPageDto procurementDto);
    AjaxResult addCustom(List<CustomStorage> customStorage);
    IPage<CustomStorage> listPageByCustom(Page page, CustomStorage customStorage);
    IPage<ProcurementPageDtoCopy> listPageCopyByProduction(Page page, ProcurementPageDto procurementDto);
    IPage<CustomStorage> listPageCopyByCustom(Page page, CustomStorage customStorage);
}
src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -7,9 +7,12 @@
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.procurementrecord.dto.*;
import com.ruoyi.procurementrecord.mapper.CustomStorageMapper;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper;
import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper;
import com.ruoyi.procurementrecord.pojo.CustomStorage;
import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage;
import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut;
import com.ruoyi.procurementrecord.service.ProcurementRecordService;
@@ -21,6 +24,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
@@ -336,6 +340,134 @@
    }
    @Override
    public IPage<ProcurementPageDto> listPageByProduction(Page page, ProcurementPageDto procurementDto) {
        IPage<ProcurementPageDto> procurementPageDtoIPage = procurementRecordMapper.listPageByProduction(page, procurementDto);
        List<ProcurementPageDto> procurementPageDtos = procurementPageDtoIPage.getRecords();
        // è®¡ç®—待入库数量
        // æŸ¥è¯¢é‡‡è´­è®°å½•已入库数量
        List<Integer> collect = procurementPageDtos.stream().map(ProcurementPageDto::getId).collect(Collectors.toList());
        if(CollectionUtils.isEmpty( collect)){
            return procurementPageDtoIPage;
        }
        LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
        procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect);
        List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper);
        if(CollectionUtils.isEmpty( procurementRecords)){
            return procurementPageDtoIPage;
        }
        for (ProcurementPageDto dto : procurementPageDtos) {
            // æ ¹æ®é‡‡è´­å°è´¦ID筛选对应的出库记录
            List<ProcurementRecordOut> collect1 = procurementRecords.stream()
                    .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId()))
                    .collect(Collectors.toList());
            // å¦‚果没有相关的出库记录,跳过该条数据
            if(CollectionUtils.isEmpty(collect1)){
                dto.setInboundNum0(dto.getInboundNum());
                continue;
            }
            // è®¡ç®—已出库数量总和,并设置待出库数量
            BigDecimal totalInboundNum = collect1.stream()
                    .map(ProcurementRecordOut::getInboundNum)
                    .reduce(BigDecimal.ZERO, BigDecimal::add);
            // å¾…出库数量 = æ€»æ•°é‡ - å·²å‡ºåº“数量
            dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum));
        }
        return procurementPageDtoIPage;
    }
    private final CustomStorageMapper customStorageMapper;
    @Override
    public AjaxResult addCustom(List<CustomStorage> customStorage) {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        if(CollectionUtils.isEmpty(customStorage)){
            return AjaxResult.error("数据不能为空");
        }
        customStorage.forEach(item -> {
            // æŸ¥è¯¢é‡‡è´­å…¥åº“数量
            Long aLong = customStorageMapper.selectCount(null);
            item.setInboundBatches(aLong.equals(0L) ? "第1批次(自定义入库)" : "第"+ (aLong + 1) + "批次(自定义入库)" );
            item.setCreateBy(loginUser.getNickName());
            customStorageMapper.insert(item);
        });
        return AjaxResult.success("自定义入库成功");
    }
    @Override
    public IPage<CustomStorage> listPageByCustom(Page page, CustomStorage customStorage) {
        LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>();
        if(customStorage != null){
            if(!StringUtils.isEmpty(customStorage.getSupplierName())){
                customStorageLambdaQueryWrapper.like(CustomStorage::getSupplierName, customStorage.getSupplierName());
            }
            // ç­›é€‰å…¥åº“æ—¶é—´
            if(customStorage.getInboundDate() != null){
                customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getInboundDate());
            }
        }
        return customStorageMapper.selectPage(page, customStorageLambdaQueryWrapper);
    }
    @Override
    public IPage<ProcurementPageDtoCopy> listPageCopyByProduction(Page page, ProcurementPageDto procurementDto) {
        IPage<ProcurementPageDtoCopy> procurementPageDtoCopyIPage = procurementRecordMapper.listPageCopyByProduction(page, procurementDto);
        List<ProcurementPageDtoCopy> procurementPageDtoCopyList = procurementPageDtoCopyIPage.getRecords();
        // è®¡ç®—待入库数量
        // æŸ¥è¯¢é‡‡è´­è®°å½•已入库数量
        List<Integer> collect = procurementPageDtoCopyList.stream().map(ProcurementPageDtoCopy::getId).collect(Collectors.toList());
        if(CollectionUtils.isEmpty( collect)){
            return procurementPageDtoCopyIPage;
        }
        LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
        procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect);
        List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper);
        if(CollectionUtils.isEmpty( procurementRecords)){
            return procurementPageDtoCopyIPage;
        }
        for (ProcurementPageDtoCopy dto : procurementPageDtoCopyList) {
            // æ ¹æ®é‡‡è´­å°è´¦ID筛选对应的出库记录
            List<ProcurementRecordOut> collect1 = procurementRecords.stream()
                    .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId()))
                    .collect(Collectors.toList());
            // å¦‚果没有相关的出库记录,跳过该条数据
            if(CollectionUtils.isEmpty(collect1)){
                dto.setInboundNum0(dto.getInboundNum());
                continue;
            }
            // è®¡ç®—已出库数量总和,并设置待出库数量
            BigDecimal totalInboundNum = collect1.stream()
                    .map(ProcurementRecordOut::getInboundNum)
                    .reduce(BigDecimal.ZERO, BigDecimal::add);
            // å‡ºåº“数量 = æ€»æ•°é‡ - å¾…出库数量
            dto.setTotalInboundNum(totalInboundNum);
            // å¾…出库数量 = æ€»æ•°é‡ - å·²å‡ºåº“数量
            dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum));
        }
        return procurementPageDtoCopyIPage;
    }
    @Override
    public IPage<CustomStorage> listPageCopyByCustom(Page page, CustomStorage customStorage) {
        LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>();
        customStorageLambdaQueryWrapper.groupBy(CustomStorage::getSupplierName, CustomStorage::getProductCategory, CustomStorage::getSpecificationModel);
        if(customStorage != null){
            if(!StringUtils.isEmpty(customStorage.getSupplierName())){
                customStorageLambdaQueryWrapper.like(CustomStorage::getSupplierName, customStorage.getSupplierName());
            }
            // ç­›é€‰å…¥åº“æ—¶é—´
            if(customStorage.getInboundDate() != null){
                customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getInboundDate());
            }
        }
        return customStorageMapper.selectPage(page, customStorageLambdaQueryWrapper);
    }
    @Override
    public int add(ProcurementAddDto procurementDto) {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        // æ‰¹é‡æ–°å¢ž
src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java
@@ -66,5 +66,11 @@
    @ApiModelProperty(value = "口味分类")
    private String type;
    /**
     * é¢†ç”¨
     */
    @ApiModelProperty(value = "领用")
    private String receive;
}
src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
@@ -107,5 +107,12 @@
    @Excel(name = "口味分类")
    private String type;
    /**
     * é¢†ç”¨
     */
    @ApiModelProperty(value = "领用")
    @Excel(name = "领用")
    private String receive;
}
src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
@@ -93,6 +93,11 @@
    private String type;
    /**
     * é¢†ç”¨
     */
    private String receive;
    /**
     * åˆ›å»ºè€…
     */
    @TableField(fill = FieldFill.INSERT)
src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
@@ -171,6 +171,7 @@
                    .remark(processSchedulingDto.getRemark())
                    .type(processSchedulingDto.getType())
                    .loss(processSchedulingDto.getLoss())
                    .receive(processSchedulingDto.getReceive())
                    .salesLedgerProductId(salesLedgerScheduling.getSalesLedgerProductId())
                    .schedulingUserId(salesLedgerScheduling.getSchedulingUserId())
                    .schedulingUserName(sysUser.getNickName())
src/main/resources/application-native.yml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,219 @@
# é¡¹ç›®ç›¸å…³é…ç½®
ruoyi:
  # åç§°
  name: RuoYi
  # ç‰ˆæœ¬
  version: 3.8.9
  # ç‰ˆæƒå¹´ä»½
  copyrightYear: 2025
  # æ–‡ä»¶è·¯å¾„ ç¤ºä¾‹ï¼ˆ Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
  profile: /javaWork/product-inventory-management/file
  # èŽ·å–ip地址开关
  addressEnabled: false
  # éªŒè¯ç ç±»åž‹ math æ•°å­—计算 char å­—符验证
  captchaType: math
# å¼€å‘环境配置
server:
  # æœåŠ¡å™¨çš„HTTP端口,默认为8080
  port: 8080
  servlet:
    # åº”用的访问路径
    context-path: /
  tomcat:
    # tomcat的URI编码
    uri-encoding: UTF-8
    # è¿žæŽ¥æ•°æ»¡åŽçš„æŽ’队数,默认为100
    accept-count: 1000
    threads:
      # tomcat最大线程数,默认为200
      max: 800
      # Tomcat启动初始化的线程数,默认值10
      min-spare: 100
# æ—¥å¿—配置
logging:
  level:
    com.ruoyi: warn
    org.springframework: warn
minio:
  endpoint: http://114.132.189.42/
  port: 7019
  secure: false
  accessKey: admin
  secretKey: 12345678
  preview-expiry: 24 # é¢„览地址默认24小时
  default-bucket: demo-product
# ç”¨æˆ·é…ç½®
user:
  password:
    # å¯†ç æœ€å¤§é”™è¯¯æ¬¡æ•°
    maxRetryCount: 5
    # å¯†ç é”å®šæ—¶é—´ï¼ˆé»˜è®¤10分钟)
    lockTime: 10
# Spring配置
spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    druid:
      # ä¸»åº“数据源
      master:
        url: jdbc:mysql://localhost:3306/product-inventory-management?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: root
        password: 123456
      # ä»Žåº“数据源
      slave:
        # ä»Žæ•°æ®æºå¼€å…³/默认关闭
        enabled: false
        url:
        username:
        password:
      # åˆå§‹è¿žæŽ¥æ•°
      initialSize: 5
      # æœ€å°è¿žæŽ¥æ± æ•°é‡
      minIdle: 10
      # æœ€å¤§è¿žæŽ¥æ± æ•°é‡
      maxActive: 20
      # é…ç½®èŽ·å–è¿žæŽ¥ç­‰å¾…è¶…æ—¶çš„æ—¶é—´
      maxWait: 60000
      # é…ç½®è¿žæŽ¥è¶…æ—¶æ—¶é—´
      connectTimeout: 30000
      # é…ç½®ç½‘络超时时间
      socketTimeout: 60000
      # é…ç½®é—´éš”多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
      timeBetweenEvictionRunsMillis: 60000
      # é…ç½®ä¸€ä¸ªè¿žæŽ¥åœ¨æ± ä¸­æœ€å°ç”Ÿå­˜çš„æ—¶é—´ï¼Œå•位是毫秒
      minEvictableIdleTimeMillis: 300000
      # é…ç½®ä¸€ä¸ªè¿žæŽ¥åœ¨æ± ä¸­æœ€å¤§ç”Ÿå­˜çš„æ—¶é—´ï¼Œå•位是毫秒
      maxEvictableIdleTimeMillis: 900000
      # é…ç½®æ£€æµ‹è¿žæŽ¥æ˜¯å¦æœ‰æ•ˆ
      validationQuery: SELECT 1 FROM DUAL
      testWhileIdle: true
      testOnBorrow: false
      testOnReturn: false
      webStatFilter:
        enabled: true
      statViewServlet:
        enabled: true
        # è®¾ç½®ç™½åå•,不填则允许所有访问
        allow:
        url-pattern: /druid/*
        # æŽ§åˆ¶å°ç®¡ç†ç”¨æˆ·åå’Œå¯†ç 
        login-username: ruoyi
        login-password: 123456
      filter:
        stat:
          enabled: true
          # æ…¢SQL记录
          log-slow-sql: true
          slow-sql-millis: 1000
          merge-sql: true
        wall:
          config:
            multi-statement-allow: true
  # èµ„源信息
  messages:
    # å›½é™…化资源文件路径
    basename: i18n/messages
  # æ–‡ä»¶ä¸Šä¼ 
  servlet:
    multipart:
      # å•个文件大小
      max-file-size: 1GB
      # è®¾ç½®æ€»ä¸Šä¼ çš„æ–‡ä»¶å¤§å°
      max-request-size: 2GB
  # æœåŠ¡æ¨¡å—
  devtools:
    restart:
      # çƒ­éƒ¨ç½²å¼€å…³
      enabled: false
  # redis é…ç½®
  redis:
    # åœ°å€
#    host: 127.0.0.1
    host: 192.168.1.185
    # ç«¯å£ï¼Œé»˜è®¤ä¸º6379
    port: 6379
    # æ•°æ®åº“索引
    database: 0
    # å¯†ç 
#    password: root2022!
    password:
    # è¿žæŽ¥è¶…æ—¶æ—¶é—´
    timeout: 10s
    lettuce:
      pool:
        # è¿žæŽ¥æ± ä¸­çš„æœ€å°ç©ºé—²è¿žæŽ¥
        min-idle: 0
        # è¿žæŽ¥æ± ä¸­çš„æœ€å¤§ç©ºé—²è¿žæŽ¥
        max-idle: 8
        # è¿žæŽ¥æ± çš„æœ€å¤§æ•°æ®åº“连接数
        max-active: 8
        # #连接池最大阻塞等待时间(使用负值表示没有限制)
        max-wait: -1ms
# token配置
token:
  # ä»¤ç‰Œè‡ªå®šä¹‰æ ‡è¯†
  header: Authorization
  # ä»¤ç‰Œå¯†é’¥
  secret: abcdefghijklmnopqrstuvwxyz
  # ä»¤ç‰Œæœ‰æ•ˆæœŸï¼ˆé»˜è®¤30分钟)
  expireTime: 450
# MyBatis Plus配置
mybatis-plus:
  # æœç´¢æŒ‡å®šåŒ…别名   æ ¹æ®è‡ªå·±çš„项目来
  typeAliasesPackage: com.ruoyi.**.pojo
  # é…ç½®mapper的扫描,找到所有的mapper.xml映射文件
  mapperLocations: classpath*:mapper/**/*Mapper.xml
  # åŠ è½½å…¨å±€çš„é…ç½®æ–‡ä»¶
  configLocation: classpath:mybatis/mybatis-config.xml
  global-config:
    enable-sql-runner: true
    db-config:
      id-type: auto
# PageHelper分页插件
pagehelper:
  helperDialect: mysql
  supportMethodsArguments: true
  params: count=countSql
# Swagger配置
swagger:
  # æ˜¯å¦å¼€å¯swagger
  enabled: true
  # è¯·æ±‚前缀
  pathMapping: /dev-api
# é˜²æ­¢XSS攻击
xss:
  # è¿‡æ»¤å¼€å…³
  enabled: true
  # æŽ’除链接(多个用逗号分隔)
  excludes: /system/notice
  # åŒ¹é…é“¾æŽ¥
  urlPatterns: /system/*,/monitor/*,/tool/*
# ä»£ç ç”Ÿæˆ
gen:
  # ä½œè€…
  author: ruoyi
  # é»˜è®¤ç”ŸæˆåŒ…路径 system éœ€æ”¹æˆè‡ªå·±çš„æ¨¡å—名称 å¦‚ system monitor tool
  packageName: com.ruoyi.project.system
  # è‡ªåŠ¨åŽ»é™¤è¡¨å‰ç¼€ï¼Œé»˜è®¤æ˜¯true
  autoRemovePre: false
  # è¡¨å‰ç¼€ï¼ˆç”Ÿæˆç±»åä¸ä¼šåŒ…含表前缀,多个用逗号分隔)
  tablePrefix: sys_
  # æ˜¯å¦å…è®¸ç”Ÿæˆæ–‡ä»¶è¦†ç›–到本地(自定义路径),默认不允许
  allowOverwrite: false
file:
  temp-dir: /javaWork/product-inventory-management/file/temp/uploads
  upload-dir: /javaWork/product-inventory-management/file/prod/uploads
src/main/resources/application.yml
@@ -1,4 +1,4 @@
# Spring配置
spring:
  profiles:
    active: hckx
    active: native
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -50,15 +50,12 @@
        t1.create_by,
        t2.warn_num
        from  procurement_record_storage t1
                  left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id
                  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
        <where>
            1 = 1
            t1.type = 1
            <if test="req.supplierName != null and req.supplierName != ''">
                and t3.supplier_name like  concat('%',#{req.supplierName},'%')
            </if>
            <if test="req.type != null and req.type != ''">
                and t1.type = #{req.type}
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
@@ -112,15 +109,12 @@
        t1.create_by,
        t2.warn_num
        from  procurement_record_storage t1
        left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id
        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
        <where>
            1 = 1
            t1.type = 1
            <if test="req.supplierName != null and req.supplierName != ''">
                and t3.supplier_name like  concat('%',#{req.supplierName},'%')
            </if>
            <if test="req.type != null and req.type != ''">
                and t1.type = #{req.type}
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
@@ -169,4 +163,92 @@
                  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
    </select>
    <select id="listPageByProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto">
        select
        t3.customer_contract_no,
        t3.sales_contract_no,
        t3.customer_name,
        t2.product_category,
        t1.id,
        t1.sales_ledger_product_id,
        t1.create_user,
        t2.specification_model,
        t2.unit,
        t2.tax_rate,
        t2.tax_inclusive_unit_price,
        (t1.inbound_num * t2.tax_inclusive_unit_price) as taxInclusiveTotalPrice,
        (t1.inbound_num * t2.tax_inclusive_unit_price - t1.inbound_num * t2.tax_inclusive_unit_price * t2.tax_rate / 100) as taxExclusiveTotalPrice,
        t1.inbound_batches,
        t1.inbound_num,
        t1.inbound_num as inboundNum0,
        t1.create_time,
        t1.update_time,
        t1.create_by,
        t2.warn_num
        from  procurement_record_storage t1
        left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1
        left join sales_ledger t3 on t3.id = t2.sales_ledger_id
        <where>
            t1.type = 2
            <if test="req.customerName != null and req.customerName != ''">
                and t3.customer_name like  concat('%',#{req.customerName},'%')
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
            </if>
        </where>
    </select>
    <select id="listPageCopyByProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy">
        select
        t3.customer_contract_no,
        t3.sales_contract_no,
        t3.customer_name,
        t2.product_category,
        t1.id,
        t1.sales_ledger_product_id,
        t1.create_user,
        t2.specification_model,
        t2.unit,
        t2.min_stock,
        t2.tax_rate,
        t2.tax_inclusive_unit_price,
        t2.tax_inclusive_total_price,
        t2.tax_exclusive_total_price,
        t1.inbound_batches,
        sum(t1.inbound_num) as inboundNum,
        sum(t1.inbound_num) as inboundNum0,
        t1.inbound_num as totalInboundNum,
        t1.create_time,
        t1.update_time,
        t1.create_by,
        t2.warn_num
        from  procurement_record_storage t1
        left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1
        left join sales_ledger t3 on t3.id = t2.sales_ledger_id
        <where>
            t1.type = 2
            <if test="req.customerName != null and req.customerName != ''">
                and t3.customer_name like  concat('%',#{req.customerName},'%')
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
            </if>
            <if test="req.reportDate != null">
                and t1.create_time >= #{req.reportDate} and t1.create_time &lt; DATE_ADD(#{req.reportDate}, INTERVAL 1 DAY)
            </if>
            <if test="req.startMonth != null">
                and t1.create_time >= #{req.startMonth}
            </if>
            <if test="req.endMonth != null">
                and t1.create_time &lt;= #{req.endMonth}
            </if>
            <if test="req.startDate != null">
                and t1.create_time >= #{req.startDate}
            </if>
            <if test="req.endDate != null">
                and t1.create_time &lt;= #{req.endDate}
            </if>
        </where>
        group by t3.customer_name,t2.product_category,t2.specification_model
    </select>
</mapper>
src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
@@ -16,6 +16,7 @@
        t4.loss,
        t4.type,
        t4.remark,
        t4.receive,
        T1.sales_contract_no,
        T1.customer_contract_no,
        T1.project_name,