From 15a15c885501f812586764228d27bfd2b33c6836 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 20 Jul 2020 17:43:58 +0800 Subject: [PATCH] =?UTF-8?q?heart=E5=B7=A5=E4=BD=9C=E7=AB=AF-=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D=E7=BD=AE=E3=80=81?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E4=BF=AE=E6=94=B9=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/work/ActCustomizedFormDTO.java | 23 +++++++ .../form/work/SaveActCustomizedFormDTO.java | 62 +++++++++++++++++++ .../result/work/ActCustomizedResultDTO.java | 51 +++++++++++++++ .../epmet/constant/ActCustomizedConstant.java | 40 ++++++++++++ .../controller/ActCustomizedController.java | 34 +++++++++- .../java/com/epmet/dao/ActCustomizedDao.java | 11 +++- .../epmet/service/ActCustomizedService.java | 21 +++++++ .../impl/ActCustomizedServiceImpl.java | 61 +++++++++++++++++- .../resources/mapper/ActCustomizedDao.xml | 17 ++++- 9 files changed, 315 insertions(+), 5 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java new file mode 100644 index 0000000000..5a4cfe3d5c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 获取自定义配置项-入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 15:17 + */ +@Data +public class ActCustomizedFormDTO implements Serializable { + private static final long serialVersionUID = 7089647420851532829L; + public interface AddUserInternalGroup {} + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java new file mode 100644 index 0000000000..e6af4266e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 保存自定义配置-入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 17:22 + */ +@Data +public class SaveActCustomizedFormDTO implements Serializable { + + private static final long serialVersionUID = 5571356065160809543L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + /** + * act_customized主键 + */ + @NotBlank(message = "主键不能为空", groups = { AddUserInternalGroup.class }) + private String actCustomizedId; + + /** + * 标题:志愿者去哪儿 + */ + @NotBlank(message = "标题不能为空", groups = { AddUserShowGroup.class }) + private String titleName; + + /** + * 咨询热线 + */ + @NotBlank(message = "咨询热线不能为空", groups = { AddUserShowGroup.class }) + private String hotLine; + + /** + * 活动列表 + */ + @NotBlank(message = "活动列表名称不能为空", groups = { AddUserShowGroup.class }) + private String actListName; + + /** + * 爱心榜 + */ + @NotBlank(message = "爱心榜列表名称不能为空", groups = { AddUserShowGroup.class }) + private String heartRankName; + + /** + * 活动回顾 + */ + @NotBlank(message = "活动回顾列表名称不能为空", groups = { AddUserShowGroup.class }) + private String actReviewName; + + /** + * 我的活动 + */ + @NotBlank(message = "我的回顾列表名称不能为空", groups = { AddUserShowGroup.class }) + private String myActName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java new file mode 100644 index 0000000000..f06d4eaa89 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 获取自定义配置项-返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 15:03 + */ +@Data +public class ActCustomizedResultDTO implements Serializable { + private static final long serialVersionUID = 5784819474548493258L; + + /** + * act_customized主键 + */ + private String actCustomizedId; + + /** + * 标题:志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotLine; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java new file mode 100644 index 0000000000..e097fcd814 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java @@ -0,0 +1,40 @@ +package com.epmet.constant; + +/** + * 爱心互助自定义配置项 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 16:54 + */ +public interface ActCustomizedConstant { + + /** + * 标题:志愿者去哪儿 + */ + String TITLE_NAME = "志愿者去哪儿"; + + /** + * 咨询热线 + */ + String HOT_LINE = ""; + + /** + * 活动列表 + */ + String ACT_LIST_NAME = "活动列表"; + + /** + * 爱心榜 + */ + String HEART_RANK_NAME = "爱心榜"; + + /** + * 活动回顾 + */ + String ACT_REVIEW_NAME = "活动回顾"; + + /** + * 我的活动 + */ + String MY_ACT_NAME = "我的活动"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java index cbc7bf3083..c65621aae9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java @@ -17,8 +17,15 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; import com.epmet.service.ActCustomizedService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -36,6 +43,31 @@ public class ActCustomizedController { @Autowired private ActCustomizedService actCustomizedService; + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 15:42 + **/ + @PostMapping("getconfigs") + public Result getConfigs(@RequestBody ActCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActCustomizedFormDTO.AddUserInternalGroup.class); + ActCustomizedResultDTO resultDTO=actCustomizedService.getConfigs(formDTO); + return new Result().ok(resultDTO); + } - + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 保存自定义配置 + * @Date 2020/7/20 17:25 + **/ + @PostMapping("save") + public Result saveConfigs(@RequestBody SaveActCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SaveActCustomizedFormDTO.AddUserShowGroup.class,SaveActCustomizedFormDTO.AddUserInternalGroup.class); + actCustomizedService.saveConfigs(formDTO); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java index ecb50483a9..80a94700f9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActCustomizedResultDTO; import com.epmet.entity.ActCustomizedEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +30,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActCustomizedDao extends BaseDao { - + + /** + * @param customerId + * @return com.epmet.dto.result.work.ActCustomizedResultDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 17:04 + **/ + ActCustomizedResultDTO selectConfigsByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java index d53305c49f..3d539c4076 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java @@ -20,6 +20,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.ActCustomizedDTO; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; import com.epmet.entity.ActCustomizedEntity; import java.util.List; @@ -92,4 +95,22 @@ public interface ActCustomizedService extends BaseService { * @date 2020-07-19 */ void delete(String[] ids); + + /** + * @return com.epmet.dto.result.work.ActCustomizedResultDTO + * @param formDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 15:42 + **/ + ActCustomizedResultDTO getConfigs(ActCustomizedFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 保存自定义配置 + * @Date 2020/7/20 17:26 + **/ + void saveConfigs(SaveActCustomizedFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java index f81e5f9672..d3f5539d70 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java @@ -20,15 +20,21 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.ActCustomizedConstant; import com.epmet.dao.ActCustomizedDao; import com.epmet.dto.ActCustomizedDTO; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; import com.epmet.entity.ActCustomizedEntity; import com.epmet.redis.ActCustomizedRedis; import com.epmet.service.ActCustomizedService; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,7 +51,7 @@ import java.util.Map; */ @Service public class ActCustomizedServiceImpl extends BaseServiceImpl implements ActCustomizedService { - + private Logger logger = LogManager.getLogger(ActCustomizedServiceImpl.class); @Autowired private ActCustomizedRedis actCustomizedRedis; @@ -101,4 +107,55 @@ public class ActCustomizedServiceImpl extends BaseServiceImpl - + + \ No newline at end of file