mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 18:49:06 +08:00 
			
		
		
		
	code review 支付应用的逻辑
This commit is contained in:
		| @ -41,7 +41,7 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E | |||||||
|  * 支付应用信息 controller 组件 |  * 支付应用信息 controller 组件 | ||||||
|  * |  * | ||||||
|  * @author aquan |  * @author aquan | ||||||
|  */ |  */ // TODO @aquan:一般 controller 上就不写注释了,因为有 swagger 注解,不然就重复啦 | ||||||
| @Slf4j | @Slf4j | ||||||
| @Api(tags = "支付应用信息") | @Api(tags = "支付应用信息") | ||||||
| @RestController | @RestController | ||||||
| @ -51,11 +51,8 @@ public class PayAppController { | |||||||
|  |  | ||||||
|     @Resource |     @Resource | ||||||
|     private PayAppService appService; |     private PayAppService appService; | ||||||
|  |  | ||||||
|     @Resource |     @Resource | ||||||
|     private PayChannelService channelService; |     private PayChannelService channelService; | ||||||
|  |  | ||||||
|  |  | ||||||
|     @Resource |     @Resource | ||||||
|     private PayMerchantService merchantService; |     private PayMerchantService merchantService; | ||||||
|  |  | ||||||
| @ -135,6 +132,7 @@ public class PayAppController { | |||||||
|             // 写入商户的数据 |             // 写入商户的数据 | ||||||
|             respVO.setPayMerchant(PayAppConvert.INSTANCE.convert(deptMap.get(app.getMerchantId()))); |             respVO.setPayMerchant(PayAppConvert.INSTANCE.convert(deptMap.get(app.getMerchantId()))); | ||||||
|             // 写入支付渠道信息的数据 |             // 写入支付渠道信息的数据 | ||||||
|  |             // TODO @aquan:VO 里返回的 payChannel,是不是用一个 Set 集合就好了,里面是渠道的枚举值 | ||||||
|             PayAppPageItemRespVO.PayChannel payChannel = new PayAppPageItemRespVO.PayChannel(); |             PayAppPageItemRespVO.PayChannel payChannel = new PayAppPageItemRespVO.PayChannel(); | ||||||
|             channels.forEach(c -> { |             channels.forEach(c -> { | ||||||
|                 if (c.getAppId().equals(app.getId())) { |                 if (c.getAppId().equals(app.getId())) { | ||||||
| @ -177,5 +175,4 @@ public class PayAppController { | |||||||
|         return success(PayAppConvert.INSTANCE.convertList(appListDO)); |         return success(PayAppConvert.INSTANCE.convertList(appListDO)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -72,4 +72,5 @@ public class PayAppPageItemRespVO extends PayAppBaseVO { | |||||||
|         @ApiModelProperty(value = "支付宝扫码支付", required = true, example = "1") |         @ApiModelProperty(value = "支付宝扫码支付", required = true, example = "1") | ||||||
|         private Integer alipayQr = CommonStatusEnum.DISABLE.getStatus(); |         private Integer alipayQr = CommonStatusEnum.DISABLE.getStatus(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -36,10 +36,6 @@ public class PayAppServiceImpl implements PayAppService { | |||||||
|  |  | ||||||
|     @Resource |     @Resource | ||||||
|     private PayAppMapper appMapper; |     private PayAppMapper appMapper; | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 商户 service 组件 |  | ||||||
|      */ |  | ||||||
|     @Resource |     @Resource | ||||||
|     private PayMerchantMapper merchantMapper; |     private PayMerchantMapper merchantMapper; | ||||||
|  |  | ||||||
| @ -151,7 +147,6 @@ public class PayAppServiceImpl implements PayAppService { | |||||||
|      */ |      */ | ||||||
|     @VisibleForTesting |     @VisibleForTesting | ||||||
|     public void checkAppExists(Long id) { |     public void checkAppExists(Long id) { | ||||||
|  |  | ||||||
|         if (id == null) { |         if (id == null) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| @ -160,4 +155,5 @@ public class PayAppServiceImpl implements PayAppService { | |||||||
|             throw exception(PAY_APP_NOT_FOUND); |             throw exception(PAY_APP_NOT_FOUND); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -46,7 +46,6 @@ public class PayChannelServiceImpl implements PayChannelService { | |||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public Long createChannel(PayChannelCreateReqVO reqVO) { |     public Long createChannel(PayChannelCreateReqVO reqVO) { | ||||||
|  |  | ||||||
|         // 断言是否有重复的 |         // 断言是否有重复的 | ||||||
|         PayChannelDO channelDO = this.getChannelByConditions(reqVO.getMerchantId(), reqVO.getAppId(), reqVO.getCode()); |         PayChannelDO channelDO = this.getChannelByConditions(reqVO.getMerchantId(), reqVO.getAppId(), reqVO.getCode()); | ||||||
|         Assert.isNull(channelDO, CHANNEL_EXIST_SAME_CHANNEL_ERROR.getMsg()); |         Assert.isNull(channelDO, CHANNEL_EXIST_SAME_CHANNEL_ERROR.getMsg()); | ||||||
|  | |||||||
| @ -467,8 +467,6 @@ export default { | |||||||
|       this.settingChannelParam(row, payCode, type) |       this.settingChannelParam(row, payCode, type) | ||||||
|       this.channelParam.edit = false; |       this.channelParam.edit = false; | ||||||
|       this.channelParam.loading = false; |       this.channelParam.loading = false; | ||||||
|  |  | ||||||
|  |  | ||||||
|     }, |     }, | ||||||
|     /** |     /** | ||||||
|      * 设置支付渠道信息 |      * 设置支付渠道信息 | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV