Commit a99065ca authored by renjie's avatar renjie

支付方式bug

parent 5cff936b
...@@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory; ...@@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -23,6 +24,7 @@ import java.util.ArrayList; ...@@ -23,6 +24,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.stream.DoubleStream;
@Service @Service
...@@ -105,6 +107,7 @@ public class AdministratorServiceImpl implements AdministratorService { ...@@ -105,6 +107,7 @@ public class AdministratorServiceImpl implements AdministratorService {
List<UserPrePaidBilling> userBillingList = userPrePaidBillingRepository.findByUsername(name); List<UserPrePaidBilling> userBillingList = userPrePaidBillingRepository.findByUsername(name);
if (userBillingList == null) if (userBillingList == null)
throw new ClientRequestException(AccountErrorCode.NAMENOTEXIST, "Username does not exist: " + name); throw new ClientRequestException(AccountErrorCode.NAMENOTEXIST, "Username does not exist: " + name);
double total = userBillingList.stream().mapToDouble(UserPrePaidBilling::getTotal).sum();
return userBillingList; return userBillingList;
} }
...@@ -146,10 +149,9 @@ public class AdministratorServiceImpl implements AdministratorService { ...@@ -146,10 +149,9 @@ public class AdministratorServiceImpl implements AdministratorService {
@Override @Override
public Page<UserPrePaidBilling> searchAllUserBillingPage(int page, int year1, int year2, int month1, int month2) { public Page<UserPrePaidBilling> searchAllUserBillingPage(int page, int year1, int year2, int month1, int month2) {
// Pageable pageable = new PageRequest(page, 15); Pageable pageable = PageRequest.of(page, 15);
// Page<UserPrePaidBilling> userPrePaidBillings = userPrePaidBillingRepository.findAllByYearBetweenAndMonthBetween(pageable, year1, year2, month1, month2); Page<UserPrePaidBilling> userPrePaidBillings = userPrePaidBillingRepository.findAllByYearBetweenAndMonthBetween(pageable, year1, year2, month1, month2);
// return userPrePaidBillings; return userPrePaidBillings;
return null;
} }
@Override @Override
......
...@@ -155,7 +155,7 @@ public class IpResourceServiceImpl implements IpResourceService { ...@@ -155,7 +155,7 @@ public class IpResourceServiceImpl implements IpResourceService {
ipChargeRequestDto.setRegion(request.getRegion()); ipChargeRequestDto.setRegion(request.getRegion());
ipChargeRequestDto.setPeriod(request.getPeriod()); ipChargeRequestDto.setPeriod(request.getPeriod());
ipChargeRequestDto.setUnit(request.getUnit()); ipChargeRequestDto.setUnit(request.getUnit());
ipChargeRequestDto.setPayMethod(0); ipChargeRequestDto.setPayMethod(payMethod);
return ipChargeRequestDto; return ipChargeRequestDto;
} }
......
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