maven
3 天以前 5f39a6af8917e522a0f2cb915b4cc2e0e41cf47e
yys  移动仓储物流
已修改7个文件
320 ■■■■■ 文件已修改
src/main/java/com/ruoyi/common/enums/FileNameType.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/pojo/TempFile.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/CommonFileServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/ProcurementRecordOutMapper.xml 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/common/enums/FileNameType.java
@@ -11,7 +11,8 @@
    MEASURING(5),  //计量器具台账
    MEASURINGRecord(6),//计量器具台账记录
    ApproveNode(7),  //协同审批节点审核
    ApproveProcess(8);  //协同审批主数据
    ApproveProcess(8),
    Inventory(9);  //协同审批主数据
    private final int value;
src/main/java/com/ruoyi/other/pojo/TempFile.java
@@ -16,5 +16,5 @@
    private String originalName;   // 原始文件名
    private String tempPath;       // 临时存储路径
    private LocalDateTime expireTime; // 过期时间
    private Integer type;       // 关联表类型
    private Integer type;       // 关联表类型 9-库存
}
src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
@@ -155,7 +155,7 @@
        }
    }
    @Scheduled(cron = "0 0 3 * * ?") // 每天凌晨3点执行
//    @Scheduled(cron = "0 0 3 * * ?") // 每天凌晨3点执行
    public void cleanupExpiredTempFiles() {
        LambdaQueryWrapper<TempFile> wrapper = new LambdaQueryWrapper<>();
        wrapper.lt(TempFile::getExpireTime, LocalDateTime.now()); // expireTime < 当前时间
src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java
@@ -38,6 +38,11 @@
    @Excel(name = "待出库数量")
    @TableField(exist = false)
    private BigDecimal inboundNum0;
    /**
     * 图片
     */
    private String url;
    /**
     * 出库数量
     */
src/main/java/com/ruoyi/sales/service/impl/CommonFileServiceImpl.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.enums.FileNameType;
import com.ruoyi.other.mapper.TempFileMapper;
import com.ruoyi.other.pojo.TempFile;
import com.ruoyi.sales.mapper.CommonFileMapper;
@@ -133,7 +134,6 @@
                Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING);
                Files.deleteIfExists(Paths.get(tempFile.getTempPath()));
                log.info("文件迁移成功: {} -> {}", tempFile.getTempPath(), formalFilePath);
                // 更新文件记录(关联到业务ID)
                CommonFile fileRecord = new CommonFile();
                fileRecord.setCommonId(businessId);
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
@@ -42,6 +42,8 @@
        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.unit_price,
        t1.total_price,
        t1.inbound_batches,
        t1.inbound_num,
        t1.inbound_num as inboundNum0,
@@ -50,17 +52,21 @@
        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.productCategory != null and req.productCategory != ''">
                and t2.product_category like  concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
            </if>
        </where>
        order by t1.create_time desc
    </select>
    <select id="list" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto">
        select
@@ -84,6 +90,32 @@
        from  procurement_record_storage 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
    </select>
    <select id="listOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto">
        select
            t3.customer_contract_no,
            t3.sales_contract_no,
            t3.customer_name,
            t2.product_category,
            t1.id,
            t2.specification_model,
            t2.unit,
            t2.quantity,
            t2.quantity as quantity0,
            t2.tax_rate,
            t2.tax_inclusive_unit_price,
            t2.tax_inclusive_total_price,
            t2.tax_exclusive_total_price,
            t1.inbound_batches,
            t1.inbound_num,
            t1.create_time,
            t1.create_time as time,
            t1.create_by
        from  procurement_record_storage t1
            left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id
            left join sales_ledger t3 on t3.id = t2.sales_ledger_id
        where t1.type = 2
    </select>
    <select id="listPageCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy">
        select
@@ -101,20 +133,24 @@
        t2.tax_inclusive_total_price,
        t2.tax_exclusive_total_price,
        t1.inbound_batches,
        t1.unit_price as unitPrice,
        sum(t1.total_price) as totalPrice,
        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
        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.productCategory != null and req.productCategory != ''">
                and t2.product_category like  concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
@@ -135,7 +171,8 @@
                and t1.create_time &lt;= #{req.endDate}
            </if>
        </where>
        group by t3.supplier_name,t2.product_category,t2.specification_model
        group by t2.product_category,t2.specification_model,t1.unit_price
        order by t1.create_time desc
    </select>
    <select id="listCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy">
        select
