From a9d25243c6f655884728395b623dfcdd525f99a8 Mon Sep 17 00:00:00 2001 From: Burce Date: Thu, 31 Oct 2019 12:00:42 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[=E6=8B=9B=E5=95=86][=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF]=E4=B8=8D=E6=A0=A1=E9=AA=8C=E5=93=81?= =?UTF-8?q?=E7=89=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invest/impl/InvestBizServiceImpl.java | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) 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; } From 2911207a24c9f8a1155698378c3d5aa4fcaa8ca0 Mon Sep 17 00:00:00 2001 From: Burce Date: Thu, 31 Oct 2019 13:41:26 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[=E6=8B=9B=E5=95=86][=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF]=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/invest/impl/InvestBizServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f1907b47e..f88d006ac 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 @@ -382,7 +382,7 @@ public class InvestBizServiceImpl implements InvestBizService { updateCustomerAndDemand(toImportCustomer); } //记数 - redisKeyIncrement(importKey, "processCount", "allSuccessCount"); + redisKeyIncrement(importKey, "processCount"); stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS); }); } catch (Exception e) { From 3b23e0a51a1fd9631c96037f62cd6077edc9a953 Mon Sep 17 00:00:00 2001 From: Burce Date: Thu, 31 Oct 2019 13:55:12 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[=E6=8B=9B=E5=95=86][=E6=A6=82=E8=A7=88]?= =?UTF-8?q?=E5=BE=85=E5=88=86=E9=85=8D=E6=8E=92=E9=99=A4=E5=90=88=E4=BD=9C?= =?UTF-8?q?=E5=AE=A2=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/InvestCustomerMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml b/mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml index 98b74e1d8..d03eafcb0 100644 --- a/mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml +++ b/mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml @@ -42,7 +42,7 @@ SELECT count(1) FROM `invest_customer` c INNER JOIN `invest_demand` d ON d.`customer_id` = c.id - WHERE d.`owner` = 0 + WHERE d.`owner` = 0 AND c.type in (0,1,3) AND c.`tenant_id` = #{tenantId}; From 2a3a3d4880bd74c5bccd135a109fa88facd07420 Mon Sep 17 00:00:00 2001 From: Burce Date: Thu, 31 Oct 2019 17:25:21 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[=E6=8B=9B=E5=95=86][=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/invest/InvestFollowRecordController.java | 2 -- .../com/iformall/domain/vo/invest/InvestDemandQuery.java | 4 +++- .../service/invest/impl/InvestBizServiceImpl.java | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java index 02566d3e4..a97f02fdb 100755 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java @@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.*; import java.util.Arrays; - /** * 招商模块-跟踪记录 * @@ -45,7 +44,6 @@ public class InvestFollowRecordController extends InvestBaseController { return execute(params, p -> bizService.queryPageFollowRecord(p)); } - /** * 信息 */ diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestDemandQuery.java b/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestDemandQuery.java index 3d8629a58..7841b32d5 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestDemandQuery.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestDemandQuery.java @@ -4,6 +4,8 @@ import com.iformall.enums.EnumCustomerType; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + @Data @EqualsAndHashCode(callSuper = true) public class InvestDemandQuery extends InvestPageQuery { @@ -18,7 +20,7 @@ public class InvestDemandQuery extends InvestPageQuery { * 客户分类:0-潜在客户;1-意向客户;2-合作客户;3-谈判失败 */ @io.swagger.annotations.ApiModelProperty(value = "客户分类:0-潜在客户;1-意向客户;2-合作客户;3-谈判失败", name = "customerType") - private EnumCustomerType customerType; + private List customerType; /** * 经营业态 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 f88d006ac..c2572b2f4 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 @@ -105,6 +105,9 @@ public class InvestBizServiceImpl implements InvestBizService { queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList), InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); } } + if(CollectionUtils.isNotEmpty(params.getCustomerType())) { + queryWrapperCustomer.in(InvestCustomerEntity::getType,params.getCustomerType()) ; + } queryWrapperCustomer.orderByDesc(InvestCustomerEntity::getCreateDate); InvestPageResult customers = customerService.queryPage(buildPageQuery(params, null), queryWrapperCustomer); @@ -492,9 +495,9 @@ public class InvestBizServiceImpl implements InvestBizService { private InvestDemandDto doConvertDemand(InvestDemandQuery params) { InvestCustomerEntity customerEntity = null; - if (ObjectUtils.anyNotNull(params.getCustomerType(), params.getBusinessId())) { + if (ObjectUtils.anyNotNull(params.getBusinessId())) { customerEntity = new InvestCustomerEntity(); - customerEntity.setType(params.getCustomerType()); + //customerEntity.setType(params.getCustomerType()); customerEntity.setBusinessId(params.getBusinessId()); } @@ -915,7 +918,7 @@ public class InvestBizServiceImpl implements InvestBizService { if (Objects.isNull(shop)) { return new HashMap<>(); } - return rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId(), ""), + return rentContractService.selectRentContractByShopIds(Collections.singletonList(shop.getId()), StringUtils.join(shop.getId(), ""), InvestUserContext.getUser().getTenantId()); }