Commit 549887959a31cf5cda8c419bc360ac58322e8055

Authored by 张志伟
1 parent b9e29c97

:bug: sql语句bug修复

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