|
|
@@ -125,8 +125,9 @@ public class StatisticService {
|
|
|
return this.getDTOS(orderInfos, start, (int) day);
|
|
|
}
|
|
|
|
|
|
- public List<StatisticDTO> employeeOrderFee(int year, int month, Long userId) {
|
|
|
- LocalDateTime start = LocalDateTime.of(year, month, 1, 0, 0);
|
|
|
+ public List<StatisticDTO> employeeOrderFee(String time, Long userId) {
|
|
|
+// LocalDateTime start = LocalDateTime.of(year, month, 1, 0, 0);
|
|
|
+ LocalDateTime start = DateTimeUtils.toLocalDateTime(time, "yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDateTime end = start.plusMonths(1);
|
|
|
long day = end.toLocalDate().toEpochDay() - start.toLocalDate().toEpochDay() - 1;
|
|
|
List<Long> childrenId = userService.childrenId(userId);
|
|
|
@@ -139,14 +140,18 @@ public class StatisticService {
|
|
|
}));
|
|
|
|
|
|
Map<Integer, List<WxFee>> collect = wxFeeList.stream().collect(Collectors.groupingBy(WxFee::getAction));
|
|
|
+ List<WxFee> fees = new ArrayList<>();
|
|
|
List<WxFee> wxFees = collect.get(0);
|
|
|
+ if (CollUtil.isNotEmpty(wxFees)) {
|
|
|
+ fees = wxFees;
|
|
|
+ }
|
|
|
List<WxFee> refunds = new ArrayList<>();
|
|
|
List<WxFee> wxFees1 = collect.get(1);
|
|
|
if (CollUtil.isNotEmpty(wxFees1)) {
|
|
|
refunds = wxFees1;
|
|
|
}
|
|
|
|
|
|
- return getDTOS2(wxFees, refunds, start, (int) day);
|
|
|
+ return getDTOS2(fees, refunds, start, (int) day);
|
|
|
}
|
|
|
|
|
|
public List<StatisticDTO> getDTOS(List<OrderInfo> orderInfos, LocalDateTime start, int day) {
|
|
|
@@ -195,8 +200,9 @@ public class StatisticService {
|
|
|
return dtos;
|
|
|
}
|
|
|
|
|
|
- public List<StatisticDTO> employeeCommission(int year, int month, Long userId) {
|
|
|
- LocalDateTime start = LocalDateTime.of(year, month, 1, 0, 0);
|
|
|
+ public List<StatisticDTO> employeeCommission(String time, Long userId) {
|
|
|
+// LocalDateTime start = LocalDateTime.of(year, month, 1, 0, 0);
|
|
|
+ LocalDateTime start = DateTimeUtils.toLocalDateTime(time, "yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDateTime end = start.plusMonths(1);
|
|
|
long day = end.toLocalDate().toEpochDay() - start.toLocalDate().toEpochDay() - 1;
|
|
|
List<CommissionRecord> recordList = commissionRecordRepo.findAllByUserIdAndCreatedAtBetween(userId, start, end);
|