diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java index f5edce8..893ffbb 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/CustomerRetentionRatioBizService.java @@ -73,8 +73,13 @@ public class CustomerRetentionRatioBizService { } private void extractingPerson(ShopInfo shop, Date nowDate) { + Timestamp preMonthDay = DateUtil.getExpiredMonth(nowDate, -1); + String dateString = DateUtil.getFullDateString(preMonthDay); List pools = Optional.ofNullable(stammkundePoolService.list(Wrappers.query() - .select("DISTINCT adviser_id", "adviser_name").eq("shop_id", shop.getId())) + .select("DISTINCT adviser_id", "adviser_name") + .eq("pool_status", 1) + .eq("DATE_FORMAT(activation_time, '%Y-%m')", "DATE_FORMAT('" + dateString + "', '%Y-%m')") + .eq("shop_id", shop.getId())) ).orElse(new ArrayList<>()); List userDTOS = Optional.ofNullable(userService.getUserByRole(shop.getId(), RoleCode.FWGW)).orElse(new ArrayList<>()); Set set = new HashSet<>(); @@ -93,7 +98,6 @@ public class CustomerRetentionRatioBizService { if (CollectionUtils.isEmpty(set)) { return; } - Timestamp preMonthDay = DateUtil.getExpiredMonth(nowDate, -1); Date preMonthEndDay = DateUtil.endDate(DateUtil.getMonthEndDay(preMonthDay)); List list = new ArrayList<>(); for (UserInfo userInfo : set) {