Upd:增加卡支付合规流程,BD提交资料,合规通过,合规打回

master
dulingling 5 years ago
parent db974f69e2
commit a382441bf2

@ -20,5 +20,5 @@ public interface ClientAuditProcessMapper {
int update(JSONObject partner);
@AutoSql(SqlType.SELECT)
PageList<JSONObject> getAuditLog(@Param("client_id") int client_id, PageBounds pagination);
PageList<JSONObject> getAuditLog(@Param("client_id") int client_id, @Param("type") int type, PageBounds pagination);
}

@ -0,0 +1,31 @@
package au.com.royalpay.payment.manage.mappers.system;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect;
import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper;
import com.yixsoft.support.mybatis.autosql.annotations.AutoSql;
import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
import java.util.Date;
import java.util.List;
/**
* Created by dulingling on 2020-04-26.
*/
@AutoMapper(tablename = "sys_clients_card_flow", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface ClientCardFlowMapper {
@AutoSql(SqlType.SELECT)
JSONObject findClient(@Param("client_id") int clientId);
@AutoSql(SqlType.INSERT)
void save(JSONObject partner);
@AutoSql(SqlType.UPDATE)
int update(JSONObject partner);
}

@ -51,6 +51,7 @@ public class PartnerQuery {
private boolean bd_upload_material = false;
private boolean is_valid = false;
private String merchant_id;
private boolean card_approving = false;
public String getClient_moniker() {
return StringUtils.isEmpty(client_moniker) ? null : client_moniker;
@ -120,6 +121,9 @@ public class PartnerQuery {
if (approving) {
param.put("approving", true);
}
if(card_approving){
param.put("card_approving",true);
}
if (org_id != null) {
param.put("org_id", org_id);
}
@ -472,4 +476,12 @@ public class PartnerQuery {
public void setSuburb(String suburb) {
this.suburb = suburb;
}
public boolean isCard_approving() {
return card_approving;
}
public void setCard_approving(boolean card_approving) {
this.card_approving = card_approving;
}
}

@ -81,6 +81,9 @@ public interface ClientManager {
@Transactional(noRollbackFor = EmailException.class)
void auditClient(JSONObject manager, String clientMoniker, int pass);
@Transactional(noRollbackFor = EmailException.class)
void auditCardClient(JSONObject manager, String clientMoniker, int pass);
@Transactional(noRollbackFor = EmailException.class)
void auditClientGreenChannel(JSONObject manager, String clientMoniker);
@ -299,6 +302,13 @@ public interface ClientManager {
void commitToDoAgreeFile(String clientMoniker, JSONObject manager);
/**
*
* @param clientMoniker
* @param manager
*/
void commitToDoCardAgreeFile(String clientMoniker, JSONObject manager);
void commitToGreenChannel(String clientMoniker, JSONObject manager);
void changePaymentPage(JSONObject manager, String clientMoniker, String paypad_version);
@ -335,6 +345,8 @@ public interface ClientManager {
void refusePartner(String clientMoniker, JSONObject manager, String refuse_remark);
void cardRefusePartner(String clientMoniker, JSONObject manager, String refuse_remark);
JSONArray getAllClientIds(int clientId);
void updateAppClient(JSONObject account, int client_id, AppClientBean appClientBean);

@ -328,6 +328,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private RPayMerchantMapper rPayMerchantMapper;
@Resource
private SysClientUpayProfileMapper sysClientUpayProfileMapper;
@Resource
private ClientCardFlowMapper clientCardFlowMapper;
@Resource
private SmsSender smsSender;
private static final String SOURCE_AGREE_FILE = "source_agree_file";
@ -434,7 +438,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
client.putAll(clientConfig);
JSONObject upayInfo = sysClientUpayProfileMapper.findInfo(client.getIntValue("client_id"));
if(null != upayInfo){
client.putAll(upayInfo);
}
client.put("unsubscribe", mailUnsubMapper.findOneByClientMoniker(clientMoniker) == null ? false : true);
client.put("show_all_permission", true);
int role = manager != null ? manager.getIntValue("role") : 0;
@ -488,12 +494,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("min_customer_surcharge_rate", client.getBigDecimal("rate_value").add(new BigDecimal("0.1")));
}
// 商户审核过程日志
PageList<JSONObject> audit_logs = clientAuditProcessMapper.getAuditLog(client.getIntValue("client_id"),
// 商户跨境支付审核过程日志
PageList<JSONObject> audit_logs = clientAuditProcessMapper.getAuditLog(client.getIntValue("client_id"),1,
new PageBounds(Order.formString("create_time")));
if (audit_logs != null && !audit_logs.isEmpty()) {
client.put("audit_logs", audit_logs);
}
//商户卡支付审核过程日志
PageList<JSONObject> audit_card_logs = clientAuditProcessMapper.getAuditLog(client.getIntValue("client_id"),2,
new PageBounds(Order.formString("create_time")));
if (audit_card_logs != null && !audit_card_logs.isEmpty()) {
client.put("audit_card_logs", audit_card_logs);
}
//插入卡支付审核状态
JSONObject cardFlowInfo = clientCardFlowMapper.findClient(client.getInteger("client_id"));
if(null != cardFlowInfo){
client.put("card_flow_info",cardFlowInfo);
}
//HF支付链接二维码
if (client.getString("hf_pay_url") != null) {
@ -568,6 +586,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
partner.put("expiry_time", DateUtils.addDays(partner.getDate("approve_time"), authDays));
partner.put("pass_timeout", DateUtils.addDays(partner.getDate("approve_time"), authDays).compareTo(new Date()) < 0);
}
JSONObject cardFlowInfo = clientCardFlowMapper.findClient(partner.getInteger("client_id"));
if(null != cardFlowInfo){
partner.put("card_approve_flow_info",cardFlowInfo);
}
}
return PageListUtils.buildPageListResult(partners);
}
@ -1161,30 +1183,71 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientModifySupport.processClientModify(auditModify);
sendCommissionWechatMessage(client);// wxMessage
if (pass == 1) {
createKycAuthStatus(manager,client);
createKycAuthStatus(manager, client);
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "skip_clearing", false));
if (client.getIntValue("source") == 4 || client.getIntValue("source") == 5) {
List<JSONObject> accounts = clientAccountMapper.listAdminAccounts(client.getIntValue("client_id"));
JSONObject account = accounts.get(0);
sendInitEmail(client, account.getString("username"), "*****");
// sendInitEmail(manager, client, account.getString("username"), "*****");
saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager);
saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager,1);
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "skip_clearing", false));
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "common_sub_merchant_id", false));
gatewayMerchantApply.notifyOrgMerchantStatus(client);
} else if (checkGreenChannel && client.getIntValue("open_status") == 5) {
// 绿色通道通过后不发邮件
logger.info("PASS 绿色通道:" + clientMoniker);
saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager);
saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager,1);
} else {
initAdminUserAndSendEmail(manager, clientMoniker, client);
saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager);
saveClientAuditProcess(client.getIntValue("client_id"), open_status, 5, "合规通过", manager,1);
}
}
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
}
@Override
public void auditCardClient(JSONObject manager, String clientMoniker, int pass) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
//检查商户是否进入平台黑名单
int clientId = client.getIntValue("client_id");
isRiskyMerchant(client, clientBankAccountMapper.clientBankAccounts(clientId).get(0));
if (client.getString("sub_merchant_id") == null || client.getString("sub_merchant_id").equals("")) {
throw new BadRequestException("该商户未设置微信 Sub Merchant ID!");
}
JSONObject cardFlowInfo = clientCardFlowMapper.findClient(clientId);
client.putAll(clientConfigService.find(client.getIntValue("client_id")));
Integer open_status_to = cardFlowInfo != null? cardFlowInfo.getIntValue("open_status") : null;
cardFlowInfo.put("open_status",5);
cardFlowInfo.put("approve_result",1);
clientCardFlowMapper.update(cardFlowInfo);
sendCardCommissionWechatMessage(client);// wxMessage
if (pass == 1) {
createKycAuthStatus(manager, client);
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "skip_clearing", false));
if (client.getIntValue("source") == 4 || client.getIntValue("source") == 5) {
List<JSONObject> accounts = clientAccountMapper.listAdminAccounts(client.getIntValue("client_id"));
JSONObject account = accounts.get(0);
//TODO 发送卡支付开通邮件 1.判断商户是否已开通跨境支付若没有开通init账号
// sendInitEmail(client, account.getString("username"), "*****");
saveClientAuditProcess(client.getIntValue("client_id"), open_status_to, 5, "合规通过", manager,2);
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(manager, clientMoniker, "skip_clearing", false));
// gatewayMerchantApply.notifyOrgMerchantStatus(client);
} else {
//TODO 发送卡支付开通邮件 1.判断商户是否已开通跨境支付若没有开通init账号
// initAdminUserAndSendEmail(manager, clientMoniker, client);
saveClientAuditProcess(client.getIntValue("client_id"), open_status_to, 5, "合规通过", manager,2);
}
}
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
}
private void createKycAuthStatus(JSONObject manager,JSONObject client){
private void createKycAuthStatus(JSONObject manager, JSONObject client) {
JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id"));
if (compliance != null) {
compliance.put("client_id", client.getIntValue("client_id"));
@ -1227,7 +1290,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new BadRequestException("该商户未设置微信 Sub Merchant ID!");
}
clientModifySupport.processClientModify(new GreenChannelModify(manager, clientMoniker, manager.getString("manager_id")));
saveClientAuditProcess(client.getIntValue("client_id"), 10, 1, "绿色通道申请通过", manager);
saveClientAuditProcess(client.getIntValue("client_id"), 10, 1, "绿色通道申请通过", manager,1);
sendCommissionWechatMessage(client);
initAdminUserAndSendEmail(manager, clientMoniker, client);
}
@ -2051,7 +2114,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientRateMapper.updateConfig(rateLog);
}
if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) {
JSONObject extRateParams = new JSONObject(){{
JSONObject extRateParams = new JSONObject() {{
put("domestic_rate_value", config.getBigDecimal("rate_value"));
put("overseas_rate_value", config.getJSONObject("ext_rates").getBigDecimal("international_rate_value"));
}};
@ -2088,7 +2151,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
int clientId = client.getIntValue("client_id");
JSONObject changeRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "Wechat");
int cleanDays = changeRate.getIntValue("clean_days");
if (cleanDays != client.getIntValue("clean_days") && StringUtils.equalsIgnoreCase("Wechat",config.getRateName())) {
if (cleanDays != client.getIntValue("clean_days") && StringUtils.equalsIgnoreCase("Wechat", config.getRateName())) {
clientModifySupport.processClientConfigModify(new ClearDaysModify(manager, clientMoniker, cleanDays));
}
// clientMapper.updateCleanDays(clientId, config.getCleanDays());
@ -2127,7 +2190,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission(manager, client);
List<JSONObject> listChildClients = clientMapper.listChildClients(client.getIntValue("client_id"));
JSONObject mchConfig = merchantInfoProvider.getMchExtParams(client.getIntValue("client_id"));
if(mchConfig.getBooleanValue("hide_sub_mch")){
if (mchConfig.getBooleanValue("hide_sub_mch")) {
return new ArrayList<>();
}
if (mchConfig.getBooleanValue("level3_mch_config")) {
@ -2145,7 +2208,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker,String searchText, int page) {
public JSONObject listSubClientsByPage(JSONObject manager, String clientMoniker, String searchText, int page) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -2153,7 +2216,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission(manager, client);
PageBounds pageBounds;
pageBounds= new PageBounds(page, 20, Order.formString("create_time.desc"));
pageBounds = new PageBounds(page, 20, Order.formString("create_time.desc"));
JSONObject params = new JSONObject() {{
put("parent_client_id", client.getIntValue("client_id"));
}};
@ -2753,7 +2816,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client_ids != null) {
params.put("client_ids", Arrays.asList(client_ids));
params.remove("client_id");
}else {
} else {
queryModifyClientIds(client.getIntValue("client_id"), params);
}
List<JSONObject> deviceIds = clientDeviceMapper.listClientDeviceIds(params);
@ -3304,7 +3367,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
if (manager != null) {
saveClientAuditProcess(client.getIntValue("client_id"), 1, 2, "Compliance合同制作中", manager);
saveClientAuditProcess(client.getIntValue("client_id"), 1, 2, "Compliance合同制作中", manager,1);
}
}
}
@ -3321,7 +3384,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
client.put("open_status", 3);
clientModifySupport.processClientModify(new OpenStatusModify(manager, clientMoniker, 3));
saveClientAuditProcess(client.getIntValue("client_id"), 2, 3, "合同制作完成等待BD处理", manager);
saveClientAuditProcess(client.getIntValue("client_id"), 2, 3, "合同制作完成等待BD处理", manager,1);
// sendAgreeFileMsgToBD(client,null);
sendCommissionWechatMessage(client);
}
@ -3514,7 +3577,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport.processClientModify( new SwitchAllowSurchargeCreditModify(manager, clientMoniker, "enable_presettle", presettle));
clientModifySupport.processClientModify(new SwitchAllowSurchargeCreditModify(manager, clientMoniker, "enable_presettle", presettle));
}
@Override
@ -3567,7 +3630,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException();
}
params.put("display_name", manager.getString("display_name"));
clientApproveIdInfo(params,client);
clientApproveIdInfo(params, client);
}
@Override
@ -3659,7 +3722,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file","kyc_utility_bill_file"};
String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file", "client_apply_file", "kyc_utility_bill_file"};
if (client == null) {
throw new InvalidShortIdException();
}
@ -3714,7 +3777,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
List<JSONObject> clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id"));
JSONObject fileJson = new JSONObject();
JSONObject companyFile = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id"));
fileJson.put("companyFile",companyFile);
fileJson.put("companyFile", companyFile);
if (clientFiles != null && clientFiles.size() > 0) {
for (String fileKey : fileKeys) {
List<JSONObject> clientFileUrl = clientFiles.stream()
@ -3925,7 +3988,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
@Transactional
public List<JSONObject> uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo,String fileType) {
public List<JSONObject> uploadKycFilesForWaitComplianceForApp(JSONObject account, String clientMoniker, JSONObject filesInfo, String fileType) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
List<JSONObject> fileResult = new ArrayList<>();
if (client == null) {
@ -3933,7 +3996,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
int clientId = client.getIntValue("client_id");
try {
updateFilesForWaitAuditWithoutRepeatForApp(account,clientId, fileType, filesInfo.getString("url"),fileResult);
updateFilesForWaitAuditWithoutRepeatForApp(account, clientId, fileType, filesInfo.getString("url"), fileResult);
} catch (Exception e) {
logger.error("上传KYC文件失败", e);
throw new BadRequestException("上传KYC文件失败" + e.getMessage());
@ -3942,7 +4005,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
@Transactional
public void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source) {
@ -4521,14 +4583,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
client.put("open_status", 4);
clientModifySupport.processClientModify(openStatusModify);
saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 4, "BD完成签字提交compliance审核", manager);
saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 4, "BD完成签字提交compliance审核", manager,1);
if (manager != null) {
// sendMessagetoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage(client);
}
}
private void saveClientAuditProcess(int client_id, Integer open_status_form, Integer open_status_to, String remark, JSONObject manager) {
private void saveClientAuditProcess(int client_id, Integer open_status_form, Integer open_status_to, String remark, JSONObject manager,int type) {
JSONObject log = new JSONObject();
try {
log.put("client_id", client_id);
@ -4539,6 +4601,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
log.put("operator_id", StringUtils.isNotEmpty(manager.getString("manager_id")) ? manager.getString("manager_id") : manager.getString("account_id"));
log.put("operator", manager.getString("display_name"));
log.put("create_time", new Date());
log.put("type",type);
log.put("remark", remark);
clientAuditProcessMapper.save(log);
} catch (Exception e) {
@ -4554,6 +4617,54 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException();
}
client.putAll(clientConfigService.find(client.getIntValue("client_id")));
beforeCommitToDoAgreeValid(client, manager);
OpenStatusModify openStatusModify = new OpenStatusModify(manager, clientMoniker, 1);
openStatusModify.setApprove_result(4);
openStatusModify.setApprove_time(new Date());
clientModifySupport.processClientModify(openStatusModify);
saveClientAuditProcess(client.getIntValue("client_id"), null, 1, "提交Card Payment Compliance制作合同", manager,1);
if (manager != null) {
// sendAgreeFileMsgtoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage(client);
}
}
@Override
@Transactional
public void commitToDoCardAgreeFile(String clientMoniker, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
int clientId = client.getIntValue("client_id");
client.putAll(clientConfigService.find(clientId));
beforeCommitToDoAgreeValid(client, manager);
JSONObject cardFlowInfo = clientCardFlowMapper.findClient(clientId);
if(null != cardFlowInfo){
JSONObject cardFlow = new JSONObject(){{
put("client_id",clientId);
put("approve_result",4);
put("open_status",1);
put("approve_time",new Date());
}};
clientCardFlowMapper.update(cardFlow);
}else{
JSONObject cardFlow = new JSONObject(){{
put("client_id",clientId);
put("open_status",1);
put("approve_result",4);
put("approve_time",new Date());
}};
clientCardFlowMapper.save(cardFlow);
}
saveClientAuditProcess(client.getIntValue("client_id"), null, 1, "提交Compliance制作合同", manager,2);
}
private void beforeCommitToDoAgreeValid(JSONObject client, JSONObject manager) {
if (manager != null && ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
int bdOperatClientRole = clientBDMapper.checkBDPermission(client.getIntValue("client_id"), manager.getString("manager_id"));
if (bdOperatClientRole <= 0) {
@ -4570,15 +4681,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (account == null || account.size() <= 0) {
throw new BadRequestException("The Partner's Bank Account is not config!");
}
OpenStatusModify openStatusModify = new OpenStatusModify(manager, clientMoniker, 1);
openStatusModify.setApprove_result(4);
openStatusModify.setApprove_time(new Date());
clientModifySupport.processClientModify(openStatusModify);
saveClientAuditProcess(client.getIntValue("client_id"), null, 1, "提交Compliance制作合同", manager);
if (manager != null) {
// sendAgreeFileMsgtoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage(client);
}
}
@Override
@ -4610,7 +4712,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
openStatusModify.setApprove_result(4);
openStatusModify.setApprove_time(new Date());
clientModifySupport.processClientModify(openStatusModify);
saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 10, "提交绿色通道申请Compliance审核", manager);
saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 10, "提交绿色通道申请Compliance审核", manager,1);
if (manager != null) {
// sendGreenChannelMessagetoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage(client);
@ -4900,7 +5002,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (refuse_remark != null && !refuse_remark.isEmpty()) {
auditModify.setRefuse_remark(refuse_remark);
}
saveClientAuditProcess(client.getIntValue("client_id"), open_status, client.getInteger("open_status"), "打回," + refuse_remark, manager);
saveClientAuditProcess(client.getIntValue("client_id"), open_status, client.getInteger("open_status"), "打回," + refuse_remark, manager,1);
clientModifySupport.processClientModify(auditModify);
try {
@ -4925,6 +5027,55 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
@Override
public void cardRefusePartner(String clientMoniker, JSONObject manager, String refuse_remark) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
Integer clientId = client.getInteger("client_id");
JSONObject cardFlowInfo = clientCardFlowMapper.findClient(clientId);
Integer open_status = null;
if(null != cardFlowInfo){
open_status = cardFlowInfo.getIntValue("open_status");
if (open_status == 1) {
cardFlowInfo.put("open_status",null);
} else {
cardFlowInfo.put("open_status",open_status - 1);
}
if ( cardFlowInfo.getIntValue("approve_result") == 4 || client.getIntValue("source") == 4) {
cardFlowInfo.put("approve_result",5);
}
if (refuse_remark != null && !refuse_remark.isEmpty()) {
cardFlowInfo.put("refuse_remark",refuse_remark);
}
}else{
cardFlowInfo.put("open_status",null);
}
saveClientAuditProcess(client.getIntValue("client_id"), open_status, cardFlowInfo.getIntValue("open_status"), "打回," + refuse_remark, manager,2);
clientCardFlowMapper.update(cardFlowInfo);
try {
if (client.getIntValue("source") == 4) {
String contact_phone = client.getString("contact_phone");
if (contact_phone.startsWith("+61")) {
ArrayList<String> param = new ArrayList<>();
param.add(refuse_remark);
try {
smsSender.getSender().sendWithParam("61", contact_phone.replace("+61", ""), REFUSE_CLIENT_TEMPLID, param, "RoyalPay", "", "");
} catch (Exception ignore) {
throw new ServerErrorException("Phone number is wrong :" + contact_phone);
}
}
}
if (client.getIntValue("source") == 5) {
gatewayMerchantApply.notifyOrgMerchantStatus(client);
}
} catch (Exception e) {
logger.error("RefusePartnerError=======:" + clientMoniker + "," + e.getMessage());
}
}
@Override
@Cacheable(value = ":all_clients:", key = "''+#clientId")
public JSONArray getAllClientIds(int clientId) {
@ -5442,6 +5593,94 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
private void sendCardCommissionWechatMessage(JSONObject client) {
String bd_user_name = client.getString("bd_user_name");
String client_moniker = "[" + client.getString("client_moniker") + "]";
String short_name = client.getString("short_name");
JSONObject cardFlowInfo = clientCardFlowMapper.findClient(client.getInteger("client_id"));
if(null == cardFlowInfo){
return;
}
if (cardFlowInfo.getIntValue("open_status") == 1) {
List<JSONObject> complianceList = managerMapper.getOnlyCompliance();
if (complianceList != null && complianceList.size() > 0) {
for (JSONObject compliance : complianceList) {
String wxopenid = compliance.getString("wx_openid");
try {
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), "BD申请制作卡支付合同" + client_moniker,
bd_user_name, "制作卡支付合同申请", "BD申请制作" + short_name + "的卡支付合同");
paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) {
logger.error("Wechat Message Error,open_status=1" + e.getMessage());
publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=1,openid=" + wxopenid));
}
}
}
return;
}
if (cardFlowInfo.getIntValue("open_status") == 3) {
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
for (JSONObject bd : bds) {
String wxopenid = bd.getString("wx_openid");
if (wxopenid != null) {
try {
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "卡支付合同制作完成",
"Compliance", "合规材料", "上传完整合规材料,商户:" + short_name);
paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) {
logger.error("Wechat Message Error,open_status=3" + e.getMessage());
publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=3,openid=" + wxopenid));
}
}
}
return;
}
if (cardFlowInfo.getIntValue("open_status") == 4) {
if (client.getIntValue("source") == 4 && !StringUtils.isNotEmpty(bd_user_name)) {
bd_user_name = "自助开通商户";
}
List<JSONObject> complianceList = managerMapper.getOnlyCompliance();
if (complianceList != null && complianceList.size() > 0) {
for (JSONObject compliance : complianceList) {
String wxopenid = compliance.getString("wx_openid");
try {
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "卡支付合规材料已提交",
bd_user_name, "审核材料", "已提交合规材料,等待审核");
paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) {
logger.error("Wechat Message Error,open_status=1" + e.getMessage());
publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=1,openid=" + wxopenid));
} catch (Exception e) {
logger.error("Wechat Message Error,open_status=1" + e.getMessage());
}
}
}
return;
}
if (cardFlowInfo.getIntValue("open_status") == 5) {
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
for (JSONObject bd : bds) {
String wxopenid = bd.getString("wx_openid");
if (wxopenid != null) {
try {
TemplateMessage msg = initTaskFinishTemplate(wxopenid, client_moniker + "已正式开通", "Card Payment Compliance审核通过", "");
MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi();
paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) {
logger.error("Wechat Message Error,open_status=5" + e.getMessage());
publisher.publishEvent(new WechatExceptionEvent(this, e, "Audit,open_status=5,openid=" + wxopenid));
}
}
}
return;
}
}
@Override
@Cacheable(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker")
public List<JSONObject> listSubMerchantIdApplys(JSONObject manager, String clientMoniker) {
@ -6048,7 +6287,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
client.put("open_status", 4);
clientModifySupport.processClientModify(openStatusModify);
saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 4, "自助开通商户提交compliance审核", client_account);
saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 4, "自助开通商户提交compliance审核", client_account,1);
if (params != null) {
params.put("display_name", client_account.getString("display_name"));
@ -6648,7 +6887,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject isLessFiles(JSONObject partner){
public JSONObject isLessFiles(JSONObject partner) {
JSONObject client = clientMapper.findClientByMoniker(partner.getString("client_moniker"));
if (client == null) {
throw new InvalidShortIdException();
@ -6656,7 +6895,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5)) {
boolean lessKycFiles = isPartnerKycfilesComplete(partner.getString("client_moniker"));
partner.put("lessKycFiles", lessKycFiles);
partner.put("lessComplianceFiles",signInAccountService.checkAuthFileStatus(partner.getJSONObject("client")).getBoolean("client_less_file"));
partner.put("lessComplianceFiles", signInAccountService.checkAuthFileStatus(partner.getJSONObject("client")).getBoolean("client_less_file"));
}
partner.put("lessKycFiles", false);
partner.put("lessComplianceFiles", false);
@ -6679,14 +6918,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException();
}
JSONObject KycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id"));
if(KycFilesAuth != null){
if (KycFilesAuth != null) {
lessKycFiles = false;
}
return lessKycFiles;
}
@Override
public JSONObject partnerIncrementalServiceInfo(String clientMoniker,String channel){
public JSONObject partnerIncrementalServiceInfo(String clientMoniker, String channel) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -6700,16 +6939,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject getClientIncrementalServiceLoginToken(JSONObject account,String sourceCode){
public JSONObject getClientIncrementalServiceLoginToken(JSONObject account, String sourceCode) {
JSONObject client = clientMapper.findClient(account.getIntValue("client_id"));
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject clientConfig = clientConfigMapper.find(account.getIntValue("client_id"));
if(!clientConfig.getBooleanValue("geek_shop_status")){
if (!clientConfig.getBooleanValue("geek_shop_status")) {
throw new BadRequestException("Merchant service not opened");
}
return retailRSvcService.getGeekSsoTokenInfo(sourceCode,client.getString("client_moniker"));
return retailRSvcService.getGeekSsoTokenInfo(sourceCode, client.getString("client_moniker"));
}
@Override
@ -6913,18 +7152,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void changeExtParams(String clientMoniker,JSONObject manager, JSONObject params){
public void changeExtParams(String clientMoniker, JSONObject manager, JSONObject params) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject extParmas = JSONObject.parseObject(client.getString("ext_params"));
if("true".equals(params.getString("value"))||"false".equals(params.getString("value"))){
extParmas.put(params.getString("key"),params.getBoolean("value"));
}else{
extParmas.put(params.getString("key"),params.getString("value"));
if ("true".equals(params.getString("value")) || "false".equals(params.getString("value"))) {
extParmas.put(params.getString("key"), params.getBoolean("value"));
} else {
extParmas.put(params.getString("key"), params.getString("value"));
}
client.put("ext_params",extParmas.toString());
client.put("ext_params", extParmas.toString());
clientMapper.update(client);
}
@ -6970,7 +7209,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void selectBillCodeVersion(JSONObject manager, String clientMoniker, String version){
public void selectBillCodeVersion(JSONObject manager, String clientMoniker, String version) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -6981,26 +7220,26 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void exportLetterOfferPDF(String clientMoniker,HttpServletResponse response) {
public void exportLetterOfferPDF(String clientMoniker, HttpServletResponse response) {
JSONObject info = convertClientLetterOfferInfo(clientMoniker);
String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/letter_of_offer.pdf";
String fileName = clientMoniker+"_Letter_of_Offer.pdf";
publishExcelCardPDFFile(fileName,pdfPath,info,response);
String fileName = clientMoniker + "_Letter_of_Offer.pdf";
publishExcelCardPDFFile(fileName, pdfPath, info, response);
}
private JSONObject convertClientLetterOfferInfo(String clientMoniker){
private JSONObject convertClientLetterOfferInfo(String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
//合规状态
if(client.getIntValue("approve_result")!=1 && client.getIntValue("approve_result")==3){
if (client.getIntValue("approve_result") != 1 && client.getIntValue("approve_result") == 3) {
throw new BadRequestException("The merchant failed the audit!");
}
//获取数据源
int clientId = client.getInteger("client_id");
JSONObject clientRate = clientRateMapper.latestChannelCleanDays("rpaypmt_card", clientId);
if(clientRate == null){
if (clientRate == null) {
throw new BadRequestException("rpaypmt_card rate Not configured");
}
JSONObject cardRate = clientRate.getJSONObject("ext_rates");
@ -7008,84 +7247,84 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
//装在数据
JSONObject info = new JSONObject();
info.put("down_date",convertDateEnglish(new Date()));//下载文件日期
info.put("bussiness_name",client.getString("business_name")+" ABN");//商圈类型
info.put("partner_address",client.getString("address"));//商家店铺地址
info.put("partner_country",client.getString("country"));//国家
info.put("partner_state",client.getString("state"));//洲
info.put("partner_bussiness_name",client.getString("business_name"));//商户商用名称
info.put("clean_days",client.getInteger("clean_days"));//T+规则清算天数
info.put("partner_industry_mcc",client.getInteger("industry"));//商户行业编码
info.put("legal_bussiness",client.getString("contact_person")+" AS "+client.getString("business_name") + " ABN "+client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码
info.put("annual_rate","0");//年费率
info.put("cost_per_transaction",clientRate.getString("transaction_fee"));//每次交易成本
info.put("domestic_fee",cardRate.getString("domestic_rate_value"));//国内服务费
info.put("international_fee",cardRate.getString("overseas_rate_value"));//国际服务费
info.put("account_reserve","1000");//账户储备金
info.put("down_date", convertDateEnglish(new Date()));//下载文件日期
info.put("bussiness_name", client.getString("business_name") + " ABN");//商圈类型
info.put("partner_address", client.getString("address"));//商家店铺地址
info.put("partner_country", client.getString("country"));//国家
info.put("partner_state", client.getString("state"));//洲
info.put("partner_bussiness_name", client.getString("business_name"));//商户商用名称
info.put("clean_days", client.getInteger("clean_days"));//T+规则清算天数
info.put("partner_industry_mcc", client.getInteger("industry"));//商户行业编码
info.put("legal_bussiness", client.getString("contact_person") + " AS " + client.getString("business_name") + " ABN " + client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码
info.put("annual_rate", "0");//年费率
info.put("cost_per_transaction", clientRate.getString("transaction_fee"));//每次交易成本
info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费
info.put("international_fee", cardRate.getString("overseas_rate_value"));//国际服务费
info.put("account_reserve", "1000");//账户储备金
//银行账号信息
info.put("account_name",bankAccountInfo.getString("account_name"));//
info.put("bsb",bankAccountInfo.getString("bsb_no"));
info.put("account_no",bankAccountInfo.getString("account_no"));
info.put("card_acceptor_name","xxxxxxxxxxxxx");
info.put("account_name", bankAccountInfo.getString("account_name"));//
info.put("bsb", bankAccountInfo.getString("bsb_no"));
info.put("account_no", bankAccountInfo.getString("account_no"));
info.put("card_acceptor_name", "xxxxxxxxxxxxx");
return info;
}
@Override
public void exportPromotionalOfferPDF(String clientMoniker, String date, HttpServletResponse response) {
JSONObject info = convertPromotionalOfferInfo(clientMoniker,date);
JSONObject info = convertPromotionalOfferInfo(clientMoniker, date);
String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/promotional_offer.pdf";
String fileName = clientMoniker+"_Promotional_Offer.pdf";
publishExcelCardPDFFile(fileName,pdfPath,info,response);
String fileName = clientMoniker + "_Promotional_Offer.pdf";
publishExcelCardPDFFile(fileName, pdfPath, info, response);
}
private JSONObject convertPromotionalOfferInfo(String clientMoniker,String date){
private JSONObject convertPromotionalOfferInfo(String clientMoniker, String date) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
//合规状态
if(client.getIntValue("approve_result")!=1 && client.getIntValue("approve_result")==3){
if (client.getIntValue("approve_result") != 1 && client.getIntValue("approve_result") == 3) {
throw new BadRequestException("The merchant failed the audit!");
}
int clientId = client.getInteger("client_id");
JSONObject clientRate = clientRateMapper.latestChannelCleanDays("rpaypmt_card", clientId);
if(clientRate == null){
if (clientRate == null) {
throw new BadRequestException("rpaypmt_card rate Not configured");
}
JSONObject cardRate = clientRate.getJSONObject("ext_rates");
JSONObject bankAccountInfo = clientBankAccountMapper.clientBankAccounts(clientId).get(0);
JSONObject info = new JSONObject();
info.put("down_date",convertDateEnglish(new Date()));//下载文件日期
info.put("bussiness_name",client.getString("business_name")+" ABN");//商圈类型
info.put("partner_address",client.getString("address"));//商家店铺地址
info.put("partner_country",client.getString("country"));//国家
info.put("partner_state",client.getString("state"));//洲
info.put("partner_bussiness_name",client.getString("business_name"));//商户商用名称
info.put("letter_offer_sub_time",date);
info.put("legal_bussiness",client.getString("contact_person")+" AS "+client.getString("business_name") + " ABN "+client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码
info.put("domestic_fee",cardRate.getString("domestic_rate_value"));//国内服务费
info.put("international_fee",cardRate.getString("overseas_rate_value"));//国际服务费
info.put("promotional_effective_date","xxxxxxxxx");
info.put("promotional_period","xxxxxxxxx");
info.put("down_date", convertDateEnglish(new Date()));//下载文件日期
info.put("bussiness_name", client.getString("business_name") + " ABN");//商圈类型
info.put("partner_address", client.getString("address"));//商家店铺地址
info.put("partner_country", client.getString("country"));//国家
info.put("partner_state", client.getString("state"));//洲
info.put("partner_bussiness_name", client.getString("business_name"));//商户商用名称
info.put("letter_offer_sub_time", date);
info.put("legal_bussiness", client.getString("contact_person") + " AS " + client.getString("business_name") + " ABN " + client.getString("abn"));//拼接规则:法人名 AS 商用名称 ABD 编码
info.put("domestic_fee", cardRate.getString("domestic_rate_value"));//国内服务费
info.put("international_fee", cardRate.getString("overseas_rate_value"));//国际服务费
info.put("promotional_effective_date", "xxxxxxxxx");
info.put("promotional_period", "xxxxxxxxx");
return info;
}
@Override
public void exportTermsConditionsPDF(String clientMoniker,HttpServletResponse response) {
public void exportTermsConditionsPDF(String clientMoniker, HttpServletResponse response) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
if(client.getIntValue("approve_result")!=1 && client.getIntValue("approve_result")==3){
if (client.getIntValue("approve_result") != 1 && client.getIntValue("approve_result") == 3) {
throw new BadRequestException("The merchant failed the audit!");
}
String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/terms_and_conditions.pdf";
String fileName = clientMoniker+"_Terms_And_Conditions.pdf";
publishExcelCardPDFFile(fileName,pdfPath,new JSONObject(),response);
String fileName = clientMoniker + "_Terms_And_Conditions.pdf";
publishExcelCardPDFFile(fileName, pdfPath, new JSONObject(), response);
}
private void publishExcelCardPDFFile (String fileName,String pdfPath,JSONObject info,HttpServletResponse response){
private void publishExcelCardPDFFile(String fileName, String pdfPath, JSONObject info, HttpServletResponse response) {
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf");
try {
@ -7105,14 +7344,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
private String convertDateEnglish(Date date){
String[] months= {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Spt","Oct","Nov","Dec"};
private String convertDateEnglish(Date date) {
String[] months = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Spt", "Oct", "Nov", "Dec"};
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
return day+" "+ months[month]+" "+ year;
return day + " " + months[month] + " " + year;
}
public void saveLegalAndMarketingInfo(JSONObject partner) {

@ -280,6 +280,11 @@ public class PartnerManageController {
clientManager.auditClient(manager, clientMoniker, pass.getIntValue("pass"));
}
@ManagerMapping(value = "/{clientMoniker}/card_audit", method = RequestMethod.PUT, role = ManagerRole.OPERATOR)
public void auditCardPartner(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject pass) {
clientManager.auditCardClient(manager, clientMoniker, pass.getIntValue("pass"));
}
@ManagerMapping(value = "/{clientMoniker}/aduit/green_channel", method = RequestMethod.PUT, role = ManagerRole.OPERATOR)
public void auditPartnerGreenChannel(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
clientManager.auditClientGreenChannel(manager, clientMoniker);
@ -300,6 +305,11 @@ public class PartnerManageController {
clientManager.refusePartner(clientMoniker, manager, refuse.getString("refuse_remark"));
}
@ManagerMapping(value = "/{clientMoniker}/card_audit/refuse", method = RequestMethod.PUT, role = ManagerRole.OPERATOR)
public void cardRefusePartner(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject refuse) {
clientManager.cardRefusePartner(clientMoniker, manager, refuse.getString("refuse_remark"));
}
@ManagerMapping(value = "/{clientMoniker}/common_sub_merchant_id", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void switchCommonSubMerchantId(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchPermission(manager, clientMoniker, "common_sub_merchant_id", pass.getBooleanValue("allow"));
@ -629,6 +639,17 @@ public class PartnerManageController {
clientManager.commitToDoAgreeFile(clientMoniker, manager);
}
//TODO BD提交申请卡合规
/**
*
* @param clientMoniker
* @param manager
*/
@ManagerMapping(value = "/{clientMoniker}/make_card_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER})
public void commitToDoCardAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.commitToDoCardAgreeFile(clientMoniker, manager);
}
@ManagerMapping(value = "/{clientMoniker}/compliance/green_channel", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.BD_USER})
public void commitToGreenChannel(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.commitToGreenChannel(clientMoniker, manager);

@ -133,6 +133,24 @@
c.open_status=1 or c.open_status=2 or c.open_status=4)
</if>
<if test="card_approving and approving">
OR (c.client_id NOT IN (
SELECT client_id FROM sys_clients_card_flow
)
OR c.client_id IN (
SELECT client_id FROM sys_clients_card_flow AS cardFlow
WHERE cardFlow.approve_result = 4 or approve_result = 1
))
</if>
<if test="card_approving">
AND (c.client_id NOT IN (
SELECT client_id FROM sys_clients_card_flow
)
OR c.client_id IN (
SELECT client_id FROM sys_clients_card_flow AS cardFlow
WHERE cardFlow.approve_result = 4 or approve_result = 1
))
</if>
<if test="quickPass">
and c.source=4
</if>

@ -533,6 +533,72 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
});
};
$scope.passCardClient = function () {
if (!$rootScope.complianceCheck) {
alert("please check first");
return;
}
if (!$rootScope.complianceCheck.authFile) {
alert("Compliance Files not checked");
return;
}
if (!$rootScope.complianceCheck.clientInfo) {
alert("Partner Detail not checked");
return;
}
if (!$rootScope.complianceCheck.bankAccount) {
alert("Bank Account not checked");
return;
}
var title = 'Audit Partner Card';
var content = 'Are you sure to mark partner ' + $scope.partner.company_name + ' audited';
var choises = '';
var contentHtml = '';
if ($scope.isComplianceOfCompanyName || $scope.isComplianceOfShortName
|| $scope.isComplianceOfBusinessStructure) {
var info = [];
if ($scope.isComplianceOfCompanyName) {
info.push('Company Name');
}
if ($scope.isComplianceOfShortName) {
info.push('Short Name');
}
if ($scope.isComplianceOfBusinessStructure) {
info.push('Business Structure');
}
title = 'Warning';
contentHtml = $sce.trustAsHtml('本次提交的商户[' + $scope.partner.company_name + '],<span style="color: red">' + info.toString() + '</span>存在微信渠道不合规信息');
choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true},
{label: '确认提交', className: 'btn-success', key: '1'}];
content = '';
}
commonDialog.confirm({
title: title,
content: content,
choises: choises,
contentHtml: contentHtml
}).then(function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/card_audit', {pass: 1}).then(function () {
if ($scope.partner.approve_result == 2 && ($scope.partner.source == 1 || $scope.partner.source == 2)) {
commonDialog.alert({
title: 'Success',
content: 'Comply Passed!',
type: 'success'
});
} else {
commonDialog.alert({
title: 'Success',
content: 'Comply Passed! Email will send to contact email address soon.',
type: 'success'
});
}
delete $rootScope.complianceCheck;
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
});
};
$scope.pass2GreenChannel = function () {
commonDialog.confirm({
title: 'Green Channel Audit Partner',
@ -648,6 +714,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
};
$scope.cardRefuse = function(){
commonDialog.inputText({title: 'refuse cause'}).then(function (text) {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/card_audit/refuse', {refuse_remark: text}).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Card Audit application has been refused.',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
}
$scope.deleteClient = function () {
commonDialog.confirm({
title: 'Delete Partner',
@ -712,6 +793,20 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
);
};
$scope.apply2makeCardAgreeFile = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/make_card_agree_file').then(function () {
commonDialog.alert({
title: 'Success!',
content: '已提交制作合同!',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
}
);
};
$scope.commit2GreenChannel = function () {
commonDialog.confirm({
title: 'Audit Partner',

@ -58,11 +58,11 @@
<li class="active">Partner Detail</li>
</ol>
</section>
<div class="content">
<!-- 跨境支付审核 -->
<div class="box box-warning" ng-if="('10'|withRole)">
<div class="box-header with-border">
<h3 class="box-title">Compliance <span ng-if="partner.approve_result==5 || partner.refuse_remark.length>0"
<h3 class="box-title"> <img style="height: 20px;width: 20px" height="20px" src="/static/images/royalpay_sign_s.png"> Compliance <span ng-if="partner.approve_result==5 || partner.refuse_remark.length>0"
style="color: red">(Refused
<small class=""
ng-if="partner.approve_result==5 || partner.refuse_remark.length>0">:{{partner.refuse_remark}}</small>)</span>
@ -95,6 +95,8 @@
<div ng-if="partner.open_status != 5 && partner.open_status!=10">
<!--<a role="button" type="button" class="btn btn-success" ng-click="exportPDF()">-->
<!--制作合同</a>-->
<a role="button" class="btn-group btn btn-warning" type="button" ng-href="{{Export()}}">
<i class="fa fa-download"></i>制作临时合同</a>
<a role="button" type="button" class="btn btn-success" ng-click="exportAgreegatePDF()">
制作全支付合同</a>
<a role="button" type="button" class="btn btn-warning" ngf-select="uploadAgreeFile($file)"
@ -108,7 +110,7 @@
<button ng-if="(partner.open_status==1||partner.open_status==10) && partner.approve_result>3 || partner.open_status==4"
type="button" class="btn btn-primary" ng-click="refuse()">Refuse
</button>
<button type="button" class="btn btn-danger" ng-click="deleteClient()">Delete</button>
</div>
<div ng-if="partner.open_status==10" class="btn-group pull-right" role="group" aria-label="...">
<button type="button" class="btn btn-success" ng-click="pass2GreenChannel()">
@ -116,10 +118,10 @@
Agree Green Channel
</button>
</div>
<a ng-if="fileManager.source_agree_file" role="button" class="btn-group btn btn-warning"
<a style="margin-top: 5px" ng-if="fileManager.source_agree_file" role="button" class="btn-group btn btn-warning" style="margin-top: 5px"
type="button" ng-href="{{fileManager.source_agree_file}}" target="_blank"><i
class="fa fa-download"></i>下载合同</a>
<span style="padding-top: 10px" ng-if="partner.open_status != 5">
<span style="margin-top: 5px" ng-if="partner.open_status != 5">
<a ng-if="partner.open_status==2" role="button" type="button" class="btn btn-primary"
ng-click="notifyBD()">
<i class="fa fa-thumb-tack"></i> Notify BD</a>
@ -155,14 +157,12 @@
</div>
</div>
</div>
<div><a role="button" class="btn-group btn btn-warning" type="button" ng-href="{{Export()}}">
<i class="fa fa-download"></i>制作临时合同</a>
</div>
<div class="box" ng-if="('100'|withRole) && partner.show_all_permission"
ng-class="{'box-warning':partner.approve_result!=5,'box-danger':partner.approve_result==5}">
<div class="box-header with-border">
<h3 class="box-title">Operation <span ng-if="partner.approve_result==5" style="color: red">
<h3 class="box-title">
<img style="height: 20px;width: 20px" src="/static/images/royalpay_sign_s.png">
RP Operation <span ng-if="partner.approve_result==5" style="color: red">
(Refused
<small class="" ng-if="partner.approve_result==5">:{{partner.refuse_remark}}</small>
)</span><span ng-if="(partner.source==1 || partner.source==2) && partner.approve_result==2"
@ -242,6 +242,165 @@
</div>
</div>
</div>
<!-- 卡支付审核 -->
<!-- 给合规权限查看 -->
<div class="box box-warning" ng-if="('10'|withRole)">
<div class="box-header with-border">
<h3 class="box-title"><span style="width: 20px;height: 20px"><img style="height: 20px;width: 20px" src="/static/images/card_payment_sign.png"></span>
Compliance <span ng-if="partner.card_flow_info.approve_result==5 || partner.card_flow_info.refuse_remark.length>0"
style="color: red">(Refused
<small class=""
ng-if="partner.approve_result==5 || partner.refuse_remark.length>0">:{{partner.refuse_remark}}</small>)</span>
<span ng-if="(partner.source==1 || partner.source==2) && partner.card_flow_info.approve_result==2"
style="color: green">(The Partner Using Green Channel Now!)</span>
【目前状态】-
<b ng-if="partner.source==4">
<span ng-if="!partner.card_flow_info.approve_result">(自助申请)资料完善中</span>
<span ng-if="partner.card_flow_info.approve_result==1">(自助申请)已开通</span>
<span ng-if="partner.card_flow_info.approve_result==2">(自助申请)快速开通等待提交合规材料</span>
<span ng-if="partner.card_flow_info.approve_result==3">(自助申请)待审核(材料已提交)</span>
</b>
<b ng-if="partner.source!=4">
<span ng-if="!partner.card_flow_info.open_status">资料完善中</span>
<span ng-if="partner.card_flow_info.open_status==1">待审核(合同制作中)</span>
<span ng-if="partner.card_flow_info.open_status==2">合同制作完成</span>
<span ng-if="partner.card_flow_info.open_status==3">BD处理中</span>
<span ng-if="partner.card_flow_info.open_status==4">待审核(合规文件已提交)</span>
<span ng-if="partner.card_flow_info.open_status==5">通过</span>
<span ng-if="partner.card_flow_info.open_status==0">不通过</span>
</b>
<span ng-if="partner.is_valid==0" ng-class="{pass_timeout:partner.is_valid==0}">(已禁用)</span>
</h3>
<button ng-if="!partner.is_valid" type="button" class="btn btn-success" style="float:right;"
ng-click="revertClient()">Revert
</button>
</div>
<div class="box-body" ng-if="partner.is_valid==1">
<div ng-if="partner.card_flow_info.open_status != 5">
<!--<a role="button" type="button" class="btn btn-success" ng-click="exportPDF()">-->
<!--制作合同</a>-->
<a role="button" type="button" class="btn btn-success" ng-click="exportAgreegatePDF()">
制作全支付合同</a>
<a role="button" type="button" class="btn btn-warning" ngf-select="uploadAgreeFile($file)"
accept="pdf/*">
上传合同</a> (通用合同请选择制作合同,非通用合同模板请人工制作合同后上传)
</div>
<div class="btn-group pull-right" role="group" aria-label="...">
<button type="button" ng-if="partner.card_flow_info.approve_result!=1"
class="btn btn-success" ng-click="passCardClient()">Pass
</button>
<button ng-if="partner.card_flow_info.open_status==1 ||partner.card_flow_info.open_status==4"
type="button" class="btn btn-primary" ng-click="cardRefuse()">Refuse
</button>
</div>
<a style="margin-top: 5px" ng-if="fileManager.source_agree_file" role="button" class="btn-group btn btn-warning"
type="button" ng-href="{{fileManager.source_agree_file}}" target="_blank"><i
class="fa fa-download"></i>下载合同</a>
<span style="margin-top: 5px"ng-if="partner.card_flow_info.open_status != 5">
<a ng-if="partner.card_flow_info.open_status==2" role="button" type="button" class="btn btn-primary"
ng-click="notifyBD()">
<i class="fa fa-thumb-tack"></i> Notify BD</a>
</span>
<div ng-if="partner.audit_card_logs">
<hr>
<div class="box-body table-responsive pad">
<small>
<div class="btn-group-vertical">
<button type="button" class="btn btn-xs btn-primary">完善资料</button>
</div>
</small>
<small ng-repeat="log in partner.audit_card_logs">
<i class="fa fa-arrow-right" aria-hidden="true"></i>
<div class="btn-group-vertical">
<button type="button" class="btn btn-xs btn-primary"
ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status==5||(log.open_status==1)}">
{{log.remark}}
</button>
<button type="button" class="btn btn-xs btn-primary"
ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status==5||(log.open_status==1)}">
{{log.operator}} | {{log.create_time}}
</button>
</div>
</small>
</div>
</div>
</div>
</div>
<!-- 给BD权限查看 -->
<div class="box" ng-if="('100'|withRole) && partner.show_all_permission"
ng-class="{'box-warning':partnercard_flow_info.approve_result!=5,'box-danger':partnercard_flow_info.approve_result==5}">
<div class="box-header with-border">
<h3 class="box-title"><img style="height: 20px;width: 20px" src="/static/images/card_payment_sign.png"> Card Payment Operation <span ng-if="partner.card_flow_info.approve_result==5" style="color: red">
(Refused
<small class="" ng-if="partner.card_flow_info.approve_result==5">:{{partner.card_flow_info.refuse_remark}}</small>
)</span><span ng-if="(partner.source==1 || partner.source==2) && partner.approve_result==2"
style="color: green">(The Partner Using Green Channel Now!)</span>
【目前状态】-
<span ng-if="!partner.card_flow_info.open_status">资料完善中</span>
<span ng-if="partner.card_flow_info.open_status==1">待审核(合同制作中)</span>
<span ng-if="partner.card_flow_info.open_status==2">合同制作完成</span>
<span ng-if="partner.card_flow_info.open_status==3">BD处理中</span>
<span ng-if="partner.card_flow_info.open_status==4">待审核(合规文件已提交)</span>
<span ng-if="partner.card_flow_info.open_status==5">通过</span>
<span ng-if="partner.card_flow_info.open_status==0">不通过</span>
<span ng-if="partner.card_flow_info.open_status==10">绿色通道申请中</span>
</h3>
</div>
<div class="box-body">
<!--<div class="pull-left" ng-if="partner.approve_result==5">Remark:{{partner.refuse_remark}}</div>-->
<a ng-if="fileManager.source_agree_file" role="button" class="btn-group btn btn-warning"
type="button" ng-href="{{fileManager.source_agree_file}}" target="_blank"> <i
class="fa fa-download"></i>下载合同</a>
<div ng-if="partner.card_flow_info.open_status==3" class="btn-group pull-right" role="group" aria-label="...">
<button type="button" class="btn btn-danger" ng-click="commitToCompliance()">Commit to Compliance
</button>
</div>
<div ng-if="!partner.card_flow_info.open_status" class="btn-group pull-right" role="group" aria-label="...">
<button type="button" class="btn btn-primary" ng-click="apply2makeCardAgreeFile()">
<i class="fa fa-paper-plane"></i>
提交合规制作合同
</button>
</div>
<div ng-if="partner.audit_card_logs">
<hr>
<div class="box-body table-responsive pad">
<small>
<div class="btn-group-vertical" style="margin-top: 5px">
<button type="button" class="btn btn-xs btn-primary">BD完善资料</button>
</div>
</small>
<small ng-repeat="log in partner.audit_card_logs">
<i class="fa fa-arrow-right" aria-hidden="true" style="margin-top: 5px"></i>
<div class="btn-group-vertical" style="margin-top: 5px">
<button type="button" class="btn btn-xs btn-primary"
ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">
{{log.remark}}
</button>
<button type="button" class="btn btn-xs btn-primary"
ng-class="{'btn-danger':log.remark.indexOf('打回')>-1,'btn-success':log.open_status_to==5||(log.open_status_from==10 && log.open_status_to==1)}">
{{log.operator}} | {{log.create_time}}
</button>
</div>
</small>
</div>
</div>
</div>
</div>
<!-- 邮件通知 -->
<div class="box box-warning" ng-if="partner.card_flow_info && partner.card_flow_info.approve_result==1 && partner.card_flow_info.approve_email_send==2">
<div class="box-header with-border">
<h3 class="box-title">Solved</h3>
</div>
<div class="box-body">
<div class="pull-left">Make sure you have send the email to client.</div>
<div class="btn-group pull-right" role="group" aria-label="...">
<button type="button" class="btn btn-danger" ng-click="markAuditEmail()">Sure</button>
</div>
</div>
</div>
<!-- 商户信息 -->
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">
@ -1086,6 +1245,7 @@
<div style="text-align: center">
<a role="button" style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope"
ng-if="('10'|withRole)" ng-click="complianceCheck()">check</a>
<a role="button" style="margin-bottom: 25px;" class="btn btn-danger btn-sm ng-scope" ng-click="deleteClient()">Delete</a>
</div>
</div>
</div>

@ -370,6 +370,16 @@
<label>
<input type="checkbox" ng-model="params.approving"
id="approving-check">
<img height="20px" src="/static/images/royalpay_sign_s.png">
等待合规
</label>
</span>
<span class="checkbox-inline">
<label>
<input type="checkbox" ng-model="params.card_approving"
id="card_approving-check">
<img height="20px" src="/static/images/card_payment_sign.png">
等待合规
</label>
</span>
@ -476,7 +486,9 @@
<td ng-bind="partner.short_name"></td>
<td ng-bind="partner.sub_merchant_id"></td>
<td ng-bind="partner.create_time"></td>
<td ng-class="{'bg-green':(partner.approve_result==2 && (partner.source==1 || partner.source==2)),'bg-red':((partner.open_status==1||partner.open_status==2||partner.open_status==4) && partner.approve_result!=3)||(partner.approve_result==3 && (!partner.open_status || partner.open_status==1 || partner.open_status == 4))||(partner.approve_result==4 && !partner.open_status)||(partner.open_status==10)}">
<td class="row">
<div class="col-xs-5" ng-class="{'bg-green':(partner.approve_result==2 && (partner.source==1 || partner.source==2)),'bg-red':((partner.open_status==1||partner.open_status==2||partner.open_status==4) && partner.approve_result!=3)||(partner.approve_result==3 && (!partner.open_status || partner.open_status==1 || partner.open_status == 4))||(partner.approve_result==4 && !partner.open_status)||(partner.open_status==10)}">
<img height="20px" src="/static/images/royalpay_sign_s.png">
<span ng-if="partner.approve_result==1 && partner.approve_time">通过({{partner.approve_time}})</span>
<span ng-if="!partner.open_status && !partner.approve_result && partner.approve_result!=5 && partner.source!=4">资料完善中</span>
<span ng-if="!partner.open_status && !partner.approve_result && partner.approve_result!=5 && partner.source==4">(自助开通)资料完善中</span>
@ -489,6 +501,22 @@
<span ng-if="partner.open_status==3 && partner.approve_result!=5">等待BD上传材料审核</span>
<span ng-if="partner.open_status==10">绿色通道申请中</span>
<span ng-if="partner.approve_result==4 && !partner.open_status"><i ng-if="partner.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true" title="被打回重新提交"></i>等待合规</span>
</div>
<div ng-if="!partner.card_approve_flow_info" class="col-xs-5">
<img height="20px" src="/static/images/card_payment_sign.png"><span>等待BD上传材料审核</span>
</div>
<div ng-if="partner.card_approve_flow_info" class="col-xs-5" style="margin-left: 2px" ng-class="{'bg-green':(partner.card_approve_flow_info.approve_result==2 && (partner.source==1 || partner.source==2)),'bg-red':((partner.card_approve_flow_info.open_status==1||partner.card_approve_flow_info.open_status==2||partner.card_approve_flow_info.open_status==4) && partner.card_approve_flow_info.approve_result!=3)||(partner.card_approve_flow_info.approve_result==3 && (!partner.card_approve_flow_info.open_status || partner.card_approve_flow_info.open_status==1 || partner.card_approve_flow_info.open_status == 4))||(partner.card_approve_flow_info.approve_result==4 && !partner.card_approve_flow_info.open_status)}">
<img height="20px" src="/static/images/card_payment_sign.png">
<span ng-if="partner.card_approve_flow_info.approve_result==1 && partner.card_approve_flow_info.approve_time">通过({{partner.card_approve_flow_info.approve_time}})</span>
<span ng-if="!partner.card_approve_flow_info.open_status && !partner.card_approve_flow_info.approve_result && partner.card_approve_flow_info.approve_result!=5 && partner.source!=4">资料完善中</span>
<span ng-if="!partner.card_approve_flow_info.open_status && !partner.card_approve_flow_info.approve_result && partner.card_approve_flow_info.approve_result!=5 && partner.source==4">(自助开通)资料完善中</span>
<span ng-if="partner.card_approve_flow_info.approve_result==0 && partner.card_approve_flow_info.approve_time">不通过({{partner.card_approve_flow_info.approve_time}})</span>
<span ng-if="partner.card_approve_flow_info.approve_result==5 && partner.card_approve_flow_info.approve_time && !partner.card_approve_flow_info.open_status">申请打回({{partner.card_approve_flow_info.refuse_remark|limitTo:15}})</span>
<span ng-if="(partner.card_approve_flow_info.open_status==1||partner.card_approve_flow_info.open_status==4)"><i ng-if="partner.card_approve_flow_info.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true" title="被打回重新提交"></i>等待合规</span>
<span ng-if="partner.card_approve_flow_info.open_status==2">合同制作完成</span>
<span ng-if="partner.card_approve_flow_info.open_status==3 && partner.card_approve_flow_info.approve_result!=5">等待BD上传材料审核</span>
<span ng-if="partner.card_approve_flow_info.approve_result==4 && !partner.card_approve_flow_info.open_status"><i ng-if="partner.card_approve_flow_info.refuse_remark.length>0" class="fa fa-reply" aria-hidden="true" title="被打回重新提交"></i>等待合规</span>
</div>
</td>
<td ng-bind="partner.org_name"></td>
<td ng-bind="partner.bd_user_name"></td>

Loading…
Cancel
Save