yuan
4 天以前 f568916d4fc630a6c26a4de74d6a6853d87ef114
feat: 更新查询顺序以首先显示多个服务和映射器中的最新记录
已修改20个文件
37 ■■■■■ 文件已修改
src/main/java/com/ruoyi/account/service/impl/BorrowInfoServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/InvoiceLedgerServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/WeighingRecordServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/procurementrecord/InboundManagementMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductOrderMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductWorkOrderMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductInputMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductMainMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductOutputMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/ProductRecordMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/InvoiceLedgerMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/InvoiceRegistrationMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesQuotationMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ShippingInfoMapper.xml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/stock/StockInRecordMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/stock/StockInventoryMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/stock/StockOutRecordMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/account/service/impl/BorrowInfoServiceImpl.java
@@ -56,6 +56,8 @@
                borrowInfoLambdaQueryWrapper.like(BorrowInfo::getBorrowerName, borrowInfo.getBorrowerName());
            }
        }
        // 最新借款在前
        borrowInfoLambdaQueryWrapper.orderByDesc(BorrowInfo::getCreateTime);
        return AjaxResult.success(borrowInfoMapper.selectPage(page, borrowInfoLambdaQueryWrapper));
    }
src/main/java/com/ruoyi/sales/service/impl/InvoiceLedgerServiceImpl.java
@@ -405,7 +405,7 @@
        QueryWrapper<InvoiceRegistrationProduct> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("sales_ledger_id", invoiceRegistrationProduct.getSalesLedgerId());
        queryWrapper.eq("sales_ledger_product_id", invoiceRegistrationProduct.getSalesLedgerProductId());
        queryWrapper.orderByAsc("create_time");
        queryWrapper.orderByDesc("create_time");
        List<InvoiceRegistrationProduct> allList = invoiceRegistrationProductMapper.selectList(queryWrapper);
        int index = -1;
@@ -435,7 +435,7 @@
        QueryWrapper<InvoiceRegistrationProduct> newQueryWrapper = new QueryWrapper<>();
        newQueryWrapper.eq("sales_ledger_id", invoiceRegistrationProduct.getSalesLedgerId());
        newQueryWrapper.eq("sales_ledger_product_id", invoiceRegistrationProduct.getSalesLedgerProductId());
        newQueryWrapper.orderByAsc("create_time");
        newQueryWrapper.orderByDesc("create_time");
        List<InvoiceRegistrationProduct> remainList = invoiceRegistrationProductMapper.selectList(newQueryWrapper);
        // 查询销售台账产品
@@ -467,7 +467,7 @@
        QueryWrapper<InvoiceRegistrationProduct> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("sales_ledger_id", invoiceRegistrationProduct.getSalesLedgerId());
        queryWrapper.eq("sales_ledger_product_id", invoiceRegistrationProduct.getSalesLedgerProductId());
        queryWrapper.orderByAsc("create_time");
        queryWrapper.orderByDesc("create_time");
        List<InvoiceRegistrationProduct> list = invoiceRegistrationProductMapper.selectList(queryWrapper);
        if (CollectionUtils.isEmpty(list)) {
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerProductServiceImpl.java
@@ -125,8 +125,10 @@
                    } else {
                        item.setShippingStatus("已发货");
                    }
                } else {
                    // 没有任何磅单 → 未发货
                    item.setShippingStatus("未发货");
                }
                item.setShippingStatus("未发货");
            });
            // 开票
            InvoiceRegistrationProductDto invoiceRegistrationProductDto = new InvoiceRegistrationProductDto();
src/main/java/com/ruoyi/sales/service/impl/WeighingRecordServiceImpl.java
@@ -53,6 +53,8 @@
        // 发货单位(精确查询,可选)
        queryWrapper.eq(StringUtils.isNotBlank(weighingRecord.getShipUnit()),
                WeighingRecord::getShipUnit, weighingRecord.getShipUnit());
        // 最新过磅在前
        queryWrapper.orderByDesc(WeighingRecord::getCreateTime);
        return weighingRecordMapper.selectPage(page, queryWrapper);
    }
src/main/resources/mapper/procurementrecord/InboundManagementMapper.xml
@@ -12,5 +12,6 @@
                and supplier_name like concat('%',#{req.supplierName},'%')
            </if>
        </where>
        order by create_time desc, id desc
    </select>
</mapper>
src/main/resources/mapper/production/ProductOrderMapper.xml
@@ -64,6 +64,7 @@
                and po.create_time between #{c.startTime} and #{c.endTime}
            </if>
        </where>
        order by po.create_time desc, po.id desc
    </select>
    <select id="listProcessRoute" resultType="com.ruoyi.production.pojo.ProcessRoute">
        select pr.*
src/main/resources/mapper/production/ProductWorkOrderMapper.xml
@@ -48,6 +48,7 @@
            <if test="c.productOrderId != null and c.productOrderId != ''">
               and pwo.product_order_id = #{c.productOrderId}
            </if>
            order by pwo.create_time desc, pwo.id desc
    </select>
    <select id="getProductWorkOrderFlowCard" resultType="com.ruoyi.production.dto.ProductWorkOrderDto">
        SELECT
src/main/resources/mapper/production/ProductionProductInputMapper.xml
@@ -26,7 +26,7 @@
                and ppm.id = #{c.productMainId}
            </if>
        </where>
        order by ppi.id
        order by ppi.create_time desc, ppi.id desc
    </select>
    <delete id="deleteByProductMainIds" parameterType="java.util.List">
src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -47,7 +47,7 @@
                and ppm.status = #{c.status}
            </if>
        </where>
        order by ppm.id
        order by ppm.create_time desc, ppm.id desc
    </select>
    <select id="getOrderByMainId" resultType="com.ruoyi.production.pojo.ProductOrder">
src/main/resources/mapper/production/ProductionProductOutputMapper.xml
@@ -24,7 +24,7 @@
                and ppm.id = #{c.productMainId}
            </if>
        </where>
        order by ppo.id
        order by ppo.create_time desc, ppo.id desc
    </select>
    <delete id="deleteByProductMainIds" parameterType="java.util.List">
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
@@ -84,6 +84,7 @@
            </if>
        </where>
        GROUP BY slpa.scheduling_user_id, slpa.scheduling_user_name
        order by slpa.scheduling_date desc, slpa.id desc
    </select>
    <select id="selectDailyWagesStats" resultType="java.util.Map">
src/main/resources/mapper/purchase/ProductRecordMapper.xml
@@ -42,6 +42,7 @@
        <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''">
            and tr.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%')
        </if>
        ORDER BY pr.created_at DESC, pr.id DESC
    </select>
    <select id="getProductRecordById" resultType="com.ruoyi.purchase.dto.ProductRecordDto">
        SELECT
src/main/resources/mapper/sales/InvoiceLedgerMapper.xml
@@ -43,6 +43,7 @@
                AND DATE_FORMAT(T1.invoice_date,'%Y-%m-%d') = DATE_FORMAT(#{invoiceLedgerDto.invoiceDate},'%Y-%m-%d')
            </if>
        </where>
        ORDER BY T1.invoice_date DESC, T1.id DESC
    </select>
    <select id="invoiceLedgerList" resultType="com.ruoyi.sales.dto.InvoiceLedgerDto">
src/main/resources/mapper/sales/InvoiceRegistrationMapper.xml
@@ -32,6 +32,7 @@
            GROUP BY
                invoice_registration_id
        ) T4 ON T1.id = T4.invoice_registration_id
    ORDER BY T1.create_time DESC, T1.id DESC
    </select>
    <select id="invoiceRegisAndProductExcelDtoList" resultType="com.ruoyi.sales.excel.InvoiceRegisAndProductExcelDto">
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml
@@ -29,7 +29,7 @@
                AND T4.customer_id = #{receiptPaymentDto.customerId}
            </if>
        </where>
        ORDER BY T1.create_time ASC
        ORDER BY T1.create_time DESC, T1.id DESC
    </select>
    <select id="receiptPaymentInfo" resultType="com.ruoyi.sales.dto.ReceiptPaymentDto">
src/main/resources/mapper/sales/SalesQuotationMapper.xml
@@ -18,5 +18,6 @@
        <if test="salesQuotationDto.status != null and salesQuotationDto.status != '' ">
            AND t1.status = #{salesQuotationDto.status}
        </if>
        order by t1.create_time desc, t1.id desc
    </select>
</mapper>
src/main/resources/mapper/sales/ShippingInfoMapper.xml
@@ -57,6 +57,7 @@
            sl.customer_name
        FROM shipping_info s
                 LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id
        order by s.create_time desc, s.id desc
    </select>
    <select id="getReturnManagementDtoById" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto">
        SELECT
src/main/resources/mapper/stock/StockInRecordMapper.xml
@@ -27,7 +27,7 @@
                and sir.record_type = #{params.recordType}
            </if>
        </where>
        order by sir.id desc
        order by sir.create_time desc, sir.id desc
    </select>
    <select id="listStockInRecordExportData" resultType="com.ruoyi.stock.execl.StockInRecordExportData">
        SELECT
src/main/resources/mapper/stock/StockInventoryMapper.xml
@@ -72,6 +72,7 @@
        <if test="ew.productName != null and ew.productName !=''">
            and p.product_name like concat('%',#{ew.productName},'%')
        </if>
        order by si.update_time desc, si.id desc
    </select>
    <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData">
        select si.qualitity,
@@ -114,6 +115,7 @@
                and sir.create_time &lt;= #{ew.endMonth}
            </if>
        </where>
        order by sir.update_time desc, sir.id desc
    </select>
    <select id="stockInAndOutRecord" resultType="com.ruoyi.stock.dto.StockInventoryDto">
src/main/resources/mapper/stock/StockOutRecordMapper.xml
@@ -42,7 +42,7 @@
                and sor.record_type = #{params.recordType}
            </if>
        </where>
        order by sor.id desc
        order by sor.create_time desc, sor.id desc
    </select>
    <select id="listStockOutRecordExportData" resultType="com.ruoyi.stock.execl.StockOutRecordExportData">
        SELECT