From 205b8204c420e2e2920caad549788c31a1aad8cc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 23 Apr 2021 09:20:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?group=5Fmessage=20=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=95=B0=E6=8D=AEsql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.16__group_act.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.16__group_act.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.16__group_act.sql index 819b58e9ee..a80b4f042b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.16__group_act.sql +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.16__group_act.sql @@ -17,6 +17,28 @@ CREATE TABLE `group_message` ( PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组内消息(话题、通知、活动)记录表'; +INSERT INTO group_message SELECT + md5(uuid()), + rg.customer_id, + rg.grid_id, + rt.group_id, + 'topic', + rt.id, + rt.created_by, + rt.`status`, + rt.created_time, + '0', + '0', + rt.created_by, + NOW(), + rt.UPDATED_BY, + NOW() + FROM + resi_topic rt + INNER JOIN resi_group rg ON rt.group_id = rg.id + WHERE + rt.del_flag = '0' + AND rg.del_flag = '0' /* Navicat Premium Data Transfer From 49c184805889ac5d98d5da1575cd49288bf510a0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 23 Apr 2021 10:27:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E7=A0=81=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/modules/utils/ModuleConstant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java index fd2a9310c9..038b0ad745 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java @@ -372,7 +372,7 @@ public interface ModuleConstant extends Constant { /** * 活动扫码签到,对应的跳转到 活动详情页面 */ - String GROUP_ACT_DETAIL_PAGE = "pages/group/activity/detail"; + String GROUP_ACT_DETAIL_PAGE = "subpages/group/pages/group/activity/detail"; String TOPIC_CONTENT_AND_VOICE_IS_NULL = "请输入话题内容或语音"; From db35fa98b1a6101c155a54ff1eb8f0abbc9288de Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 23 Apr 2021 14:13:25 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=9F=A5=E8=BF=87=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=BC=95=E8=B5=B7=E7=9A=84=E4=BB=A3=E7=A0=81=E5=8F=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/resi/group/dto/notice/NoticeDTO.java | 5 +++++ .../resi/group/dto/notice/form/AddNoticeFormDTO.java | 12 +++++++++++- .../group/dto/notice/form/EditNoticeFormDTO.java | 11 +++++++++++ .../modules/notice/controller/NoticeController.java | 9 +++++++++ .../epmet/modules/notice/entity/NoticeEntity.java | 5 +++++ .../notice/service/impl/NoticeServiceImpl.java | 2 ++ 6 files changed, 43 insertions(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeDTO.java index 1ef416538c..d45950bd44 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeDTO.java @@ -78,6 +78,11 @@ public class NoticeDTO implements Serializable { */ private Date changeTime; + /** + * 通知过期时间(此时间需大于变更时间) + */ + private Date expirationTime; + /** * 删除标记 0:未删除,1:已删除 */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java index 2344e94898..ad95a99cd4 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java @@ -1,10 +1,14 @@ package com.epmet.resi.group.dto.notice.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; import java.util.List; /** @@ -31,6 +35,13 @@ public class AddNoticeFormDTO { @NotBlank(message = "通知内容不能为空",groups = {AddNoticeFormDTO.AddUserShow.class}) @Length(max = 1000, message = "通知内容不能超过1000个字符",groups = {AddNoticeFormDTO.AddUserShow.class}) private String content; + /** + * 通知过期时间(此时间需大于变更时间) + */ + @NotNull(message = "过期时间不能为空",groups = AddNoticeFormDTO.AddUserShow.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date expirationTime; /** * 图片附件集合 */ @@ -39,7 +50,6 @@ public class AddNoticeFormDTO { * 文件附件url集合 */ private List docList; - /** * token中用户Id */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java index 940077459f..c43f8d0e69 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java @@ -1,10 +1,14 @@ package com.epmet.resi.group.dto.notice.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; import java.util.List; /** @@ -31,6 +35,13 @@ public class EditNoticeFormDTO { @NotBlank(message = "通知内容不能为空",groups = {EditNoticeFormDTO.EditUserShow.class}) @Length(max = 1000, message = "通知内容不能超过1000个字符",groups = {EditNoticeFormDTO.EditUserShow.class}) private String content; + /** + * 通知过期时间(此时间需大于变更时间) + */ + @NotNull(message = "过期时间不能为空",groups = AddNoticeFormDTO.AddUserShow.class) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date expirationTime; /** * 图片附件集合 */ diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java index ad2a0dd9dc..0736625518 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java @@ -18,6 +18,7 @@ package com.epmet.modules.notice.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -30,6 +31,8 @@ import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.Date; + /** * 小组通知表 @@ -59,6 +62,9 @@ public class NoticeController { @PostMapping(value = "add") public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddNoticeFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AddNoticeFormDTO.Add.class, AddNoticeFormDTO.AddUserShow.class); + if(formDTO.getExpirationTime().before(new Date())){ + throw new RenException("通知过期时间不能早于当前时间"); + } formDTO.setUserId(tokenDto.getUserId()); noticeService.add(formDTO); return new Result(); @@ -73,6 +79,9 @@ public class NoticeController { @PostMapping(value = "edit") public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditNoticeFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, EditNoticeFormDTO.Edit.class, EditNoticeFormDTO.EditUserShow.class); + if(formDTO.getExpirationTime().before(new Date())){ + throw new RenException("通知过期时间不能早于当前时间"); + } formDTO.setUserId(tokenDto.getUserId()); noticeService.edit(formDTO); return new Result(); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeEntity.java index b12dce96ca..46173d1d3a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeEntity.java @@ -78,4 +78,9 @@ public class NoticeEntity extends BaseEpmetEntity { */ private Date changeTime; + /** + * 通知过期时间(此时间需大于变更时间) + */ + private Date expirationTime; + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java index 65a2ecf861..c7f03be409 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java @@ -180,6 +180,7 @@ public class NoticeServiceImpl extends BaseServiceImpl entity.setContent(formDTO.getContent()); entity.setIsChange("no"); entity.setChangeTime(new Date()); + entity.setExpirationTime(formDTO.getExpirationTime()); insert(entity); //5.保存附件数据 @@ -310,6 +311,7 @@ public class NoticeServiceImpl extends BaseServiceImpl entity.setContent(formDTO.getContent()); entity.setIsChange("yes"); entity.setChangeTime(new Date()); + entity.setExpirationTime(formDTO.getExpirationTime()); baseDao.updateById(entity); //5.通知附件表数据先删后增 From 4a0a337583bd9e96274bc199f7b6c09f6f77e660 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 23 Apr 2021 14:13:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=9F=A5=E8=BF=87=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=BC=95=E8=B5=B7=E7=9A=84=E4=BB=A3=E7=A0=81=E5=8F=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V0.0.17__alter_notice.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.17__alter_notice.sql diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.17__alter_notice.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.17__alter_notice.sql new file mode 100644 index 0000000000..29ef1d8a78 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.17__alter_notice.sql @@ -0,0 +1,2 @@ +ALTER TABLE `notice` +ADD COLUMN `EXPIRATION_TIME` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '通知过期时间(此时间需大于变更时间)' AFTER `CHANGE_TIME`;