code review 支付商户逻辑

pull/2/head
YunaiV 2021-12-25 17:53:18 +08:00
parent ff21fdc5df
commit 4b5c185608
8 changed files with 23 additions and 24 deletions

View File

@ -175,14 +175,14 @@ VALUES (3, '全部退款', '20', 'pay_order_refund_status', 0, '全部退款', '
-- 退 -- 退
INSERT INTO `sys_dict_type`(`name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('退', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:42:50', '1', '2021-12-10 16:42:50', b'0'); INSERT INTO `sys_dict_type`(`name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('退', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:42:50', '1', '2021-12-10 16:42:50', b'0');
INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (117, 1, '退', '0', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:44:44', '1', '2021-12-10 16:44:44', b'0'); INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1117, 1, '退', '0', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:44:44', '1', '2021-12-10 16:44:44', b'0');
INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (118, 2, '退', '1', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:44:59', '1', '2021-12-10 16:44:59', b'0'); INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1118, 2, '退', '1', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:44:59', '1', '2021-12-10 16:44:59', b'0');
INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (119, 3, '退', '2', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:45:10', '1', '2021-12-10 16:45:10', b'0'); INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1119, 3, '退', '2', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:45:10', '1', '2021-12-10 16:45:10', b'0');
INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (120, 4, '退, ', '3', 'pay_refund_order_status', 0, '退, ', '1', '2021-12-10 16:45:32', '1', '2021-12-10 16:45:32', b'0'); INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1120, 4, '退, ', '3', 'pay_refund_order_status', 0, '退, ', '1', '2021-12-10 16:45:32', '1', '2021-12-10 16:45:32', b'0');
INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (121, 5, '退, ', '4', 'pay_refund_order_status', 0, '退, ', '1', '2021-12-10 16:45:48', '1', '2021-12-10 16:45:48', b'0'); INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1121, 5, '退, ', '4', 'pay_refund_order_status', 0, '退, ', '1', '2021-12-10 16:45:48', '1', '2021-12-10 16:45:48', b'0');
INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (122, 6, '', '5', 'pay_refund_order_status', 0, '', '1', '2021-12-10 16:46:03', '1', '2021-12-10 16:46:03', b'0'); INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1122, 6, '', '5', 'pay_refund_order_status', 0, '', '1', '2021-12-10 16:46:03', '1', '2021-12-10 16:46:03', b'0');
INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (123, 7, '', '6', 'pay_refund_order_status', 0, '', '1', '2021-12-10 16:46:13', '1', '2021-12-10 16:46:13', b'0'); INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1123, 7, '', '6', 'pay_refund_order_status', 0, '', '1', '2021-12-10 16:46:13', '1', '2021-12-10 16:46:13', b'0');
INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (124, 8, '退', '99', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:46:26', '1', '2021-12-10 16:46:26', b'0'); INSERT INTO `sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1124, 8, '退', '99', 'pay_refund_order_status', 0, '退', '1', '2021-12-10 16:46:26', '1', '2021-12-10 16:46:26', b'0');
-- 退 -- 退
INSERT INTO `sys_dict_type`(`name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('退', 'pay_refund_order_type', 0, '退', '1', '2021-12-10 17:14:53', '1', '2021-12-10 17:14:53', b'0'); INSERT INTO `sys_dict_type`(`name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('退', 'pay_refund_order_type', 0, '退', '1', '2021-12-10 17:14:53', '1', '2021-12-10 17:14:53', b'0');

View File

@ -5,7 +5,7 @@ INSERT INTO `sys_menu`(
`path`, `icon`, `component`, `status` `path`, `icon`, `component`, `status`
) )
VALUES ( VALUES (
'', '', 2, 0, ${table.parentMenuId}, '', '', 2, 0, 1117,
'merchant', '', 'pay/merchant/index', 0 'merchant', '', 'pay/merchant/index', 0
); );

View File

@ -1,7 +1,7 @@
-- SQL -- SQL
INSERT INTO `sys_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, INSERT INTO `sys_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`,
`path`, `icon`, `component`, `status`) `path`, `icon`, `component`, `status`)
VALUES ('', '', 2, 0, ${table.parentMenuId}, VALUES ('', '', 2, 0, 1117,
'order', '', 'pay/order/index', 0); 'order', '', 'pay/order/index', 0);
-- ID -- ID

View File

@ -75,7 +75,7 @@ public class PayMerchantController {
return success(PayMerchantConvert.INSTANCE.convert(merchant)); return success(PayMerchantConvert.INSTANCE.convert(merchant));
} }
@GetMapping("/list-name") @GetMapping("/list-name") // TODO @aquan/list-name =》/list-by-name
@ApiOperation("根据商户名称获得支付商户信息列表") @ApiOperation("根据商户名称获得支付商户信息列表")
@ApiImplicitParam(name = "name", value = "商户名称", example = "芋道", dataTypeClass = Long.class) @ApiImplicitParam(name = "name", value = "商户名称", example = "芋道", dataTypeClass = Long.class)
@PreAuthorize("@ss.hasPermission('pay:merchant:query')") @PreAuthorize("@ss.hasPermission('pay:merchant:query')")

View File

@ -1,6 +1,5 @@
package cn.iocoder.yudao.adminserver.modules.pay.service.merchant; package cn.iocoder.yudao.adminserver.modules.pay.service.merchant;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.adminserver.modules.pay.controller.merchant.vo.PayMerchantCreateReqVO; import cn.iocoder.yudao.adminserver.modules.pay.controller.merchant.vo.PayMerchantCreateReqVO;
import cn.iocoder.yudao.adminserver.modules.pay.controller.merchant.vo.PayMerchantExportReqVO; import cn.iocoder.yudao.adminserver.modules.pay.controller.merchant.vo.PayMerchantExportReqVO;
import cn.iocoder.yudao.adminserver.modules.pay.controller.merchant.vo.PayMerchantPageReqVO; import cn.iocoder.yudao.adminserver.modules.pay.controller.merchant.vo.PayMerchantPageReqVO;
@ -11,14 +10,13 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* Service * Service
* *
* @author * @author TODO @aquan
*/ */
public interface PayMerchantService { public interface PayMerchantService {

View File

@ -21,6 +21,7 @@ import java.util.List;
import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.PAY_MERCHANT_NOT_EXISTS; import static cn.iocoder.yudao.coreservice.modules.pay.enums.PayErrorCodeCoreConstants.PAY_MERCHANT_NOT_EXISTS;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
/** /**
* Service * Service
* *
@ -86,6 +87,7 @@ public class PayMerchantServiceImpl implements PayMerchantService {
return merchantMapper.selectList(exportReqVO); return merchantMapper.selectList(exportReqVO);
} }
// TODO @aquan接口上已经有注释这里不用在有啦
/** /**
* *
* *
@ -114,7 +116,6 @@ public class PayMerchantServiceImpl implements PayMerchantService {
return this.merchantMapper.getMerchantListByName(merchantName); return this.merchantMapper.getMerchantListByName(merchantName);
} }
/** /**
* *
* @param id * @param id
@ -134,6 +135,7 @@ public class PayMerchantServiceImpl implements PayMerchantService {
// TODO @芋艿:后续增加下合适的算法 // TODO @芋艿:后续增加下合适的算法
/** /**
* *
*
* @return * @return
*/ */
private String generateMerchantNo(){ private String generateMerchantNo(){

View File

@ -44,17 +44,16 @@ spring:
datasource: datasource:
master: master:
name: ruoyi-vue-pro name: ruoyi-vue-pro
url: jdbc:mysql://rm-j6cxl87683w973f78ho.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
username: chenquan username: root
password: Miraclequan@990429 password: 123456
slave: # 模拟从库,可根据自己需要修改 slave: # 模拟从库,可根据自己需要修改
name: ruoyi-vue-pro name: ruoyi-vue-pro
url: jdbc:mysql://rm-j6cxl87683w973f78ho.mysql.rds.aliyuncs.com:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
username: chenquan username: root
password: Miraclequan@990429 password: 123456
activiti: activiti:
#1.false:默认值activiti启动时对比数据库表中保存的版本如果不匹配。将抛出异常 #1.false:默认值activiti启动时对比数据库表中保存的版本如果不匹配。将抛出异常

View File

@ -35,7 +35,7 @@ export const DICT_TYPE = {
OA_LEAVE_TYPE: 'oa_leave_type', OA_LEAVE_TYPE: 'oa_leave_type',
// 商户状态 // 商户状态
PAY_MERCHANT_STATUS: 'pay_merchant_status', PAY_MERCHANT_STATUS: 'pay_merchant_status', // TODO @aquan一般使用 COMMON_RESULT 即可。保持数值一致,以后加更多状态的时候,在单独数据字典
// 应用状态 // 应用状态
PAY_APP_STATUS: 'pay_app_status', PAY_APP_STATUS: 'pay_app_status',
// 渠道状态 // 渠道状态