Commit f1424aa61e1e8e854dba1fddcc0e362ac7277fad
1 parent
4b5c1856
code review 支付应用的逻辑
Showing
5 changed files
with
4 additions
and
13 deletions
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/PayAppController.java
| @@ -41,7 +41,7 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E | @@ -41,7 +41,7 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E | ||
| 41 | * 支付应用信息 controller 组件 | 41 | * 支付应用信息 controller 组件 |
| 42 | * | 42 | * |
| 43 | * @author aquan | 43 | * @author aquan |
| 44 | - */ | 44 | + */ // TODO @aquan:一般 controller 上就不写注释了,因为有 swagger 注解,不然就重复啦 |
| 45 | @Slf4j | 45 | @Slf4j |
| 46 | @Api(tags = "支付应用信息") | 46 | @Api(tags = "支付应用信息") |
| 47 | @RestController | 47 | @RestController |
| @@ -51,11 +51,8 @@ public class PayAppController { | @@ -51,11 +51,8 @@ public class PayAppController { | ||
| 51 | 51 | ||
| 52 | @Resource | 52 | @Resource |
| 53 | private PayAppService appService; | 53 | private PayAppService appService; |
| 54 | - | ||
| 55 | @Resource | 54 | @Resource |
| 56 | private PayChannelService channelService; | 55 | private PayChannelService channelService; |
| 57 | - | ||
| 58 | - | ||
| 59 | @Resource | 56 | @Resource |
| 60 | private PayMerchantService merchantService; | 57 | private PayMerchantService merchantService; |
| 61 | 58 | ||
| @@ -135,6 +132,7 @@ public class PayAppController { | @@ -135,6 +132,7 @@ public class PayAppController { | ||
| 135 | // 写入商户的数据 | 132 | // 写入商户的数据 |
| 136 | respVO.setPayMerchant(PayAppConvert.INSTANCE.convert(deptMap.get(app.getMerchantId()))); | 133 | respVO.setPayMerchant(PayAppConvert.INSTANCE.convert(deptMap.get(app.getMerchantId()))); |
| 137 | // 写入支付渠道信息的数据 | 134 | // 写入支付渠道信息的数据 |
| 135 | + // TODO @aquan:VO 里返回的 payChannel,是不是用一个 Set 集合就好了,里面是渠道的枚举值 | ||
| 138 | PayAppPageItemRespVO.PayChannel payChannel = new PayAppPageItemRespVO.PayChannel(); | 136 | PayAppPageItemRespVO.PayChannel payChannel = new PayAppPageItemRespVO.PayChannel(); |
| 139 | channels.forEach(c -> { | 137 | channels.forEach(c -> { |
| 140 | if (c.getAppId().equals(app.getId())) { | 138 | if (c.getAppId().equals(app.getId())) { |
| @@ -177,5 +175,4 @@ public class PayAppController { | @@ -177,5 +175,4 @@ public class PayAppController { | ||
| 177 | return success(PayAppConvert.INSTANCE.convertList(appListDO)); | 175 | return success(PayAppConvert.INSTANCE.convertList(appListDO)); |
| 178 | } | 176 | } |
| 179 | 177 | ||
| 180 | - | ||
| 181 | } | 178 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/vo/PayAppPageItemRespVO.java
| @@ -72,4 +72,5 @@ public class PayAppPageItemRespVO extends PayAppBaseVO { | @@ -72,4 +72,5 @@ public class PayAppPageItemRespVO extends PayAppBaseVO { | ||
| 72 | @ApiModelProperty(value = "支付宝扫码支付", required = true, example = "1") | 72 | @ApiModelProperty(value = "支付宝扫码支付", required = true, example = "1") |
| 73 | private Integer alipayQr = CommonStatusEnum.DISABLE.getStatus(); | 73 | private Integer alipayQr = CommonStatusEnum.DISABLE.getStatus(); |
| 74 | } | 74 | } |
| 75 | + | ||
| 75 | } | 76 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/impl/PayAppServiceImpl.java
| @@ -36,10 +36,6 @@ public class PayAppServiceImpl implements PayAppService { | @@ -36,10 +36,6 @@ public class PayAppServiceImpl implements PayAppService { | ||
| 36 | 36 | ||
| 37 | @Resource | 37 | @Resource |
| 38 | private PayAppMapper appMapper; | 38 | private PayAppMapper appMapper; |
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * 商户 service 组件 | ||
| 42 | - */ | ||
| 43 | @Resource | 39 | @Resource |
| 44 | private PayMerchantMapper merchantMapper; | 40 | private PayMerchantMapper merchantMapper; |
| 45 | 41 | ||
| @@ -151,7 +147,6 @@ public class PayAppServiceImpl implements PayAppService { | @@ -151,7 +147,6 @@ public class PayAppServiceImpl implements PayAppService { | ||
| 151 | */ | 147 | */ |
| 152 | @VisibleForTesting | 148 | @VisibleForTesting |
| 153 | public void checkAppExists(Long id) { | 149 | public void checkAppExists(Long id) { |
| 154 | - | ||
| 155 | if (id == null) { | 150 | if (id == null) { |
| 156 | return; | 151 | return; |
| 157 | } | 152 | } |
| @@ -160,4 +155,5 @@ public class PayAppServiceImpl implements PayAppService { | @@ -160,4 +155,5 @@ public class PayAppServiceImpl implements PayAppService { | ||
| 160 | throw exception(PAY_APP_NOT_FOUND); | 155 | throw exception(PAY_APP_NOT_FOUND); |
| 161 | } | 156 | } |
| 162 | } | 157 | } |
| 158 | + | ||
| 163 | } | 159 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/impl/PayChannelServiceImpl.java
| @@ -46,7 +46,6 @@ public class PayChannelServiceImpl implements PayChannelService { | @@ -46,7 +46,6 @@ public class PayChannelServiceImpl implements PayChannelService { | ||
| 46 | 46 | ||
| 47 | @Override | 47 | @Override |
| 48 | public Long createChannel(PayChannelCreateReqVO reqVO) { | 48 | public Long createChannel(PayChannelCreateReqVO reqVO) { |
| 49 | - | ||
| 50 | // 断言是否有重复的 | 49 | // 断言是否有重复的 |
| 51 | PayChannelDO channelDO = this.getChannelByConditions(reqVO.getMerchantId(), reqVO.getAppId(), reqVO.getCode()); | 50 | PayChannelDO channelDO = this.getChannelByConditions(reqVO.getMerchantId(), reqVO.getAppId(), reqVO.getCode()); |
| 52 | Assert.isNull(channelDO, CHANNEL_EXIST_SAME_CHANNEL_ERROR.getMsg()); | 51 | Assert.isNull(channelDO, CHANNEL_EXIST_SAME_CHANNEL_ERROR.getMsg()); |
yudao-admin-ui/src/views/pay/app/index.vue
| @@ -467,8 +467,6 @@ export default { | @@ -467,8 +467,6 @@ export default { | ||
| 467 | this.settingChannelParam(row, payCode, type) | 467 | this.settingChannelParam(row, payCode, type) |
| 468 | this.channelParam.edit = false; | 468 | this.channelParam.edit = false; |
| 469 | this.channelParam.loading = false; | 469 | this.channelParam.loading = false; |
| 470 | - | ||
| 471 | - | ||
| 472 | }, | 470 | }, |
| 473 | /** | 471 | /** |
| 474 | * 设置支付渠道信息 | 472 | * 设置支付渠道信息 |