From ca5aca117ff894e32d2dd426a60612dcde8028b6 Mon Sep 17 00:00:00 2001 From: xs Date: Thu, 29 Aug 2024 18:26:36 +0800 Subject: [PATCH] =?UTF-8?q?2.9.8=20MES:=20-=E5=9C=A8=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=89=A9=E6=96=99=E9=A1=B5=E9=9D=A2=E6=90=9C=E7=B4=A2=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=A2=9E=E5=8A=A0=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=80=89=E6=8B=A9=20-=E7=94=9F=E4=BA=A7=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=AE=8C=E5=96=84=20-=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=9F=A5=E8=AF=A2=E5=AE=8C=E5=96=84=20-?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E6=9F=A5=E8=AF=A2=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/utils/file/MimeTypeUtils.java | 4 +- .../com/hw/common/log/enums/BusinessType.java | 15 ++ .../controller/MesProductOrderController.java | 8 +- .../controller/MesProductPlanController.java | 5 +- .../impl/MesProductPlanServiceImpl.java | 24 ++- .../mapper/mes/MesPurchaseOrderMapper.xml | 1 + .../mapper/mes/MesSaleOrderMapper.xml | 2 + .../java/com/hw/wms/domain/WmsRawInstock.java | 14 ++ .../impl/WmsRawInstockServiceImpl.java | 4 +- .../mapper/wms/WmsRawInstockMapper.xml | 3 + hw-ui/src/router/index.js | 4 +- .../views/board/common/applyRawOutstock.vue | 1 - hw-ui/src/views/board/fifthFloor/index.vue | 14 +- hw-ui/src/views/board/firstFloor/index.vue | 11 +- .../src/views/board/fourthFloor/assemble.vue | 11 +- hw-ui/src/views/mes/materialBom/addBom.vue | 1 + hw-ui/src/views/mes/materialBom/index.vue | 73 ++++---- hw-ui/src/views/mes/materialinfo/index.vue | 35 +++- .../views/mes/materialinfo/selectMaterial.vue | 10 +- hw-ui/src/views/mes/productOrder/index.vue | 24 ++- .../views/mes/productplan/addProductPlan.vue | 2 +- .../views/mes/productplan/editProductPlan.vue | 156 ++++++++++++------ hw-ui/src/views/mes/productplan/index.vue | 4 +- hw-ui/src/views/mes/purchaseOrder/index.vue | 27 ++- hw-ui/src/views/mes/saleOrder/index.vue | 57 ++++--- 25 files changed, 363 insertions(+), 147 deletions(-) diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/file/MimeTypeUtils.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/file/MimeTypeUtils.java index 3f5cc89..8873d5f 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/file/MimeTypeUtils.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/utils/file/MimeTypeUtils.java @@ -36,7 +36,9 @@ public class MimeTypeUtils // 视频格式 "mp4", "avi", "rmvb", // pdf - "pdf" }; + "pdf", + //图纸 + "dxf","dwg"}; public static String getExtension(String prefix) { diff --git a/hw-common/hw-common-log/src/main/java/com/hw/common/log/enums/BusinessType.java b/hw-common/hw-common-log/src/main/java/com/hw/common/log/enums/BusinessType.java index a952eef..70bd8f3 100644 --- a/hw-common/hw-common-log/src/main/java/com/hw/common/log/enums/BusinessType.java +++ b/hw-common/hw-common-log/src/main/java/com/hw/common/log/enums/BusinessType.java @@ -143,4 +143,19 @@ public enum BusinessType * 继续 */ CONTINUE, + + /** + * 排产,适合生产工单批量管理修改时间 + */ + MANAGEMENT, + + /** + * 发布 + */ + PUBLISH, + + /** + * 撤回 + */ + RECALL, } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductOrderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductOrderController.java index 3c68512..c706d03 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductOrderController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductOrderController.java @@ -114,6 +114,8 @@ public class MesProductOrderController extends BaseController { * @param productOrderList * @return */ + @RequiresPermissions("mes:productOrder:management") + @Log(title = "生产工单", businessType = BusinessType.MANAGEMENT) @PostMapping("/batchEditingProductOrder") public AjaxResult batchEditingProductOrder(@RequestBody List productOrderList) { int result = mesProductOrderService.batchEditingProductOrder(productOrderList); @@ -131,7 +133,7 @@ public class MesProductOrderController extends BaseController { } /** - * 锁库存 + * 锁库存(废弃) */ @Log(title = "生产工单", businessType = BusinessType.UPDATE) @PostMapping("/productOrderLockInventory") @@ -142,7 +144,8 @@ public class MesProductOrderController extends BaseController { /** * 工单发布 */ - @Log(title = "生产工单", businessType = BusinessType.UPDATE) + @Log(title = "生产工单", businessType = BusinessType.PUBLISH) + @RequiresPermissions("mes:productOrder:publish") @PostMapping("/productOrderPublish") public AjaxResult productOrderPublish(@RequestBody MesProductOrder mesProductOrder) { return toAjax(mesProductOrderService.productOrderPublish(mesProductOrder)); @@ -186,6 +189,7 @@ public class MesProductOrderController extends BaseController { * 查询物料使用情况 */ // @RequiresPermissions("mes:productplan:add") + @RequiresPermissions("mes:productOrder:materialUsage") @GetMapping("/getMaterialUsages") public AjaxResult getMaterialUsages(MesProductOrder mesProductOrder) { return success(mesProductOrderService.getMaterialUsages(mesProductOrder)); 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 4b1ea62..8a560b7 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 @@ -112,7 +112,7 @@ public class MesProductPlanController extends BaseController { /** * 修改生产派工 */ - @RequiresPermissions("mes:productplan:edit") + @RequiresPermissions("mes:productplan:add") @Log(title = "生产派工", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MesProductPlan mesProductPlan) { @@ -216,7 +216,8 @@ public class MesProductPlanController extends BaseController { /** * 工单撤回 */ - @Log(title = "生产工单", businessType = BusinessType.UPDATE) + @Log(title = "生产工单", businessType = BusinessType.RECALL) + @RequiresPermissions("mes:productOrder:recall") @PostMapping("/productOrderRecall") public AjaxResult productOrderRecall(@RequestBody MesProductOrder mesProductOrder) { return toAjax(mesProductPlanService.productOrderRecall(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 524fb13..d950b37 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 @@ -232,14 +232,14 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { p.getPlanId() == null ).collect(Collectors.toList()); StringBuffer returnMsgBuffer = new StringBuffer(); - int i=1; + int i = 1; for (MesProductPlan toInsertedProductPlan : toInsertedProductPlanList) { List conflictProductPlans = mesProductPlanMapper.selectOnlyConflictMesProductPlans(toInsertedProductPlan); if (conflictProductPlans != null && !conflictProductPlans.isEmpty()) { conflictProductPlans.forEach(cp -> { returnMsgBuffer.append(i).append(".").append(cp.getNickName()).append(":").append("计划时间") - .append(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,cp.getPlanBeginTime())) - .append("-").append(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,cp.getPlanEndTime())).append(";"); + .append(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, cp.getPlanBeginTime())) + .append("-").append(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, cp.getPlanEndTime())).append(";"); }); } } @@ -290,6 +290,8 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { throw new ServiceException("总派工数量不能大于计划数量,请重新派工"); } + Long orderPlanBeginTimeL = mesProductOrder.getPlanBeginTime() == null ? 0L : mesProductOrder.getPlanBeginTime().getTime(); + Long orderPlanEndTimeL = mesProductOrder.getPlanEndTime() == null ? 0L : mesProductOrder.getPlanEndTime().getTime(); /**每一个工序的productplan,都有可能派工给多个人,当某个人完成了,则此人的派工信息productplan就不能修改。 * 如果某个工序的部分人完成,则还可以继续派工此工序给其他人;如果某个工序的所有人都完成了则就不能继续派工此工序了(由于末工序完成有可能也只是修改了productorder的完成数量,在前端控制) @@ -300,6 +302,22 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { List mesProductPlanList = mesProductPlanEditVo.getMesProductPlanList(); for (MesProductPlan mesProductPlan : mesProductPlanList) { + Date planPlanBeginTime = mesProductPlan.getPlanBeginTime(); + Date planPlanEndTime = mesProductPlan.getPlanEndTime(); + if (planPlanBeginTime != null) { + long planPlanBeginTimeL = planPlanBeginTime.getTime(); + if (planPlanBeginTimeL < orderPlanBeginTimeL || planPlanBeginTimeL > orderPlanEndTimeL) { + throw new ServiceException("生产派工的计划开始时间不在生产工单计划时间范围内"); + } + } + + if (planPlanEndTime != null) { + long planPlanEndTimeL = planPlanEndTime.getTime(); + if (planPlanEndTimeL < orderPlanBeginTimeL || planPlanEndTimeL > orderPlanEndTimeL) { + throw new ServiceException("生产派工的计划结束时间不在生产工单计划时间范围内"); + } + } + Long planId = mesProductPlan.getPlanId(); if (planId != null) { MesProductPlan dbProductPlan = orderProductPlans.stream().filter(orderProductPlan -> orderProductPlan.getPlanId().equals(planId)).findFirst().get(); diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml index 8a66bbe..30ea19b 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml @@ -415,6 +415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mpo.src_bill_no like concat('%', #{srcBillNo}, '%') and mpo.tond_base like concat('%', #{tondBase}, '%') + order by mpo.erp_modify_date desc diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml index 7aab61e..1204be3 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml @@ -253,7 +253,9 @@ and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec}, '%') + and mso.is_release = #{isRelease} + order by mso.erp_modify_date desc diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java index 6c517ed..900d4b5 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java @@ -33,6 +33,11 @@ public class WmsRawInstock extends BaseEntity @Excel(name = "库位编码") private String locationCode; + /** + * 采购订单ID + */ + private Long purchaseOrderId; + /** 采购订单号,入库扫描条码时获取唯一条码 */ @Excel(name = "采购订单号,入库扫描条码时获取唯一条码") private String poNo; @@ -189,6 +194,15 @@ public class WmsRawInstock extends BaseEntity { return locationCode; } + + public Long getPurchaseOrderId() { + return purchaseOrderId; + } + + public void setPurchaseOrderId(Long purchaseOrderId) { + this.purchaseOrderId = purchaseOrderId; + } + public void setPoNo(String poNo) { this.poNo = poNo; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java index ced7b65..fdfb795 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java @@ -181,19 +181,20 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { } } - Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); WmsRawInstock wmsRawInstock = new WmsRawInstock(); wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType, Seq.rawInstockSeqCode)); wmsRawInstock.setWarehouseId(baseLocation.getWarehouseId()); wmsRawInstock.setLocationCode(locationCode); + wmsRawInstock.setPurchaseOrderId(baseBarcodeInfo.getPurchaseOrderId()); wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo()); wmsRawInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL); wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_PURCHASE); wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); wmsRawInstock.setApplyBy(userName); wmsRawInstock.setApplyDate(currentDate); + if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) { wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode()); } @@ -336,6 +337,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { WmsRawInstock wmsRawInstock = new WmsRawInstock(); wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType, Seq.rawInstockSeqCode)); wmsRawInstock.setWarehouseId(wmsRawBackVo.getWarehouseId()); + wmsRawInstock.setPurchaseOrderId(baseBarcodeInfo.getPurchaseOrderId()); wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo()); wmsRawInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO); wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_RETURN); diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml index c851c25..3c3f3f1 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml @@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -75,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" task_code, warehouse_id, location_code, + purchase_order_id, po_no, operation_type, instock_type, @@ -101,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{taskCode}, #{warehouseId}, #{locationCode}, + #{purchaseOrderId}, #{poNo}, #{operationType}, #{instockType}, diff --git a/hw-ui/src/router/index.js b/hw-ui/src/router/index.js index dad2493..7e79010 100644 --- a/hw-ui/src/router/index.js +++ b/hw-ui/src/router/index.js @@ -314,7 +314,7 @@ export const dynamicRoutes = [ path: '/mes/product-plan', component: Layout, hidden: true, - permissions: ['mes:productplan:edit'], + permissions: ['mes:productplan:add'], children: [ { path: 'index/:productOrderId(\\d+)', @@ -328,7 +328,7 @@ export const dynamicRoutes = [ path: '/mes/production-scheduling', component: Layout, hidden: true, - permissions: ['mes:productplan:edit'], + permissions: ['mes:productOrder:management'], children: [ { path: 'index/:productOrderId(\\d+)', diff --git a/hw-ui/src/views/board/common/applyRawOutstock.vue b/hw-ui/src/views/board/common/applyRawOutstock.vue index 47fed21..9a3e4b7 100644 --- a/hw-ui/src/views/board/common/applyRawOutstock.vue +++ b/hw-ui/src/views/board/common/applyRawOutstock.vue @@ -207,7 +207,6 @@ export default { wmsRawOutstockDetailList: [] } - alert(JSON.stringify(this.form)) } if (this.defineData.maxPlanAmount) { this.maxPlanAmount = this.defineData.maxPlanAmount diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index 87397c2..a5925d8 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -498,7 +498,7 @@ - + @@ -723,14 +723,14 @@ export default { // }); // }, 60 * 1000) getLoginStationInfo().then(e => { - // if(!e.data){ - // this.$modal.msgError("登录工位有误"); - // return; - // } - // this.loginStationInfo = e.data; + if(!e.data){ + this.$modal.msgError("登录工位有误"); + return; + } + this.loginStationInfo = e.data; //TODO - this.loginStationInfo = {stationId:"1",stationCode:"ZP_02"} + // this.loginStationInfo = {stationId:"1",stationCode:"ZP_02"} this.getProductPlans(); this.getChartData(); }); diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 43ee4d1..7311f9c 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -510,6 +510,11 @@ const vw = (document.documentElement.clientWidth || document.body.clientWidth) / export default { name: 'Board1', dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', "mes_safe_flag"], + provide(){ + return{ + closeDialog : this.closeDialog + } + }, components: { 'apply-raw-outstock': applyRawOutstock, Chart, @@ -1106,7 +1111,11 @@ export default { this.materialConfirmForm.materialBarcode = this.serialData; } // console.log(this.serialData) - } + }, + + closeDialog(){ + this.dialogVisible = false; + }, } } diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index 42fac4f..bffa995 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -355,6 +355,11 @@ const vw = (document.documentElement.clientWidth || document.body.clientWidth) / export default { name: 'Board1', dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', 'mes_safe_flag'], + provide(){ + return{ + closeDialog : this.closeDialog + } + }, mixins: [monitorSerialData], components: { 'apply-raw-outstock': applyRawOutstock, @@ -1099,7 +1104,11 @@ export default { this.returnModelForm.materialBarcode = this.serialData; } // console.log(this.serialData) - } + }, + + closeDialog(){ + this.dialogVisible = false; + }, } diff --git a/hw-ui/src/views/mes/materialBom/addBom.vue b/hw-ui/src/views/mes/materialBom/addBom.vue index edf1237..0c90001 100644 --- a/hw-ui/src/views/mes/materialBom/addBom.vue +++ b/hw-ui/src/views/mes/materialBom/addBom.vue @@ -1,3 +1,4 @@ +