From 122ca93cd2bcac6fce6bf9bce76eeb949198c90f Mon Sep 17 00:00:00 2001 From: yinq Date: Thu, 19 Dec 2024 09:37:23 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E8=BD=A6=E9=97=B4=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E6=A0=B9=E6=8D=AEplanId=E6=9F=A5=E7=9C=8BSOP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MesProductPlanController.java | 12 ++++++ .../mes/service/IMesProductPlanService.java | 8 ++++ .../impl/MesProductPlanServiceImpl.java | 42 +++++++++++++++++++ .../mapper/mes/MesProductPlanMapper.xml | 1 + hw-ui/src/api/mes/productplan.js | 8 ++++ hw-ui/src/views/board/fifthFloor/index.vue | 4 +- hw-ui/src/views/board/firstFloor/index.vue | 4 +- .../src/views/board/fourthFloor/assemble.vue | 4 +- .../views/board/fourthFloor/laserLight.vue | 4 +- hw-ui/src/views/board/fourthFloor/weld.vue | 4 +- 10 files changed, 81 insertions(+), 10 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 8826861a..14448cbf 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 @@ -340,6 +340,7 @@ public class MesProductPlanController extends BaseController { /** * 校验生产派工是否已绑定附件 + * @param attachType * @param attachId * @return */ @@ -347,4 +348,15 @@ public class MesProductPlanController extends BaseController { public AjaxResult checkMesProductPlanAttachInfo(@PathVariable("attachType") String attachType, @PathVariable("attachId") String attachId) { return success(mesProductPlanService.checkMesProductPlanAttachInfo(attachType, attachId)); } + + /** + * 根据planId获取生产派工SOP附件List列表 + * @param attachType + * @param planId + * @return + */ + @GetMapping(value = "/getDispatchAttachByPlanIdList/{attachType}/{planId}") + public AjaxResult getDispatchAttachByPlanIdList(@PathVariable("attachType") String attachType, @PathVariable("planId") Long planId) { + return success(mesProductPlanService.getDispatchAttachByPlanIdList(attachType, planId)); + } } 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 fa53dc55..8abe359e 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 @@ -202,4 +202,12 @@ public interface IMesProductPlanService * @return */ String checkMesProductPlanAttachInfo(String attachType, String attachId); + + /** + * 根据planId获取生产派工SOP附件List列表 + * @param attachType + * @param planId + * @return + */ + public List getDispatchAttachByPlanIdList(String attachType, Long planId); } 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 c67bb4b3..85c01539 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 @@ -848,6 +848,48 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { return result; } + /** + * 根据planId获取生产派工SOP附件List列表 + * @param attachType + * @param planId + * @return + */ + @Override + public List getDispatchAttachByPlanIdList(String attachType, Long planId) { + MesProductPlan queryProductPlan = new MesProductPlan(); + queryProductPlan.setPlanId(planId); + List mesProductPlans = mesProductPlanMapper.selectOnlyMesProductPlans(queryProductPlan); + if (mesProductPlans != null && !mesProductPlans.isEmpty()) { + MesProductPlan mesProductPlan = mesProductPlans.get(0); + try { + if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) { + if (StringUtils.isEmpty(mesProductPlan.getAttachId())) { + return new ArrayList<>(); + } + Long[] attachIds = Arrays.stream(mesProductPlan.getAttachId().split(",")) + .map(String::trim) + .map(Long::parseLong) + .toArray(Long[]::new); + return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(attachIds); + } else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)) { + if (StringUtils.isEmpty(mesProductPlan.getSopId())) { + return new ArrayList<>(); + } + Long[] sopIds = Arrays.stream(mesProductPlan.getSopId().split(",")) + .map(String::trim) + .map(Long::parseLong) + .toArray(Long[]::new); + return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(sopIds); + } else { + return new ArrayList<>(); + } + } catch (Exception e) { + return new ArrayList<>(); + } + } + return new ArrayList<>(); + } + // public String executeAssignTaskResultTask() { // ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); 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 191f1ebb..6221e7a3 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 @@ -509,6 +509,7 @@ a.is_flag from mes_product_plan a + and a.plan_id = #{planId} and a.dispatch_code = #{dispatchCode} and a.process_id = #{processId} and a.user_id = #{userId} diff --git a/hw-ui/src/api/mes/productplan.js b/hw-ui/src/api/mes/productplan.js index 5820359d..b98eb3da 100644 --- a/hw-ui/src/api/mes/productplan.js +++ b/hw-ui/src/api/mes/productplan.js @@ -170,3 +170,11 @@ export function checkMesProductPlanAttachInfo(attachType, attachIds) { method: 'get' }) } + +// 根据planId获取生产派工SOP附件List列表 +export function getDispatchAttachByPlanIdList(attachType, planId) { + return request({ + url: '/mes/productplan/getDispatchAttachByPlanIdList/' + attachType + '/' + planId, + method: 'get' + }) +} diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index 6d47d496..d853d4ff 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -639,7 +639,7 @@ import applyRawReturn from '@//views/board/common/applyRawReturn.vue'; import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" import ViewFile from "@/components/viewFile/index.vue"; -import {getDispatchSOPAttachList} from "@/api/mes/productplan"; +import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan"; import {monitorSerialData} from "@/utils/serial"; import saleOrderRelates from "@/views/board/common/saleOrderRelates.vue"; @@ -1855,7 +1855,7 @@ export default { /** SOP预览*/ handleViewSOP(e) { this.fileListData = []; - getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => { + getDispatchAttachByPlanIdList("2", e.planId).then(res => { let attachList = res.data; let thisFileList = []; attachList.forEach(e => { diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 64a329ec..47c310cf 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -513,7 +513,7 @@ import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue"; import applyRawReturn from '@//views/board/common/applyRawReturn.vue'; import {getNowDateTime} from "@/utils/ruoyi"; import ViewFile from "@/components/viewFile/index.vue"; -import {getDispatchSOPAttachList} from "@/api/mes/productplan"; +import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan"; const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { @@ -1102,7 +1102,7 @@ export default { /** SOP预览*/ handleViewSOP(e){ this.fileListData = []; - getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => { + getDispatchAttachByPlanIdList("2", e.planId).then(res => { let attachList = res.data; let thisFileList = []; attachList.forEach(e => { diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index aa076948..ae5c5adb 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -494,7 +494,7 @@ import {getNowDateTime} from "@/utils/ruoyi"; import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" import ViewFile from "@/components/viewFile/index.vue"; -import {getDispatchSOPAttachList} from "@/api/mes/productplan"; +import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan"; const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { @@ -1270,7 +1270,7 @@ export default { /** SOP预览*/ handleViewSOP(e){ this.fileListData = []; - getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => { + getDispatchAttachByPlanIdList("2", e.planId).then(res => { let attachList = res.data; let thisFileList = []; attachList.forEach(e => { diff --git a/hw-ui/src/views/board/fourthFloor/laserLight.vue b/hw-ui/src/views/board/fourthFloor/laserLight.vue index f0d1ac48..cf7f3f7c 100644 --- a/hw-ui/src/views/board/fourthFloor/laserLight.vue +++ b/hw-ui/src/views/board/fourthFloor/laserLight.vue @@ -374,7 +374,7 @@ import {addWmslocation, updateWmslocation} from "@/api/wms/wmslocation"; import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" import ViewFile from "@/components/viewFile/index.vue"; -import {getDispatchSOPAttachList} from "@/api/mes/productplan"; +import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan"; const setState = (e) => { if (e === '1') { @@ -1335,7 +1335,7 @@ export default { /** SOP预览*/ handleViewSOP(){ this.fileListData = []; - getDispatchSOPAttachList(this.selectedRows.dispatchCode, this.selectedRows.processId).then(res => { + getDispatchAttachByPlanIdList("2", this.selectedRows.planId).then(res => { let attachList = res.data; let thisFileList = []; attachList.forEach(e => { diff --git a/hw-ui/src/views/board/fourthFloor/weld.vue b/hw-ui/src/views/board/fourthFloor/weld.vue index 5d15c6b9..8a960ce4 100644 --- a/hw-ui/src/views/board/fourthFloor/weld.vue +++ b/hw-ui/src/views/board/fourthFloor/weld.vue @@ -383,7 +383,7 @@ import { import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" import ViewFile from "@/components/viewFile/index.vue"; -import {getDispatchSOPAttachList} from "@/api/mes/productplan"; +import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan"; import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue"; import PrintPage from "@/views/board/barcode/workshopBarcode.vue"; @@ -1044,7 +1044,7 @@ export default { /** SOP预览*/ handleViewSOP(e) { this.fileListData = []; - getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => { + getDispatchAttachByPlanIdList("2", e.planId).then(res => { let attachList = res.data; let thisFileList = []; attachList.forEach(e => {