Commit 544d9030e6d777bc2bc88714a781c00be92d711d
1 parent
ba541fba
pay:后台支付应用信息列表关闭某一渠道,但是任然显示为开启状态
Showing
1 changed file
with
8 additions
and
8 deletions
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/PayAppController.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.controller.admin.app; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | 5 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 7 | -import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; | |
| 8 | 7 | import cn.iocoder.yudao.module.pay.controller.admin.app.vo.*; |
| 9 | 8 | import cn.iocoder.yudao.module.pay.convert.app.PayAppConvert; |
| 10 | 9 | import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO; |
| ... | ... | @@ -14,14 +13,14 @@ import cn.iocoder.yudao.module.pay.service.channel.PayChannelService; |
| 14 | 13 | import io.swagger.v3.oas.annotations.Operation; |
| 15 | 14 | import io.swagger.v3.oas.annotations.Parameter; |
| 16 | 15 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 16 | +import jakarta.annotation.Resource; | |
| 17 | +import jakarta.validation.Valid; | |
| 17 | 18 | import lombok.extern.slf4j.Slf4j; |
| 18 | 19 | import org.springframework.security.access.prepost.PreAuthorize; |
| 19 | 20 | import org.springframework.validation.annotation.Validated; |
| 20 | 21 | import org.springframework.web.bind.annotation.*; |
| 21 | 22 | |
| 22 | -import jakarta.annotation.Resource; | |
| 23 | -import jakarta.validation.Valid; | |
| 24 | -import java.util.*; | |
| 23 | +import java.util.List; | |
| 25 | 24 | |
| 26 | 25 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 27 | 26 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; |
| ... | ... | @@ -89,9 +88,10 @@ public class PayAppController { |
| 89 | 88 | return success(PageResult.empty()); |
| 90 | 89 | } |
| 91 | 90 | |
| 92 | - // 得到所有的应用编号,查出所有的渠道 | |
| 93 | - Collection<Long> appIds = convertList(pageResult.getList(), PayAppDO::getId); | |
| 94 | - List<PayChannelDO> channels = channelService.getChannelListByAppIds(appIds); | |
| 91 | + // 得到所有的应用编号,查出所有的渠道,并移除未启用的渠道 | |
| 92 | + List<PayChannelDO> channels = channelService.getChannelListByAppIds( | |
| 93 | + convertList(pageResult.getList(), PayAppDO::getId)); | |
| 94 | + channels.removeIf(channel -> !CommonStatusEnum.ENABLE.getStatus().equals(channel.getStatus())); | |
| 95 | 95 | |
| 96 | 96 | // 拼接后返回 |
| 97 | 97 | return success(PayAppConvert.INSTANCE.convertPage(pageResult, channels)); | ... | ... |