f876f4a194e563cb387373662eb303b1a3b4bdcb..b59406c5aff7272e74049e0addffdfa82c867882
5 天以前 zss
refactor(purchase): 优化采购台账质检相关代码
b59406 对比 | 目录
5 天以前 zss
refactor(database): 优化多处查询排序字段
a5198f 对比 | 目录
5 天以前 gongchunyi
fix: 原材料更名为原料
409e75 对比 | 目录
已修改10个文件
43 ■■■■ 文件已修改
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionOrderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionPlanMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductMainMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/quality/QualityInspectMapper.xml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/SalesLedgerMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sales/ShippingInfoMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/stock/StockInRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/stock/StockOutRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -22,10 +22,10 @@
import com.ruoyi.basic.pojo.ProductModel;
import com.ruoyi.basic.pojo.SupplierManage;
import com.ruoyi.basic.utils.FileUtil;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.enums.ApprovalStatusEnum;
import com.ruoyi.common.enums.ReviewStatusEnum;
import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
@@ -64,7 +64,6 @@
import com.ruoyi.stock.service.StockInRecordService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
@@ -130,6 +129,7 @@
        if (purchaseLedger.getApprovalStatus() != null) {
            queryWrapper.eq(PurchaseLedger::getApprovalStatus, purchaseLedger.getApprovalStatus());
        }
        queryWrapper.orderByDesc(PurchaseLedger::getEntryDate);
        return purchaseLedgerMapper.selectList(queryWrapper);
    }
