|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
@ -1168,17 +1190,58 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
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"));
|
|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
@ -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"));
|
|
|
|
|