Commit 549887959a31cf5cda8c419bc360ac58322e8055
1 parent
b9e29c97
sql语句bug修复
Showing
1 changed file
with
6 additions
and
2 deletions
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) { | ... | ... |