diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java index 8ec0a07554..d31e01cab8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java @@ -5,9 +5,8 @@ import lombok.Data; import java.io.Serializable; /** - * @Description 推荐小组查询返参 - * @Author yinzuomei - * @Date 2020/3/28 17:11 + * @Author sun + * @Description 所有小组查询-接口返参 */ @Data public class AllGroupListResultDTO implements Serializable { diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java index c086df0f94..726289e144 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.resi.group.dto.notice.result; import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; @@ -34,7 +35,7 @@ public class NoticeCommentListResultDTO implements Serializable { /** * 评论时间 yyyy-MM-dd HH:mm * */ - @JSONField(format="yyyy-MM-dd HH:mm") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date commentTime; /** * 用户Id 评论者Id diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeDetailResultDTO.java index eec820ee53..551b8eb7d6 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeDetailResultDTO.java @@ -1,15 +1,12 @@ package com.epmet.resi.group.dto.notice.result; -import com.epmet.resi.group.dto.notice.form.AddNoticeFormDTO; -import com.epmet.resi.group.dto.topic.form.FileDTO; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.NoArgsConstructor; -import org.hibernate.validator.constraints.Length; -import javax.validation.constraints.NotBlank; import java.io.Serializable; -import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -39,7 +36,13 @@ public class NoticeDetailResultDTO implements Serializable { /** * 发布时间yyyy-MM-dd HH:mm */ - private String releaseTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date releaseTime; + /** + * 通知过期时间(此时间需大于变更时间) + */ + @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/service/impl/NoticeCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java index b4ee53de76..2ab3994891 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java @@ -158,6 +158,7 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl userIdList = resultList.stream().map(NoticeCommentListResultDTO::getUserId).collect(Collectors.toList()); + userIdList = userIdList.stream().distinct().collect(Collectors.toList()); Result> result = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); if (!result.success()) { throw new RenException("调用user服务,获取用户基础数据失败"); 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 9f91a71585..36a20ffde6 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 @@ -294,7 +294,7 @@ public class NoticeServiceImpl extends BaseServiceImpl throw new RenException(String.format("小组通知变更,获取通知数据失败,通知Id->", formDTO.getNoticeId())); } //通知已过期时不允许再次变更 - if(entity.getChangeTime().before(new Date())){ + if(entity.getExpirationTime().before(new Date())){ throw new RenException(EpmetErrorCode.NOTICE_BE_OVERDUE.getCode()); } @@ -469,7 +469,8 @@ public class NoticeServiceImpl extends BaseServiceImpl resultDTO.setTitle(entity.getTitle()); resultDTO.setContent(entity.getContent()); resultDTO.setIsChange(entity.getIsChange()); - resultDTO.setReleaseTime(entity.getChangeTime().toString()); + resultDTO.setReleaseTime(entity.getChangeTime()); + resultDTO.setExpirationTime(entity.getExpirationTime()); StringBuffer name = new StringBuffer(); StringBuffer url = new StringBuffer(); resultDTOList.forEach(user -> { diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index b51b6cf97a..3ff4a69d88 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -575,7 +575,7 @@ (SELECT ai.ID, ai.CREATED_BY AS userId, - DATE_FORMAT(ai.CREATED_TIME,'%Y-%m-%d %H:%i:%s') AS releaseTime, + DATE_FORMAT(ai.CHANGED_TIME,'%Y-%m-%d %H:%i:%s') AS releaseTime, IFNULL(ac.CONTENT,'') AS content, ai.`STATUS` AS status, '' AS issueId, @@ -587,7 +587,7 @@ LEFT JOIN group_act_content ac2 ON ac2.GROUP_ACT_ID = ai.ID AND ac2.CONTENT_TYPE = 'img' AND ac2.DEL_FLAG = 0 AND ac2.SORT = 1 WHERE ai.DEL_FLAG = '0' AND ai.GROUP_ID = #{groupId} - ORDER BY ai.CREATED_TIME DESC + ORDER BY ai.CHANGED_TIME DESC LIMIT 10) UNION ALL (SELECT @@ -737,7 +737,7 @@ (SELECT ai.ID, ai.CREATED_BY AS userId, - DATE_FORMAT(ai.CREATED_TIME,'%Y-%m-%d %H:%i:%s') AS releaseTime, + DATE_FORMAT(ai.CHANGED_TIME,'%Y-%m-%d %H:%i:%s') AS releaseTime, IFNULL(ac.CONTENT,'') AS content, 'act' AS contentType, IFNULL(ac2.CONTENT,'') AS firstPhoto, @@ -813,7 +813,7 @@ (SELECT ai.ID, ai.CREATED_BY AS userId, - DATE_FORMAT(ai.CREATED_TIME,'%Y-%m-%d %H:%i:%s') AS releaseTime, + DATE_FORMAT(ai.CHANGED_TIME,'%Y-%m-%d %H:%i:%s') AS releaseTime, IFNULL(ac.CONTENT,'') AS content, ai.`STATUS` AS status, '' AS issueId,