@@ -160,7 +197,137 @@
            t1.update_time as uTime,
            t1.create_by
        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 t1.type = 1
        group by t3.supplier_name,t2.product_category,t2.specification_model
    </select>
    <select id="listCopyOne" 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.tax_rate,
            t2.tax_inclusive_unit_price,
            t2.tax_inclusive_total_price,
            t2.tax_exclusive_total_price,
            t1.inbound_batches,
            t1.inbound_num,
            t1.inbound_num as inboundNum0,
            t1.create_time,
            t1.update_time,
            t1.create_time as cTime,
            t1.update_time as uTime,
            t1.create_by
        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
        group by t3.customer_name,t2.product_category,t2.specification_model
    </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.unit_price,
        t1.total_price,
        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.productCategory != null and req.productCategory != ''">
                and t2.product_category like  concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
            </if>
        </where>
        order by t1.create_time desc
    </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.total_price) as totalPrice,
        t1.unit_price,
        sum(t1.inbound_num) as inboundNum,
        sum(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.productCategory != null and req.productCategory != ''">
                and t2.product_category like  concat('%',#{req.productCategory},'%')
            </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 t2.product_category,t2.specification_model,t1.unit_price
        order by t1.create_time desc
    </select>
</mapper>
src/main/resources/mapper/procurementrecord/ProcurementRecordOutMapper.xml
@@ -17,19 +17,26 @@
        t1.inbound_num,
        t1.create_time,
        t1.create_by,
        t2.warn_num
        t2.warn_num,
        t4.unit_price,
        t4.unit_price *  t1.inbound_num as totalPrice
        from  procurement_record_out 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
        left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id
        <where>
            1 = 1
            and t1.type = 1
            <if test="req.supplierName != null and req.supplierName != ''">
                and t3.supplier_name like  concat('%',#{req.supplierName},'%')
            </if>
            <if test="req.productCategory != null and req.productCategory != ''">
                and t2.product_category like  concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
            </if>
        </where>
        order by t1.create_time desc
    </select>
    <select id="list" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto">
        select
@@ -49,5 +56,117 @@
        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
    </select>
    <select id="listOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto">
        select
            t3.customer_contract_no,
            t3.sales_contract_no,
            t3.customer_name,
            t2.product_category,
            t1.id,
            t2.specification_model,
            t2.unit,
            t2.tax_rate,
            t2.tax_inclusive_unit_price,
            t2.tax_inclusive_total_price,
            t2.tax_exclusive_total_price,
            t1.inbound_num,
            t1.create_time,
            t1.create_time as time,
            t1.create_by
        from  procurement_record_out t1
            left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id
            left join sales_ledger t3 on t3.id = t2.sales_ledger_id
        where t1.type = 2
    </select>
    <select id="listTwo" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto">
        select
            t1.supplier_name,
            t1.product_category,
            t1.id,
            t1.specification_model,
            t1.unit,
            t1.tax_rate,
            t1.tax_inclusive_unit_price,
            t1.tax_inclusive_total_price,
            t1.tax_exclusive_total_price,
            t1.inbound_num,
            t1.create_time,
            t1.create_time as time,
            t1.create_by
        from  procurement_record_out t1
        where t1.type = 3
    </select>
    <select id="listPageByProduct" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto">
        select
        t3.customer_contract_no,
        t3.sales_contract_no,
        t3.customer_name,
        t2.product_category,
        t1.id,
        t1.code,
        t2.specification_model,
        t2.unit,
        t2.tax_rate,
        t2.tax_inclusive_unit_price,
        t2.tax_inclusive_total_price,
        t2.tax_exclusive_total_price,
        t1.inbound_num,
        t1.create_time,
        t1.create_by,
        t4.unit_price,
        t4.unit_price *  t1.inbound_num as totalPrice
        from  procurement_record_out 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
        left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id
        <where>
            and t1.type = 2
            <if test="req.customerName != null and req.customerName != ''">
                and t3.customer_name like  concat('%',#{req.customerName},'%')
            </if>
            <if test="req.productCategory != null and req.productCategory != ''">
                and t2.product_category like  concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
            </if>
        </where>
        order by t1.create_time desc
    </select>
    <select id="listPageByCustom" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto">
        select
        t2.supplier_name,
        t2.product_category,
        t1.id,
        t1.code,
        t2.specification_model,
        t2.unit,
        t2.tax_rate,
        t2.tax_inclusive_unit_price,
        t2.tax_inclusive_unit_price * t1.inbound_num as totalPrice,
        t2.tax_exclusive_total_price,
        t1.inbound_num,
        t1.create_time,
        t1.create_by,
        t2.item_type
        from  procurement_record_out t1
        left join custom_storage t2 on t2.id = t1.procurement_record_storage_id
        <where>
            t1.type = 3
            <if test="req.supplierName != null and req.supplierName != ''">
                and t2.supplier_name like  concat('%',#{req.supplierName},'%')
            </if>
            <if test="req.productCategory != null and req.productCategory != ''">
                and t2.product_category like  concat('%',#{req.productCategory},'%')
            </if>
            <if test="req.timeStr != null and req.timeStr != ''">
                and t1.create_time like  concat('%',#{req.timeStr},'%')
            </if>
        </where>
        order by t1.create_time desc
    </select>
</mapper>