From acec9d177de20ead9379daff437ab8c16ee48db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Sat, 17 Jul 2021 11:23:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=BC=82=E5=B8=B8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AbnormalBillController.java | 3 ++ .../impl/AbnormalBillLogServiceImpl.java | 53 +++++++++++++++++-- .../service/impl/AbnormalBillServiceImpl.java | 10 ++-- .../resources/mapper/AbnormalBillMapper.xml | 4 +- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java index 3f8512c6..6153fcdb 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java @@ -10,6 +10,7 @@ import com.foreverwin.mesnac.anomaly.service.FileUploadedService; import com.foreverwin.mesnac.common.dto.SfcDispatchDto; import com.foreverwin.mesnac.common.service.AnomalyService; import com.foreverwin.mesnac.common.service.SfcDispatchCommonService; +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; @@ -79,6 +80,8 @@ public class AbnormalBillController { public R page(FrontPage frontPage, AbnormalBill abnormalBill){ IPage result; QueryWrapper queryWrapper = new QueryWrapper<>(); + String site = CommonMethods.getSite(); + abnormalBill.setSite(site); queryWrapper.setEntity(abnormalBill); if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { //TODO modify global query diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillLogServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillLogServiceImpl.java index c68e501f..c778dd40 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillLogServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillLogServiceImpl.java @@ -14,7 +14,14 @@ import com.foreverwin.mesnac.anomaly.service.AbnormalBillLogService; import com.foreverwin.mesnac.anomaly.service.AbnormalBillService; import com.foreverwin.mesnac.anomaly.service.AbnormalNcCodeService; import com.foreverwin.mesnac.common.constant.Constants; +import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.util.StringUtil; +import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper; +import com.foreverwin.mesnac.meapi.mapper.ShopOrderMapper; +import com.foreverwin.mesnac.meapi.model.Router; +import com.foreverwin.mesnac.meapi.model.ShopOrder; +import com.foreverwin.mesnac.meapi.service.RouterService; +import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import org.springframework.beans.factory.annotation.Autowired; @@ -53,6 +60,15 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, AbnormalBillLog abnormalBillLog) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -71,6 +87,7 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl ncGroupAndNcCodes, List dutyCauseType, List dutyType) { String user = CommonMethods.getUser(); LocalDateTime now = LocalDateTime.now(); + String site = CommonMethods.getSite(); AbnormalBillLog abnormalBillLog = abnormalBillLogMapper.findAllByAbnormalNo(abnormalBill); if(abnormalBillLogMapper.selectById(abnormalBillLog.getHandle()) == null){ @@ -118,11 +135,41 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl routers = routerService.selectList(router); + if(routers == null || routers.size() == 0){ + throw BusinessException.build("该返修工艺不存在"); + } + } + //判断返修工单是否正确 + if(!StringUtil.isBlank(abnormalBillDispose.getResolveShopOrder())){ + ShopOrder shopOrder = shopOrderMapper.selectById(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBillDispose.getResolveShopOrder())); + if(shopOrder == null){ + throw BusinessException.build("该返修工单不存在"); + } + } + //发送用户 + String[] split = abnormalBillDispose.getResolveSendUser().split(","); + List strings = Arrays.asList(split); + int length = nwaUserMapper.checkUser(site, strings); + if(length != strings.size()){ + throw BusinessException.build("发送用户填报错误"); + } + + + if(Constants.ABNORMAL_QUALITY.equals(abnormalBill.getType())){ abnormalBillService.anomalyReport(abnormalBill,abnormalBillDispose,ncGroupAndNcCodes,dutyCauseType,dutyType); + }else if(Constants.ABNORMAL_OTHER.equals(abnormalBill.getType())){ + abnormalBillService.anomalyReportOther(abnormalBill,abnormalBillDispose,dutyCauseType,dutyType); } } } \ No newline at end of file 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 78fed7c5..016285c9 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 @@ -186,10 +186,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} - ${ew.sqlSegment} + AND ${ew.sqlSegment} - ${ew.sqlSegment} + AND ${ew.sqlSegment}