From 2072a3cbc920655885e7348323422f61d50768e9 Mon Sep 17 00:00:00 2001 From: zhanyunjiu <787952492@qq.com> Date: Mon, 15 Aug 2022 15:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86dubbo=E6=B2=A1=E6=9C=89provid?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/farm/service/crop/CropServiceImpl.java | 15 ++++++++++++--- .../farm/service/discuss/DiscussServiceImpl.java | 6 +++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/crop/CropServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/crop/CropServiceImpl.java index c7ddc055..221b0547 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/crop/CropServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/crop/CropServiceImpl.java @@ -17,6 +17,7 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -95,10 +96,18 @@ public class CropServiceImpl implements CropService { } public List getMaterialList(){ - List list = openErpService.getMaterialList(); - List materialList = BeanUtil.copyToList( list, ErpMaterialDTO.class); + List materialList = new ArrayList<>(); + try{ + List list = openErpService.getMaterialList(); + materialList = BeanUtil.copyToList( list, ErpMaterialDTO.class); + }catch (Exception e){ + e.printStackTrace(); + }finally { + return materialList; + } + + - return materialList; } } diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/discuss/DiscussServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/discuss/DiscussServiceImpl.java index 9bee6517..b2449275 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/discuss/DiscussServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/discuss/DiscussServiceImpl.java @@ -308,7 +308,11 @@ public class DiscussServiceImpl implements DiscussService { .num(new BigDecimal(reqVO.getRecoveryNumber())) .build(); log.info("同步到ERP,,{}", intoStock); - openErpService.intoStock(Arrays.asList(intoStock) ); + try{ + openErpService.intoStock(Arrays.asList(intoStock) ); + }catch (Exception e){ + e.printStackTrace(); + } } }