From 160b0f05c4e9404cd1d0345d00aea050b46bcbad Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 26 Feb 2024 15:55:31 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=94=9F=E4=BA=A7=E6=B4=BE?= =?UTF-8?q?=E5=B7=A5=E9=A1=B5=E9=9D=A2=E6=A0=A1=E9=AA=8C=E4=B8=8E=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MesProductPlanController.java | 14 + .../com/hw/mes/domain/MesProductPlan.java | 75 +++++ .../impl/MesProductOrderServiceImpl.java | 3 +- .../impl/MesProductPlanServiceImpl.java | 12 +- .../mapper/mes/MesProductPlanMapper.xml | 272 ++++++++++++------ hw-ui/src/api/mes/productplan.js | 9 + hw-ui/src/views/mes/productOrder/index.vue | 66 ++--- .../views/mes/productplan/editProductPlan.vue | 93 ++++-- hw-ui/src/views/mes/productplan/index.vue | 132 +++++---- 9 files changed, 460 insertions(+), 216 deletions(-) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java index 30122ba0..0fe319ec 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java @@ -3,6 +3,8 @@ package com.hw.mes.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; + +import com.hw.mes.service.IMesProductOrderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -47,6 +49,18 @@ public class MesProductPlanController extends BaseController return getDataTable(list); } + /** + * 查询生产派工List + * @param mesProductPlan + * @return + */ + @GetMapping("/getProductPlan") + public AjaxResult getProductPlan(MesProductPlan mesProductPlan) + { + List list = mesProductPlanService.selectMesProductPlanList(mesProductPlan); + return success(list); + } + /** * 导出生产派工列表 */ diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java index 3a8e768f..8be4e8c1 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java @@ -26,6 +26,12 @@ public class MesProductPlan extends BaseEntity @Excel(name = "生产工单ID") private Long productOrderId; + /** + * 生产工单编号 + */ + @Excel(name = "生产工单编号") + private String orderCode; + /** 工单编号 */ @Excel(name = "工单编号") private String planCode; @@ -42,10 +48,18 @@ public class MesProductPlan extends BaseEntity @Excel(name = "物料bomID") private Long materialBomId; + /** 物料bom名称 */ + @Excel(name = "物料bom名称") + private String materialBomName; + /** 工序ID */ @Excel(name = "工序ID") private Long processId; + /** 工序名称 */ + @Excel(name = "工序名称") + private String processName; + /** 顺序;派工类型是工艺路线的需要有顺序 */ @Excel(name = "顺序") private Long processOrder; @@ -54,10 +68,18 @@ public class MesProductPlan extends BaseEntity @Excel(name = "上一工序ID") private Long lastProcessId; + /** 上工序名称 */ + @Excel(name = "上工序名称") + private String lastProcessName; + /** 工位ID,关联工位信息主键;根据选择的工序或者工艺路线拆分到工位上,会拆分1到多条生产计划 */ @Excel(name = "工位ID") private Long stationId; + /** 工位名称 */ + @Excel(name = "工位名称") + private String stationName; + /** 用户ID*/ @Excel(name = "用户ID") private Long userId; @@ -116,9 +138,62 @@ public class MesProductPlan extends BaseEntity */ private String materialName; + + /** 生产计划明细信息 */ private List mesProductPlanDetailList; + /** 工单已派工数量 */ + private BigDecimal dispatchedAmount; + + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getMaterialBomName() { + return materialBomName; + } + + public void setMaterialBomName(String materialBomName) { + this.materialBomName = materialBomName; + } + + public String getLastProcessName() { + return lastProcessName; + } + + public void setLastProcessName(String lastProcessName) { + this.lastProcessName = lastProcessName; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + public String getStationName() { + return stationName; + } + + public void setStationName(String stationName) { + this.stationName = stationName; + } + + public BigDecimal getDispatchedAmount() { + return dispatchedAmount; + } + + public void setDispatchedAmount(BigDecimal dispatchedAmount) { + this.dispatchedAmount = dispatchedAmount; + } + public void setPlanId(Long planId) { this.planId = planId; diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java index 4c6c8242..706227e1 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java @@ -173,7 +173,8 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { throw new ServiceException("该生产工单不是未发布状态!"); } mesProductOrder.setOrderStatus(MesConstants.PUBLISHED); - return mesProductOrderMapper.updateMesProductOrder(mesProductOrder); + mesProductOrder.setReleaseTime(DateUtils.getNowDate()); + return this.updateMesProductOrder(mesProductOrder); } /** diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java index 90d5e0f4..bfec216e 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java @@ -4,6 +4,8 @@ import java.util.List; import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; +import com.hw.mes.domain.MesProductOrder; +import com.hw.mes.service.IMesProductOrderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -26,6 +28,9 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService @Autowired private MesProductPlanMapper mesProductPlanMapper; + @Autowired + private IMesProductOrderService mesProductOrderService; + /** * 查询生产派工 * @@ -64,6 +69,11 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService mesProductPlan.setCreateTime(DateUtils.getNowDate()); mesProductPlan.setPlanCode(Seq.getId(Seq.planCodeSeqType, Seq.planCodeCode)); int rows = mesProductPlanMapper.insertMesProductPlan(mesProductPlan); + //更新工单已派工数量 + MesProductOrder mesProductOrder = new MesProductOrder(); + mesProductOrder.setProductOrderId(mesProductPlan.getProductOrderId()); + mesProductOrder.setDispatchAmount(mesProductPlan.getDispatchedAmount()); + mesProductOrderService.updateMesProductOrder(mesProductOrder); insertMesProductPlanDetail(mesProductPlan); return rows; } @@ -124,7 +134,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService Long planId = mesProductPlan.getPlanId(); if (StringUtils.isNotNull(mesProductPlanDetailList)) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList) { mesProductPlanDetail.setPlanId(planId); diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml index 4fa70bc2..f8a6c5ec 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml @@ -1,97 +1,182 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - select plan_id, product_order_id, plan_code, dispatch_code, material_id, material_bom_id, process_id, process_order, last_process_id, station_id, user_id, production_time, plan_amount, complete_amount, plan_begin_time, plan_end_time, real_begin_time, real_end_time, attach_id, plan_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan + select mpp.plan_id, + mpp.product_order_id, + po.order_code, + mpp.plan_code, + mpp.dispatch_code, + mpp.material_id, + mi.material_name, + mpp.material_bom_id, + concat(mb.material_name, '-', mb.material_bom_desc) materialBomName, + mpp.process_id, + bpi.process_name, + mpp.process_order, + mpp.last_process_id, + bp2.process_name lastProcessName, + mpp.station_id, + bsi.station_name, + mpp.user_id, + mpp.production_time, + mpp.plan_amount, + mpp.complete_amount, + mpp.plan_begin_time, + mpp.plan_end_time, + mpp.real_begin_time, + mpp.real_end_time, + mpp.attach_id, + mpp.plan_status, + mpp.is_flag, + mpp.remark, + mpp.create_by, + mpp.create_time, + mpp.update_by, + mpp.update_time + from mes_product_plan mpp + left join mes_base_process_info bpi on bpi.process_id = mpp.process_id + left join mes_base_station_info bsi on bsi.station_id = mpp.station_id + left join mes_base_material_info mi on mi.material_id = mpp.material_id + left join mes_material_bom mb on mb.material_bom_id = mpp.material_bom_id + left join mes_base_process_info bp2 on bp2.process_id = mpp.last_process_id + left join mes_product_order po on po.product_order_id = mpp.product_order_id @@ -123,7 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, update_by, update_time, - + #{productOrderId}, #{planCode}, @@ -150,7 +235,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateBy}, #{updateTime}, - + @@ -186,7 +271,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from mes_product_plan where plan_id = #{planId} + delete + from mes_product_plan + where plan_id = #{planId} @@ -204,37 +291,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from mes_product_plan_detail where plan_id = #{planId} + delete + from mes_product_plan_detail + where plan_id = #{planId} - insert into mes_product_plan_detail( plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, real_begin_time, real_end_time, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time) values - - ( #{item.planDetailId}, #{item.planDetailCode}, #{item.planId}, #{item.planCode}, #{item.userId}, #{item.userName}, #{item.realBeginTime}, #{item.realEndTime}, #{item.planDetailStatus}, #{item.isFlag}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + insert into mes_product_plan_detail( plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, + real_begin_time, real_end_time, plan_detail_status, is_flag, remark, create_by, create_time, update_by, + update_time) values + + ( #{item.planDetailId}, #{item.planDetailCode}, #{item.planId}, #{item.planCode}, #{item.userId}, + #{item.userName}, #{item.realBeginTime}, #{item.realEndTime}, #{item.planDetailStatus}, #{item.isFlag}, + #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) - - - - - - - - - - - diff --git a/hw-ui/src/api/mes/productplan.js b/hw-ui/src/api/mes/productplan.js index e4fee8d3..2dbe878f 100644 --- a/hw-ui/src/api/mes/productplan.js +++ b/hw-ui/src/api/mes/productplan.js @@ -59,3 +59,12 @@ export function orderAddMesProductPlanList(data) { data: data }) } + +// 查询生产派工列表 +export function getProductPlan(query) { + return request({ + url: '/mes/productplan/getProductPlan', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/views/mes/productOrder/index.vue b/hw-ui/src/views/mes/productOrder/index.vue index 5be62423..6f1b62b2 100644 --- a/hw-ui/src/views/mes/productOrder/index.vue +++ b/hw-ui/src/views/mes/productOrder/index.vue @@ -1,6 +1,6 @@ - + - + - + - + - + - + - + @@ -113,7 +113,7 @@