IOS端公众号app相关,更改401错误码message,更改getAccessToken方法,银盛部分相关,四要素新增错误码
This commit is contained in:
@@ -1,15 +1,30 @@
|
||||
package cn.pluss.platform.controller.merchant;
|
||||
|
||||
import cn.pluss.platform.channel.ys.impl.YSAuditServiceV3;
|
||||
import cn.pluss.platform.entity.SubMerchantApplyOrder;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.mapper.SubMerchantApplyOrderMapper;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.wx.WxCommonService;
|
||||
import cn.pluss.platform.ys.impl.v20220527.ReqMethod;
|
||||
import cn.pluss.platform.ys.impl.v20220527.YsServiceV3;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.pluss.platform.util.WechatSignUtil.*;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@@ -17,6 +32,15 @@ import java.io.IOException;
|
||||
public class WxController {
|
||||
|
||||
private final SubMerchantApplyOrderMapper subMerchantApplyOrderMapper;
|
||||
@Resource
|
||||
private MerchantBaseInfoService merchantBaseInfoService;
|
||||
@Resource
|
||||
private YsServiceV3 ysServiceV3;
|
||||
@Resource
|
||||
private YSAuditServiceV3 ysAuditServiceV3;
|
||||
@Resource
|
||||
private WxCommonService wxCommonService;
|
||||
|
||||
|
||||
/**
|
||||
* 跳转到微信商户认证图片
|
||||
@@ -68,4 +92,134 @@ public class WxController {
|
||||
response.setHeader("content-type", "text/html;charset=UTF-8");
|
||||
response.getWriter().write("<img src='" + subMerchantApplyOrder.getInfoQrcode() + "' />");
|
||||
}
|
||||
// @PostMapping("/authorisation")
|
||||
// public void authorisation(){
|
||||
//// MerchantBaseInfo merchantBaseInfoByUserId = merchantBaseInfoService.getMerchantBaseInfoByUserId(userId);
|
||||
// JSONObject bizContentMap = new JSONObject();
|
||||
//// Map<String,Object> bizContentMap = new HashMap<>();
|
||||
// //交易报备渠道编号 CUPS_WECHAT-银联微信;CUPS_ALIPAY-银联支付宝;NUCC_WECHAT-网联微信;NUCC_ALIPAY-网联支付宝
|
||||
// bizContentMap.put("channelCode","CUPS_WECHAT");
|
||||
// //商户号
|
||||
// bizContentMap.put("mercId","QRY230510383416");
|
||||
// //商户信息-营业执照营业执照复印件(盖公章)
|
||||
// bizContentMap.put("linencePhoto","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/7228fde116c14c6380fce592c97e8998.png?Expires=1998984528&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=klQgxxm4MgTR1JuJTLW5NZJ9C%2BE%3D");
|
||||
// //商户信息-法人身份证复印件(盖私章,签字)/原件扫描件
|
||||
// bizContentMap.put("indentityPhoto","");
|
||||
// //商户信息-服务协议复印件(盖公章)/原件扫描件
|
||||
// bizContentMap.put("protocolPhoto","");
|
||||
// //商户信息-组织机构代码证(盖公章)/原件扫描件
|
||||
// bizContentMap.put("cocc","");
|
||||
// //商户信息-法人身份证正面照
|
||||
// bizContentMap.put("sfzFrontPhoto","");
|
||||
// //商户信息-法人身份证反面照
|
||||
// bizContentMap.put("sfzBackPhoto","");
|
||||
// //商户信息法人身份证号码
|
||||
// bizContentMap.put("idcarNo","");
|
||||
// //商户信息-银盛商户类型
|
||||
// bizContentMap.put("mccSubCd","5814");
|
||||
// //业务类型0-微信 1-支付宝
|
||||
// bizContentMap.put("busiType","0");
|
||||
// //商户信息-商户简称
|
||||
// bizContentMap.put("mercShortName","会飞的土豆");
|
||||
// //商户信息-商户归属省
|
||||
// bizContentMap.put("mercProv","7900");
|
||||
// //商户信息-商户归属市
|
||||
// bizContentMap.put("mercCity","7910");
|
||||
// //商户信息-商户归属区
|
||||
// bizContentMap.put("mercArea","8081");
|
||||
// //商户信息-营业地址(联系地址)
|
||||
// bizContentMap.put("busAddr","荣民国际");
|
||||
// //商户信息-联系人姓名
|
||||
// bizContentMap.put("contactsName","李雯");
|
||||
// //商户信息-联系人手机号
|
||||
// bizContentMap.put("contactsTel","18710449883");
|
||||
// //商户信息-联系人邮箱
|
||||
// bizContentMap.put("contactsEmail","1657953836@qq.com");
|
||||
// //商户信息-法人姓名
|
||||
// bizContentMap.put("crpNm","李雯");
|
||||
// //商户信息-法人证件号
|
||||
// bizContentMap.put("certNo","610323199812250941");
|
||||
// //商户信息-代理商名称
|
||||
// bizContentMap.put("agentName","陕西超掌柜科技有限公司");
|
||||
// //商户信息-代理商编号
|
||||
// bizContentMap.put("agtMercId","801521000002WJW");
|
||||
// //商户信息-开户行行别
|
||||
// bizContentMap.put("bankType","1051000");
|
||||
// //商户信息-开户行名称
|
||||
// bizContentMap.put("bankName","中国建设银行陕西省分行");
|
||||
// //商户信息-账户类型
|
||||
// bizContentMap.put("accountType","11");
|
||||
// //商户信息-账户名称
|
||||
// bizContentMap.put("accountName","李雯");
|
||||
// //商户信息-账户账号
|
||||
// bizContentMap.put("accountNo","QRY230510383416");
|
||||
// //商户信息-客户号
|
||||
// bizContentMap.put("custId","2023051028630896");
|
||||
// //商户信息-报备行业类型
|
||||
// bizContentMap.put("mchType","139");
|
||||
// bizContentMap.put("mercName","");
|
||||
// bizContentMap.put("reportName","");
|
||||
// //商户信息-商户类别 0或null:普通企业商户,1:小微商户,2:个体商户,3:事业单位,4:社会组织(原其他组织), 5:政府机关
|
||||
// bizContentMap.put("mercType","1");
|
||||
// bizContentMap.put("certType","");
|
||||
// bizContentMap.put("pId","");
|
||||
// bizContentMap.put("shopPhoto","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/f2804e6991474b4691bda17d8a644f41.png?Expires=1998984700&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=aW28so6wOxOfdJpU7sgA4gr1%2FeE%3D");
|
||||
// bizContentMap.put("storeEnvirPhoto","https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/a71a293015d44006b7db02a911f54775.png?Expires=1998984731&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=lkhJ%2F0Rg2%2BA9fd1fQId382g0CO8%3D");
|
||||
// bizContentMap.put("idImgHand", "https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/7228fde116c14c6380fce592c97e8998.png?Expires=1998984528&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=klQgxxm4MgTR1JuJTLW5NZJ9C%2BE%3D");
|
||||
// bizContentMap.put("bankCardImg","");
|
||||
// bizContentMap.put("bdShopPhoto","");
|
||||
// bizContentMap.put("bdPosterPhoto","");
|
||||
// bizContentMap.put("wxPlatform","");
|
||||
// bizContentMap.put("idValidDateBegin","");
|
||||
// bizContentMap.put("idValidDateEnd","");
|
||||
// bizContentMap.put("busLincenceBegin","");
|
||||
// bizContentMap.put("busLincenceEnd","");
|
||||
// bizContentMap.put("managementType","");
|
||||
// bizContentMap.put("storeName","");
|
||||
// bizContentMap.put("wechatCheckStandPhoto","");
|
||||
// bizContentMap.put("alipayCheckStandPhoto","");
|
||||
// bizContentMap.put("aliPayStoreCashierPhoto","");
|
||||
// bizContentMap.put("bookType","");
|
||||
// bizContentMap.put("unitPhoto","");
|
||||
// bizContentMap.put("hotLine","");
|
||||
// //商户信息-证照类型 0:营业执照;1:事业单位法人证书;2:小微商户负责人身份证;3:社会信用等级证书
|
||||
// bizContentMap.put("businessLicenseType","2");
|
||||
// //商户信息-证件编号
|
||||
// bizContentMap.put("businessLicense","610323199812250941");
|
||||
// bizContentMap.put("appletAppId","wxc2bb94c0ddda1032");
|
||||
// bizContentMap.put("appId1","");
|
||||
// bizContentMap.put("appId2","");
|
||||
// bizContentMap.put("appId3","");
|
||||
// bizContentMap.put("appId4","");
|
||||
// bizContentMap.put("applyServices","01;02");
|
||||
// bizContentMap.put("picType","2");
|
||||
// //商户信息-商户归属机构
|
||||
// bizContentMap.put("orgNo","3520000064");
|
||||
// ysServiceV3.req(ReqMethod.Reporting, bizContentMap);
|
||||
// }
|
||||
//
|
||||
@PostMapping("/appIdAddOrUpdate")
|
||||
public void appIdAddOrUpdate(){
|
||||
JSONObject bizContentMap = new JSONObject();
|
||||
bizContentMap.put("channelId", "CUPS_WECHAT");
|
||||
bizContentMap.put("mercId", "QRY230511483159");
|
||||
bizContentMap.put("appletId", "wxc2bb94c0ddda1032");
|
||||
ysServiceV3.req(ReqMethod.appIdAddOrUpdate, bizContentMap);
|
||||
}
|
||||
|
||||
@PostMapping("/auditResult")
|
||||
public void test(String sysFlowId){
|
||||
ysAuditServiceV3.result(sysFlowId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公众号权限
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/permissions")
|
||||
public JSONObject appletPermissions(@RequestBody JSONObject url){
|
||||
JSONObject jsApiConfigParam = wxCommonService.getJsApiConfigParam(url.getString("url"));
|
||||
return jsApiConfigParam;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
if (StringUtils.isEmpty(myLoginName) || StringUtils.isEmpty(requestToken)) {
|
||||
Result<Object> result = new Result<>();
|
||||
result.setCode(ResultCode.NOT_TOKEN).setMessage("非法请求");
|
||||
result.setCode(ResultCode.NOT_TOKEN).setMessage("请先登录");
|
||||
ComUtil.responseResult(response, result);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -96,6 +96,17 @@ public class ParameterConfig {
|
||||
*/
|
||||
@Value("${parameter.APPSECRET}")
|
||||
public String APPSECRET;
|
||||
|
||||
/**
|
||||
* IOS公众号ID
|
||||
*/
|
||||
@Value("${parameter.APPID_IOS}")
|
||||
public String APPID_IOS;
|
||||
/**
|
||||
* IOS公众号密钥
|
||||
*/
|
||||
@Value("${parameter.APP_SECRET_IOS}")
|
||||
public String APP_SECRET_IOS;
|
||||
/**
|
||||
* 商户号
|
||||
*/
|
||||
@@ -276,6 +287,8 @@ public class ParameterConfig {
|
||||
ParametersUtil.APPLETS_APPID = APPLETS_APPID;
|
||||
ParametersUtil.APPLETS_SECRET = APPLETS_SECRET;
|
||||
ParametersUtil.APPSECRET = APPSECRET;
|
||||
ParametersUtil.APPID_IOS = APPID_IOS;
|
||||
ParametersUtil.APP_SECRET_IOS = APP_SECRET_IOS;
|
||||
ParametersUtil.PID = PID;
|
||||
ParametersUtil.KEY = KEY;
|
||||
ParametersUtil.wechatCallback = wechatCallback;
|
||||
|
||||
@@ -37,9 +37,9 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class MobV2PushUtilIOS {
|
||||
|
||||
public static final String appKey = "lLZ0nPNJZ29CcEgkzxTkj7";
|
||||
public static final String appId = "uygciF2fKU8KYGAuLghjQ7";
|
||||
public static final String masterSecret = "T2xS8yXA6SAVg1Ns8wYdZ";
|
||||
public static final String appKey = "QwyHsKpc0I9BQMk9Xysx74";
|
||||
public static final String appId = "yuBG87yWEt6SXrwBSSvjy1 ";
|
||||
public static final String masterSecret = "QwyHsKpc0I9BQMk9Xysx74";
|
||||
|
||||
public String getToken() throws IOException, NoSuchAlgorithmException {
|
||||
|
||||
|
||||
@@ -53,6 +53,15 @@ public class ParametersUtil {
|
||||
* AppSecret
|
||||
*/
|
||||
public static String APPSECRET;
|
||||
/**
|
||||
* IOS公众号ID
|
||||
*/
|
||||
public static String APPID_IOS;
|
||||
/**
|
||||
* IOS公众号密钥
|
||||
*/
|
||||
public static String APP_SECRET_IOS;
|
||||
|
||||
/**
|
||||
*商户号
|
||||
*/
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
package cn.pluss.platform.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public class WechatSignUtil {
|
||||
|
||||
|
||||
@@ -95,4 +89,30 @@ public class WechatSignUtil {
|
||||
signParam.append("&key=").append(payKey);
|
||||
return signParam.toString();
|
||||
}
|
||||
/**
|
||||
* 加密模式
|
||||
* @return
|
||||
*/
|
||||
public static String createNonceStr() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
* @return
|
||||
*/
|
||||
public static String createTimestamp() {
|
||||
return Long.toString(System.currentTimeMillis() / 1000);
|
||||
}
|
||||
public static String byteToHex(final byte[] hash) {
|
||||
Formatter formatter = new Formatter();
|
||||
for (byte b : hash)
|
||||
{
|
||||
formatter.format("%02x", b);
|
||||
}
|
||||
String result = formatter.toString();
|
||||
formatter.close();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -105,6 +105,9 @@ parameter:
|
||||
APPLETS_SECRET: 625cbce8772629312e42e8278a8d6889
|
||||
APPSECRET: 4e00bbf3fc75a1ff68ce866fd13f2bcc
|
||||
# b84ee0efaa0d9a649746ac65525f8e10
|
||||
#IOS端公众号
|
||||
APPID_IOS: wx212769170d2c6b2a
|
||||
APP_SECRET_IOS: 8492a7e8d55bbb1b57f5c8276ea1add0
|
||||
KEY: 微信原生加密用的KEY
|
||||
LESHUALIU: 乐刷、未接入可不管
|
||||
LESHUA_API:
|
||||
|
||||
@@ -10,7 +10,7 @@ ys:
|
||||
## 其他网关接口
|
||||
otherDomain: https://commonapi.ysepay.com/gateway.do
|
||||
## 代理商编号
|
||||
agentNo:
|
||||
agentNo: 801521000002WJW
|
||||
## 交易发起方编号 武汉融商创银科技有限公司
|
||||
srcMerchantNo: 826521773920170
|
||||
|
||||
@@ -49,7 +49,7 @@ ys-extension:
|
||||
## 机构号ID
|
||||
src:
|
||||
## 代理商编号
|
||||
agentNoV2:
|
||||
agentNoV2: 801521000002WJW
|
||||
## 进件私钥v2
|
||||
priKeyV2:
|
||||
## 进件公钥v2
|
||||
|
||||
@@ -8,6 +8,7 @@ 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.dto.BankCardDTO;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.mapper.AccountMapper;
|
||||
@@ -114,6 +115,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
private SxfMerAuditHandler sxfMerAuditHandler;
|
||||
@Autowired
|
||||
private SubMerchantService smService;
|
||||
@Resource
|
||||
private SxfMerAuditHandler handler;
|
||||
// @Autowired
|
||||
// private MercChangeRecordService mcrService;
|
||||
|
||||
@@ -696,9 +699,18 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
}
|
||||
mcsService.updateById(mcs);
|
||||
openOnlinePay(mcs);
|
||||
|
||||
mercAuditListener.onSuccess(mbi.getUserId(), mcs);
|
||||
//暂时用手动进件
|
||||
// mercAuditListener.onSuccess(mbi.getUserId(), mcs);
|
||||
//向小程序里加入商家
|
||||
handler.createStore(mcs);
|
||||
// //银盛再次报备
|
||||
// JSONObject bizContentMap = new JSONObject();
|
||||
// bizContentMap.put("channelId", "CUPS_WECHAT");
|
||||
// bizContentMap.put("mercId", mercId);
|
||||
// bizContentMap.put("appletId", "wxc2bb94c0ddda1032");
|
||||
// ysServiceV3.req(ReqMethod.appIdAddOrUpdate, bizContentMap);
|
||||
break;
|
||||
//TODO 失败和错误时没有处理
|
||||
case YsConfigV3.STATUS_REFUSE:
|
||||
case YsConfigV3.STATUS_SIGN_REFUSE:
|
||||
List<String> excludeStatus = Arrays.asList(MerchantChannelStatus.AUDIT_STATUS_REJECT, MerchantChannelStatus.AUDIT_STATUS_SUCCESS);
|
||||
@@ -1152,21 +1164,21 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
* 变更结算卡
|
||||
* 一般不支持非法人结算卡变更
|
||||
*/
|
||||
// public void editAccountInfo(String userId) {
|
||||
public void editAccountInfo(BankCardDTO bankCardDTO) {
|
||||
// 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);
|
||||
//
|
||||
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByUserId(bankCardDTO.getUserId());
|
||||
|
||||
MerchantChannelStatus mcs = mcsService.getByMerchantCode(mbi.getMerchantCode(), 4);
|
||||
|
||||
RegionCodeYs ysRegionCode = regionReflectService.getYsRegionCode(bankCardDTO);
|
||||
|
||||
// JSONObject ext = entity.getExt();
|
||||
// String settleType;
|
||||
// if (ext == null) {
|
||||
@@ -1179,53 +1191,58 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
// 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());
|
||||
//
|
||||
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();
|
||||
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put(YsConstantV3.NOTIFY_URL, YsConfigV3.AUDIT_NOTIFY_URL);
|
||||
StlAccInfo stlAccInfo = new StlAccInfo();
|
||||
stlAccInfo.setIsSettInPlatAcc("N");
|
||||
stlAccInfo.setIsUncrpSett(account.getSettleType().startsWith(Account.SETTLE_TYPE_PRIVATE_ILLEGAL) ? "Y" : "N");
|
||||
stlAccInfo.setStlAccNo(bankCardDTO.getBankCardNo());
|
||||
stlAccInfo.setStlAccType(account.getSettleType().startsWith(Account.SETTLE_TYPE_CORPORATE) ? "21" : "11");
|
||||
stlAccInfo.setOpenCertNo(accountIdCard.getCertNo());
|
||||
stlAccInfo.setStlAccNm(bankCardDTO.getBankHolder());
|
||||
stlAccInfo.setBankSubCode(bankCardDTO.getContactLine());
|
||||
stlAccInfo.setBankMobile(bankCardDTO.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");
|
||||
//
|
||||
|
||||
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);
|
||||
// }
|
||||
//
|
||||
// // 申请表
|
||||
|
||||
if (bankCardDTO.getAccountType().equals(BankCard.ACCOUNT_TYPE_CORPORATE)) {
|
||||
// 对公结算需要上传开户许可证
|
||||
imageEditUpload(MerchantImage.ImageType.ACCOUNT_PERMITS, bankCardDTO.getLicenseUrl(), changeSysFlowId);
|
||||
} else {
|
||||
// 对私结算需要上传银行卡图片
|
||||
imageEditUpload(MerchantImage.ImageType.BANK_CARD_FRONT, bankCardDTO.getImgUrl(), changeSysFlowId);
|
||||
}
|
||||
|
||||
// 非法人结算,传结算人的身份证图片
|
||||
if (Objects.equals(account.getSettleType(), Account.SETTLE_TYPE_PRIVATE_ILLEGAL)) {
|
||||
imageEditUpload(MerchantImage.ImageType.SETTLE_IDCARD_FRONT, accountIdCard.getImgPositive(), changeSysFlowId);
|
||||
imageEditUpload(MerchantImage.ImageType.SETTLE_IDCARD_BACK, accountIdCard.getImgNegative(), changeSysFlowId);
|
||||
}
|
||||
|
||||
// 申请表
|
||||
// imageEditUpload(MerchantImage.ImageType.CHANGE_FORM, applyImg, changeSysFlowId);
|
||||
//
|
||||
// log.debug("云商服3.0基本信息变更发起成功");
|
||||
@@ -1237,7 +1254,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
//
|
||||
// noticeService.saveSysNotice(userId, title, remark);
|
||||
// generalPushUtil.sendAllPlatByAlias(Collections.singletonList(userId), title, remark, "1");
|
||||
// }
|
||||
}
|
||||
/**
|
||||
* 变更基本信息
|
||||
*/
|
||||
@@ -1654,6 +1671,14 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
||||
Notify.Cust cust = JSON.parseObject(respEntity.getBusinessData(), Notify.Cust.class);
|
||||
auditResultHandle(cust);
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -285,7 +285,7 @@ public class AliyunServiceImpl implements AliyunService {
|
||||
if ("403".equals(verifyBankElementResponse.getBody().getCode())){
|
||||
throw new MsgException("24小时内重复查询相同信息超过10次,已锁定,请在12小时后重试。");
|
||||
}
|
||||
if ("428".equals(verifyBankElementResponse.getBody().getCode())){
|
||||
if ("428".equals(verifyBankElementResponse.getBody().getCode()) || "437".equals(verifyBankElementResponse.getBody().getCode())){
|
||||
throw new MsgException("请正确输入相关信息");
|
||||
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public interface WxCommonService {
|
||||
* @param request:
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
*/
|
||||
JSONObject getJsApiConfigParam(HttpServletRequest request);
|
||||
JSONObject getJsApiConfigParam(String request);
|
||||
|
||||
/**
|
||||
* 获取小程序 scheme 码
|
||||
|
||||
@@ -17,6 +17,12 @@ import org.springframework.web.client.RestTemplate;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import static cn.pluss.platform.util.WechatSignUtil.byteToHex;
|
||||
|
||||
/**
|
||||
*
|
||||
*@description:
|
||||
@@ -46,46 +52,46 @@ public class WxCommonServiceImpl implements WxCommonService {
|
||||
public String getAccessToken(WxAccessTokenRequest request,Boolean refresh) {
|
||||
checkCommonParams(request);
|
||||
String keyCode = WX_ACCESS_TOKEN_PREFIX_CODE + request.getAppid();
|
||||
String url = API_TOKEN_URL.replace("KEY",request.getAppid()).replace("CODE",WX_ACCESS_TOKEN_PREFIX_CODE).replace("REFRESH",refresh ? "1" : "0");
|
||||
JSONObject result = restTemplate.getForObject(url, JSONObject.class);
|
||||
if(result.getInteger("code") != ResultCode.SUCCESS.code()){
|
||||
CacheInfo cache = cacheInfoService.getCacheInfoByKeyCode(keyCode);
|
||||
if(cache == null){
|
||||
//String url = API_TOKEN_URL.replace("KEY",request.getAppid()).replace("CODE",WX_ACCESS_TOKEN_PREFIX_CODE).replace("REFRESH",refresh ? "1" : "0");
|
||||
//JSONObject result = restTemplate.getForObject(url, JSONObject.class);
|
||||
// if(result.getInteger("code") != ResultCode.SUCCESS.code()){
|
||||
CacheInfo cache = cacheInfoService.getCacheInfoByKeyCode(keyCode);
|
||||
if(cache == null){
|
||||
WxAccessTokenResponse response = WechatUtils.getAccessToken(request);
|
||||
CacheInfo cacheInfo = new CacheInfo(response,request,keyCode);
|
||||
cacheInfoService.save(cacheInfo);
|
||||
return response.getAccess_token();
|
||||
}else{
|
||||
Long time = System.currentTimeMillis() / 1000;
|
||||
if(time >= cache.getExpiresIn() - CacheInfo.MAX_CRITICAL_VALUE){
|
||||
WxAccessTokenResponse response = WechatUtils.getAccessToken(request);
|
||||
CacheInfo cacheInfo = new CacheInfo(response,request,keyCode);
|
||||
cacheInfoService.save(cacheInfo);
|
||||
cacheInfo.setId(cache.getId());
|
||||
cacheInfoService.saveOrUpdate(cacheInfo);
|
||||
return response.getAccess_token();
|
||||
}else{
|
||||
Long time = System.currentTimeMillis() / 1000;
|
||||
if(time >= cache.getExpiresIn() - CacheInfo.MAX_CRITICAL_VALUE){
|
||||
WxAccessTokenResponse response = WechatUtils.getAccessToken(request);
|
||||
CacheInfo cacheInfo = new CacheInfo(response,request,keyCode);
|
||||
cacheInfo.setId(cache.getId());
|
||||
cacheInfoService.saveOrUpdate(cacheInfo);
|
||||
return response.getAccess_token();
|
||||
}else{
|
||||
return cache.getAccessToken();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
CacheInfo cache = cacheInfoService.getCacheInfoByKeyCode(keyCode);
|
||||
JSONObject data = result.getJSONObject("data");
|
||||
if(cache == null){
|
||||
CacheInfo cacheInfo = new CacheInfo(request,keyCode,data.getString("accessToken"),data.getLong("expire"),data.getString("refreshToken"));
|
||||
cacheInfoService.save(cacheInfo);
|
||||
return data.getString("accessToken");
|
||||
}else{
|
||||
if(!cache.getAccessToken().equals(data.getString("accessToken"))){
|
||||
cache.setAccessToken(data.getString("accessToken"));
|
||||
cache.setExpiresIn(data.getLong("expire"));
|
||||
if(StringUtil.isNotEmpty(data.getString("refreshToken"))){
|
||||
cache.setRefreshToken(data.getString("refreshToken"));
|
||||
}
|
||||
cacheInfoService.saveOrUpdate(cache);
|
||||
}
|
||||
return data.getString("accessToken");
|
||||
return cache.getAccessToken();
|
||||
}
|
||||
}
|
||||
// }else{
|
||||
// CacheInfo cache = cacheInfoService.getCacheInfoByKeyCode(keyCode);
|
||||
// JSONObject data = result.getJSONObject("data");
|
||||
// if(cache == null){
|
||||
// CacheInfo cacheInfo = new CacheInfo(request,keyCode,data.getString("accessToken"),data.getLong("expire"),data.getString("refreshToken"));
|
||||
// cacheInfoService.save(cacheInfo);
|
||||
// return data.getString("accessToken");
|
||||
// }else{
|
||||
// if(!cache.getAccessToken().equals(data.getString("accessToken"))){
|
||||
// cache.setAccessToken(data.getString("accessToken"));
|
||||
// cache.setExpiresIn(data.getLong("expire"));
|
||||
// if(StringUtil.isNotEmpty(data.getString("refreshToken"))){
|
||||
// cache.setRefreshToken(data.getString("refreshToken"));
|
||||
// }
|
||||
// cacheInfoService.saveOrUpdate(cache);
|
||||
// }
|
||||
// return data.getString("accessToken");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,15 +235,37 @@ public class WxCommonServiceImpl implements WxCommonService {
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
*/
|
||||
@Override
|
||||
public JSONObject getJsApiConfigParam(HttpServletRequest request) {
|
||||
public JSONObject getJsApiConfigParam(String request) {
|
||||
JSONObject result = new JSONObject(4);
|
||||
WxAccessTokenRequest req = WxAccessTokenRequest.buidWxToken(ParametersUtil.APPID,ParametersUtil.APPSECRET);
|
||||
WxAccessTokenRequest req = WxAccessTokenRequest.buidWxToken(ParametersUtil.APPID_IOS,ParametersUtil.APP_SECRET_IOS);
|
||||
String ticket = this.getJsapiTicket(req, "jsapi");
|
||||
String noncestr = StringUtil.generateMixStr(10);
|
||||
Long timestamp = System.currentTimeMillis() / 1000;
|
||||
String pUrl = request.getRequestURL().toString() + "?" + request.getQueryString();
|
||||
// String pUrl = request.getRequestURL().toString() + "?" + request.getQueryString();
|
||||
String pUrl = request;
|
||||
System.out.println(pUrl);
|
||||
String signContent = "jsapi_ticket=" + ticket + "&noncestr="+noncestr + "×tamp="+ timestamp + "&url="+pUrl;
|
||||
String sign = SignUtils.sha1Encrypt(signContent);
|
||||
String signature = "";
|
||||
try
|
||||
{
|
||||
MessageDigest crypt = MessageDigest.getInstance("SHA-1");
|
||||
crypt.reset();
|
||||
crypt.update(signContent.getBytes("UTF-8"));
|
||||
signature = byteToHex(crypt.digest());
|
||||
}
|
||||
catch (NoSuchAlgorithmException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println(sign);
|
||||
System.out.println(signature);
|
||||
|
||||
result.put("signature",sign);
|
||||
result.put("nonceStr",noncestr);
|
||||
result.put("timestamp",timestamp);
|
||||
|
||||
@@ -250,7 +250,7 @@ public class YsCertServiceImpl implements MerchantCertService {
|
||||
|
||||
MerchantBaseInfo mbi = mbiService.getMerchantBaseInfoByMerchantCode(mcs.getMerchantCode());
|
||||
|
||||
String pushMsg = "您好!您的商户微信认证因“##”被驳回,请联系收银呗客服修改资料并重新审核";
|
||||
String pushMsg = "您好!您的商户微信认证因“##”被驳回,请联系快银收银客服修改资料并重新审核";
|
||||
pushMsg = pushMsg.replace("##", wxCertResult.getString("reject_reason"));
|
||||
generalPushUtil.sendAllPlatByAlias(Collections.singletonList(mbi.getUserId()), "商户微信认证通知", pushMsg, "1");
|
||||
|
||||
|
||||
@@ -29,6 +29,14 @@ public enum ReqMethod {
|
||||
* 支付宝实名认证状态查询
|
||||
*/
|
||||
aliAuthStatus(Req.Url.PREFIX + "pregate/alipay/getAuthState"),
|
||||
/**
|
||||
* 新增报备
|
||||
*/
|
||||
Reporting(Req.Url.PREFIX+"report/scan/union/reportAdd"),
|
||||
/**
|
||||
* 新增/修改appid
|
||||
*/
|
||||
appIdAddOrUpdate(Req.Url.PREFIX+"report/scan/union/appIdAddOrUpdate")
|
||||
;
|
||||
|
||||
private final String url;
|
||||
|
||||
Reference in New Issue
Block a user