|
|
@ -9,6 +9,7 @@ import java.util.LinkedHashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.bdprize.support.BDPrizeCalculator;
|
|
|
|
import au.com.royalpay.payment.manage.bdprize.support.BDPrizeCalculator;
|
|
|
@ -30,6 +31,7 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
|
|
|
|
private Map<String, JSONObject> bdMap = new HashMap<>();
|
|
|
|
private Map<String, JSONObject> bdMap = new HashMap<>();
|
|
|
|
private Map<Integer, Map<Integer, List<JSONObject>>> rateConfigMap = new HashMap<>();
|
|
|
|
private Map<Integer, Map<Integer, List<JSONObject>>> rateConfigMap = new HashMap<>();
|
|
|
|
private Map<String, BigDecimal> bdTotalMap = new HashMap<>();
|
|
|
|
private Map<String, BigDecimal> bdTotalMap = new HashMap<>();
|
|
|
|
|
|
|
|
private TransactionMapper transactionMapper;
|
|
|
|
|
|
|
|
|
|
|
|
public BDPrizeCalculatorDefaultImpl(List<JSONObject> tradeLogs, Date month) {
|
|
|
|
public BDPrizeCalculatorDefaultImpl(List<JSONObject> tradeLogs, Date month) {
|
|
|
|
this.tradeLogs = tradeLogs;
|
|
|
|
this.tradeLogs = tradeLogs;
|
|
|
@ -76,7 +78,7 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<JSONObject> getReport() {
|
|
|
|
public List<JSONObject> getReport(int year,int month1) {
|
|
|
|
List<JSONObject> report = new ArrayList<>();
|
|
|
|
List<JSONObject> report = new ArrayList<>();
|
|
|
|
for (Map.Entry<String, Map<String, JSONObject>> resultItem : results.entrySet()) {
|
|
|
|
for (Map.Entry<String, Map<String, JSONObject>> resultItem : results.entrySet()) {
|
|
|
|
JSONObject log = new JSONObject();
|
|
|
|
JSONObject log = new JSONObject();
|
|
|
@ -89,7 +91,7 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
|
|
|
|
log.put("total_amount", 0);
|
|
|
|
log.put("total_amount", 0);
|
|
|
|
log.put("total_prize", 0);
|
|
|
|
log.put("total_prize", 0);
|
|
|
|
log.put("total_donation", 0);
|
|
|
|
log.put("total_donation", 0);
|
|
|
|
BigDecimal totalAmount = bdTotalMap.get(bd.getString("bd_id"));
|
|
|
|
BigDecimal totalAmount = transactionMapper.TotalAmountForBDPrize(year,month1,bd.getString("bd_id"));
|
|
|
|
List<JSONObject> details = new ArrayList<>();
|
|
|
|
List<JSONObject> details = new ArrayList<>();
|
|
|
|
for (Map.Entry<String, JSONObject> detail : resultItem.getValue().entrySet()) {
|
|
|
|
for (Map.Entry<String, JSONObject> detail : resultItem.getValue().entrySet()) {
|
|
|
|
JSONObject detailItem = detail.getValue();
|
|
|
|
JSONObject detailItem = detail.getValue();
|
|
|
|