银盛大改,增加D1通道
This commit is contained in:
@@ -9,13 +9,13 @@ public interface YSAuditServiceV3 {
|
||||
* 银盛进件3.0
|
||||
* @param userId 用户id
|
||||
*/
|
||||
void merchantAuditV3(String userId, boolean isFailCheck);
|
||||
void sign(MerchantChannelStatus mcs);
|
||||
void merchantAuditV3(String userId, boolean isFailCheck, Integer channel);
|
||||
void sign(MerchantChannelStatus mcs, Integer channel);
|
||||
/**
|
||||
* 回调,通用回调
|
||||
* @param jsonObject 回调参数
|
||||
*/
|
||||
void callback(JSONObject jsonObject) throws Exception;
|
||||
void callback(JSONObject jsonObject, Integer channel) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询进件结果
|
||||
@@ -25,8 +25,8 @@ public interface YSAuditServiceV3 {
|
||||
|
||||
void openOnlinePay(MerchantChannelStatus mcs);
|
||||
|
||||
void report(MerchantChannelStatus mcs);
|
||||
void report(MerchantChannelStatus mcs, Integer channel);
|
||||
|
||||
void reportAgain(MerchantChannelStatus mcs);
|
||||
void reportAgain(MerchantChannelStatus mcs, Integer channel);
|
||||
|
||||
}
|
||||
|
||||
@@ -122,19 +122,19 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
// private MercChangeRecordService mcrService;
|
||||
|
||||
@Override
|
||||
public void merchantAuditV3(String userId, boolean isFailCheck) {
|
||||
public void merchantAuditV3(String userId, boolean isFailCheck, Integer channel) {
|
||||
try {
|
||||
self.step1(userId);
|
||||
self.step1(userId,channel);
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
self.step2(userId);
|
||||
self.step2(userId,channel);
|
||||
Thread.sleep(10000);
|
||||
self.step3(userId);
|
||||
self.step3(userId, channel);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), channel);
|
||||
|
||||
if (e instanceof MsgException) {
|
||||
Serializable obj = ((MsgException) e).getObj();
|
||||
@@ -143,7 +143,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
}
|
||||
}
|
||||
|
||||
if (mcs != null && mcs.getChannel() == 4) {
|
||||
if (mcs != null && mcs.getChannel().equals(channel)) {
|
||||
mcs.setStatus(MerchantChannelStatus.AUDIT_STATUS_EXAMINING);
|
||||
mcs.setThirdStatus(MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING);
|
||||
mcs.setRemark("银盛审核失败: " + e.getMessage());
|
||||
@@ -161,9 +161,9 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
e.printStackTrace();
|
||||
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), channel);
|
||||
|
||||
if (mcs != null && Objects.equals(mcs.getChannel(), 4)) {
|
||||
if (mcs != null && Objects.equals(mcs.getChannel(), channel)) {
|
||||
mcs.setStatus(MerchantChannelStatus.AUDIT_STATUS_EXAMINING);
|
||||
mcs.setThirdStatus(MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING);
|
||||
mcs.setRemark("银盛审核失败: " + e.getMessage());
|
||||
@@ -183,7 +183,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sign(MerchantChannelStatus mcs) {
|
||||
public void sign(MerchantChannelStatus mcs, Integer channel) {
|
||||
List<String> excludeStatus = Collections.singletonList(MerchantChannelStatus.AUDIT_STATUS_SUCCESS);
|
||||
|
||||
boolean returnFlag = excludeStatus.stream().anyMatch(s -> s.equals(mcs.getStatus()));
|
||||
@@ -198,28 +198,51 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
|
||||
JSONObject extra = mcs.getExtra();
|
||||
String custId = extra.getString("custId");
|
||||
RespEntity respEntity;
|
||||
if(channel == 4) {
|
||||
RateInfo rateInfo = new RateInfo();
|
||||
rateInfo.setCustId(custId);
|
||||
rateInfo.setBusOpenType("00|01");
|
||||
rateInfo.setContractType("2");
|
||||
rateInfo.setIsSendConMsg("1");
|
||||
rateInfo.setNotifyUrl(YsConfigV3.AUDIT_SIGN_NOTIFY_URL);
|
||||
|
||||
RateInfo rateInfo = new RateInfo();
|
||||
rateInfo.setCustId(custId);
|
||||
rateInfo.setBusOpenType("00|01");
|
||||
rateInfo.setContractType("2");
|
||||
rateInfo.setIsSendConMsg("1");
|
||||
rateInfo.setNotifyUrl(YsConfigV3.AUDIT_SIGN_NOTIFY_URL);
|
||||
RateFeeInfo rateFeeInfo = new RateFeeInfo();
|
||||
rateFeeInfo.setAliPayFee(new RateFeeDetail("0", "0.38", "1"));
|
||||
rateFeeInfo.setWxPayFee(new RateFeeDetail("0", "0.38", "1"));
|
||||
rateFeeInfo.setBank1debitPayFee(new RateFeeDetail("0", "0.61", "1", "999900"));
|
||||
rateFeeInfo.setBank1creditPayFee(new RateFeeDetail("0", "0.61", "1", "999900"));
|
||||
rateFeeInfo.setBank2debitPayFee(new RateFeeDetail("0", "0.60", "1", "999900"));
|
||||
rateFeeInfo.setBank2creditPayFee(new RateFeeDetail("0", "0.60", "1"));
|
||||
RateFeeDetail codeScanD0Fee = new RateFeeDetail("0", "0.48", "1");
|
||||
rateInfo.setCodeScanD0Fee(codeScanD0Fee);
|
||||
rateInfo.setCodeScanT1Fee(rateFeeInfo);
|
||||
|
||||
RateFeeInfo rateFeeInfo = new RateFeeInfo();
|
||||
rateFeeInfo.setAliPayFee(new RateFeeDetail("0", "0.38", "1"));
|
||||
rateFeeInfo.setWxPayFee(new RateFeeDetail("0", "0.38", "1"));
|
||||
rateFeeInfo.setBank1debitPayFee(new RateFeeDetail("0", "0.61", "1", "999900"));
|
||||
rateFeeInfo.setBank1creditPayFee(new RateFeeDetail("0", "0.61", "1", "999900"));
|
||||
rateFeeInfo.setBank2debitPayFee(new RateFeeDetail("0", "0.60", "1", "999900"));
|
||||
rateFeeInfo.setBank2creditPayFee(new RateFeeDetail("0", "0.60", "1"));
|
||||
RateFeeDetail codeScanD0Fee = new RateFeeDetail("0", "0.10", "1");
|
||||
rateInfo.setCodeScanD0Fee(codeScanD0Fee);
|
||||
rateInfo.setCodeScanT1Fee(rateFeeInfo);
|
||||
respEntity = ysServiceV3.req(ReqMethod.sign, (JSONObject) JSON.toJSON(rateInfo), channel);
|
||||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约申请请求失败, {}", respEntity.getSubMsg());
|
||||
}
|
||||
}else {
|
||||
RateInfoD1 rateInfoD1 = new RateInfoD1();
|
||||
rateInfoD1.setCustId(custId);
|
||||
rateInfoD1.setBusOpenType("00");
|
||||
rateInfoD1.setContractType("2");
|
||||
rateInfoD1.setIsSendConMsg("1");
|
||||
rateInfoD1.setNotifyUrl(YsConfigV3.AUDIT_NOTIFY_URL_D1);
|
||||
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.sign, (JSONObject) JSON.toJSON(rateInfo));
|
||||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约申请请求失败, {}", respEntity.getSubMsg());
|
||||
RateFeeInfo rateFeeInfo = new RateFeeInfo();
|
||||
rateFeeInfo.setAliPayFee(new RateFeeDetail("0", "0.38", "1"));
|
||||
rateFeeInfo.setWxPayFee(new RateFeeDetail("0", "0.38", "1"));
|
||||
rateFeeInfo.setBank1debitPayFee(new RateFeeDetail("0", "0.61", "1", "999900"));
|
||||
rateFeeInfo.setBank1creditPayFee(new RateFeeDetail("0", "0.61", "1", "999900"));
|
||||
rateFeeInfo.setBank2debitPayFee(new RateFeeDetail("0", "0.60", "1", "999900"));
|
||||
rateFeeInfo.setBank2creditPayFee(new RateFeeDetail("0", "0.60", "1"));
|
||||
rateInfoD1.setCodeScanT1Fee(rateFeeInfo);
|
||||
|
||||
respEntity = ysServiceV3.req(ReqMethod.sign, (JSONObject) JSON.toJSON(rateInfoD1), channel);
|
||||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约申请请求失败, {}", respEntity.getSubMsg());
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject businessData = JSON.parseObject(respEntity.getBusinessData());
|
||||
@@ -242,7 +265,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void callback(JSONObject callback) throws Exception {
|
||||
public void callback(JSONObject callback, Integer channel) throws Exception {
|
||||
// String signContent = SignUtils.getSignContent(callback);
|
||||
// String signStr = callback.getString("sign");
|
||||
// Sign sign = SecureUtil.sign(SignAlgorithm.SHA256withRSA, null, ysConfig.getOldPubKey());
|
||||
@@ -260,7 +283,6 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
// log.info("银盛云商服3.0回调验签失败");
|
||||
// throw new MsgException("银盛云商服3.0回调验签失败");
|
||||
// }
|
||||
|
||||
String bizContent = callback.getString("bizContent");
|
||||
Notify notifyData = JSON.parseObject(bizContent, Notify.class);
|
||||
|
||||
@@ -269,13 +291,13 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
// 资料确认通知
|
||||
Notify.Cust cust = notifyData.getCust();
|
||||
cust.setStatus(notifyData.getStatus());
|
||||
auditResultHandle(cust);
|
||||
auditResultHandle(cust,channel);
|
||||
break;
|
||||
case Notify.TYPE_MERC_SIGN:
|
||||
// 签约变更通知
|
||||
Notify.Auth auth = notifyData.getAuth();
|
||||
auth.setStatus(notifyData.getStatus());
|
||||
signResultHandle(auth);
|
||||
signResultHandle(auth,channel);
|
||||
break;
|
||||
case Notify.TYPE_MERC_CHANGE:
|
||||
// 商户资料变更通知
|
||||
@@ -289,7 +311,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
// 报备通知
|
||||
Notify.Report report = notifyData.getReport();
|
||||
report.setStatus(notifyData.getStatus());
|
||||
collectSubMerId(report);
|
||||
collectSubMerId(report,channel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -299,7 +321,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
|
||||
}
|
||||
|
||||
public void preCheck(String userId) {
|
||||
public void preCheck(String userId, Integer channel) {
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
LambdaQueryWrapper<MerchantChannelStatus> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(MerchantChannelStatus::getMerchantCode, mbi.getMerchantCode());
|
||||
@@ -341,32 +363,32 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
}
|
||||
|
||||
// 此处先将进件状态锁住
|
||||
existD0.setChannel(4);
|
||||
existD0.setChannel(channel);
|
||||
mcsService.saveOrUpdate(existD0);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
||||
public void step1(String userId) {
|
||||
MercInfo mercInfo = combineBaseInfo(userId);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.addCustInfoApply, (JSONObject) JSONObject.toJSON(mercInfo));
|
||||
public void step1(String userId, Integer channel) {
|
||||
MercInfo mercInfo = combineBaseInfo(userId, channel);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.addCustInfoApply, (JSONObject) JSONObject.toJSON(mercInfo), channel);
|
||||
String subCode = req.getSubCode();
|
||||
|
||||
if (!Objects.equals(subCode, YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException(req.getSubMsg());
|
||||
}
|
||||
|
||||
preCheck(userId);
|
||||
preCheck(userId, channel);
|
||||
MerchantChannelStatus mcs = new MerchantChannelStatus();
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
mcs.setMerchantCode(mbi.getMerchantCode());
|
||||
mcs.setChannel(4);
|
||||
mcs.setChannel(channel);
|
||||
mcs = mcsService.getOne(new QueryWrapper<>(mcs));
|
||||
|
||||
if (mcs == null) {
|
||||
mcs = new MerchantChannelStatus();
|
||||
mcs.setMerchantCode(mcs.getMerchantCode());
|
||||
mcs.setChannel(4);
|
||||
mcs.setChannel(channel);
|
||||
}
|
||||
|
||||
JSONObject extra = mcs.getExtra();
|
||||
@@ -382,8 +404,14 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
//upstreamInfoService.save(mbi, legalIdCard, accountDTO.getIdcard(), accountDTO.getBankCard(), 4);
|
||||
}
|
||||
|
||||
private MercInfo combineBaseInfo(String userId) {
|
||||
CombineMercInfo combineMercInfo = mercAuditListener.getMercInfo(userId, Account.CHANNEL_TYPE_D0);
|
||||
private MercInfo combineBaseInfo(String userId, Integer channel) {
|
||||
CombineMercInfo combineMercInfo;
|
||||
if (channel.equals(4)){
|
||||
combineMercInfo = mercAuditListener.getMercInfo(userId, Account.CHANNEL_TYPE_D0);
|
||||
}else {
|
||||
combineMercInfo = mercAuditListener.getMercInfo(userId, Account.CHANNEL_TYPE_D1);
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<MerchantBaseInfo> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(MerchantBaseInfo::getUserId, userId);
|
||||
MerchantBaseInfo mbi = mbiService.getOne(qWrapper);
|
||||
@@ -413,8 +441,14 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
custInfo.setMccCd(mbi.getMcc());
|
||||
custInfo.setContactMail("chaozhanggui2022@163.com");
|
||||
custInfo.setCusMgrNm("蔡祥");
|
||||
custInfo.setNotifyUrl(YsConfigV3.AUDIT_NOTIFY_URL);
|
||||
custInfo.setAgtMercId(ysConfigV3.getAgentNo());
|
||||
//区分D0、D1
|
||||
if (channel.equals(4)) {
|
||||
custInfo.setNotifyUrl(YsConfigV3.AUDIT_NOTIFY_URL);
|
||||
custInfo.setAgtMercId(ysConfigV3.getAgentNo());
|
||||
}else {
|
||||
custInfo.setNotifyUrl(YsConfigV3.AUDIT_NOTIFY_URL_D1);
|
||||
custInfo.setAgtMercId(ysConfigV3.getAgentNoD1());
|
||||
}
|
||||
// custInfo.setRemark("测试商户");
|
||||
|
||||
//法人基本信息
|
||||
@@ -507,12 +541,12 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
* 客户号id custId
|
||||
* 入网状态 status
|
||||
*/
|
||||
public void auditResultHandle(Notify.Cust cust) {
|
||||
public void auditResultHandle(Notify.Cust cust, Integer channel) {
|
||||
String status = cust.getStatus();
|
||||
String sysFlowId = cust.getSysFlowId();
|
||||
MerchantChannelStatus mcs = new MerchantChannelStatus();
|
||||
mcs.setApplicationId(sysFlowId);
|
||||
mcs.setChannel(4);
|
||||
mcs.setChannel(channel);
|
||||
mcs = mcsService.getOne(new QueryWrapper<>(mcs));
|
||||
mcs.setThirdStatus(status);
|
||||
mcs.getExtra().putAll((JSONObject) JSON.toJSON(cust));
|
||||
@@ -521,7 +555,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
case YsConfigV3.STATUS_SUCCESS:
|
||||
mcs.setAuditSuccessTime(new Date());
|
||||
mcsService.updateById(mcs);
|
||||
sign(mcs);
|
||||
sign(mcs,channel);
|
||||
break;
|
||||
case YsConfigV3.STATUS_REFUSE:
|
||||
List<String> excludeStatus = Arrays.asList(MerchantChannelStatus.AUDIT_STATUS_REJECT, MerchantChannelStatus.AUDIT_STATUS_SUCCESS);
|
||||
@@ -549,65 +583,11 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 入网申请流水 lkl
|
||||
* 备注 note
|
||||
* 客户号id custId
|
||||
* 入网状态 status
|
||||
*/
|
||||
public void lklResultHandle(CallBackVo cust) {
|
||||
String status = cust.getStatus();
|
||||
String sysFlowId = cust.getSysFlowId();
|
||||
MerchantChannelStatus mcs = new MerchantChannelStatus();
|
||||
mcs.setApplicationId(sysFlowId);
|
||||
mcs.setChannel(5);
|
||||
mcs = mcsService.getOne(new QueryWrapper<>(mcs));
|
||||
mcs.setThirdStatus(status);
|
||||
mcs.getExtra().putAll((JSONObject) JSON.toJSON(cust));
|
||||
|
||||
switch (status) {
|
||||
case YsConfigV3.STATUS_SUCCESS:
|
||||
mcs.setAuditSuccessTime(new Date());
|
||||
mcsService.updateById(mcs);
|
||||
sign(mcs);
|
||||
break;
|
||||
case YsConfigV3.STATUS_REFUSE:
|
||||
List<String> excludeStatus = Arrays.asList(MerchantChannelStatus.AUDIT_STATUS_REJECT, MerchantChannelStatus.AUDIT_STATUS_SUCCESS);
|
||||
MerchantChannelStatus finalMcs = mcs;
|
||||
boolean returnFlag = excludeStatus.stream().anyMatch(s -> s.equals(finalMcs.getStatus()));
|
||||
if (returnFlag) {
|
||||
return;
|
||||
}
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByMerchantCode(mcs.getMerchantCode());
|
||||
String note = cust.getNote();
|
||||
mcs.setRemark(note);
|
||||
mcs.setStatus(MerchantChannelStatus.AUDIT_STATUS_REJECT);
|
||||
mcsService.updateById(mcs);
|
||||
mercAuditListener.onFail(mbi.getUserId(), mcs, note);
|
||||
break;
|
||||
// case YsConfigV3.STATUS_TO_MANUAL:
|
||||
// List<String> excludeStatus2 = Arrays.asList(MerchantChannelStatus.AUDIT_STATUS_SUCCESS, MerchantChannelStatus.AUDIT_STATUS_ARTIFICIAL_EXAMINING);
|
||||
// MerchantChannelStatus finalMcs2 = mcs;
|
||||
// boolean returnFlag2 = excludeStatus2.stream().anyMatch(s -> s.equals(finalMcs2.getStatus()));
|
||||
// if (returnFlag2) {
|
||||
// return;
|
||||
// }
|
||||
// mcs.setStatus(MerchantChannelStatus.AUDIT_STATUS_ARTIFICIAL_EXAMINING);
|
||||
// mcsService.updateById(mcs);
|
||||
// break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void step2(String userId) {
|
||||
public void step2(String userId, Integer channel) {
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
List<MerchantImage> miList = miService.getListOfMerch(userId, Account.CHANNEL_TYPE_D0);
|
||||
MerchantChannelStatus mcs = new MerchantChannelStatus();
|
||||
mcs.setChannel(4);
|
||||
mcs.setChannel(channel);
|
||||
mcs.setMerchantCode(mbi.getMerchantCode());
|
||||
mcs = mcsService.getOne(new QueryWrapper<>(mcs));
|
||||
|
||||
@@ -619,9 +599,9 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
imageUpload(mi.getPhotoType(), mi.getPicUrl(), mcs.getApplicationId());
|
||||
}
|
||||
}
|
||||
public void step3(String userId) {
|
||||
public void step3(String userId, Integer channel) {
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), channel);
|
||||
|
||||
if (mcs == null) {
|
||||
throw new MsgException("无法确认进件信息");
|
||||
@@ -631,7 +611,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put("auditFlag", "Y");
|
||||
param.put("sysFlowId", mcs.getApplicationId());
|
||||
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.auditCustInfoApply, param);
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.auditCustInfoApply, param, channel);
|
||||
|
||||
JSONObject bizContent = JSON.parseObject(respEntity.getBusinessData());
|
||||
mcs.getExtra().putAll(bizContent);
|
||||
@@ -723,10 +703,10 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
|
||||
return null;
|
||||
}
|
||||
public void signResultHandle(Notify.Auth authData) {
|
||||
public void signResultHandle(Notify.Auth authData, Integer channel) {
|
||||
QueryWrapper<MerchantChannelStatus> qWrapper = Wrappers.query();
|
||||
qWrapper.eq("extra ->> '$.authId'", authData.getAuthId());
|
||||
qWrapper.eq("channel", 4);
|
||||
qWrapper.eq("channel", channel);
|
||||
MerchantChannelStatus mcs = mcsService.getOne(qWrapper);
|
||||
mcs = mcsService.getByIdLock(mcs.getId());
|
||||
|
||||
@@ -837,13 +817,13 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put("option", "ON");
|
||||
param.put("rateFee", "0.38");
|
||||
param.put("rateBottom", "1");
|
||||
ysServiceV3.req(ReqMethod.openOnlinePay, param);
|
||||
ysServiceV3.req(ReqMethod.openOnlinePay, param, mcs.getChannel());
|
||||
} catch (Exception e) {
|
||||
log.error("云商服3.0开通线上D0接口报错: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void collectSubMerId(Notify.Report report) {
|
||||
public void collectSubMerId(Notify.Report report, Integer channel) {
|
||||
List<Notify.ThirdMerc> thridMercList = report.getThridMercList();
|
||||
|
||||
if (thridMercList == null || thridMercList.isEmpty()) {
|
||||
@@ -863,7 +843,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
String reportChannel = item.getReportChannel();
|
||||
|
||||
SubMerchant subMerchant = new SubMerchant();
|
||||
subMerchant.setChannelTypeId("4");
|
||||
subMerchant.setChannelTypeId(String.valueOf(channel));
|
||||
|
||||
String flagName = "";
|
||||
String typeName = "";
|
||||
@@ -916,12 +896,12 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void report(MerchantChannelStatus mcs) {
|
||||
public void report(MerchantChannelStatus mcs, Integer channel) {
|
||||
if (mcs == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mcs.getChannel() != 4) {
|
||||
if (!mcs.getChannel().equals(channel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -964,7 +944,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put(YsConstant.MERC_ID, merchantId);
|
||||
param.put("reportChannel", "NUCC_WECHAT");
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param, Integer.valueOf(merchantId));
|
||||
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("微信网联报备异常," + req.getSubMsg());
|
||||
}
|
||||
@@ -979,7 +959,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put(YsConstant.MERC_ID, merchantId);
|
||||
param.put("reportChannel", "CUPS_WECHAT");
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param, Integer.valueOf(merchantId));
|
||||
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("微信银联报备异常," + req.getSubMsg());
|
||||
}
|
||||
@@ -994,7 +974,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put(YsConstant.MERC_ID, merchantId);
|
||||
param.put("reportChannel", "NUCC_ALIPAY");
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param, Integer.valueOf(merchantId));
|
||||
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("支付宝网联报备异常," + req.getSubMsg());
|
||||
}
|
||||
@@ -1009,18 +989,18 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put(YsConstant.MERC_ID, merchantId);
|
||||
param.put("reportChannel", "CUPS_ALIPAY");
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.sweepReport, param, Integer.valueOf(merchantId));
|
||||
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("支付宝银联报备异常," + req.getSubMsg());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void reportAgain(MerchantChannelStatus mcs){
|
||||
public void reportAgain(MerchantChannelStatus mcs, Integer channel){
|
||||
if (mcs == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mcs.getChannel() != 4) {
|
||||
if (!mcs.getChannel().equals(channel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1064,7 +1044,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put(YsConstant.MERC_ID, merchantId);
|
||||
param.put("reportChannel", "NUCC_WECHAT");
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param, Integer.valueOf(merchantId));
|
||||
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("微信网联报备异常," + req.getSubMsg());
|
||||
}
|
||||
@@ -1140,7 +1120,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put(YsConstant.MERC_ID, merchantId);
|
||||
param.put("reportChannel", "CUPS_WECHAT");
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param, Integer.valueOf(merchantId));
|
||||
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("微信银联报备异常," + req.getSubMsg());
|
||||
}
|
||||
@@ -1155,7 +1135,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put(YsConstant.MERC_ID, merchantId);
|
||||
param.put("reportChannel", "NUCC_ALIPAY");
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param, Integer.valueOf(merchantId));
|
||||
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("支付宝网联报备异常," + req.getSubMsg());
|
||||
}
|
||||
@@ -1170,7 +1150,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
param.put(YsConstant.MERC_ID, merchantId);
|
||||
param.put("reportChannel", "CUPS_ALIPAY");
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.reportAgain, param,Integer.valueOf(merchantId));
|
||||
if (!Objects.equals(req.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("支付宝银联报备异常," + req.getSubMsg());
|
||||
}
|
||||
@@ -1183,7 +1163,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
|
||||
String signId = mcs.getExtra().getString("signId");
|
||||
if (StringUtils.isEmpty(signId)) {
|
||||
sign(mcs);
|
||||
sign(mcs,mcs.getChannel());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1191,7 +1171,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
reqParam.put("signId", signId);
|
||||
reqParam.put("isSendConMsg", "1");
|
||||
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.sendSmsOrEmailMsg, reqParam);
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.sendSmsOrEmailMsg, reqParam,mcs.getChannel());
|
||||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约短信请求失败, " + respEntity.getSubMsg());
|
||||
}
|
||||
@@ -1218,7 +1198,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
* 变更结算卡
|
||||
* 一般不支持非法人结算卡变更
|
||||
*/
|
||||
public void editAccountInfo(BankCardDTO bankCardDTO) {
|
||||
public void editAccountInfo(BankCardDTO bankCardDTO, Integer channel) {
|
||||
// MercChangeRecord entity = mcrService.get(userId, 4, MercChangeRecord.Type.ACCOUNT, MercChangeRecord.Status.EDIT);
|
||||
// if (entity == null) {
|
||||
// throw new MsgException("没有需要变更的信息");
|
||||
@@ -1229,10 +1209,9 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(bankCardDTO.getUserId());
|
||||
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), channel);
|
||||
|
||||
RegionCodeYs ysRegionCode = regionReflectService.getYsRegionCode(bankCardDTO);
|
||||
|
||||
// JSONObject ext = entity.getExt();
|
||||
// String settleType;
|
||||
// if (ext == null) {
|
||||
@@ -1245,11 +1224,19 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
// AccountDTO accountDTO = accountService.getRealAccount(userId, AccountDTO.CHANNEL_TYPE_D0);
|
||||
// idCard = accountDTO.getIdcard();
|
||||
// }
|
||||
Account account = new Account().setUserId(bankCardDTO.getUserId()).setChannelType(Account.CHANNEL_TYPE_D0);
|
||||
account = accountService.getOne(new QueryWrapper<>(account));
|
||||
IdCard accountIdCard = idCardService.getAccountIdCard(bankCardDTO.getUserId(), Account.CHANNEL_TYPE_D0);
|
||||
JSONObject bak = account.getBak();
|
||||
|
||||
Account account = new Account();
|
||||
IdCard accountIdCard;
|
||||
if (4 == channel) {
|
||||
account.setUserId(bankCardDTO.getUserId()).setChannelType(Account.CHANNEL_TYPE_D0);
|
||||
account = accountService.getOne(new QueryWrapper<>(account));
|
||||
accountIdCard = idCardService.getAccountIdCard(bankCardDTO.getUserId(), Account.CHANNEL_TYPE_D0);
|
||||
JSONObject bak = account.getBak();
|
||||
}else {
|
||||
account.setUserId(bankCardDTO.getUserId()).setChannelType(Account.CHANNEL_TYPE_D1);
|
||||
account = accountService.getOne(new QueryWrapper<>(account));
|
||||
accountIdCard = idCardService.getAccountIdCard(bankCardDTO.getUserId(), Account.CHANNEL_TYPE_D1);
|
||||
JSONObject bak = account.getBak();
|
||||
}
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put(YsConstantV3.NOTIFY_URL, YsConfigV3.AUDIT_NOTIFY_URL);
|
||||
@@ -1270,7 +1257,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
|
||||
// String applyImg = entity.getChangeForm();
|
||||
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.changeMercStlAccInfo, param);
|
||||
RespEntity req = ysServiceV3.req(ReqMethod.changeMercStlAccInfo, param, channel);
|
||||
if (!YsConfigV3.BIZ_SUCCESS.equals(req.getSubCode())) {
|
||||
throw new MsgException(req.getSubMsg());
|
||||
}
|
||||
@@ -1702,7 +1689,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
* 查询进件结果
|
||||
* @param mcs
|
||||
*/
|
||||
public void auditResult(MerchantChannelStatus mcs) {
|
||||
public void auditResult(MerchantChannelStatus mcs,Integer channel) {
|
||||
if (mcs == null) {
|
||||
return;
|
||||
}
|
||||
@@ -1717,29 +1704,29 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
return;
|
||||
}
|
||||
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.queryCustApply, new JSONObject().fluentPut("sysFlowId", sysFlowId));
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.queryCustApply, new JSONObject().fluentPut("sysFlowId", sysFlowId),channel);
|
||||
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);
|
||||
auditResultHandle(cust,channel);
|
||||
}
|
||||
|
||||
public void result(String sysFlowId){
|
||||
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());
|
||||
}
|
||||
}
|
||||
// public void result(String sysFlowId){
|
||||
// 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());
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查询签约结果,该操作作为商户最终状态的判断
|
||||
* @param userId 用户id
|
||||
*/
|
||||
public void signResult(String userId) {
|
||||
public void signResult(String userId, Integer channel) {
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(userId);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), channel);
|
||||
if (mcs == null) {
|
||||
return;
|
||||
}
|
||||
@@ -1756,12 +1743,12 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
JSONObject reqParam = new JSONObject();
|
||||
reqParam.put("authId", authId);
|
||||
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.queryAuthInfo, reqParam);
|
||||
RespEntity respEntity = ysServiceV3.req(ReqMethod.queryAuthInfo, reqParam,channel);
|
||||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约状态请求失败, {}", respEntity.getSubMsg());
|
||||
}
|
||||
|
||||
signResultHandle(JSON.parseObject(respEntity.getBusinessData(), Notify.Auth.class));
|
||||
signResultHandle(JSON.parseObject(respEntity.getBusinessData(), Notify.Auth.class),channel);
|
||||
}
|
||||
/**
|
||||
* 查询商户变更结果
|
||||
|
||||
@@ -99,9 +99,12 @@ public interface DeviceStockService extends IService<DeviceStock> {
|
||||
* @param dto
|
||||
*/
|
||||
void bindDevcieV2(DeviceStockDTO dto);
|
||||
void bindTableCode(DeviceStockDTO dto);
|
||||
|
||||
DeviceStock checkBind(String sn);
|
||||
DeviceStock checkSN(String sn);
|
||||
|
||||
DeviceStock getDeviceBySnNo(String sn);
|
||||
|
||||
void checkDevice(String sn);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import cn.pluss.platform.mapper.DeviceTypeMapper;
|
||||
import cn.pluss.platform.merchant.MerchantCashPayCodeService;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantDevice.MerchantDeviceService;
|
||||
import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
@@ -89,6 +90,8 @@ public class DeviceStockServiceImpl extends ServiceImpl<DeviceStockMapper, Devic
|
||||
|
||||
@Resource
|
||||
private MercOrderNewService mercOrderNewService;
|
||||
@Resource
|
||||
private MerchantStoreService merchantStoreService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -390,6 +393,41 @@ public class DeviceStockServiceImpl extends ServiceImpl<DeviceStockMapper, Devic
|
||||
DeviceOperateInfo operateInfo = new DeviceOperateInfo(userApp, DeviceOperateType.BIND.getCode(), stock.getSnNo(), null);
|
||||
deviceOperateInfoService.save(operateInfo);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void bindTableCode(DeviceStockDTO dto){
|
||||
MerchantStore merchantStore = new MerchantStore();
|
||||
merchantStore.setId(Integer.valueOf(dto.getActMercId()));
|
||||
MerchantStore store = merchantStoreService.queryMerchantStore(merchantStore);
|
||||
//认证
|
||||
MsgException.check(store==null,"未找到商户");
|
||||
MerchantBaseInfo merchant = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(store.getMerchantCode());
|
||||
//认证是否为商户
|
||||
MsgException.checkNull(merchant, "当前商户还未认证成商户,暂时无法进行绑定操作");
|
||||
DeviceStock stock = new DeviceStock();
|
||||
stock.setActMercName(merchant.getAlias());
|
||||
stock.setActMercId(String.valueOf(merchant.getId()));
|
||||
stock.setStatus("3");
|
||||
stock.setBindTime(DateUtils.currentDate());
|
||||
UpdateWrapper<DeviceStock> deviceStockUpdateWrapper = new UpdateWrapper<>();
|
||||
deviceStockUpdateWrapper.eq("snNo", dto.getQrNo());
|
||||
update(stock,deviceStockUpdateWrapper);
|
||||
//绑定商户
|
||||
UserApp userApp = new UserApp();
|
||||
userApp.setUserId(Long.valueOf(merchant.getUserId()));
|
||||
DeviceOperateInfo operateInfo = new DeviceOperateInfo(userApp, DeviceOperateType.BIND.getCode(), dto.getQrNo(), null);
|
||||
deviceOperateInfoService.save(operateInfo);
|
||||
}
|
||||
@Override
|
||||
public void checkDevice(String sn){
|
||||
MsgException.checkBlank(sn, "缺失设备SN号");
|
||||
DeviceStock deviceBySnNo = baseMapper.getDeviceBySnNo(sn);
|
||||
if (deviceBySnNo == null){
|
||||
throw new MsgException("未找到对应的二维码");
|
||||
}else if (Objects.equals(deviceBySnNo.getStatus(), "3")){
|
||||
throw new MsgException("该设备已被绑定,请勿重复绑定!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceStock checkBind(String sn) {
|
||||
|
||||
@@ -15,10 +15,7 @@ import cn.pluss.platform.dto.*;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.enums.UserRoleEnum;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.mapper.ActivityEnrollMapper;
|
||||
import cn.pluss.platform.mapper.MerchantBaseInfoMapper;
|
||||
import cn.pluss.platform.mapper.MerchantMarketMapper;
|
||||
import cn.pluss.platform.mapper.MerchantOrderMapper;
|
||||
import cn.pluss.platform.mapper.*;
|
||||
import cn.pluss.platform.merchant.AccountService;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
|
||||
@@ -28,8 +25,10 @@ import cn.pluss.platform.merchantStore.MerchantStoreService;
|
||||
import cn.pluss.platform.region.RegionReflectService;
|
||||
import cn.pluss.platform.roleUserInfo.RoleUserInfoService;
|
||||
import cn.pluss.platform.systemConfig.SystemConfigService;
|
||||
import cn.pluss.platform.task.SxfMerAuditHandler;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.IpUtils;
|
||||
import cn.pluss.platform.util.MD5Util;
|
||||
import cn.pluss.platform.util.RegexUtils;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
@@ -49,10 +48,14 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
@@ -119,7 +122,11 @@ public class MerchantBaseInfoServiceImpl extends ServiceImpl<MerchantBaseInfoMap
|
||||
|
||||
@Autowired
|
||||
private DictService dictService;
|
||||
@Resource
|
||||
private MerchantStoreMapper merchantStoreMapper;
|
||||
|
||||
@Resource
|
||||
private MerchantImageMapper merchantImageMapper;
|
||||
@Override
|
||||
public MerchantBaseInfoVO apiGetMchDetail(String userId) {
|
||||
// 先判断是不是直推或间推
|
||||
@@ -337,10 +344,44 @@ public class MerchantBaseInfoServiceImpl extends ServiceImpl<MerchantBaseInfoMap
|
||||
merchantStore.setStatus("1");
|
||||
merchantStore.setCreateDt(new Date());
|
||||
merchantStoreService.saveMerchantStore(merchantStore);
|
||||
|
||||
} else {
|
||||
merchantStore.setStoreName(mbi.getAlias());
|
||||
merchantStore.setMerchantName(mbi.getAlias());
|
||||
merchantStoreService.updateMerchantStore(merchantStore);
|
||||
|
||||
MerchantChannelStatus merchantChannelStatus = new MerchantChannelStatus();
|
||||
merchantStore = merchantStoreMapper.selectOne(new QueryWrapper<>(merchantStore));
|
||||
MerchantBaseInfo merchantBaseInfo = getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
||||
QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
||||
.eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
||||
MerchantImage merchantImage = merchantImageMapper.selectOne(queryWrapper);
|
||||
//String baseUrl = "https://life.sxczgkj.cn/web/wmerchant.php?c=site&a=entry&ctrl=store&ac=oauth&op=add_merchan&do=web&m=we7_wmall&i=1";
|
||||
String baseUrl = "https://kysh.sxczgkj.cn/javaApi/java-api/add-store";
|
||||
StringBuilder sb = new StringBuilder(baseUrl);
|
||||
sb.append("?title=").append(mbi.getAlias());
|
||||
sb.append("&syb_m_id=").append(merchantStore.getId());
|
||||
sb.append("&addressNo=").append(merchantBaseInfo.getAddressNo());
|
||||
String address = merchantBaseInfo.getProvince() + merchantBaseInfo.getCity() + merchantBaseInfo.getDistrict() + merchantBaseInfo.getAddress();
|
||||
String area = merchantBaseInfo.getProvince() +"-"+ merchantBaseInfo.getCity() +"-"+ merchantBaseInfo.getDistrict();
|
||||
try {
|
||||
String decodeAddress = URLEncoder.encode(address, "UTF-8");
|
||||
sb.append("&address=").append(decodeAddress);
|
||||
String decodeArea = URLEncoder.encode(area, "UTF-8");
|
||||
sb.append("&area=").append(decodeArea);
|
||||
String logo = URLEncoder.encode(merchantImage.getPicUrl(), "GBK");
|
||||
sb.append("&logo=").append(logo);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Map<String, String> lnxMap = IpUtils.getLocationByAddress(address);
|
||||
if (lnxMap != null) {
|
||||
sb.append("&location_x=").append(lnxMap.get("x"));
|
||||
sb.append("&location_y=").append(lnxMap.get("y"));
|
||||
}
|
||||
// 请求生成店铺j
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String result = restTemplate.getForObject(sb.toString(), String.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ public interface MerchantChannelStatusService extends IService<MerchantChannelSt
|
||||
LambdaQueryWrapper<MerchantChannelStatus> qWrapper = Wrappers.lambdaQuery();
|
||||
qWrapper.eq(MerchantChannelStatus::getVirChannelFlag, channelType);
|
||||
qWrapper.eq(MerchantChannelStatus::getMerchantCode, merchantCode);
|
||||
qWrapper.eq(MerchantChannelStatus::getAuthorizationStatus,1);
|
||||
|
||||
return getOne(qWrapper);
|
||||
}
|
||||
|
||||
@@ -737,7 +737,8 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
|
||||
|
||||
return result;
|
||||
}
|
||||
@Resource
|
||||
@Autowired
|
||||
@Lazy
|
||||
LaKalaInterfaceImpl laKalaInterface;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -802,13 +803,13 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
|
||||
case "4":
|
||||
// 银盛
|
||||
//ysAuditServiceV2.merchantAudit(userId, false);
|
||||
ysAuditServiceV3.merchantAuditV3(userId, false);
|
||||
ysAuditServiceV3.merchantAuditV3(userId, false, 4);
|
||||
break;
|
||||
case "5":
|
||||
laKalaInterface.createTuoKeInfo(userId);
|
||||
break;
|
||||
case "6":
|
||||
ysAuditServiceV3.merchantAuditV3(userId, false);
|
||||
ysAuditServiceV3.merchantAuditV3(userId, false, 6);
|
||||
default:
|
||||
MsgException.throwException("未知的进件通道");
|
||||
}
|
||||
|
||||
@@ -34,6 +34,14 @@ public class YsConfigV3 {
|
||||
|
||||
@Value("agentNoV2")
|
||||
private String agentNo;
|
||||
@Value("agentNoD1")
|
||||
private String agentNoD1;
|
||||
@Value("srcMerchantNoD1")
|
||||
private String srcMerchantNoD1;
|
||||
@Value("priKeyV2D1")
|
||||
private String priKeyV2D1;
|
||||
@Value("pubKeyV2D1")
|
||||
private String pubKeyV2D1;
|
||||
|
||||
public static final String INTERFACE_VERSION = "v3";
|
||||
|
||||
@@ -42,6 +50,8 @@ public class YsConfigV3 {
|
||||
public static final String BIZ_SUCCESS = "0000";
|
||||
//银盛进件回调
|
||||
public static final String AUDIT_NOTIFY_URL = "https://ky.sxczgkj.cn/api/auditCallback/ysV3";
|
||||
//银盛进件回调D1
|
||||
public static final String AUDIT_NOTIFY_URL_D1 = "https://ky.sxczgkj.cn/api/auditCallback/ysV3D1";
|
||||
//银盛签约回调
|
||||
public static final String AUDIT_SIGN_NOTIFY_URL = "https://ky.sxczgkj.cn/api/auditCallback/ysSignV3";
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
@@ -46,6 +47,8 @@ public class YsServiceV3 {
|
||||
private YsConfig ysConfig;
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
@Resource
|
||||
private YsConfigV3 ysConfigV3;
|
||||
/**
|
||||
* 只用于新的进件接口
|
||||
*
|
||||
@@ -53,18 +56,28 @@ public class YsServiceV3 {
|
||||
* @param reqData 请求参数
|
||||
* @return
|
||||
*/
|
||||
public RespEntity req(ReqMethod reqMethod, JSONObject reqData) {
|
||||
public RespEntity req(ReqMethod reqMethod, JSONObject reqData, Integer channel) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int i = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
|
||||
if (i < 8 || i >= 21) {
|
||||
throw new MsgException("当前时段暂不支持入网,请于8:00-21:00提交");
|
||||
}
|
||||
|
||||
String key = RandomUtil.randomString(RandomUtil.BASE_NUMBER + "ABCDEF",16);
|
||||
try {
|
||||
ReqEntity request = ReqEntity.get(reqMethod);
|
||||
request.setCertId(ysConfig.getSrcMerchantNo());
|
||||
|
||||
Sign sign = null;
|
||||
if (channel.equals(4)) {
|
||||
request.setCertId(ysConfig.getSrcMerchantNo());
|
||||
RSA rsa = SecureUtil.rsa(ysConfig.getPriKey(), ysConfig.getOldPubKey());
|
||||
request.setCheck(rsa.encryptBase64(key, KeyType.PublicKey));
|
||||
sign = SecureUtil.sign(SignAlgorithm.SHA256withRSA, ysConfig.getPriKey(), ysConfig.getOldPubKey());
|
||||
}else {
|
||||
request.setCertId(ysConfigV3.getSrcMerchantNoD1());
|
||||
RSA rsa = SecureUtil.rsa(ysConfigV3.getPriKeyV2D1(), ysConfigV3.getPubKeyV2D1());
|
||||
request.setCheck(rsa.encryptBase64(key, KeyType.PublicKey));
|
||||
sign = SecureUtil.sign(SignAlgorithm.SHA256withRSA, ysConfigV3.getPriKeyV2D1(), ysConfigV3.getPubKeyV2D1());
|
||||
}
|
||||
request.setBizContent(reqData.toJSONString());
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
||||
@@ -72,17 +85,14 @@ public class YsServiceV3 {
|
||||
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36");
|
||||
|
||||
log.info("业务参数==============>" + JSONObject.toJSONString(reqData));
|
||||
String key = RandomUtil.randomString(RandomUtil.BASE_NUMBER + "ABCDEF",16);
|
||||
|
||||
log.info("key = " + key);
|
||||
AES aes = new AES(key.getBytes(StandardCharsets.UTF_8));
|
||||
String s = aes.encryptBase64(request.getBizContent());
|
||||
request.setBizContent(s);
|
||||
|
||||
RSA rsa = SecureUtil.rsa(ysConfig.getPriKey(), ysConfig.getOldPubKey());
|
||||
request.setCheck(rsa.encryptBase64(key, KeyType.PublicKey));
|
||||
|
||||
String encryptOriginData = SignUtils.getSignContent((JSONObject) JSON.toJSON(request));
|
||||
Sign sign = SecureUtil.sign(SignAlgorithm.SHA256withRSA, ysConfig.getPriKey(), ysConfig.getOldPubKey());
|
||||
|
||||
log.info("加签源数据==============>" + encryptOriginData);
|
||||
request.setSign(Base64.encode(sign.sign(encryptOriginData)));
|
||||
log.warn("请求报文==============>" + JSONObject.toJSONString(request));
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.pluss.platform.ys.impl.v20220527.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@Data
|
||||
public class RateInfoD1 {
|
||||
private String busOpenType;
|
||||
|
||||
private String contractType;
|
||||
|
||||
private String isSendConMsg;
|
||||
|
||||
private String notifyUrl;
|
||||
|
||||
private RateFeeInfo codeScanT1Fee;
|
||||
|
||||
private String custId;
|
||||
}
|
||||
Reference in New Issue
Block a user