updates
This commit is contained in:
parent
774d539630
commit
9001d70b6d
|
|
@ -28,7 +28,7 @@ import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.exception.JeecgBootException;
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.util.AssertUtils;
|
import org.jeecg.common.util.AssertUtils;
|
||||||
import org.jeecg.common.util.RedisUtil;
|
import org.jeecg.modules.mini.douyin.config.DouYinConfig;
|
||||||
import org.jeecg.modules.mini.douyin.model.DouYinOrderSyncModel;
|
import org.jeecg.modules.mini.douyin.model.DouYinOrderSyncModel;
|
||||||
import org.jeecg.modules.mini.douyin.model.ItemStruct;
|
import org.jeecg.modules.mini.douyin.model.ItemStruct;
|
||||||
import org.jeecg.modules.mini.douyin.util.DouWayPaymentMethod;
|
import org.jeecg.modules.mini.douyin.util.DouWayPaymentMethod;
|
||||||
|
|
@ -36,6 +36,7 @@ import org.jeecg.modules.mini.douyin.util.DouYinUtil;
|
||||||
import org.jeecg.modules.mini.douyin.util.Sign;
|
import org.jeecg.modules.mini.douyin.util.Sign;
|
||||||
import org.jeecg.modules.mini.dto.VipDTO;
|
import org.jeecg.modules.mini.dto.VipDTO;
|
||||||
import org.jeecg.modules.mini.service.MiniUserService;
|
import org.jeecg.modules.mini.service.MiniUserService;
|
||||||
|
import org.jeecg.modules.mini.wx.config.WeXinConfig;
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
import org.jeecg.modules.system.service.ISysUserService;
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
import org.jeecg.modules.system.util.OrderNumberGenerator;
|
import org.jeecg.modules.system.util.OrderNumberGenerator;
|
||||||
|
|
@ -53,7 +54,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -79,58 +79,9 @@ public class MiniPayApiController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private MiniUserService miniUserService;
|
private MiniUserService miniUserService;
|
||||||
@Resource
|
@Resource
|
||||||
private RedisUtil redisUtil;
|
private DouYinConfig douYinConfig;
|
||||||
@Value("${dy.appId}")
|
@Resource
|
||||||
String douyinAppId;
|
private WeXinConfig weXinConfig;
|
||||||
@Value("${dy.appSecret}")
|
|
||||||
String douyinSecret;
|
|
||||||
@Value("${dy.token}")
|
|
||||||
String douyinToken;
|
|
||||||
@Value("${dy.notifyUrl}")
|
|
||||||
String douyinNotifyUrl;
|
|
||||||
@Value("${dy.salt}")
|
|
||||||
String douyinSalt;
|
|
||||||
/**
|
|
||||||
* 微信小程序appid
|
|
||||||
**/
|
|
||||||
@Value("${wx.appId}")
|
|
||||||
String appid;
|
|
||||||
/**
|
|
||||||
* 微信小程序secretId
|
|
||||||
**/
|
|
||||||
@Value("${wx.appSecret}")
|
|
||||||
String secret;
|
|
||||||
/**
|
|
||||||
* 商户号
|
|
||||||
**/
|
|
||||||
@Value("${wx.mchid}")
|
|
||||||
String mchid;
|
|
||||||
/**
|
|
||||||
* 商户密钥
|
|
||||||
**/
|
|
||||||
@Value("${wx.mchKey}")
|
|
||||||
String mchKey;
|
|
||||||
/**
|
|
||||||
* 回调地址
|
|
||||||
**/
|
|
||||||
@Value("${wx.notifyUrl}")
|
|
||||||
String notifyUrl;
|
|
||||||
/**
|
|
||||||
* 证书地址
|
|
||||||
**/
|
|
||||||
@Value("${wx.certPath}")
|
|
||||||
String certPath;
|
|
||||||
/**
|
|
||||||
* 证书密钥地址
|
|
||||||
**/
|
|
||||||
@Value("${wx.certKeyPath}")
|
|
||||||
String certKeyPath;
|
|
||||||
/**
|
|
||||||
* 微信平台证书
|
|
||||||
**/
|
|
||||||
@Value("${wx.platFormPath}")
|
|
||||||
String platFormPath;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小程序支付
|
* 小程序支付
|
||||||
|
|
@ -183,21 +134,21 @@ public class MiniPayApiController {
|
||||||
//判断是抖音平台 还是 微信平台 小程序操作
|
//判断是抖音平台 还是 微信平台 小程序操作
|
||||||
if ("toutiao".equals(provider)) {
|
if ("toutiao".equals(provider)) {
|
||||||
//抖音
|
//抖音
|
||||||
String douyinSign = DouYinUtil.main(douyinAppId, douyinToken, douyinNotifyUrl, douyinSalt, orderCode, totalAmount.intValue(),yxVipSku.getSkuName(), description);
|
String douyinSign = DouYinUtil.main(douYinConfig.getAppId(), douYinConfig.getToken(),douYinConfig.getNotifyUrl(), douYinConfig.getSalt(), orderCode, totalAmount.intValue(),yxVipSku.getSkuName(), description);
|
||||||
yxOrder.setOrderSign(douyinSign);
|
yxOrder.setOrderSign(douyinSign);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
String timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
|
String timeExpire = DateTimeZoneUtil.dateToTimeZone(System.currentTimeMillis() + 1000 * 60 * 3);
|
||||||
UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
|
UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
|
||||||
// APPID
|
// APPID
|
||||||
.setAppid(appid)
|
.setAppid(weXinConfig.getAppId())
|
||||||
// 商户号
|
// 商户号
|
||||||
.setMchid(mchid)
|
.setMchid(weXinConfig.getMchId())
|
||||||
.setDescription(description)
|
.setDescription(description)
|
||||||
.setOut_trade_no(orderCode)
|
.setOut_trade_no(orderCode)
|
||||||
.setTime_expire(timeExpire)
|
.setTime_expire(timeExpire)
|
||||||
.setAttach("艺体志愿宝"+yxVipSku.getSkuName())
|
.setAttach("艺体志愿宝"+yxVipSku.getSkuName())
|
||||||
.setNotify_url(notifyUrl)
|
.setNotify_url(weXinConfig.getNotifyUrl())
|
||||||
.setAmount(new Amount().setTotal(totalAmount.intValue()))
|
.setAmount(new Amount().setTotal(totalAmount.intValue()))
|
||||||
.setPayer(new Payer().setOpenid(openId));
|
.setPayer(new Payer().setOpenid(openId));
|
||||||
log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
|
log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
|
||||||
|
|
@ -205,21 +156,21 @@ public class MiniPayApiController {
|
||||||
RequestMethodEnum.POST,
|
RequestMethodEnum.POST,
|
||||||
WxDomainEnum.CHINA.toString(),
|
WxDomainEnum.CHINA.toString(),
|
||||||
BasePayApiEnum.JS_API_PAY.toString(),
|
BasePayApiEnum.JS_API_PAY.toString(),
|
||||||
mchid,
|
weXinConfig.getMchId(),
|
||||||
getSerialNumber(),
|
getSerialNumber(),
|
||||||
null,
|
null,
|
||||||
certKeyPath,
|
weXinConfig.getCertKeyPath(),
|
||||||
JSONUtil.toJsonStr(unifiedOrderModel)
|
JSONUtil.toJsonStr(unifiedOrderModel)
|
||||||
);
|
);
|
||||||
log.info("统一下单响应 {}", response);
|
log.info("统一下单响应 {}", response);
|
||||||
// 根据证书序列号查询对应的证书来验证签名结果
|
// 根据证书序列号查询对应的证书来验证签名结果
|
||||||
boolean verifySignature = WxPayKit.verifySignature(response, platFormPath);
|
boolean verifySignature = WxPayKit.verifySignature(response, weXinConfig.getPlatFormPath());
|
||||||
log.info("verifySignature: {}", verifySignature);
|
log.info("verifySignature: {}", verifySignature);
|
||||||
if (response.getStatus() == HttpStatus.HTTP_OK && verifySignature) {
|
if (response.getStatus() == HttpStatus.HTTP_OK && verifySignature) {
|
||||||
String body = response.getBody();
|
String body = response.getBody();
|
||||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||||
String prepayId = jsonObject.getString("prepay_id");
|
String prepayId = jsonObject.getString("prepay_id");
|
||||||
Map<String, String> map = WxPayKit.jsApiCreateSign(appid, prepayId, certKeyPath);
|
Map<String, String> map = WxPayKit.jsApiCreateSign(weXinConfig.getAppId(), prepayId, weXinConfig.getCertKeyPath());
|
||||||
log.info("唤起支付参数:{}", map);
|
log.info("唤起支付参数:{}", map);
|
||||||
String jsonStr = JSONUtil.toJsonStr(map);
|
String jsonStr = JSONUtil.toJsonStr(map);
|
||||||
//==============创建订单信息 Start
|
//==============创建订单信息 Start
|
||||||
|
|
@ -259,7 +210,7 @@ public class MiniPayApiController {
|
||||||
log.info("支付通知密文 {}", result);
|
log.info("支付通知密文 {}", result);
|
||||||
// 需要通过证书序列号查找对应的证书,verifyNotify 中有验证证书的序列号
|
// 需要通过证书序列号查找对应的证书,verifyNotify 中有验证证书的序列号
|
||||||
String plainText = WxPayKit.verifyNotify(serialNo, result, signature, nonce, timestamp,
|
String plainText = WxPayKit.verifyNotify(serialNo, result, signature, nonce, timestamp,
|
||||||
mchKey, platFormPath);
|
weXinConfig.getMchKey(), weXinConfig.getPlatFormPath());
|
||||||
log.info("支付通知明文 {}", plainText);
|
log.info("支付通知明文 {}", plainText);
|
||||||
if (StrUtil.isNotEmpty(plainText)) {
|
if (StrUtil.isNotEmpty(plainText)) {
|
||||||
com.alibaba.fastjson.JSONObject plainTextJson = JSONObject.parseObject(plainText);
|
com.alibaba.fastjson.JSONObject plainTextJson = JSONObject.parseObject(plainText);
|
||||||
|
|
@ -291,7 +242,7 @@ public class MiniPayApiController {
|
||||||
//生成本地签名
|
//生成本地签名
|
||||||
List<String> sortedString = new ArrayList<>();
|
List<String> sortedString = new ArrayList<>();
|
||||||
//token
|
//token
|
||||||
sortedString.add(douyinToken);
|
sortedString.add(douYinConfig.getToken());
|
||||||
//时间戳
|
//时间戳
|
||||||
sortedString.add(requestJson.getString("timestamp"));
|
sortedString.add(requestJson.getString("timestamp"));
|
||||||
//随机数
|
//随机数
|
||||||
|
|
@ -339,7 +290,7 @@ public class MiniPayApiController {
|
||||||
}
|
}
|
||||||
itemList.add(new ItemStruct(yxOrder.getSkuCode(),img,"艺体志愿宝-"+yxOrder.getSkuName(),null,1,yxOrder.getTotalAmount().longValue()));
|
itemList.add(new ItemStruct(yxOrder.getSkuCode(),img,"艺体志愿宝-"+yxOrder.getSkuName(),null,1,yxOrder.getTotalAmount().longValue()));
|
||||||
douYinOrderSyncModel.setItem_list(itemList);
|
douYinOrderSyncModel.setItem_list(itemList);
|
||||||
DouYinUtil.orderSync(douYinOrderSyncModel,douyinAppId,douyinSecret,sysUser.getDyOpenId());
|
DouYinUtil.orderSync(douYinOrderSyncModel,douYinConfig.getAppId(),douYinConfig.getAppSecret(),sysUser.getDyOpenId());
|
||||||
response.setStatus(200);
|
response.setStatus(200);
|
||||||
map.put("code", "SUCCESS");
|
map.put("code", "SUCCESS");
|
||||||
map.put("message", "SUCCESS");
|
map.put("message", "SUCCESS");
|
||||||
|
|
@ -378,7 +329,7 @@ public class MiniPayApiController {
|
||||||
// 验证签名一致性
|
// 验证签名一致性
|
||||||
List<String> sortedString = new ArrayList<>();
|
List<String> sortedString = new ArrayList<>();
|
||||||
//token
|
//token
|
||||||
sortedString.add(douyinToken);
|
sortedString.add(douYinConfig.getToken());
|
||||||
//时间戳
|
//时间戳
|
||||||
sortedString.add(requestJson.getStr("timestamp"));
|
sortedString.add(requestJson.getStr("timestamp"));
|
||||||
//随机数
|
//随机数
|
||||||
|
|
@ -427,11 +378,11 @@ public class MiniPayApiController {
|
||||||
|
|
||||||
private String getSerialNumber() {
|
private String getSerialNumber() {
|
||||||
// 获取证书序列号
|
// 获取证书序列号
|
||||||
X509Certificate certificate = PayKit.getCertificate(certPath);
|
X509Certificate certificate = PayKit.getCertificate(weXinConfig.getCertPath());
|
||||||
if (null != certificate) {
|
if (null != certificate) {
|
||||||
String serialNo = certificate.getSerialNumber().toString(16).toUpperCase();
|
String serialNo = certificate.getSerialNumber().toString(16).toUpperCase();
|
||||||
// 提前两天检查证书是否有效
|
// 提前两天检查证书是否有效
|
||||||
boolean isValid = PayKit.checkCertificateIsValid(certificate, mchid, -2);
|
boolean isValid = PayKit.checkCertificateIsValid(certificate, weXinConfig.getMchId(), -2);
|
||||||
log.info("证书是否可用 {} 证书有效期为 {}", isValid, DateUtil.format(certificate.getNotAfter(), DatePattern.NORM_DATETIME_PATTERN));
|
log.info("证书是否可用 {} 证书有效期为 {}", isValid, DateUtil.format(certificate.getNotAfter(), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
System.out.println("serialNo:" + serialNo);
|
System.out.println("serialNo:" + serialNo);
|
||||||
return serialNo;
|
return serialNo;
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ import java.util.Map;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/wx/pay/v1")
|
@RequestMapping("/wx/pay/v1")
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class WxPayApiController {
|
public class WxPayApiController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService sysUserService;
|
private ISysUserService sysUserService;
|
||||||
|
|
@ -88,8 +88,8 @@ public class WxPayApiController {
|
||||||
@Value("${wx.appSecret}")
|
@Value("${wx.appSecret}")
|
||||||
String secret;
|
String secret;
|
||||||
/**商户号**/
|
/**商户号**/
|
||||||
@Value("${wx.mchid}")
|
@Value("${wx.mchId}")
|
||||||
String mchid;
|
String mchId;
|
||||||
/**商户密钥**/
|
/**商户密钥**/
|
||||||
@Value("${wx.mchKey}")
|
@Value("${wx.mchKey}")
|
||||||
String mchKey;
|
String mchKey;
|
||||||
|
|
@ -152,7 +152,7 @@ public class WxPayApiController {
|
||||||
// APPID
|
// APPID
|
||||||
.setAppid(appid)
|
.setAppid(appid)
|
||||||
// 商户号
|
// 商户号
|
||||||
.setMchid(mchid)
|
.setMchid(mchId)
|
||||||
.setDescription(description)
|
.setDescription(description)
|
||||||
.setOut_trade_no(orderCode)
|
.setOut_trade_no(orderCode)
|
||||||
.setTime_expire(timeExpire)
|
.setTime_expire(timeExpire)
|
||||||
|
|
@ -165,7 +165,7 @@ public class WxPayApiController {
|
||||||
RequestMethodEnum.POST,
|
RequestMethodEnum.POST,
|
||||||
WxDomainEnum.CHINA.toString(),
|
WxDomainEnum.CHINA.toString(),
|
||||||
BasePayApiEnum.JS_API_PAY.toString(),
|
BasePayApiEnum.JS_API_PAY.toString(),
|
||||||
mchid,
|
mchId,
|
||||||
getSerialNumber(),
|
getSerialNumber(),
|
||||||
null,
|
null,
|
||||||
certKeyPath,
|
certKeyPath,
|
||||||
|
|
@ -253,7 +253,7 @@ public class WxPayApiController {
|
||||||
if (null != certificate) {
|
if (null != certificate) {
|
||||||
String serialNo = certificate.getSerialNumber().toString(16).toUpperCase();
|
String serialNo = certificate.getSerialNumber().toString(16).toUpperCase();
|
||||||
// 提前两天检查证书是否有效
|
// 提前两天检查证书是否有效
|
||||||
boolean isValid = PayKit.checkCertificateIsValid(certificate, mchid, -2);
|
boolean isValid = PayKit.checkCertificateIsValid(certificate, mchId, -2);
|
||||||
log.info("证书是否可用 {} 证书有效期为 {}", isValid, DateUtil.format(certificate.getNotAfter(), DatePattern.NORM_DATETIME_PATTERN));
|
log.info("证书是否可用 {} 证书有效期为 {}", isValid, DateUtil.format(certificate.getNotAfter(), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
System.out.println("serialNo:" + serialNo);
|
System.out.println("serialNo:" + serialNo);
|
||||||
return serialNo;
|
return serialNo;
|
||||||
|
|
@ -272,7 +272,7 @@ public class WxPayApiController {
|
||||||
RequestMethodEnum.GET,
|
RequestMethodEnum.GET,
|
||||||
WxDomainEnum.CHINA.toString(),
|
WxDomainEnum.CHINA.toString(),
|
||||||
OtherApiEnum.GET_CERTIFICATES.toString(),
|
OtherApiEnum.GET_CERTIFICATES.toString(),
|
||||||
mchid,
|
mchId,
|
||||||
getSerialNumber(),
|
getSerialNumber(),
|
||||||
null,
|
null,
|
||||||
certKeyPath,
|
certKeyPath,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.jeecg.config;
|
package org.jeecg.modules.mini.douyin.config;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.jeecg.modules.mini.wx.model;
|
package org.jeecg.modules.mini.wx.config;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
@ -17,16 +17,21 @@ import org.springframework.stereotype.Component;
|
||||||
public class WeXinConfig {
|
public class WeXinConfig {
|
||||||
|
|
||||||
private String appId;
|
private String appId;
|
||||||
|
|
||||||
private String mchId;
|
|
||||||
|
|
||||||
private String mchSerialNo;
|
|
||||||
|
|
||||||
private String appSecret;
|
private String appSecret;
|
||||||
|
// mchId
|
||||||
private String apiKey;
|
private String mchId;
|
||||||
|
// api密钥
|
||||||
|
private String mchKey;
|
||||||
|
// 证书序列号
|
||||||
|
private String mchSerialNo;
|
||||||
|
// 回调接口地址
|
||||||
private String notifyUrl;
|
private String notifyUrl;
|
||||||
|
// 证书地址
|
||||||
|
private String certPath;
|
||||||
|
// 证书密钥地址
|
||||||
|
private String certKeyPath;
|
||||||
|
// 微信平台证书
|
||||||
|
private String platFormPath;
|
||||||
|
|
||||||
private String keyPath;
|
private String keyPath;
|
||||||
|
|
||||||
|
|
@ -10,7 +10,6 @@ import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.util.*;
|
import org.jeecg.common.util.*;
|
||||||
import org.jeecg.modules.mini.wx.model.WeXinConfig;
|
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
import org.jeecg.modules.system.model.SysLoginModel;
|
import org.jeecg.modules.system.model.SysLoginModel;
|
||||||
import org.jeecg.modules.system.service.ISysUserService;
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
|
|
@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -36,10 +34,6 @@ public class WebUserController {
|
||||||
private ISysUserService sysUserService;
|
private ISysUserService sysUserService;
|
||||||
@Resource
|
@Resource
|
||||||
private WebUserService webUserService;
|
private WebUserService webUserService;
|
||||||
@Resource
|
|
||||||
private WeXinConfig weXinConfig;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
@RequestMapping(value = "checkPhoneAvailable")
|
@RequestMapping(value = "checkPhoneAvailable")
|
||||||
@ApiOperation(value = "判断手机号是否可用")
|
@ApiOperation(value = "判断手机号是否可用")
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
package org.jeecg.modules.web.controller;
|
package org.jeecg.modules.web.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.util.RedisUtil;
|
import org.jeecg.common.util.RedisUtil;
|
||||||
import org.jeecg.modules.mini.wx.constant.WeiXinConstant;
|
import org.jeecg.modules.mini.wx.constant.WeiXinConstant;
|
||||||
import org.jeecg.modules.mini.wx.model.WeXinConfig;
|
import org.jeecg.modules.mini.wx.config.WeXinConfig;
|
||||||
import org.jeecg.modules.mini.wx.util.WeXinUtil;
|
import org.jeecg.modules.mini.wx.util.WeXinUtil;
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
|
||||||
import org.jeecg.modules.system.service.ISysUserService;
|
|
||||||
import org.jeecg.modules.web.service.WebUserService;
|
import org.jeecg.modules.web.service.WebUserService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
@ -32,8 +29,6 @@ public class WeiXinController {
|
||||||
@Resource
|
@Resource
|
||||||
private WebUserService webUserService;
|
private WebUserService webUserService;
|
||||||
@Resource
|
@Resource
|
||||||
private ISysUserService sysUserService;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@ package org.jeecg.modules.yx.controller;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
@ -16,8 +11,7 @@ import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.jeecg.common.util.AssertUtils;
|
import org.jeecg.common.util.AssertUtils;
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
import org.jeecg.modules.mini.douyin.config.DouYinConfig;
|
||||||
import org.jeecg.config.DouYinConfig;
|
|
||||||
import org.jeecg.modules.mini.douyin.util.DouYinUtil;
|
import org.jeecg.modules.mini.douyin.util.DouYinUtil;
|
||||||
import org.jeecg.modules.yx.constant.YxConstant;
|
import org.jeecg.modules.yx.constant.YxConstant;
|
||||||
import org.jeecg.modules.yx.entity.YxOrder;
|
import org.jeecg.modules.yx.entity.YxOrder;
|
||||||
|
|
@ -28,19 +22,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
|
|
||||||
|
|
@ -571,12 +571,17 @@ public class YxCalculationMajorServiceImpl extends ServiceImpl<YxCalculationMajo
|
||||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//判断录取方式,分数是否过省控线
|
|
||||||
if (!ScoreUtil.crossingControlLine(rulesEnrollProbability, culturalScore, professionalScore, culturalControlLine, specialControlLine)) {
|
// 体育类不判断分数过线
|
||||||
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
if (!professionalCategory.equals("体育类")) {
|
||||||
continue;
|
//判断录取方式,分数是否过省控线
|
||||||
|
if (!ScoreUtil.crossingControlLine(rulesEnrollProbability, culturalScore, professionalScore, culturalControlLine, specialControlLine)) {
|
||||||
|
recommendMajorDTO.setEnrollProbability(YxConstant.bigDecimal0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//算分用
|
//算分用
|
||||||
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), activeCurrentUserScore.getProfessionalScore(), recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
|
studentScore = ScoreUtil.convertIntoScore(rulesEnrollProbability, activeCurrentUserScore.getCulturalScore(), activeCurrentUserScore.getProfessionalScore(), recommendMajorDTO.getFirstLevelDiscipline(), probabilityOperator);
|
||||||
recommendMajorDTO.setPrivateStudentScore(studentScore);
|
recommendMajorDTO.setPrivateStudentScore(studentScore);
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,11 @@ wx:
|
||||||
appSecret: ed3fd9089dcfbd1d886eddeca69c07bd
|
appSecret: ed3fd9089dcfbd1d886eddeca69c07bd
|
||||||
# 微信小程序支付配置信息
|
# 微信小程序支付配置信息
|
||||||
# 商户号
|
# 商户号
|
||||||
mchid: 1667485494
|
mchId: 1667485494
|
||||||
# api密钥
|
# api密钥
|
||||||
mchKey: hnjdsyxxkj1509067963615090658223
|
mchKey: hnjdsyxxkj1509067963615090658223
|
||||||
# 证书序列号
|
# 证书序列号
|
||||||
mch-serial-no: 46DB385431D56209508BFE80D43940BCC636C7B7
|
mchSerialNo: 46DB385431D56209508BFE80D43940BCC636C7B7
|
||||||
# 回调接口地址
|
# 回调接口地址
|
||||||
notifyUrl: https://yitisheng.vip/jbt/wx/pay/v1/payNotify
|
notifyUrl: https://yitisheng.vip/jbt/wx/pay/v1/payNotify
|
||||||
# 证书地址
|
# 证书地址
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue