huminmin
12 小时以前 18480213c000dfd7f6f236903f965a4d3f254597
销售台账列表返回库存类型
已修改3个文件
26 ■■■■ 文件已修改
src/main/java/com/ruoyi/sales/vo/SalesLedgerVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/stock/service/impl/StockOutRecordServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/vo/SalesLedgerVo.java
@@ -10,4 +10,6 @@
public class SalesLedgerVo extends SalesLedger {
    private List<StorageBlobVO> storageBlobVOs;
    private String stockType;
}
src/main/java/com/ruoyi/stock/service/impl/StockOutRecordServiceImpl.java
@@ -142,10 +142,19 @@
    public void exportStockOutRecord(HttpServletResponse response, StockOutRecordDto stockOutRecordDto) {
        List<StockOutRecordExportData> list = stockOutRecordMapper.listStockOutRecordExportData(stockOutRecordDto);
        for (StockOutRecordExportData stockInRecordExportData : list) {
            if (stockInRecordExportData.getType().equals("0")) {
                stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
            }else {
                stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
            if (StringUtils.isEmpty(stockInRecordExportData.getRecordType())) {
                continue;
            }
            StockOutQualifiedRecordTypeEnum outRecordTypeEnum =
                    EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType()));
            if (outRecordTypeEnum != null) {
                stockInRecordExportData.setRecordType(outRecordTypeEnum.getValue());
                continue;
            }
            StockInQualifiedRecordTypeEnum inRecordTypeEnum =
                    EnumUtil.fromCode(StockInQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType()));
            if (inRecordTypeEnum != null) {
                stockInRecordExportData.setRecordType(inRecordTypeEnum.getValue());
            }
        }
        ExcelUtil<StockOutRecordExportData> util = new ExcelUtil<>(StockOutRecordExportData.class);
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -62,10 +62,17 @@
        T1.payment_method,
        T1.delivery_date,
        DATEDIFF(T1.delivery_date, CURDATE()) AS delivery_days_diff,
        COALESCE(stock_type_info.stock_type, 'qualified') AS stock_type,
        IFNULL(shipping_status_counts.is_all_shipped, FALSE) AS is_fh
        FROM sales_ledger T1
        LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id
        LEFT JOIN (
        SELECT sales_ledger_id, MAX(stock_type) AS stock_type
        FROM sales_ledger_product
        WHERE type = 1
        GROUP BY sales_ledger_id
        ) stock_type_info ON T1.id = stock_type_info.sales_ledger_id
        LEFT JOIN (
        SELECT sales_ledger_id,
        CASE
        WHEN SUM(CASE WHEN status != '已发货' THEN 1 ELSE 0 END) = 0 THEN TRUE