[R] APP端接口调整

master
liuxinxin 5 years ago
parent 87e686c1b5
commit b35e33fc0a

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.3.10</version> <version>1.3.11</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -219,6 +219,8 @@ public interface RetailAppService {
JSONObject getClientAuthFileStatusAggregate(JSONObject device); JSONObject getClientAuthFileStatusAggregate(JSONObject device);
JSONObject getKycFiles(JSONObject device);
void getCBBankAggregateFile(JSONObject device, HttpServletResponse httpResponse); void getCBBankAggregateFile(JSONObject device, HttpServletResponse httpResponse);
JSONObject getSourceAggregateFile(JSONObject device); JSONObject getSourceAggregateFile(JSONObject device);
@ -229,11 +231,13 @@ public interface RetailAppService {
List<JSONObject> uploadKycAuthFiles(JSONObject device, ClientKycFilesInfo filesInfo); List<JSONObject> uploadKycAuthFiles(JSONObject device, ClientKycFilesInfo filesInfo);
void uploadKycAuthFilesForApp(JSONObject device, JSONObject filesInfo,String fileType);
void deleteGreenChannelAuthFiles(JSONObject device, String filesInfo); void deleteGreenChannelAuthFiles(JSONObject device, String filesInfo);
void commitAuthFilesToCompliance(JSONObject device, JSONObject photoInfo); void commitAuthFilesToCompliance(JSONObject device, JSONObject photoInfo);
void commitAuthFilesToKyc(JSONObject device); void commitAuthFilesToKyc(JSONObject device,String idType);
JSONObject getClientSubManage(JSONObject device); JSONObject getClientSubManage(JSONObject device);

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.appclient.core.impls;
import au.com.royalpay.payment.core.PaymentApi; import au.com.royalpay.payment.core.PaymentApi;
import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; import au.com.royalpay.payment.manage.activities.app_index.core.AppActService;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper; import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
@ -16,6 +17,7 @@ import au.com.royalpay.payment.manage.customers.core.CouponValidateService;
import au.com.royalpay.payment.manage.device.core.DeviceManager; import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.fund.core.impls.XPlanFundConfigServiceImpl; import au.com.royalpay.payment.manage.fund.core.impls.XPlanFundConfigServiceImpl;
import au.com.royalpay.payment.manage.kyc.core.KycService; import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.kyc.enums.FilesAuthTypeEnum;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService; import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.mappers.client.AuthAppMessageMapper; import au.com.royalpay.payment.manage.mappers.client.AuthAppMessageMapper;
import au.com.royalpay.payment.manage.mappers.log.*; import au.com.royalpay.payment.manage.mappers.log.*;
@ -107,6 +109,7 @@ import java.util.*;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/** /**
* Created by yishuqian on 28/03/2017. * Created by yishuqian on 28/03/2017.
@ -219,6 +222,8 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource @Resource
private MessageSource messageSource; private MessageSource messageSource;
@Resource @Resource
private ClientFilesMapper clientFilesMapper;
@Resource
private DeviceManager deviceManager; private DeviceManager deviceManager;
private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf"; private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf";
private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/10/22/1571723034726_5xK6A0FGv5aQPbMIDJzXJrUPKHFutv.pdf"; private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/10/22/1571723034726_5xK6A0FGv5aQPbMIDJzXJrUPKHFutv.pdf";
@ -2529,6 +2534,61 @@ public class RetailAppServiceImp implements RetailAppService {
return authFileStatus; return authFileStatus;
} }
@Override
public JSONObject getKycFiles(JSONObject device) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject file = checkKycFileStatusForApp(client);
JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(device.getIntValue("client_id"));
file.put("file_company", compliance);
return file;
}
public JSONObject checkKycFileStatusForApp(JSONObject client) {
JSONObject result = new JSONObject();
boolean lessKycFiles = true;
JSONObject kycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id"));
if(kycFilesAuth != null
|| !("PINE".equals(client.getString("client_moniker"))
|| "LEOH".equals(client.getString("client_moniker")))){
lessKycFiles = false;
}
result.put("help_confirm", messageSource.getMessage("client.auth.file.help_confirm", null, RequestEnvironment.getLocale()));
result.put("help_success", messageSource.getMessage("client.auth.file.help_success", null, RequestEnvironment.getLocale()));
result.put("client_less_file", lessKycFiles);
if (lessKycFiles) {
List<JSONObject> kycFiles = new ArrayList<>();
kycFiles = clientFilesMapper.findKycClientFileByClient(client.getIntValue("client_id"));
for (JSONObject file : kycFiles) {
result.put(file.getString("file_name"), file.getString("file_value"));
}
List<JSONObject> clientFileUrl = kycFiles.stream()
.filter(json -> ("kyc_utility_bill_file".equals(json.getString("file_name"))))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
params.put("file_id", json.getString("file_id"));
params.put("status", json.getString("status"));
params.put("file_value", json.getString("file_value"));
return params;
})
.collect(Collectors.toList());
if (clientFileUrl.size() > 0) {
result.put("kyc_utility_bill_file", clientFileUrl);
}
}
return result;
}
public JSONObject complianceFilesNotice(JSONObject client,JSONObject account){ public JSONObject complianceFilesNotice(JSONObject client,JSONObject account){
JSONObject complianceFilesNotice = new JSONObject(); JSONObject complianceFilesNotice = new JSONObject();
@ -2538,9 +2598,10 @@ public class RetailAppServiceImp implements RetailAppService {
} }
JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")); JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id"));
complianceFilesNotice.put("auth_type",FilesAuthTypeEnum.COMPLIANCE.getAuthType());
complianceFilesNotice.put("type", messageSource.getMessage("client.auth.file.compliance.type", null, RequestEnvironment.getLocale())); complianceFilesNotice.put("type", messageSource.getMessage("client.auth.file.compliance.type", null, RequestEnvironment.getLocale()));
complianceFilesNotice.put("deadline", messageSource.getMessage("client.auth.file.aggregate.deadline", null, RequestEnvironment.getLocale())); complianceFilesNotice.put("deadline","2020-01-31");
complianceFilesNotice.put("root_url","111"); /* complianceFilesNotice.put("root_url","111");*/
complianceFilesNotice.put("client_less_file",complianceFileStatus.getBoolean("client_less_file")); complianceFilesNotice.put("client_less_file",complianceFileStatus.getBoolean("client_less_file"));
if(compliance != null){ if(compliance != null){
complianceFilesNotice.put("refused_reason",compliance.getString("description")); complianceFilesNotice.put("refused_reason",compliance.getString("description"));
@ -2559,9 +2620,10 @@ public class RetailAppServiceImp implements RetailAppService {
return null; return null;
} }
kycFilesNotice.put("auth_type",FilesAuthTypeEnum.KYC.getAuthType());
kycFilesNotice.put("type", messageSource.getMessage("client.auth.file.kyc.type", null, RequestEnvironment.getLocale())); kycFilesNotice.put("type", messageSource.getMessage("client.auth.file.kyc.type", null, RequestEnvironment.getLocale()));
kycFilesNotice.put("deadline", messageSource.getMessage("client.auth.file.aggregate.deadline", null, RequestEnvironment.getLocale())); kycFilesNotice.put("deadline", "2020-01-31");
kycFilesNotice.put("root_url","111"); /* kycFilesNotice.put("root_url","111");*/
kycFilesNotice.put("client_less_file",kycFileStatus.getBoolean("client_less_file")); kycFilesNotice.put("client_less_file",kycFileStatus.getBoolean("client_less_file"));
if(compliance != null){ if(compliance != null){
kycFilesNotice.put("refused_reason",compliance.getString("description")); kycFilesNotice.put("refused_reason",compliance.getString("description"));
@ -2693,6 +2755,15 @@ public class RetailAppServiceImp implements RetailAppService {
return clientManager.uploadKycFilesForWaitCompliance(account, client.getString("client_moniker"), clientKycFilesInfo); return clientManager.uploadKycFilesForWaitCompliance(account, client.getString("client_moniker"), clientKycFilesInfo);
} }
@Override
public void uploadKycAuthFilesForApp(JSONObject device, JSONObject filesInfo, String fileType) {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
clientManager.uploadKycFilesForWaitComplianceForApp(account, client.getString("client_moniker"), filesInfo,fileType);
}
@Override @Override
public void deleteGreenChannelAuthFiles(JSONObject device, String fileId) { public void deleteGreenChannelAuthFiles(JSONObject device, String fileId) {
@ -2712,11 +2783,12 @@ public class RetailAppServiceImp implements RetailAppService {
} }
@Override @Override
public void commitAuthFilesToKyc(JSONObject device) { public void commitAuthFilesToKyc(JSONObject device,String idType) {
String clientType = device.getString("client_type"); String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType); deviceSupport.findRegister(clientType);
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
JSONObject account = clientAccountMapper.findById(device.getString("account_id")); JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
account.put("id_type", idType);
kycService.commitAuthKycFilesToCompliance(client.getString("client_moniker"), account, "App"); kycService.commitAuthKycFilesToCompliance(client.getString("client_moniker"), account, "App");
} }

@ -14,9 +14,12 @@ import au.com.royalpay.payment.manage.bill.bean.QueryBillBean;
import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean; import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean;
import au.com.royalpay.payment.manage.bill.core.BillOrderService; import au.com.royalpay.payment.manage.bill.core.BillOrderService;
import au.com.royalpay.payment.manage.bill.core.BillService; import au.com.royalpay.payment.manage.bill.core.BillService;
import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; 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.ClientKycFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery; import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
@ -81,6 +84,12 @@ public class RetailAppController {
private ManualSettleSupport manualSettleSupport; private ManualSettleSupport manualSettleSupport;
@Resource @Resource
private AttachmentClient attachmentClient; private AttachmentClient attachmentClient;
@Resource
private KycService kycService;
@Resource
private ClientAccountMapper clientAccountMapper;
@Autowired @Autowired
private RiskBusinessService riskBusinessService; private RiskBusinessService riskBusinessService;
@ -899,14 +908,21 @@ public class RetailAppController {
retailAppService.commitAuthFilesToCompliance(device, photoInfo); retailAppService.commitAuthFilesToCompliance(device, photoInfo);
} }
@GetMapping("/client/kyc_auth_file/clientViewFiles")
public JSONObject getkycFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
return retailAppService.getKycFiles(device);
}
/** /**
* KYC * KYC
* *
* @param device * @param device
*/ */
@PutMapping("/client/kyc_auth_file") @PostMapping("/client/kyc_auth_file")
public List<JSONObject> uploadKycAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody ClientKycFilesInfo filesInfo) { public JSONObject uploadKycAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestParam MultipartFile file, @RequestParam("fileType") String fileType)throws Exception{
return retailAppService.uploadKycAuthFiles(device, filesInfo); JSONObject fileInfo = attachmentClient.uploadFile(file, false);
retailAppService.uploadKycAuthFilesForApp(device, fileInfo,fileType);
return fileInfo;
} }
/** /**
@ -915,8 +931,19 @@ public class RetailAppController {
* @param device * @param device
*/ */
@PostMapping("/client/auth_file/commit_to_kyc") @PostMapping("/client/auth_file/commit_to_kyc")
public void commitToKycAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { public void commitToKycAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestBody JSONObject params) {
retailAppService.commitAuthFilesToKyc(device); retailAppService.commitAuthFilesToKyc(device, params.getString("id_type"));
}
@PutMapping(value = "/notifyBd")
public void clientKycBdIntervention(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
kycService.kycNotifyBd(account, "app");
}
@PutMapping("/client/kyc_auth_file")
public List<JSONObject> uploadKycAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody ClientKycFilesInfo filesInfo) {
return retailAppService.uploadKycAuthFiles(device, filesInfo);
} }
@GetMapping("/client/sub_manage") @GetMapping("/client/sub_manage")

