This commit is contained in:
dzc committed 2026-06-02 18:27:26 +08:00
1 parent 0a7607a93c
commit e6cbb10d10
2 files changed
+18 -12

No files matched your search

@@ -107,6 +107,7 @@ public class ThirdAppPlusWechatMicropayServiceImpl implements ThirdAppPlusWechat
if (ObjectUtil.equals(res.getResultCode(), "SUCCESS") && ObjectUtil.equals(res.getReturnCode(), "SUCCESS")) {
payOrder.setStatus(ThirdPayOrderStatusEnum.PAY_SUCCESS.getType());
payOrder.setThirdPayNo(res.getTransactionId());
payOrder.setPayTime(LocalDateTime.now());
}
// 如果支付失败了就撤销订单
else {
@@ -157,6 +158,8 @@ public class ThirdAppPlusWechatMicropayServiceImpl implements ThirdAppPlusWechat
// 支付成功
if (ObjectUtil.equals(transaction.getTradeState(), Transaction.TradeStateEnum.SUCCESS)) {
payOrder.setStatus(ThirdPayOrderStatusEnum.PAY_SUCCESS.getType());
payOrder.setThirdPayNo(transaction.getTransactionId());
payOrder.setPayTime(LocalDateTime.now());
return transaction.getOutTradeNo();
}
// 支付失败
@@ -253,18 +253,21 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
Page<WalletManageVo> list = baseMapper.scopePage(page, dto, dataScope);
disposeList(list.getRecords());
if (ObjectUtil.isNotEmpty(list.getRecords())) {
// 查询用户属于的店铺
MchManageVo mchDetail = mchManageService.getViewsCanteenMchByDeptId(user.getDeptId());
if (ObjectUtil.isNotEmpty(mchDetail) && ObjectUtil.isNotEmpty(mchDetail.getWalletAliasList())) {
List<MchManageEntity.WalletAlias> walletAliasList = mchDetail.getWalletAliasList();
Iterator<WalletManageVo> iterator = list.getRecords().iterator();
while (iterator.hasNext()) {
WalletManageVo walletVo = iterator.next();
Optional<MchManageEntity.WalletAlias> matchingAlias = walletAliasList.stream()
.filter(alias -> ObjectUtil.equals(alias.getWalletTypeId(), walletVo.getWalletTypeId()))
.findFirst();
if (matchingAlias.isPresent() && !matchingAlias.get().getVisible()) {
iterator.remove();
UserInfo userInfo = userService.getByUserId(user.getId()).getData();
if (ObjectUtil.isNotEmpty(userInfo)) {
// 查询用户属于的店铺
MchManageVo mchDetail = mchManageService.getViewsCanteenMchByDeptId(userInfo.getSysUser().getDeptId());
if (ObjectUtil.isNotEmpty(mchDetail) && ObjectUtil.isNotEmpty(mchDetail.getWalletAliasList())) {
List<MchManageEntity.WalletAlias> walletAliasList = mchDetail.getWalletAliasList();
Iterator<WalletManageVo> iterator = list.getRecords().iterator();
while (iterator.hasNext()) {
WalletManageVo walletVo = iterator.next();
Optional<MchManageEntity.WalletAlias> matchingAlias = walletAliasList.stream()
.filter(alias -> ObjectUtil.equals(alias.getWalletTypeId(), walletVo.getWalletTypeId()))
.findFirst();
if (matchingAlias.isPresent() && !matchingAlias.get().getVisible()) {
iterator.remove();
}
}
}
}