【admin&from】 新增 1、后台优化初始化微信配置修改平台证书 2、小程序优化退单状态,已成功退款,订单状态改为已完成退款 3、小程序端口号改为8084
parent
5d0cd1279d
commit
e5a548af24
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||||
import com.github.binarywang.wxpay.config.WxPayConfig;
|
import com.github.binarywang.wxpay.config.WxPayConfig;
|
||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
|
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
|
||||||
|
import com.hcy.common.config.wx.WxPayCustomConfig;
|
||||||
import com.hcy.common.entity.pay.DevPay;
|
import com.hcy.common.entity.pay.DevPay;
|
||||||
import com.hcy.common.entity.system.SystemConfig;
|
import com.hcy.common.entity.system.SystemConfig;
|
||||||
import com.hcy.common.entity.wxpay.SystemWxPayConfig;
|
import com.hcy.common.entity.wxpay.SystemWxPayConfig;
|
||||||
|
@ -38,7 +39,8 @@ public class WxPayConfiguration {
|
||||||
@Bean("mpWxPayService")
|
@Bean("mpWxPayService")
|
||||||
public WxPayService mpWxPayService() {
|
public WxPayService mpWxPayService() {
|
||||||
Boolean flag = Boolean.FALSE;
|
Boolean flag = Boolean.FALSE;
|
||||||
WxPayConfig payConfig = new WxPayConfig();
|
WxPayCustomConfig payConfig = new WxPayCustomConfig();
|
||||||
|
// WxPayConfig payConfig = new WxPayConfig();
|
||||||
DevPay devPay = devPayMapper.getEntityByPayWay(OrderPlayTypeEnum.WECHAT_PAY.getType());
|
DevPay devPay = devPayMapper.getEntityByPayWay(OrderPlayTypeEnum.WECHAT_PAY.getType());
|
||||||
String config = devPay.getConfig();
|
String config = devPay.getConfig();
|
||||||
SystemWxPayConfig systemWxPayConfig = JSON.parseObject(config, SystemWxPayConfig.class);
|
SystemWxPayConfig systemWxPayConfig = JSON.parseObject(config, SystemWxPayConfig.class);
|
||||||
|
@ -54,6 +56,16 @@ public class WxPayConfiguration {
|
||||||
payConfig.setPrivateCertContent(StringUtils.trimToNull(systemWxPayConfig.getApiclientCert()).getBytes());
|
payConfig.setPrivateCertContent(StringUtils.trimToNull(systemWxPayConfig.getApiclientCert()).getBytes());
|
||||||
flag = Boolean.TRUE;
|
flag = Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
payConfig.setPublicKeyId("PUB_KEY_ID_0117052034742025012300326100001464");
|
||||||
|
payConfig.setPublicKey("-----BEGIN PUBLIC KEY-----\n" +
|
||||||
|
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7xtJgD6ML1dL3AnCHJ7G\n" +
|
||||||
|
"lwoSpdZKCb0yoL3D0la47yXgiFcwA+PXum/d5uTBQ3rxXIV1YMPNF7JhA2nPYC9O\n" +
|
||||||
|
"xTnA+bvAL9e4EP9x3Ocs5Uc9J+p/NxO+FcbD8Qbp6eDM2Rn5iir3TMze0ppMwDCE\n" +
|
||||||
|
"LtVlSCo5DysLjuL6Ub71QBN0aaOJ5SFQtyRXTizm+sDvL7JvHRbOy+lJsyIN83EW\n" +
|
||||||
|
"NzWuBMUR5gs7KgCRPSQvAOIXGcfxYP1kYlCbkYHzACDhpKB3ZDQHWIlwVMuCsYb/\n" +
|
||||||
|
"O4/0gPK/xizNdtjM2SDz/IijWOfVhBb9rup+hccbns4Zi/8hn0+CiiZpBVbWxak2\n" +
|
||||||
|
"iQIDAQAB\n" +
|
||||||
|
"-----END PUBLIC KEY-----\n");
|
||||||
// 可以指定是否使用沙箱环境
|
// 可以指定是否使用沙箱环境
|
||||||
payConfig.setUseSandboxEnv(false);
|
payConfig.setUseSandboxEnv(false);
|
||||||
WxPayService wxPayService = new WxPayServiceImpl();
|
WxPayService wxPayService = new WxPayServiceImpl();
|
||||||
|
|
|
@ -469,8 +469,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||||
orderRefundDetailVo.setDeductionRatioMoney(new BigDecimal("0"));
|
orderRefundDetailVo.setDeductionRatioMoney(new BigDecimal("0"));
|
||||||
}else{
|
}else{
|
||||||
orderRefundDetailVo.setDeductionRatioMoney(model.getOrderAmount()
|
orderRefundDetailVo.setDeductionRatioMoney(model.getOrderAmount()
|
||||||
.multiply(orderRefund.getPracticalDeductionRatio() == null ? orderRefund.getDeductionRatio()
|
// .multiply(orderRefund.getPracticalDeductionRatio() == null ? orderRefund.getDeductionRatio()
|
||||||
: orderRefund.getPracticalDeductionRatio())
|
// : orderRefund.getPracticalDeductionRatio())
|
||||||
.divide(new BigDecimal("100"),2,RoundingMode.HALF_UP));
|
.divide(new BigDecimal("100"),2,RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
vo.setOrderRefundDetailVo(orderRefundDetailVo);
|
vo.setOrderRefundDetailVo(orderRefundDetailVo);
|
||||||
|
@ -877,7 +877,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||||
log.info("createAndRefund,退款返回结果:{}", wxPayRefundV3Result.toString());
|
log.info("createAndRefund,退款返回结果:{}", wxPayRefundV3Result.toString());
|
||||||
orderRefund.setRefundTime(TimeUtil.timestamp());
|
orderRefund.setRefundTime(TimeUtil.timestamp());
|
||||||
orderRefund.setTransactionId(wxPayRefundV3Result.getRefundId());
|
orderRefund.setTransactionId(wxPayRefundV3Result.getRefundId());
|
||||||
|
// 更新退款订单状态
|
||||||
|
orderRefund.setRefundStatus(OrderRefundStatusEnum.SUCCESS.getStatus());
|
||||||
orderRefundMapper.updateById(orderRefund);
|
orderRefundMapper.updateById(orderRefund);
|
||||||
|
// 更新订单状态
|
||||||
|
model.setOrderStatus(OrderStatusEnum.CLOSE.getStatus());
|
||||||
|
orderMapper.updateById(model);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
User user = userMapper.selectOne(new QueryWrapper<User>()
|
User user = userMapper.selectOne(new QueryWrapper<User>()
|
||||||
|
|
|
@ -4,7 +4,7 @@ like:
|
||||||
# upload-directory: E:\img\
|
# upload-directory: E:\img\
|
||||||
# 服务配置
|
# 服务配置
|
||||||
server:
|
server:
|
||||||
port: 8086
|
port: 8084
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /
|
context-path: /
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue