buhuazhen
2026-05-09 c1db4e0ccf2c2ef1d6b6eb61946af5453010cf06
feat(production): 在生产和报工查询中增加车间筛选和展示

为生产订单、工序任务和产品报工查询增加车间字段支持,包括:
- 在查询条件中增加车间ID筛选
- 在查询结果中增加车间ID和名称字段
- 移除ProductionOrderVo中冗余的workshopId字段
- 为ProductionOrderVo的workshopName字段添加Excel导出注解
已修改6个文件
34 ■■■■ 文件已修改
src/main/java/com/ruoyi/production/bean/dto/ProductionProductMainDto.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/bean/vo/ProductionOperationTaskVo.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/bean/vo/ProductionOrderVo.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionOrderMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductMainMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/production/bean/dto/ProductionProductMainDto.java
@@ -71,4 +71,10 @@
    @Schema(description = "operation param list")
    private List<ProductionOrderRoutingOperationParam> productionOperationParamList;
    @Schema(description = "车间id")
    private Long workshopId;
    @Schema(description = "车间名称")
    private String workshopName;
}
src/main/java/com/ruoyi/production/bean/vo/ProductionOperationTaskVo.java
@@ -46,4 +46,10 @@
    @Schema(description = "是否结束)")
    private Boolean endOrder;
    @Schema(description = "车间id")
    private Long workshopId;
    @Schema(description = "车间名称")
    private String workshopName;
}
src/main/java/com/ruoyi/production/bean/vo/ProductionOrderVo.java
@@ -45,10 +45,8 @@
    @Schema(description = "是否已退料")
    private Boolean returned;
    @Schema(description = "车间id")
    private Long workshopId;
    @Schema(description = "车间名称")
    @Excel(name = "车间名称",sort = 11)
    private String workshopName;
src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -34,7 +34,9 @@
        CASE
            WHEN pot.work_order_no LIKE 'FG%' THEN '返工返修'
            ELSE '正常'
            END AS work_order_type
            END AS work_order_type,
        t8.id as workshop_id,
        t8.name as workshop_name
        from production_operation_task pot
                 left join production_order po on pot.production_order_id = po.id
                 left join production_order_routing_operation poro on pot.production_order_routing_operation_id = poro.id
@@ -47,6 +49,7 @@
                     left join production_product_output ppo on ppo.production_product_main_id = ppm.id
            group by ppm.production_operation_task_id
        ) scrapStat on scrapStat.taskId = pot.id
        left join workshop as t8 on po.workshop_id = t8.id
        <where>
            <if test="c != null and c.id != null">
                and pot.id = #{c.id}
src/main/resources/mapper/production/ProductionOrderMapper.xml
@@ -129,6 +129,9 @@
                <if test="c.endTime != null">
                    and po.end_time &lt;= #{c.endTime}
                </if>
                <if test="c.workshopId != null">
                    and t7.id = #{c.workshopId}
                </if>
            </if>
        </where>
    </sql>
src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -34,11 +34,14 @@
               date(ppm.create_time) as schedulingDate,
               su.nick_name as schedulingUserName,
               po_sales.customerName,
               poro.operation_name as process
               poro.operation_name as process,
               t5.id as workshop_id,
               t5.name as workshop_name
        from production_product_main ppm
                 left join production_operation_task pot on ppm.production_operation_task_id = pot.id
                 left join production_order po on pot.production_order_id = po.id
                 left join production_order_routing_operation poro on pot.production_order_routing_operation_id = poro.id
                 left join workshop as t5 on po.workshop_id = t5.id
                 left join (
            select po2.id as orderId,
                   group_concat(distinct sl2.sales_contract_no order by sl2.sales_contract_no separator ',') as salesContractNo,
@@ -109,7 +112,9 @@
                       else 1
                   end
                   as decimal(18,4)
               ) as wages
               ) as wages,
                t10.id as workshop_id,
                t10.name as workshop_name
        from production_account pa
                 left join production_product_main ppm on ppm.id = pa.production_product_main_id
                 left join production_operation_task pot on ppm.production_operation_task_id = pot.id
@@ -119,6 +124,7 @@
                 left join product p on pm.product_id = p.id
                 left join product p_parent on p_parent.id = p.parent_id
                 left join production_product_output ppo on ppo.production_product_main_id = ppm.id
                 left join workshop as t10 on po.workshop_id = t10.id
        <where>
            <if test="c != null">
                <if test="c.productCategory != null and c.productCategory != ''">