gongchunyi
昨天 7ffca29de342a6e5f7a124a9eabba468cfb4f9a3
fix: 生产计划的产品ID、产品型号字段重命名
已修改4个文件
56 ■■■■ 文件已修改
src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanDto.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanDto.java
@@ -33,11 +33,11 @@
     */
    @ApiModelProperty("产品规格")
    @Excel(name = "产品规格")
    private String specification;
    private String model;
    @ApiModelProperty("产品单位")
    @Excel(name = "产品单位")
    private String baseUnit;
    private String unit;
    @ApiModelProperty(value = "生产计划id集合")
    private List<Long> ids;
src/main/java/com/ruoyi/productionPlan/dto/ProductionPlanSummaryDto.java
@@ -35,7 +35,7 @@
     * 产品规格
     */
    @ApiModelProperty("产品规格")
    private String specification;
    private String model;
    /**
     * 产品长度
@@ -71,6 +71,6 @@
     * 基本单位
     */
    @ApiModelProperty("基本单位")
    private String baseUnit;
    private String unit;
}
src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
@@ -122,8 +122,8 @@
        }
        // 校验是否存在不同的产品规格
        String firstProductSpec = plans.get(0).getSpecification();
        if (plans.stream().anyMatch(p -> p.getSpecification() == null || !p.getSpecification().equals(firstProductSpec))) {
        String firstProductSpec = plans.get(0).getModel();
        if (plans.stream().anyMatch(p -> p.getModel() == null || !p.getModel().equals(firstProductSpec))) {
            throw new BaseException("合并失败,存在不同的产品规格");
        }
src/main/resources/mapper/productionPlan/ProductionPlanMapper.xml
@@ -38,25 +38,25 @@
        SELECT
        pp.*,
        pms.material_code AS materialCode,
        pms.specification AS specification,
        pms.material_id AS productMaterialId,
        pm.material_name AS productName,
        pm.base_unit
        pms.model,
        pms.product_id AS productMaterialId,
        pm.product_name AS productName,
        pm.unit
        FROM production_plan pp
        left join product_material_sku pms on pp.product_material_sku_id = pms.id
        left join product_material pm on pms.material_id = pm.id
        left join product_material pm on pms.product_id = pm.id
        WHERE 1 = 1
        <if test="c.customerName != null and c.customerName != '' ">
            AND pp.customer_name LIKE CONCAT('%',#{c.customerName},'%')
        </if>
        <if test="c.productName != null and c.productName != '' ">
            AND pm.material_name LIKE CONCAT('%',#{c.productName},'%')
            AND pm.product_name LIKE CONCAT('%',#{c.productName},'%')
        </if>
        <if test="c.materialCode != null and c.materialCode != '' ">
            AND pms.material_code LIKE CONCAT('%',#{c.materialCode},'%')
        </if>
        <if test="c.specification != null and c.specification != '' ">
            AND pms.specification LIKE CONCAT('%',#{c.specification},'%')
        <if test="c.model != null and c.model != '' ">
            AND pms.model LIKE CONCAT('%',#{c.model},'%')
        </if>
        <if test="c.applyNo != null and c.applyNo != '' ">
            AND pp.apply_no LIKE CONCAT('%',#{c.applyNo},'%')
@@ -73,52 +73,52 @@
    <select id="selectSummaryByProductType" resultType="com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto">
        SELECT
        sku.material_code AS materialCode,
        pm.material_name AS productName,
        sku.specification AS specification,
        pm.product_name AS productName,
        sku.model,
        pp.length,
        pp.width,
        pp.height,
        pm.base_unit AS baseUnit,
        pm.unit AS unit,
        COALESCE(SUM(pp.quantity),0) AS quantity,
        COALESCE(SUM(pp.volume),0) AS volume
        FROM production_plan pp
        LEFT JOIN product_material_sku sku
        ON pp.product_material_sku_id = sku.id
        LEFT JOIN product_material pm
        ON sku.material_id = pm.id
        ON sku.product_id = pm.id
        <where>
            <if test="materialCode != null and materialCode != ''">
                AND sku.material_code LIKE CONCAT('%', #{materialCode}, '%')
            </if>
            <if test="productName != null and productName != ''">
                AND pm.material_name LIKE CONCAT('%', #{productName}, '%')
                AND pm.product_name LIKE CONCAT('%', #{productName}, '%')
            </if>
            <if test="specification != null and specification != ''">
                AND sku.specification LIKE CONCAT('%', #{specification}, '%')
            <if test="model != null and model != ''">
                AND sku.model LIKE CONCAT('%', #{model}, '%')
            </if>
        </where>
        GROUP BY
        sku.material_code,
        pm.material_name,
        sku.specification,
        pm.product_name,
        sku.model,
        pp.length,
        pp.width,
        pp.height,
        pm.base_unit
        pm.unit
    </select>
    <select id="selectWithMaterialByIds" resultType="com.ruoyi.productionPlan.dto.ProductionPlanDto">
        SELECT
        pp.*,
        pms.material_code AS materialCode,
        pms.specification AS specification,
        pm.material_name AS productName,
        pm.base_unit
        pms.model,
        pm.product_name AS productName,
        pm.unit
        FROM production_plan pp
        LEFT JOIN product_material_sku pms ON pp.product_material_sku_id = pms.id
        LEFT JOIN product_material pm ON pms.material_id = pm.id
        LEFT JOIN product_material pm ON pms.product_id = pm.id
        WHERE pp.id IN
        <foreach collection="ids" item="id" open="(" separator="," close=")">
            #{id}