Commit 1c02aba5 authored by renjie's avatar renjie

Merge branch 'dev-zrj' into 'staging'

bug修改

See merge request !12
parents 43c838e0 e6fee17d
......@@ -29,7 +29,7 @@ public interface AccountRepository extends MongoRepository<Account, String>, Acc
Page<Account> findAllBySignupDateBetween(Pageable pageable, Date startDate, Date endDate);
List<Account> findAllBySignupDateBetweenAndPromotionCode(Date startDate, Date endDate, String promotionCode);
List<Account> findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull(Date startDate, Date endDate, String promotionCode);
Page<Account> findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull(Pageable pageable, Date startDate, Date endDate, String promotionCode);
......
......@@ -403,7 +403,7 @@ public class AdministratorServiceImpl implements AdministratorService {
Page<AccountPromotionDto> accountPromotionDtoPage = new PageImpl<AccountPromotionDto>(accountPromotionDtos);
promotionQueryResultDto.setUsers(accountPromotionDtoPage);
List<Account> accounts = accountRepository.findAllBySignupDateBetweenAndPromotionCode(dateTime1, dateTime2, account.getPromotion().getCode());
List<Account> accounts = accountRepository.findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull(dateTime1, dateTime2, account.getPromotion().getCode());
Promotion promotion = new Promotion();
Account finalAccount = account;
if (accounts != null && accounts.size() > 0) {
......@@ -411,7 +411,7 @@ public class AdministratorServiceImpl implements AdministratorService {
promotion.setInvitedUsers(promotion.getInvitedUsers() + 1);
List<UserPrePaidBilling> userPrePaidBillings = userPrePaidBillingRepository.findByAdministratorAndPayMethodInAndTimestampBetween(x.getName(), Arrays.asList(1,2,3), dateTime1.getTime(), dateTime2.getTime());
double totalCommission = 0;
if (userPrePaidBillings != null)
if (userPrePaidBillings != null && userPrePaidBillings.size() > 0)
totalCommission = userPrePaidBillings.stream().mapToDouble(UserPrePaidBilling::getTotal).sum();
promotion.setTotalCommission(promotion.getTotalCommission() + (int)totalCommission);
promotion.setCommission(promotion.getCommission() + x.getPromotion().getCommission());
......@@ -442,7 +442,7 @@ public class AdministratorServiceImpl implements AdministratorService {
return promotionQueryResultDto;
} catch (Exception e) {
log.error(e.getMessage());
log.error(e.getMessage(), e);
throw new ClientRequestException(BrowserErrorCode.UNKNOWN);
}
}
......
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