@ -0,0 +1,22 @@
package au.com.royalpay.payment.manage.kyc.enums;
/**
* @Author: liuxinxin
* @Date: 2019-12-20
*/
public enum FilesAuthTypeEnum {
KYC("kyc"),
COMPLIANCE("compliance");
private final String authType;
public String getAuthType() {
return authType;
}
FilesAuthTypeEnum(String authType) {
this.authType = authType;
}
}

@ -266,6 +266,8 @@ public interface ClientManager {
List<JSONObject> uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo); List<JSONObject> uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo);
List<JSONObject> uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo,String fileType);
List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo);
void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source); void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source);

@ -3613,6 +3613,25 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return fileResult; return fileResult;
} }
@Override
@Transactional
public List<JSONObject> uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo,String fileType) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
List<JSONObject> fileResult = new ArrayList<>();
if (client == null) {
throw new InvalidShortIdException();
}
int clientId = client.getIntValue("client_id");
try {
updateFilesForWaitAuditWithoutRepeatForApp(account,clientId, fileType, filesInfo.getString("url"),fileResult);
} catch (Exception e) {
logger.error("上传KYC文件失败", e);
throw new BadRequestException("上传KYC文件失败" + e.getMessage());
}
return fileResult;
}
@Override @Override
@Transactional @Transactional
@ -4019,6 +4038,35 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
public void updateFilesForWaitAuditWithoutRepeatForApp(JSONObject account, int clientId, String fileType, String fileValue, List<JSONObject> fileResult) {
if (fileValue != null) {
String[] values = fileValue.split(",");
List<JSONObject> repetitiveFiles = clientFilesMapper.findRepetitiveFiles(clientId,fileType);
for (String value : values) {
JSONObject fileJson = new JSONObject();
fileJson.put("client_id", clientId);
fileJson.put("last_update_date", new Date());
fileJson.put("last_update_by", account.getString("display_name"));
fileJson.put("file_name", fileType);
fileJson.put("file_value", value);
fileJson.put("status", 0);
fileJson.put("is_valid", 1);
clientFilesMapper.save(fileJson);
logger.info(clientId + "的fileType文件上传成功" + fileJson.getString("file_id"));
JSONObject file = new JSONObject();
file.put("file_id", fileJson.getString("file_id"));
file.put("file_value", fileJson.getString("file_value"));
fileResult.add(file);
}
if(repetitiveFiles != null){
for(JSONObject repetitiveFile : repetitiveFiles){
clientFilesMapper.deleteByClientAndFileId(repetitiveFile.getString("file_id"));
}
}
}
}
public void updateAggregateFilesForWaitCompliance(JSONObject manager, int clientId, String fileType, String fileValue, List<JSONObject> fileResult) { public void updateAggregateFilesForWaitCompliance(JSONObject manager, int clientId, String fileType, String fileValue, List<JSONObject> fileResult) {
if (fileValue != null) { if (fileValue != null) {

@ -120,3 +120,5 @@ client.auth.file.aggregate.title=Notice Of Supplementary Files
client.auth.file.compliance.type=Compliance Files client.auth.file.compliance.type=Compliance Files
client.auth.file.kyc.type=KYC Files client.auth.file.kyc.type=KYC Files
client.auth.file.aggregate.deadline=Deadline 2020-1-20 client.auth.file.aggregate.deadline=Deadline 2020-1-20
client.auth.file.help_confirm=Please confirm whether you need help from customer service ?
client.auth.file.help_success=Successful notification, please wait for customer service to contact you.

@ -113,3 +113,5 @@ client.auth.file.aggregate.title=补充材料通知
client.auth.file.compliance.type=合规材料 client.auth.file.compliance.type=合规材料
client.auth.file.kyc.type=KYC材料 client.auth.file.kyc.type=KYC材料
client.auth.file.aggregate.deadline=截止时间 2020-1-20 client.auth.file.aggregate.deadline=截止时间 2020-1-20
client.auth.file.help_confirm=请确认您是否需要客服的帮助?
client.auth.file.help_success=通知成功,请等待客服与您联系。

Loading…
Cancel
Save