From 1c83d3a22c5676c684f3d9d33964458d059c2cef Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Jul 2020 14:02:42 +0800 Subject: [PATCH] =?UTF-8?q?heart-work=EF=BC=9Asaveact=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/work/SaveActContentFormDTO.java | 31 +++ .../dto/form/work/SaveActInfoFormDTO.java | 182 ++++++++++++++++++ .../work/LatestDraftActInfoResultDTO.java | 3 + .../work/PublishActInitResultDTO.java | 2 +- .../result/work/SaveActDraftResultDTO.java | 21 ++ .../controller/WorkActDraftController.java | 20 +- .../epmet/service/WorkActDraftService.java | 13 +- .../service/impl/WorkActDraftServiceImpl.java | 16 +- 8 files changed, 284 insertions(+), 4 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java rename epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/{form => result}/work/PublishActInitResultDTO.java (91%) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java new file mode 100644 index 0000000000..3117a66132 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActContentFormDTO.java @@ -0,0 +1,31 @@ +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/21 13:18 + */ +@Data +public class SaveActContentFormDTO implements Serializable { + private static final long serialVersionUID = 5236509944250440348L; + public interface UserInternalGroup {} + public interface UserShowGroup extends CustomerClientShowGroup {} + /** + * 内容 + */ + @NotBlank(message = "内容不能为空", groups = {UserShowGroup.class }) + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + @NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class }) + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java new file mode 100644 index 0000000000..39df684d03 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActInfoFormDTO.java @@ -0,0 +1,182 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 预览-保存活动草稿入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 13:17 + */ +@Data +public class SaveActInfoFormDTO implements Serializable { + private static final long serialVersionUID = -4967079570884814526L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + @Valid + private List actContent; + + /** + * 活动草稿id,如果是编辑之前的活动草稿,此列是有值的 + */ + private String actDraftId; + + + /** + * 如果是重新发布活动,此列是有值的 + */ + private String actId; + + /** + * 活动标题 + */ + @NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class }) + private String title; + + /** + * 封面图 + */ + @NotBlank(message = "封面图不能为空", groups = {AddUserShowGroup.class }) + private String coverPic; + + /** + * 活动地点 + */ + @NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class }) + private String actAddress; + + /** + * 活动地点-经度 + */ + @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class }) + private String actLongitude; + + /** + * 活动地点-纬度 + */ + @NotBlank(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class }) + private String actLatitude; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计开始时间不能为空", groups = {AddUserShowGroup.class }) + private String actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计结束时间不能为空", groups = {AddUserShowGroup.class }) + private String actEndTime; + + /** + * 活动人数 + */ + @Min(0) + private Integer actQuota; + + /** + * 活动积分 + */ + @Min(0) + private Integer reward; + + /** + * 报名审核:true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动 + */ + @NotNull(message = "报名身份不能为空",groups = {AddUserInternalGroup.class}) + private Boolean volunteerLimit; + + /** + * 报名审核: true: 需人工审核 false: 无需审核 + */ + @NotNull(message = "报名审核方式不能为空",groups = {AddUserInternalGroup.class}) + private Boolean auditSwitch; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "报名截止时间不能为空", groups = {AddUserShowGroup.class }) + private String signUpEndTime; + + /** + * 报名条件 + */ + @NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class }) + private String requirement; + + /** + * 签到开始时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到开始时间不能为空", groups = {AddUserShowGroup.class }) + private String signInStartTime; + + /** + * 签到结束时间: yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到结束时间不能为空", groups = {AddUserShowGroup.class }) + private String signInEndTime; + + /** + * 签到地址 + */ + @NotBlank(message = "签到地址不能为空", groups = {AddUserShowGroup.class }) + private String signInAddress; + + /** + * 签到地址-纬度 + */ + @NotBlank(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class }) + private String signInLatitude; + + /** + * 签到地址-经度 + */ + @NotBlank(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class }) + private String signInLongitude; + + /** + * 签到有效范围(米) + */ + @Min(0) + private Integer signInRadius; + + /** + * 主办方id + */ + @NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class }) + private String sponsorId; + + /** + * 主办方类型:以网格名义:grid , 以机关名义: agency + */ + @NotBlank(message = "主办方类型不能为空", groups = {AddUserInternalGroup.class }) + private String sponsorType; + + /** + * 主办方名称 + */ + @NotBlank(message = "主办方名称不能为空", groups = {AddUserShowGroup.class }) + private String sponsorName; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空", groups = {AddUserShowGroup.class }) + private String sponsorContacts; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class }) + private String sponsorTel; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java index 3f5a6dacaa..4e3e933be4 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java @@ -17,6 +17,9 @@ import java.util.List; @Data public class LatestDraftActInfoResultDTO implements Serializable { private static final long serialVersionUID = 4104775168048712734L; + /** + * 活动草稿id + */ private String actDraftId; /** * 客户id diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInitResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java similarity index 91% rename from epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInitResultDTO.java rename to epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java index 94b9e8b7af..08c3ff1d97 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInitResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dto.form.work; +package com.epmet.dto.result.work; import lombok.Data; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java new file mode 100644 index 0000000000..248519fc28 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 预览-保存活动草稿返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 12:53 + */ +@Data +public class SaveActDraftResultDTO implements Serializable { + private static final long serialVersionUID = -111427814347693729L; + + /** + * 活动草稿id + */ + private String actDraftId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java index c224a270a9..69645c02a5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -1,11 +1,15 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.work.PublishActInitResultDTO; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.SaveActInfoFormDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.dto.result.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.SaveActDraftResultDTO; import com.epmet.service.WorkActDraftService; 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; @@ -60,4 +64,18 @@ public class WorkActDraftController { LatestDraftActInfoResultDTO resultDTO=workActDraftService.getLatestDraft(); return new Result().ok(resultDTO); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + @PostMapping("saveact") + public Result saveAct(@RequestBody SaveActInfoFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + SaveActDraftResultDTO resultDTO=workActDraftService.saveAct(formDTO); + return new Result().ok(resultDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java index 016a8e9564..6e56268955 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java @@ -1,7 +1,9 @@ package com.epmet.service; -import com.epmet.dto.form.work.PublishActInitResultDTO; +import com.epmet.dto.form.work.SaveActInfoFormDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.dto.result.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.SaveActDraftResultDTO; /** * 工作端活动草稿 @@ -37,4 +39,13 @@ public interface WorkActDraftService { * @Date 2020/7/20 22:29 **/ LatestDraftActInfoResultDTO getLatestDraft(); + + /** + * @return com.epmet.dto.result.work.SaveActDraftResultDTO + * @param formDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + SaveActDraftResultDTO saveAct(SaveActInfoFormDTO formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java index 4fbe13acf7..c2ea713fc7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -1,9 +1,11 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.dto.form.work.PublishActInitResultDTO; +import com.epmet.dto.form.work.SaveActInfoFormDTO; import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.dto.result.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.SaveActDraftResultDTO; import com.epmet.service.LatestActContentService; import com.epmet.service.LatestActInfoService; import com.epmet.service.WorkActDraftService; @@ -89,4 +91,16 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { } return null; } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.SaveActDraftResultDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + @Override + public SaveActDraftResultDTO saveAct(SaveActInfoFormDTO formDTO) { + return null; + } }