|
|
@ -122,10 +122,12 @@ public class CityPartnerPrizeController {
|
|
|
|
public JSONObject getreferrerPrizeDetail(@PathVariable String monthStr, @PathVariable String orgId) {
|
|
|
|
public JSONObject getreferrerPrizeDetail(@PathVariable String monthStr, @PathVariable String orgId) {
|
|
|
|
return cityPartnerPrizeService.getReferrerPrizeDetail(monthStr, orgId);
|
|
|
|
return cityPartnerPrizeService.getReferrerPrizeDetail(monthStr, orgId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/referrer/months")
|
|
|
|
@RequestMapping("/referrer/months")
|
|
|
|
public List<JSONObject> listReferrerAvailableMonths(@RequestParam String year) {
|
|
|
|
public List<JSONObject> listReferrerAvailableMonths(@RequestParam String year) {
|
|
|
|
return cityPartnerPrizeService.listReferrerAvailableMonths(year);
|
|
|
|
return cityPartnerPrizeService.listReferrerAvailableMonths(year);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/referrer/months/{monthStr}")
|
|
|
|
@RequestMapping(value = "/referrer/months/{monthStr}")
|
|
|
|
public JSONObject getReferrerPrizeInfo(@PathVariable String monthStr) {
|
|
|
|
public JSONObject getReferrerPrizeInfo(@PathVariable String monthStr) {
|
|
|
|
List<JSONObject> partnerPrizeInfos = cityPartnerPrizeService.getReferrerPrizeInfoList(monthStr);
|
|
|
|
List<JSONObject> partnerPrizeInfos = cityPartnerPrizeService.getReferrerPrizeInfoList(monthStr);
|
|
|
@ -182,10 +184,12 @@ public class CityPartnerPrizeController {
|
|
|
|
public JSONObject getAgentPrizeDetail(@PathVariable String monthStr, @PathVariable String orgId) {
|
|
|
|
public JSONObject getAgentPrizeDetail(@PathVariable String monthStr, @PathVariable String orgId) {
|
|
|
|
return cityPartnerPrizeService.getAgentPrizeDetail(monthStr, orgId);
|
|
|
|
return cityPartnerPrizeService.getAgentPrizeDetail(monthStr, orgId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/agent/months")
|
|
|
|
@RequestMapping("/agent/months")
|
|
|
|
public List<JSONObject> listAgentAvailableMonths(@RequestParam String year) {
|
|
|
|
public List<JSONObject> listAgentAvailableMonths(@RequestParam String year) {
|
|
|
|
return cityPartnerPrizeService.listAgentAvailableMonths(year);
|
|
|
|
return cityPartnerPrizeService.listAgentAvailableMonths(year);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/agent/months/{monthStr}")
|
|
|
|
@RequestMapping(value = "/agent/months/{monthStr}")
|
|
|
|
public JSONObject getAgentPrizeInfo(@PathVariable String monthStr) {
|
|
|
|
public JSONObject getAgentPrizeInfo(@PathVariable String monthStr) {
|
|
|
|
List<JSONObject> partnerPrizeInfos = cityPartnerPrizeService.getAgentPrizeInfoList(monthStr);
|
|
|
|
List<JSONObject> partnerPrizeInfos = cityPartnerPrizeService.getAgentPrizeInfoList(monthStr);
|
|
|
@ -200,35 +204,69 @@ public class CityPartnerPrizeController {
|
|
|
|
partenerPrizeMap.put(key, tmpList);
|
|
|
|
partenerPrizeMap.put(key, tmpList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal royalpay_charge = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<JSONObject> partnerPrizeList = cityPartnerPrizeService.getCityPartnerPrizeInfoList(monthStr);
|
|
|
|
|
|
|
|
Map<Integer, JSONObject> countPartnerPrizeMap = new HashMap<>();
|
|
|
|
|
|
|
|
for (JSONObject p : partnerPrizeList) {
|
|
|
|
|
|
|
|
royalpay_charge = royalpay_charge.add(p.getBigDecimal("royalpay_charge"));
|
|
|
|
|
|
|
|
Integer key = p.getInteger("org_id");
|
|
|
|
|
|
|
|
JSONObject partnerTmp = countPartnerPrizeMap.get(key);
|
|
|
|
|
|
|
|
if (partnerTmp == null) {
|
|
|
|
|
|
|
|
JSONObject partner = new JSONObject();
|
|
|
|
|
|
|
|
partner.put("royalpay_charge", p.getBigDecimal("royalpay_charge"));
|
|
|
|
|
|
|
|
countPartnerPrizeMap.put(key, partner);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
partnerTmp.put("royalpay_charge", partnerTmp.getBigDecimal("royalpay_charge").add(p.getBigDecimal("royalpay_charge")));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
List<JSONObject> partnerInfos = new ArrayList<>(partenerPrizeMap.size());
|
|
|
|
List<JSONObject> partnerInfos = new ArrayList<>(partenerPrizeMap.size());
|
|
|
|
BigDecimal resultGrossAmount = BigDecimal.ZERO;
|
|
|
|
BigDecimal resultGrossAmount = BigDecimal.ZERO;
|
|
|
|
BigDecimal resultOrgCharge = BigDecimal.ZERO;
|
|
|
|
BigDecimal resultOrgCharge = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal resultAgentCharge = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal resultOrgNetCharge = BigDecimal.ZERO;
|
|
|
|
for (Map.Entry<String, List<JSONObject>> entry : partenerPrizeMap.entrySet()) {
|
|
|
|
for (Map.Entry<String, List<JSONObject>> entry : partenerPrizeMap.entrySet()) {
|
|
|
|
JSONObject sumResult = new JSONObject();
|
|
|
|
JSONObject sumResult = new JSONObject();
|
|
|
|
BigDecimal grossAmount = BigDecimal.ZERO;
|
|
|
|
BigDecimal grossAmount = BigDecimal.ZERO;
|
|
|
|
BigDecimal orgCharge = BigDecimal.ZERO;
|
|
|
|
BigDecimal orgCharge = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal agentCharge = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal orgNetCharge = BigDecimal.ZERO;
|
|
|
|
String cityPartnerName = "";
|
|
|
|
String cityPartnerName = "";
|
|
|
|
int org_id = 0;
|
|
|
|
int org_id = 0;
|
|
|
|
for (JSONObject jsonObject : entry.getValue()) {
|
|
|
|
for (JSONObject jsonObject : entry.getValue()) {
|
|
|
|
grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount"));
|
|
|
|
grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount"));
|
|
|
|
orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge"));
|
|
|
|
orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge"));
|
|
|
|
|
|
|
|
agentCharge = agentCharge.add(jsonObject.getBigDecimal("total_charge"));
|
|
|
|
|
|
|
|
orgNetCharge = orgNetCharge.add(jsonObject.getBigDecimal("org_net_charge"));
|
|
|
|
org_id = jsonObject.getIntValue("org_id");
|
|
|
|
org_id = jsonObject.getIntValue("org_id");
|
|
|
|
cityPartnerName = jsonObject.getString("name");
|
|
|
|
cityPartnerName = jsonObject.getString("name");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sumResult.put("gross_amount", grossAmount);
|
|
|
|
sumResult.put("gross_amount", grossAmount);
|
|
|
|
sumResult.put("org_charge", orgCharge);
|
|
|
|
sumResult.put("org_charge", orgCharge);
|
|
|
|
|
|
|
|
sumResult.put("org_net_charge",orgNetCharge);
|
|
|
|
sumResult.put("org_name", cityPartnerName);
|
|
|
|
sumResult.put("org_name", cityPartnerName);
|
|
|
|
sumResult.put("org_id", org_id);
|
|
|
|
sumResult.put("org_id", org_id);
|
|
|
|
sumResult.put("channel_detail", entry.getValue());
|
|
|
|
sumResult.put("channel_detail", entry.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sumResult.put("royalpay_charge",countPartnerPrizeMap.get(org_id)==null?0:countPartnerPrizeMap.get(org_id).getBigDecimal("royalpay_charge"));
|
|
|
|
resultGrossAmount = resultGrossAmount.add(grossAmount);
|
|
|
|
resultGrossAmount = resultGrossAmount.add(grossAmount);
|
|
|
|
resultOrgCharge = resultOrgCharge.add(orgCharge);
|
|
|
|
resultOrgCharge = resultOrgCharge.add(orgCharge);
|
|
|
|
|
|
|
|
resultAgentCharge = resultAgentCharge.add(agentCharge);
|
|
|
|
|
|
|
|
resultOrgNetCharge = resultOrgNetCharge.add(orgNetCharge);
|
|
|
|
partnerInfos.add(sumResult);
|
|
|
|
partnerInfos.add(sumResult);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.put("royalpay_charge", royalpay_charge);
|
|
|
|
result.put("monthstr", monthStr);
|
|
|
|
result.put("monthstr", monthStr);
|
|
|
|
result.put("gross_amount", resultGrossAmount);
|
|
|
|
result.put("gross_amount", resultGrossAmount);
|
|
|
|
|
|
|
|
result.put("agent_total_charge", resultAgentCharge);
|
|
|
|
result.put("org_charge", resultOrgCharge);
|
|
|
|
result.put("org_charge", resultOrgCharge);
|
|
|
|
|
|
|
|
result.put("org_net_charge", resultOrgNetCharge);
|
|
|
|
result.put("partner_info_list", partnerInfos);
|
|
|
|
result.put("partner_info_list", partnerInfos);
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|