diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index 91cd0b132..f1907b47e 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -345,33 +345,33 @@ public class InvestBizServiceImpl implements InvestBizService { try { successList.forEach(customer -> { if (StringUtils.isBlank(customer.getPhone())) { - stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); + redisKeyIncrement(importKey, "processCount", "failCount"); log.error("负责人电话为空", customer.toString()); return; } if (StringUtils.isBlank(customer.getShopNumber())) { - stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); + redisKeyIncrement(importKey, "processCount", "failCount"); log.error("意向铺位为空", customer.toString()); return; } if (StringUtils.isBlank(customer.getBrandName())) { - stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); + redisKeyIncrement(importKey, "processCount", "failCount"); log.error("品牌为空", customer.toString()); return; } - if (StringUtils.isBlank(customer.getName())) { - stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); - log.error("品牌负责人为空", customer.toString()); - return; - } + //if (StringUtils.isBlank(customer.getName())) { + // redisKeyIncrement(importKey, "processCount","failCount") ; + // log.error("品牌负责人为空", customer.toString()); + // return; + //} if (StringUtils.isBlank(customer.getBusiness())) { - stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); + redisKeyIncrement(importKey, "processCount", "failCount"); log.error("经营业态为空", customer.toString()); return; } InvestDemandDto toImportCustomer = convetCustomer(importKey, customer, brandMap, businesseMap, shopMap, customerMap.get(customer.getPhone()), demandMap); if (toImportCustomer == null) { - stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); + redisKeyIncrement(importKey, "processCount", "failCount"); log.error("customerBase null"); return; } @@ -382,7 +382,7 @@ public class InvestBizServiceImpl implements InvestBizService { updateCustomerAndDemand(toImportCustomer); } //记数 - stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); + redisKeyIncrement(importKey, "processCount", "allSuccessCount"); stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS); }); } catch (Exception e) { @@ -414,10 +414,10 @@ public class InvestBizServiceImpl implements InvestBizService { if (Objects.isNull(demandEntity)) { demandEntity = new InvestDemandEntity(); } - if (Objects.isNull(brandMap.get(importCustomerVo.getBrandName()))) { - log.warn("品牌:{} 不存在", importCustomerVo.getBrandName()); - return null; - } + //if (Objects.isNull(brandMap.get(importCustomerVo.getBrandName()))) { + // log.warn("品牌:{} 不存在", importCustomerVo.getBrandName()); + // return null; + //} customerEntity.setBrandId(brandMap.get(importCustomerVo.getBrandName()).getId()); if (Objects.isNull(businesseMap.get(importCustomerVo.getBusiness()))) { @@ -478,6 +478,12 @@ public class InvestBizServiceImpl implements InvestBizService { log.error(e.getMessage()); } + private void redisKeyIncrement(String key, String... hashKey) { + for (String s : hashKey) { + stringRedisTemplate.opsForHash().increment(key, s, 1); + } + } + @Override public List queryCustomer() { List customerEntities = customerService.list(); @@ -921,9 +927,16 @@ public class InvestBizServiceImpl implements InvestBizService { InvestCustomerEntity customerEntity = customerService.getByIdNotNull(remindVo.getCustomerId()); if (Objects.nonNull(customerEntity)) { remindVo.setCustomer(customerEntity); - remindVo.setBrand(brandService.getById(customerEntity.getBrandId())); + WxBrand brand = brandService.getById(customerEntity.getBrandId()); + if (Objects.nonNull(brand)) { + remindVo.setBrand(brand); + } + } + + MallUserInfo userInfo = userInfoService.getById(remindEntity.getOwner()); + if (Objects.nonNull(userInfo)) { + remindVo.setOwnerInfo(userInfo); } - remindVo.setOwnerInfo(userInfoService.getById(remindEntity.getOwner())); return remindVo; }