@@ -983,11 +983,7 @@
                    salesLedgerProduct.setRegister(loginUser.getNickName());
                    salesLedgerProduct.setRegisterDate(LocalDateTime.now());
                    salesLedgerProduct.setApproveStatus(0);
                    // 是否质检判断
                    salesLedgerProduct.setIsChecked(salesLedgerProductImportDto.getIsChecked() == 1);
                    if(salesLedgerProductImportDto.getIsChecked() == 1){
                        addQualityInspect(salesLedger, salesLedgerProduct);
                    }
                    salesLedgerProductMapper.insert(salesLedgerProduct);
                }
                // 采购审核
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -71,7 +71,7 @@
                and pot.work_order_no like concat('%', #{c.workOrderNo}, '%')
            </if>
        </where>
        order by pot.production_order_id desc, poro.drag_sort
        order by pot.work_order_no desc, poro.drag_sort
    </select>
    <select id="selectTaskStatisticsByDate" resultType="com.ruoyi.home.dto.ProductionTaskStatisticsDto">
src/main/resources/mapper/production/ProductionOrderMapper.xml
@@ -134,7 +134,7 @@
        <include refid="ProductionOrderVoColumns" />
        <include refid="ProductionOrderVoFrom" />
        <include refid="ProductionOrderWhere" />
        order by po.id desc
        order by po.status  , po.plan_complete_time desc
    </select>
    <select id="listProductionOrder" resultMap="ProductionOrderVoResultMap">
src/main/resources/mapper/production/ProductionPlanMapper.xml
@@ -58,7 +58,7 @@
                </if>
            </if>
        </where>
        ORDER BY COALESCE(pp.id) DESC
        ORDER BY pp.required_date DESC
    </select>
    <select id="selectWithMaterialByIds" resultType="com.ruoyi.production.bean.dto.ProductionPlanDto">
src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -82,7 +82,7 @@
                and ppm.id = #{c.productMainId}
            </if>
        </where>
        order by ppm.create_time desc
        order by ppm.product_no desc
    </select>
    <select id="getOrderByMainId" resultType="com.ruoyi.production.pojo.ProductionOrder">
src/main/resources/mapper/quality/QualityInspectMapper.xml
@@ -96,7 +96,7 @@
    <select id="getInspectStatistics" resultType="com.ruoyi.quality.dto.QualityInspectStatDto">
        SELECT CASE pp.product_name
                   WHEN '原材料' THEN 0
                   WHEN '原料' THEN 0
                   WHEN '半成品' THEN 1
                   WHEN '成品' THEN 2
                   END                     AS modelType,
@@ -116,7 +116,7 @@
                 LEFT JOIN quality_inspect qi
                           ON qi.product_model_id = pm.id
        WHERE pp.product_name IN ('原材料', '半成品', '成品')
        WHERE pp.product_name IN ('原料', '半成品', '成品')
        GROUP BY pp.product_name
@@ -200,7 +200,7 @@
                 LEFT JOIN quality_inspect qi
                           ON qi.product_model_id = pm.id
                               AND (
                                  (pp.product_name = '原材料' AND t.modelType = 0) OR
                                  (pp.product_name = '原料' AND t.modelType = 0) OR
                                  (pp.product_name = '半成品' AND t.modelType = 1) OR
                                  (pp.product_name = '成品' AND t.modelType = 2)
                                  )
@@ -306,7 +306,7 @@
                               AND YEAR(qi.check_time) = #{year}
                               AND MONTH(qi.check_time) = b.month_num
                               AND (
                                  (pp.product_name = '原材料' AND b.modelType = 0)
                                  (pp.product_name = '原料' AND b.modelType = 0)
                                      OR (pp.product_name = '半成品' AND b.modelType = 1)
                                      OR (pp.product_name = '成品' AND b.modelType = 2)
                                  )
@@ -320,7 +320,7 @@
        SELECT t.modelType,
               COALESCE(SUM(
                                CASE
                                    WHEN pp.product_name = '原材料' AND t.modelType = 0 THEN qi.quantity
                                    WHEN pp.product_name = '原料' AND t.modelType = 0 THEN qi.quantity
                                    WHEN pp.product_name = '半成品' AND t.modelType = 1 THEN qi.quantity
                                    WHEN pp.product_name = '成品' AND t.modelType = 2 THEN qi.quantity
                                    ELSE 0
@@ -328,7 +328,7 @@
                        ), 0) AS totalCount,
               COALESCE(SUM(
                                CASE
                                    WHEN pp.product_name = '原材料' AND t.modelType = 0 THEN qi.qualified_quantity
                                    WHEN pp.product_name = '原料' AND t.modelType = 0 THEN qi.qualified_quantity
                                    WHEN pp.product_name = '半成品' AND t.modelType = 1 THEN qi.qualified_quantity
                                    WHEN pp.product_name = '成品' AND t.modelType = 2 THEN qi.qualified_quantity
                                    ELSE 0
@@ -336,7 +336,7 @@
                        ), 0) AS qualifiedCount,
               COALESCE(SUM(
                                CASE
                                    WHEN pp.product_name = '原材料' AND t.modelType = 0 THEN qi.unqualified_quantity
                                    WHEN pp.product_name = '原料' AND t.modelType = 0 THEN qi.unqualified_quantity
                                    WHEN pp.product_name = '半成品' AND t.modelType = 1 THEN qi.unqualified_quantity
                                    WHEN pp.product_name = '成品' AND t.modelType = 2 THEN qi.unqualified_quantity
                                    ELSE 0
@@ -381,10 +381,10 @@
                   WHEN 12 THEN '十二月'
                   END        AS month,
            /* 原材料 */
            /* 原料 */
               COALESCE(SUM(
                                CASE
                                    WHEN pp.product_name = '原材料'
                                    WHEN pp.product_name = '原料'
                                        THEN qi.quantity
                                    ELSE 0
                                    END
@@ -435,7 +435,7 @@
                                                ON p.parent_id = pp.id
                                  WHERE qi.inspect_state = 1
                                    AND (
                                      (#{modelType} = 1 AND pp.product_name = '原材料')
                                      (#{modelType} = 1 AND pp.product_name = '原料')
                                          OR (#{modelType} = 2 AND pp.product_name = '半成品')
                                          OR (#{modelType} = 3 AND pp.product_name = '成品')
                                      )
src/main/resources/mapper/sales/SalesLedgerMapper.xml
@@ -40,6 +40,7 @@
                T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
            </if>
        </where>
        order by T1.entry_date desc
    </select>
    <select id="selectSalesLedgerListPage" resultType="com.ruoyi.sales.vo.SalesLedgerVo">
src/main/resources/mapper/sales/ShippingInfoMapper.xml
@@ -48,7 +48,7 @@
        <if test="req.expressNumber != null and req.expressNumber != ''">
            AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%')
        </if>
        order by create_time DESC
        order by shipping_no DESC
    </select>
    <select id="listAll" resultType="com.ruoyi.sales.pojo.ShippingInfo">
        SELECT
src/main/resources/mapper/stock/StockInRecordMapper.xml
@@ -132,7 +132,7 @@
                and p.id in (select id from product_tree)
            </if>
        </where>
        order by sir.id desc
        order by sir.inbound_batches desc
    </select>
    <select id="listStockInRecordExportData" resultType="com.ruoyi.stock.execl.StockInRecordExportData">
        SELECT
src/main/resources/mapper/stock/StockOutRecordMapper.xml
@@ -89,7 +89,7 @@
                and sor.record_type = #{params.recordType}
            </if>
        </where>
        order by sor.id desc
        order by sor.outbound_batches desc
    </select>
    <select id="listPageAccountSales" resultType="com.ruoyi.account.bean.vo.sales.SalesOutboundVo">