From 7795ae965397794f1e904a6858fb9a8ff072533e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 4 Aug 2020 15:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/PointRuleServiceImpl.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index 5eb5aaefbd..780a68019c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -195,14 +195,22 @@ public class PointRuleServiceImpl extends BaseServiceImpl> customerListResult = operCrmOpenFeignClient.getAllCustomerList(); + log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult)); if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) { - log.error("获取所有客户列表失败"); + throw new RenException("获取所有客户列表失败"); } List customerDTOList = customerListResult.getData(); List ruleDefaultEntities = pointRuleDefaultDao.selectList(null); + if (CollectionUtils.isEmpty(ruleDefaultEntities)) { + log.warn("initPointRule pointRuleDefaultDao.selectList return empty"); + throw new RenException("获取默认规则失败"); + } List haveInitCustomerIds = baseDao.selectCustomerIds(); + if (haveInitCustomerIds == null) { + haveInitCustomerIds = new ArrayList<>(); + } List insertList = new ArrayList<>(); - ruleDefaultEntities.forEach(defaultRule -> { + for (PointRuleDefaultEntity defaultRule : ruleDefaultEntities) { for (CustomerDTO customerDTO : customerDTOList) { if (haveInitCustomerIds.contains(customerDTO.getId())) { continue; @@ -211,7 +219,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl