From c5fd4f60adb2ab735a9f2bd5242fdf31e84f45d2 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 18 Mar 2021 16:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=AF=B9=E6=8E=A5=E7=9A=84=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/ThirdPlatformFormDTO.java | 8 +-- .../controller/ThirdPlatformController.java | 26 ++++----- .../dao/ThirdplatformCustomerActionDao.java | 33 +++++++++++ .../java/com/epmet/dao/ThirdplatformDao.java | 4 ++ .../ThirdplatformCustomerActionEntity.java | 56 +++++++++++++++++++ .../ThirdplatformCustomerRegisterEntity.java | 4 ++ .../epmet/service/ThirdPlatformService.java | 3 +- .../impl/ThirdPlatformServiceImpl.java | 10 +++- .../mapper/ThirdplatformCustomerActionDao.xml | 20 +++++++ .../ThirdplatformCustomerRegisterDao.xml | 4 ++ .../resources/mapper/ThirdplatformDao.xml | 42 ++++++++++++++ 11 files changed, 189 insertions(+), 21 deletions(-) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerActionDao.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ThirdplatformCustomerActionEntity.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerActionDao.xml diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ThirdPlatformFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ThirdPlatformFormDTO.java index c2ff1a3666..475a09a4de 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ThirdPlatformFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ThirdPlatformFormDTO.java @@ -8,14 +8,14 @@ import javax.validation.constraints.NotBlank; public class ThirdPlatformFormDTO { // 根据客户和动作查询分组 - public interface ListByCustomerAndActionGroup {} + public interface ListAvailableByCustomerAndActionGroup {} // 根据动作查询分组 - public interface ListByActionGroup {} + public interface ListSelectableByCustomerAndActionGroup {} - @NotBlank(message = "客户ID不能为空", groups = { ListByCustomerAndActionGroup.class }) + @NotBlank(message = "客户ID不能为空", groups = { ListAvailableByCustomerAndActionGroup.class }) private String customerId; - @NotBlank(message = "客户ID不能为空", groups = { ListByCustomerAndActionGroup.class, ListByActionGroup.class }) + @NotBlank(message = "客户ID不能为空", groups = { ListAvailableByCustomerAndActionGroup.class, ListSelectableByCustomerAndActionGroup.class }) private String actionKey; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ThirdPlatformController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ThirdPlatformController.java index a8196d2520..92976c57e1 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ThirdPlatformController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ThirdPlatformController.java @@ -24,32 +24,32 @@ public class ThirdPlatformController { private ThirdPlatformService thirdPlatformService; /** - * 根据客户id和动作,列出客户开通可用的第三方平台 + * 根据客户id和动作,列出客户登记可用的第三方平台 + * * @param input * @return */ - @PostMapping("customer/list-platforms-by-action") - public Result> listPlatformsByCustomerAndAction(@RequestBody ThirdPlatformFormDTO input) { - ValidatorUtils.validateEntity(input, ThirdPlatformFormDTO.ListByCustomerAndActionGroup.class); - List platformRegs = thirdPlatformService.listDTOS(input.getCustomerId(), input.getActionKey()); + @PostMapping("customer/list-available-platforms-by-action") + public Result> listAvailablePlatformsByCustomerAndAction(@RequestBody ThirdPlatformFormDTO input) { + ValidatorUtils.validateEntity(input, ThirdPlatformFormDTO.ListAvailableByCustomerAndActionGroup.class); + List platformRegs = thirdPlatformService.listAvailablePlatformsByCustomerAndAction(input.getCustomerId(), input.getActionKey()); return new Result>().ok(platformRegs); } /** - * @Description 根据动作列出平台列表 * @return + * @Description 根据客户id和动作,列出客户可选的第三方系统 * @author wxz * @date 2021.03.18 10:54 - */ - @PostMapping("list-platforms-by-action") - public Result> listPlatformsByAction(@RequestBody ThirdPlatformFormDTO input) { - ValidatorUtils.validateEntity(input, ThirdPlatformFormDTO.ListByActionGroup.class); - List platformRegs = thirdPlatformService.listDTOS(null, input.getActionKey()); - return new Result>().ok(platformRegs); + */ + @PostMapping("customer/list-selectable-platforms-by-action") + public Result> listSelectablePlatformsByAction(@RequestBody ThirdPlatformFormDTO input) { + ValidatorUtils.validateEntity(input, ThirdPlatformFormDTO.ListSelectableByCustomerAndActionGroup.class); + List platformRegs = thirdPlatformService.listSelectableByCustomerAndActionGroup(input.getCustomerId(), input.getActionKey()); + return new Result>().ok(platformRegs); } //@PostMapping("register") - } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerActionDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerActionDao.java new file mode 100644 index 0000000000..4b937061fd --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerActionDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ThirdplatformCustomerActionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户针对指定操作所选用的第三方平台列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-18 + */ +@Mapper +public interface ThirdplatformCustomerActionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformDao.java index e86e63b7f2..8b5e7840cc 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformDao.java @@ -39,4 +39,8 @@ public interface ThirdplatformDao extends BaseDao { * @return */ List listDTOS(@Param("customerId") String customerId, @Param("actionKey") String actionKey); + + List listAvailablePlatformsByCustomerAndAction(@Param("customerId") String customerId, @Param("actionKey") String actionKey); + + List listSelectableByCustomerAndActionGroup(@Param("customerId") String customerId, @Param("actionKey") String actionKey); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ThirdplatformCustomerActionEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ThirdplatformCustomerActionEntity.java new file mode 100644 index 0000000000..8be40a1a0b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ThirdplatformCustomerActionEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户针对指定操作所选用的第三方平台列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("thirdplatform_customer_action") +public class ThirdplatformCustomerActionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 平台ID + */ + private String platformId; + + /** + * 动作key + */ + private String actionKey; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ThirdplatformCustomerRegisterEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ThirdplatformCustomerRegisterEntity.java index b3b77fb626..8f19691433 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ThirdplatformCustomerRegisterEntity.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ThirdplatformCustomerRegisterEntity.java @@ -48,4 +48,8 @@ public class ThirdplatformCustomerRegisterEntity extends BaseEpmetEntity { */ private String platformId; + private String customizedPlatformName; + + private String customizedPlatformIcon; + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java index 8110c4b5b3..aa86027db9 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java @@ -6,6 +6,7 @@ import java.util.List; public interface ThirdPlatformService { - List listDTOS(String customerId, String actionKey); + List listAvailablePlatformsByCustomerAndAction(String customerId, String actionKey); + List listSelectableByCustomerAndActionGroup(String customerId, String actionKey); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java index 5e23671983..9a7ed8bb3c 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java @@ -1,6 +1,5 @@ package com.epmet.service.impl; -import com.epmet.dao.ThirdplatformCustomerRegisterDao; import com.epmet.dao.ThirdplatformDao; import com.epmet.dto.result.ThirdplatformResultDTO; import com.epmet.service.ThirdPlatformService; @@ -16,7 +15,12 @@ public class ThirdPlatformServiceImpl implements ThirdPlatformService { private ThirdplatformDao thirdplatformDao; @Override - public List listDTOS(String customerId, String actionKey) { - return thirdplatformDao.listDTOS(customerId, actionKey); + public List listAvailablePlatformsByCustomerAndAction(String customerId, String actionKey) { + return thirdplatformDao.listAvailablePlatformsByCustomerAndAction(customerId, actionKey); + } + + @Override + public List listSelectableByCustomerAndActionGroup(String customerId, String actionKey) { + return thirdplatformDao.listSelectableByCustomerAndActionGroup(customerId, actionKey); } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerActionDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerActionDao.xml new file mode 100644 index 0000000000..33c76cfd7a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerActionDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml index 4e5577228e..e4cdddc98d 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml @@ -7,6 +7,8 @@ + + @@ -20,6 +22,8 @@ select tcr.id, customer_id, platform_id, + customized_platform_name, + customized_platform_icon, del_flag, revision, created_by, diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformDao.xml index 0db6eba1f2..beec9ed36d 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformDao.xml @@ -45,4 +45,46 @@ + + + \ No newline at end of file