From 176e6ed9273fbd77c6fcb020a8216390fb4ad0df Mon Sep 17 00:00:00 2001 From: yinq Date: Fri, 23 Feb 2024 17:06:38 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=94=9F=E4=BA=A7=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=96=B0=E5=A2=9E=E7=94=9F=E4=BA=A7=E6=B4=BE=E5=B7=A5?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=8E=E5=90=8E=E5=8F=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hw/common/core/utils/uuid/Seq.java | 21 + .../controller/MesBaseRouteController.java | 11 + .../controller/MesProductPlanController.java | 22 + .../com/hw/mes/domain/MesProductOrder.java | 43 ++ .../com/hw/mes/domain/MesProductPlan.java | 22 +- .../com/hw/mes/mapper/MesBaseRouteMapper.java | 8 + .../hw/mes/service/IMesBaseRouteService.java | 9 + .../mes/service/IMesProductPlanService.java | 15 + .../service/impl/MesBaseRouteServiceImpl.java | 11 + .../impl/MesProductPlanServiceImpl.java | 28 +- .../mapper/mes/MesBaseRouteMapper.xml | 20 + .../mapper/mes/MesProductOrderMapper.xml | 120 ++-- hw-ui/src/api/mes/baseRoute.js | 8 + hw-ui/src/api/mes/productplan.js | 61 ++ hw-ui/src/router/index.js | 14 + hw-ui/src/views/mes/productOrder/index.vue | 6 +- .../views/mes/productplan/editProductPlan.vue | 278 ++++++++ hw-ui/src/views/mes/productplan/index.vue | 625 ++++++++++++++++++ 18 files changed, 1250 insertions(+), 72 deletions(-) create mode 100644 hw-ui/src/api/mes/productplan.js create mode 100644 hw-ui/src/views/mes/productplan/editProductPlan.vue create mode 100644 hw-ui/src/views/mes/productplan/index.vue diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java index f9beea9..29d382d 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/uuid/Seq.java @@ -53,6 +53,23 @@ public class Seq { // 工单编号记录标识 public static final String orderCodeCode = "OC"; + // 派工编号序列类型 + public static final String dispatchCodeSeqType = "DISPATCH_CODE"; + + // 派工编号序列数 + private static AtomicInteger dispatchCodeSeq = new AtomicInteger(1); + + // 派工编号记录标识 + public static final String dispatchCodeCode = "PG"; + + // 派工计划编号序列类型 + public static final String planCodeSeqType = "PLAN_CODE"; + + // 派工计划编号序列数 + private static AtomicInteger planCodeSeq = new AtomicInteger(1); + + // 派工计划编号记录标识 + public static final String planCodeCode = "JL"; /** * 获取通用序列号 @@ -122,6 +139,10 @@ public class Seq { atomicInt = rawReturnSeq; }else if (orderCodeSeqType.equals(type)) { atomicInt = orderCodeSeq; + }else if (dispatchCodeSeqType.equals(type)) { + atomicInt = dispatchCodeSeq; + }else if (planCodeSeqType.equals(type)) { + atomicInt = planCodeSeq; } return getId(atomicInt, 3, code); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseRouteController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseRouteController.java index 15542af..7e35844 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseRouteController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseRouteController.java @@ -116,4 +116,15 @@ public class MesBaseRouteController extends BaseController { return toAjax(mesBaseRouteService.deleteMesBaseRouteByRouteIds(routeIds)); } + + /** + * 根据工艺路线ID查询工位信息 + * @param routeId + * @return + */ + @GetMapping(value = "/getStationByRouteId/{routeId}") + public AjaxResult getStationByRouteId(@PathVariable("routeId") Long routeId) + { + return success(mesBaseRouteService.getStationByRouteId(routeId)); + } } 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 30ce786..30122ba 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 @@ -102,4 +102,26 @@ public class MesProductPlanController extends BaseController { return toAjax(mesProductPlanService.deleteMesProductPlanByPlanIds(planIds)); } + + /** + * 获取派工编号 + * + * @return orderCode + */ + @GetMapping(value = "/getDispatchCode") + public AjaxResult getDispatchCode() { + return success(mesProductPlanService.getDispatchCode()); + } + + /** + * 生产工单新增生产派工List + */ + @RequiresPermissions("mes:productplan:add") + @Log(title = "生产派工", businessType = BusinessType.INSERT) + @PostMapping("/orderAddMesProductPlanList") + public AjaxResult orderAddMesProductPlanList(@RequestBody List mesProductPlanList) + { + return toAjax(mesProductPlanService.orderAddMesProductPlanList(mesProductPlanList)); + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java index 3393aae..b0127c4 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java @@ -77,6 +77,7 @@ public class MesProductOrder extends BaseEntity { @Excel(name = "派工ID") private Long dispatchId; + /** * 销售数量;销售订单的销售数量 */ @@ -160,6 +161,48 @@ public class MesProductOrder extends BaseEntity { */ private String saleOrderFlag; + /** + * 工艺路线名称 + */ + @Excel(name = "工艺路线名称") + private String dispatchName; + + /** + * 物料编号 + */ + @Excel(name = "物料编号") + private String materialCode; + + /** + * 物料名称 + */ + @Excel(name = "物料名称") + private String materialName; + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getDispatchName() { + return dispatchName; + } + + public void setDispatchName(String dispatchName) { + this.dispatchName = dispatchName; + } + public Date getPlanDeliveryDate() { return planDeliveryDate; } 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 5c89c1b..3a8e768 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,12 +26,12 @@ public class MesProductPlan extends BaseEntity @Excel(name = "生产工单ID") private Long productOrderId; - /** 计划编号 */ - @Excel(name = "计划编号") + /** 工单编号 */ + @Excel(name = "工单编号") private String planCode; /** 派工单号;主要为顺序生产时,获取上一工序的派工单是否完成,每次派工生成的派工单号相同,不同次派工的派工单号不能相同 */ - @Excel(name = "派工单号;主要为顺序生产时,获取上一工序的派工单是否完成,每次派工生成的派工单号相同,不同次派工的派工单号不能相同") + @Excel(name = "派工单号") private String dispatchCode; /** 物料ID */ @@ -39,7 +39,7 @@ public class MesProductPlan extends BaseEntity private Long materialId; /** 物料bomID,关联mes_material_bom的material_bom_id */ - @Excel(name = "物料bomID,关联mes_material_bom的material_bom_id") + @Excel(name = "物料bomID") private Long materialBomId; /** 工序ID */ @@ -47,7 +47,7 @@ public class MesProductPlan extends BaseEntity private Long processId; /** 顺序;派工类型是工艺路线的需要有顺序 */ - @Excel(name = "顺序;派工类型是工艺路线的需要有顺序") + @Excel(name = "顺序") private Long processOrder; /** 上一工序ID */ @@ -55,11 +55,11 @@ public class MesProductPlan extends BaseEntity private Long lastProcessId; /** 工位ID,关联工位信息主键;根据选择的工序或者工艺路线拆分到工位上,会拆分1到多条生产计划 */ - @Excel(name = "工位ID,关联工位信息主键;根据选择的工序或者工艺路线拆分到工位上,会拆分1到多条生产计划") + @Excel(name = "工位ID") private Long stationId; - /** 用户ID,关联sys_user主键;预留,暂时不用 */ - @Excel(name = "用户ID,关联sys_user主键;预留,暂时不用") + /** 用户ID*/ + @Excel(name = "用户ID") private Long userId; /** 单位生产时间(单位:s) */ @@ -95,15 +95,15 @@ public class MesProductPlan extends BaseEntity private Date realEndTime; /** 附件信息,关联附件信息主键;多个用,隔开;页面可选择附件信息,也可直接上传 */ - @Excel(name = "附件信息,关联附件信息主键;多个用,隔开;页面可选择附件信息,也可直接上传") + @Excel(name = "附件信息") private String attachId; /** 计划状态:0-未派工;1-已派工;2-已开始 */ - @Excel(name = "计划状态:0-未派工;1-已派工;2-已开始;3-已完成") + @Excel(name = "计划状态") private String planStatus; /** 是否标识:1-是;0-否 */ - @Excel(name = "是否标识:1-是;0-否") + @Excel(name = "是否标识") private String isFlag; /** diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseRouteMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseRouteMapper.java index 8f6e5a7..bc439b7 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseRouteMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseRouteMapper.java @@ -1,5 +1,6 @@ package com.hw.mes.mapper; +import java.util.HashMap; import java.util.List; import com.hw.mes.domain.MesBaseRoute; import com.hw.mes.domain.MesBaseRouteProcess; @@ -84,4 +85,11 @@ public interface MesBaseRouteMapper * @return 结果 */ public int deleteMesBaseRouteProcessByRouteId(Long routeId); + + /** + * 根据工艺路线ID查询工位信息 + * @param routeId + * @return + */ + List> getStationByRouteId(Long routeId); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseRouteService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseRouteService.java index e564373..4be4af6 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseRouteService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseRouteService.java @@ -1,5 +1,6 @@ package com.hw.mes.service; +import java.util.HashMap; import java.util.List; import com.hw.mes.domain.MesBaseRoute; @@ -58,4 +59,12 @@ public interface IMesBaseRouteService * @return 结果 */ public int deleteMesBaseRouteByRouteId(Long routeId); + + /** + * 根据工艺路线ID查询工位信息 + * @param routeId + * @return + */ + List> getStationByRouteId(Long routeId); + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java index bbc1b8c..0942650 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java @@ -67,4 +67,19 @@ public interface IMesProductPlanService * @return 生产派工 */ public List selectMesProductPlanJoinList(MesProductPlan mesProductPlan); + + /** + * 获取派工编号 + * + * @return 生产派工 + */ + public String getDispatchCode(); + + /** + * 生产工单新增生产派工List + * + * @param mesProductPlanList 生产派工 + * @return 结果 + */ + public int orderAddMesProductPlanList(List mesProductPlanList); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseRouteServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseRouteServiceImpl.java index e555df0..3c87912 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseRouteServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseRouteServiceImpl.java @@ -1,5 +1,6 @@ package com.hw.mes.service.impl; +import java.util.HashMap; import java.util.List; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; @@ -136,4 +137,14 @@ public class MesBaseRouteServiceImpl implements IMesBaseRouteService } } } + + /** + * 根据工艺路线ID查询工位信息 + * @param routeId + * @return + */ + @Override + public List> getStationByRouteId(Long routeId) { + return mesBaseRouteMapper.getStationByRouteId(routeId); + } } 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 25a253f..90d5e0f 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 @@ -2,6 +2,7 @@ package com.hw.mes.service.impl; 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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -59,7 +60,9 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService @Override public int insertMesProductPlan(MesProductPlan mesProductPlan) { + mesProductPlan.setCreateBy(SecurityUtils.getUsername()); mesProductPlan.setCreateTime(DateUtils.getNowDate()); + mesProductPlan.setPlanCode(Seq.getId(Seq.planCodeSeqType, Seq.planCodeCode)); int rows = mesProductPlanMapper.insertMesProductPlan(mesProductPlan); insertMesProductPlanDetail(mesProductPlan); return rows; @@ -75,6 +78,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService @Override public int updateMesProductPlan(MesProductPlan mesProductPlan) { + mesProductPlan.setUpdateBy(SecurityUtils.getUsername()); mesProductPlan.setUpdateTime(DateUtils.getNowDate()); mesProductPlanMapper.deleteMesProductPlanDetailByPlanId(mesProductPlan.getPlanId()); insertMesProductPlanDetail(mesProductPlan); @@ -133,11 +137,27 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService } } + /** + * 获取派工编号 + * @return + */ + @Override + public String getDispatchCode() { + return Seq.getId(Seq.dispatchCodeSeqType, Seq.dispatchCodeCode); + } - - - - + /** + * 生产工单新增生产派工List + * @param mesProductPlanList 生产派工 + * @return + */ + @Override + public int orderAddMesProductPlanList(List mesProductPlanList) { + for (MesProductPlan mesProductPlan : mesProductPlanList) { + this.insertMesProductPlan(mesProductPlan); + } + return 1; + } /** * 查询生产派工列表Join product_order和base_material diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseRouteMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseRouteMapper.xml index c5f05ee..4c12625 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseRouteMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseRouteMapper.xml @@ -124,4 +124,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ( #{item.routeProcessId}, #{item.routeId}, #{item.processId}, #{item.processOrder}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + + \ No newline at end of file diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml index f68b642..a90542b 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml @@ -33,77 +33,85 @@ + + + - select product_order_id, - order_code, - sale_order_id, - saleorder_code, - saleorder_linenumber, - project_no, - material_id, - material_bom_id, - dispatch_type, - dispatch_id, - sale_amount, - plan_amount, - dispatch_amount, - complete_amount, - release_time, - plan_begin_time, - plan_end_time, - real_begin_time, - real_end_time, - order_status, - stock_lock_flag, - sale_order_flag, - plan_delivery_date, - remark, - create_by, - create_time, - update_by, - update_time - from mes_product_order + select mpo.product_order_id, + mpo.order_code, + mpo.sale_order_id, + mpo.saleorder_code, + mpo.saleorder_linenumber, + mpo.project_no, + mpo.material_id, + mpo.material_bom_id, + mpo.dispatch_type, + mpo.dispatch_id, + mbr.route_name dispatchName, + bmi.material_code, + bmi.material_name, + mpo.sale_amount, + mpo.plan_amount, + mpo.dispatch_amount, + mpo.complete_amount, + mpo.release_time, + mpo.plan_begin_time, + mpo.plan_end_time, + mpo.real_begin_time, + mpo.real_end_time, + mpo.order_status, + mpo.stock_lock_flag, + mpo.sale_order_flag, + mpo.plan_delivery_date, + mpo.remark, + mpo.create_by, + mpo.create_time, + mpo.update_by, + mpo.update_time + from mes_product_order mpo + left join mes_base_route mbr on mbr.route_id = mpo.dispatch_id + left join mes_base_material_info bmi on bmi.material_id = mpo.material_id import('@/views/mes/productplan/editProductPlan'), + name: 'productPlanEdit', + meta: { title: '工单生产派工', activeMenu: '/mes/productplan' } + } + ] + }, //查看工单路由,不可审批 { path: "/dms/repairInstanceActivitySelect", diff --git a/hw-ui/src/views/mes/productOrder/index.vue b/hw-ui/src/views/mes/productOrder/index.vue index d3d1034..5be6242 100644 --- a/hw-ui/src/views/mes/productOrder/index.vue +++ b/hw-ui/src/views/mes/productOrder/index.vue @@ -774,9 +774,13 @@ export default { /** 生产派工 */ handleDispatch(row) { - this.form.productOrderId = row.productOrderId; + const productOrderId = row.productOrderId || this.ids[0]; + const orderCode = row.orderCode; + const params = { pageNum: this.queryParams.pageNum }; + this.$tab.openPage("工单[" + orderCode + "]生产派工", '/mes/product-plan/index/' + productOrderId, params); }, + /** 提交按钮 */ submitForm() { this.$refs["form"].validate(valid => { diff --git a/hw-ui/src/views/mes/productplan/editProductPlan.vue b/hw-ui/src/views/mes/productplan/editProductPlan.vue new file mode 100644 index 0000000..f042c83 --- /dev/null +++ b/hw-ui/src/views/mes/productplan/editProductPlan.vue @@ -0,0 +1,278 @@ + + + diff --git a/hw-ui/src/views/mes/productplan/index.vue b/hw-ui/src/views/mes/productplan/index.vue new file mode 100644 index 0000000..3217dbd --- /dev/null +++ b/hw-ui/src/views/mes/productplan/index.vue @@ -0,0 +1,625 @@ + + +