From d5c628ce003c0d004864681b763a62c7cd93de9f Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Tue, 10 Aug 2021 13:17:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8B=86=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- console/src/main/resources/application-qas.yml | 2 +- .../controller/SplitSfcController.java | 6 +++--- .../production/mapper/SplitSfcMapper.java | 2 +- .../production/service/SplitSfcService.java | 2 +- .../service/impl/SplitSfcServiceImpl.java | 18 ++++++++++++++---- .../main/resources/mapper/SplitSfcMapper.xml | 2 +- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/console/src/main/resources/application-qas.yml b/console/src/main/resources/application-qas.yml index 076f5a6b..54b8bdcd 100644 --- a/console/src/main/resources/application-qas.yml +++ b/console/src/main/resources/application-qas.yml @@ -33,7 +33,7 @@ ftp: #打印服务器配置 print: - server: http://localhost:8080/CodeSoftPrintWeb/printService + server: http://172.16.251.188:8022/print/mesnacprint activeMq: sendWeChatMessage: tcp://localhost:61616?wireFormat.maxInactivityDuration=0 diff --git a/production/src/main/java/com/foreverwin/mesnac/production/controller/SplitSfcController.java b/production/src/main/java/com/foreverwin/mesnac/production/controller/SplitSfcController.java index cd01bbea..a9ae99cb 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/controller/SplitSfcController.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/controller/SplitSfcController.java @@ -26,9 +26,9 @@ public class SplitSfcController { @ResponseBody @GetMapping("/getSfcData") - public R getSfcData(String sfc){ + public R getSfcData(SfcDto dto){ SfcDto result; - result = splitSfcService.getSfcData(sfc); + result = splitSfcService.getSfcData(dto); return R.ok(result); } @@ -49,7 +49,7 @@ public class SplitSfcController { @ResponseBody @GetMapping("/splitSfc") - public R getSfcData(SfcDto sfcDto){ + public R splitSfc(SfcDto sfcDto){ return R.ok( splitSfcService.splitSfc(sfcDto)); } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/mapper/SplitSfcMapper.java b/production/src/main/java/com/foreverwin/mesnac/production/mapper/SplitSfcMapper.java index 3ac0c6a3..4ef0f0ca 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/mapper/SplitSfcMapper.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/mapper/SplitSfcMapper.java @@ -20,5 +20,5 @@ public interface SplitSfcMapper extends BaseMapper { SfcDto getSfcData(@Param("handle") String handle); - SplitSfcDto getAbnormalQty(@Param("site")String site, @Param("sfc")String sfc, @Param("operation") String operation); + SplitSfcDto getAbnormalQty(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation,@Param("abnormalNo") String abnormalNo); } \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/SplitSfcService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/SplitSfcService.java index 7a7e9309..48bb4234 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/SplitSfcService.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/SplitSfcService.java @@ -27,7 +27,7 @@ public interface SplitSfcService extends IService { List selectList(SplitSfc splitSfc); - SfcDto getSfcData(String sfc); + SfcDto getSfcData(SfcDto dto); SfcDto getGoodSfcData(String sfc); diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java index ca2dd264..5a4ccfb1 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java @@ -73,9 +73,15 @@ public class SplitSfcServiceImpl extends ServiceImpl i } @Override - public SfcDto getSfcData(String sfc) { + public SfcDto getSfcData(SfcDto dto) { String site = CommonMethods.getSite(); - String handle = HandleEnum.SFC.getHandle(site, sfc); + String handle = HandleEnum.SFC.getHandle(site, dto.getSfc()); + if (StringUtil.isBlank(dto.getSfc())){ + throw new BaseException("产品条码不能为空"); + } + if (StringUtil.isBlank(dto.getAbnormalNo())){ + throw new BaseException("异常单号不能为空"); + } //根据sfc找工单等信息 SfcDto sfcData = splitSfcMapper.getSfcData(handle); if (sfcData==null){ @@ -83,7 +89,7 @@ public class SplitSfcServiceImpl extends ServiceImpl i } String operation = sfcData.getOperation(); //查询质量异常记录数量 - SplitSfcDto sfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation); + SplitSfcDto sfcDto=splitSfcMapper.getAbnormalQty(site,dto.getSfc(),operation,dto.getAbnormalNo()); if (sfcDto==null){ throw new BaseException("未找到闭环关闭的质量异常"); } @@ -154,6 +160,10 @@ public class SplitSfcServiceImpl extends ServiceImpl i public SplitSfc splitSfc(SfcDto sfcDto){ String site = CommonMethods.getSite(); String sfc = sfcDto.getSfc(); + String abnormalNo = sfcDto.getAbnormalNo(); + if (StringUtil.isBlank(abnormalNo)){ + throw new BaseException("异常单号不能为空"); + } String handle = HandleEnum.SFC.getHandle(site, sfc); BigDecimal splitQty = new BigDecimal(sfcDto.getQty()); @@ -164,7 +174,7 @@ public class SplitSfcServiceImpl extends ServiceImpl i throw new BaseException("未找到产品条码信息"); } //查询质量异常记录数量 处置工艺路线及不良代码 - SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation); + SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo); String routerBo = splitSfcDto.getRouterBo(); String ncCode = splitSfcDto.getNcCode(); if (StringUtil.isBlank(routerBo)){ diff --git a/production/src/main/resources/mapper/SplitSfcMapper.xml b/production/src/main/resources/mapper/SplitSfcMapper.xml index 235a0d55..f41b6117 100644 --- a/production/src/main/resources/mapper/SplitSfcMapper.xml +++ b/production/src/main/resources/mapper/SplitSfcMapper.xml @@ -380,7 +380,7 @@ From d0068c2479b3dd7e426c0923a081055434bc4c85 Mon Sep 17 00:00:00 2001 From: Leon <3066758958@qq.com> Date: Tue, 10 Aug 2021 13:20:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8F=98=E6=9B=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InterfaceServiceImpl.java | 48 +++++++++++-------- .../mesnac/meapi/mapper/OperationMapper.java | 2 +- .../meapi/service/OperationService.java | 9 ++++ .../service/impl/OperationServiceImpl.java | 5 +- .../main/resources/mapper/OperationMapper.xml | 9 +++- 5 files changed, 51 insertions(+), 22 deletions(-) diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java index d4c2d035..628379cb 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java @@ -442,13 +442,13 @@ public class InterfaceServiceImpl implements InterfaceService { * 2.MES资源类型=生产车间_ERP工作中心 * 3.MES资源类型=MES工序 */ - String erpWorkCenter = componentDto.getOPERATION(); - if (StringUtil.isBlank(erpWorkCenter)) { - throw BusinessException.build("BOM节点下字段【OPERATION】不能为空!"); + String stepId = componentDto.getSTEP_ID(); + if (StringUtil.isBlank(stepId)) { + throw BusinessException.build("步骤标示不能为空!"); } - Operation operationModel = operationService.queryOperationByErpWorkCenter(site, erpWorkCenter); + Operation operationModel = operationService.getOperationByRouterStepId(site, bom, stepId); if (operationModel == null) { - throw BusinessException.build("ERP工作中心【" +erpWorkCenter+"】对应的MES工序未维护"); + throw BusinessException.build("步骤标识【"+stepId+"】在工艺路线【"+bom+"】未到对应的工序"); } String operationBo = operationModel.getHandle(); @@ -532,10 +532,21 @@ public class InterfaceServiceImpl implements InterfaceService { String stepId = routerStepDto.getSTEP_ID(); String erpWorkCenter = routerStepDto.getOPERATION().trim(); + if (StringUtil.isBlank(entryRouterStep)) { + entryRouterStep = stepId; + } + + //上一步骤添加当前步骤为下一步骤 + if (i > 0) { + RouterNextStep routerNextStep = new RouterNextStep(); + routerNextStep.setNextStepId(stepId); + routerStepList.get(i - 1).getRouterNextStepList().add(routerNextStep); + } + String operation = null; String operationBo = null; if (StringUtil.isBlank(erpWorkCenter)) { - operation = (i == 0) ? "HJ01_6106GX" : "6106GX"; + operation = "6106GX"; Operation operationModel = operationService.getCurrentRevisionRef(site, operation); if (operationModel == null) { throw BusinessException.build("工序编号【" +operation+ "】不存在"); @@ -543,19 +554,6 @@ public class InterfaceServiceImpl implements InterfaceService { operation = operationModel.getOperation(); operationBo = operationModel.getHandle(); } else { - - if (StringUtil.isBlank(entryRouterStep)) { - entryRouterStep = stepId; - } - - //上一步骤添加当前步骤为下一步骤 - if (i > 0) { - RouterNextStep routerNextStep = new RouterNextStep(); - routerNextStep.setNextStepId(stepId); - routerStepList.get(i - 1).getRouterNextStepList().add(routerNextStep); - } - - /** * 工序参数说明: * 1.接口传过来的参数是ERP工作中心 @@ -680,6 +678,18 @@ public class InterfaceServiceImpl implements InterfaceService { if (StringUtil.isBlank(plannedItem)) { throw BusinessException.build("工单的计划物料不能拿为空"); } + + //查询物料清单和工艺路线 + Bom bomModel = bomService.getMaxRevisionBom(site, plannedBom); + if (bomModel == null) { + throw BusinessException.build("工单【" +shopOrder+ "】的物料清单未同步!"); + } + + Router routerModel = routerService.getMaxRevisionRouter(site, plannedRouter); + if (routerModel == null) { + throw BusinessException.build("工单【" +shopOrder+ "】的工艺路线未同步!"); + } + String plannedItemBo = HandleEnum.ITEM.getHandle(site, plannedItem, "A"); String plannedBomBo = HandleEnum.BOM.getHandle(site, plannedBom, bomType, "#"); String plannedRouterBo = HandleEnum.ROUTER.getHandle(site, plannedRouter, routerType, "#"); diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java index 125724c8..6351b508 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java @@ -29,5 +29,5 @@ public interface OperationMapper extends BaseMapper { IPage selectOperationStep( IPage page, @Param("locale") String locale,@Param("ew") Wrapper wrapper); - + Operation selectOperationByRouterStepId(@Param("site") String site, @Param("router") String router, @Param("stepId") String stepId); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java index c641d3fe..66826b7d 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java @@ -40,4 +40,13 @@ public interface OperationService extends IService { */ Operation queryOperationByErpWorkCenter(String site, String erpWorkCenter); + /** + * 查询工序By 工艺路线&步骤标识 + * + * @param site + * @param router + * @param stepId + * @return + */ + Operation getOperationByRouterStepId(String site, String router, String stepId); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java index 1c894695..921bcfb9 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java @@ -66,7 +66,10 @@ public class OperationServiceImpl extends ServiceImpl - + From ada6099b6b9218e5f82ae4a29f927002846dcc5a Mon Sep 17 00:00:00 2001 From: Leon <3066758958@qq.com> Date: Tue, 10 Aug 2021 13:47:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8F=98=E6=9B=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meapi/src/main/resources/mapper/OperationMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meapi/src/main/resources/mapper/OperationMapper.xml b/meapi/src/main/resources/mapper/OperationMapper.xml index 06968d98..d8d155d6 100644 --- a/meapi/src/main/resources/mapper/OperationMapper.xml +++ b/meapi/src/main/resources/mapper/OperationMapper.xml @@ -639,7 +639,7 @@