add 商户KYC认证进度百分比

master
luoyang 5 years ago
parent e2d411b60f
commit 40b36c432a

@ -11,6 +11,8 @@ public interface KycManage {
JSONObject listCompletedClients(JSONObject manager, KycPartnersQuery query);
JSONObject getKycDashboard(JSONObject manager);
List<JSONObject> listNeedHelpClients(JSONObject manager, KycPartnersQuery query);
void sendNotify(JSONObject complianceInfo);

@ -30,7 +30,6 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class KycManageImpl implements KycManage {
@ -69,6 +68,24 @@ public class KycManageImpl implements KycManage {
return PageListUtils.buildPageListResult(completedClients);
}
@Override
public JSONObject getKycDashboard(JSONObject manager) {
JSONObject params = new JSONObject();
JSONObject result = new JSONObject();
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
params.put("bd_user", manager.getString("manager_id"));
}
List<JSONObject> needHelps = clientComplianceCompanyMapper.listNeedHelpClients(params);
result.put("total_need_help", needHelps != null ? needHelps.size() : 0);
result.put("total_partner", clientMapper.countKycClients(params));
result.put("total_progressing", clientComplianceCompanyMapper.countKycProgressClients(params));
params.put("status", 1);
result.put("total_pass_partner", clientComplianceCompanyMapper.countKycProgressClients(params));
params.put("status", 2);
result.put("total_refuse_partner", clientComplianceCompanyMapper.countKycProgressClients(params));
return result;
}
@Override
public List<JSONObject> listNeedHelpClients(JSONObject manager, KycPartnersQuery query) {
JSONObject params = query.toJsonParam();
@ -139,24 +156,29 @@ public class KycManageImpl implements KycManage {
}
private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) {
//todo 可支持bdleader查看组内bd商户kyc情况
// if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
// JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id"));
// if (bdConfig != null) {
// params.put("bd_group", bdConfig.getString("bd_group"));
// List<JSONObject> listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group"));
// List<String> bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList());
// if (params.containsKey("bd_user")) {
// if (!bdUserId.contains(params.getString("bd_user"))) {
// params.remove("bd_user");
// }
// }
// }
// if (query.isOnlyMe()) {
// params.put("bd_user", manager.getString("manager_id"));
// if (params.containsKey("bd_group")) {
// params.remove("bd_group");
// }
// }
// }
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id"));
if (bdConfig != null) {
params.put("bd_group", bdConfig.getString("bd_group"));
List<JSONObject> listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group"));
List<String> bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList());
if (params.containsKey("bd_user")) {
if (!bdUserId.contains(params.getString("bd_user"))) {
params.remove("bd_user");
}
}
}
if (query.isOnlyMe()) {
params.put("bd_user", manager.getString("manager_id"));
if (params.containsKey("bd_group")) {
params.remove("bd_group");
}
}
params.put("bd_user", manager.getString("manager_id"));
}
//todo 如果是合规增加bd_user为customerService
}
}

@ -35,4 +35,9 @@ public class KycManageController {
public List<JSONObject> listNeedHelpClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, KycPartnersQuery query) {
return kycManage.listNeedHelpClients(manager, query);
}
@ManagerMapping(value = "/partner/dashboard", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public JSONObject getKycDashboard(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return kycManage.getKycDashboard(manager);
}
}

@ -36,4 +36,6 @@ public interface ClientComplianceCompanyMapper {
PageList<JSONObject> listKycProgressClients(JSONObject params, PageBounds pageBounds);
int countKycProgressClients(JSONObject params);
}

@ -141,4 +141,6 @@ public interface ClientMapper {
List<Integer> listUseAlipayMerchant(@Param("start") int start, @Param("end") int end);
PageList<JSONObject> listCompletedContractKycClients(JSONObject params, PageBounds pageBounds);
int countKycClients(JSONObject params);
}

