Commit ab16a2c2 authored by renjie's avatar renjie

bug修改

parent 6d404617
......@@ -36,9 +36,9 @@ public interface UserPrePaidBillingRepository extends MongoRepository<UserPrePai
List<UserPrePaidBilling> findByStatus(BillStatus status);
List<UserPrePaidBilling> findByUsernameAndPayMethodInAndTimestampGreaterThanAndTimestampLessThan(String username, List<Integer> payMehtods, long time1, long time2);
List<UserPrePaidBilling> findByUsernameAndPayMethodInAndTimestampBetween(String username, List<Integer> payMehtods, long time1, long time2);
List<UserPrePaidBilling> findByUsernameAndChargeTypeAndTimestampGreaterThanAndTimestampLessThan(String username, int chargeType, long time1, long time2);
List<UserPrePaidBilling> findByUsernameAndChargeTypeAndTimestampBetween(String username, int chargeType, long time1, long time2);
Page<UserPrePaidBilling> findByUsernameAndTimestampGreaterThanOrderByTimestampDesc(String username, long time, Pageable pageable);
......
......@@ -147,7 +147,6 @@ public class AdministratorServiceImpl implements AdministratorService {
List<UserPrePaidBilling> userPrePaidBillings_child = userPrePaidBillingRepository.findByUsernameAndPayMethodIn(child.getName(), Arrays.asList(1,2));
if (userPrePaidBillings_child != null)
childexpense += userPrePaidBillings_child.stream().mapToDouble(UserPrePaidBilling::getTotal).sum();
childwithdrawn += child.getPromotion().getWithdrawn();
UserBalance userBalance_child = userBalanceRepository.findById(child.getName()).orElse(null);
if (userBalance_child != null) {
childbalanced += userBalance_child.getBalanced();
......@@ -407,11 +406,11 @@ public class AdministratorServiceImpl implements AdministratorService {
Account finalAccount = account;
accounts.forEach(x -> {
promotion.setInvitedUsers(promotion.getInvitedUsers() + 1);
double totalCommission = userPrePaidBillingRepository.findByUsernameAndPayMethodInAndTimestampGreaterThanAndTimestampLessThan(x.getName(), Arrays.asList(1,2,3), dateTime1.getTime(), dateTime2.getTime())
double totalCommission = userPrePaidBillingRepository.findByUsernameAndPayMethodInAndTimestampBetween(x.getName(), Arrays.asList(1,2,3), dateTime1.getTime(), dateTime2.getTime())
.stream().mapToDouble(UserPrePaidBilling::getTotal).sum();
promotion.setTotalCommission(promotion.getTotalCommission() + (int)totalCommission);
promotion.setCommission(promotion.getCommission() + x.getPromotion().getCommission());
double totalwithdrawn = userPrePaidBillingRepository.findByUsernameAndChargeTypeAndTimestampGreaterThanAndTimestampLessThan(x.getName(), ChargeType.gift, dateTime1.getTime(), dateTime2.getTime())
double totalwithdrawn = userPrePaidBillingRepository.findByUsernameAndChargeTypeAndTimestampBetween(x.getName(), ChargeType.gift, dateTime1.getTime(), dateTime2.getTime())
.stream().mapToDouble(UserPrePaidBilling::getTotal).sum();
promotion.setWithdrawn(promotion.getWithdrawn() + totalwithdrawn);
double secondCommission = 0;
......
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