Merge branch 'develop'

master
yixian 3 years ago
commit acc5dc5a59

@ -39,6 +39,8 @@ public interface DashboardService {
JSONObject getCommonAnalysis(JSONObject partner, AnalysisBean partnerAnalysisBean); JSONObject getCommonAnalysis(JSONObject partner, AnalysisBean partnerAnalysisBean);
JSONObject getCommonAnalysisByChannel(JSONObject partner, AnalysisBean partnerAnalysisBean);
List<JSONObject> getTradeAnalysisInHours(JSONObject partner, AnalysisBean partnerAnalysisBean); List<JSONObject> getTradeAnalysisInHours(JSONObject partner, AnalysisBean partnerAnalysisBean);
List<JSONObject> getTradeAnalysisInDays(JSONObject partner, AnalysisBean partnerAnalysisBean); List<JSONObject> getTradeAnalysisInDays(JSONObject partner, AnalysisBean partnerAnalysisBean);

@ -335,13 +335,13 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
JSONObject yes = getTransJSONO(params); JSONObject yes = getTransJSONO(params);
res.put("today",today); res.put("today",today);
res.put("yes",yes); res.put("yes",yes);
res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); // res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
params.put("channel", "system"); // params.put("channel", "system");
res.put("sys_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); // res.put("sys_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
params.put("channel", "rpaypmt_card"); // params.put("channel", "rpaypmt_card");
res.put("rpaypmt_card_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); // res.put("rpaypmt_card_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
params.put("channel", "rpaypmt_dd"); // params.put("channel", "rpaypmt_dd");
res.put("rpaypmt_dd_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); // res.put("rpaypmt_dd_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
res.put("trade_amount_rise",yes.getBigDecimal("trade_amount").compareTo(BigDecimal.ZERO)>0 ? (today.getBigDecimal("trade_amount").subtract(yes.getBigDecimal("trade_amount"))).divide(yes.getBigDecimal("trade_amount"), 4, RoundingMode.HALF_UP):BigDecimal.ZERO); res.put("trade_amount_rise",yes.getBigDecimal("trade_amount").compareTo(BigDecimal.ZERO)>0 ? (today.getBigDecimal("trade_amount").subtract(yes.getBigDecimal("trade_amount"))).divide(yes.getBigDecimal("trade_amount"), 4, RoundingMode.HALF_UP):BigDecimal.ZERO);
res.put("trade_count_rise", yes.getIntValue("trade_count") > 0 ? (today.getBigDecimal("trade_count").subtract(yes.getBigDecimal("trade_count"))).divide(yes.getBigDecimal("trade_count"), 4, RoundingMode.HALF_UP) : 0); res.put("trade_count_rise", yes.getIntValue("trade_count") > 0 ? (today.getBigDecimal("trade_count").subtract(yes.getBigDecimal("trade_count"))).divide(yes.getBigDecimal("trade_count"), 4, RoundingMode.HALF_UP) : 0);
res.put("customers_rise", yes.getIntValue("customers") > 0 ? (today.getBigDecimal("customers").subtract(yes.getBigDecimal("customers"))).divide(yes.getBigDecimal("customers"), 4, RoundingMode.HALF_UP) : 0); res.put("customers_rise", yes.getIntValue("customers") > 0 ? (today.getBigDecimal("customers").subtract(yes.getBigDecimal("customers"))).divide(yes.getBigDecimal("customers"), 4, RoundingMode.HALF_UP) : 0);
@ -351,6 +351,38 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
res.put("latest_settle",logs.isEmpty()?BigDecimal.ZERO:logs.get(0).getBigDecimal("income")); res.put("latest_settle",logs.isEmpty()?BigDecimal.ZERO:logs.get(0).getBigDecimal("income"));
return res; return res;
} }
/**
*
* @param partner
* @param partnerAnalysisBean
* @return
*/
@Override
public JSONObject getCommonAnalysisByChannel(JSONObject partner, AnalysisBean partnerAnalysisBean) {
String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = partnerAnalysisBean.toParams(timezone);
try {
clientManager.validateClients(partner.getIntValue("client_id"), params);
} catch (Exception e) {
logger.error("Dashboard analysis request including not permission client_id");
params.remove("client_ids");
}
JSONObject res = new JSONObject();
JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id"));
params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch"));
params.put("client_id", partner.getIntValue("client_id"));
clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params);
params.put("begin",DateUtils.addDays(params.getDate("begin"),-1));
params.put("end",DateUtils.addDays(params.getDate("end"),-1));
String key="not_settled";
if(StringUtils.isNotEmpty(params.getString("channel"))){
key=params.getString("channel")+"_not_settled";
}
res.put(key, new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
return res;
}
private JSONObject getTransJSONO(JSONObject params){ private JSONObject getTransJSONO(JSONObject params){
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
JSONObject object = transactionAnalysisMapper.getClientTransaction(params); JSONObject object = transactionAnalysisMapper.getClientTransaction(params);

@ -27,6 +27,11 @@ public class PartnerDashboardController {
public JSONObject commonAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) { public JSONObject commonAnalysis(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) {
return dashboardService.getCommonAnalysis(partner,partnerAnalysisBean); return dashboardService.getCommonAnalysis(partner,partnerAnalysisBean);
} }
@PartnerMapping("/common_analysis_channel")
@ReadOnlyConnection
public JSONObject commonAnalysisByChannel(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, AnalysisBean partnerAnalysisBean) {
return dashboardService.getCommonAnalysisByChannel(partner,partnerAnalysisBean);
}
@PartnerMapping("/trade_in_hours") @PartnerMapping("/trade_in_hours")
@ReadOnlyConnection @ReadOnlyConnection

@ -685,6 +685,26 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct
$http.get('/dashboard/partner/common_analysis',{params:params}).then(function (resp) { $http.get('/dashboard/partner/common_analysis',{params:params}).then(function (resp) {
$scope.transcommon = resp.data; $scope.transcommon = resp.data;
}); });
var params_total = angular.copy(params);
params_total.channel=null;
$http.get('/dashboard/partner/common_analysis_channel',{params:params_total}).then(function (resp) {
$scope.transcommon_total = resp.data;
});
var params_system = angular.copy(params);
params_system.channel='system';
$http.get('/dashboard/partner/common_analysis_channel',{params:params_system}).then(function (resp) {
$scope.transcommon_system = resp.data;
});
var params_rpaypmt_card = angular.copy(params);
params_rpaypmt_card.channel='rpaypmt_card';
$http.get('/dashboard/partner/common_analysis_channel',{params:params_rpaypmt_card}).then(function (resp) {
$scope.transcommon_rpaypmt_card = resp.data;
});
var params_rpaypmt_dd = angular.copy(params);
params_rpaypmt_dd.channel='rpaypmt_dd';
$http.get('/dashboard/partner/common_analysis_channel',{params:params_rpaypmt_dd}).then(function (resp) {
$scope.transcommon_rpaypmt_dd = resp.data;
});
} }
function getExchangeRate() { function getExchangeRate() {

@ -357,17 +357,17 @@
<span class="mini-stat-icon bg-light"><i class="glyphicon glyphicon-btc text-info"></i></span> <span class="mini-stat-icon bg-light"><i class="glyphicon glyphicon-btc text-info"></i></span>
<div class="mini-stat-info text-right text-light f-14"> <div class="mini-stat-info text-right text-light f-14">
<span class="counter text-white" style="font-size: 24px"> <span class="counter text-white" style="font-size: 24px">
{{transcommon.not_settled|currency:'AUD '}} <i class="fa fa-ellipsis-v" ng-click="hideNotSettleDetail()" style="cursor: pointer"></i> {{transcommon_total.not_settled|currency:'AUD '}} <i class="fa fa-ellipsis-v" ng-click="hideNotSettleDetail()" style="cursor: pointer"></i>
</span> </span>
<div ng-if="showUnSettleDetail"> <div ng-if="showUnSettleDetail">
<span class="counter text-white" style="font-size: 1px"> <span class="counter text-white" style="font-size: 1px">
Cross-border Payment : {{transcommon.sys_not_settled|currency:'AUD '}} Cross-border Payment : {{transcommon_system.system_not_settled|currency:'AUD '}}
</span> </span>
<span class="counter text-white" style="font-size: 1px"> <span class="counter text-white" style="font-size: 1px">
Card Payment : {{transcommon.rpaypmt_card_not_settled|currency:'AUD '}} Card Payment : {{transcommon_rpaypmt_card.rpaypmt_card_not_settled|currency:'AUD '}}
</span> </span>
<span class="counter text-white" style="font-size: 1px"> <span class="counter text-white" style="font-size: 1px">
Direct Debit : {{transcommon.rpaypmt_dd_not_settled|currency:'AUD '}} Direct Debit : {{transcommon_rpaypmt_dd.rpaypmt_dd_not_settled|currency:'AUD '}}
</span> </span>
</div> </div>
UNSETTLED UNSETTLED

Loading…
Cancel
Save