Browse Source

Merge remote-tracking branch 'origin/dev_group_act_notice' into dev_temp

master
yinzuomei 4 years ago
parent
commit
2179db9a3c
  1. 8
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActSummaryContentDTO.java
  2. 28
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/ActSummaryDetailFormDTO.java
  3. 42
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/ActSummaryFormDTO.java
  4. 3
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/PublishGroupActFormDTO.java
  5. 33
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/ActSummaryDetailResultDTO.java
  6. 50
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/ActSummaryTemplateResultDTO.java
  7. 7
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/AllGroupListFormDTO.java
  8. 28
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserReadFlagResultDTO.java
  9. 26
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserUnReadResultDTO.java
  10. 12
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java
  11. 13
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java
  12. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java
  13. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentListFormDTO.java
  14. 23
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeFileDTO.java
  15. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/ReadTypeFormDTO.java
  16. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java
  17. 8
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java
  18. 35
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActSummaryController.java
  19. 16
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActSummaryContentDao.java
  20. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActSummaryDao.java
  21. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActSummaryContentEntity.java
  22. 22
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActSummaryService.java
  23. 241
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActSummaryServiceImpl.java
  24. 13
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java
  25. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  26. 36
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  27. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  28. 7
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  29. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java
  30. 22
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentController.java
  31. 21
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java
  32. 24
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java
  33. 4
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeReadRecordDao.java
  34. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java
  35. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java
  36. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeService.java
  37. 22
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java
  38. 19
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java
  39. 58
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java
  40. 107
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  41. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java
  42. 15
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSummaryContentDao.xml
  43. 10
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSummaryDao.xml
  44. 153
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  45. 11
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml
  46. 7
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReadRecordDao.xml
  47. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoResultDTO.java

8
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActSummaryContentDTO.java

@ -17,9 +17,10 @@
package com.epmet.resi.group.dto.act;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -43,6 +44,11 @@ public class ActSummaryContentDTO implements Serializable {
*/
private String customerId;
/**
* act_summary.id
*/
private String actSummaryId;
/**
* group_act_info.id
*/

28
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/ActSummaryDetailFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.resi.group.dto.act.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 014查看活动总结详情
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/21 14:14
*/
@Data
public class ActSummaryDetailFormDTO implements Serializable {
private static final long serialVersionUID = 3937952227893070145L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class)
private String groupActId;
/**
* 当前用户id
*/
@NotBlank(message = "tokenDto获取userId为空", groups = ActReadViewFormDTO.AddUserInternalGroup.class)
private String userId;
}

42
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/ActSummaryFormDTO.java

@ -0,0 +1,42 @@
package com.epmet.resi.group.dto.act.form;
import com.epmet.resi.group.dto.topic.form.FileDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 013提交活动总结
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/21 12:58
*/
@Data
public class ActSummaryFormDTO implements Serializable {
private static final long serialVersionUID = 6068480003626532767L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class)
private String groupActId;
/**
* 补充内容限制1000字
*/
private List<String> textList;
/**
* 补充图片列表
*/
private List<FileDTO> imgList;
/**
* 当前用户id
*/
@NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class)
private String userId;
}

3
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/PublishGroupActFormDTO.java

@ -1,6 +1,7 @@
package com.epmet.resi.group.dto.act.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.resi.group.dto.topic.form.FileDTO;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -98,7 +99,7 @@ public class PublishGroupActFormDTO implements Serializable {
/**
* 图片列表最多3张
*/
private List<String> imgList;
private List<FileDTO> imgList;
private String gridId;
}

33
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/ActSummaryDetailResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.resi.group.dto.act.result;
import lombok.Data;
import java.util.List;
/**
* 014查看活动总结详情
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/21 14:17
*/
@Data
public class ActSummaryDetailResultDTO extends ActSummaryTemplateResultDTO{
private static final long serialVersionUID = -6918035750154831223L;
/**
* 活动总结id
*/
private String actSummaryId;
/**
* 补充内容列表
*/
private List<String> extraTextList;
/**
* 补充图片列表
*/
private List<String> extraImgList;
}

50
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/ActSummaryTemplateResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.resi.group.dto.act.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -14,16 +15,65 @@ import java.util.List;
*/
@Data
public class ActSummaryTemplateResultDTO implements Serializable {
/**
* 小组活动id
*/
private String groupActId;
/**
* 活动标题
*/
private String title;
/**
* 标签名称 支部建设-三会一课
*/
private String allCategoryName;
/**
* 活动时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date startTime;
/**
* 活动地点
*/
private String address;
/**
* 应参加人数
*/
private Integer shouldAttend;
/**
* 已签到人数
*/
private Integer signedInNum;
/**
* 签到人员名单分隔开
*/
private String signedInUsers;
/**
* 活动内容
*/
private List<String> textList;
/**
* 活动图片
*/
private List<String> imgList;
/**
* 是否填写总结1已填写0未填写
*/
private Integer summaryFlag;
/**
* 签到用户id
*/
private List<String> signedInUserIds;
}

7
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/AllGroupListFormDTO.java

@ -23,12 +23,17 @@ public class AllGroupListFormDTO implements Serializable {
* 请求页码
*/
@Min(1)
private int pageNo;
private int pageNo = 1;
/**
* 每页多少条数据
*/
private int pageSize = 20;
/**
* token中用户Id
*/
private String userId;
public interface GroupList {
}
}

28
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserReadFlagResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/21 上午9:43
* @DESC
*/
@Data
public class UserReadFlagResultDTO implements Serializable {
private static final long serialVersionUID = -5727870985731706332L;
/**
* 活动通知 ID
*/
private String id;
private String userId;
/**
* 阅读状态read已读un_read未读
*/
private String readFlag;
}

26
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/UserUnReadResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/21 上午9:43
* @DESC
*/
@Data
public class UserUnReadResultDTO implements Serializable {
private static final long serialVersionUID = -5727870085731706332L;
/**
* 活动通知 ID
*/
private String id;
/**
* 未读数量
*/
private Integer unRead;
}

12
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java

@ -1,7 +1,6 @@
package com.epmet.resi.group.dto.notice.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.resi.group.dto.topic.form.FileDTO;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -35,12 +34,19 @@ public class AddNoticeFormDTO {
/**
* 图片附件集合
*/
private List<FileDTO> imageList;
private List<NoticeFileDTO> imageList;
/**
* 文件附件url集合
*/
private List<FileDTO> docList;
private List<NoticeFileDTO> docList;
/**
* token中用户Id
*/
private String userId;
public interface Add{}
public interface AddUserShow extends CustomerClientShowGroup {}
}

13
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java

@ -1,7 +1,6 @@
package com.epmet.resi.group.dto.notice.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.resi.group.dto.topic.form.FileDTO;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -23,22 +22,30 @@ public class EditNoticeFormDTO {
/**
* 通知标题
*/
@NotBlank(message = "通知标题不能为空",groups = {EditNoticeFormDTO.EditUserShow.class})
@Length(max = 20, message = "通知标题不能超过20个字符",groups = {EditNoticeFormDTO.EditUserShow.class})
private String title;
/**
* 通知内容
*/
@NotBlank(message = "通知内容不能为空",groups = {EditNoticeFormDTO.EditUserShow.class})
@Length(max = 1000, message = "通知内容不能超过1000个字符",groups = {EditNoticeFormDTO.EditUserShow.class})
private String content;
/**
* 图片附件集合
*/
private List<FileDTO> imageList;
private List<NoticeFileDTO> imageList;
/**
* 文件附件url集合
*/
private List<FileDTO> docList;
private List<NoticeFileDTO> docList;
/**
* token中用户Id
*/
private String userId;
public interface Edit{}
public interface EditUserShow extends CustomerClientShowGroup {}
}

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java

