Customer impression task

master
wangning 7 years ago
parent b46745ed55
commit a02314e294

@ -566,6 +566,23 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
recordIds.add(jsonObject.getString("record_id"));
}
BigDecimal royalpay_charge = BigDecimal.ZERO;
List<JSONObject> partnerPrizeDetailList = financialPartnerCommissionDetailMapper.listDetailByMonth(year,month);
Map<Integer, JSONObject> countPartnerPrizeMap = new HashMap<>();
for (JSONObject p : partnerPrizeDetailList) {
royalpay_charge = royalpay_charge.add(p.getBigDecimal("royalpay_charge"));
Integer key = p.getInteger("client_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")));
}
}
List<JSONObject> details = financialAgentCommissionDetailMapper.listDetailsByRecordIds(recordIds);
Map<String, List<JSONObject>> detailMap = new HashMap<>();
for (JSONObject detail : details) {
@ -582,27 +599,35 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
List<JSONObject> partnerClientInfos = new ArrayList<>();
BigDecimal resultGrossAmount = BigDecimal.ZERO;
BigDecimal resultOrgCharge = BigDecimal.ZERO;
BigDecimal resultOrgNetCharge = BigDecimal.ZERO;
for (Map.Entry<String, List<JSONObject>> entry : detailMap.entrySet()) {
JSONObject sumResult = new JSONObject();
BigDecimal grossAmount = BigDecimal.ZERO;
BigDecimal orgCharge = BigDecimal.ZERO;
BigDecimal orgNetCharge = BigDecimal.ZERO;
String clientMoniker = "";
int client_id = 0;
for (JSONObject jsonObject : entry.getValue()) {
grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount"));
orgCharge = orgCharge.add(jsonObject.getBigDecimal("org_charge"));
orgNetCharge = orgNetCharge.add(jsonObject.getBigDecimal("org_net_charge"));
clientMoniker = jsonObject.getString("client_moniker");
}
resultGrossAmount = resultGrossAmount.add(grossAmount);
resultOrgCharge = resultOrgCharge.add(orgCharge);
resultOrgNetCharge = resultOrgNetCharge.add(orgNetCharge);
sumResult.put("gross_amount", grossAmount);
sumResult.put("org_charge", orgCharge);
sumResult.put("client_moniker", clientMoniker);
sumResult.put("org_net_charge",orgNetCharge);
sumResult.put("royalpay_charge",countPartnerPrizeMap.get(client_id)==null?BigDecimal.ZERO:countPartnerPrizeMap.get(client_id).getBigDecimal("royalpay_charge"));
partnerClientInfos.add(sumResult);
}
result.put("partner_client_infos", partnerClientInfos);
result.put("monthstr", monthStr);
result.put("gross_amount", resultGrossAmount);
result.put("org_charge", resultOrgCharge);
result.put("org_net_charge", resultOrgNetCharge);
return result;
}

@ -22,4 +22,7 @@ public interface FinancialPartnerCommissionDetailMapper {
List<JSONObject> listDetails(@Param("record_id") String recordId);
List<JSONObject> listDetailsByRecordIds(List<String> recordId);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> listDetailByMonth(@Param("year") int year, @Param("month") int month);
}

@ -23,4 +23,5 @@
</foreach>
ORDER BY c.client_moniker ASC, d.date_from ASC
</select>
</mapper>

@ -17,7 +17,7 @@
Month:<span ng-bind="detail.monthstr"></span>
</div>
<div class="col-xs-3 col-sm-3 nowrap">
Total Transaction:{{detail.total_transaction}}
Total Transaction:{{detail.gross_amount}}
</div>
<div class="col-xs-3 col-sm-3 nowrap">
Total Charge:{{detail.total_charge}}
@ -26,10 +26,10 @@
RoyalPay Charge:{{detail.royalPay_charge}}
</div>
<div class="col-xs-3 col-sm-3 nowrap">
Net Charge:{{detail.net_charge}}
Org Net Charge:{{detail.org_net_charge}}
</div>
<div class="col-xs-6 col-sm-6 nowrap">
City Partner Charge:{{detail.city_partner_charge}}
City Partner Charge:{{detail.org_charge}}
</div>
<div class="col-xs-3 ng-scope"
@ -45,8 +45,8 @@
ng-bind="detail.Alipay_total_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">RoyalPay Charge:<span
ng-bind="detail.Alipay_royalpay_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">Net Charge:<span
ng-bind="detail.Alipay_net_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">Org Net Charge:<span
ng-bind="detail.Alipay_org_net_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">City Partner Charge:<span
ng-bind="detail.Alipay_org_charge|currency:'AUD'"></span></h5>
</div>
@ -66,8 +66,8 @@
ng-bind="detail.Bestpay_total_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">RoyalPay Charge:<span
ng-bind="detail.Bestpay_royalpay_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">Net Charge:<span
ng-bind="detail.Bestpay_net_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">Org Net Charge:<span
ng-bind="detail.Bestpay_org_net_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">City Partner Charge:<span
ng-bind="detail.Bestpay_org_charge|currency:'AUD'"></span></h5>
</div>
@ -87,8 +87,8 @@
ng-bind="detail.Wechat_total_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding"> RoyalPay Charge:<span
ng-bind="detail.Wechat_royalpay_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">Net Charge:<span
ng-bind="detail.Wechat_net_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">Org Net Charge:<span
ng-bind="detail.Wechat_org_net_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">City Partner Charge:<span
ng-bind="detail.Wechat_org_charge|currency:'AUD'"></span></h5>
</div>
@ -108,8 +108,8 @@
ng-bind="detail.jd_total_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding"> RoyalPay Charge:<span
ng-bind="detail.jd_royalpay_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">Net Charge:<span
ng-bind="detail.jd_net_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">Org Net Charge:<span
ng-bind="detail.jd_org_net_charge|currency:'AUD'"></span></h5>
<h5 class="ng-binding">City Partner Charge:<span
ng-bind="detail.jd_org_charge|currency:'AUD'"></span></h5>
</div>
@ -127,7 +127,7 @@
<th>Transaction</th>
<th>Total Charge</th>
<th>RoyalPay Charge</th>
<th>Net Charge</th>
<th>Org Net Charge</th>
<th>City Partner Charge</th>
<th>Details</th>
</tr>
@ -138,7 +138,7 @@
<td ng-bind="log.gross_amount|currency:'AUD'"></td>
<td ng-bind="log.total_charge|currency:'AUD'"></td>
<td ng-bind="log.royalpay_charge|currency:'AUD'"></td>
<td ng-bind="log.net_charge|currency:'AUD'"></td>
<td ng-bind="log.org_net_charge|currency:'AUD'"></td>
<td ng-bind="log.org_charge|currency:'AUD'"></td>
<td>
@ -157,7 +157,7 @@
<th>Transaction Amount</th>
<th>Total Charge</th>
<th>RoyalPay Charge</th>
<th>Net Charge</th>
<th>Org Net Charge</th>
<th>City Partner Charge</th>
<th>channel</th>
</tr>
@ -171,7 +171,7 @@
<td ng-bind="detail.gross_amount"></td>
<td ng-bind="detail.total_charge"></td>
<td ng-bind="detail.royalpay_charge"></td>
<td ng-bind="detail.net_charge"></td>
<td ng-bind="detail.org_net_charge"></td>
<td ng-bind="detail.org_charge"></td>
<td ng-bind="detail.channel"></td>
</tr>

Loading…
Cancel
Save