diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java index b71bb41e..02a4e35c 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java @@ -110,14 +110,12 @@ public class RechargeUserServiceImpl implements RechargeUserService { BigDecimal currentMonthRecharge = BigDecimal.ZERO; for (AdminRechargeAgentRelation relation : relations) { - String monthStart = relation.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); - String monthEnd = YearMonth.now().atEndOfMonth().atTime(23, 59, 59).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); -// LocalDateTime actualStartTime = relation.getCreateTime().isAfter(startTime) -// ? relation.getCreateTime() -// : startTime; -// -// String monthStart = actualStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); -// String monthEnd = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + LocalDateTime actualStartTime = relation.getCreateTime().isAfter(startTime) + ? relation.getCreateTime() + : startTime; + + String monthStart = actualStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + String monthEnd = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); BigDecimal monthRecharge = freightGoldClient.getTotalAmountByCondition(relation.getUserId(), monthStart, monthEnd, RECHARGE_TYPE).getBody(); currentMonthRecharge = currentMonthRecharge.add(monthRecharge != null ? monthRecharge : BigDecimal.ZERO);