src/main/java/com/ruoyi/production/bean/dto/ProductionPlanDto.java
@@ -1,5 +1,6 @@ package com.ruoyi.production.bean.dto; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.production.pojo.ProductionPlan; @@ -52,6 +53,8 @@ @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDate requiredDateEnd; @Schema(description = "车间id") private Long workshopId; @Schema(description = "销售合同号") private String salesContractNo; src/main/java/com/ruoyi/production/bean/dto/ProductionProductMainDto.java
@@ -71,4 +71,10 @@ @Schema(description = "工序参数列表") 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
@@ -47,6 +47,12 @@ @Schema(description = "是否结束)") private Boolean endOrder; @Schema(description = "车间id") private Long workshopId; @Schema(description = "车间名称") private String workshopName; @Schema(description = "类型 区分计时和计件(0计时1计件)") private Integer type; } src/main/java/com/ruoyi/production/bean/vo/ProductionOrderVo.java
@@ -44,4 +44,10 @@ @Schema(description = "是否已退料") private Boolean returned; @Schema(description = "车间名称") @Excel(name = "车间名称",sort = 11) private String workshopName; } src/main/java/com/ruoyi/production/controller/ProductionPlanController.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; @@ -54,6 +55,9 @@ if (productionPlanDto.getTotalAssignedQuantity() == null || productionPlanDto.getTotalAssignedQuantity().compareTo(BigDecimal.ZERO) <= 0) { return R.fail("请输入下发数量"); } if(productionPlanDto.getWorkshopId() == null){ throw new BaseException("请选择车间信息"); } return R.ok(productionPlanService.combine(productionPlanDto)); } src/main/java/com/ruoyi/production/pojo/ProductionOrder.java
@@ -88,4 +88,9 @@ @Schema(description = "是否结束)") @TableField("is_end_order") private Boolean endOrder; @TableField("workshop_id") @Schema(description = "车间id") private Long workshopId; } src/main/java/com/ruoyi/production/service/impl/ProductionPlanServiceImpl.java
@@ -150,6 +150,7 @@ productionOrder.setProductionPlanIds(formatPlanIds(issuedPlanIds)); productionOrder.setProductModelId(firstPlan.getProductModelId()); productionOrder.setQuantity(assignedQuantity); productionOrder.setWorkshopId(productionPlanDto.getWorkshopId()); productionOrder.setPlanCompleteTime(productionPlanDto.getPlanCompleteTime()); if (!productionOrderService.saveProductionOrder(productionOrder)) { throw new ServiceException("下发失败,生产订单保存失败"); src/main/resources/mapper/production/ProductionOperationTaskMapper.xml
@@ -35,7 +35,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 @@ -48,6 +50,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
@@ -54,7 +54,9 @@ tr.process_route_code as processRouteCode, ROUND(po.complete_quantity / po.quantity * 100, 2) AS completionStatus, tb.bom_no as bomNo, pop_return.returned as returned pop_return.returned as returned, t7.name as workshop_name, t7.id as workshop_id </sql> <sql id="ProductionOrderVoFrom"> @@ -81,6 +83,8 @@ from production_order_pick group by production_order_id ) pop_return on pop_return.productionOrderId = po.id left join workshop as t7 on po.workshop_id = t7.id </sql> <sql id="ProductionOrderWhere"> @@ -125,6 +129,9 @@ <if test="c.endTime != null"> and po.end_time <= #{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, @@ -113,7 +116,9 @@ end 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 @@ -123,6 +128,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 != ''">