Commit 43c838e0 authored by renjie's avatar renjie

Merge branch 'dev-zrj' into 'staging'

bug修改

See merge request !11
parents cc93604f 3c0201b0
...@@ -395,15 +395,18 @@ public class AdministratorServiceImpl implements AdministratorService { ...@@ -395,15 +395,18 @@ public class AdministratorServiceImpl implements AdministratorService {
Date dateTime2 = formatter.parse(strDate2); Date dateTime2 = formatter.parse(strDate2);
Page<Account> accountPage = accountRepository.findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull(pageable, dateTime1, dateTime2, account.getPromotion().getCode()); Page<Account> accountPage = accountRepository.findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull(pageable, dateTime1, dateTime2, account.getPromotion().getCode());
List<AccountPromotionDto> accountPromotionDtos = new ArrayList<>(); List<AccountPromotionDto> accountPromotionDtos = new ArrayList<>();
if (accountPage.getNumber() > 0) {
accountPage.get().forEach(account1 -> { accountPage.get().forEach(account1 -> {
accountPromotionDtos.add(new AccountPromotionDto(account1)); accountPromotionDtos.add(new AccountPromotionDto(account1));
}); });
}
Page<AccountPromotionDto> accountPromotionDtoPage = new PageImpl<AccountPromotionDto>(accountPromotionDtos); Page<AccountPromotionDto> accountPromotionDtoPage = new PageImpl<AccountPromotionDto>(accountPromotionDtos);
promotionQueryResultDto.setUsers(accountPromotionDtoPage); promotionQueryResultDto.setUsers(accountPromotionDtoPage);
List<Account> accounts = accountRepository.findAllBySignupDateBetweenAndPromotionCode(dateTime1, dateTime2, account.getPromotion().getCode()); List<Account> accounts = accountRepository.findAllBySignupDateBetweenAndPromotionCode(dateTime1, dateTime2, account.getPromotion().getCode());
Promotion promotion = new Promotion(); Promotion promotion = new Promotion();
Account finalAccount = account; Account finalAccount = account;
if (accounts != null && accounts.size() > 0) {
accounts.forEach(x -> { accounts.forEach(x -> {
promotion.setInvitedUsers(promotion.getInvitedUsers() + 1); promotion.setInvitedUsers(promotion.getInvitedUsers() + 1);
List<UserPrePaidBilling> userPrePaidBillings = userPrePaidBillingRepository.findByAdministratorAndPayMethodInAndTimestampBetween(x.getName(), Arrays.asList(1,2,3), dateTime1.getTime(), dateTime2.getTime()); List<UserPrePaidBilling> userPrePaidBillings = userPrePaidBillingRepository.findByAdministratorAndPayMethodInAndTimestampBetween(x.getName(), Arrays.asList(1,2,3), dateTime1.getTime(), dateTime2.getTime());
...@@ -425,6 +428,7 @@ public class AdministratorServiceImpl implements AdministratorService { ...@@ -425,6 +428,7 @@ public class AdministratorServiceImpl implements AdministratorService {
List<UserPrePaidBilling> userPrePaidBillings1 = userPrePaidBillingRepository.findByAdministratorAndYearAndMonthAndPayMethodIn(secondPromote.getName(), List<UserPrePaidBilling> userPrePaidBillings1 = userPrePaidBillingRepository.findByAdministratorAndYearAndMonthAndPayMethodIn(secondPromote.getName(),
YearMonth.now().minusMonths(1).getYear(), YearMonth.now().minusMonths(1).getYear(),
YearMonth.now().minusMonths(1).getMonthValue(), Arrays.asList(1,2,3)); YearMonth.now().minusMonths(1).getMonthValue(), Arrays.asList(1,2,3));
if (userPrePaidBillings1 != null && userPrePaidBillings1.size() > 0)
secondCommission += userPrePaidBillings1.stream().mapToDouble(UserPrePaidBilling::getTotal).sum(); secondCommission += userPrePaidBillings1.stream().mapToDouble(UserPrePaidBilling::getTotal).sum();
} }
} }
...@@ -433,6 +437,7 @@ public class AdministratorServiceImpl implements AdministratorService { ...@@ -433,6 +437,7 @@ public class AdministratorServiceImpl implements AdministratorService {
promotion.setGift(promotion.getGift() + x.getPromotion().getGift()); promotion.setGift(promotion.getGift() + x.getPromotion().getGift());
promotion.setCommissionLastMonth(promotion.getCommissionLastMonth() + x.getPromotion().getCommissionLastMonth()); promotion.setCommissionLastMonth(promotion.getCommissionLastMonth() + x.getPromotion().getCommissionLastMonth());
}); });
}
promotionQueryResultDto.setPromotion(promotion); promotionQueryResultDto.setPromotion(promotion);
return promotionQueryResultDto; return promotionQueryResultDto;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment