mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-14 05:40:25 +00:00
fix: 修复分账配置更新不生效问题, 修复wxjava配置使用base64无法解析问题, 修复微信分账同步有空指针问题
This commit is contained in:
13
_doc/Task.md
13
_doc/Task.md
@@ -1,11 +1,14 @@
|
|||||||
# 单商户
|
# 单商户
|
||||||
## 3.0.1 功能优化
|
## 3.0.1 功能优化
|
||||||
|
- [ ] 网关配套移动端开发
|
||||||
|
- [ ] 同步回调页
|
||||||
- [ ] 收银台功能优化
|
- [ ] 收银台功能优化
|
||||||
- [ ] 支持配置背景色和图标
|
- [ ] 支持配置背景色和图标
|
||||||
- [ ] 定时同步任务频次不要太高, 预防产生过多的数据
|
- [ ] 定时同步任务频次不要太高, 预防产生过多的数据
|
||||||
|
- [ ] 增加首页驾驶舱功能
|
||||||
|
- [ ] 商户应用应该要有一个类似删除的功能, 实现停用冻结, 但不影响数据的关联
|
||||||
## 3.0.0.bate3: 功能完善
|
## 3.0.0.bate3: 功能完善
|
||||||
- 优化:
|
- 优化:
|
||||||
- [ ] 增加首页驾驶舱功能
|
|
||||||
- [x] 分账界面功能
|
- [x] 分账界面功能
|
||||||
- [x] 分账接收方配置
|
- [x] 分账接收方配置
|
||||||
- [x] 分账单管理
|
- [x] 分账单管理
|
||||||
@@ -18,8 +21,6 @@
|
|||||||
- [ ] 自动完成
|
- [ ] 自动完成
|
||||||
- [ ] 自动同步状态
|
- [ ] 自动同步状态
|
||||||
- [ ] 分账消息通知和回调
|
- [ ] 分账消息通知和回调
|
||||||
- [ ] 网关配套移动端开发
|
|
||||||
- [ ] 同步回调页
|
|
||||||
- [x] 分账接收方和分账组优化, 后台管理时, 编号自动生成
|
- [x] 分账接收方和分账组优化, 后台管理时, 编号自动生成
|
||||||
- [x] 微信通道添加单独的认证跳转地址, 处理它的特殊情况
|
- [x] 微信通道添加单独的认证跳转地址, 处理它的特殊情况
|
||||||
- [x] 支付订单新增待支付状态
|
- [x] 支付订单新增待支付状态
|
||||||
@@ -47,7 +48,7 @@
|
|||||||
- [x] 码牌不再使用应用号作为标识, 使用独立的编码
|
- [x] 码牌不再使用应用号作为标识, 使用独立的编码
|
||||||
- [x] 码牌H5页面对接
|
- [x] 码牌H5页面对接
|
||||||
- [ ] 分账配置/分账组/分账接收方合并为一个tabs页面
|
- [ ] 分账配置/分账组/分账接收方合并为一个tabs页面
|
||||||
## 3.0.0.beta2 收银台
|
## 3.0.0.beta1 收银台
|
||||||
- [x] 收银台功能
|
- [x] 收银台功能
|
||||||
- [x] 收银台配置
|
- [x] 收银台配置
|
||||||
- [x] 分类配置
|
- [x] 分类配置
|
||||||
@@ -63,8 +64,6 @@
|
|||||||
- [x] H5收银台
|
- [x] H5收银台
|
||||||
- [x] 跳转支付
|
- [x] 跳转支付
|
||||||
- [x] 升级为聚合支付
|
- [x] 升级为聚合支付
|
||||||
- [ ] ~~APP调起支付~~
|
|
||||||
- [ ] ~~小程序支付~~
|
|
||||||
- [x] 聚合收银台
|
- [x] 聚合收银台
|
||||||
- [x] Jsapi调用
|
- [x] Jsapi调用
|
||||||
- [x] 跳转支付
|
- [x] 跳转支付
|
||||||
@@ -80,5 +79,3 @@
|
|||||||
|
|
||||||
## 任务池
|
## 任务池
|
||||||
- [ ] 退款支持以撤销的方式进行退款
|
- [ ] 退款支持以撤销的方式进行退款
|
||||||
- [ ] 商户应用增加启停用状态
|
|
||||||
- [ ] 商户应用应该要有一个类似删除的功能, 实现停用冻结, 但不影响数据的关联
|
|
||||||
|
@@ -30,8 +30,10 @@ import org.dromara.daxpay.service.entity.allocation.transaction.AllocOrder;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -126,7 +128,7 @@ public class WeChatPayAllocationV2Service {
|
|||||||
}
|
}
|
||||||
var detailMap = details.stream()
|
var detailMap = details.stream()
|
||||||
.collect(Collectors.toMap(AllocDetail::getReceiverAccount, Function.identity(), CollectorsFunction::retainLatest));
|
.collect(Collectors.toMap(AllocDetail::getReceiverAccount, Function.identity(), CollectorsFunction::retainLatest));
|
||||||
var royaltyDetailList = result.getReceivers();
|
var royaltyDetailList = Optional.ofNullable( result.getReceivers()).orElse(new ArrayList<>(0));
|
||||||
for (var receiver : royaltyDetailList) {
|
for (var receiver : royaltyDetailList) {
|
||||||
var detail = detailMap.get(receiver.getAccount());
|
var detail = detailMap.get(receiver.getAccount());
|
||||||
if (Objects.nonNull(detail)) {
|
if (Objects.nonNull(detail)) {
|
||||||
|
@@ -28,8 +28,10 @@ import org.dromara.daxpay.service.entity.allocation.transaction.AllocOrder;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -124,7 +126,7 @@ public class WeChatPayAllocationV3Service {
|
|||||||
}
|
}
|
||||||
var detailMap = details.stream()
|
var detailMap = details.stream()
|
||||||
.collect(Collectors.toMap(AllocDetail::getReceiverAccount, Function.identity(), CollectorsFunction::retainLatest));
|
.collect(Collectors.toMap(AllocDetail::getReceiverAccount, Function.identity(), CollectorsFunction::retainLatest));
|
||||||
var royaltyDetailList = result.getReceivers();
|
var royaltyDetailList = Optional.ofNullable(result.getReceivers()).orElse(new ArrayList<>(0));
|
||||||
for (var receiver : royaltyDetailList) {
|
for (var receiver : royaltyDetailList) {
|
||||||
var detail = detailMap.get(receiver.getAccount());
|
var detail = detailMap.get(receiver.getAccount());
|
||||||
if (Objects.nonNull(detail)) {
|
if (Objects.nonNull(detail)) {
|
||||||
|
@@ -2,6 +2,7 @@ package org.dromara.daxpay.channel.wechat.service.config;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
|
import cn.hutool.core.codec.Base64;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
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;
|
||||||
@@ -146,10 +147,11 @@ public class WechatPayConfigService {
|
|||||||
payConfig.setAppId(wechatPayConfig.getWxAppId());
|
payConfig.setAppId(wechatPayConfig.getWxAppId());
|
||||||
payConfig.setMchKey(wechatPayConfig.getApiKeyV2());
|
payConfig.setMchKey(wechatPayConfig.getApiKeyV2());
|
||||||
payConfig.setApiV3Key(wechatPayConfig.getApiKeyV3());
|
payConfig.setApiV3Key(wechatPayConfig.getApiKeyV3());
|
||||||
payConfig.setPrivateKeyString(wechatPayConfig.getPrivateKey());
|
// 注意不要使用base64的方式进行配置, 因为wxjava 是直接读取文本并不会进行解码
|
||||||
payConfig.setPrivateCertString(wechatPayConfig.getPrivateCert());
|
payConfig.setPrivateKeyContent(Base64.decode(wechatPayConfig.getPrivateKey()));
|
||||||
|
payConfig.setPrivateCertContent(Base64.decode(wechatPayConfig.getPrivateCert()));
|
||||||
payConfig.setCertSerialNo(wechatPayConfig.getCertSerialNo());
|
payConfig.setCertSerialNo(wechatPayConfig.getCertSerialNo());
|
||||||
payConfig.setKeyString(wechatPayConfig.getP12());
|
payConfig.setKeyContent(Base64.decode(wechatPayConfig.getP12()));
|
||||||
WxPayService wxPayService = new WxPayServiceImpl();
|
WxPayService wxPayService = new WxPayServiceImpl();
|
||||||
wxPayService.setConfig(payConfig);
|
wxPayService.setConfig(payConfig);
|
||||||
return wxPayService;
|
return wxPayService;
|
||||||
|
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@RequestGroup(groupCode = "AllocConfig", groupName = "分账配置", moduleCode = "Alloc", moduleName = "分账管理" )
|
@RequestGroup(groupCode = "AllocConfig", groupName = "分账配置", moduleCode = "Alloc", moduleName = "分账管理" )
|
||||||
@RequestMapping("/allocation/config")
|
@RequestMapping("/allocation/config")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class AllocController {
|
public class AllocConfigController {
|
||||||
private final AllocConfigService allocConfigService;
|
private final AllocConfigService allocConfigService;
|
||||||
|
|
||||||
@RequestPath("保存")
|
@RequestPath("保存")
|
@@ -43,7 +43,7 @@ public class AllocConfigService {
|
|||||||
public void update(AllocConfigParam param) {
|
public void update(AllocConfigParam param) {
|
||||||
AllocConfig config = allocConfigManger.findById(param.getId())
|
AllocConfig config = allocConfigManger.findById(param.getId())
|
||||||
.orElseThrow(() -> new DataNotExistException("分账配置不存在"));
|
.orElseThrow(() -> new DataNotExistException("分账配置不存在"));
|
||||||
BeanUtil.copyProperties(config, param, CopyOptions.create().ignoreNullValue());
|
BeanUtil.copyProperties(param, config, CopyOptions.create().ignoreNullValue());
|
||||||
allocConfigManger.updateById(config);
|
allocConfigManger.updateById(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user