From 2e260ff834ac819beccd99963c50ee164a72e910 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 8 Sep 2022 11:05:47 +0800 Subject: [PATCH] gov_party_helper --- .../epmet/dto/result/CustomerParaResDTO.java | 21 ++++++++++++++++ .../CustomerParameterController.java | 13 ++++++++++ .../service/CustomerParameterService.java | 9 +++++++ .../impl/CustomerParameterServiceImpl.java | 24 +++++++++++++++++++ .../migration/V0.0.9__party_helper_param.sql | 3 +++ 5 files changed, 70 insertions(+) create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerParaResDTO.java create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.9__party_helper_param.sql diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerParaResDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerParaResDTO.java new file mode 100644 index 0000000000..7c7954d9a4 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerParaResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/9/8 10:44 + */ +@Data +public class CustomerParaResDTO implements Serializable { + /** + * 开启:open + * 关闭:closed + * 没有数据默认开启 + */ + private String govPartyHelper; +} + diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerParameterController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerParameterController.java index 006080bd6b..f31cd52346 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerParameterController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerParameterController.java @@ -1,9 +1,12 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CrmParameterFormDTO; import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.dto.result.CustomerParaResDTO; import com.epmet.service.CustomerParameterService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -50,4 +53,14 @@ public class CustomerParameterController { return new Result(); } + /** + * 查询客户定制化参数 + * 比如党建小助手是否开启 + * @param tokenDto + * @return + */ + @PostMapping("customize") + public Result queryCustomerCustomize(@LoginUser TokenDto tokenDto){ + return new Result().ok(parameterService.queryCustomerCustomize(tokenDto.getCustomerId())); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java index 4ff8119c79..ba8055f90e 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java @@ -4,6 +4,7 @@ import com.epmet.dto.form.CrmParameterFormDTO; import com.epmet.dto.form.FootBarPatternFormDTO; import com.epmet.dto.form.FootBarPatternQueryFormDTO; import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.dto.result.CustomerParaResDTO; import com.epmet.dto.result.FootBarPatternQueryResultDTO; import java.util.List; @@ -49,4 +50,12 @@ public interface CustomerParameterService { * @date 2021/7/27 17:24 */ void saveFootBarPattern(FootBarPatternFormDTO formDTO); + + /** + * 查询客户定制化参数 + * 比如党建小助手是否开启 + * @param customerId + * @return + */ + CustomerParaResDTO queryCustomerCustomize(String customerId); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java index fc7cd29f80..e00e1b54ac 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; @@ -10,6 +11,7 @@ import com.epmet.dto.form.FootBarPatternFormDTO; import com.epmet.dto.form.FootBarPatternQueryFormDTO; import com.epmet.dto.result.CheckFloatFootBarResultDTO; import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.dto.result.CustomerParaResDTO; import com.epmet.dto.result.FootBarPatternQueryResultDTO; import com.epmet.entity.CustomerParameterEntity; import com.epmet.feign.OperCustomizeOpenFeignClient; @@ -146,5 +148,27 @@ public class CustomerParameterServiceImpl implements CustomerParameterService { } } + /** + * 查询客户定制化参数 + * 比如党建小助手是否开启 + * + * @param customerId + * @return + */ + @Override + public CustomerParaResDTO queryCustomerCustomize(String customerId) { + CustomerParaResDTO resDTO = new CustomerParaResDTO(); + resDTO.setGovPartyHelper("open"); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CustomerParameterEntity::getCustomerId, customerId) + .eq(CustomerParameterEntity::getParameterKey, "gov_party_helper") + .last("limit 1"); + CustomerParameterEntity customerParameterEntity = parameterDao.selectOne(queryWrapper); + if (null != customerParameterEntity) { + resDTO.setGovPartyHelper(customerParameterEntity.getParameterValue()); + } + return resDTO; + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.9__party_helper_param.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.9__party_helper_param.sql new file mode 100644 index 0000000000..5cc11e5f73 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.9__party_helper_param.sql @@ -0,0 +1,3 @@ +INSERT INTO `epmet_oper_crm`.`customer_parameter` ( `ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_SWITCH`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` ) +VALUES + ( '5ce6f22c-2f22-11ed-bb6b-0050568f8cf7', 'default', 'gov_party_helper', '工作端党建小助手是否开启?', 'on', 'open', '开启:open;关闭:closed;不配置,默认是开启', 0, 0, 'APP_USER', '2022-09-08 11:03:35', 'APP_USER', '2022-09-08 11:03:45' ); \ No newline at end of file