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; 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]); 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}