fix 优化前端代码

master
luoyang 5 years ago
parent 8e8781c7e2
commit 073bba4e5a

@ -40,7 +40,6 @@ import java.util.List;
@Service
public class KycServiceImpl implements KycService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Resource
private MailService mailService;
@ -207,7 +206,7 @@ public class KycServiceImpl implements KycService {
if (client == null) {
throw new InvalidShortIdException();
}
checkClientBelongBd(client.getIntValue("client_id"), manager.getString("manager_id"));
checkClientBelongBd(client.getIntValue("client_id"), manager);
JSONObject kycInfo = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id"));
if (kycInfo == null || kycInfo.getIntValue("status") != 9) {
throw new BadRequestException("This Partner is not application submitted");
@ -222,7 +221,7 @@ public class KycServiceImpl implements KycService {
throw new InvalidShortIdException();
}
if (account.containsKey("manager_id")) {
checkClientBelongBd(client.getIntValue("client_id"), account.getString("manager_id"));
checkClientBelongBd(client.getIntValue("client_id"), account);
}
int sourceEnum = 2;
List<JSONObject> clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
@ -284,7 +283,7 @@ public class KycServiceImpl implements KycService {
if (client == null) {
throw new InvalidShortIdException();
}
checkClientBelongBd(client.getIntValue("client_id"), manager.getString("manager_id"));
checkClientBelongBd(client.getIntValue("client_id"), manager);
clientManager.uploadKycFilesForWaitCompliance(manager, clientMoniker, kycFilesInfo);
}
@ -298,41 +297,26 @@ public class KycServiceImpl implements KycService {
if (client == null) {
throw new InvalidShortIdException();
}
checkClientBelongBd(file.getIntValue("client_id"), manager.getString("manager_id"));
checkClientBelongBd(file.getIntValue("client_id"), manager);
clientFilesMapper.deleteByClientAndFileId(fileId);
}
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"))) {
params.put("bd_user", manager.getString("manager_id"));
}
//todo 如果是合规增加bd_user为customerService
if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) {
params.put("bd_user", "186");
}
}
private void checkClientBelongBd(int clientId, String managerId) {
int permissionInt = clientBDMapper.checkBDPermission(clientId, managerId);
private void checkClientBelongBd(int clientId, JSONObject manager) {
if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) {
manager.put("manager_id","186");
}
int permissionInt = clientBDMapper.checkBDPermission(clientId, manager.getString("manager_id"));
if (permissionInt < 1) {
// throw new BadRequestException("This Partner is not belongs to you");
throw new BadRequestException("This Partner is not belongs to you");
}
}

@ -20,14 +20,12 @@
<select id="listNeedHelpClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,c.short_name,c.create_time,c.bd_user_name,c.approve_result,c.approve_time,c.open_status,
c.source as client_source,c.refuse_remark,a.* FROM client_authfile_compliance a INNER JOIN sys_clients c on c.client_id = a.client_id
<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>
<where>
and a.type = 2
and a.status = 9
<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
@ -35,6 +33,8 @@
AND (fb.bd_group=#{bd_group} or fb.manager_id=#{bd_group})
)
</if>
and a.type = 2
and a.status = 9
</where>
order by a.submit_time desc
</select>
@ -42,21 +42,12 @@
<select id="listKycProgressClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,c.short_name,c.create_time,c.bd_user_name,c.approve_result,c.approve_time,c.open_status,
c.source as client_source,a.* FROM client_authfile_compliance a INNER JOIN sys_clients c on c.client_id = a.client_id
<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>
<where>
and a.type = 2
and a.status != 9
and a.status != 2
<if test="client_moniker!=null">
and c.client_moniker = #{client_moniker}
</if>
<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
@ -64,22 +55,26 @@
AND (fb.bd_group=#{bd_group} or fb.manager_id=#{bd_group})
)
</if>
<if test="client_moniker!=null">
and c.client_moniker = #{client_moniker}
</if>
<if test="status!=null">
and a.status = #{status}
</if>
and a.type = 2
and a.status != 9
and a.status != 2
</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
<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>
<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
@ -87,6 +82,11 @@
AND (fb.bd_group=#{bd_group} or fb.manager_id=#{bd_group})
)
</if>
and a.type = 2
and a.status != 9
<if test="status!=null">
and a.status = #{status}
</if>
</where>
</select>
</mapper>

@ -773,6 +773,11 @@
<select id="listCompletedContractKycClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.client_moniker,c.short_name,c.create_time,c.bd_user_name,c.approve_result,c.approve_time,c.open_status,
c.source AS client_source,c.refuse_remark,a.* FROM sys_clients c LEFT JOIN client_authfile_compliance a ON c.client_id = a.client_id AND a.type=2
<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>
<where>
and c.is_valid=1 and (a.is_valid is null or a.status = 2)
<if test="client_moniker!=null">
@ -784,11 +789,6 @@
<if test="status==2">
and a.status = 2
</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

@ -62,7 +62,7 @@
</div>
</a>
</div>
<div ng-if="'110'|withRole" class="col-sm-2 col-xs-6">
<div ng-if="'100'|withRole" class="col-sm-2 col-xs-6">
<a ui-sref="partnerKYCProgress" ui-sref-opts="{reload:true}">
<div class="description-block">
<img src="/static/images/main_menu/merchant_info.png"/>

@ -17,9 +17,9 @@
<li ui-sref-active="active">
<a ui-sref="partner_compliance_auth.partner_kyc_files_auth"> <span>KYC文件审核</span></a>
</li>
<!--<li ui-sref-active-eq="active" ng-if="'citypartner'|withModule">
<a ui-sref="partner_apply.citypartner_reg"><i class="fa fa-tv"></i> <span>City Partners</span></a>
</li>-->
<li ui-sref-active="active">
<a ui-sref="partnerKYCProgress"> <span>CustomerService商户KYC认证进度</span></a>
</li>
</ul>
</div>
</div>

Loading…
Cancel
Save