@ -25,6 +25,11 @@ public class NoticeCommentFormDTO {
@Length(max = 20, message = "评论内容不能超过300个字符",groups = {NoticeCommentFormDTO.UserShow.class})
private String commentContent;
/**
* token中用户Id
*/
private String userId;
public interface Comment{}
public interface UserShow extends CustomerClientShowGroup {}
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentListFormDTO.java

@ -23,7 +23,7 @@ public class NoticeCommentListFormDTO implements Serializable {
* 请求页码
* */
@Min(1)
private int pageNo;
private int pageNo = 1;
/**
* 每页多少条数据
* */

23
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeFileDTO.java

@ -0,0 +1,23 @@
package com.epmet.resi.group.dto.notice.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author sun
* @Description 小组通知保存变更-接口入参
*/
@NoArgsConstructor
@Data
public class NoticeFileDTO implements Serializable {
private static final long serialVersionUID = -3930520724652521552L;
private String name;
private String url;
private String type;
private String format;
private Integer size;
private Integer duration;
}

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/ReadTypeFormDTO.java

@ -17,5 +17,10 @@ public class ReadTypeFormDTO {
@NotBlank(message = "通知Id不能为空",groups = {ReadTypeFormDTO.Read.class})
private String noticeId;
/**
* token中用户Id
*/
private String userId;
public interface Read{}
}

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java

@ -26,19 +26,19 @@ public class GetLatestV2ResultDTO implements Serializable {
private String groupType;
/**
* 是否显示通知按钮
* 是否显示通知按钮(当前人员是否为组长)
*/
private String noticeBut;
private Boolean noticeBut = false;
/**
* 是否显示活动按钮
* 是否显示活动按钮当前组为支部组且当前人是组长
*/
private String actBut;
private Boolean actBut = false;
/**
* 是否存在未读消息
*/
private Boolean unReadNews;
private Boolean unReadNews = false;
/**
* 近十条数据

8
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java

@ -38,7 +38,7 @@ public class LatestTenResultDTO implements Serializable {
/**
* 发布时间yyyy-MM-dd HH:mm
*/
private String releaseTimed;
private String releaseTime;
/**
* 内容
@ -53,7 +53,7 @@ public class LatestTenResultDTO implements Serializable {
/**
* 是否本人
*/
private String releaseUserFlag;
private Boolean releaseUserFlag;
/**
* 如果有图片后台只返回第一张没有图片此列为空
@ -90,10 +90,10 @@ public class LatestTenResultDTO implements Serializable {
this.userId = "";
this.releaseUserName = "";
this.releaseUserHeadPhoto = "";
this.releaseTimed = "";
this.releaseTime = "";
this.content = "";
this.status = "";
this.releaseUserFlag = "";
this.releaseUserFlag = false;
this.firstPhoto = "";
this.issueId = "";
this.shiftIssueFlag = false;

35
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActSummaryController.java

@ -17,10 +17,16 @@
package com.epmet.modules.act.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.modules.act.service.ActSummaryService;
import com.epmet.resi.group.dto.act.GroupActIdDTO;
import com.epmet.resi.group.dto.act.form.ActSummaryDetailFormDTO;
import com.epmet.resi.group.dto.act.form.ActSummaryFormDTO;
import com.epmet.resi.group.dto.act.form.InitTemplateFormDTO;
import com.epmet.resi.group.dto.act.result.ActSummaryDetailResultDTO;
import com.epmet.resi.group.dto.act.result.ActSummaryTemplateResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -54,4 +60,33 @@ public class ActSummaryController {
ValidatorUtils.validateEntity(formDTO, InitTemplateFormDTO.AddUserInternalGroup.class);
return new Result<ActSummaryTemplateResultDTO>().ok(actSummaryService.initTemplate(formDTO));
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.act.GroupActIdDTO>
* @author yinzuomei
* @description 013提交活动总结
* @Date 2021/4/21 13:06
**/
@PostMapping("submit")
public Result<GroupActIdDTO> submitActSummary(@LoginUser TokenDto tokenDto, @RequestBody ActSummaryFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ActSummaryFormDTO.AddUserInternalGroup.class);
return new Result<GroupActIdDTO>().ok(actSummaryService.submitActSummary(formDTO));
}
/**
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.act.result.ActSummaryDetailResultDTO>
* @author yinzuomei
* @description 014查看活动总结详情
* @Date 2021/4/21 14:20
**/
@PostMapping("detail")
public Result<ActSummaryDetailResultDTO> queryActSummaryDetail(@LoginUser TokenDto tokenDto,@RequestBody ActSummaryDetailFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ActSummaryFormDTO.AddUserInternalGroup.class);
return new Result<ActSummaryDetailResultDTO>().ok(actSummaryService.queryActSummaryDetail(formDTO));
}
}

16
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActSummaryContentDao.java

@ -20,6 +20,9 @@ package com.epmet.modules.act.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.act.entity.ActSummaryContentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 活动总结内容
@ -29,5 +32,16 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActSummaryContentDao extends BaseDao<ActSummaryContentEntity> {
/**
* 查询总结补充内容
*
* @param groupActId
* @param actSummaryId
* @param contentType
* @return
*/
List<String> selectContentList(@Param("actSummaryId")String actSummaryId,
@Param("groupActId")String groupActId,
@Param("contentType")String contentType);
}

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActSummaryDao.java

@ -20,6 +20,7 @@ package com.epmet.modules.act.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.act.entity.ActSummaryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 活动总结
@ -29,5 +30,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActSummaryDao extends BaseDao<ActSummaryEntity> {
ActSummaryEntity selectUserSummary(@Param("groupActId")String groupActId, @Param("userId")String userId);
}

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActSummaryContentEntity.java

@ -40,6 +40,11 @@ public class ActSummaryContentEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* act_summary.id
*/
private String actSummaryId;
/**
* group_act_info.id
*/

22
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActSummaryService.java

@ -19,7 +19,11 @@ package com.epmet.modules.act.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.act.entity.ActSummaryEntity;
import com.epmet.resi.group.dto.act.GroupActIdDTO;
import com.epmet.resi.group.dto.act.form.ActSummaryDetailFormDTO;
import com.epmet.resi.group.dto.act.form.ActSummaryFormDTO;
import com.epmet.resi.group.dto.act.form.InitTemplateFormDTO;
import com.epmet.resi.group.dto.act.result.ActSummaryDetailResultDTO;
import com.epmet.resi.group.dto.act.result.ActSummaryTemplateResultDTO;
/**
@ -37,4 +41,22 @@ public interface ActSummaryService extends BaseService<ActSummaryEntity> {
* @return com.epmet.resi.group.dto.act.result.ActSummaryTemplateResultDTO
*/
ActSummaryTemplateResultDTO initTemplate(InitTemplateFormDTO formDTO);
/**
* 013提交活动总结
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.GroupActIdDTO
*/
GroupActIdDTO submitActSummary(ActSummaryFormDTO formDTO);
/**
* 014查看活动总结详情
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.ActSummaryDetailResultDTO
*/
ActSummaryDetailResultDTO queryActSummaryDetail(ActSummaryDetailFormDTO formDTO);
}

241
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActSummaryServiceImpl.java

