eason 6 years ago
parent 611a4eb646
commit 876b8cc46e

@ -121,7 +121,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
List<JSONObject> trades = transactionMapper.listTransactionsForBDPrize(now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, channel); List<JSONObject> trades = transactionMapper.listTransactionsForBDPrize(now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, channel);
List<Integer> clientsWithBDAway = clientBDMapper.clientsWithBDAway(); List<Integer> clientsWithBDAway = clientBDMapper.clientsWithBDAway();
List<JSONObject> rateConfig = getRateConfig(); List<JSONObject> rateConfig = getRateConfig();
BDPrizeCalculator calculator = new BDPrizeCalculatorDefaultImpl(trades, now.getTime()).clientBDMapper(clientBDMapper,transactionMapper) BDPrizeCalculator calculator = new BDPrizeCalculatorDefaultImpl(trades, now.getTime()).clientBDMapper(clientBDMapper).transactionMapper(transactionMapper)
.clientsWithBDAwayDeterminor(new DefaultClientWithBDAwayDeterminor(clientsWithBDAway)).rateConfig(rateConfig); .clientsWithBDAwayDeterminor(new DefaultClientWithBDAwayDeterminor(clientsWithBDAway)).rateConfig(rateConfig);
calculator.calculate(); calculator.calculate();
List<JSONObject> report = calculator.getReport(now.get(Calendar.YEAR),now.get(Calendar.MONTH) + 1); List<JSONObject> report = calculator.getReport(now.get(Calendar.YEAR),now.get(Calendar.MONTH) + 1);

@ -38,8 +38,12 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
this.month = month; this.month = month;
} }
public BDPrizeCalculatorDefaultImpl clientBDMapper(ClientBDMapper clientBDMapper,TransactionMapper transactionMapper) { public BDPrizeCalculatorDefaultImpl clientBDMapper(ClientBDMapper clientBDMapper) {
this.clientBDMapper = clientBDMapper; this.clientBDMapper = clientBDMapper;
return this;
}
public BDPrizeCalculatorDefaultImpl transactionMapper(TransactionMapper transactionMapper) {
this.transactionMapper = transactionMapper; this.transactionMapper = transactionMapper;
return this; return this;
} }

Loading…
Cancel
Save