From 2a7422d305d0a1644397008ed06dbacb2d26295f Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Mon, 23 Aug 2021 11:18:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E9=9D=A2=E6=9D=BF=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/controller/PodTemplateController.java | 12 ++++++++++-- .../production/service/PodTemplateService.java | 2 +- .../service/impl/PodTemplateServiceImpl.java | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/production/src/main/java/com/foreverwin/mesnac/production/controller/PodTemplateController.java b/production/src/main/java/com/foreverwin/mesnac/production/controller/PodTemplateController.java index 9f7b5e9f..ad6274f8 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/controller/PodTemplateController.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/controller/PodTemplateController.java @@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -76,9 +77,16 @@ public class PodTemplateController { if (StringUtil.isBlank(resrce)) { throw new BaseException("资源不能为空"); } - for (SfcDto sfcDto : sfcDtoList) { - podTemplateService.sfcComplete(sfcDto,resrce); + ArrayList sfcList = new ArrayList<>(); + try { + for (SfcDto sfcDto : sfcDtoList) { + String completeSfc = podTemplateService.sfcComplete(sfcDto, resrce); + sfcList.add(completeSfc); + } + }catch (Exception e){ + return R.failed(sfcList,e.getMessage()); } + return R.ok(); } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java index 14cd85eb..23bb03bd 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/PodTemplateService.java @@ -16,7 +16,7 @@ public interface PodTemplateService { void sfcStart(Map map); - void sfcComplete(SfcDto sfcDto, String resrce); + String sfcComplete(SfcDto sfcDto, String resrce); void sendErp(String sfc, String stepId, BigDecimal qty, BigDecimal scrapQty, BigDecimal workHour); diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java index 142b35a4..03869e30 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java @@ -237,7 +237,7 @@ public class PodTemplateServiceImpl implements PodTemplateService { } @Override - public void sfcComplete(SfcDto sfcDto, String resrce) { + public String sfcComplete(SfcDto sfcDto, String resrce) { String site = CommonMethods.getSite(); String operation = sfcDto.getOperation(); Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation); @@ -309,6 +309,7 @@ public class PodTemplateServiceImpl implements PodTemplateService { } catch (Exception e) { ExceptionUtil.throwException(e); } + return sfc; }