[R]KCY认证Web端开发

master
liuxinxin 5 years ago
parent 97effc720b
commit e2d411b60f

@ -13,12 +13,16 @@ public class ClientComplianceQuery {
private int page = 1; private int page = 1;
private String status; private String status;
private String client_moniker; private String client_moniker;
private String type = "1";
public JSONObject toJson(){ public JSONObject toJson(){
JSONObject jason = new JSONObject(); JSONObject jason = new JSONObject();
if(StringUtils.isNotEmpty(status)){ if(StringUtils.isNotEmpty(status)){
jason.put("status",status); jason.put("status",status);
} }
if(StringUtils.isNotEmpty(type)){
jason.put("type",type);
}
if(StringUtils.isNotEmpty(client_moniker)){ if(StringUtils.isNotEmpty(client_moniker)){
jason.put("client_moniker",client_moniker); jason.put("client_moniker",client_moniker);
} }
@ -56,4 +60,12 @@ public class ClientComplianceQuery {
public void setClient_moniker(String client_moniker) { public void setClient_moniker(String client_moniker) {
this.client_moniker = client_moniker; this.client_moniker = client_moniker;
} }
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
} }

@ -1,55 +0,0 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Created by yishuqian on 06/03/2017.
*/
@AutoMapper(tablename = "sys_asic_files", pkName = "file_id")
public interface ClientAsicFilesMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject partner);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject partner);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1")
List<JSONObject> findClientFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'")
List<JSONObject> findClientPassAggreeFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 0 or status = 3) and file_name='client_agree_file'")
List<JSONObject> findClientAggreeFileCommit(@Param("client_id") int clientId);
List<JSONObject> findAllClientFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
JSONObject findFileById(@Param("file_id") String file_id);
List<JSONObject> findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name);
JSONObject getSourceAgreeFilesByClientId(@Param("client_id") int clientId);
void deleteByClientAndFileId(@Param("file_id") String file_id);
void deleteAggreeByClientId(@Param("client_id") int file_id);
void confirmAgreeFile(@Param("client_id") int client_id);
void updateBeforeCompliance(@Param("client_id") int client_id);
void refuseCompliance(@Param("client_id") int client_id);
void passCompliance(@Param("client_id") int client_id);
}

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.mappers.system; package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
@ -22,8 +23,13 @@ public interface ClientComplianceCompanyMapper {
void update(JSONObject partner); void update(JSONObject partner);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "type = 1")
JSONObject findFileByClientId(@Param("client_id") int client_id); JSONObject findFileByClientId(@Param("client_id") int client_id);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "type = 2")
JSONObject findKycFileByClientId(@Param("client_id") int client_id);
PageList<JSONObject> listClientCompliances(JSONObject params, PageBounds pageBounds); PageList<JSONObject> listClientCompliances(JSONObject params, PageBounds pageBounds);
List<JSONObject> listNeedHelpClients(JSONObject params); List<JSONObject> listNeedHelpClients(JSONObject params);

@ -25,6 +25,9 @@ public interface ClientFilesMapper {
@AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1") @AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1")
List<JSONObject> findClientFile(@Param("client_id") int clientId); List<JSONObject> findClientFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
JSONObject findFileByIdAndvalue(@Param("client_id") int clientId,@Param("file_name") String fileType);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'") @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'")
List<JSONObject> findClientPassAggreeFile(@Param("client_id") int clientId); List<JSONObject> findClientPassAggreeFile(@Param("client_id") int clientId);

@ -0,0 +1,54 @@
package au.com.royalpay.payment.manage.merchants.beans;
import com.alibaba.fastjson.JSONObject;
/**
* Created by liuxinxin on 09/12/2019.
*/
public class ClientKycFilesInfo {
private String file_bank_info;
private String file_id_info;
private String utility_bill_info;
private int authStatus=0;
public JSONObject toJson(){
return (JSONObject)JSONObject.toJSON(this);
}
public String getFile_bank_info() {
return file_bank_info;
}
public void setFile_bank_info(String file_bank_info) {
this.file_bank_info = file_bank_info;
}
public String getFile_id_info() {
return file_id_info;
}
public void setFile_id_info(String file_id_info) {
this.file_id_info = file_id_info;
}
public String getUtility_bill_info() {
return utility_bill_info;
}
public void setUtility_bill_info(String utility_bill_info) {
this.utility_bill_info = utility_bill_info;
}
public int getAuthStatus() {
return authStatus;
}
public void setAuthStatus(int authStatus) {
this.authStatus = authStatus;
}
}