@ -17,30 +17,48 @@
package com.epmet.modules.act.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.act.dao.ActSignInRecordDao;
import com.epmet.modules.act.dao.ActSummaryDao;
import com.epmet.modules.act.dao.GroupActContentDao;
import com.epmet.modules.act.dao.GroupActInfoDao;
import com.epmet.modules.act.dao.*;
import com.epmet.modules.act.entity.ActSummaryContentEntity;
import com.epmet.modules.act.entity.ActSummaryEntity;
import com.epmet.modules.act.entity.GroupActInfoEntity;
import com.epmet.modules.act.service.ActSummaryService;
import com.epmet.modules.constant.GroupActConstant;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.resi.group.dto.act.GroupActIdDTO;
import com.epmet.resi.group.dto.act.form.ActSummaryDetailFormDTO;
import com.epmet.resi.group.dto.act.form.ActSummaryFormDTO;
import com.epmet.resi.group.dto.act.form.InitTemplateFormDTO;
import com.epmet.resi.group.dto.act.result.ActSummaryDetailResultDTO;
import com.epmet.resi.group.dto.act.result.ActSummaryTemplateResultDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.topic.form.FileDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* 活动总结
@ -51,6 +69,13 @@ import java.util.List;
@Slf4j
@Service
public class ActSummaryServiceImpl extends BaseServiceImpl<ActSummaryDao, ActSummaryEntity> implements ActSummaryService {
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Value("${openapi.scan.method.imgSyncScan}")
private String imgSyncScanMethod;
@Autowired
private GroupActInfoDao groupActInfoDao;
@Autowired
@ -59,6 +84,11 @@ public class ActSummaryServiceImpl extends BaseServiceImpl<ActSummaryDao, ActSum
private ActSignInRecordDao actSignInRecordDao;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private ResiGroupMemberService resiGroupMemberService;
@Autowired
private ActSummaryContentDao actSummaryContentDao;
/**
* 012初始化活动总结模板
@ -68,27 +98,202 @@ public class ActSummaryServiceImpl extends BaseServiceImpl<ActSummaryDao, ActSum
*/
@Override
public ActSummaryTemplateResultDTO initTemplate(InitTemplateFormDTO formDTO) {
GroupActInfoEntity groupActInfoEntity=groupActInfoDao.selectById(formDTO.getGroupActId());
if(null==groupActInfoEntity){
throw new RenException(String.format("根据groupActId:%s,查询活动信息为null",formDTO.getGroupActId()));
GroupActInfoEntity groupActInfoEntity = groupActInfoDao.selectById(formDTO.getGroupActId());
if (null == groupActInfoEntity) {
throw new RenException(String.format("根据groupActId:%s,查询活动信息为null", formDTO.getGroupActId()));
}
ActSummaryTemplateResultDTO resultDTO= ConvertUtils.sourceToTarget(groupActInfoEntity,ActSummaryTemplateResultDTO.class);
ActSummaryTemplateResultDTO resultDTO = ConvertUtils.sourceToTarget(groupActInfoEntity, ActSummaryTemplateResultDTO.class);
resultDTO.setTextList(groupActContentDao.selectContentList(formDTO.getGroupActId(), GroupActConstant.TEXT));
resultDTO.setImgList(groupActContentDao.selectContentList(formDTO.getGroupActId(),GroupActConstant.IMG));
List<String> signedInUserIds=actSignInRecordDao.selectUserIds(formDTO.getGroupActId());
resultDTO.setImgList(groupActContentDao.selectContentList(formDTO.getGroupActId(), GroupActConstant.IMG));
//签到人员姓名集合
List<String> signedInUserIds = actSignInRecordDao.selectUserIds(formDTO.getGroupActId());
resultDTO.setSignedInUserIds(signedInUserIds);
if(CollectionUtils.isNotEmpty(signedInUserIds)){
Result<List<UserBaseInfoResultDTO>> result = epmetUserOpenFeignClient.queryUserBaseInfo(signedInUserIds);
if (!result.success()) {
List<String> signedInUsers = querySignedInUsers(signedInUserIds);
resultDTO.setSignedInUsers(StringUtils.strip(signedInUsers.toString(), "[]").replace(", ", StrConstant.COMMA_ZH));
resultDTO.setGroupActId(formDTO.getGroupActId());
return resultDTO;
}
/**
* 013提交活动总结
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.GroupActIdDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public GroupActIdDTO submitActSummary(ActSummaryFormDTO formDTO) {
GroupActIdDTO result = new GroupActIdDTO();
result.setGroupActId(formDTO.getGroupActId());
//已经提交,无需重复提交
GroupActInfoEntity groupActInfoEntity = groupActInfoDao.selectById(formDTO.getGroupActId());
if (null == groupActInfoEntity) {
throw new RenException(String.format("根据groupActId:%s,查询活动信息为null", formDTO.getGroupActId()));
}
if (groupActInfoEntity.getSummaryFlag() == NumConstant.ONE) {
log.warn("已填写活动总结,无需重复提交");
return result;
}
checkActSummaryFormDTO(formDTO, groupActInfoEntity.getGroupId());
//插入总结主表
ActSummaryEntity insertEntity = new ActSummaryEntity();
insertEntity.setCustomerId(groupActInfoEntity.getCustomerId());
insertEntity.setGroupActId(formDTO.getGroupActId());
insertEntity.setShouldAttend(groupActInfoEntity.getShouldAttend());
insertEntity.setUserId(formDTO.getUserId());
//签到人员姓名集合
List<String> signedInUserIds = actSignInRecordDao.selectUserIds(formDTO.getGroupActId());
List<String> signedInUsers = querySignedInUsers(signedInUserIds);
insertEntity.setSignedInUsers(StringUtils.strip(signedInUsers.toString(), "[]").replace(", ", StrConstant.COMMA_ZH));
insertEntity.setSignedInNum(signedInUsers.size());
baseDao.insert(insertEntity);
//插入补充内容表
int textNum = NumConstant.ONE;
for (String content : formDTO.getTextList()) {
ActSummaryContentEntity insert = new ActSummaryContentEntity();
insert.setCustomerId(groupActInfoEntity.getCustomerId());
insert.setContent(content);
insert.setContentType(GroupActConstant.TEXT);
insert.setGroupActId(groupActInfoEntity.getId());
insert.setSort(textNum);
insert.setActSummaryId(insertEntity.getId());
actSummaryContentDao.insert(insert);
textNum++;
}
int imgNum = NumConstant.ONE;
for (FileDTO fileDTO : formDTO.getImgList()) {
ActSummaryContentEntity insert = new ActSummaryContentEntity();
insert.setCustomerId(groupActInfoEntity.getCustomerId());
insert.setContent(fileDTO.getUrl());
insert.setContentType(GroupActConstant.IMG);
insert.setGroupActId(groupActInfoEntity.getId());
insert.setSort(imgNum);
insert.setActSummaryId(insertEntity.getId());
actSummaryContentDao.insert(insert);
imgNum++;
}
//更新总结标识
groupActInfoEntity.setSummaryFlag(NumConstant.ONE);
groupActInfoDao.updateById(groupActInfoEntity);
return result;
}
private List<String> querySignedInUsers(List<String> signedInUserIds) {
List<String> nameList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(signedInUserIds)) {
Result<List<UserBaseInfoResultDTO>> userResult = epmetUserOpenFeignClient.queryUserBaseInfo(signedInUserIds);
if (!userResult.success()) {
throw new RenException("调用user服务,获取用户基础数据失败");
}
result.getData().forEach(userBaseInfo->{
resultDTO.setSignedInUsers(userBaseInfo.getSurname().concat(userBaseInfo.getName()));
for (String signedInUserId : signedInUserIds) {
for (UserBaseInfoResultDTO userBaseInfo : userResult.getData()) {
if (signedInUserId.equals(userBaseInfo.getUserId())) {
nameList.add(userBaseInfo.getSurname().concat(userBaseInfo.getName()));
break;
}
}
}
}
return nameList;
}
private void checkActSummaryFormDTO(ActSummaryFormDTO formDTO, String groupId) {
//只有组长才可以填写活动总结
ResiGroupMemberDTO groupMemberDTO = resiGroupMemberService.getLeaderMember(groupId);
if (!formDTO.getUserId().equals(groupMemberDTO.getCustomerUserId())) {
throw new RenException(EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getCode(), EpmetErrorCode.GROUP_LEADER_CAN_EDIT_GROUP_INFO.getMsg());
}
if (!org.springframework.util.CollectionUtils.isEmpty(formDTO.getTextList())) {
//活动文本内容,目前只有一段,限制1000字
if (formDTO.getTextList().get(NumConstant.ZERO).length() > 1000) {
throw new RenException(EpmetErrorCode.GROUP_ACT_CONTENT_MAX.getCode(), EpmetErrorCode.GROUP_ACT_CONTENT_MAX.getMsg());
}
}
if (!org.springframework.util.CollectionUtils.isEmpty(formDTO.getImgList())) {
//最多选择3张图片
if (formDTO.getImgList().size() > NumConstant.THREE) {
throw new RenException(EpmetErrorCode.GROUP_ACT_IMG_MAX.getCode(), EpmetErrorCode.GROUP_ACT_IMG_MAX.getMsg());
}
}
//内容审核
//补充内容
if (!org.springframework.util.CollectionUtils.isEmpty(formDTO.getTextList())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
formDTO.getTextList().forEach(content -> {
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(content);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
});
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
log.warn(String.format("补充内容审核失败【%s】", JSON.toJSONString(formDTO.getTextList())));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg());
}
}
}
//补充图片
if (!org.springframework.util.CollectionUtils.isEmpty(formDTO.getImgList())) {
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
formDTO.getImgList().forEach(fileDTO -> {
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(fileDTO.getUrl());
imgScanParamDTO.getTasks().add(task);
});
}else{
resultDTO.setSignedInUserIds(new ArrayList<>());
resultDTO.setSignedInUsers(StrConstant.EPMETY_STR);
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
log.warn("补充图片审核失败");
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg());
}
}
}
}
/**
* 014查看活动总结详情
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.ActSummaryDetailResultDTO
*/
@Override
public ActSummaryDetailResultDTO queryActSummaryDetail(ActSummaryDetailFormDTO formDTO) {
GroupActInfoEntity groupActInfoEntity = groupActInfoDao.selectById(formDTO.getGroupActId());
if (null == groupActInfoEntity) {
throw new RenException(String.format("根据groupActId:%s,查询活动信息为null", formDTO.getGroupActId()));
}
ActSummaryEntity actSummaryEntity = baseDao.selectUserSummary(formDTO.getGroupActId(),formDTO.getUserId());
if (null == actSummaryEntity || groupActInfoEntity.getSummaryFlag() == NumConstant.ZERO) {
throw new RenException(String.format("根据groupActId:%s,查询活动总结信息为null", formDTO.getGroupActId()));
}
ActSummaryDetailResultDTO resultDTO = ConvertUtils.sourceToTarget(groupActInfoEntity, ActSummaryDetailResultDTO.class);
resultDTO.setTextList(groupActContentDao.selectContentList(formDTO.getGroupActId(), GroupActConstant.TEXT));
resultDTO.setImgList(groupActContentDao.selectContentList(formDTO.getGroupActId(), GroupActConstant.IMG));
resultDTO.setActSummaryId(actSummaryEntity.getId());
resultDTO.setSignedInUsers(actSummaryEntity.getSignedInUsers());
//按签到顺序
resultDTO.setSignedInUserIds(actSignInRecordDao.selectUserIds(formDTO.getGroupActId()));
resultDTO.setGroupActId(formDTO.getGroupActId());
resultDTO.setExtraImgList(actSummaryContentDao.selectContentList(actSummaryEntity.getId(), formDTO.getGroupActId(), GroupActConstant.IMG));
resultDTO.setExtraTextList(actSummaryContentDao.selectContentList(actSummaryEntity.getId(), formDTO.getGroupActId(), GroupActConstant.TEXT));
return resultDTO;
}
}

13
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java

@ -66,6 +66,7 @@ import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.invitation.InvitationRecordDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO;
import com.epmet.resi.group.dto.topic.form.FileDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -308,7 +309,7 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
* @description
* @Date 2021/4/19 16:39
**/
private void scanActContent(String title, List<String> textList, List<String> imgList) {
private void scanActContent(String title, List<String> textList, List<FileDTO> imgList) {
//活动标题
if (StringUtils.isNotBlank(title)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
@ -348,10 +349,10 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
//活动图片
if (!CollectionUtils.isEmpty(imgList)) {
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
imgList.forEach(url -> {
imgList.forEach(fileDTO -> {
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(url);
task.setUrl(fileDTO.getUrl());
imgScanParamDTO.getTasks().add(task);
});
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
@ -375,13 +376,13 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
return actOperationRecordEntity;
}
private List<GroupActContentEntity> constructImg(String groupActId, String customerId, List<String> imgList) {
private List<GroupActContentEntity> constructImg(String groupActId, String customerId, List<FileDTO> imgList) {
List<GroupActContentEntity> list = new ArrayList<>();
int imgSort = NumConstant.ONE;
for (String img : imgList) {
for (FileDTO img : imgList) {
GroupActContentEntity entity = new GroupActContentEntity();
entity.setGroupActId(groupActId);
entity.setContent(img);
entity.setContent(img.getUrl());
entity.setContentType(GroupActConstant.IMG);
entity.setCustomerId(customerId);
entity.setSort(imgSort);

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -31,8 +31,6 @@ import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.form.ResiIdentityFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO;
import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
@ -508,7 +506,8 @@ public class ResiGroupController {
@PostMapping(value = "allgrouplist")
public Result<List<AllGroupListResultDTO>> allGroupList(@LoginUser TokenDto tokenDto, @RequestBody AllGroupListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AllGroupListFormDTO.GroupList.class);
return new Result<List<AllGroupListResultDTO>>().ok(resiGroupService.allGroupList(tokenDto, formDTO));
formDTO.setUserId(tokenDto.getUserId());
return new Result<List<AllGroupListResultDTO>>().ok(resiGroupService.allGroupList(formDTO));
}
}

36
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java

@ -24,6 +24,7 @@ import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.topic.result.LatestTenResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -242,4 +243,39 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @Description 分页查询网格下所有小组列表
**/
List<AllGroupListResultDTO> selectAllGroupList(AllGroupListFormDTO formDTO);
/**
* @Description 查询 话题通知活动最近10条数据
* @Param groupId
* @author zxc
* @date 2021/4/20 下午4:14
*/
List<LatestTenResultDTO> selectLatestTen(@Param("groupId")String groupId);
/**
* @Description 查询此人在小组内未读数量
* @Param groupId
* @Param userId
* @author zxc
* @date 2021/4/20 下午5:23
*/
Integer selectUserUnRead(@Param("groupId")String groupId,@Param("userId")String userId);
/**
* @Description 查询阅读状态
* @Param groupId
* @Param userId
* @author zxc
* @date 2021/4/21 上午9:45
*/
List<UserReadFlagResultDTO> selectUserReadFlag(@Param("groupId")String groupId,@Param("userIds")List<String> userIds,@Param("ids")List<String> ids);
/**
* @Description 根据 活动或通知查询 未读人数
* @Param groupId
* @Param ids
* @author zxc
* @date 2021/4/21 上午10:22
*/
List<UserUnReadResultDTO> selectUserUnReadById(@Param("groupId")String groupId,@Param("ids")List<String> ids);
}

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -20,7 +20,6 @@ package com.epmet.modules.group.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.resi.group.dto.UserRoleDTO;
@ -378,5 +377,5 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
* @Author sun
* @Description 所有小组查询
**/
List<AllGroupListResultDTO> allGroupList(TokenDto tokenDto, AllGroupListFormDTO formDTO);
List<AllGroupListResultDTO> allGroupList(AllGroupListFormDTO formDTO);
}

7
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -30,7 +30,6 @@ import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
@ -1500,7 +1499,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
* @Description 所有小组查询
**/
@Override
public List<AllGroupListResultDTO> allGroupList(TokenDto tokenDto, AllGroupListFormDTO formDTO) {
public List<AllGroupListResultDTO> allGroupList(AllGroupListFormDTO formDTO) {
//1.分页查询网格下所有小组列表且是审核通过状态的,以组内人员数从多到少排序
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
@ -1511,7 +1510,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
//2.查询当前用户居民端角色列表
AtomicBoolean isPartymember = new AtomicBoolean(false);
Result<List<UserRoleResultDTO>> resultDTOList = epmetUserOpenFeignClient.getUserRoleInfoByUserId(tokenDto.getUserId());
Result<List<UserRoleResultDTO>> resultDTOList = epmetUserOpenFeignClient.getUserRoleInfoByUserId(formDTO.getUserId());
if (!resultDTOList.success()) {
throw new RenException("调用user服务,获取用户基础数据失败");
}
@ -1529,7 +1528,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
dto.setStatus("rejected");
continue;
}
GroupMemeberOperationDTO operation = groupMemeberOperationService.selectLatestRecord(dto.getGroupId(), tokenDto.getUserId());
GroupMemeberOperationDTO operation = groupMemeberOperationService.selectLatestRecord(dto.getGroupId(), formDTO.getUserId());
if (null != operation) {
dto.setStatus(operation.getOperateStatus());
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java

@ -159,4 +159,13 @@ public interface ResiGroupMemberDao extends BaseDao<ResiGroupMemberEntity> {
* @Date 2021/4/19 13:54
**/
Integer selectCountMember(String groupId);
/**
* @Description 查询此人组内身份
* @Param groupId
* @Param userId
* @author zxc
* @date 2021/4/20 下午4:03
*/
String selectUserRole(@Param("groupId")String groupId, @Param("userId")String userId);
}

22
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentController.java

@ -18,27 +18,20 @@
package com.epmet.modules.notice.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.notice.excel.NoticeCommentExcel;
import com.epmet.modules.notice.service.NoticeCommentService;
import com.epmet.resi.group.dto.notice.NoticeCommentDTO;
import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO;
import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
@ -64,7 +57,8 @@ public class NoticeCommentController {
@PostMapping(value = "noticecomment")
public Result noticeComment(@LoginUser TokenDto tokenDto, @RequestBody NoticeCommentFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NoticeCommentFormDTO.Comment.class, NoticeCommentFormDTO.UserShow.class);
noticeCommentService.noticeComment(tokenDto, formDTO);
formDTO.setUserId(tokenDto.getUserId());
noticeCommentService.noticeComment(formDTO);
return new Result();
}
@ -75,9 +69,9 @@ public class NoticeCommentController {
* @Description 通知评论列表查询
**/
@PostMapping(value = "noticecommentlist")
public Result<List<NoticeCommentListResultDTO>> noticeCommentList(@LoginUser TokenDto tokenDto, @RequestBody NoticeCommentListFormDTO formDTO){
public Result<List<NoticeCommentListResultDTO>> noticeCommentList(@RequestBody NoticeCommentListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NoticeCommentListFormDTO.CommentList.class);
return new Result<List<NoticeCommentListResultDTO>>().ok(noticeCommentService.noticeCommentList(tokenDto, formDTO));
return new Result<List<NoticeCommentListResultDTO>>().ok(noticeCommentService.noticeCommentList(formDTO));
}
}

21
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java

@ -18,16 +18,9 @@
package com.epmet.modules.notice.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.notice.excel.NoticeExcel;
import com.epmet.modules.notice.service.NoticeService;
import com.epmet.resi.group.dto.notice.NoticeDTO;
import com.epmet.resi.group.dto.notice.form.AddNoticeFormDTO;
@ -37,10 +30,6 @@ import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 小组通知表
@ -70,7 +59,8 @@ public class NoticeController {
@PostMapping(value = "add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddNoticeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddNoticeFormDTO.Add.class, AddNoticeFormDTO.AddUserShow.class);
noticeService.add(tokenDto, formDTO);
formDTO.setUserId(tokenDto.getUserId());
noticeService.add(formDTO);
return new Result();
}
@ -83,7 +73,8 @@ public class NoticeController {
@PostMapping(value = "edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditNoticeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, EditNoticeFormDTO.Edit.class, EditNoticeFormDTO.EditUserShow.class);
noticeService.edit(tokenDto, formDTO);
formDTO.setUserId(tokenDto.getUserId());
noticeService.edit(formDTO);
return new Result();
}
@ -94,9 +85,9 @@ public class NoticeController {
* @Description 小组通知详情
**/
@PostMapping(value = "noticedetail")
public Result<NoticeDetailResultDTO> noticeDetail(@LoginUser TokenDto tokenDto, @RequestBody NoticeDetailFormDTO formDTO){
public Result<NoticeDetailResultDTO> noticeDetail(@RequestBody NoticeDetailFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NoticeDetailFormDTO.Detail.class);
return new Result<NoticeDetailResultDTO>().ok(noticeService.noticeDetail(tokenDto, formDTO));
return new Result<NoticeDetailResultDTO>().ok(noticeService.noticeDetail(formDTO));
}
}

24
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java

@ -18,27 +18,18 @@
package com.epmet.modules.notice.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.notice.excel.NoticeReadRecordExcel;
import com.epmet.modules.notice.service.NoticeReadRecordService;
import com.epmet.resi.group.dto.notice.NoticeReadRecordDTO;
import com.epmet.resi.group.dto.notice.form.NoticeReadListFormDTO;
import com.epmet.resi.group.dto.notice.form.ReadTypeFormDTO;
import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
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;
/**
@ -61,9 +52,9 @@ public class NoticeReadRecordController {
* @Description 通知已读未读列表查询
**/
@PostMapping(value = "noticereadlist")
public Result<NoticeReadListResultDTO> noticeReadList(@LoginUser TokenDto tokenDto, @RequestBody NoticeReadListFormDTO formDTO){
public Result<NoticeReadListResultDTO> noticeReadList(@RequestBody NoticeReadListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NoticeReadListFormDTO.List.class);
return new Result<NoticeReadListResultDTO>().ok(noticeReafdRecordService.noticeReadList(tokenDto, formDTO));
return new Result<NoticeReadListResultDTO>().ok(noticeReafdRecordService.noticeReadList(formDTO));
}
/**
@ -75,7 +66,8 @@ public class NoticeReadRecordController {
@PostMapping(value = "readtype")
public Result readType(@LoginUser TokenDto tokenDto, @RequestBody ReadTypeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ReadTypeFormDTO.Read.class);
noticeReafdRecordService.readType(tokenDto, formDTO);
formDTO.setUserId(tokenDto.getUserId());
noticeReafdRecordService.readType(formDTO);
return new Result();
}

4
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeReadRecordDao.java

@ -42,9 +42,9 @@ public interface NoticeReadRecordDao extends BaseDao<NoticeReadRecordEntity> {
/**
* @Author sun
* @Description 根据通知Id查询组成员已读未读数据
* @Description 根据通知Id查询组成员已读未读数据,抛去组长数据
**/
List<NoticeReadRecordDTO> getByNoticeId(@Param("noticeId") String noticeId);
List<NoticeReadRecordDTO> getByNoticeId(@Param("noticeId") String noticeId, @Param("leaderId") String leaderId);
/**
* @Author sun

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java

@ -18,16 +18,12 @@
package com.epmet.modules.notice.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.modules.notice.entity.NoticeCommentEntity;
import com.epmet.resi.group.dto.notice.NoticeCommentDTO;
import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO;
import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO;
import java.util.List;
import java.util.Map;
/**
* 小组通知评论表
@ -43,7 +39,7 @@ public interface NoticeCommentService extends BaseService<NoticeCommentEntity> {
* @Author sun
* @Description 发布通知评论
**/
void noticeComment(TokenDto tokenDto, NoticeCommentFormDTO formDTO);
void noticeComment(NoticeCommentFormDTO formDTO);
/**
* @param formDTO
@ -51,5 +47,5 @@ public interface NoticeCommentService extends BaseService<NoticeCommentEntity> {
* @Author sun
* @Description 通知评论列表查询
**/
List<NoticeCommentListResultDTO> noticeCommentList(TokenDto tokenDto, NoticeCommentListFormDTO formDTO);
List<NoticeCommentListResultDTO> noticeCommentList(NoticeCommentListFormDTO formDTO);
}

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java

@ -18,17 +18,11 @@
package com.epmet.modules.notice.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.modules.notice.entity.NoticeReadRecordEntity;
import com.epmet.resi.group.dto.notice.NoticeReadRecordDTO;
import com.epmet.resi.group.dto.notice.form.NoticeReadListFormDTO;
import com.epmet.resi.group.dto.notice.form.ReadTypeFormDTO;
import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO;
import java.util.List;
import java.util.Map;
/**
* 小组通知组成员阅读记录表
*
@ -43,7 +37,7 @@ public interface NoticeReadRecordService extends BaseService<NoticeReadRecordEnt
* @Author sun
* @Description 通知已读未读列表查询
**/
NoticeReadListResultDTO noticeReadList(TokenDto tokenDto, NoticeReadListFormDTO formDTO);
NoticeReadListResultDTO noticeReadList(NoticeReadListFormDTO formDTO);
/**
* @param formDTO
@ -51,5 +45,5 @@ public interface NoticeReadRecordService extends BaseService<NoticeReadRecordEnt
* @Author sun
* @Description 小组通知阅读状态修改
**/
void readType(TokenDto tokenDto, ReadTypeFormDTO formDTO);
void readType(ReadTypeFormDTO formDTO);
}

11
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeService.java

@ -18,8 +18,6 @@
package com.epmet.modules.notice.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.modules.notice.entity.NoticeEntity;
import com.epmet.resi.group.dto.notice.NoticeDTO;
import com.epmet.resi.group.dto.notice.form.AddNoticeFormDTO;
@ -27,9 +25,6 @@ import com.epmet.resi.group.dto.notice.form.EditNoticeFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeDetailFormDTO;
import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO;
import java.util.List;
import java.util.Map;
/**
* 小组通知表
*
@ -54,7 +49,7 @@ public interface NoticeService extends BaseService<NoticeEntity> {
* @Author sun
* @Description 小组通知保存
**/
void add(TokenDto tokenDto, AddNoticeFormDTO formDTO);
void add(AddNoticeFormDTO formDTO);
/**
* @param formDTO
@ -62,7 +57,7 @@ public interface NoticeService extends BaseService<NoticeEntity> {
* @Author sun
* @Description 小组通知变更
**/
void edit(TokenDto tokenDto, EditNoticeFormDTO formDTO);
void edit(EditNoticeFormDTO formDTO);
/**
* @param formDTO
@ -70,5 +65,5 @@ public interface NoticeService extends BaseService<NoticeEntity> {
* @Author sun
* @Description 小组通知详情
**/
NoticeDetailResultDTO noticeDetail(TokenDto tokenDto, NoticeDetailFormDTO formDTO);
NoticeDetailResultDTO noticeDetail(NoticeDetailFormDTO formDTO);
}

22
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java

@ -17,19 +17,13 @@
package com.epmet.modules.notice.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.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.dto.result.UserBaseInfoResultDTO;
@ -43,9 +37,7 @@ import com.epmet.modules.notice.service.NoticeService;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.constant.MemberStateConstant;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.notice.NoticeCommentDTO;
import com.epmet.resi.group.dto.notice.NoticeDTO;
import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO;
@ -58,7 +50,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/**
@ -92,7 +86,7 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl<NoticeCommentDao,
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void noticeComment(TokenDto tokenDto, NoticeCommentFormDTO formDTO) {
public void noticeComment(NoticeCommentFormDTO formDTO) {
//1.内容安全校验
String commentContent = formDTO.getCommentContent();
if (StringUtils.isNotBlank(commentContent)) {
@ -116,12 +110,12 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl<NoticeCommentDao,
//2.判断当前用户是否被禁言、移除、非本组成员
NoticeDTO notice = noticeService.get(formDTO.getNoticeId());
if (null == notice) {
logger.error(ModuleConstant.NO_SUCH_TOPIC);
throw new RenException(ModuleConstant.NO_SUCH_TOPIC);
logger.error("通知评论,未查询到通知数据");
throw new RenException(String.format("通知评论,未查询到通知数据,通知Id->", formDTO.getNoticeId()));
}
ResiGroupMemberDTO resiGroupMemberDTO =
resiGroupMemberService.getResiGroupMember(notice.getGroupId(), tokenDto.getUserId());
resiGroupMemberService.getResiGroupMember(notice.getGroupId(), formDTO.getUserId());
//查看当前用户是否被禁言或者被移除
if (null != resiGroupMemberDTO) {
if (MemberStateConstant.SILENT.equals(resiGroupMemberDTO.getStatus())) {
@ -154,7 +148,7 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl<NoticeCommentDao,
* @Description 通知评论列表查询
**/
@Override
public List<NoticeCommentListResultDTO> noticeCommentList(TokenDto tokenDto, NoticeCommentListFormDTO formDTO) {
public List<NoticeCommentListResultDTO> noticeCommentList(NoticeCommentListFormDTO formDTO) {
//1.分页查询通知评论列表
formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize());
List<NoticeCommentListResultDTO> resultList = baseDao.getNoticeCommentList(formDTO);

19
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java

@ -17,14 +17,8 @@
package com.epmet.modules.notice.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.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.dto.result.UserBaseInfoResultDTO;
@ -45,9 +39,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -66,7 +58,6 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl<NoticeReadRecor
@Autowired
private NoticeDao noticeDao;
/**
* @param formDTO
* @return
@ -74,7 +65,7 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl<NoticeReadRecor
* @Description 通知已读未读列表查询
**/
@Override
public NoticeReadListResultDTO noticeReadList(TokenDto tokenDto, NoticeReadListFormDTO formDTO) {
public NoticeReadListResultDTO noticeReadList(NoticeReadListFormDTO formDTO) {
NoticeReadListResultDTO resultDTO = new NoticeReadListResultDTO();
List<NoticeReadListResultDTO.NoticeReafdRecord> readList = new ArrayList<>();
List<NoticeReadListResultDTO.NoticeReafdRecord> unReadList = new ArrayList<>();
@ -82,7 +73,7 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl<NoticeReadRecor
String leaderId = noticeDao.selectNoticeGroupLeader(formDTO.getNoticeId());
//1.根据通知Id查询组成员已读未读数据
List<NoticeReadRecordDTO> list = baseDao.getByNoticeId(formDTO.getNoticeId());
List<NoticeReadRecordDTO> list = baseDao.getByNoticeId(formDTO.getNoticeId(), leaderId);
//2.调用user服务,查询人员基础数据
List<String> userIdList = list.stream().map(NoticeReadRecordDTO::getUserId).collect(Collectors.toList());
@ -132,9 +123,9 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl<NoticeReadRecor
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void readType(TokenDto tokenDto, ReadTypeFormDTO formDTO) {
public void readType(ReadTypeFormDTO formDTO) {
//1.根据通知Id和当前用户查询是否存在通知阅读记录
NoticeReadRecordEntity entity = baseDao.selectByNoticeId(formDTO.getNoticeId(), tokenDto.getUserId());
NoticeReadRecordEntity entity = baseDao.selectByNoticeId(formDTO.getNoticeId(), formDTO.getUserId());
//2.不存在记录时新增已读记录
if (null == entity || StringUtils.isEmpty(entity.getId())) {
@ -146,7 +137,7 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl<NoticeReadRecor
reafdRecord.setGridId(notice.getGridId());
reafdRecord.setGroupId(notice.getGroupId());
reafdRecord.setNoticeId(notice.getId());
reafdRecord.setUserId(tokenDto.getUserId());
reafdRecord.setUserId(formDTO.getUserId());
reafdRecord.setReadFlag(ReadFlagConstant.READ);
insert(reafdRecord);
} else {

58
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

@ -18,31 +18,26 @@
package com.epmet.modules.notice.service.impl;
import cn.hutool.core.collection.CollUtil;
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.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.entity.ResiGroupEntity;
@ -63,10 +58,9 @@ import com.epmet.resi.group.dto.notice.NoticeDTO;
import com.epmet.resi.group.dto.notice.form.AddNoticeFormDTO;
import com.epmet.resi.group.dto.notice.form.EditNoticeFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeDetailFormDTO;
import com.epmet.resi.group.dto.notice.form.NoticeFileDTO;
import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO;
import com.epmet.resi.group.dto.topic.form.FileDTO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -74,7 +68,10 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -103,6 +100,8 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private NoticeAttachmentService noticeAttachmentService;
@ -111,7 +110,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
@Autowired
private NoticeReadRecordService noticeReafdRecordService;
@Autowired
private NoticeReadRecordDao noticeReafdRecordDao;
private NoticeReadRecordDao noticeReadRecordDao;
@Override
@ -128,7 +127,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void add(TokenDto tokenDto, AddNoticeFormDTO formDTO) {
public void add(AddNoticeFormDTO formDTO) {
//1.查询组内成员数据
List<ResiGroupMemberDTO> memberList = resiGroupMemberDao.getMemberList(formDTO.getGroupId());
if (CollUtil.isEmpty(memberList)) {
@ -138,7 +137,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
//2.校验当前操作人员是否为组长
AtomicReference<Boolean> bl = new AtomicReference<>(true);
memberList.forEach(m -> {
if (m.getCustomerUserId().equals(tokenDto.getUserId()) && "leader".equals(m.getGroupLeaderFlag())) {
if (m.getCustomerUserId().equals(formDTO.getUserId()) && "leader".equals(m.getGroupLeaderFlag())) {
bl.set(false);
}
});
@ -150,30 +149,27 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
List<String> wordList = new ArrayList<>();
wordList.add(formDTO.getTitle());
wordList.add(formDTO.getContent());
List<String> imageList = formDTO.getImageList().stream().map(FileDTO::getUrl).collect(Collectors.toList());
List<String> imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList());
safetyCheck(wordList, imageList);
//4.保存小组通知基础数据
//4-1.获取小组信息
ResiGroupEntity groupEntity = resiGroupDao.selectById(formDTO.getGroupId());
if (null == groupEntity) {
throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", tokenDto.getUserId()));
throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", formDTO.getUserId()));
}
//4-2.获取token用户所属组织信息
LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO();
dto.setApp(tokenDto.getApp());
dto.setClient(tokenDto.getClient());
dto.setUserId(tokenDto.getUserId());
Result<LoginUserDetailsResultDTO> result = epmetUserOpenFeignClient.getLoginUserDetails(dto);
if (!result.success() || org.springframework.util.StringUtils.isEmpty(result.getData().getAgencyId())) {
throw new RenException(String.format("调用user服务查询用户数据失败,userId->", tokenDto.getUserId()));
Result<GridInfoResultDTO> result = govOrgOpenFeignClient.queryGridInfo(groupEntity.getGridId());
if (!result.success() || org.springframework.util.StringUtils.isEmpty(result.getData().getParentAgencyId())) {
throw new RenException(String.format("调用user服务查询用户数据失败,userId->", formDTO.getUserId()));
}
LoginUserDetailsResultDTO resultDTO = result.getData();
GridInfoResultDTO resultDTO = result.getData();
//4-3.保存通知数据
NoticeEntity entity = new NoticeEntity();
entity.setCustomerId(resultDTO.getCustomerId());
entity.setAgencyId(resultDTO.getAgencyId());
entity.setAgencyId(resultDTO.getParentAgencyId());
entity.setGridId(groupEntity.getGridId());
entity.setGroupId(formDTO.getGroupId());
entity.setTitle(formDTO.getTitle());
@ -237,7 +233,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
if ("leader".equals(m.getGroupLeaderFlag())) {
reafdRecord.setReadFlag(ReadFlagConstant.READ);
}else {
reafdRecord.setReadFlag(ReadFlagConstant.UN_READ);
reafdRecord.setReadFlag("un_read");
}
reafdRecordList.add(reafdRecord);
});
@ -274,7 +270,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
* @Description 小组通知变更
**/
@Override
public void edit(TokenDto tokenDto, EditNoticeFormDTO formDTO) {
public void edit(EditNoticeFormDTO formDTO) {
//1.查询通知是否存在
NoticeEntity entity = baseDao.selectById(formDTO.getNoticeId());
if (null == entity) {
@ -284,7 +280,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
List<String> wordList = new ArrayList<>();
wordList.add(formDTO.getTitle());
wordList.add(formDTO.getContent());
List<String> imageList = formDTO.getImageList().stream().map(FileDTO::getUrl).collect(Collectors.toList());
List<String> imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList());
safetyCheck(wordList, imageList);
//3.查询组成员列表数据
@ -346,7 +342,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
}
//6.通知已读未读消息表数据先删后增
noticeReafdRecordDao.delByNoticeId(formDTO.getNoticeId());
noticeReadRecordDao.delByNoticeId(formDTO.getNoticeId());
List<NoticeReadRecordEntity> reafdRecordList = new ArrayList<>();
memberList.forEach(m -> {
NoticeReadRecordEntity reafdRecord = new NoticeReadRecordEntity();
@ -358,7 +354,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
if ("leader".equals(m.getGroupLeaderFlag())) {
reafdRecord.setReadFlag(ReadFlagConstant.READ);
}else {
reafdRecord.setReadFlag(ReadFlagConstant.UN_READ);
reafdRecord.setReadFlag("un_read");
}
reafdRecordList.add(reafdRecord);
});
@ -370,7 +366,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
//7-1.获取小组信息
ResiGroupEntity groupEntity = resiGroupDao.selectById(entity.getGroupId());
if (null == groupEntity) {
throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", tokenDto.getUserId()));
throw new RenException(String.format("保存小组通知,获取小组数据失败,小组Id->", formDTO.getUserId()));
}
//7-2.推送站内信信息
List<UserMessageFormDTO> userMessageFormDTOS = new ArrayList<>();
@ -400,7 +396,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
* @Description 小组通知详情
**/
@Override
public NoticeDetailResultDTO noticeDetail(TokenDto tokenDto, NoticeDetailFormDTO formDTO) {
public NoticeDetailResultDTO noticeDetail(NoticeDetailFormDTO formDTO) {
NoticeDetailResultDTO resultDTO = new NoticeDetailResultDTO();
List<NoticeDetailResultDTO.File> imageList = new ArrayList<>();
List<NoticeDetailResultDTO.File> docList = new ArrayList<>();

107
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -82,6 +82,8 @@ import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO;
import com.epmet.resi.group.dto.group.ResiGroupStatisticalInfoRedisDTO;
import com.epmet.resi.group.dto.group.result.UserReadFlagResultDTO;
import com.epmet.resi.group.dto.group.result.UserUnReadResultDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO;
import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO;
@ -109,6 +111,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.constraints.NotBlank;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -2192,7 +2195,109 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
*/
@Override
public GetLatestV2ResultDTO getLatestV2(GetLatestV2FormDTO formDTO) {
return null;
GetLatestV2ResultDTO result = new GetLatestV2ResultDTO();
String userId = formDTO.getUserId();
String groupId = formDTO.getGroupId();
// 查询此人在小组内的身份
String leaderFlag = resiGroupMemberDao.selectUserRole(groupId, userId);
result.setUserRole(leaderFlag);
ResiGroupEntity resiGroup = resiGroupDao.selectById(groupId);
result.setGroupType(resiGroup.getGroupType());
if (leaderFlag.equals(ModuleConstant.GROUP_MEMBER_FLAG)){
// 当前人员是组长,显示通知按钮
result.setNoticeBut(true);
}
if (result.getGroupType().equals(ModuleConstant.GROUP_TYPE_BRANCH) && leaderFlag.equals(ModuleConstant.GROUP_MEMBER_FLAG)){
// 当前组为支部组且当前人是组长,显示活动按钮
result.setActBut(true);
}
Integer unRead = resiGroupDao.selectUserUnRead(groupId, userId);
if (unRead > NumConstant.ZERO){
// 存在未读消息
result.setUnReadNews(true);
}
// 查询 话题、通知、活动最近10条记录
List<LatestTenResultDTO> latestTenData = resiGroupDao.selectLatestTen(groupId);
if (CollectionUtils.isEmpty(latestTenData)){
result.setList(new ArrayList<>());
return result;
}
// 活动、通知、话题 创建者ID集合
List<String> userIds = latestTenData.stream().map(m -> m.getUserId()).collect(Collectors.toList());
// 活动、通知、话题 ID集合
List<String> ids = latestTenData.stream().map(m -> m.getId()).collect(Collectors.toList());
List<UserInfoResultDTO> userInfos = disPoseUserInfo(result.getGroupType(), userIds);
// 查询用户的 活动或通知的 阅读状态
List<UserReadFlagResultDTO> userReadFlag = resiGroupDao.selectUserReadFlag(groupId, userIds, ids);
// 查询小组下的 通知或活动 未读人数
List<UserUnReadResultDTO> userUnReadCount = resiGroupDao.selectUserUnReadById(groupId, ids);
latestTenData.forEach(l -> {
// 是否转议题,true:是,false:不是
l.setShiftIssueFlag(StringUtils.isNotEmpty(l.getIssueId()));
// 是不是本人,true:是,false:不是
l.setReleaseUserFlag(userId.equals(l.getUserId()));
// 用户的名字,头像赋值
if (!CollectionUtils.isEmpty(userIds)){
userInfos.forEach(u -> {
if (l.getUserId().equals(u.getUserId())){
l.setReleaseUserName(u.getReleaseUserName());
l.setReleaseUserHeadPhoto(u.getReleaseUserHeadPhoto());
}
});
}
// 用户已读,未读
if (!CollectionUtils.isEmpty(userReadFlag)){
userReadFlag.forEach(u -> {
if (l.getUserId().equals(u.getUserId()) && l.getId().equals(u.getId())){
l.setReadOrUnRead(u.getReadFlag());
}
});
}
// 活动,通知未读人数
if (!CollectionUtils.isEmpty(userUnReadCount)){
userUnReadCount.forEach(u -> {
if (l.getId().equals(u.getId())){
l.setUnReadCount(u.getUnRead());
}
});
}
});
result.setList(latestTenData);
return result;
}
/**
* @Description 查询用户信息头像名字
* @Param groupType
* @Param userIds
* @author zxc
* @date 2021/4/20 下午5:54
*/
public List<UserInfoResultDTO> disPoseUserInfo(String groupType,List<String> userIds){
List<UserInfoResultDTO> result = new ArrayList<>();
Result<List<UserBaseInfoResultDTO>> userInfo = userOpenFeignClient.queryUserBaseInfo(userIds);
if (!userInfo.success()){
throw new RenException(ModuleConstant.GET_USER_INFO_ERR);
}
List<UserBaseInfoResultDTO> userInfos = userInfo.getData();
if (CollectionUtils.isEmpty(userInfos)){
return new ArrayList<>();
}
userInfos.forEach(u -> {
UserInfoResultDTO ui = new UserInfoResultDTO();
ui.setUserId(u.getUserId());
ui.setReleaseUserHeadPhoto(u.getHeadImgUrl());
if (groupType.equals(ModuleConstant.GROUP_TYPE_BRANCH)){
ui.setReleaseUserName(u.getStreet() + "-" + u.getRealName());
}else {
ui.setReleaseUserName(u.getShowName());
}
result.add(ui);
});
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
return result;
}
}

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java

@ -387,4 +387,9 @@ public interface ModuleConstant extends Constant {
String GROUP_TYPE_BRANCH = "branch";
String IS_PARTY_MEMBER_ERR = "查询此人是不是党员失败了";
String GROUP_MEMBER_FLAG = "leader";
String GET_USER_INFO_ERR = "查询用户信息失败了";
}

15
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSummaryContentDao.xml

@ -3,6 +3,17 @@
<mapper namespace="com.epmet.modules.act.dao.ActSummaryContentDao">
<select id="selectContentList" parameterType="map" resultType="java.lang.String">
SELECT
M.CONTENT
FROM
act_summary_content m
WHERE
m.DEL_FLAG = '0'
AND m.GROUP_ACT_ID = #{groupActId}
AND m.act_summary_id = #{actSummaryId}
AND m.CONTENT_TYPE = #{contentType}
ORDER BY
m.SORT ASC
</select>
</mapper>

10
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSummaryDao.xml

@ -3,6 +3,14 @@
<mapper namespace="com.epmet.modules.act.dao.ActSummaryDao">
<select id="selectUserSummary" parameterType="map" resultType="com.epmet.modules.act.entity.ActSummaryEntity">
SELECT
*
FROM
act_summary a
where a.DEL_FLAG='0'
and a.GROUP_ACT_ID=#{groupActId}
and a.USER_ID=#{userId}
</select>
</mapper>

153
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -550,4 +550,157 @@
#{pageNo}, #{pageSize}
</select>
<!-- 查询 话题、通知、活动最近10条数据 -->
<select id="selectLatestTen" resultType="com.epmet.resi.group.dto.topic.result.LatestTenResultDTO">
SELECT id,userId,releaseTime,content,status,issueId,contentType,firstPhoto FROM
((SELECT
t.ID,
t.CREATED_BY AS userId,
DATE_FORMAT(t.CREATED_TIME,'%Y-%m-%d %H:%m:%s') AS releaseTime,
t.TOPIC_CONTENT AS content,
t.`STATUS` AS status,
IFNULL(t.ISSUE_ID,'') AS issueId,
'topic' AS contentType,
IFNULL(ta.ATTACHMENT_URL,'') AS firstPhoto
FROM resi_topic t
LEFT JOIN resi_topic_attachment ta ON ta.TOPIC_ID = t.ID AND ta.ATTACHMENT_TYPE = 'image' AND ta.SORT = 0
WHERE t.DEL_FLAG = '0'
AND t.`STATUS` != 'hidden'
AND t.GROUP_ID = #{groupId}
ORDER BY t.CREATED_TIME DESC
LIMIT 10)
UNION ALL
(SELECT
ai.ID,
ai.CREATED_BY AS userId,
DATE_FORMAT(ai.CREATED_TIME,'%Y-%m-%d %H:%m:%s') AS releaseTime,
IFNULL(ac.CONTENT,'') AS content,
ai.`STATUS` AS status,
'' AS issueId,
'act' AS contentType,
IFNULL(ac2.CONTENT,'') AS firstPhoto
FROM group_act_info ai
LEFT JOIN group_act_content ac ON ac.GROUP_ACT_ID = ai.ID AND ac.CONTENT_TYPE = 'text'
LEFT JOIN group_act_content ac2 ON ac2.GROUP_ACT_ID = ai.ID AND ac2.CONTENT_TYPE = 'img' AND ac2.SORT = 1
WHERE ai.DEL_FLAG = '0'
AND ai.GROUP_ID = #{groupId}
ORDER BY ai.CREATED_TIME DESC
LIMIT 10)
UNION ALL
(SELECT
n.ID,
n.CREATED_BY AS userId,
DATE_FORMAT(n.CREATED_TIME,'%Y-%m-%d %H:%m:%s') AS releaseTime,
n.CONTENT AS content,
'' AS status,
'' AS issueId,
'notice' AS contentType,
IFNULL(na.ATTACHMENT_URL,'') AS firstPhoto
FROM notice n
LEFT JOIN notice_attachment na ON na.NOTICE_ID = n.ID AND na.DEL_FLAG = '0' AND na.ATTACHMENT_TYPE = 'image' AND na.SORT = 0
WHERE n.DEL_FLAG = '0'
AND n.GROUP_ID = #{groupId}
ORDER BY n.CREATED_TIME DESC
LIMIT 10)
)temp
ORDER BY releaseTime DESC
LIMIT 10
</select>
<!-- 查询此人在小组内未读数量 -->
<select id="selectUserUnRead" resultType="java.lang.Integer">
SELECT IFNULL(SUM(unRead),0) FROM
((SELECT
COUNT( 1 ) AS unRead
FROM act_read_record
WHERE DEL_FLAG = 0
AND `READ_FLAG` = 'un_read'
AND USER_ID = #{userId}
AND GROUP_ID = #{groupId})
UNION ALL
(SELECT
COUNT( 1 ) AS unRead
FROM notice_read_record
WHERE DEL_FLAG = 0
AND READ_FLAG = 'un_read'
AND USER_ID = #{userId}
AND GROUP_ID = #{groupId})) temp
</select>
<!-- 查询阅读状态 -->
<select id="selectUserReadFlag" resultType="com.epmet.resi.group.dto.group.result.UserReadFlagResultDTO">
(SELECT
READ_FLAG,
USER_ID,
GROUP_ACT_ID AS id
FROM act_read_record
WHERE
DEL_FLAG = 0
AND (
<foreach collection="userIds" item="userId" separator=" OR ">
USER_ID = #{userId}
</foreach>
)
AND (
<foreach collection="ids" item="id" separator=" OR ">
GROUP_ACT_ID = #{id}
</foreach>
)
AND GROUP_ID = #{groupId}
)
UNION ALL
(SELECT
READ_FLAG,
USER_ID,
NOTICE_ID AS id
FROM notice_read_record
WHERE
DEL_FLAG = 0
AND (
<foreach collection="userIds" item="userId" separator=" OR ">
USER_ID = #{userId}
</foreach>
)
AND (
<foreach collection="ids" item="id" separator=" OR ">
NOTICE_ID = #{id}
</foreach>
)
AND GROUP_ID = #{groupId}
)
</select>
<!-- 根据 活动或通知查询 未读人数 -->
<select id="selectUserUnReadById" resultType="com.epmet.resi.group.dto.group.result.UserUnReadResultDTO">
(SELECT
GROUP_ACT_ID AS id,
COUNT( 1 ) AS unRead
FROM act_read_record
WHERE DEL_FLAG = 0
AND (
<foreach collection="ids" item="id" separator=" OR ">
GROUP_ACT_ID = #{id}
</foreach>
)
AND `READ_FLAG` = 'un_read'
AND GROUP_ID = #{groupId}
GROUP BY GROUP_ACT_ID
)
UNION ALL
(SELECT
NOTICE_ID AS id,
COUNT( 1 ) AS unRead
FROM notice_read_record
WHERE DEL_FLAG = 0
AND (
<foreach collection="ids" item="id" separator=" OR ">
NOTICE_ID = #{id}
</foreach>
)
AND `READ_FLAG` = 'un_read'
AND GROUP_ID = #{groupId}
GROUP BY NOTICE_ID
)
</select>
</mapper>

11
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml

@ -215,4 +215,15 @@
rgm.RESI_GROUP_ID = #{groupId}
AND rgm.DEL_FLAG = '0'
</select>
<!-- 查询此人组内身份 -->
<select id="selectUserRole" resultType="java.lang.String">
SELECT
GROUP_LEADER_FLAG
FROM
resi_group_member
WHERE DEL_FLAG = '0'
AND CUSTOMER_USER_ID = #{userId}
AND RESI_GROUP_ID = #{groupId}
</select>
</mapper>

7
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReadRecordDao.xml

@ -7,17 +7,18 @@
SELECT
*
FROM
notice_reafd_record
notice_read_record
WHERE
del_flag = '0'
AND notice_id = #{noticeId}
AND user_id != #{leaderId}
</select>
<select id="selectByNoticeId" resultType="com.epmet.modules.notice.entity.NoticeReadRecordEntity">
SELECT
*
FROM
notice_reafd_record
notice_read_record
WHERE
del_flag = '0'
AND notice_id = #{noticeId}
@ -27,7 +28,7 @@
<delete id="delByNoticeId">
DELETE
FROM
notice_reafd_record
notice_read_record
WHERE
notice_id = #{noticeId}
</delete>

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/20 下午5:51
* @DESC
*/
@Data
public class UserInfoResultDTO implements Serializable {
private static final long serialVersionUID = 6003815400792121273L;
private String userId;
/**
* 发布者的全称街道-姓氏先生/女士专项组显示真实名
*/
private String releaseUserName;
/**
* 话题发布者的头像Url
*/
private String releaseUserHeadPhoto;
}
Loading…
Cancel
Save