|
@@ -110,6 +110,13 @@ public class OpenDouble11StaticsController extends BaseController {
|
|
|
result.setTotalSaleMaintenance(sporadic.getSaleAmount());
|
|
|
result.setTotalUserMaintenancePurchaseNumber(sporadic.getUserPurchaseNumber());
|
|
|
|
|
|
+ // 小组课
|
|
|
+ query.setSaleStaticsType(7);
|
|
|
+ setQueryParam(query, configParam);
|
|
|
+ Double11StaticWrapper.SaleAmountAndUser smallGroups = studentPaymentOrderDao.saleStatics(query);
|
|
|
+ result.setSmallGroupsMaintenance(smallGroups.getSaleAmount());
|
|
|
+ result.setSmallGroupsPurchaseNumber(smallGroups.getUserPurchaseNumber());
|
|
|
+
|
|
|
BigDecimal totalAmount = result.getTotalSale1V1()
|
|
|
.add(result.getTotalSale1V2())
|
|
|
.add(result.getTotalSaleMaintenance())
|
|
@@ -135,11 +142,15 @@ public class OpenDouble11StaticsController extends BaseController {
|
|
|
Map<Integer, Organization> mapById = organizationService.getMapById(Arrays.stream(query.getOrganId()
|
|
|
.split(",")).map(Integer::valueOf).collect(Collectors.toList()));
|
|
|
orgIdMap.putAll(mapById);
|
|
|
+ configParam.setOrganId(orgs.getParanValue());
|
|
|
} else {
|
|
|
List<Organization> allOrgans = organizationService.findAllOrgans(query.getTenantId());
|
|
|
Map<Integer, Organization> mapById = allOrgans.stream()
|
|
|
.collect(Collectors.toMap(Organization::getId, Function.identity()));
|
|
|
orgIdMap.putAll(mapById);
|
|
|
+ List<String> organId =
|
|
|
+ allOrgans.stream().map(next -> String.valueOf(next.getId())).collect(Collectors.toList());
|
|
|
+ configParam.setOrganId(String.join(",", organId));
|
|
|
}
|
|
|
List<Double11StaticWrapper.SaleAmountAndUser> result;
|
|
|
Integer saleStaticsType = query.getSaleStaticsType();
|
|
@@ -151,6 +162,13 @@ public class OpenDouble11StaticsController extends BaseController {
|
|
|
List<Double11StaticWrapper.SaleAmountAndUser> oneResult = queryOrgSaleAmount(query, orgIdMap);
|
|
|
allResult.addAll(oneResult);
|
|
|
}
|
|
|
+
|
|
|
+ List<Double11StaticWrapper.StudentCount> studentNumByOrgan =
|
|
|
+ studentPaymentOrderDao.count2023Double11StudentsByOrgan(configParam);
|
|
|
+ Map<Integer, Integer> countByOgranId = studentNumByOrgan.stream()
|
|
|
+ .collect(Collectors.toMap(Double11StaticWrapper.StudentCount::getOrganId, Double11StaticWrapper.StudentCount::getCount));
|
|
|
+
|
|
|
+
|
|
|
Map<Integer, List<Double11StaticWrapper.SaleAmountAndUser>> groupByOrg = allResult.stream()
|
|
|
.collect(Collectors.groupingBy(Double11StaticWrapper.SaleAmountAndUser::getOrganId));
|
|
|
result = groupByOrg.entrySet().stream()
|
|
@@ -158,16 +176,11 @@ public class OpenDouble11StaticsController extends BaseController {
|
|
|
Double11StaticWrapper.SaleAmountAndUser amount = new Double11StaticWrapper.SaleAmountAndUser();
|
|
|
amount.setOrganId(entry.getKey());
|
|
|
amount.setOrganName(orgIdMap.getOrDefault(entry.getKey(), new Organization()).getName());
|
|
|
- Set<Integer> userIds = new HashSet<>();
|
|
|
for (Double11StaticWrapper.SaleAmountAndUser v : entry.getValue()) {
|
|
|
amount.setActualAmount(amount.getActualAmount().add(v.getActualAmount()));
|
|
|
amount.setBalancePaymentAmount(amount.getBalancePaymentAmount().add(v.getBalancePaymentAmount()));
|
|
|
- String userId = v.getUserIds();
|
|
|
- if (StringUtils.isNotEmpty(userId)) {
|
|
|
- userIds.addAll(Arrays.stream(userId.split(",")).map(Integer::valueOf).collect(Collectors.toList()));
|
|
|
- }
|
|
|
}
|
|
|
- amount.setUserPurchaseNumber(userIds.size());
|
|
|
+ amount.setUserPurchaseNumber(countByOgranId.getOrDefault(entry.getKey(),0));
|
|
|
return amount;
|
|
|
}).collect(Collectors.toList());
|
|
|
} else {
|
|
@@ -291,11 +304,19 @@ public class OpenDouble11StaticsController extends BaseController {
|
|
|
query.setEndPayTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(
|
|
|
Optional.ofNullable(endTime.getParanValue()).orElse("2023-11-11 23:59:59"),
|
|
|
new ParsePosition(0)));
|
|
|
+ configParam.setStartPayTime(query.getStartPayTime());
|
|
|
+ configParam.setEndPayTime(query.getEndPayTime());
|
|
|
+ configParam.setGoodId(good.getParanValue());
|
|
|
} else if (saleStaticsType == 6) {
|
|
|
// 保价卡销售
|
|
|
query.setGroupType(GroupType.SPORADIC);
|
|
|
query.setType(OrderTypeEnum.SPORADIC);
|
|
|
query.setMusicGroupId(configParam.getSporadic());
|
|
|
+ }else if (saleStaticsType == 7) {
|
|
|
+ // 小组课
|
|
|
+ query.setGroupType(GroupType.ACTIVITY);
|
|
|
+ query.setType(OrderTypeEnum.SMALL_CLASS_TO_BUY);
|
|
|
+ query.setActivityId(configParam.getTheory());
|
|
|
}
|
|
|
}
|
|
|
|