【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.service.WxPayService;
|
||||
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.system.SystemConfig;
|
||||
import com.hcy.common.entity.wxpay.SystemWxPayConfig;
|
||||
|
@ -38,7 +39,8 @@ public class WxPayConfiguration {
|
|||
@Bean("mpWxPayService")
|
||||
public WxPayService mpWxPayService() {
|
||||
Boolean flag = Boolean.FALSE;
|
||||
WxPayConfig payConfig = new WxPayConfig();
|
||||
WxPayCustomConfig payConfig = new WxPayCustomConfig();
|
||||
// WxPayConfig payConfig = new WxPayConfig();
|
||||
DevPay devPay = devPayMapper.getEntityByPayWay(OrderPlayTypeEnum.WECHAT_PAY.getType());
|
||||
String config = devPay.getConfig();
|
||||
SystemWxPayConfig systemWxPayConfig = JSON.parseObject(config, SystemWxPayConfig.class);
|
||||
|
@ -54,6 +56,16 @@ public class WxPayConfiguration {
|
|||
payConfig.setPrivateCertContent(StringUtils.trimToNull(systemWxPayConfig.getApiclientCert()).getBytes());
|
||||
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);
|
||||
WxPayService wxPayService = new WxPayServiceImpl();
|
||||
|
|
|
@ -469,8 +469,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||
orderRefundDetailVo.setDeductionRatioMoney(new BigDecimal("0"));
|
||||
}else{
|
||||
orderRefundDetailVo.setDeductionRatioMoney(model.getOrderAmount()
|
||||
.multiply(orderRefund.getPracticalDeductionRatio() == null ? orderRefund.getDeductionRatio()
|
||||
: orderRefund.getPracticalDeductionRatio())
|
||||
// .multiply(orderRefund.getPracticalDeductionRatio() == null ? orderRefund.getDeductionRatio()
|
||||
// : orderRefund.getPracticalDeductionRatio())
|
||||
.divide(new BigDecimal("100"),2,RoundingMode.HALF_UP));
|
||||
}
|
||||
vo.setOrderRefundDetailVo(orderRefundDetailVo);
|
||||
|
@ -877,7 +877,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||
log.info("createAndRefund,退款返回结果:{}", wxPayRefundV3Result.toString());
|
||||
orderRefund.setRefundTime(TimeUtil.timestamp());
|
||||
orderRefund.setTransactionId(wxPayRefundV3Result.getRefundId());
|
||||
// 更新退款订单状态
|
||||
orderRefund.setRefundStatus(OrderRefundStatusEnum.SUCCESS.getStatus());
|
||||
orderRefundMapper.updateById(orderRefund);
|
||||
// 更新订单状态
|
||||
model.setOrderStatus(OrderStatusEnum.CLOSE.getStatus());
|
||||
orderMapper.updateById(model);
|
||||
break;
|
||||
case 2:
|
||||
User user = userMapper.selectOne(new QueryWrapper<User>()
|
||||
|
|
|
@ -4,7 +4,7 @@ like:
|
|||
# upload-directory: E:\img\
|
||||
# 服务配置
|
||||
server:
|
||||
port: 8086
|
||||
port: 8084
|
||||
servlet:
|
||||
context-path: /
|
||||
|
||||
|
|
Loading…
Reference in New Issue