add 增加bd handle textarea 完善bd帮助流程

master
luoyang 6 years ago
parent adc653509b
commit 8457814c0d

@ -20,4 +20,6 @@ public interface KycService {
void kycNotifyBd(JSONObject account, String source);
JSONObject getKYCFilesForBDHelp(JSONObject manager, String clientMoniker);
void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source);
}

@ -6,9 +6,11 @@ import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage;
@ -56,6 +58,10 @@ public class KycServiceImpl implements KycService {
private RoyalThreadPoolExecutor royalThreadPoolExecutor;
@Resource
private MpWechatApiProvider mpWechatApiProvider;
@Resource
private ClientFilesMapper clientFilesMapper;
@Resource
private SignInAccountService signInAccountService;
@Override
public JSONObject listProgressClients(JSONObject manager, KycPartnersQuery query) {
@ -207,6 +213,64 @@ public class KycServiceImpl implements KycService {
return clientManager.getKycFilesForBD(client);
}
@Override
public void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
int sourceEnum = 2;
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
if (clientAllAuthFiles == null || clientAllAuthFiles.size() == 0) {
throw new BadRequestException("Please check the information is uploaded completely");
}
String[] fileKeys = {"client_bank_file", "client_id_file"};
String[] fileNames = {"ASIC File", "ID"};
if(StringUtils.equalsIgnoreCase("passport",account.getString("id_type")) ){
String[] fileKeysPassport = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"};
String[] fileNamesPassport = {"ASIC File", "Utility Bill Files", "ID"};
fileKeys = fileKeysPassport;
fileNames = fileNamesPassport;
}
for (int i = 0; i < fileKeys.length; i++) {
String fileKey = fileKeys[i];
if (clientAllAuthFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) {
throw new BadRequestException("Please check the " + fileNames[i] + " is uploaded completely");
}
}
if ("app".equals(source.toLowerCase())) {
sourceEnum = 1;
}
JSONObject fileComp = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id"));
if (fileComp == null) {
fileComp = new JSONObject();
fileComp.put("client_id", client.getIntValue("client_id"));
fileComp.put("submit_time", new Date());
fileComp.put("status", 0);
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.containsKey("account_id") ? account.getString("account_id") : account.getString("manager_id"));
fileComp.put("type", 2);
fileComp.put("id_type", account.getString("idType"));
clientComplianceCompanyMapper.save(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
} else if (fileComp.getIntValue("status") == 2 || fileComp.getIntValue("status") == 9) {
fileComp.put("status", 0);
fileComp.put("submit_time", new Date());
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.containsKey("account_id") ? account.getString("account_id") : account.getString("manager_id"));
fileComp.put("id_type", account.getString("idType"));
fileComp.put("bd_handle", account.getString("bd_handle"));
clientComplianceCompanyMapper.update(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
} else {
throw new BadRequestException("please do not repeat submission");
}
if (account.containsKey("account_id")) {
signInAccountService.clearAccountCache(account.getString("account_id"));
}
}
private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) {
//todo 可支持bdleader查看组内bd商户kyc情况
// if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {

@ -41,4 +41,11 @@ public class KycManageController {
public JSONObject getKycFilesForBDHelp(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
return kycService.getKYCFilesForBDHelp(manager,clientMoniker);
}
@ManagerMapping(value = "/{clientMoniker}/kycCommit", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void clientKycFilesViewCommit(@PathVariable String clientMoniker ,@RequestBody JSONObject params,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
manager.put("id_type", params.getString("id_type"));
manager.put("bd_handle", params.getString("bd_handle"));
kycService.commitAuthKycFilesToCompliance(clientMoniker, manager, "Web");
}
}

@ -266,8 +266,6 @@ public interface ClientManager {
void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source);
void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source);
JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException;
JSONObject getClientsAnalysis(JSONObject manager);

@ -3628,63 +3628,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
signInAccountService.clearAccountCache(account.getString("account_id"));
}
@Override
@Transactional
public void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
int sourceEnum = 2;
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
if (clientAllAuthFiles == null || clientAllAuthFiles.size() == 0) {
throw new BadRequestException("Please check the information is uploaded completely");
}
String[] fileKeys = {"client_bank_file", "client_id_file"};
String[] fileNames = {"ASIC File", "ID"};
if( "passport".equals(account.getString("idType")) ){
String[] fileKeys_passport = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"};
String[] fileNames_passport = {"ASIC File", "Utility Bill Files", "ID"};
fileKeys = fileKeys_passport;
fileNames = fileNames_passport;
}
for (int i = 0; i < fileKeys.length; i++) {
String fileKey = fileKeys[i];
if (clientAllAuthFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) {
throw new BadRequestException("Please check the " + fileNames[i] + " is uploaded completely");
}
}
if ("app".equals(source.toLowerCase())) {
sourceEnum = 1;
}
JSONObject fileComp = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id"));
if (fileComp == null) {
fileComp = new JSONObject();
fileComp.put("client_id", client.getIntValue("client_id"));
fileComp.put("submit_time", new Date());
fileComp.put("status", 0);
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.getString("account_id"));
fileComp.put("type", 2);
clientComplianceCompanyMapper.save(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
} else if (fileComp.getIntValue("status") == 2) {
fileComp.put("status", 0);
fileComp.put("submit_time", new Date());
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.getString("account_id"));
clientComplianceCompanyMapper.update(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
} else {
throw new BadRequestException("please do not repeat submission");
}
signInAccountService.clearAccountCache(account.getString("account_id"));
}
@Override
public JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException {
if (StringUtils.isBlank(file.getOriginalFilename())) {

@ -1,8 +1,7 @@
package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
@ -59,12 +58,9 @@ public class PartnerViewController {
@Resource
private ClientContractService clientContractService;
@Resource
private ClientComplianceCompanyMapper clientComplianceCompanyMapper;
@Resource
private SignInAccountService signInAccountService;
@Resource
private SimpleClientApplyService simpleClientApplyService;
private KycService kycService;
@RequestMapping(method = RequestMethod.GET)
@RequirePartner
@ -617,8 +613,8 @@ public class PartnerViewController {
@PartnerMapping(value = "/clientCompliance/{clientMoniker}/kycFilesViewCommit/{idType}", method = RequestMethod.POST)
@ResponseBody
public void clientKycFilesViewCommit(@PathVariable String clientMoniker ,@PathVariable String idType,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
account.put("idType", idType);
clientManager.commitAuthKycFilesToCompliance(clientMoniker, account, "Web");
account.put("id_type", idType);
kycService.commitAuthKycFilesToCompliance(clientMoniker, account, "Web");
}
@PartnerMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file", method = RequestMethod.POST)

@ -161,35 +161,38 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
})
};
$scope.clientComplianceViewCommit = function () {
if (!$scope.file.client_bank_file.file_value) {
if (!$scope.file.client_bank_file && !$scope.file.file_company.bd_handle) {
commonDialog.alert({title: 'Error', content: '请提交* ASIC File', type: 'error'});
return;
}
if (!$scope.file.client_id_file.file_value) {
if (!$scope.file.client_id_file && !$scope.file.file_company.bd_handle) {
commonDialog.alert({title: 'Error', content: '请提交ID护照或驾照信息', type: 'error'});
return;
}
if ($scope.file.id_type == "" || $scope.file.id_type == undefined || $scope.file.id_type == null) {
if (($scope.file.id_type == "" || $scope.file.id_type == undefined || $scope.file.id_type == null) && !$scope.file.file_company.bd_handle) {
commonDialog.alert({title: 'Error', content: '请选择ID文件的类型', type: 'error'});
return;
}
if ($scope.file.id_type == "passport") {
if (!$scope.file.kyc_utility_bill_file.file_value) {
if ($scope.file.id_type == "passport" && !$scope.file.file_company.bd_handle) {
if (!$scope.file.kyc_utility_bill_file) {
commonDialog.alert({title: 'Error', content: '请提交Utility Bill FIles(水电煤账单)信息', type: 'error'});
return;
}
}
var params = {};
params.bd_handle = $scope.file.file_company.bd_handle;
params.id_type = $scope.file.file_company.id_type;
commonDialog.confirm({
title: 'Warning',
content: 'Are you sure to submit files?'
}).then(function () {
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/kycFilesViewCommit/' + $scope.file.id_type).then(function () {
$http.post('/sys/kyc/manage/' + $scope.file.client.client_moniker + '/kycCommit', params).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Commit Successful',
type: 'success'
});
$state.reload();
$state.go('partnerKYCProgress',{},{reload: true});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})

@ -95,7 +95,7 @@
<label class="control-label col-sm-3">* Choose ID Type </label>
<div class="col-sm-5">
<div class="form-control-static">
<select class="form-control" ng-model="file.id_type" style="width: 250px">
<select class="form-control" ng-model="file.file_company.id_type" style="width: 250px">
<option value="">Please Choose</option>
<option value="passport" >Passport</option>
<option value="driver_license">Driver's license</option>
@ -188,6 +188,15 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3"> 无法提供材料原因:</label>
<div class="col-sm-4">
<div class="form-control-static">
<textarea class="form-control" ng-model="file.file_company.bd_handle" style="height: 150px"></textarea>
</div>
</div>
</div>
<div class="row" style="text-align: center">
<button style="width: 30%;height: 50px;font-size: 20px;margin-top: 40px;margin-bottom: 20px;" class="btn-group btn btn-success" type="button"
ng-click="clientComplianceViewCommit()">Submit Files

Loading…
Cancel
Save