@ -66,4 +66,27 @@
</if>
</where>
</select>
<select id="countKycProgressClients" resultType="int">
SELECT count(1) FROM client_authfile_compliance a INNER JOIN sys_clients c on c.client_id = a.client_id
<where>
and a.type = 2
and a.status != 9
<if test="status!=null">
and a.status = #{status}
</if>
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON a.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= date(now()) and (d.end_date is null or date(d.end_date)&gt;= date(now())) and
d.is_valid=1
</if>
<if test="bd_group!=null">and a.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config fb ON fb.manager_id=b.bd_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now())
AND (fb.bd_group=#{bd_group} or fb.manager_id=#{bd_group})
)
</if>
</where>
</select>
</mapper>

@ -798,4 +798,23 @@
</if>
</where>
</select>
<select id="countKycClients" resultType="int">
SELECT count(1) FROM sys_clients c
<where>
and c.is_valid=1
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= date(now()) and (d.end_date is null or date(d.end_date)&gt;= date(now())) and
d.is_valid=1
</if>
<if test="bd_group!=null">and c.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config fb ON fb.manager_id=b.bd_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now())
AND (fb.bd_group=#{bd_group} or fb.manager_id=#{bd_group})
)
</if>
</where>
</select>
</mapper>

@ -56,7 +56,6 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
};
$scope.addHandleLog = function (info) {
debugger
$uibModal.open({
templateUrl: '/static/payment/partner/templates/add_handle_log.html',
controller: 'addHandleDetailCtrl',
@ -68,6 +67,62 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
commonDialog.alert({title: 'Success', type: 'success'});
})
};
$scope.loadKYCDashboardInfo = function () {
var params = angular.copy($scope.params);
$http.get('/sys/kyc/manage/partner/dashboard').then(function (resp) {
$scope.total_need_help = resp.data.total_need_help;
$scope.total_partner = resp.data.total_partner;
$scope.total_progressing = resp.data.total_progressing;
$scope.total_pass_partner = resp.data.total_pass_partner;
$scope.total_refuse_partner = resp.data.total_refuse_partner;
$(".circleChart1").circleChart({
value: ($scope.total_need_help/$scope.total_partner)*100,
redraw: false,
startAngle: 50,
color: "#68cf7c",
size: 130,
text: 0 + '%',
onDraw: function(el, circle){
$(".circleChart_text", el).html(Math.round(circle.value) + '%');
}
});
$(".circleChart2").circleChart({
value: ($scope.total_progressing/$scope.total_partner)*100,
redraw: false,
startAngle: 50,
color: "#68cf7c",
size: 130,
text: 0 + '%',
onDraw: function(el, circle){
$(".circleChart_text", el).html(Math.round(circle.value) + '%');
}
});
$(".circleChart3").circleChart({
value: ($scope.total_pass_partner/$scope.total_partner)*100,
redraw: false,
startAngle: 50,
color: "#96cf9a",
size: 130,
text: 0 + '%',
onDraw: function(el, circle){
$(".circleChart_text", el).html(Math.round(circle.value) + '%');
}
});
$(".circleChart4").circleChart({
value: ($scope.total_refuse_partner/$scope.total_progressing)*100,
redraw: false,
startAngle: 50,
color: "#96cf9a",
size: 130,
text: 0 + '%',
onDraw: function(el, circle){
$(".circleChart_text", el).html(Math.round(circle.value) + '%');
}
});
});
};
$scope.loadKYCDashboardInfo();
}]);
app.controller('addHandleDetailCtrl', [ '$scope', '$http', '$state', 'compliance_id', 'commonDialog',function ($scope, $http, $state, compliance_id, commonDialog) {

@ -3,36 +3,30 @@
.btn-box-tool {
color: #97a0b3
}
.bg-info4 {
color: white;
background-color: #00c0ef;
margin: 0 10px 20px 10px;
}
.bg-info1 {
color: white;
background-color: #dd4b39;
margin: 0 10px 20px 10px;
}
.bg-info2 {
color: white;
background-color: #00a65a;
margin: 0 10px 20px 10px;
}
.bg-info3 {
color: white;
background-color: #f39c12;
margin: 0 10px 20px 10px;
}
.circleChart_canvas {
display: none;
}
</style>
<script>
$(".circleChart1").circleChart({
value: Math.random()*100,
redraw: false,
startAngle: 50,
text: 0 + '%',
onDraw: function(el, circle){
$(".circleChart_text", el).html(Math.round(circle.value) + '%');
}
});
$(".circleChart2").circleChart({
value: Math.random()*100,
redraw: false,
startAngle: 50,
text:true,
onDraw: function(el, circle){
$(".circleChart_text", el).html(Math.round(circle.value) + '%');
}
});
$(".circleChart3").circleChart({
value: Math.random()*100,
redraw: false,
startAngle: 50,
text: 0 + '%',
onDraw: function(el, circle){
$(".circleChart_text", el).html(Math.round(circle.value) + '%');
}
});
</script>
<section class="content-header" style="margin-bottom: 30px">
<h1>商户KYC认证进度</h1>
<ol class="breadcrumb">
@ -43,43 +37,56 @@
</ol>
</section>
<div class="row">
<div class="col-lg-4 col-6">
<div class="row" style="padding: 0 30px">
<div class="col-lg-3 col-6">
<!-- small card -->
<div class="small-box bg-info">
<div class="inner">
<h3>44</h3>
<p>User Registrations</p>
<div class="small-box bg-info4">
<div class="inner" style="height: 130px;">
<h2 class="bg-title">{{total_need_help}}</h2>
<p class="bg-title1">{{total_need_help}}/{{total_partner}}</p>
<p class="bg-title2">需要帮助的商户/总商户数</p>
</div>
<div class="icon">
<div class="circleChart1"></div>
<div class="icon" style="position: absolute;top: 2px;right: 10px;">
<div class="circleChart1" style="color: white"></div>
</div>
</div>
</div>
<div class="col-lg-4 col-6">
<div class="col-lg-3 col-6">
<!-- small card -->
<div class="small-box bg-info">
<div class="inner">
<h3>44</h3>
<p>User Registrations</p>
<div class="small-box bg-info3">
<div class="inner" style="height: 130px;">
<h2 class="bg-title">{{total_progressing}}</h2>
<p class="bg-title1">{{total_progressing}}/{{total_partner}}</p>
<p class="bg-title2">已提交材料/总商户数</p>
</div>
<div class="icon">
<div class="circleChart2"></div>
<div class="icon" style="position: absolute;top: 2px;right: 10px;">
<div class="circleChart2" style="color: white"></div>
</div>
</div>
</div>
<div class="col-lg-4 col-6">
<div class="col-lg-3 col-6">
<!-- small card -->
<div class="small-box bg-info">
<div class="inner">
<h3>44</h3>
<p>User Registrations</p>
<div class="small-box bg-info2">
<div class="inner" style="height: 130px;">
<h2 class="bg-title">{{total_pass_partner}}</h2>
<p class="bg-title1">{{total_pass_partner}}/{{total_partner}}</p>
<p class="bg-title2">已通过/总商户数</p>
</div>
<div class="icon" style="position: absolute;top: 2px;right: 10px;">
<div class="circleChart3" style="color: white"></div>
</div>
</div>
</div>
<div class="col-lg-3 col-6">
<!-- small card -->
<div class="small-box bg-info1">
<div class="inner" style="height: 130px;">
<h2 class="bg-title">{{total_refuse_partner}}</h2>
<p class="bg-title1">{{total_refuse_partner}}/{{total_progressing}}</p>
<p class="bg-title2">材料打回/提交审核商户数</p>
</div>
<div class="icon">
<div class="circleChart3"></div>
<div class="icon" style="position: absolute;top: 2px;right: 10px;">
<div class="circleChart4" style="color: white"></div>
</div>
</div>
</div>
@ -253,7 +260,7 @@
</table>
</div>
<div class="modal-footer">
<uib-pagination ng-if="approving.length"
<uib-pagination ng-if="approving.size()>0"
class="pagination"
total-items="progressPagination.totalCount"
boundary-links="true"

Loading…
Cancel
Save