From 4b5c185608d8dab5a60360d86342233c1752bdd2 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 25 Dec 2021 17:53:18 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=20=E6=94=AF=E4=BB=98=E5=95=86?= =?UTF-8?q?=E6=88=B7=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/pay-dict.sql | 18 +++++++++--------- sql/pay-merchant-menu.sql | 2 +- sql/pay-order-menu.sql | 2 +- .../merchant/PayMerchantController.java | 2 +- .../service/merchant/PayMerchantService.java | 4 +--- .../merchant/impl/PayMerchantServiceImpl.java | 4 +++- .../src/main/resources/application-local.yaml | 13 ++++++------- yudao-admin-ui/src/utils/dict.js | 2 +- 8 files changed, 23 insertions(+), 24 deletions(-) diff --git a/sql/pay-dict.sql b/sql/pay-dict.sql index 4e61b3d6e..fecfdbc14 100644 --- a/sql/pay-dict.sql +++ b/sql/pay-dict.sql @@ -175,17 +175,17 @@ 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_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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 `ruoyi-vue-pro`.`sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (125, 1, '未退款', '0', 'pay_refund_order_type', 0, '未退款', '1', '2021-12-10 17:15:11', '1', '2021-12-10 17:15:11', b'0'); INSERT INTO `ruoyi-vue-pro`.`sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (126, 2, '部分退款', '10', 'pay_refund_order_type', 0, '部分退款', '1', '2021-12-10 17:15:24', '1', '2021-12-10 17:15:24', b'0'); -INSERT INTO `ruoyi-vue-pro`.`sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (127, 3, '全部退款', '20', 'pay_refund_order_type', 0, '全部退款', '1', '2021-12-10 17:15:34', '1', '2021-12-10 17:15:34', b'0'); \ No newline at end of file +INSERT INTO `ruoyi-vue-pro`.`sys_dict_data`(`id`, `sort`, `label`, `value`, `dict_type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (127, 3, '全部退款', '20', 'pay_refund_order_type', 0, '全部退款', '1', '2021-12-10 17:15:34', '1', '2021-12-10 17:15:34', b'0'); diff --git a/sql/pay-merchant-menu.sql b/sql/pay-merchant-menu.sql index 65b4ceb9b..e0c9ef9ac 100644 --- a/sql/pay-merchant-menu.sql +++ b/sql/pay-merchant-menu.sql @@ -5,7 +5,7 @@ INSERT INTO `sys_menu`( `path`, `icon`, `component`, `status` ) VALUES ( - '支付商户信息管理', '', 2, 0, ${table.parentMenuId}, + '支付商户信息管理', '', 2, 0, 1117, 'merchant', '', 'pay/merchant/index', 0 ); diff --git a/sql/pay-order-menu.sql b/sql/pay-order-menu.sql index 6a1260c2c..d4b7b14cb 100644 --- a/sql/pay-order-menu.sql +++ b/sql/pay-order-menu.sql @@ -1,7 +1,7 @@ -- 菜单 SQL INSERT INTO `sys_menu`(`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`) -VALUES ('支付订单管理', '', 2, 0, ${table.parentMenuId}, +VALUES ('支付订单管理', '', 2, 0, 1117, 'order', '', 'pay/order/index', 0); -- 按钮父菜单ID diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/merchant/PayMerchantController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/merchant/PayMerchantController.java index 984533412..54f8056c8 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/merchant/PayMerchantController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/merchant/PayMerchantController.java @@ -75,7 +75,7 @@ public class PayMerchantController { return success(PayMerchantConvert.INSTANCE.convert(merchant)); } - @GetMapping("/list-name") + @GetMapping("/list-name") // TODO @aquan:/list-name =》/list-by-name @ApiOperation("根据商户名称获得支付商户信息列表") @ApiImplicitParam(name = "name", value = "商户名称", example = "芋道", dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('pay:merchant:query')") diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/PayMerchantService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/PayMerchantService.java index 57bb6ec40..9b082ffa1 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/PayMerchantService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/PayMerchantService.java @@ -1,6 +1,5 @@ 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.PayMerchantExportReqVO; 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 java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.Map; /** * 支付商户信息 Service 接口 * - * @author 芋艿 + * @author 芋艿 TODO @aquan:作者是你哈 */ public interface PayMerchantService { diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/impl/PayMerchantServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/impl/PayMerchantServiceImpl.java index 61d71eca8..932cbdfbd 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/impl/PayMerchantServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/merchant/impl/PayMerchantServiceImpl.java @@ -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.framework.common.exception.util.ServiceExceptionUtil.exception; + /** * 支付商户信息 Service 实现类 * @@ -86,6 +87,7 @@ public class PayMerchantServiceImpl implements PayMerchantService { return merchantMapper.selectList(exportReqVO); } + // TODO @aquan:接口上已经有注释,这里不用在有啦 /** * 修改商户状态 * @@ -114,7 +116,6 @@ public class PayMerchantServiceImpl implements PayMerchantService { return this.merchantMapper.getMerchantListByName(merchantName); } - /** * 检查商户是否存在 * @param id 商户编号 @@ -134,6 +135,7 @@ public class PayMerchantServiceImpl implements PayMerchantService { // TODO @芋艿:后续增加下合适的算法 /** * 根据年月日时分秒毫秒生成商户号 + * * @return 商户号 */ private String generateMerchantNo(){ diff --git a/yudao-admin-server/src/main/resources/application-local.yaml b/yudao-admin-server/src/main/resources/application-local.yaml index 89709ebd3..6a7fa17a5 100644 --- a/yudao-admin-server/src/main/resources/application-local.yaml +++ b/yudao-admin-server/src/main/resources/application-local.yaml @@ -44,17 +44,16 @@ spring: datasource: master: 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 - username: chenquan - password: Miraclequan@990429 + username: root + password: 123456 slave: # 模拟从库,可根据自己需要修改 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 - username: chenquan - password: Miraclequan@990429 - + username: root + password: 123456 activiti: #1.false:默认值,activiti启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 diff --git a/yudao-admin-ui/src/utils/dict.js b/yudao-admin-ui/src/utils/dict.js index 632b3fbaf..dae5d4916 100644 --- a/yudao-admin-ui/src/utils/dict.js +++ b/yudao-admin-ui/src/utils/dict.js @@ -35,7 +35,7 @@ export const DICT_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', // 渠道状态