From e61e462b4f6401f645e9b18358c5653038c9d276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Wed, 11 Aug 2021 17:56:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=8F=90=E6=8A=A5=E6=97=B6=E6=A0=A1=E9=AA=8C=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E4=BA=A7=E5=93=81&=E5=B7=A5=E5=BA=8F=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=9C=89=E6=9C=AA=E5=AE=8C=E6=88=90=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=9C=89=E4=B8=8D=E8=83=BD=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AbnormalBillServiceImpl.java | 94 ++++++++++++++----- 1 file changed, 68 insertions(+), 26 deletions(-) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index e48cfeb1..99eb81fa 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -246,16 +246,16 @@ public class AbnormalBillServiceImpl extends ServiceImpl status = new ArrayList<>(); - status.add(Constants.PROGRAM_CONFIRM); - status.add(Constants.CANCEL); - status.add(Constants.SHUT_DOWN); - List abnormalBillList = abnormalBillMapper.findCountBySfc(abnormalBill.getSite(), abnormalBill.getType(), abnormalBill.getSfc(), status); - if(abnormalBillList.size() >= 1 ){ - throw BusinessException.build("设备异常有未处理完成的sfc"); - } - } +// if(!StringUtil.isBlank(abnormalBill.getSfc()) ){ +// List status = new ArrayList<>(); +// status.add(Constants.PROGRAM_CONFIRM); +// status.add(Constants.CANCEL); +// status.add(Constants.SHUT_DOWN); +// List abnormalBillList = abnormalBillMapper.findCountBySfc(abnormalBill.getSite(), abnormalBill.getType(), abnormalBill.getSfc(), status); +// if(abnormalBillList.size() >= 1 ){ +// throw BusinessException.build("设备异常有未处理完成的sfc"); +// } +// } abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose); this.saveOrUpdate(abnormalBill); //发送消息 @@ -463,20 +463,29 @@ public class AbnormalBillServiceImpl extends ServiceImpl dutyCauseType,List dutyType) { String site = CommonMethods.getSite(); - //返回的消息 - String message = "提报成功"; LocalDateTime currentTime = LocalDateTime.now(); String user = CommonMethods.getUser(); + + + //return 返回的消息 + String message = "提报成功"; + + //如果前台传过来的异常单为空的话,则抛出一个异常 if(StringUtil.isBlank(abnormalBill.getAbnormalNo())) { throw BusinessException.build("异常单号不存在"); } + + //设置异常单的handle abnormalBill.setHandle(HandleEnum.ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo())); + //判断该异常单是否已经提交 if(abnormalBillMapper.selectById(abnormalBill.getHandle()) != null && !Constants.SHUT_DOWN.equals(abnormalBill.getStatus())){ throw BusinessException.build("该异常单已经提交,请清空后提交"); } + + /** * 取消异常提报的更新 */ @@ -492,14 +501,18 @@ public class AbnormalBillServiceImpl extends ServiceImpl causeTypes = new ArrayList<>(); if(dutyCauseType != null && dutyCauseType.size() >= 1){ @@ -525,6 +538,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl operationQueryWrapper = new QueryWrapper(); @@ -536,7 +550,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl ncCodes = Arrays.asList(abnormalBill.getNcCode().split(",")); Integer length = ncCodeMapper.checkNcCode(ncCodes,site,"FAILURE"); @@ -571,17 +586,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl 0){ abnormalDutyService.saveOrUpdateBatch(dutyTypes); @@ -649,6 +664,33 @@ public class AbnormalBillServiceImpl extends ServiceImpl status = new ArrayList<>(); + status.add(Constants.PROGRAM_CONFIRM); + status.add(Constants.CANCEL); + status.add(Constants.SHUT_DOWN); + List abnormalBillList = abnormalBillMapper.findCountBySfc(abnormalBill.getSite(), abnormalBill.getType(), abnormalBill.getSfc(), status); + String abnormalType = abnormalBill.getType().equals(Constants.ABNORMAL_QUALITY) ? "质量异常" : + abnormalBill.getType().equals(Constants.ABNORMAL_OTHER) ? "其他异常" : "设备异常" ; + if(abnormalBillList.size() >= 1 ){ + throw BusinessException.build(abnormalType + "有未处理完成的产品条码(SFC)"); + } + + + //设置创建时间和更新时间 + if(abnormalBillMapper.selectById(abnormalBill.getHandle()) == null){ + abnormalBill.setCreatedDateTime(currentTime); + abnormalBill.setCreatedUser(user); + abnormalBillDispose.setCreatedDataTime(currentTime); + abnormalBillDispose.setCreatedUser(user); + } + abnormalBill.setModifiedDateTime(currentTime); + abnormalBill.setModifiedUser(user); + abnormalBillDispose.setModifiedDateTime(currentTime); + abnormalBillDispose.setModifiedUser(user); + + // this.anomalyCreatedAndSendMessage(abnormalBill,null); return message; From a0d55d759a9aaa2386dabfe13136da7680050995 Mon Sep 17 00:00:00 2001 From: Leon <3066758958@qq.com> Date: Thu, 12 Aug 2021 10:51:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8F=AB=E6=96=99=E6=9F=A5=E8=AF=A2BUG?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CallItemServiceImpl.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java index 5311e584..2850dd56 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java @@ -329,7 +329,17 @@ public class CallItemServiceImpl extends ServiceImpl i continue; } - if ("GB".equals(itemGroup) && blankingSize.contains("*")) { + if (StringUtil.isBlank(blankingSize)) { + callItem.setSizeReqQty(callItem.getRequiredQty()); + compQtyMap.put(component, callItem.getRequiredQty()); + continue; + } + + if ("GB".equals(itemGroup)) { + if (!blankingSize.contains("*")) { + continue; + } + String []size = blankingSize.split("\\*"); if (size != null && size.length >= 2) { int sizeLength = size.length; @@ -342,7 +352,13 @@ public class CallItemServiceImpl extends ServiceImpl i compQtyMap.put(component, (compQtyMap.get(component) != null ? compQtyMap.get(component).add(sizeReqQty) : sizeReqQty)); } } else { - String []size = blankingSize.split("\\*"); + String[] size = new String[1]; + if (blankingSize.contains("*")) { + size = blankingSize.split("\\*"); + } else { + size[0] = blankingSize; + } + if (size != null && size.length >= 1) { int sizeLength = size.length; BigDecimal length = new BigDecimal(size[sizeLength-1]); From 5213bb81eff07268fe07bcd52a1c0ef98daeab98 Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Thu, 12 Aug 2021 11:04:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meapi/controller/ResrceController.java | 19 +++++++------------ .../main/resources/mapper/ResrceMapper.xml | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java index abc1cc9d..5ac59e01 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java @@ -1,19 +1,16 @@ package com.foreverwin.mesnac.meapi.controller; -import com.foreverwin.mesnac.meapi.util.StringUtils; -import com.foreverwin.modular.core.util.R; -import com.foreverwin.modular.core.util.FrontPage; -import com.foreverwin.modular.core.util.CommonMethods; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springframework.web.bind.annotation.RequestMapping; +import com.foreverwin.mesnac.meapi.model.Resrce; +import com.foreverwin.mesnac.meapi.service.ResrceService; +import com.foreverwin.mesnac.meapi.util.StringUtils; +import com.foreverwin.modular.core.util.CommonMethods; +import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.modular.core.util.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import com.foreverwin.mesnac.meapi.service.ResrceService; -import com.foreverwin.mesnac.meapi.model.Resrce; - -import java.util.ArrayList; import java.util.List; /** @@ -98,9 +95,7 @@ public class ResrceController { queryWrapper.setEntity(resrce); if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { queryWrapper - .like(Resrce.HANDLE, frontPage.getGlobalQuery()) - .or().like(Resrce.SITE, frontPage.getGlobalQuery()) - .or().like(Resrce.RESRCE, frontPage.getGlobalQuery()) + .like(Resrce.RESRCE, frontPage.getGlobalQuery()) .or().like(Resrce.DESCRIPTION, frontPage.getGlobalQuery()) .or().like(Resrce.STATUS_BO, frontPage.getGlobalQuery()) .or().like(Resrce.PROCESS_RESOURCE, frontPage.getGlobalQuery()) diff --git a/meapi/src/main/resources/mapper/ResrceMapper.xml b/meapi/src/main/resources/mapper/ResrceMapper.xml index 4bb9b417..beea997e 100644 --- a/meapi/src/main/resources/mapper/ResrceMapper.xml +++ b/meapi/src/main/resources/mapper/ResrceMapper.xml @@ -284,7 +284,7 @@ - AND ${ew.sqlSegment} + ${ew.sqlSegment}