@ -248,8 +248,6 @@ public interface ClientManager {
JSONObject getAuthFiles(JSONObject manager, String clientMoniker); JSONObject getAuthFiles(JSONObject manager, String clientMoniker);
JSONObject getAsicFiles(JSONObject manager, String clientMoniker);
JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker); JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker);
JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker); JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker);
@ -262,10 +260,16 @@ public interface ClientManager {
void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo);
void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo);
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);
void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source);
void commitKycBdIntervention(String clientMoniker, JSONObject account, String source);
JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException; JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException;
JSONObject getClientsAnalysis(JSONObject manager); JSONObject getClientsAnalysis(JSONObject manager);
@ -495,6 +499,8 @@ public interface ClientManager {
JSONObject getComplianceFiles(JSONObject account); JSONObject getComplianceFiles(JSONObject account);
JSONObject getKycFiles(JSONObject account);
JSONObject getClientInfoByAggree(JSONObject account); JSONObject getClientInfoByAggree(JSONObject account);
JSONObject getComplianceFilesForBD(JSONObject account); JSONObject getComplianceFilesForBD(JSONObject account);

@ -94,7 +94,6 @@ import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.dom4j.Element; import org.dom4j.Element;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -230,9 +229,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private ClientFilesMapper clientFilesMapper; private ClientFilesMapper clientFilesMapper;
@Resource
private ClientAsicFilesMapper clientAsicFilesMapper;
@Resource @Resource
private TransactionMapper transactionMapper; private TransactionMapper transactionMapper;
@ -320,6 +316,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private static final String CLIENT_APPLY_FILE = "client_apply_file"; private static final String CLIENT_APPLY_FILE = "client_apply_file";
private static final List<String> tags = new ArrayList<>(); private static final List<String> tags = new ArrayList<>();
private static final String KYC_UTILITY_BILL_FILE = "kyc_utility_bill_file";
@Value("${app.agreetemplate.classic.path}") @Value("${app.agreetemplate.classic.path}")
private String agreetemplatePdfPath; private String agreetemplatePdfPath;
@Value("${app.agreetemplate.aggregate.path}") @Value("${app.agreetemplate.aggregate.path}")
@ -2177,6 +2175,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return file; return file;
} }
@Override
public JSONObject getKycFiles(JSONObject account) {
JSONObject client = getClientInfo(account.getIntValue("client_id"));
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject file = signInAccountService.checkKycFileStatus(client);
JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(account.getIntValue("client_id"));
file.put("file_company", compliance);
return file;
}
@Override @Override
public JSONObject getClientInfoByAggree(JSONObject account) { public JSONObject getClientInfoByAggree(JSONObject account) {
JSONObject client = getClientInfo(account.getIntValue("client_id")); JSONObject client = getClientInfo(account.getIntValue("client_id"));
@ -3387,20 +3397,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return fileJson; return fileJson;
} }
@Override
public JSONObject getAsicFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientFiles = clientAsicFilesMapper.findClientFile(client.getIntValue("client_id"));
JSONObject fileJson = new JSONObject();
for (JSONObject file : clientFiles) {
fileJson.put(file.getString("file_name"), file.getString("file_value"));
}
return fileJson;
}
@Override @Override
public JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker) { public JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -3514,6 +3510,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
// } // }
} }
@Override
@Transactional
public void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
int clientId = client.getIntValue("client_id");
try {
updateSysClientFiles(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info());
updateSysClientFiles(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info());
updateSysClientFiles(manager, clientId, KYC_UTILITY_BILL_FILE, filesInfo.getUtility_bill_info());
} catch (Exception e) {
logger.error("上传合规文件失败", e);
}
}
@Override @Override
@Transactional @Transactional
public List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo) { public List<JSONObject> uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo) {
@ -3603,6 +3616,99 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
signInAccountService.clearAccountCache(account.getString("account_id")); 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
@Transactional
public void commitKycBdIntervention(String clientMoniker, JSONObject account, String source) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
int sourceEnum = 2;
if (client == null) {
throw new InvalidShortIdException();
}
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", 9);
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", 9);
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 @Override
public JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException { public JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException {
if (StringUtils.isBlank(file.getOriginalFilename())) { if (StringUtils.isBlank(file.getOriginalFilename())) {

@ -3,12 +3,12 @@ package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo;
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.ClientRegisterInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner; import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection;
@ -25,14 +25,11 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -44,8 +41,6 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -524,11 +519,6 @@ public class PartnerViewController {
return clientManager.getAuthFiles(null,account.getString("client_moniker")); return clientManager.getAuthFiles(null,account.getString("client_moniker"));
} }
@PartnerMapping(value = "/asic/files", method = RequestMethod.GET)
@ResponseBody
public JSONObject asicFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.getAsicFiles(null,account.getString("client_moniker"));
}
@PartnerMapping(value = "/compliance/complianceInfo", method = RequestMethod.GET) @PartnerMapping(value = "/compliance/complianceInfo", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ -542,6 +532,12 @@ public class PartnerViewController {
return clientManager.getComplianceFiles(account); return clientManager.getComplianceFiles(account);
} }
@PartnerMapping(value = "/kyc/clientViewFiles", method = RequestMethod.GET)
@ResponseBody
public JSONObject kycFiles(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.getKycFiles(account);
}
@PartnerMapping(value = "/aggregateFile/client_info", method = RequestMethod.GET) @PartnerMapping(value = "/aggregateFile/client_info", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ -586,6 +582,16 @@ public class PartnerViewController {
} }
} }
@PartnerMapping(value = "/update/kycFile", method = RequestMethod.PUT)
@ResponseBody
public void updateKycFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientKycFilesInfo filesInfo) {
JSONObject client = account.getJSONObject("client");
JSONObject manager = new JSONObject();
manager.put("display_name","client");
clientManager.uploadKycFiles(manager, account.getString("client_moniker"), filesInfo);
}
@PartnerMapping(value = "/update/wait_compliance_file", method = RequestMethod.PUT) @PartnerMapping(value = "/update/wait_compliance_file", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
public void updateWaitComplianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) { public void updateWaitComplianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) {
@ -608,6 +614,19 @@ public class PartnerViewController {
clientManager.commitAuthFilesToCompliance(clientMoniker, account, "Web"); clientManager.commitAuthFilesToCompliance(clientMoniker, account, "Web");
} }
@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");
}
@PartnerMapping(value = "/clientCompliance/{clientMoniker}/kycBdIntervention", method = RequestMethod.POST)
@ResponseBody
public void clientKycBdIntervention(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.commitAuthKycFilesToCompliance(clientMoniker, account, "Web");
}
@PartnerMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file", method = RequestMethod.POST) @PartnerMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public JSONObject getClientArregateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam MultipartFile file, @RequestHeader("User-Agent") String userAgent, HttpServletRequest request) throws IOException { public JSONObject getClientArregateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam MultipartFile file, @RequestHeader("User-Agent") String userAgent, HttpServletRequest request) throws IOException {

