Merge remote-tracking branch 'origin/master'

This commit is contained in:
hankaikai 2023-05-23 09:39:29 +08:00
commit 374396284d
35 changed files with 578 additions and 149 deletions

View File

@ -75,6 +75,9 @@ public class PushController {
String uid = userApp.getUserId().toString();
String cid = param.get("cid").toString();
if (cid.isEmpty()){
return ResultGenerator.genSuccessResult();
}
String deviceType = httpServletRequest.getHeader("type");
@ -142,6 +145,9 @@ public class PushController {
String uid = userApp.getUserId().toString();
String cid = param.get("cid").toString();
if (cid.isEmpty()){
return ResultGenerator.genSuccessResult();
}
String deviceType = httpServletRequest.getHeader("type");
String token = "";

View File

@ -229,6 +229,17 @@ public class UserInfoController {
return ResultGenerator.genSuccessResult();
}
/**
* 新版登录
* @param userInfo
* @return
*/
@PostMapping("/login")
public Result<Map<String, Object>> detail(@RequestBody UserInfo userInfo) {
Map<String, Object> login = userInfoNewService.login(userInfo.getLoginName(), userInfo.getPassword());
return ResultGenerator.genSuccessResult(login);
}
@GetMapping("/{loginName}/{password}")
@ApiOperation(tags = {"页面-登录", "页面-切换商户"}, value = "登录", notes = "登录接口", httpMethod = "GET")
@ApiImplicitParams({
@ -265,6 +276,19 @@ public class UserInfoController {
return ResultGenerator.genSuccessResult("保存安全密码成功", null);
}
@PostMapping("/checkPayPassword")
public Result<Object> checkPayPassword(@RequestBody UserInfo userInfo){
if (userInfo.getId() == null){
return ResultGenerator.genFailResult("无ID");
}
UserInfo payPassword = userInfoNewService.queryUserInfo(userInfo);
if (payPassword.getPayPassword() == null){
return ResultGenerator.genSuccessResult("无支付密码","0");
}else {
return ResultGenerator.genSuccessResult("ok","1");
}
}
@PostMapping("/verifyPayPassword")
public Result<Object> verifyPayPassword(@RequestBody Map<String, Object> param) {
String payPassword = param.get("payPassword").toString();

View File

@ -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;
}
}

View File

@ -3,6 +3,7 @@ package cn.pluss.platform.controller.store;
import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.device.MercOrderDetailService;
import cn.pluss.platform.device.MercOrderExpressService;
import cn.pluss.platform.dto.MercOrderDetailDTO;
import cn.pluss.platform.entity.MercOrderDetail;
import cn.pluss.platform.vo.MercOrderExpressVO;
@ -26,6 +27,8 @@ public class MercOrderDetailController {
@Resource
private MercOrderDetailService modService;
@Resource
private MercOrderExpressService mercOrderExpressService;
/**
* 订单分页查询接口
@ -114,6 +117,18 @@ public class MercOrderDetailController {
String msg = express == null ? "暂无物流信息" : "获取成功";
return ResultGenerator.genSuccessResult(msg,express);
}
/**
* 查看物流信息快递鸟
*/
@GetMapping("/logistic")
public Result<Object> logistic(@RequestParam String expressNo)throws Exception{
JSONObject expressInfo = mercOrderExpressService.getExpressInfo(expressNo);
if (expressInfo.isEmpty()){
return ResultGenerator.genFailResult("无法查询快递信息");
}else {
return ResultGenerator.genSuccessResult(expressInfo);
}
}
/**
* 申请退款

View File

@ -66,6 +66,7 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
limitUri.add("/api/deviceGoods/deviceDetail/");
limitUri.add("/api/questionsAnswers");
limitUri.add("/api/helpVideo");
limitUri.add("/api/systemConfig/updateSystemVersion");
boolean passFlag = limitUri.stream().anyMatch(s -> s.equals(requestUri) || requestUri.startsWith(s));
if (passFlag) {
return true;
@ -88,7 +89,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;
}

View File

@ -1,14 +1,14 @@
spring:
datasource:
url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: CZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
# datasource:
# url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
# username: root
# password: prodCZGmysqlroot@123
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
# username: root
# password: CZGmysqlroot@123
# driver-class-name: com.mysql.jdbc.Driver
datasource:
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
parameter:
### 这个根据自己的情况配置
domain: https://ky.sxczgkj.cn

View File

@ -1,10 +1,14 @@
spring:
# datasource:
# url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
# username: root
# password: prodCZGmysqlroot@123
# driver-class-name: com.mysql.jdbc.Driver
datasource:
url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
parameter:
### 这个根据自己的情况配置
domain: https://ky.sxczgkj.cn

View File

@ -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;
/**
* 商户号
*/
@ -265,6 +276,14 @@ public class ParameterConfig {
@Value("${parameter.SJ_APPSECRET}")
public String SJ_APPSECRET;
/**
* 快递相关快递鸟
*/
@Value("${express.USERID}")
public String USERID;
@Value("${express.APIKEY}")
public String APIKEY;
@PostConstruct
public void init() {
ParametersUtil.upload_save_path = upload_save_path;
@ -276,6 +295,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;
@ -309,6 +330,8 @@ public class ParameterConfig {
ParametersUtil.LESHUA_API=LESHUA_API;
ParametersUtil.SJ_APPID = SJ_APPID;
ParametersUtil.SJ_APPSECRET = SJ_APPSECRET;
ParametersUtil.USERID = USERID;
ParametersUtil.APIKEY = APIKEY;
SxfConfg.init(sxfDomain, publicKey, orgId);

View File

@ -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 = "PpidsIbMSs7EQddDMHAh81";
public String getToken() throws IOException, NoSuchAlgorithmException {

View File

@ -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;
/**
*商户号
*/
@ -190,5 +199,11 @@ public class ParametersUtil {
* @date: 2021/9/23 10:27
*/
public static String SJ_APPSECRET;
/**
* 快递相关快递鸟
*/
public static String USERID;
public static String APIKEY;
}

View File

@ -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;
}
}

View File

@ -103,8 +103,11 @@ parameter:
APPLETS_APPID: wxc2bb94c0ddda1032
#小程序密钥
APPLETS_SECRET: 625cbce8772629312e42e8278a8d6889
APPSECRET: 4e00bbf3fc75a1ff68ce866fd13f2bcc
APPSECRET: 8492a7e8d55bbb1b57f5c8276ea1add0
# b84ee0efaa0d9a649746ac65525f8e10
#IOS端公众号
APPID_IOS: wx212769170d2c6b2a
APP_SECRET_IOS: 8492a7e8d55bbb1b57f5c8276ea1add0
KEY: 微信原生加密用的KEY
LESHUALIU: 乐刷、未接入可不管
LESHUA_API:
@ -153,3 +156,11 @@ sxf:
getui:
domain: https://restapi.getui.com/v2/${getui.appId}
appId: jzSkfM0Wsk8uSDL2zwGu07
#快递(快递鸟)
express:
USERID: 1778214
APIKEY: 63e75d64-e8fd-4dcc-93fa-17dc710cdf04

View File

@ -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

View File

@ -1,16 +1,16 @@
spring:
datasource:
druid:
url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&noAccessToProcedureBodies=true&allowMultiQueries=true
username: root
password: CZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
# datasource:
# druid:
# url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
# url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&noAccessToProcedureBodies=true&allowMultiQueries=true
# username: root
# password: prodCZGmysqlroot@123
# password: CZGmysqlroot@123
# driver-class-name: com.mysql.jdbc.Driver
datasource:
druid:
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
logging:
config: classpath:log4j2-dev.xml

View File

@ -1,10 +1,16 @@
spring:
# datasource:
# druid:
# url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&noAccessToProcedureBodies=true&allowMultiQueries=true
# username: root
# password: prodCZGmysqlroot@123
# driver-class-name: com.mysql.jdbc.Driver
datasource:
druid:
url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&noAccessToProcedureBodies=true&allowMultiQueries=true
username: root
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
scheduling:
enabled: true

View File

@ -44,7 +44,8 @@
<option value="3" <c:if test="${agreement.discern == 3}">selected</c:if>>隐私协议</option>
<option value="5" <c:if test="${agreement.discern == 5}">selected</c:if>>应用权限说明</option>
<option value="6" <c:if test="${agreement.discern == 6}">selected</c:if>>第三方SDK说明</option>
</select>
<option value="7" <c:if test="${agreement.discern == 7}">selected</c:if>>会员协议</option>
</select>
</div>
</div>
</div>

View File

@ -88,6 +88,7 @@ public class MerChantOrderDTO {
private MerchantMemberCode mercMenberCode;
private String MercOrderNo;
/**
* 参数转换

View File

@ -225,6 +225,8 @@ public class MerchantOrder {
*/
private BigDecimal mercFee;
private String thirdSendNo;
/**
* 节约金额
*/

View File

@ -13,8 +13,9 @@ import lombok.Getter;
@AllArgsConstructor
public enum LogisticProvider {
YTO("YTO","圆通快递");
YTO("YTO","圆通快递"),
STO("STO", "申通快递"),
HTKY("HTKY", "百世快递");
private String code;
private String desc;

View File

@ -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

View File

@ -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("请正确输入相关信息");
}

View File

@ -1,6 +1,7 @@
package cn.pluss.platform.device;
import cn.pluss.platform.entity.MercOrderExpress;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
public interface MercOrderExpressService extends IService<MercOrderExpress> {
@ -8,4 +9,6 @@ public interface MercOrderExpressService extends IService<MercOrderExpress> {
MercOrderExpress getByLogistNo(String logistNo);
MercOrderExpress getByExpressNo(String expressNo);
JSONObject getExpressInfo(String expressNo) throws Exception;
}

View File

@ -2,14 +2,26 @@ package cn.pluss.platform.device.impl;
import cn.pluss.platform.device.MercOrderExpressService;
import cn.pluss.platform.entity.MercOrderExpress;
import cn.pluss.platform.enums.LogisticProvider;
import cn.pluss.platform.exception.MsgException;
import cn.pluss.platform.mapper.MercOrderExpressMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.pluss.platform.util.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@Service
public class MercOrderExpressServiceImpl extends ServiceImpl<MercOrderExpressMapper, MercOrderExpress> implements MercOrderExpressService {
public static final String CHECK_Express = "https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx";
/**
* 根据上送物流单号查询商户单号
* @param logistNo
@ -24,4 +36,57 @@ public class MercOrderExpressServiceImpl extends ServiceImpl<MercOrderExpressMap
public MercOrderExpress getByExpressNo(String expressNo) {
return baseMapper.getByExpressNo(expressNo);
}
@Override
public JSONObject getExpressInfo(String expressNo) throws Exception {
if (expressNo.isEmpty()){
throw new MsgException("暂无相应的快递单号");
}
JSONObject reqData = new JSONObject();
String subThree = expressNo.substring(0, 3);
if ("268".equals(subThree) || "368".equals(subThree) || "468".equals(subThree)|| "334".equals(subThree)
|| "888".equals(subThree) || "77".equals(expressNo.substring(0,2))){
reqData.put("ShipperCode", LogisticProvider.STO.getCode());
} else if ("YT".equals(expressNo.substring(0,2))){
reqData.put("ShipperCode", LogisticProvider.YTO.getCode());
} else if ("55".equals(expressNo.substring(0,2))){
reqData.put("ShipperCode", LogisticProvider.HTKY.getCode());
}else {
return new JSONObject();
}
reqData.put("LogisticCode", expressNo);
JSONObject jsonObject = reqJsonData(reqData);
if (!(Boolean) jsonObject.get("Success")){
log.info("快递查询错误===========>",jsonObject.get("Reason"));
throw new MsgException("快递查询失败");
}
return jsonObject;
}
public JSONObject reqJsonData(JSONObject requestData)throws Exception{
Map<String, Object> hashMap = new HashMap<>(16);
hashMap.put("RequestData", requestData);
hashMap.put("EBusinessID", ParametersUtil.USERID);
hashMap.put("RequestType", "1002");
hashMap.put("DataSign", dataSign(requestData));
hashMap.put("DataType", "2");
HttpResult httpResult = HttpUtil.doPost(CHECK_Express, hashMap);
JSONObject jsonObject = JSON.parseObject(httpResult.getBody());
return jsonObject;
}
private String dataSign(JSONObject requestData)throws Exception{
String sign = requestData.toString()+ParametersUtil.APIKEY;
//首先再进行MD5
String lowerMD5 = MD5Util.md5(sign).toLowerCase();
//然后再进行Base64
final byte[] lowerMD5Bytes = lowerMD5.getBytes(StandardCharsets.UTF_8);
String base64= Base64.getEncoder().encodeToString(lowerMD5Bytes);
//再进行base64URL编码
return URLEncoder.encode(base64, "UTF-8");
}
}

View File

@ -101,4 +101,6 @@ public interface DeviceStockService extends IService<DeviceStock> {
void bindDevcieV2(DeviceStockDTO dto);
DeviceStock checkBind(String sn);
DeviceStock getDeviceBySnNo(String sn);
}

View File

@ -399,6 +399,14 @@ public class DeviceStockServiceImpl extends ServiceImpl<DeviceStockMapper, Devic
return deviceBySnNo;
}
@Override
public DeviceStock getDeviceBySnNo(String sn) {
MsgException.checkBlank(sn,"缺失设备SN号");
DeviceStock deviceBySnNo = baseMapper.getDeviceBySnNo(sn);
MsgException.checkBlank(deviceBySnNo.getActMercId(),"未绑定扫码pos");
return deviceBySnNo;
}
@Override
public <E extends IPage<DeviceStock>> E page(E page, Wrapper<DeviceStock> queryWrapper) {
DeviceStock deviceStock = queryWrapper.getEntity();

View File

@ -7,6 +7,7 @@ import cn.pluss.platform.entity.*;
import cn.pluss.platform.exception.MsgException;
import cn.pluss.platform.mapper.MerchantMenberMapper;
import cn.pluss.platform.mapper.PhoneValidateCodeMapper;
import cn.pluss.platform.merchant.MerchantBaseInfoService;
import cn.pluss.platform.merchantMenber.MerchantMenberService;
import cn.pluss.platform.merchantStore.MerchantStoreService;
import cn.pluss.platform.userApp.UserAppService;
@ -51,6 +52,8 @@ public class MerchantMenberServiceImpl extends ServiceImpl<MerchantMenberMapper,
@Resource
private WxCommonService wxCommonService;
@Resource
private MerchantBaseInfoService merchantBaseInfoService;
private final String default_avatar = "https://syb-resource.oss-cn-hangzhou.aliyuncs.com/微信图片_20210408103257.png?versionId=CAEQKxiBgMCllMC9xRciIDMyZDA3Y2IzNGU5YjQ5ODk5NTlhOGI5MWJjZGNhNTYw";
@ -366,10 +369,12 @@ public class MerchantMenberServiceImpl extends ServiceImpl<MerchantMenberMapper,
@Override
public void sendMenberBalanceChangeNotice(MerchantMenber menber, Double amt, String type) {
MerchantStore store = merchantStoreService.getStoreByMerchantCode(menber.getMerchantCode());
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
merchantBaseInfo = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(menber.getMerchantCode());
if(store != null && StringUtil.isNotEmpty(menber.getOpenid())){
JSONObject miniprogram = new JSONObject();
miniprogram.put("appid", ParametersUtil.APPLETS_APPID);
miniprogram.put("pagepath","yb_o2ov2/vip/my-vip?storeId="+store.getId()+"&phone="+menber.getPhone());
miniprogram.put("pagepath","yb_o2ov2/vip/order_record?syb_m_id="+merchantBaseInfo.getId()+"&phone="+menber.getPhone()+"&memberCode"+menber.getMemberCode());
String first = "您的【"+store.getStoreName()+"】会员卡:"+menber.getCardNo()+"资金有变动啦,请注意查收!";
String remark = "如对此会员卡余额变动有疑问,可以点此进入小程序中查看!";

View File

@ -123,7 +123,7 @@ public class RyxPayServiceimpl implements RyxPayService {
if(!RyxConfig.PAY_SUCCESS_CODE.equals(respCode)){
result.put("code",ResultCode.FAIL.code());
if(respMsg.contains("商户需补齐相关资料")){
result.put("msg","D1次日到账商户未在快银收银APP-商户认证-微信认证内完成授权,暂时无法微信收款");
result.put("msg","D0实时到账商户未在快银收银APP-商户认证-微信认证(支付宝认证)内完成授权,暂时无法收款");
}
return result;
}

View File

@ -160,7 +160,7 @@ public class SxfPayServiceImpl implements SxfPayService {
if (respData.get("bizMsg").toString().contains("使用微信支付")) {
result.put("msg", "云闪付/京东支付失败:同一支付通道下一张身份证最多注册一个小微商户");
} else if (respData.get("bizMsg").toString().contains("商户需补齐相关资料") || respData.get("bizMsg").toString().contains("微信实名认证")) {
result.put("msg", "D1次日到账商户未在快银收银APP-商户认证-微信认证内完成授权,暂时无法微信收款");
result.put("msg", "D0实时到账商户未在快银收银APP-商户认证-微信认证(支付宝认证)内完成授权,暂时无法收款");
} else {
result.put("msg", respData.get("bizMsg"));
}

View File

@ -86,7 +86,7 @@ public interface WxCommonService {
* @param request:
* @return com.alibaba.fastjson.JSONObject
*/
JSONObject getJsApiConfigParam(HttpServletRequest request);
JSONObject getJsApiConfigParam(String request);
/**
* 获取小程序 scheme

View File

@ -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 + "&timestamp="+ 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);

View File

@ -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");

View File

@ -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;

View File

@ -208,7 +208,7 @@ public class YsPayOldServiceImpl extends YsPayServiceImpl{
String sub_code = respData.getString("sub_code");
String sub_msg = respData.getString("sub_msg");
if("4335".equals(sub_code) && StringUtil.isNotEmpty(sub_msg) && sub_msg.contains("商户需补齐相关资料")){
MsgException.throwException("D0实时到账商户未在快银收银APP-商户认证-微信认证内完成授权,暂时无法收款");
MsgException.throwException("D0实时到账商户未在快银收银APP-商户认证-微信认证(支付宝认证)内完成授权,暂时无法收款");
}else if("4335".equals(sub_code) && StringUtil.isNotEmpty(sub_msg) && sub_msg.contains("金额超限")){
MsgException.throwException("单笔交易金额超限");
}else{

View File

@ -407,20 +407,21 @@ public class WechantController {
}
merchantMenberService.updateMerchantMenber(merchantMenber);
try {
MerchantStore store = merchantStoreService.getStoreByMerchantCode(merchantMenber.getMerchantCode());
// MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
// merchantBaseInfo = merchantBaseInfoService.queryMerchantBaseInfo(queryMerchantBaseInfo);
// MerchantStore store = merchantStoreService.getStoreByMerchantCode(merchantMenber.getMerchantCode());
MerchantBaseInfo merchantBaseInfo = new MerchantBaseInfo();
merchantBaseInfo = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(merchantMenber.getMerchantCode());
JSONObject miniprogram = new JSONObject();
miniprogram.put("appid",ParametersUtil.APPLETS_APPID);
miniprogram.put("pagepath","yb_o2ov2/vip/my-vip?syb_m_id="+store.getId()+"&phone="+merchantMenber.getPhone());
miniprogram.put("pagepath","yb_o2ov2/vip/my-vip?syb_m_id="+merchantBaseInfo.getId()+"&phone="+merchantMenber.getPhone()+
"&memberCode"+merchantMenber.getMemberCode());
String first = "恭喜您成为本店会员,祝你生活愉快!";
String remark = "如对此卡有疑问或查询会员更多优惠信息,可以点此进入小程序中查看!";
double usableRechargeFee = merchantMenber.getUsableRechargeFee() == null ? 0 : StringUtil.bigDecimal(merchantMenber.getUsableRechargeFee());
double usableGiveFee = merchantMenber.getUsableGiveFee() == null ? 0 : StringUtil.bigDecimal(merchantMenber.getUsableGiveFee());
String useFee = BigDecimal.valueOf(usableRechargeFee + usableGiveFee).setScale(2,BigDecimal.ROUND_HALF_DOWN).toString();
String[] array = {store.getStoreName(), merchantMenber.getMemberName(), merchantMenber.getPhone(), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())};
String[] array = {merchantBaseInfo.getAlias(), merchantMenber.getMemberName(), merchantMenber.getPhone(), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())};
//TODO 后面小程序同步后加miniprogram
WxTemolateRequest tempRequest = new WxTemolateRequest(openId,WxConstants.VIP_CARD_SUCCESS_TEMPLATE_ID,null, null)
WxTemolateRequest tempRequest = new WxTemolateRequest(openId,WxConstants.VIP_CARD_SUCCESS_TEMPLATE_ID,null, miniprogram)
.buildData(first,remark,array);
//发送开卡成功消息模板
wxCommonService.sendTemplateMsg(tempRequest,tokenRequest);

View File

@ -1,7 +1,7 @@
spring:
datasource:
druid:
url: jdbc:mysql://rm-bp19ib8x213kh9t45.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver