|
|
|
|
@ -6,6 +6,7 @@ import cn.hutool.crypto.asymmetric.Sign;
|
|
|
|
|
import cn.hutool.crypto.asymmetric.SignAlgorithm;
|
|
|
|
|
import cn.pluss.platform.IdCardService;
|
|
|
|
|
import cn.pluss.platform.channel.MercAuditListener;
|
|
|
|
|
import cn.pluss.platform.converter.Converter;
|
|
|
|
|
import cn.pluss.platform.dto.AccountDTO;
|
|
|
|
|
import cn.pluss.platform.entity.*;
|
|
|
|
|
import cn.pluss.platform.exception.MsgException;
|
|
|
|
|
@ -23,7 +24,9 @@ import cn.pluss.platform.region.RegionReflectService;
|
|
|
|
|
import cn.pluss.platform.subMerchant.SubMerchantService;
|
|
|
|
|
import cn.pluss.platform.task.SxfMerAuditHandler;
|
|
|
|
|
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
|
|
|
|
import cn.pluss.platform.util.OssOperatUtil;
|
|
|
|
|
import cn.pluss.platform.util.SignUtils;
|
|
|
|
|
import cn.pluss.platform.vo.MerchantRateNewVO;
|
|
|
|
|
import cn.pluss.platform.ys.YsConfig;
|
|
|
|
|
import cn.pluss.platform.ys.impl.v20210929.YsConstant;
|
|
|
|
|
import cn.pluss.platform.ys.impl.v20220527.ReqMethod;
|
|
|
|
|
@ -32,25 +35,31 @@ import cn.pluss.platform.ys.impl.v20220527.YsConfigV3;
|
|
|
|
|
import cn.pluss.platform.ys.impl.v20220527.YsServiceV3;
|
|
|
|
|
import cn.pluss.platform.ys.impl.v20220527.entity.*;
|
|
|
|
|
import cn.pluss.platform.ys.impl.v20220527.service.YsAuditServiceV3;
|
|
|
|
|
import cn.pluss.platform.ysExtension.v20220615.YsConstantV3;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
//import cn.pluss.platform.merchant.edit.MercChangeRecordService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.TransactionStatus;
|
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
|
|
|
|
|
import org.springframework.transaction.support.TransactionTemplate;
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
|
@ -105,6 +114,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|
|
|
|
private SxfMerAuditHandler sxfMerAuditHandler;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SubMerchantService smService;
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private MercChangeRecordService mcrService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void merchantAuditV3(String userId, boolean isFailCheck) {
|
|
|
|
|
@ -834,12 +845,913 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void report(MerchantChannelStatus mcs) {
|
|
|
|
|
if (mcs == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void main(){
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
param.put("sysFlowId", "APPL202304061707282745251");
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.queryCustApply, param);
|
|
|
|
|
System.out.println(req);
|
|
|
|
|
if (mcs.getChannel() != 4) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reportWxNucc(mcs);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result += e.getMessage() + "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reportWxCups(mcs);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result += e.getMessage() + "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reportAliNucc(mcs);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result += e.getMessage() + "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reportAliCups(mcs);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result += e.getMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result.length() > 0) {
|
|
|
|
|
throw new MsgException(result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 微信网联报备
|
|
|
|
|
*/
|
|
|
|
|
public void reportWxNucc(MerchantChannelStatus mcs) {
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
String merchantId = mcs.getMerchantId();
|
|
|
|
|
param.put(YsConstant.MERC_ID, merchantId);
|
|
|
|
|
param.put("reportChannel", "NUCC_WECHAT");
|
|
|
|
|
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param);
|
|
|
|
|
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("微信网联报备异常," + req.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 微信银联报备
|
|
|
|
|
*/
|
|
|
|
|
public void reportWxCups(MerchantChannelStatus mcs) {
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
String merchantId = mcs.getMerchantId();
|
|
|
|
|
param.put(YsConstant.MERC_ID, merchantId);
|
|
|
|
|
param.put("reportChannel", "CUPS_WECHAT");
|
|
|
|
|
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param);
|
|
|
|
|
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("微信银联报备异常," + req.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 支付宝网联报备
|
|
|
|
|
*/
|
|
|
|
|
public void reportAliNucc(MerchantChannelStatus mcs) {
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
String merchantId = mcs.getMerchantId();
|
|
|
|
|
param.put(YsConstant.MERC_ID, merchantId);
|
|
|
|
|
param.put("reportChannel", "NUCC_ALIPAY");
|
|
|
|
|
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param);
|
|
|
|
|
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("支付宝网联报备异常," + req.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 支付宝银联报备
|
|
|
|
|
*/
|
|
|
|
|
public void reportAliCups(MerchantChannelStatus mcs) {
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
String merchantId = mcs.getMerchantId();
|
|
|
|
|
param.put(YsConstant.MERC_ID, merchantId);
|
|
|
|
|
param.put("reportChannel", "CUPS_ALIPAY");
|
|
|
|
|
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param);
|
|
|
|
|
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("支付宝银联报备异常," + req.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void reportAgain(MerchantChannelStatus mcs){
|
|
|
|
|
if (mcs == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mcs.getChannel() != 4) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reportAgainWxNucc(mcs);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result += e.getMessage() + "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reportAgainWxCups(mcs);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result += e.getMessage() + "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reportAgainAliNucc(mcs);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result += e.getMessage() + "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
reportAgainAliCups(mcs);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
result += e.getMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result.length() > 0) {
|
|
|
|
|
throw new MsgException(result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 微信网联重新报备
|
|
|
|
|
*/
|
|
|
|
|
public void reportAgainWxNucc(MerchantChannelStatus mcs) {
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
String merchantId = mcs.getMerchantId();
|
|
|
|
|
param.put(YsConstant.MERC_ID, merchantId);
|
|
|
|
|
param.put("reportChannel", "NUCC_WECHAT");
|
|
|
|
|
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param);
|
|
|
|
|
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("微信网联报备异常," + req.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// /**
|
|
|
|
|
// * 默认传值,无效可以传空字符串
|
|
|
|
|
// *
|
|
|
|
|
// * @param merchantName 商户名称
|
|
|
|
|
// * @param merchantId 商编
|
|
|
|
|
// * @param legalName 法人、管理人名称
|
|
|
|
|
// * @param bussAuthName 营业名称,
|
|
|
|
|
// * eg: 营业执照名称,简称:商户简称
|
|
|
|
|
// * @param bankHolder 持卡人
|
|
|
|
|
// * @param bankCardNo 结算银行户名
|
|
|
|
|
// * @param rateInfo 费率信息
|
|
|
|
|
// * @param bizName 业务类型
|
|
|
|
|
// * @return
|
|
|
|
|
// */
|
|
|
|
|
// public String getApplyImg(String merchantName, String merchantId, String legalName, String bussAuthName, String bankHolder,
|
|
|
|
|
// String bankCardNo, String rateInfo, String bizName) {
|
|
|
|
|
// try {
|
|
|
|
|
// ClassPathResource cpr = new ClassPathResource("templates/ys_change_table.xlsx");
|
|
|
|
|
// Map<String, Object> param = new HashMap<>();
|
|
|
|
|
// param.put("merchantName", merchantName);
|
|
|
|
|
// param.put("merchantId", merchantId);
|
|
|
|
|
// param.put("bussAuthName", bussAuthName);
|
|
|
|
|
// param.put("bankHolder", bankHolder);
|
|
|
|
|
// param.put("bankCardNo", bankCardNo);
|
|
|
|
|
// param.put("rateInfo", rateInfo);
|
|
|
|
|
// param.put("bizName", bizName);
|
|
|
|
|
// param.put("legalName", legalName);
|
|
|
|
|
//
|
|
|
|
|
// ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
|
|
|
// EasyExcel.write(baos).withTemplate(cpr.getInputStream()).sheet("Sheet1").doFill(param);
|
|
|
|
|
//
|
|
|
|
|
// ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
|
|
|
|
|
//
|
|
|
|
|
// Properties props = System.getProperties();
|
|
|
|
|
//
|
|
|
|
|
// Workbook wb = new Workbook();
|
|
|
|
|
// wb.loadFromStream(bais);
|
|
|
|
|
// wb.setCodeName("UTF-8");
|
|
|
|
|
// Worksheet sheet = wb.getWorksheets().get(0);
|
|
|
|
|
// //随机起一个名称
|
|
|
|
|
// String property = props.getProperty("user.home");
|
|
|
|
|
//
|
|
|
|
|
// String dirPath = property + File.separator + "apply";
|
|
|
|
|
// File dir = new File(dirPath);
|
|
|
|
|
// if (!dir.exists()) {
|
|
|
|
|
// dir.mkdirs();
|
|
|
|
|
// }
|
|
|
|
|
// String uri = dirPath + File.separator + UUID.randomUUID() + ".jpg";
|
|
|
|
|
// sheet.saveToImage(uri);
|
|
|
|
|
// File file = new File(uri);
|
|
|
|
|
// String imgUrl = OssOperatUtil.upload(file, "jpg");
|
|
|
|
|
//
|
|
|
|
|
// log.info("商户变更申请表链接为:" + imgUrl);
|
|
|
|
|
//
|
|
|
|
|
// file.delete();
|
|
|
|
|
// return imgUrl;
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 微信银联重新报备
|
|
|
|
|
*/
|
|
|
|
|
public void reportAgainWxCups(MerchantChannelStatus mcs) {
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
String merchantId = mcs.getMerchantId();
|
|
|
|
|
param.put(YsConstant.MERC_ID, merchantId);
|
|
|
|
|
param.put("reportChannel", "CUPS_WECHAT");
|
|
|
|
|
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param);
|
|
|
|
|
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("微信银联报备异常," + req.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 支付宝网联重新报备
|
|
|
|
|
*/
|
|
|
|
|
public void reportAgainAliNucc(MerchantChannelStatus mcs) {
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
String merchantId = mcs.getMerchantId();
|
|
|
|
|
param.put(YsConstant.MERC_ID, merchantId);
|
|
|
|
|
param.put("reportChannel", "NUCC_ALIPAY");
|
|
|
|
|
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param);
|
|
|
|
|
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("支付宝网联报备异常," + req.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 支付宝银联重新报备
|
|
|
|
|
*/
|
|
|
|
|
public void reportAgainAliCups(MerchantChannelStatus mcs) {
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
String merchantId = mcs.getMerchantId();
|
|
|
|
|
param.put(YsConstant.MERC_ID, merchantId);
|
|
|
|
|
param.put("reportChannel", "CUPS_ALIPAY");
|
|
|
|
|
|
|
|
|
|
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param);
|
|
|
|
|
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("支付宝银联报备异常," + req.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public void sendProtocolMsg(MerchantChannelStatus mcs) {
|
|
|
|
|
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByMerchantCode(mcs.getMerchantCode());
|
|
|
|
|
if (!mcs.getStatus().equals(MerchantChannelStatus.AUDIT_STATUS_WAITING_SIGN)) {
|
|
|
|
|
throw new MsgException("当前状态不能发送签约短信");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String signId = mcs.getExtra().getString("signId");
|
|
|
|
|
if (StringUtils.isEmpty(signId)) {
|
|
|
|
|
sign(mcs);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject reqParam = new JSONObject();
|
|
|
|
|
reqParam.put("signId", signId);
|
|
|
|
|
reqParam.put("isSendConMsg", "1");
|
|
|
|
|
|
|
|
|
|
RespEntity respEntity = ysServiceV3.req(ReqMethod.sendSmsOrEmailMsg, reqParam);
|
|
|
|
|
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("银盛云商服3.0商户签约短信请求失败, " + respEntity.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject businessData = JSON.parseObject(respEntity.getBusinessData());
|
|
|
|
|
mcs.getExtra().putAll(businessData);
|
|
|
|
|
mcsService.updateById(mcs);
|
|
|
|
|
|
|
|
|
|
Notice notice = new Notice(1, -1, mbi.getUserId());
|
|
|
|
|
String uniqueKey = "YS_QY" + System.currentTimeMillis();
|
|
|
|
|
String title = "电子协议签约通知";
|
|
|
|
|
String content = "尊敬的客户您好,请点此通知完成签约意愿授权。请注意,同意授权后,支付通道才会进行商户资料审核,否则会一直等待审核。";
|
|
|
|
|
String url = businessData.getString("signUrl");
|
|
|
|
|
notice.setUniqueKey(uniqueKey);
|
|
|
|
|
notice.setNoticeCode(uniqueKey);
|
|
|
|
|
notice.setTitle(title);
|
|
|
|
|
notice.setUrl(url);
|
|
|
|
|
notice.setDesc(content);
|
|
|
|
|
noticeService.save(notice);
|
|
|
|
|
|
|
|
|
|
generalPushUtil.sendAllPlatByAlias(Collections.singletonList(mbi.getUserId()), title, content, "1");
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 变更结算卡
|
|
|
|
|
* 一般不支持非法人结算卡变更
|
|
|
|
|
*/
|
|
|
|
|
// public void editAccountInfo(String userId) {
|
|
|
|
|
// MercChangeRecord entity = mcrService.get(userId, 4, MercChangeRecord.Type.ACCOUNT, MercChangeRecord.Status.EDIT);
|
|
|
|
|
// if (entity == null) {
|
|
|
|
|
// throw new MsgException("没有需要变更的信息");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// BankCard bankCard = entity.getBankCardInfo();
|
|
|
|
|
// IdCard idCard = entity.getIdCardInfo();
|
|
|
|
|
//
|
|
|
|
|
// MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
|
|
|
|
//
|
|
|
|
|
// MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
|
|
|
|
//
|
|
|
|
|
// RegionCodeYs ysRegionCode = regionReflectService.getYsRegionCode(bankCard);
|
|
|
|
|
//
|
|
|
|
|
// JSONObject ext = entity.getExt();
|
|
|
|
|
// String settleType;
|
|
|
|
|
// if (ext == null) {
|
|
|
|
|
// settleType = Account.LEGAL_PRIVATE_LEGAL;
|
|
|
|
|
// } else {
|
|
|
|
|
// settleType = ext.getString("settleType");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (idCard == null) {
|
|
|
|
|
// AccountDTO accountDTO = accountService.getRealAccount(userId, AccountDTO.CHANNEL_TYPE_D0);
|
|
|
|
|
// idCard = accountDTO.getIdcard();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// JSONObject param = new JSONObject();
|
|
|
|
|
// param.put(YsConstantV3.NOTIFY_URL, YsConfigV3.AUDIT_NOTIFY_URL);
|
|
|
|
|
// StlAccInfo stlAccInfo = new StlAccInfo();
|
|
|
|
|
// stlAccInfo.setIsSettInPlatAcc("N");
|
|
|
|
|
// stlAccInfo.setIsUncrpSett(settleType.startsWith(Account.SETTLE_TYPE_PRIVATE_ILLEGAL) ? "Y" : "N");
|
|
|
|
|
// stlAccInfo.setStlAccNo(bankCard.getBankCardNo());
|
|
|
|
|
// stlAccInfo.setStlAccType(settleType.startsWith(Account.SETTLE_TYPE_CORPORATE) ? "21" : "11");
|
|
|
|
|
// stlAccInfo.setOpenCertNo(idCard.getCertNo());
|
|
|
|
|
// stlAccInfo.setStlAccNm(bankCard.getBankHolder());
|
|
|
|
|
// stlAccInfo.setBankSubCode(bankCard.getContactLine());
|
|
|
|
|
// stlAccInfo.setBankMobile(bankCard.getPhone());
|
|
|
|
|
// stlAccInfo.setBankProince(ysRegionCode.getProvinceCode());
|
|
|
|
|
// stlAccInfo.setBankCity(ysRegionCode.getCityCode());
|
|
|
|
|
//
|
|
|
|
|
// param.put("stlAccInfo", stlAccInfo);
|
|
|
|
|
// param.put(YsConstant.MERC_ID, mcs.getMerchantId());
|
|
|
|
|
//
|
|
|
|
|
// String applyImg = entity.getChangeForm();
|
|
|
|
|
//
|
|
|
|
|
// RespEntity req = ysServiceV3.req(ReqMethod.changeMercStlAccInfo, param);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(req.getSubCode())) {
|
|
|
|
|
// throw new MsgException(req.getSubMsg());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// String businessData = req.getBusinessData();
|
|
|
|
|
// JSONObject bizData = JSON.parseObject(businessData);
|
|
|
|
|
// String changeSysFlowId = bizData.getString("changeSysFlowId");
|
|
|
|
|
//
|
|
|
|
|
// entity.setApplicationId(changeSysFlowId);
|
|
|
|
|
// entity.setStatus(MercChangeRecord.Status.AUDITING.getValue());
|
|
|
|
|
//
|
|
|
|
|
// if (bankCard.getAccountType().equals(BankCard.ACCOUNT_TYPE_CORPORATE)) {
|
|
|
|
|
// // 对公结算需要上传开户许可证
|
|
|
|
|
// imageEditUpload(MerchantImage.ImageType.ACCOUNT_PERMITS, bankCard.getLicenseUrl(), changeSysFlowId);
|
|
|
|
|
// } else {
|
|
|
|
|
// // 对私结算需要上传银行卡图片
|
|
|
|
|
// imageEditUpload(MerchantImage.ImageType.BANK_CARD_FRONT, bankCard.getImgUrl(), changeSysFlowId);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // 非法人结算,传结算人的身份证图片
|
|
|
|
|
// if (Objects.equals(settleType, Account.SETTLE_TYPE_PRIVATE_ILLEGAL)) {
|
|
|
|
|
// imageEditUpload(MerchantImage.ImageType.SETTLE_IDCARD_FRONT, idCard.getImgPositive(), changeSysFlowId);
|
|
|
|
|
// imageEditUpload(MerchantImage.ImageType.SETTLE_IDCARD_BACK, idCard.getImgNegative(), changeSysFlowId);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // 申请表
|
|
|
|
|
// imageEditUpload(MerchantImage.ImageType.CHANGE_FORM, applyImg, changeSysFlowId);
|
|
|
|
|
//
|
|
|
|
|
// log.debug("云商服3.0基本信息变更发起成功");
|
|
|
|
|
// String title = "收银呗商户信息变更通知";
|
|
|
|
|
// String remark = "D0结算信息变更已发起";
|
|
|
|
|
//
|
|
|
|
|
// entity.setRemark(remark);
|
|
|
|
|
// mcrService.saveOrUpdate(entity);
|
|
|
|
|
//
|
|
|
|
|
// noticeService.saveSysNotice(userId, title, remark);
|
|
|
|
|
// generalPushUtil.sendAllPlatByAlias(Collections.singletonList(userId), title, remark, "1");
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 变更基本信息
|
|
|
|
|
*/
|
|
|
|
|
// public void editBaseInfo(String userId) {
|
|
|
|
|
// MercChangeRecord entity = mcrService.get(userId, 4, MercChangeRecord.Type.BASE, MercChangeRecord.Status.EDIT);
|
|
|
|
|
// if (entity == null) {
|
|
|
|
|
// throw new MsgException("没有需要变更的信息");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// MerchantBaseInfo baseInfo = entity.getBaseInfo();
|
|
|
|
|
//
|
|
|
|
|
// MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
|
|
|
|
//
|
|
|
|
|
// MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
|
|
|
|
//
|
|
|
|
|
// JSONObject param = new JSONObject();
|
|
|
|
|
// param.put("notifyUrl", YsConfigV3.AUDIT_NOTIFY_URL);
|
|
|
|
|
// param.put(YsConstant.MERC_ID, mcs.getMerchantId());
|
|
|
|
|
// if (baseInfo != null) {
|
|
|
|
|
// JSONObject custInfo = new JSONObject();
|
|
|
|
|
// custInfo.put("mercName", baseInfo.getMerchantName());
|
|
|
|
|
// custInfo.put("mercShortName", baseInfo.getAlias());
|
|
|
|
|
// // 其他属性暂不考虑
|
|
|
|
|
// param.put("custInfo", custInfo);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// IdCard legalCardInfo = entity.getLegalCardInfo();
|
|
|
|
|
// if (legalCardInfo != null) {
|
|
|
|
|
// JSONObject crpInfo = new JSONObject();
|
|
|
|
|
// crpInfo.put("crpNm", legalCardInfo.getCertName());
|
|
|
|
|
// crpInfo.put("certExpire", legalCardInfo.getCertEndTime().replace("-", ""));
|
|
|
|
|
// param.put("crpInfo", crpInfo);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// RespEntity req = ysServiceV3.req(ReqMethod.changeMercBaseInfo, param);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(req.getSubCode())) {
|
|
|
|
|
// throw new MsgException(req.getSubMsg());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// String businessData = req.getBusinessData();
|
|
|
|
|
// JSONObject bizData = JSON.parseObject(businessData);
|
|
|
|
|
// String changeSysFlowId = bizData.getString("changeSysFlowId");
|
|
|
|
|
//
|
|
|
|
|
// entity.setApplicationId(changeSysFlowId);
|
|
|
|
|
// entity.setStatus(MercChangeRecord.Status.AUDITING.getValue());
|
|
|
|
|
//
|
|
|
|
|
// if (legalCardInfo != null) {
|
|
|
|
|
// int count = 3;
|
|
|
|
|
// String errorMsg = null;
|
|
|
|
|
// do {
|
|
|
|
|
// RespEntity uploadPostImg = ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "A002", legalCardInfo.getImgPositive(), changeSysFlowId);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(uploadPostImg.getSubCode())) {
|
|
|
|
|
// errorMsg = uploadPostImg.getSubMsg();
|
|
|
|
|
// count--;
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// } while (count > 0);
|
|
|
|
|
//
|
|
|
|
|
// if (count == 0) {
|
|
|
|
|
// log.debug("基本信息变更失败,上传身份证正面异常," + errorMsg);
|
|
|
|
|
// String title = "收银呗商户信息变更通知";
|
|
|
|
|
// String remark = "基本信息变更失败,上传图片正面异常," + errorMsg;
|
|
|
|
|
//
|
|
|
|
|
// entity.setRemark(remark);
|
|
|
|
|
//
|
|
|
|
|
// noticeService.saveSysNotice(userId, title, remark);
|
|
|
|
|
// generalPushUtil.sendAllPlatByAlias(Collections.singletonList(userId), title, remark, "1");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// count = 3;
|
|
|
|
|
//
|
|
|
|
|
// do {
|
|
|
|
|
// RespEntity uploadPostImg = ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "A003", legalCardInfo.getImgNegative(), changeSysFlowId);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(uploadPostImg.getSubCode())) {
|
|
|
|
|
// errorMsg = uploadPostImg.getSubMsg();
|
|
|
|
|
// count--;
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// } while (count > 0);
|
|
|
|
|
//
|
|
|
|
|
// if (count == 0) {
|
|
|
|
|
// log.debug("基本信息变更失败,上传身份证反面异常," + errorMsg);
|
|
|
|
|
// String title = "收银呗商户信息变更通知";
|
|
|
|
|
// String remark = "基本信息变更失败,上传图片异常," + errorMsg;
|
|
|
|
|
//
|
|
|
|
|
// entity.setRemark(remark);
|
|
|
|
|
//
|
|
|
|
|
// noticeService.saveSysNotice(userId, title, remark);
|
|
|
|
|
// generalPushUtil.sendAllPlatByAlias(Collections.singletonList(userId), title, remark, "1");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// count = 3;
|
|
|
|
|
// do {
|
|
|
|
|
// RespEntity uploadPostImg = ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "B008", blankPng, changeSysFlowId);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(uploadPostImg.getSubCode())) {
|
|
|
|
|
// errorMsg = uploadPostImg.getSubMsg();
|
|
|
|
|
// count--;
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// } while (count > 0);
|
|
|
|
|
//
|
|
|
|
|
// if (count == 0) {
|
|
|
|
|
// log.debug("基本信息变更失败,上传身份证反面异常," + errorMsg);
|
|
|
|
|
// String title = "收银呗商户信息变更通知";
|
|
|
|
|
// String remark = "基本信息变更失败,上传图片异常," + errorMsg;
|
|
|
|
|
//
|
|
|
|
|
// entity.setRemark(remark);
|
|
|
|
|
//
|
|
|
|
|
// noticeService.saveSysNotice(userId, title, remark);
|
|
|
|
|
// generalPushUtil.sendAllPlatByAlias(Collections.singletonList(userId), title, remark, "1");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// AccountDTO realAccount = accountService.getRealAccount(userId, Account.CHANNEL_TYPE_D0);
|
|
|
|
|
// legalCardInfo = realAccount.getIdcard();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// String bussAuthName = "简称:" + mbi.getAlias();
|
|
|
|
|
// if (!mbi.getMerchantType().equals(MerchantBaseInfo.MERCH_TYPE_MICRO)) {
|
|
|
|
|
// bussAuthName += mbi.getMerchantName() + ", " + bussAuthName;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// String applyImg = getApplyImg(mbi.getMerchantName(), mcs.getMerchantId(), legalCardInfo.getCertName(), bussAuthName, ""
|
|
|
|
|
// , "", "", "变更商户基本信息");
|
|
|
|
|
//
|
|
|
|
|
// String picType = "B008";
|
|
|
|
|
// RespEntity uploadPostImg = ysServiceV3.reqUpload(ReqMethod.uploadChangePic, picType, applyImg, changeSysFlowId);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(uploadPostImg.getSubCode())) {
|
|
|
|
|
// throw new MsgException(req.getSubMsg());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// req = ysServiceV3.req(ReqMethod.changeMercStlAccInfo, param);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(req.getSubCode())) {
|
|
|
|
|
// throw new MsgException(req.getSubMsg());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// mcrService.save(entity);
|
|
|
|
|
// log.debug("云商服3.0基本信息变更发起成功");
|
|
|
|
|
// String title = "收银呗商户信息变更通知";
|
|
|
|
|
// String remark = "D0基本信息变更已发起";
|
|
|
|
|
//
|
|
|
|
|
// entity.setRemark(remark);
|
|
|
|
|
//
|
|
|
|
|
// noticeService.saveSysNotice(userId, title, remark);
|
|
|
|
|
// generalPushUtil.sendAllPlatByAlias(Collections.singletonList(userId), title, remark, "1");
|
|
|
|
|
// }
|
|
|
|
|
private void imageEditUpload(String photoType, String imgUrl, String flowId) {
|
|
|
|
|
int count = 0;
|
|
|
|
|
while (count < 3) {
|
|
|
|
|
count++;
|
|
|
|
|
String relPhotoType = imgTypeTransform(photoType);
|
|
|
|
|
if (relPhotoType == null) {
|
|
|
|
|
throw new MsgException("缺少图片类型");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RespEntity respEntity = ysServiceV3.reqUpload(ReqMethod.uploadChangePic, relPhotoType, imgUrl, flowId);
|
|
|
|
|
|
|
|
|
|
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
log.info("第{}次上传失败:{}", count, respEntity.getSubMsg());
|
|
|
|
|
} else {
|
|
|
|
|
if (photoType.equals(MerchantImage.ImageType.BANK_CARD_FRONT)) {
|
|
|
|
|
imageEditUpload(MerchantImage.ImageType.BANK_CARD_BACK, imgUrl, flowId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw new MsgException("图片多次上传失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改费率
|
|
|
|
|
*/
|
|
|
|
|
// public void editRate(String userId) {
|
|
|
|
|
// MercChangeRecord entity = mcrService.get(userId, 4, MercChangeRecord.Type.RATE, MercChangeRecord.Status.EDIT);
|
|
|
|
|
// if (entity == null) {
|
|
|
|
|
// throw new MsgException("没有需要变更的信息");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
|
|
|
|
// MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
|
|
|
|
// MerchantRateNew rateInfo = entity.getRateInfo();
|
|
|
|
|
//
|
|
|
|
|
// MerchantRateNewVO vo = Converter.INSTANCE.toVO(rateInfo);
|
|
|
|
|
// MerchantRateNewVO.setRateValue(vo);
|
|
|
|
|
//
|
|
|
|
|
// RateFeeInfo rateFeeInfo = new RateFeeInfo();
|
|
|
|
|
// rateFeeInfo.setAliPayFee(new RateFeeDetail("0", vo.getAliRateValue().divide(BigDecimal.valueOf(100)).stripTrailingZeros().toPlainString(), "1"));
|
|
|
|
|
// rateFeeInfo.setWxPayFee(new RateFeeDetail("0", vo.getWxRateValue().divide(BigDecimal.valueOf(100)).stripTrailingZeros().toPlainString(), "1"));
|
|
|
|
|
// rateFeeInfo.setBank1debitPayFee(new RateFeeDetail("0", vo.getBankRateLargeValue().divide(BigDecimal.valueOf(100)).stripTrailingZeros().toPlainString(), "1", "999900"));
|
|
|
|
|
// rateFeeInfo.setBank1creditPayFee(new RateFeeDetail("0", vo.getBankRateLargeValue().divide(BigDecimal.valueOf(100)).stripTrailingZeros().toPlainString(), "1", "999900"));
|
|
|
|
|
// rateFeeInfo.setBank2debitPayFee(new RateFeeDetail("0", vo.getBankRateValue().divide(BigDecimal.valueOf(100)).stripTrailingZeros().toPlainString(), "1", "999900"));
|
|
|
|
|
// rateFeeInfo.setBank2creditPayFee(new RateFeeDetail("0", vo.getBankRateValue().divide(BigDecimal.valueOf(100)).stripTrailingZeros().toPlainString(), "1"));
|
|
|
|
|
// RateFeeDetail codeScanD0Fee = new RateFeeDetail("0", "0.10", "1");
|
|
|
|
|
//
|
|
|
|
|
// JSONObject param = new JSONObject();
|
|
|
|
|
// param.put("codeScanT1Fee", rateFeeInfo);
|
|
|
|
|
// param.put("codeScanD0Fee", codeScanD0Fee);
|
|
|
|
|
// param.put(YsConstant.MERC_ID, mcs.getMerchantId());
|
|
|
|
|
// param.put("notifyUrl", YsConfigV3.AUDIT_NOTIFY_URL);
|
|
|
|
|
//
|
|
|
|
|
// String rateInfoContent = "微信:" + rateFeeInfo.getWxPayFee().getRateFee() + "%; ";
|
|
|
|
|
// rateInfoContent += "支付宝:" + rateFeeInfo.getAliPayFee().getRateFee() + "%; ";
|
|
|
|
|
// rateInfoContent += "银联:关闭";
|
|
|
|
|
//
|
|
|
|
|
// IdCard legalIdCard = idCardService.getLegalIdCard(userId);
|
|
|
|
|
// if (legalIdCard == null) {
|
|
|
|
|
// legalIdCard = idCardService.getAccountIdCard(userId, Account.CHANNEL_TYPE_D0);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// String applyImg = getApplyImg(mbi.getMerchantName(), mcs.getMerchantId(), legalIdCard.getCertName(), "", "", "", rateInfoContent, "费率变更");
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// RespEntity req = ysServiceV3.req(ReqMethod.changeRate, param);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(req.getSubCode())) {
|
|
|
|
|
// throw new MsgException(req.getSubMsg());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// entity.setStatus(MercChangeRecord.Status.AUDITING.getValue());
|
|
|
|
|
//
|
|
|
|
|
// String businessData = req.getBusinessData();
|
|
|
|
|
// JSONObject bizJSON = JSON.parseObject(businessData);
|
|
|
|
|
// String changeSysFlowId = bizJSON.getString("changeSysFlowId");
|
|
|
|
|
// entity.setApplicationId(changeSysFlowId);
|
|
|
|
|
//
|
|
|
|
|
// RespEntity uploadPostImg = ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "B008", applyImg, changeSysFlowId);
|
|
|
|
|
// if (!YsConfigV3.BIZ_SUCCESS.equals(uploadPostImg.getSubCode())) {
|
|
|
|
|
// throw new MsgException(req.getSubMsg());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// mcrService.saveOrUpdate(entity);
|
|
|
|
|
//
|
|
|
|
|
// log.debug("云商服3.0基本信息变更发起成功");
|
|
|
|
|
// String title = "收银呗商户信息变更通知";
|
|
|
|
|
// String remark = "D0费率变更已发起";
|
|
|
|
|
//
|
|
|
|
|
// entity.setRemark(remark);
|
|
|
|
|
//
|
|
|
|
|
// noticeService.saveSysNotice(userId, title, remark);
|
|
|
|
|
// generalPushUtil.sendAllPlatByAlias(Collections.singletonList(userId), title, remark, "1");
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 更新法人身份证
|
|
|
|
|
* @param userId
|
|
|
|
|
*/
|
|
|
|
|
// public void modifyLegalCard(String userId) {
|
|
|
|
|
// MercChangeRecord mcr = mcrService.get(userId, CHANNEL_ID, MercChangeRecord.Type.CARD, MercChangeRecord.Status.EDIT);
|
|
|
|
|
// MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
|
|
|
|
// MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), CHANNEL_ID);
|
|
|
|
|
// IdCard legalCardInfo = mcr.getLegalCardInfo();
|
|
|
|
|
//
|
|
|
|
|
// CrpInfo crpInfo = new CrpInfo();
|
|
|
|
|
// crpInfo.setCrpNm(legalCardInfo.getCertName());
|
|
|
|
|
// if ("长期".equals(legalCardInfo.getCertEndTime())) {
|
|
|
|
|
// crpInfo.setCertExpire("29991231");
|
|
|
|
|
// } else {
|
|
|
|
|
// crpInfo.setCertExpire(legalCardInfo.getCertEndTime().replace("-", ""));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// JSONObject param = new JSONObject();
|
|
|
|
|
// param.put(YsConstantV3.MERC_ID, mcs.getMerchantId());
|
|
|
|
|
// param.put(YsConstantV3.CRP_NAME, YsConfigV3.AUDIT_NOTIFY_URL);
|
|
|
|
|
// param.put("crpInfo", crpInfo);
|
|
|
|
|
//
|
|
|
|
|
// try {
|
|
|
|
|
// RespEntity req = ysServiceV3.req(ReqMethod.changeMercBaseInfo, param);
|
|
|
|
|
//
|
|
|
|
|
// String businessData = req.getBusinessData();
|
|
|
|
|
// JSONObject bizJson = JSON.parseObject(businessData);
|
|
|
|
|
// String changeSysFlowId = bizJson.getString("changeSysFlowId");
|
|
|
|
|
//
|
|
|
|
|
// // 上传法人身份证正面图片
|
|
|
|
|
// ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "A002", legalCardInfo.getImgPositive(), changeSysFlowId);
|
|
|
|
|
// // 上传法人身份证反面图片
|
|
|
|
|
// ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "A003", legalCardInfo.getImgNegative(), changeSysFlowId);
|
|
|
|
|
// // 上传变更表图片
|
|
|
|
|
// ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "B008", mcr.getChangeForm(), changeSysFlowId);
|
|
|
|
|
//
|
|
|
|
|
// mcr.setApplicationId(changeSysFlowId);
|
|
|
|
|
// mcr.setStatus(MercChangeRecord.Status.AUDITING);
|
|
|
|
|
// mcrService.updateById(mcr);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// mcr.setApplicationId("SYB_" + UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
// mcr.setRemark(e.getMessage());
|
|
|
|
|
// mcr.setStatus(MercChangeRecord.Status.REFUSE);
|
|
|
|
|
// mcrService.updateById(mcr);
|
|
|
|
|
//
|
|
|
|
|
// JSONObject ext = new JSONObject();
|
|
|
|
|
// ext.put("remark", e.getMessage());
|
|
|
|
|
// editResultService.onFail(CHANNEL_ID, mcr.getApplicationId(), ext);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 更新结算身份证
|
|
|
|
|
* @param userId
|
|
|
|
|
*/
|
|
|
|
|
// public void modifyAccCard(String userId) {
|
|
|
|
|
// MercChangeRecord mcr = mcrService.get(userId, CHANNEL_ID, MercChangeRecord.Type.CARD, MercChangeRecord.Status.EDIT);
|
|
|
|
|
// MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
|
|
|
|
// MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), CHANNEL_ID);
|
|
|
|
|
// IdCard idCard = mcr.getIdCardInfo();
|
|
|
|
|
// BankCard bankCard = mcr.getBankCardInfo();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// StlAccInfo stlAccInfo = new StlAccInfo();
|
|
|
|
|
// stlAccInfo.setStlAccNm(idCard.getCertName());
|
|
|
|
|
// stlAccInfo.setIsUncrpSett("Y");
|
|
|
|
|
// stlAccInfo.setIsSettInPlatAcc("N");
|
|
|
|
|
// stlAccInfo.setStlAccType("11");
|
|
|
|
|
// stlAccInfo.setOpenCertNo(idCard.getCertNo());
|
|
|
|
|
// stlAccInfo.setBankSubCode(bankCard.getContactLine());
|
|
|
|
|
// stlAccInfo.setBankMobile(bankCard.getPhone());
|
|
|
|
|
//
|
|
|
|
|
// RegionCodeYs regionCodeYs = regionCodeYsService.getRegionData(bankCard.getBranchProvince(), bankCard.getBranchCity(), bankCard.getBranchArea());
|
|
|
|
|
// stlAccInfo.setBankProince(regionCodeYs.getProvinceCode());
|
|
|
|
|
// stlAccInfo.setBankCity(regionCodeYs.getCityCode());
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// JSONObject param = new JSONObject();
|
|
|
|
|
// param.put(YsConstantV3.MERC_ID, mcs.getMerchantId());
|
|
|
|
|
// param.put(YsConstantV3.CRP_NAME, YsConfigV3.AUDIT_NOTIFY_URL);
|
|
|
|
|
// param.put("stlAccInfo", stlAccInfo);
|
|
|
|
|
//
|
|
|
|
|
// try {
|
|
|
|
|
// RespEntity req = ysServiceV3.req(ReqMethod.changeMercBaseInfo, param);
|
|
|
|
|
//
|
|
|
|
|
// String businessData = req.getBusinessData();
|
|
|
|
|
// JSONObject bizJson = JSON.parseObject(businessData);
|
|
|
|
|
// String changeSysFlowId = bizJson.getString("changeSysFlowId");
|
|
|
|
|
//
|
|
|
|
|
// // 上传银行卡卡号面图片
|
|
|
|
|
// ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "A004", bankCard.getImgUrl(), changeSysFlowId);
|
|
|
|
|
// // 上传银行卡背面图片
|
|
|
|
|
// ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "A005", bankCard.getImgUrl(), changeSysFlowId);
|
|
|
|
|
// // 上传结算人身份证正面图片
|
|
|
|
|
// ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "A013", idCard.getImgPositive(), changeSysFlowId);
|
|
|
|
|
// // 上传结算人身份证反面图片
|
|
|
|
|
// ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "A014", idCard.getImgNegative(), changeSysFlowId);
|
|
|
|
|
// // 上传变更表图片
|
|
|
|
|
// ysServiceV3.reqUpload(ReqMethod.uploadChangePic, "B008", mcr.getChangeForm(), changeSysFlowId);
|
|
|
|
|
//
|
|
|
|
|
// mcr.setApplicationId(changeSysFlowId);
|
|
|
|
|
// mcr.setStatus(MercChangeRecord.Status.AUDITING);
|
|
|
|
|
// mcrService.updateById(mcr);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// mcr.setApplicationId("SYB_" + UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
|
// mcr.setRemark(e.getMessage());
|
|
|
|
|
// mcr.setStatus(MercChangeRecord.Status.REFUSE);
|
|
|
|
|
// mcrService.updateById(mcr);
|
|
|
|
|
//
|
|
|
|
|
// JSONObject ext = new JSONObject();
|
|
|
|
|
// ext.put("remark", e.getMessage());
|
|
|
|
|
// editResultService.onFail(CHANNEL_ID, mcr.getApplicationId(), ext);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 修改营业执照
|
|
|
|
|
* @param userId 用户ID
|
|
|
|
|
*/
|
|
|
|
|
// public void editBusLicense(String userId) {
|
|
|
|
|
// MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
|
|
|
|
// MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 1);
|
|
|
|
|
//
|
|
|
|
|
// Assert.notNull(mcs, "未获取到进件信息");
|
|
|
|
|
// if (!Objects.equals(mcs.getChannel(), 1)) {
|
|
|
|
|
// throw new MsgException("未获取到进件信息");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// MercChangeRecord mcRecord = mcrService.get(userId, 1, MercChangeRecord.Type.BLL);
|
|
|
|
|
// MerchantBaseInfo newMbi = mcRecord.getBaseInfo();
|
|
|
|
|
//
|
|
|
|
|
// JSONObject param = new JSONObject();
|
|
|
|
|
// BusInfo busInfo = new BusInfo();
|
|
|
|
|
// busInfo.setBusNm(newMbi.getBussAuthName());
|
|
|
|
|
// busInfo.setBusCertExpire(newMbi.getBussAuthEndTime().replace("-", ""));
|
|
|
|
|
// busInfo.setBusAddr(newMbi.getBussAuthAddress());
|
|
|
|
|
// busInfo.setRegAddr(newMbi.getBussAuthAddress());
|
|
|
|
|
//
|
|
|
|
|
// param.put("busInfo", busInfo);
|
|
|
|
|
//
|
|
|
|
|
// RespEntity req = ysServiceV3.req(ReqMethod.changeMercBaseInfo, param);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 查询进件结果
|
|
|
|
|
* @param mcs
|
|
|
|
|
*/
|
|
|
|
|
public void auditResult(MerchantChannelStatus mcs) {
|
|
|
|
|
if (mcs == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!MerchantChannelStatus.AUDIT_STATUS_EXAMINING.equals(mcs.getStatus())
|
|
|
|
|
&& !MerchantChannelStatus.AUDIT_STATUS_ARTIFICIAL_EXAMINING.equals(mcs.getStatus())) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String sysFlowId = mcs.getExtra().getString("sysFlowId");
|
|
|
|
|
if (StringUtils.isEmpty(sysFlowId)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RespEntity respEntity = ysServiceV3.req(ReqMethod.queryCustApply, new JSONObject().fluentPut("sysFlowId", sysFlowId));
|
|
|
|
|
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("银盛云商服3.0商户信息状态确认失败: {}", respEntity.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Notify.Cust cust = JSON.parseObject(respEntity.getBusinessData(), Notify.Cust.class);
|
|
|
|
|
auditResultHandle(cust);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 查询签约结果,该操作作为商户最终状态的判断
|
|
|
|
|
* @param userId 用户id
|
|
|
|
|
*/
|
|
|
|
|
public void signResult(String userId) {
|
|
|
|
|
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
|
|
|
|
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
|
|
|
|
if (mcs == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!MerchantChannelStatus.AUDIT_STATUS_WAITING_SIGN.equals(mcs.getStatus())) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String authId = mcs.getExtra().getString("authId");
|
|
|
|
|
if (StringUtils.isEmpty(authId)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject reqParam = new JSONObject();
|
|
|
|
|
reqParam.put("authId", authId);
|
|
|
|
|
|
|
|
|
|
RespEntity respEntity = ysServiceV3.req(ReqMethod.queryAuthInfo, reqParam);
|
|
|
|
|
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
throw new MsgException("银盛云商服3.0商户签约状态请求失败, {}", respEntity.getSubMsg());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
signResultHandle(JSON.parseObject(respEntity.getBusinessData(), Notify.Auth.class));
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 查询商户变更结果
|
|
|
|
|
* @param userId 用户id
|
|
|
|
|
*/
|
|
|
|
|
// public void editResult(String userId) {
|
|
|
|
|
// MercChangeRecord entity = mcrService.get(userId, 4, null, MercChangeRecord.Status.AUDITING);
|
|
|
|
|
// if (entity == null) {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// JSONObject param = new JSONObject();
|
|
|
|
|
// param.put("changeSysFlowId", entity.getApplicationId());
|
|
|
|
|
// RespEntity respEntity = ysServiceV3.req(ReqMethod.queryCustChange, param);
|
|
|
|
|
//
|
|
|
|
|
// if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
|
|
|
|
// log.error("银盛云商服商户变更结果查询失败:{}", respEntity.getSubMsg());
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// String businessData = respEntity.getBusinessData();
|
|
|
|
|
//
|
|
|
|
|
// Notify.Change changeResult = JSON.parseObject(businessData, Notify.Change.class);
|
|
|
|
|
//
|
|
|
|
|
// editResultHandle(changeResult);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// public void editResultHandle(Notify.Change changeResult) {
|
|
|
|
|
// String status = changeResult.getStatus();
|
|
|
|
|
//
|
|
|
|
|
// MercChangeRecord entity = mcrService.get(changeResult.getChangeSysFlowId(), 4);
|
|
|
|
|
//
|
|
|
|
|
// if (entity == null && !Objects.equals(entity.getStatus(), MercChangeRecord.Status.AUDITING.getValue())) {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (YsConfigV3.STATUS_SUCCESS.equals(status)) {
|
|
|
|
|
// // 变更成功
|
|
|
|
|
// entity.setStatus(MercChangeRecord.Status.SUCCESS.getValue());
|
|
|
|
|
// mcrService.updateById(entity);
|
|
|
|
|
//
|
|
|
|
|
// if (MercChangeRecord.Type.BASE.getValue().equals(entity.getChangeType())) {
|
|
|
|
|
// // 基本信息变更完成
|
|
|
|
|
// successChangeBaseInfo(entity, entity.getUserId() + "");
|
|
|
|
|
// } else if (MercChangeRecord.Type.ACCOUNT.getValue().equals(entity.getChangeType())) {
|
|
|
|
|
// // 结算卡变更完成
|
|
|
|
|
// successChangeSettlement(entity, entity.getUserId() + "");
|
|
|
|
|
// } else if (MercChangeRecord.Type.RATE.getValue().equals(entity.getChangeType())) {
|
|
|
|
|
// // 费率变更完成
|
|
|
|
|
// successChangeRate(entity, entity.getBaseInfo().getUserId());
|
|
|
|
|
// } else if (MercChangeRecord.Type.CARD.getValue().equals(entity.getChangeType())) {
|
|
|
|
|
// // TODO 证件补充, 云商服3.0没有该功能
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (YsConfigV3.STATUS_REFUSE.equals(status)) {
|
|
|
|
|
// // 变更失败
|
|
|
|
|
// entity.setStatus(MercChangeRecord.Status.REFUSE.getValue());
|
|
|
|
|
// entity.setRemark(changeResult.getNote());
|
|
|
|
|
// mcrService.updateById(entity);
|
|
|
|
|
//
|
|
|
|
|
// if (MercChangeRecord.Type.BASE.getValue().equals(entity.getChangeType())) {
|
|
|
|
|
// // 基本信息变更失败
|
|
|
|
|
// failChangeBaseInfo(changeResult.getNote(), entity.getUserId() + "");
|
|
|
|
|
// } else if (MercChangeRecord.Type.ACCOUNT.getValue().equals(entity.getChangeType())) {
|
|
|
|
|
// // 结算卡变更失败
|
|
|
|
|
// failChangeBankCard(changeResult.getNote(), entity.getUserId() + "");
|
|
|
|
|
// } else if (MercChangeRecord.Type.RATE.getValue().equals(entity.getChangeType())) {
|
|
|
|
|
// // 费率变更失败
|
|
|
|
|
// failChangeRate(changeResult.getNote(), entity.getUserId() + "");
|
|
|
|
|
// } else if (MercChangeRecord.Type.CARD.getValue().equals(entity.getChangeType())) {
|
|
|
|
|
// // TODO 证件补充, 云商服3.0没有该功能
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|