Commit 06eccf5010e28c56df21d55c86732f70152ec033

Authored by 张志伟
2 parents 1c3bac08 54988795

Merge remote-tracking branch 'origin/dev' into test

fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java
... ... @@ -73,8 +73,13 @@ public class CustomerRetentionRatioBizService {
73 73 }
74 74  
75 75 private void extractingPerson(ShopInfo shop, Date nowDate) {
  76 + Timestamp preMonthDay = DateUtil.getExpiredMonth(nowDate, -1);
  77 + String dateString = DateUtil.getFullDateString(preMonthDay);
76 78 List<StammkundePool> pools = Optional.ofNullable(stammkundePoolService.list(Wrappers.<StammkundePool>query()
77   - .select("DISTINCT adviser_id", "adviser_name").eq("shop_id", shop.getId()))
  79 + .select("DISTINCT adviser_id", "adviser_name")
  80 + .eq("pool_status", 1)
  81 + .eq("DATE_FORMAT(activation_time, '%Y-%m')", "DATE_FORMAT('" + dateString + "', '%Y-%m')")
  82 + .eq("shop_id", shop.getId()))
78 83 ).orElse(new ArrayList<>());
79 84 List<PostUserDTO> userDTOS = Optional.ofNullable(userService.getUserByRole(shop.getId(), RoleCode.FWGW)).orElse(new ArrayList<>());
80 85 Set<UserInfo> set = new HashSet<>();
... ... @@ -93,7 +98,6 @@ public class CustomerRetentionRatioBizService {
93 98 if (CollectionUtils.isEmpty(set)) {
94 99 return;
95 100 }
96   - Timestamp preMonthDay = DateUtil.getExpiredMonth(nowDate, -1);
97 101 Date preMonthEndDay = DateUtil.endDate(DateUtil.getMonthEndDay(preMonthDay));
98 102 List<CustomerRetentionRatio> list = new ArrayList<>();
99 103 for (UserInfo userInfo : set) {
... ...