@ -69,4 +69,6 @@ public interface SignInAccountService {
JSONObject checkAuthFileStatus(JSONObject client); JSONObject checkAuthFileStatus(JSONObject client);
JSONObject checkKycFileStatus(JSONObject client);
} }

@ -98,6 +98,10 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
private final String[] FILE_KEYS = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"}; private final String[] FILE_KEYS = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"};
private final String[] PUT_KEYS = {"file_bank_info", "file_company_info", "file_id_info", "file_agreement_info"}; private final String[] PUT_KEYS = {"file_bank_info", "file_company_info", "file_id_info", "file_agreement_info"};
private final String[] FILE_NAMES = {"* bank statement", "* Certificate of Registration", "* ID", "* Agreement"}; private final String[] FILE_NAMES = {"* bank statement", "* Certificate of Registration", "* ID", "* Agreement"};
private final String[] KYC_FILE_KEYS = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"};
private final String[] KYC_PUT_KEYS = {"file_bank_info", "utility_bill_info", "file_id_info"};
private final String[] KYC_FILE_NAMES = {"* ASIC File", "Utility Bill Files", "* ID"};
private final int RESET_PASSWORD_TEMPLID = 126978; private final int RESET_PASSWORD_TEMPLID = 126978;
private ApplicationEventPublisher publisher; private ApplicationEventPublisher publisher;
private static final List<String> tags = new ArrayList<>(); private static final List<String> tags = new ArrayList<>();
@ -739,6 +743,80 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
return result; return result;
} }
@Override
public JSONObject checkKycFileStatus(JSONObject client) {
JSONObject result = new JSONObject();
result.put("client_less_file", false);
List<JSONObject> clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
boolean clientFilesIsLess = false;
for (int i = 0; i < KYC_FILE_KEYS.length; i++) {
String fileKey = KYC_FILE_KEYS[i];
if (clientFiles != null && clientFiles.size() > 0) {
List<JSONObject> clientFileUrl = clientFiles.stream()
.filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2)))
.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("file_value", json.getString("file_value"));
return params;
})
.collect(Collectors.toList());
if (clientFileUrl != null && clientFileUrl.size() > 0) {
JSONObject fileJson = new JSONObject();
fileJson.put("key", KYC_PUT_KEYS[i]);
fileJson.put("name", KYC_FILE_NAMES[i]);
fileJson.put("file_value", clientFileUrl);
fileJson.put("file_write", false);
result.put(fileKey,fileJson);
} else {
List<JSONObject> clientBackToFileUrl = clientFiles.stream()
.filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 0 || fileJson.getIntValue("status") == 3)))
.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("file_value", json.getString("file_value"));
return params;
})
.collect(Collectors.toList());
JSONObject fileJson = new JSONObject();
fileJson.put("key", KYC_PUT_KEYS[i]);
fileJson.put("name", KYC_FILE_NAMES[i]);
if (clientBackToFileUrl != null && clientBackToFileUrl.size() > 0) {
if ("client_agree_file".equals(fileKey)) {
List<JSONObject> agreeFile = new ArrayList<>();
agreeFile.add(clientBackToFileUrl.get(0));
fileJson.put("file_value", agreeFile);
}else {
fileJson.put("file_value", clientBackToFileUrl);
}
}
fileJson.put("file_write", true);
result.put(fileKey,fileJson);
clientFilesIsLess = true;
}
}else {
clientFilesIsLess = true;
for (int c = 0; c < KYC_FILE_KEYS.length; c++) {
String key = KYC_FILE_KEYS[c];
JSONObject fileJson = new JSONObject();
fileJson.put("key", KYC_PUT_KEYS[c]);
fileJson.put("name", KYC_FILE_NAMES[c]);
fileJson.put("file_write", true);
result.put(key,fileJson);
}
}
}
if ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5) && client.getIntValue("source")!=4 ) {
if (clientFilesIsLess) {
result.put("client_less_file", clientFilesIsLess);
whenClientLessFile(client, result);
}
}
return result;
}
private void whenClientLessFile(JSONObject client,JSONObject result) { private void whenClientLessFile(JSONObject client,JSONObject result) {
JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id")); JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id"));
if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) { if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) {

@ -11,6 +11,9 @@
<if test="status!=null"> <if test="status!=null">
and a.status = #{status} and a.status = #{status}
</if> </if>
<if test="type!=null">
and a.type = #{type}
</if>
</where> </where>
</select> </select>

@ -74,13 +74,16 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
url: '/devices', url: '/devices',
templateUrl: '/static/payment/partner/templates/client_devices.html', templateUrl: '/static/payment/partner/templates/client_devices.html',
controller: 'clientDeviceCtrl' controller: 'clientDeviceCtrl'
}).state('basic.asic_files', { }).state('basic.kyc_files_perfect', {
url: '/{client_moniker}/asic_files', url: '/kyc_files_perfect',
templateUrl: '/static/payment/partner/templates/client_asic_files.html', templateUrl: '/static/payment/partner/templates/client_kyc_files_complete.html',
controller: 'clientASICFilesCtrl', controller: 'clientCommitToKycFilesCtrl',
resolve: { resolve: {
asicFile: ['$http', function ($http) { file: ['$http', function ($http) {
return $http.get('/client/partner_info/asic/files'); return $http.get('/client/partner_info/kyc/clientViewFiles');
}],
partner: ['$http', function ($http) {
return $http.get('/client/partner_info');
}] }]
} }
}) })
@ -866,37 +869,77 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
}; };
}]); }]);
app.controller('clientASICFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, asicFile) { app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) {
$scope.file = file.data || {};
$scope.partner = partner.data || {};
$scope.asicFile = asicFile.data || {}; $scope.uploadStorePhoto = function (file) {
//asic files if (file != null) {
debugger; if (file.size > 2 * 1024 * 1024) {
$scope.id_type = 'passport'; commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.file.photo_info.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.file.photo_info.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadAsicFile = function (file) { //audit files
debugger; $scope.uploadBankFile = function (file) {
if (file != null) { if (file != null) {
if (file.size > 3 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'}) commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else { } else {
$scope.AsicFileProgress = {value: 0}; $scope.bankFileProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/attachment/files', url: '/attachment/files',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.AsicFileProgress; delete $scope.bankFileProgress;
$scope.asicFile.file_bank_info = resp.data.url; $scope.file.file_bank_info = resp.data.url;
$scope.updateFile(); $scope.updateFile();
if ($scope.asicFile.file_bank_info.endsWith('pdf')) { if ($scope.file.file_bank_info.endsWith('pdf')) {
$scope.AsicIsImage = false; $scope.bankIsImage = false;
} else { } else {
$scope.AsicIsImage = true; $scope.bankIsImage = true;
} }
}, function (resp) { }, function (resp) {
delete $scope.AsicFileProgress; delete $scope.bankFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) { }, function (evt) {
$scope.AsicFileProgress.value = parseInt(100 * evt.loaded / evt.total); $scope.bankFileProgress.value = parseInt(100 * evt.loaded / evt.total);
}) })
} }
} }
@ -921,7 +964,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) { if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) {
$scope.idIsImage = false; $scope.idIsImage = false;
} }
$scope.uploadCompanyFile = function (file) { $scope.uploadCompanyFile = function (file) {
if (file != null) { if (file != null) {
if (file.size > 3 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {
@ -1043,7 +1085,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
}; };
*/ */
$scope.updateFile = function () { $scope.updateFile = function () {
$http.put('/client/partner_info/update/file', $scope.file).then(function () { $http.put('/client/partner_info/update/wait_compliance_file', $scope.file).then(function () {
commonDialog.alert({ commonDialog.alert({
title: 'Success', title: 'Success',
content: 'Upload Successful', content: 'Upload Successful',
@ -1062,6 +1104,65 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
type: 'error' type: 'error'
}); });
}; };
$scope.clientComplianceViewCommit = function () {
if (!$scope.file.client_agree_file) {
commonDialog.alert({title: 'Error', content: '请提交* Agreement', type: 'error'});
return;
} else if (!$scope.file.client_id_file) {
commonDialog.alert({title: 'Error', content: '请提交* ID', type: 'error'});
return;
} else if (!$scope.file.client_bank_file) {
commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'});
return;
} else if (!$scope.file.client_company_file) {
commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'});
return;
}
if ((!$scope.file.photo_info.company_photo || !$scope.file.photo_info.store_photo) && !$scope.file.photo_info.web_site) {
alert('Please upload two photos or fill out the website');
return;
}
commonDialog.confirm({
title: 'Warning',
content: 'Are you sure to submit files?'
}).then(function () {
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file.photo_info).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Commit Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
$scope.deleteComplianceFiles = function (file_id) {
$scope.file_id = file_id;
commonDialog.confirm({
title: 'Warning',
content: 'This operation will delete the file, Are you sure?'
}).then(function () {
$http.put('/client/partner_info/auth_file/' + $scope.file_id + '/delete').then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Delete Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
$scope.commitPartner = function () { $scope.commitPartner = function () {
if ($scope.file) { if ($scope.file) {
if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) { if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) {
@ -1075,55 +1176,16 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
commitError(); commitError();
} }
}; };
}]);
app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) { }]);
app.controller('clientCommitToKycFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) {
$scope.file = file.data || {}; $scope.file = file.data || {};
$scope.partner = partner.data || {}; $scope.partner = partner.data || {};
$scope.uploadStorePhoto = function (file) { $scope.file.id_type = 'passport';
if (file != null) { $scope.file.need_bd = true;
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.storePhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.storePhotoProgress;
$scope.file.photo_info.store_photo = resp.data.url;
}, function (resp) {
delete $scope.storePhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.uploadShopPhoto = function (file) {
if (file != null) {
if (file.size > 2 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB请压缩后重试', type: 'error'})
} else {
$scope.shopPhotoProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.shopPhotoProgress;
$scope.file.photo_info.company_photo = resp.data.url;
}, function (resp) {
delete $scope.shopPhotoProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//audit files //audit files
$scope.uploadBankFile = function (file) { $scope.uploadBankFile = function (file) {
@ -1153,53 +1215,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
} }
} }
}; };
$scope.agreeIsImage = true;
if ($scope.file.file_agreement_info && $scope.file.file_agreement_info.endsWith('pdf')) {
$scope.agreeIsImage = false;
}
$scope.bankIsImage = true;
if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) {
$scope.bankIsImage = false;
}
$scope.companyIsImage = true;
if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) {
$scope.companyIsImage = false;
}
$scope.applyIsImage = true;
if ($scope.file.file_apply_info && $scope.file.file_apply_info.endsWith('pdf')) {
$scope.applyIsImage = false;
}
$scope.idIsImage = true;
if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) {
$scope.idIsImage = false;
}
$scope.uploadCompanyFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.companyFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.companyFileProgress;
$scope.file.file_company_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_company_info.endsWith('pdf')) {
$scope.companyIsImage = false;
} else {
$scope.companyIsImage = true;
}
}, function (resp) {
delete $scope.companyFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//上传ID信息 //上传ID信息
$scope.uploadIDFile = function (file) { $scope.uploadIDFile = function (file) {
if (file != null) { if (file != null) {
@ -1229,72 +1245,50 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
} }
}; };
//上传协议文件 //上传账单流水
$scope.uploadAgreementFile = function (file) { $scope.uploadCompanyFile = function (file) {
if (file != null) { if (file != null) {
if (file.size > 10 * 1024 * 1024) { if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过5MB请压缩后重试', type: 'error'}) commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else { } else {
$scope.agreementFileProgress = {value: 0}; $scope.billFileProgress = {value: 0};
Upload.upload({ Upload.upload({
url: '/attachment/files', url: '/attachment/files',
data: {file: file} data: {file: file}
}).then(function (resp) { }).then(function (resp) {
delete $scope.agreementFileProgress; delete $scope.billFileProgress;
$scope.file.file_agreement_info = resp.data.url; $scope.file.utility_bill_info = resp.data.url;
$scope.updateFile(); $scope.updateFile();
if ($scope.file.file_agreement_info.endsWith('pdf')) { if ($scope.file.utility_bill_info.endsWith('pdf')) {
$scope.agreeIsImage = false; $scope.billIsImage = false;
} else { } else {
$scope.agreeIsImage = true; $scope.billIsImage = true;
} }
}, function (resp) { }, function (resp) {
delete $scope.agreementFileProgress; delete $scope.billFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) { }, function (evt) {
$scope.agreementFileProgress.value = parseInt(100 * evt.loaded / evt.total); $scope.billFileProgress.value = parseInt(100 * evt.loaded / evt.total);
}) })
} }
} }
}; };
//上传申请表 $scope.bankIsImage = true;
$scope.uploadApplyFile = function (file) { if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) {
if (file != null) { $scope.bankIsImage = false;
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.applyFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.applyFileProgress;
$scope.file.file_apply_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_apply_info.endsWith('pdf')) {
$scope.applyIsImage = false;
} else {
$scope.applyIsImage = true;
} }
}, function (resp) { $scope.idIsImage = true;
delete $scope.applyFileProgress; if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) {
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) $scope.idIsImage = false;
}, function (evt) {
$scope.applyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
} }
$scope.billIsImage = true;
if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) {
$scope.billIsImage = false;
} }
};
/* $scope.downloadAsZip = function () {
var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP';
return url;
};
*/
$scope.updateFile = function () { $scope.updateFile = function () {
$http.put('/client/partner_info/update/wait_compliance_file', $scope.file).then(function () { $http.put('/client/partner_info/update/kycFile', $scope.file).then(function () {
commonDialog.alert({ commonDialog.alert({
title: 'Success', title: 'Success',
content: 'Upload Successful', content: 'Upload Successful',
@ -1306,6 +1300,23 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
}) })
}; };
$scope.needBDIntervention = function () {
commonDialog.confirm({
title: 'Warning',
content: 'Are you sure to need BD intervention ?'
}).then(function () {
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/kycBdIntervention').then(function () {
commonDialog.alert({
title: 'Success',
content: 'Commit Successful',
type: 'success'
});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
function commitError() { function commitError() {
commonDialog.alert({ commonDialog.alert({
title: 'Error', title: 'Error',
@ -1316,29 +1327,18 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
$scope.clientComplianceViewCommit = function () { $scope.clientComplianceViewCommit = function () {
if (!$scope.file.client_agree_file) { if (!$scope.file.client_id_file) {
commonDialog.alert({title: 'Error', content: '请提交* Agreement', type: 'error'}); commonDialog.alert({title: 'Error', content: '请提交* ASIC File', type: 'error'});
return;
} else if (!$scope.file.client_id_file) {
commonDialog.alert({title: 'Error', content: '请提交* ID', type: 'error'});
return; return;
} else if (!$scope.file.client_bank_file) { } else if (!$scope.file.client_bank_file) {
commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'}); commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'});
return; return;
} else if (!$scope.file.client_company_file) {
commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'});
return;
} }
if ((!$scope.file.photo_info.company_photo || !$scope.file.photo_info.store_photo) && !$scope.file.photo_info.web_site) {
alert('Please upload two photos or fill out the website');
return;
}
commonDialog.confirm({ commonDialog.confirm({
title: 'Warning', title: 'Warning',
content: 'Are you sure to submit files?' content: 'Are you sure to submit files?'
}).then(function () { }).then(function () {
$http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file.photo_info).then(function () { $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/kycFilesViewCommit/'+ $scope.file.id_type).then(function () {
commonDialog.alert({ commonDialog.alert({
title: 'Success', title: 'Success',
content: 'Commit Successful', content: 'Commit Successful',
@ -1371,7 +1371,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
}) })
}; };
$scope.commitPartner = function () { $scope.commitPartner = function () {
if ($scope.file) { if ($scope.file) {
if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) { if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) {

@ -29,6 +29,10 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
templateUrl: '/static/payment/partner/templates/compliance_auth.html', templateUrl: '/static/payment/partner/templates/compliance_auth.html',
controller: 'partnerComplianceAuditCtrl' controller: 'partnerComplianceAuditCtrl'
}).state('partner_kyc_files_auth', {
url: '/partners/KycFilesAuth',
templateUrl: 'static/sys/templates/partner_kyc_flies_auth.html',
controller: 'kycFilesAuthForClientCtrl'
}) })
}]); }]);
@ -55,6 +59,29 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}; };
}]); }]);
app.controller('kycFilesAuthForClientCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap',
function ($scope, $sce, $http, $filter, $uibModal, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) {
$scope.pagination = {};
$scope.industries = industryMap.configs();
$scope.states = stateMap.configs();
$scope.countries = countryMap.configs();
$scope.params = {type:'2'};
$scope.loadClientCompliance = function (page) {
var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/compliance/audit/listClientCompliances', {params: params}).then(function (resp) {
$scope.compliances = resp.data.data;
$scope.pagination = resp.data.pagination;
});
};
$scope.loadClientCompliance(1);
$scope.statusSelected = function (arr) {
return $scope.params.status != null && $scope.params.status.filter(function (status) {
return arr.indexOf(status) >= 0
}).length > 0
};
}]);
app.controller('partnerComplianceCompanyDetail', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'file', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, file) { app.controller('partnerComplianceCompanyDetail', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'file', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, file) {
$scope.file = file.data || {}; $scope.file = file.data || {};
$scope.partner = $scope.file.client; $scope.partner = $scope.file.client;

@ -1,73 +0,0 @@
<style type="text/css">
img {
width: 100%;
}
</style>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">* ASIC Files</label>
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadAsicFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
<a ng-if="asicFile.asic_file" role="button" class="btn-group btn btn-warning" type="button" ng-href="{{asicFile.asic_file}}" target="_blank"><i class="fa fa-download"></i></a>
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="AsicProgress.value" ng-if="AsicFileProgress"></uib-progressbar>
<a ng-if="AsicIsImage" target="_blank" ng-href="{{asicfile.asic_file}}">
<img ng-src="{{asicfile.asic_file}}" class="col-sm-8"></a>
</div>
<div class="col-sm-6">
<div class="form-control-static">
<p>Example请保证图片信息清晰可见,如下图</p>
<img class="col-sm-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488859920633_5ruVtDa30yY2ytBSDAAqxg0Ob2nreh.jpeg">
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-4 col-sm-2">
<select class="form-control" ng-model="id_type">
<option value="passport">Passport</option>
<option value="driver_license">Driver's license</option>
</select>
</label>
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadIDFile($file)" >
<i class="fa fa-upload"></i> Upload
</button>
<a ng-if="asicFile.client_id_file" role="button" class="btn-group btn btn-warning" type="button" ng-href="{{asicFile.client_id_file}}" target="_blank"><i class="fa fa-download"></i></a>
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="idFileProgress.value" ng-if="idFileProgress"></uib-progressbar>
<a ng-if="idIsImage" ng-href="{{asicFile.client_id_file}}" target="_blank">
<img ng-src="{{asicFile.client_id_file}}" class="col-sm-8"></a>
</div>
<div class="col-sm-6">
<div class="form-control-static">
<div class="col-sm-6">
<p>Example请保证图片(护照或驾照)信息清晰可见,如下图</p>
<img class="col-xs-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725651779_OPiqOP1dGnTpaxPsCR3P9lVrp4384b.jpg">
</div>
<div class="col-sm-6">
<br/>
<br/>
<img class="col-sm-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725678615_Bv2tzUtihY5U6YK9ScveXzKkVWOnrF.jpg">
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,186 @@
<style type="text/css">
img {
width: 100%;
}
.btn btn-default:active{
position: relative;
top: 1px;
box-shadow: inset 0 3px 5px 0 rgba(0,0,0, 0.2);
outline: 0;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333;
background-color: #f7bf90;
border-color: #adadad;
}
</style>
<section class="content-header">
<h1>商户KYC文件补充
<span class="small text-danger" style="margin: 20px 20px;font-size: 20px;" ng-if="file.client_refuse_reason">
({{file.client_refuse_reason}})</span>
</h1>
</section>
<div class="panel-body box box-warning ng-scope" style="margin-top: 20px;">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-3">* ASIC File</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadBankFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="bankFileProgress.value" ng-if="bankFileProgress"></uib-progressbar>
<table>
<tbody>
<tr ng-repeat="file_src in file.client_bank_file.file_value track by $index">
<td ng-bind="$index+1+'.'" ALIGN="left" VALIGN="top" class="btn">1</td>
<td><a ng-if="bankIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}"
class="col-sm-8"
onerror="this.src='/static/images/file_close.png'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-3">
<div class="form-control-static">
<p>Example请保证图片信息清晰可见,如示例
<img class="col-sm-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488859920633_5ruVtDa30yY2ytBSDAAqxg0Ob2nreh.jpeg">
</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* ID </label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadIDFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="idFileProgress.value" ng-if="idFileProgress"></uib-progressbar>
<table>
<tbody>
<tr ng-repeat="file_src in file.client_id_file.file_value track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="idIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-8"
onerror="this.src='/static/images/file_close.png'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-3">
<div class="form-control-static">
<div class="col-sm-12">
<p>Example请保证图片(护照或驾照)信息清晰可见,如示例
<img class="col-xs-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725651779_OPiqOP1dGnTpaxPsCR3P9lVrp4384b.jpg">
<img class="col-sm-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725678615_Bv2tzUtihY5U6YK9ScveXzKkVWOnrF.jpg">
</p>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Choose ID Type </label>
<div class="col-sm-3">
<div class="form-control-static">
<select class="form-control" ng-model="file.id_type">
<option value="passport" >Passport</option>
<option value="driver_license">Driver's license</option>
</select>
</div>
</div>
<div class="col-sm-3">
<div class="form-control-static">
<div class="col-sm-12">
<p>选择ID类型若选择Driver's license,Utility Bill Files可以选填</p>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3"> Utility Bill Files</label>
<div class="col-sm-3">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadCompanyFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="billFileProgress.value" ng-if="billFileProgress"></uib-progressbar>
<table>
<tbody>
<tr ng-repeat="file_src in file.kyc_utility_bill_file.file_value track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="billIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-8"
onerror="this.src='/static/images/file_close.png'">
</a>
<button class="btn btn-danger" type="button"
ng-click="deleteComplianceFiles(file_src.file_id)">
X
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-5">
<div class="form-control-static">
<div class="col-sm-12">
<p class="col-sm-6">Example公司请提供以下文件图片,如示例
<img class="col-xs-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488865011738_mW91ylSb5V1NJYu8jxvBPGNN49Zyel.jpeg">
</p>
<p class="col-sm-6">sole trade个体户),partnership合伙,trust信托请在http://abr.business.gov.au将查询结果截图上传
<img class="col-sm-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488860564017_37spL6phUySM27oRtO4cQ7FOJblYJ6.jpeg">
</p>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">* Is Need BD</label>
<div class="col-sm-3">
<div class="form-control-static">
<button ng-click="needBDIntervention()" class="btn-group btn btn-success">BD Intervention</button>
</div>
</div>
<div class="col-sm-3">
<div class="form-control-static">
<div class="col-sm-12">
<p>对补充材料有疑问需要BD介入帮助,如果需要BD介入帮助上述材料可不填</p>
</div>
</div>
</div>
</div>
<div class="row" style="text-align: center">
<button style="width: 35%;height: 50px;font-size: 20px;margin-top: 40px;margin-bottom: 20px;" class="btn-group btn btn-success" type="button"
ng-click="clientComplianceViewCommit()">Submit Files
</button>
</div>
</div>
</div>
</div>

@ -54,7 +54,7 @@
</li> </li>
<li ui-sref-active="active"> <li ui-sref-active="active">
<a ui-sref=".asic_files">ASIC files</a> <a ui-sref=".kyc_files_perfect">KYC files</a>
</li> </li>
</ul> </ul>

@ -10,6 +10,16 @@
<div class="box box-warning" style="margin-top: 30px;"> <div class="box box-warning" style="margin-top: 30px;">
<div class="box-header"> <div class="box-header">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active">
<a ui-sref="partner_compliance_auth">合规文件审核</a>
</li>
<li ui-sref-active-eq="active">
<a ui-sref="partner_kyc_files_auth">KYC文件审核</a>
</li>
</ul>
</div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="form-horizontal"> <div class="form-horizontal">

@ -0,0 +1,140 @@
<section class="content-header">
<h1>商户合规文件审核</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> Compliance Management
</li>
<li class="active">商户合规文件审核</li>
</ol>
</section>
<div class="box box-warning" style="margin-top: 30px;">
<div class="box-header">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active">
<a ui-sref="partner_compliance_auth">合规文件审核</a>
</li>
<li ui-sref-active-eq="active">
<a ui-sref="partner_kyc_files_auth">KYC文件审核</a>
</li>
</ul>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<div class="form-group col-xs-12">
<label class="col-xs-4 col-sm-2 control-label">Partner Code</label>
<div class="col-sm-5 col-xs-8">
<input class="form-control" placeholder="" ng-click="loadClientCompliance(1)"
ng-model="params.client_moniker">
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">审核状态:</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.status==null}"
ng-click="params.status=null;loadClientCompliance(1)">All</a> |
<a role="button" ng-class="{'bg-primary':statusSelected([0])}"
ng-click="params.status=[0];loadClientCompliance(1)">待审核</a>|
<a role="button" ng-class="{'bg-primary':statusSelected([1])}"
ng-click="params.status=[1];loadClientCompliance(1)">通过</a>|
<a role="button" ng-class="{'bg-primary':statusSelected([2])}"
ng-click="params.status=[2];loadClientCompliance(1)">打回</a>
</p>
</div>
</div>
<button class="btn btn-success" type="button" ng-click="loadClientCompliance()">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
</div>
</div>
<div class="box box-danger">
<div class="modal-body">
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Short Name</th>
<th>Compliance Status</th>
<th>Register Time</th>
<th>BD</th>
<th>KYCFile Status</th>
<th>Submit Time</th>
<th>Source</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="compliance_company in compliances">
<td ng-bind="compliance_company.client_moniker"></td>
<td ng-bind="compliance_company.short_name"></td>
<td ng-class="{'bg-green':(compliance_company.approve_result==2 && (compliance_company.client_source==1 || compliance_company.client_source==2)),'bg-red':((compliance_company.open_status==1||compliance_company.open_status==2||compliance_company.open_status==4) && compliance_company.approve_result!=3)||(compliance_company.approve_result==3 && (!compliance_company.open_status || compliance_company.open_status==1 || compliance_company.open_status == 4))||(compliance_company.approve_result==4 && !compliance_company.open_status)||(compliance_company.open_status==10)}">
<span ng-if="compliance_company.approve_result==1 && compliance_company.approve_time">通过({{compliance_company.approve_time}})</span>
<span ng-if="!compliance_company.open_status && !compliance_company.approve_result && compliance_company.approve_result!=5 && compliance_company.client_source!=4">资料完善中</span>
<span ng-if="!compliance_company.open_status && !compliance_company.approve_result && compliance_company.approve_result!=5 && compliance_company.client_source==4">(自助开通)资料完善中</span>
<span ng-if="!compliance_company.open_status && compliance_company.approve_result==2 && compliance_company.approve_time">自助开通试用中({{compliance_company.approve_time}}~{{compliance_company.expiry_time}})</span>
<span ng-if="compliance_company.approve_result==0 && compliance_company.approve_time">不通过({{compliance_company.approve_time}})</span>
<span ng-if="compliance_company.approve_result==5 && compliance_company.approve_time && compliance_company.refuse_remark">申请打回({{compliance_company.refuse_remark|limitTo:15}})</span>
<span ng-if="(compliance_company.open_status==1||compliance_company.open_status==4) && compliance_company.approve_result!=3"><i
ng-if="compliance_company.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true"
title="被打回重新提交"></i>等待合规</span>
<span ng-if="compliance_company.approve_result==3 && (!compliance_company.open_status || compliance_company.open_status==4)">自助开通(等待合规)</span>
<span ng-if="compliance_company.open_status==2">合同制作完成</span>
<span ng-if="compliance_company.open_status==3 && compliance_company.approve_result!=5">等待BD上传材料审核</span>
<span ng-if="compliance_company.open_status==10">绿色通道申请中</span>
<span ng-if="compliance_company.approve_result==4 && !compliance_company.open_status"><i
ng-if="compliance_company.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true"
title="被打回重新提交"></i>等待合规</span>
</td>
<td ng-bind="compliance_company.create_time|date:'dd/MMM/yyyy'"></td>
<td ng-bind="compliance_company.bd_user_name"></td>
<td>
<span ng-if="compliance_company.status==0">待审核</span>
<span ng-if="compliance_company.status==1">通过</span>
<span ng-if="compliance_company.status==2">打回</span>
</td>
<td ng-bind="compliance_company.submit_time|date:'dd/MMM/yyyy'"></td>
<td>
<span ng-if="compliance_company.source==1">App</span>
<span ng-if="compliance_company.source==2">Web</span>
</td>
<td><a class="text-primary" role="button" title="Detail"
ui-sref="compliance_detail({client_moniker:compliance_company.client_moniker})">
<i class="fa fa-search"></i> Detail
</a>
</td>
<!--({client_id:compliance_company.client_id})-->
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<uib-pagination ng-if="compliances.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadClientCompliance()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div>
Loading…
Cancel
Save