Browse Source

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

master
yinzuomei 4 years ago
parent
commit
ab21c1d287
  1. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 15
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.java
  3. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/GroupActIdDTO.java
  4. 29
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/ActReadViewFormDTO.java
  5. 38
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CancelActFormDTO.java
  6. 39
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java
  7. 25
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentQueryFormDTO.java
  8. 39
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/SetSignTimeFormDTO.java
  9. 47
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/SignInFormDTO.java
  10. 25
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/SignInRecFormDTO.java
  11. 143
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/ActDetailResultDTO.java
  12. 30
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java
  13. 22
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/SetSignTimeResultDTO.java
  14. 31
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/SignInRecResultDTO.java
  15. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java
  16. 101
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupSetupDTO.java
  17. 34
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/AllGroupListFormDTO.java
  18. 51
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java
  19. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeReadRecordDTO.java
  20. 28
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java
  21. 33
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentListFormDTO.java
  22. 21
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/ReadTypeFormDTO.java
  23. 44
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java
  24. 24
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetLatestV2FormDTO.java
  25. 47
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GetLatestV2ResultDTO.java
  26. 104
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/LatestTenResultDTO.java
  27. 40
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentController.java
  28. 56
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActSignInRecordController.java
  29. 31
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java
  30. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentDao.java
  31. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActOperationRecordDao.java
  32. 26
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActReadRecordDao.java
  33. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActSignInCodeDao.java
  34. 21
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActSignInRecordDao.java
  35. 20
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActContentDao.java
  36. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java
  37. 20
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentService.java
  38. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActSignInCodeService.java
  39. 37
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActSignInRecordService.java
  40. 28
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java
  41. 107
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java
  42. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActSignInCodeServiceImpl.java
  43. 193
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActSignInRecordServiceImpl.java
  44. 270
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java
  45. 4
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/GroupActConstant.java
  46. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  47. 40
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupSetupController.java
  48. 7
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  49. 33
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupSetupDao.java
  50. 71
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupSetupEntity.java
  51. 47
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupSetupRedis.java
  52. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  53. 31
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupSetupService.java
  54. 46
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  55. 40
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupSetupServiceImpl.java
  56. 17
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java
  57. 1
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/InvitationRecordServiceImpl.java
  58. 13
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java
  59. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  60. 30
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentController.java
  61. 44
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java
  62. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentDao.java
  63. 8
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeDao.java
  64. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeReadRecordDao.java
  65. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeReadRecordEntity.java
  66. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/excel/NoticeReadRecordExcel.java
  67. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/redis/NoticeReadRecordRedis.java
  68. 20
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java
  69. 25
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java
  70. 148
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java
  71. 93
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java
  72. 51
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java
  73. 14
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  74. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
  75. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  76. 16
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentDao.xml
  77. 15
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActOperationRecordDao.xml
  78. 24
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActReadRecordDao.xml
  79. 9
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSignInCodeDao.xml
  80. 21
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSignInRecordDao.xml
  81. 15
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActContentDao.xml
  82. 23
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  83. 7
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupSetupDao.xml
  84. 15
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentDao.xml
  85. 14
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeDao.xml
  86. 15
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReadRecordDao.xml

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -169,8 +169,14 @@ public enum EpmetErrorCode {
PLEASE_INPUT_ACT_CONTENT(8903,"请输入活动内容,或添加图片"),
GROUP_ACT_CONTENT_MAX(8904,"活动内容至多输入1000字"),
GROUP_ACT_IMG_MAX(8905,"最多可添加3张图片"),
PARTY_MEMBER_CREATE_BRANCH_GROUP(8906,"您不是党员,不能创建支部小组");
PARTY_MEMBER_CREATE_BRANCH_GROUP(8906,"您不是党员,不能创建支部小组"),
NOT_IN_GROUP_CAN_NOT_VIEW(8907,"当前内容仅允许组内成员查看"),
PARTY_MEMBER_JOIN_BRANCH_GROUP(8908,"您不是党员,不能加入支部小组"),
GROUP_ACT_CAN_NOT_CANCEL(8909,"活动%s,不能取消"),
//8910的msg动态赋值
GROUP_ACT_CAN_NOT_COMMENT(8910,"当前活动,不能评论"),
SIGN_IN_TIME_NOT_START(8911,"未到签到时间,不允许签到"),
SIGN_IN_TIME_PASSED(8912,"当前时间已超过签到时间");
private int code;
private String msg;

15
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActReadRecordDTO.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,16 @@ public class ActReadRecordDTO implements Serializable {
*/
private String customerId;
/**
* 小组所属网格id
*/
private String gridId;
/**
* 小组id
*/
private String groupId;
/**
* group_act_info.id
*/
@ -51,7 +62,7 @@ public class ActReadRecordDTO implements Serializable {
/**
* 已读: read未读un_read查看活动详情后修改此表或者插入一条新的已读记录
*/
private String read;
private String readFlag;
/**
* 用户id

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/GroupActIdDTO.java

@ -5,7 +5,7 @@ import lombok.Data;
import java.io.Serializable;
/**
* 描述一下
* 组织活动id
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/19 15:11

29
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/ActReadViewFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.resi.group.dto.act.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 016活动已读未读列表
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/19 19:36
*/
@Data
public class ActReadViewFormDTO implements Serializable {
private static final long serialVersionUID = -7382937811770356934L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class)
private String groupActId;
/**
* 当前用户id
*/
@NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class)
private String userId;
}

38
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CancelActFormDTO.java

@ -0,0 +1,38 @@
package com.epmet.resi.group.dto.act.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 011取消活动
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 12:04
*/
@Data
public class CancelActFormDTO implements Serializable {
private static final long serialVersionUID = 6126854423030661426L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class)
private String groupActId;
@NotBlank(message = "取消原因不能为空", groups = AddUserShowGroup.class)
@Length(max = 300, message = "取消原因最多输入300字", groups = AddUserShowGroup.class)
private String reason;
/**
* 当前用户id
*/
@NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class)
private String userId;
}

39
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java

@ -0,0 +1,39 @@
package com.epmet.resi.group.dto.act.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 005评论活动
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 12:35
*/
@Data
public class CommentFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class)
private String groupActId;
@NotBlank(message = "评论内容不能为空", groups = AddUserShowGroup.class)
@Length(max = 500, message = "评论内容最多输入500字", groups = AddUserShowGroup.class)
private String commentContent;
/**
* 当前用户id
*/
@NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class)
private String userId;
@NotBlank(message = "tokenDto获取customerId为空", groups = AddUserInternalGroup.class)
private String customerId;
}

25
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentQueryFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.resi.group.dto.act.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 006活动评论列表查询
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 12:55
*/
@Data
public class CommentQueryFormDTO implements Serializable {
private static final long serialVersionUID = 4013876445914100561L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class)
private String groupActId;
private Integer pageNo;
private Integer pageSize;
}

39
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/SetSignTimeFormDTO.java

@ -0,0 +1,39 @@
package com.epmet.resi.group.dto.act.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 010设置修改签到时间,生成签到码
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 13:34
*/
@Data
public class SetSignTimeFormDTO implements Serializable {
private static final long serialVersionUID = 4134192208518833623L;
public interface AddUserInternalGroup {
}
/**
* 小组活动id
*/
@NotBlank(message = "groupActId不能为空",groups = AddUserInternalGroup.class)
private String groupActId;
/**
* 签到开始时间yyyy-MM-dd HH:mm
*/
@NotBlank(message = "开始时间不能为空",groups = AddUserInternalGroup.class)
private String signInStartTime;
/**
* 签到截止时间yyyy-MM-dd HH:mm
*/
@NotBlank(message = "截止时间不能为空",groups = AddUserInternalGroup.class)
private String signInEndTime;
@NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class)
private String userId;
}

47
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/SignInFormDTO.java

@ -0,0 +1,47 @@
package com.epmet.resi.group.dto.act.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 007签到
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 15:14
*/
@Data
public class SignInFormDTO implements Serializable {
private static final long serialVersionUID = 3632452994910057034L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "活动id不能为空",groups = AddUserInternalGroup.class)
private String groupActId;
/**
* 签到地址
*/
@NotBlank(message = "签到地址不能为空",groups = AddUserInternalGroup.class)
private String signInAddress;
/**
* 签到地点-经度
*/
private BigDecimal longitude;
/**
* 签到地点-纬度
*/
private BigDecimal latitude;
@NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class)
private String userId;
@NotBlank(message = "tokenDto获取customerId为空", groups = AddUserInternalGroup.class)
private String customerId;
}

25
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/SignInRecFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.resi.group.dto.act.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 009签到记录列表
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 15:42
*/
@Data
public class SignInRecFormDTO implements Serializable {
private static final long serialVersionUID = -144395799437468448L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class)
private String groupActId;
private Integer pageNo;
private Integer pageSize;
}

143
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/ActDetailResultDTO.java

@ -1,10 +1,149 @@
package com.epmet.resi.group.dto.act.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 描述一下
* 004活动详情 返参
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/19 19:24
*/
public class ActDetailResultDTO {
@Data
public class ActDetailResultDTO implements Serializable {
private static final long serialVersionUID = 8912162789028312892L;
private String groupActId;
/**
* 小组id
*/
private String groupId;
/**
* 活动标题
*/
private String title;
/**
* 活动时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date startTime;
/**
* 活动所属类别编码
*/
private String categoryCode;
/**
* 上级类别编码
*/
private String parentCode;
/**
* 活动类别名称eg支部建设-三会一课
*/
private String allCategoryName;
/**
* 活动地点
*/
private String address;
/**
* 活动地点-经度
*/
private BigDecimal longitude;
/**
* 活动地点-纬度
*/
private BigDecimal latitude;
/**
* 应参加人数组长填入此列也是应签到人数
*/
private Integer shouldAttend;
/**
* 活动状态已发布published;已取消canceled已变更changed已关闭closed
*/
private String status;
/**
* 签到开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signInStartTime;
/**
* 签到截止时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signInEndTime;
/**
* 是否填写总结1已填写0未填写
*/
private Integer summaryFlag;
/**
* 取消时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date canceledTime;
/**
* 关闭时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date closedTime;
/**
* 活动发布人用户id
*/
private String publishUserId;
/**
* 内容列表
*/
private List<String> textList;
/**
* 图片列表
*/
private List<String> imgList;
//以下字段需要单独赋值
/**
* 取消原因
*/
private String canceledReason;
/**
* blank: 不显示 display显示
*/
private String signInButton;
/**
* 未签到时的描述可能是签到时间未开始可能是签到时间已经过
*/
private String signInDesc;
/**
* member成员leader群主
*/
private String userRole;
/**
* 有签到后不可以修改活动时间true可以修改false不可以
*/
private Boolean startTimeEditFlag;
}

30
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.resi.group.dto.act.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 006活动评论列表查询
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 12:58
*/
@Data
public class CommentResultDTO implements Serializable {
private static final long serialVersionUID = 6487668038520643604L;
private String commentId;
private String commentContent;
private String commentUserHeadPhoto;
private String commentUserName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date commentTime;
private String commentUserId;
}

22
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/SetSignTimeResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.resi.group.dto.act.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 010设置修改签到时间,生成签到码
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 13:46
*/
@Data
public class SetSignTimeResultDTO implements Serializable {
private static final long serialVersionUID = -7444245554430563944L;
private String groupActId;
private Date signInStartTime;
private Date signInEndTime;
private String signInCodeUrl;
}

31
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/SignInRecResultDTO.java

@ -0,0 +1,31 @@
package com.epmet.resi.group.dto.act.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 009签到记录列表
*
* @author yinzuomei@elink-cn.com
* @date 2021/4/20 15:43
*/
@Data
public class SignInRecResultDTO implements Serializable {
private static final long serialVersionUID = -2847848186325667663L;
private Integer signedInNum;
private Integer shouldAttend;
private List<SignInDetail> list;
@NoArgsConstructor
@Data
public static class SignInDetail {
private String signUserId;
private String signUserName;
private Date signInTime;
private String signInAddress;
}
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.resi.group.dto.comment.result;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -40,6 +41,7 @@ public class ResiCommentResultDTO implements Serializable {
/**
* 用户Id 评论者Id
* */
@JsonIgnore
private String userId;
/**

101
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupSetupDTO.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.resi.group.dto.group;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 建组设置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-20
*/
@Data
public class ResiGroupSetupDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID,初始默认为default
*/
private String customerId;
/**
* 默认小组头像
*/
private String logo;
/**
* 小组名称
*/
private String name;
/**
* 小组简介
*/
private String describe;
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
/**
* 专用dedicated常用common_used
*/
private String category;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -0,0 +1,34 @@
package com.epmet.resi.group.dto.group.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author sun
* @Description 所有小组查询-接口入参
*/
@Data
public class AllGroupListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网格Id
*/
@NotBlank(message = "网格Id不能为空", groups = {AllGroupListFormDTO.GroupList.class})
private String gridId;
/**
* 请求页码
*/
@Min(1)
private int pageNo;
/**
* 每页多少条数据
*/
private int pageSize = 20;
public interface GroupList {
}
}

51
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java

@ -0,0 +1,51 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 推荐小组查询返参
* @Author yinzuomei
* @Date 2020/3/28 17:11
*/
@Data
public class AllGroupListResultDTO implements Serializable {
private static final long serialVersionUID = -155229599412911489L;
/**
* 群组id
*/
private String groupId;
/**
* 群组头像
*/
private String groupHeadPhoto;
/**
* 群组名称
*/
private String groupName;
/**
* 成员总数
*/
private Integer totalMember;
/**
* 党员总数
*/
private Integer totalPartyMember;
/**
* under_auditting审核中rejected已拒绝的前端显示加入
*/
private String status="";
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeReafdRecordDTO.java → epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeReadRecordDTO.java

@ -29,7 +29,7 @@ import lombok.Data;
* @since v1.0.0 2021-04-19
*/
@Data
public class NoticeReafdRecordDTO implements Serializable {
public class NoticeReadRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;

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

@ -0,0 +1,28 @@
package com.epmet.resi.group.dto.notice.form;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @Author sun
* @Description 小组通知编辑-接口入参
*/
@Data
public class NoticeCommentFormDTO {
/**
* 通知Id
*/
@NotBlank(message = "通知Id不能为空",groups = {NoticeCommentFormDTO.Comment.class})
private String noticeId;
/**
* 评论内容300
*/
@NotBlank(message = "评论内容不能为空",groups = {NoticeCommentFormDTO.Comment.class})
@Length(max = 20, message = "评论内容不能超过300个字符")
private String commentContent;
public interface Comment{}
}

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

@ -0,0 +1,33 @@
package com.epmet.resi.group.dto.notice.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author sun
* @Description 通知评论列表查询-接口入参
*/
@Data
public class NoticeCommentListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 通知Id
*/
@NotBlank(message = "通知Id不能为空",groups = {NoticeCommentListFormDTO.CommentList.class})
private String noticeId;
/**
* 请求页码
* */
@Min(1)
private int pageNo;
/**
* 每页多少条数据
* */
private int pageSize = 20;
public interface CommentList{}
}

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

@ -0,0 +1,21 @@
package com.epmet.resi.group.dto.notice.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Author sun
* @Description 通知已读未读列表查询-接口入参
*/
@Data
public class ReadTypeFormDTO {
/**
* 通知Id
*/
@NotBlank(message = "通知Id不能为空",groups = {ReadTypeFormDTO.Read.class})
private String noticeId;
public interface Read{}
}

44
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java

@ -0,0 +1,44 @@
package com.epmet.resi.group.dto.notice.result;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author sun
* @Description 通知评论列表查询-接口返参
*/
@Data
public class NoticeCommentListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 评论Id
* */
private String noticeCommentId;
/**
* 评论内容
* */
private String commentContent;
/**
* 评论者头像
* */
private String commentUserHeadPhoto;
/**
* 评论者姓名
* */
private String commentUserName;
/**
* 评论时间 yyyy-MM-dd HH:mm
* */
@JSONField(format="yyyy-MM-dd HH:mm")
private Date commentTime;
/**
* 用户Id 评论者Id
* */
private String userId;
}

24
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/GetLatestV2FormDTO.java

@ -0,0 +1,24 @@
package com.epmet.resi.group.dto.topic.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/20 下午2:23
* @DESC
*/
@Data
public class GetLatestV2FormDTO implements Serializable {
private static final long serialVersionUID = -5212709032157867124L;
public interface GetLatestV2Form{}
@NotBlank(message = "小组ID不能为空",groups = GetLatestV2Form.class)
private String groupId;
private String userId;
}

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

@ -0,0 +1,47 @@
package com.epmet.resi.group.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/4/20 下午2:34
* @DESC
*/
@Data
public class GetLatestV2ResultDTO implements Serializable {
private static final long serialVersionUID = 1386600583326358070L;
/**
* 当前人员组内角色(member成员leader群主)
*/
private String userRole;
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
/**
* 是否显示通知按钮
*/
private String noticeBut;
/**
* 是否显示活动按钮
*/
private String actBut;
/**
* 是否存在未读消息
*/
private Boolean unReadNews;
/**
* 近十条数据
*/
private List<LatestTenResultDTO> list;
}

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

@ -0,0 +1,104 @@
package com.epmet.resi.group.dto.topic.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/20 下午2:45
* @DESC
*/
@Data
public class LatestTenResultDTO implements Serializable {
private static final long serialVersionUID = -8447212650446365613L;
/**
* 话题通知活动Id
*/
private String id;
/**
* 话题通知活动Id发布人的id
*/
private String userId;
/**
* 发布者的全称街道-姓氏先生/女士专项组显示真实名
*/
private String releaseUserName;
/**
* 话题发布者的头像Url
*/
private String releaseUserHeadPhoto;
/**
* 发布时间yyyy-MM-dd HH:mm
*/
private String releaseTimed;
/**
* 内容
*/
private String content;
/**
* 话题状态discussing进行中closed已关闭
*/
private String status;
/**
* 是否本人
*/
private String releaseUserFlag;
/**
* 如果有图片后台只返回第一张没有图片此列为空
*/
private String firstPhoto;
/**
* 议题id
*/
private String issueId;
/**
* 是否被转为议题true,false
*/
private Boolean shiftIssueFlag;
/**
* 数据类型(topic:话题 notice:通知 act:活动)
*/
private String contentType;
/**
* 本人已读未读状态(read已读 unread未读)
*/
private String readOrUnRead;
/**
* 通知或活动未读人员数
*/
private Integer unReadCount;
public LatestTenResultDTO() {
this.id = "";
this.userId = "";
this.releaseUserName = "";
this.releaseUserHeadPhoto = "";
this.releaseTimed = "";
this.content = "";
this.status = "";
this.releaseUserFlag = "";
this.firstPhoto = "";
this.issueId = "";
this.shiftIssueFlag = false;
this.contentType = "";
this.readOrUnRead = "";
this.unReadCount = NumConstant.ZERO;
}
}

40
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentController.java

@ -17,11 +17,23 @@
package com.epmet.modules.act.controller;
import com.baomidou.mybatisplus.extension.api.R;
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.ActCommentService;
import com.epmet.resi.group.dto.act.form.CommentFormDTO;
import com.epmet.resi.group.dto.act.form.CommentQueryFormDTO;
import com.epmet.resi.group.dto.act.result.CommentResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 活动评论表
@ -36,5 +48,33 @@ public class ActCommentController {
@Autowired
private ActCommentService actCommentService;
/**
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 005评论活动
* @Date 2021/4/20 12:38
**/
@PostMapping("submit")
public Result submitComment(@LoginUser TokenDto tokenDto, @RequestBody CommentFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCommentContent(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,CommentFormDTO.AddUserShowGroup.class,CommentFormDTO.AddUserInternalGroup.class);
actCommentService.submitComment(formDTO);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.group.dto.act.result.CommentResultDTO>>
* @param formDTO
* @author yinzuomei
* @description 006活动评论列表查询
* @Date 2021/4/20 13:01
**/
@PostMapping("comlist")
public Result<List<CommentResultDTO>> queryCommentList(@RequestBody CommentQueryFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CommentQueryFormDTO.AddUserInternalGroup.class);
return new Result<List<CommentResultDTO>>().ok(actCommentService.queryCommentList(formDTO));
}
}

56
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActSignInRecordController.java

@ -17,8 +17,19 @@
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.ActSignInRecordService;
import com.epmet.resi.group.dto.act.form.SetSignTimeFormDTO;
import com.epmet.resi.group.dto.act.form.SignInFormDTO;
import com.epmet.resi.group.dto.act.form.SignInRecFormDTO;
import com.epmet.resi.group.dto.act.result.SetSignTimeResultDTO;
import com.epmet.resi.group.dto.act.result.SignInRecResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -36,4 +47,49 @@ public class ActSignInRecordController {
@Autowired
private ActSignInRecordService actSignInRecordService;
/**
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.act.result.SetSignTimeResultDTO>
* @author yinzuomei
* @description 010设置修改签到时间,生成签到码
* @Date 2021/4/20 13:50
**/
@PostMapping("setsigntime")
public Result<SetSignTimeResultDTO> setSignTime(@LoginUser TokenDto tokenDto, @RequestBody SetSignTimeFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, SetSignTimeFormDTO.AddUserInternalGroup.class);
return new Result<SetSignTimeResultDTO>().ok(actSignInRecordService.setSignTime(formDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param tokenDto
* @param formDTO
* @author yinzuomei
* @description 007签到
* @Date 2021/4/20 15:19
**/
@PostMapping("signin")
public Result signIn(@LoginUser TokenDto tokenDto, @RequestBody SignInFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,SignInFormDTO.AddUserInternalGroup.class);
actSignInRecordService.signIn(formDTO);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.act.result.SignInRecResultDTO>
* @param formDTO
* @author yinzuomei
* @description 009签到记录列表
* @Date 2021/4/20 15:46
**/
@PostMapping("reclist")
public Result<SignInRecResultDTO> querySignRecList(@RequestBody SignInRecFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,SignInRecFormDTO.AddUserInternalGroup.class);
return new Result<SignInRecResultDTO>().ok(actSignInRecordService.querySignRecList(formDTO));
}
}

31
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java

@ -24,8 +24,11 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.modules.act.service.GroupActInfoService;
import com.epmet.resi.group.dto.act.GroupActIdDTO;
import com.epmet.resi.group.dto.act.form.ActDetailFormDTO;
import com.epmet.resi.group.dto.act.form.ActReadViewFormDTO;
import com.epmet.resi.group.dto.act.form.CancelActFormDTO;
import com.epmet.resi.group.dto.act.form.PublishGroupActFormDTO;
import com.epmet.resi.group.dto.act.result.ActDetailResultDTO;
import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -77,4 +80,32 @@ public class GroupActInfoController {
return new Result<ActDetailResultDTO>().ok(groupActInfoService.queryActDetail(actDetailFormDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param tokenDto
* @param actReadViewFormDTO
* @author yinzuomei
* @description 016活动已读未读列表
* @Date 2021/4/19 19:37
**/
@PostMapping("readlist")
public Result<NoticeReadListResultDTO> queryReadList(@RequestBody @LoginUser TokenDto tokenDto, @RequestBody ActReadViewFormDTO actReadViewFormDTO){
actReadViewFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(actReadViewFormDTO,ActReadViewFormDTO.AddUserInternalGroup.class);
return new Result<NoticeReadListResultDTO>().ok(groupActInfoService.queryReadList(actReadViewFormDTO));
}
/**
* @return
* @param formDTO
* @author yinzuomei
* @description 011取消活动
* @Date 2021/4/20 12:09
**/
@PostMapping("cancel")
public Result<GroupActIdDTO> cancelAct(@LoginUser TokenDto tokenDto,@RequestBody CancelActFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,CancelActFormDTO.AddUserShowGroup.class,CancelActFormDTO.AddUserInternalGroup.class);
return new Result<GroupActIdDTO>().ok(groupActInfoService.cancelAct(formDTO));
}
}

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentDao.java

@ -19,8 +19,11 @@ package com.epmet.modules.act.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.act.entity.ActCommentEntity;
import com.epmet.resi.group.dto.act.result.CommentResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 活动评论表
*
@ -29,5 +32,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActCommentDao extends BaseDao<ActCommentEntity> {
List<CommentResultDTO> selectCommentList(String groupActId);
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActOperationRecordDao.java

@ -29,5 +29,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActOperationRecordDao extends BaseDao<ActOperationRecordEntity> {
/**
* 查询活动取消的原因
*
* @param groupActId
* @return int
*/
String selectCanceledReason(String groupActId);
}

26
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActReadRecordDao.java

@ -20,6 +20,9 @@ package com.epmet.modules.act.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.act.entity.ActReadRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 活动已读记录
@ -30,5 +33,28 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ActReadRecordDao extends BaseDao<ActReadRecordEntity> {
/**
* 重新发布活动删除原来的已读未读记录重新插入应读记录
*
* @param groupActId
* @return int
*/
int deleteByActId(String groupActId);
/**
* 查询当前活动应读人员列表
*
* @param groupActId
* @return com.epmet.modules.act.entity.ActReadRecordEntity
*/
List<ActReadRecordEntity> selectByGroupActId(String groupActId);
/**
* 查询用户是否阅读过此活动
*
* @param groupActId
* @param userId
* @return com.epmet.modules.act.entity.ActReadRecordEntity
*/
ActReadRecordEntity selectUserRec(@Param("groupActId") String groupActId, @Param("userId") String userId);
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActSignInCodeDao.java

@ -19,6 +19,7 @@ package com.epmet.modules.act.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.act.entity.ActSignInCodeEntity;
import com.epmet.resi.group.dto.act.ActSignInCodeDTO;
import org.apache.ibatis.annotations.Mapper;
/**
@ -29,5 +30,11 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActSignInCodeDao extends BaseDao<ActSignInCodeEntity> {
/**
* 获取最后一次生成的签到码
*
* @param groupActId
* @return com.epmet.resi.group.dto.act.ActSignInCodeDTO
*/
ActSignInCodeDTO selectLastRec(String groupActId);
}

21
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActSignInRecordDao.java

@ -20,6 +20,9 @@ package com.epmet.modules.act.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.act.entity.ActSignInRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 组织活动签到记录
@ -29,5 +32,21 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActSignInRecordDao extends BaseDao<ActSignInRecordEntity> {
/**
* 查询当前用户是否签到
*
* @param groupActId
* @param signUserId
* @return int
*/
int selectCountUserRec(@Param("groupActId")String groupActId, @Param("signUserId")String signUserId);
/**
* 查询活动的签到记录
*
* @param groupActId
* @return int
*/
List<ActSignInRecordEntity> selectListByGroupActId(String groupActId);
}

20
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActContentDao.java

@ -20,7 +20,9 @@ package com.epmet.modules.act.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.act.entity.GroupActContentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.repository.query.Param;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 组织活动内容
@ -31,5 +33,21 @@ import org.springframework.data.repository.query.Param;
@Mapper
public interface GroupActContentDao extends BaseDao<GroupActContentEntity> {
/**
* 重新编辑活动提交将原来的内容置为已删除
*
* @param groupActId 活动id
* @param userId 更新人
* @return int
*/
int updateToDel(@Param("groupActId") String groupActId, @Param("userId") String userId);
/**
* 活动内容升序返回
*
* @param groupActId 活动id
* @param contentType 内容类型: 文字text图片img
* @return String
*/
List<String> selectContentList(@Param("groupActId")String groupActId, @Param("contentType") String contentType);
}

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActReadRecordEntity.java

@ -40,6 +40,16 @@ public class ActReadRecordEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 小组所属网格id
*/
private String gridId;
/**
* 小组id
*/
private String groupId;
/**
* group_act_info.id
*/
@ -48,7 +58,7 @@ public class ActReadRecordEntity extends BaseEpmetEntity {
/**
* 已读: read未读un_read查看活动详情后修改此表或者插入一条新的已读记录
*/
private String read;
private String readFlag;
/**
* 用户id

20
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentService.java

@ -19,6 +19,11 @@ package com.epmet.modules.act.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.act.entity.ActCommentEntity;
import com.epmet.resi.group.dto.act.form.CommentFormDTO;
import com.epmet.resi.group.dto.act.form.CommentQueryFormDTO;
import com.epmet.resi.group.dto.act.result.CommentResultDTO;
import java.util.List;
/**
* 活动评论表
@ -28,4 +33,19 @@ import com.epmet.modules.act.entity.ActCommentEntity;
*/
public interface ActCommentService extends BaseService<ActCommentEntity> {
/**
* 005评论活动
*
* @param formDTO
* @return
*/
void submitComment(CommentFormDTO formDTO);
/**
* 006活动评论列表查询
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.CommentResultDTO
*/
List<CommentResultDTO> queryCommentList(CommentQueryFormDTO formDTO);
}

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActSignInCodeService.java

@ -19,6 +19,7 @@ package com.epmet.modules.act.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.act.entity.ActSignInCodeEntity;
import com.epmet.resi.group.dto.act.ActSignInCodeDTO;
/**
* 组织活动签到码
@ -28,4 +29,11 @@ import com.epmet.modules.act.entity.ActSignInCodeEntity;
*/
public interface ActSignInCodeService extends BaseService<ActSignInCodeEntity> {
/**
* 获取最后一次生成的签到码
*
* @param groupActId
* @return com.epmet.resi.group.dto.act.ActSignInCodeDTO
*/
ActSignInCodeDTO selectLastRec(String groupActId);
}

37
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActSignInRecordService.java

@ -19,6 +19,11 @@ package com.epmet.modules.act.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.act.entity.ActSignInRecordEntity;
import com.epmet.resi.group.dto.act.form.SetSignTimeFormDTO;
import com.epmet.resi.group.dto.act.form.SignInFormDTO;
import com.epmet.resi.group.dto.act.form.SignInRecFormDTO;
import com.epmet.resi.group.dto.act.result.SetSignTimeResultDTO;
import com.epmet.resi.group.dto.act.result.SignInRecResultDTO;
/**
* 组织活动签到记录
@ -28,4 +33,36 @@ import com.epmet.modules.act.entity.ActSignInRecordEntity;
*/
public interface ActSignInRecordService extends BaseService<ActSignInRecordEntity> {
/**
* 查询当前用户是否签到
*
* @param groupActId
* @param currentUserId
* @return boolean
*/
boolean queryUserSignInRec(String groupActId, String currentUserId);
/**
* 010设置修改签到时间,生成签到码
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.SetSignTimeResultDTO
*/
SetSignTimeResultDTO setSignTime(SetSignTimeFormDTO formDTO);
/**
* 007签到
*
* @param formDTO
* @return
*/
void signIn(SignInFormDTO formDTO);
/**
* 009签到记录列表
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.SignInRecResultDTO
*/
SignInRecResultDTO querySignRecList(SignInRecFormDTO formDTO);
}

28
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java

@ -20,9 +20,13 @@ package com.epmet.modules.act.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.act.entity.GroupActInfoEntity;
import com.epmet.resi.group.dto.act.GroupActIdDTO;
import com.epmet.resi.group.dto.act.GroupActInfoDTO;
import com.epmet.resi.group.dto.act.form.ActDetailFormDTO;
import com.epmet.resi.group.dto.act.form.ActReadViewFormDTO;
import com.epmet.resi.group.dto.act.form.CancelActFormDTO;
import com.epmet.resi.group.dto.act.form.PublishGroupActFormDTO;
import com.epmet.resi.group.dto.act.result.ActDetailResultDTO;
import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO;
/**
* 组织活动信息
@ -47,4 +51,28 @@ public interface GroupActInfoService extends BaseService<GroupActInfoEntity> {
* @return com.epmet.resi.group.dto.act.result.ActDetailResultDTO
*/
ActDetailResultDTO queryActDetail(ActDetailFormDTO actDetailFormDTO);
/**
* 016活动已读未读列表
*
* @param actReadViewFormDTO
* @return com.epmet.resi.group.dto.act.result.ActDetailResultDTO
*/
NoticeReadListResultDTO queryReadList(ActReadViewFormDTO actReadViewFormDTO);
/**
* 011取消活动
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.GroupActIdDTO
*/
GroupActIdDTO cancelAct(CancelActFormDTO formDTO);
/**
* 查询活动主信息
*
* @param groupActId
* @return com.epmet.resi.group.dto.act.GroupActInfoDTO
*/
GroupActInfoDTO getGroupActInfoDTO(String groupActId);
}

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

@ -18,10 +18,34 @@
package com.epmet.modules.act.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
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.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.ActCommentDao;
import com.epmet.modules.act.entity.ActCommentEntity;
import com.epmet.modules.act.service.ActCommentService;
import com.epmet.modules.act.service.GroupActInfoService;
import com.epmet.modules.constant.GroupActConstant;
import com.epmet.resi.group.dto.act.GroupActInfoDTO;
import com.epmet.resi.group.dto.act.form.CommentFormDTO;
import com.epmet.resi.group.dto.act.form.CommentQueryFormDTO;
import com.epmet.resi.group.dto.act.result.CommentResultDTO;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* 活动评论表
@ -32,5 +56,88 @@ import org.springframework.stereotype.Service;
@Service
public class ActCommentServiceImpl extends BaseServiceImpl<ActCommentDao, ActCommentEntity> implements ActCommentService {
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Autowired
private GroupActInfoService groupActInfoService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* 005评论活动
*
* @param formDTO
* @return
*/
@Override
public void submitComment(CommentFormDTO formDTO) {
//1、关闭和已取消不能评论
GroupActInfoDTO groupActInfoDTO = groupActInfoService.getGroupActInfoDTO(formDTO.getGroupActId());
if (GroupActConstant.CLOSED.equals(groupActInfoDTO.getStatus())) {
throw new RenException(EpmetErrorCode.GROUP_ACT_CAN_NOT_COMMENT.getCode(), "当前活动已关闭,不能评论");
} else if (GroupActConstant.CANCELED.equals(groupActInfoDTO.getStatus())) {
throw new RenException(EpmetErrorCode.GROUP_ACT_CAN_NOT_COMMENT.getCode(), "当前活动已取消,不能评论");
}
//2、评论内容审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(formDTO.getCommentContent());
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()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg());
}
}
//3、插入记录
ActCommentEntity actCommentEntity = new ActCommentEntity();
actCommentEntity.setCustomerId(formDTO.getCustomerId());
actCommentEntity.setCommentContent(formDTO.getCommentContent());
actCommentEntity.setCommentUserId(formDTO.getUserId());
actCommentEntity.setGroupActId(formDTO.getGroupActId());
baseDao.insert(actCommentEntity);
}
/**
* 006活动评论列表查询
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.CommentResultDTO
*/
@Override
public List<CommentResultDTO> queryCommentList(CommentQueryFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<CommentResultDTO> list=baseDao.selectCommentList(formDTO.getGroupActId());
if(CollectionUtils.isEmpty(list)){
return Collections.EMPTY_LIST;
}
//2.调用user服务,查询人员基础数据
List<String> userIdList = list.stream().map(CommentResultDTO::getCommentUserId).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> result = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if (!result.success()) {
throw new RenException("调用user服务,获取用户基础数据失败");
}
if (!CollectionUtils.isEmpty(result.getData())) {
//3.遍历封装数据并返回
list.forEach(l -> {
result.getData().forEach(user -> {
if (l.getCommentUserId().equals(user.getUserId())) {
l.setCommentUserHeadPhoto(user.getHeadImgUrl());
l.setCommentUserName(user.getSurname().concat(user.getName()));
}
});
});
}
return list;
}
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.modules.act.dao.ActSignInCodeDao;
import com.epmet.modules.act.entity.ActSignInCodeEntity;
import com.epmet.modules.act.service.ActSignInCodeService;
import com.epmet.resi.group.dto.act.ActSignInCodeDTO;
import org.springframework.stereotype.Service;
/**
@ -33,4 +34,14 @@ import org.springframework.stereotype.Service;
public class ActSignInCodeServiceImpl extends BaseServiceImpl<ActSignInCodeDao, ActSignInCodeEntity> implements ActSignInCodeService {
/**
* 获取最后一次生成的签到码
*
* @param groupActId
* @return com.epmet.resi.group.dto.act.ActSignInCodeDTO
*/
@Override
public ActSignInCodeDTO selectLastRec(String groupActId) {
return baseDao.selectLastRec(groupActId);
}
}

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

@ -18,10 +18,41 @@
package com.epmet.modules.act.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.act.dao.ActSignInRecordDao;
import com.epmet.modules.act.dao.GroupActInfoDao;
import com.epmet.modules.act.entity.ActSignInRecordEntity;
import com.epmet.modules.act.entity.GroupActInfoEntity;
import com.epmet.modules.act.service.ActSignInCodeService;
import com.epmet.modules.act.service.ActSignInRecordService;
import com.epmet.modules.act.service.GroupActInfoService;
import com.epmet.modules.constant.GroupActConstant;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.resi.group.dto.act.ActSignInCodeDTO;
import com.epmet.resi.group.dto.act.GroupActInfoDTO;
import com.epmet.resi.group.dto.act.form.SetSignTimeFormDTO;
import com.epmet.resi.group.dto.act.form.SignInFormDTO;
import com.epmet.resi.group.dto.act.form.SignInRecFormDTO;
import com.epmet.resi.group.dto.act.result.SetSignTimeResultDTO;
import com.epmet.resi.group.dto.act.result.SignInRecResultDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 组织活动签到记录
@ -29,8 +60,170 @@ import org.springframework.stereotype.Service;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-16
*/
@Slf4j
@Service
public class ActSignInRecordServiceImpl extends BaseServiceImpl<ActSignInRecordDao, ActSignInRecordEntity> implements ActSignInRecordService {
@Autowired
private GroupActInfoService groupActInfoService;
@Autowired
private ResiGroupMemberService resiGroupMemberService;
@Autowired
private GroupActInfoDao groupActInfoDao;
@Autowired
private ActSignInCodeService actSignInCodeService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* 查询当前用户是否签到
*
* @param groupActId
* @param signUserId
* @return boolean
*/
@Override
public boolean queryUserSignInRec(String groupActId, String signUserId) {
if (baseDao.selectCountUserRec(groupActId, signUserId) > 0) {
return true;
}
return false;
}
/**
* 010设置修改签到时间,生成签到码
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.SetSignTimeResultDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public SetSignTimeResultDTO setSignTime(SetSignTimeFormDTO formDTO) {
GroupActInfoDTO originalActInfo = groupActInfoService.getGroupActInfoDTO(formDTO.getGroupActId());
// 1、只有组长才可以设置签到码
ResiGroupMemberDTO groupMemberDTO = resiGroupMemberService.getLeaderMember(originalActInfo.getGroupId());
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());
}
//2、设置起止时间
GroupActInfoEntity groupActInfoEntity = ConvertUtils.sourceToTarget(originalActInfo, GroupActInfoEntity.class);
try {
String startTimeStr = formDTO.getSignInStartTime().concat(":00");
groupActInfoEntity.setSignInStartTime(DateUtils.parse(startTimeStr, DateUtils.DATE_TIME_PATTERN));
String endTimeStr = formDTO.getSignInEndTime().concat(":00");
groupActInfoEntity.setSignInStartTime(DateUtils.parse(endTimeStr, DateUtils.DATE_TIME_PATTERN));
} catch (Exception e) {
throw new RenException("签到起止时间格式错误");
}
groupActInfoDao.updateById(groupActInfoEntity);
SetSignTimeResultDTO result = new SetSignTimeResultDTO();
//3、如果签到时间修改了,重新生成签到码
result.setSignInCodeUrl(getSignInCodeUrl(groupActInfoEntity, originalActInfo));
result.setGroupActId(formDTO.getGroupActId());
result.setSignInStartTime(groupActInfoEntity.getSignInStartTime());
result.setSignInEndTime(groupActInfoEntity.getSignInEndTime());
return result;
}
private String getSignInCodeUrl(GroupActInfoEntity actInfoEntity, GroupActInfoDTO groupActInfoDTO) {
ActSignInCodeDTO actSignInCodeDTO = actSignInCodeService.selectLastRec(actInfoEntity.getId());
if (null != actSignInCodeDTO) {
if (actInfoEntity.getSignInStartTime().equals(groupActInfoDTO.getSignInStartTime())
&& actInfoEntity.getSignInEndTime().equals(groupActInfoDTO.getSignInEndTime())) {
log.info("签到开始时间、签到截止时间未变更,不需要重新生成签到码");
return actSignInCodeDTO.getUrl();
}
}
//todo
//别忘了插入数据库act_sign_in_code
return "重新生成新的url";
}
/**
* 007签到
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void signIn(SignInFormDTO formDTO) {
if(queryUserSignInRec(formDTO.getGroupActId(),formDTO.getUserId())){
//已经签到无需重复签到
log.warn(String.format("当前用户userId=%s,已经签到,groupActId=%s",formDTO.getUserId(),formDTO.getGroupActId()));
return;
}
GroupActInfoDTO originalActInfo = groupActInfoService.getGroupActInfoDTO(formDTO.getGroupActId());
//关闭、已取消不能签到
if (GroupActConstant.CLOSED.equals(originalActInfo.getStatus())) {
throw new RenException(EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getCode(), "活动已关闭,不能签到");
} else if (GroupActConstant.CANCELED.equals(originalActInfo.getStatus())) {
throw new RenException(EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getCode(), "活动已取消,不能签到");
}
Date nowDate=new Date();
long nowTime=nowDate.getTime();
long signInStartTime=originalActInfo.getSignInStartTime().getTime();
long signInEndTime=originalActInfo.getSignInEndTime().getTime();
if (nowTime < signInStartTime) {
//未到签到时间
throw new RenException(EpmetErrorCode.SIGN_IN_TIME_NOT_START.getCode(),EpmetErrorCode.SIGN_IN_TIME_NOT_START.getMsg());
} else if (nowTime > signInEndTime) {
//未签到、已经超过了签到时间
throw new RenException(EpmetErrorCode.SIGN_IN_TIME_PASSED.getCode(),EpmetErrorCode.SIGN_IN_TIME_PASSED.getMsg());
}
//未签到、在签到时间范围内的,可以签到
GroupActInfoEntity groupActInfoEntity = ConvertUtils.sourceToTarget(originalActInfo, GroupActInfoEntity.class);
groupActInfoEntity.setSignedInNum(originalActInfo.getSignedInNum() + NumConstant.ONE);
groupActInfoDao.updateById(groupActInfoEntity);
ActSignInRecordEntity insertEntity=new ActSignInRecordEntity();
insertEntity.setCustomerId(formDTO.getCustomerId());
insertEntity.setGroupActId(formDTO.getGroupActId());
insertEntity.setSignUserId(formDTO.getUserId());
insertEntity.setSignInAddress(formDTO.getSignInAddress());
insertEntity.setLatitude(formDTO.getLatitude());
insertEntity.setLongitude(formDTO.getLongitude());
baseDao.insert(insertEntity);
}
/**
* 009签到记录列表
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.SignInRecResultDTO
*/
@Override
public SignInRecResultDTO querySignRecList(SignInRecFormDTO formDTO) {
GroupActInfoDTO originalActInfo = groupActInfoService.getGroupActInfoDTO(formDTO.getGroupActId());
SignInRecResultDTO resultDTO = new SignInRecResultDTO();
resultDTO.setSignedInNum(originalActInfo.getSignedInNum());
resultDTO.setShouldAttend(originalActInfo.getShouldAttend());
List<ActSignInRecordEntity> list = baseDao.selectListByGroupActId(formDTO.getGroupActId());
if (!CollectionUtils.isEmpty(list)) {
//2.调用user服务,查询人员基础数据
List<String> userIdList = list.stream().map(ActSignInRecordEntity::getSignUserId).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> result = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if (!result.success()) {
throw new RenException("调用user服务,获取用户基础数据失败");
}
if (!CollectionUtils.isEmpty(result.getData())) {
List<SignInRecResultDTO.SignInDetail> signInDetailList = new ArrayList<>();
//3.遍历封装数据并返回
list.forEach(l -> {
result.getData().forEach(user -> {
if (l.getSignUserId().equals(user.getUserId())) {
SignInRecResultDTO.SignInDetail signInDetail = new SignInRecResultDTO.SignInDetail();
signInDetail.setSignInAddress(l.getSignInAddress());
signInDetail.setSignInTime(l.getCreatedTime());
signInDetail.setSignUserId(l.getSignUserId());
signInDetail.setSignUserName(user.getSurname().concat(user.getName()));
}
});
});
resultDTO.setList(signInDetailList);
}
}
return resultDTO;
}
}

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

@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
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;
@ -33,6 +34,8 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.act.dao.ActOperationRecordDao;
import com.epmet.modules.act.dao.ActReadRecordDao;
@ -43,16 +46,21 @@ import com.epmet.modules.act.entity.ActReadRecordEntity;
import com.epmet.modules.act.entity.GroupActContentEntity;
import com.epmet.modules.act.entity.GroupActInfoEntity;
import com.epmet.modules.act.service.ActCategoryDictService;
import com.epmet.modules.act.service.ActSignInRecordService;
import com.epmet.modules.act.service.GroupActInfoService;
import com.epmet.modules.constant.GroupActConstant;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.resi.group.dto.act.GroupActIdDTO;
import com.epmet.resi.group.dto.act.GroupActInfoDTO;
import com.epmet.resi.group.dto.act.form.ActDetailFormDTO;
import com.epmet.resi.group.dto.act.form.ActReadViewFormDTO;
import com.epmet.resi.group.dto.act.form.CancelActFormDTO;
import com.epmet.resi.group.dto.act.form.PublishGroupActFormDTO;
import com.epmet.resi.group.dto.act.result.ActDetailResultDTO;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -65,6 +73,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* 组织活动信息
@ -95,7 +104,10 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
private GroupActContentDao groupActContentDao;
@Autowired
private ActReadRecordDao actReadRecordDao;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private ActSignInRecordService actSignInRecordService;
/**
* 003发布编辑组织活动
*
@ -136,7 +148,8 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
List<ActReadRecordEntity> readRecordEntityList=constructReadRec(groupActInfoEntity.getId(),
formDTO.getCustomerId(),
formDTO.getGroupId(),
formDTO.getPublishUserId());
formDTO.getPublishUserId(),
groupDTO.getGridId());
//2、插入活动内容
contentList.forEach(textContentEntity->{
groupActContentDao.insert(textContentEntity);
@ -155,22 +168,21 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
return result;
}
private List<ActReadRecordEntity> constructReadRec(String groupActId, String customerId, String groupId,String publishUserId) {
private List<ActReadRecordEntity> constructReadRec(String groupActId, String customerId, String groupId,String publishUserId,String gridId) {
List<ActReadRecordEntity> list=new ArrayList<>();
List<ResiGroupMemberDTO> memberDTOList=resiGroupMemberService.getMemberList(groupId);
memberDTOList.forEach(memberDTO->{
ActReadRecordEntity actReadRecordEntity=new ActReadRecordEntity();
actReadRecordEntity.setCustomerId(customerId);
actReadRecordEntity.setGroupActId(groupActId);
if(publishUserId.equals(memberDTO.getCustomerUserId())){
//发布人默认是已读
actReadRecordEntity.setRead(GroupActConstant.READ);
}else{
actReadRecordEntity.setRead(GroupActConstant.UN_READ);
}
actReadRecordEntity.setReadFlag(GroupActConstant.UN_READ);
actReadRecordEntity.setUserId(memberDTO.getCustomerUserId());
actReadRecordEntity.setShouldBeRead(Constant.YES);
list.add(actReadRecordEntity);
actReadRecordEntity.setGroupId(groupId);
actReadRecordEntity.setGridId(gridId);
if(!publishUserId.equals(memberDTO.getCustomerUserId())){
list.add(actReadRecordEntity);
}
});
return list;
}
@ -239,7 +251,7 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
}
if (!CollectionUtils.isEmpty(formDTO.getImgList())) {
//最多选择3张图片
if (formDTO.getTextList().get(NumConstant.ZERO).length() > NumConstant.THREE) {
if (formDTO.getImgList().size() > NumConstant.THREE) {
throw new RenException(EpmetErrorCode.GROUP_ACT_IMG_MAX.getCode(), EpmetErrorCode.GROUP_ACT_IMG_MAX.getMsg());
}
}
@ -257,7 +269,6 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
private void scanActContent(String title, List<String> textList, List<String> imgList) {
//活动标题
if (StringUtils.isNotBlank(title)) {
//创建话题内容审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(title);
@ -356,12 +367,239 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl<GroupActInfoDao, Gr
/**
* 004活动详情
*
* @param actDetailFormDTO
* @param formDTO
* @return com.epmet.resi.group.dto.act.result.ActDetailResultDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public ActDetailResultDTO queryActDetail(ActDetailFormDTO formDTO) {
GroupActInfoEntity groupActInfoEntity=baseDao.selectById(formDTO.getGroupActId());
ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberService.getResiGroupMember(groupActInfoEntity.getGroupId(),formDTO.getUserId());
if(null==resiGroupMemberDTO){
throw new RenException(EpmetErrorCode.NOT_IN_GROUP_CAN_NOT_VIEW.getCode(), EpmetErrorCode.NOT_IN_GROUP_CAN_NOT_VIEW.getMsg());
}
ActDetailResultDTO resultDTO=ConvertUtils.sourceToTarget(groupActInfoEntity,ActDetailResultDTO.class);
resultDTO.setGroupActId(formDTO.getGroupActId());
resultDTO.setTextList(groupActContentDao.selectContentList(formDTO.getGroupActId(),GroupActConstant.TEXT));
resultDTO.setImgList(groupActContentDao.selectContentList(formDTO.getGroupActId(),GroupActConstant.IMG));
resultDTO.setCanceledReason(GroupActConstant.CANCELED.equals(resultDTO.getStatus()) ? actOperationRecordDao.selectCanceledReason(formDTO.getGroupActId()) : StrConstant.EPMETY_STR);
handleSignInDesc(resultDTO,formDTO.getUserId());
resultDTO.setUserRole(resiGroupMemberDTO.getGroupLeaderFlag());
// 有签到后不可以修改活动时间:true可以修改,false不可以,
resultDTO.setStartTimeEditFlag(groupActInfoEntity.getSignedInNum()>NumConstant.ZERO?false:true);
//返回详情,并且已读状态
ActReadRecordEntity actReadRecordEntity=actReadRecordDao.selectUserRec(formDTO.getGroupActId(),formDTO.getUserId());
if(null== actReadRecordEntity){
//插入
ActReadRecordEntity insertEntity=new ActReadRecordEntity();
insertEntity.setCustomerId(groupActInfoEntity.getCustomerId());
insertEntity.setGroupActId(formDTO.getGroupActId());
insertEntity.setReadFlag(GroupActConstant.READ);
insertEntity.setShouldBeRead(Constant.NO);
insertEntity.setUserId(formDTO.getUserId());
insertEntity.setGridId(groupActInfoEntity.getGridId());
insertEntity.setGroupId(groupActInfoEntity.getGroupId());
actReadRecordDao.insert(insertEntity);
}else{
if(GroupActConstant.UN_READ.equals(actReadRecordEntity.getReadFlag())){
//未读->已读
actReadRecordEntity.setReadFlag(GroupActConstant.READ);
actReadRecordEntity.setUpdatedTime(new Date());
actReadRecordDao.updateById(actReadRecordEntity);
}
}
return resultDTO;
}
private void handleSignInDesc(ActDetailResultDTO resultDTO,String currentUserId) {
if(GroupActConstant.CANCELED.equals(resultDTO.getStatus())
||GroupActConstant.CLOSED.equals(resultDTO.getStatus())){
//活动已取消或者已关闭,不显示签到按钮,也不显示描述
resultDTO.setSignInButton(GroupActConstant.BLANK);
resultDTO.setSignInDesc(StrConstant.EPMETY_STR);
return;
}
if (null == resultDTO.getSignInStartTime() || null == resultDTO.getSignInEndTime()) {
//未设置签到开始、截止时间,默认不显示签到按钮,也不显示描述
resultDTO.setSignInButton(GroupActConstant.BLANK);
resultDTO.setSignInDesc(StrConstant.EPMETY_STR);
return;
}
//查询当前用户是否签到
boolean signedInFlag=actSignInRecordService.queryUserSignInRec(resultDTO.getGroupActId(),currentUserId);
// 1、签到成功显示已签到
if(signedInFlag){
resultDTO.setSignInButton(GroupActConstant.BLANK);
resultDTO.setSignInDesc("已签到");
return;
}
Date nowDate=new Date();
long nowTime=nowDate.getTime();
long signInStartTime=resultDTO.getSignInStartTime().getTime();
long signInEndTime=resultDTO.getSignInEndTime().getTime();
if (nowTime < signInStartTime) {
resultDTO.setSignInButton(GroupActConstant.DISPLAY);
// 2、未到签到时间显示距离签到时间还有多久
//距离签到开始还有XX天4小时32分钟
String remainStr=getDatePoor(resultDTO.getSignInStartTime(),nowDate);
resultDTO.setSignInDesc(String.format("距离签到开始还有%s",remainStr));
return;
} else if (signInStartTime <= nowTime && nowTime <= signInEndTime) {
// 3、在签到时间范围内,并且未签到的,显示签到按钮,描述显示空字符串
resultDTO.setSignInButton(GroupActConstant.DISPLAY);
resultDTO.setSignInDesc(StrConstant.EPMETY_STR);
return;
} else if (nowTime > signInEndTime) {
// 4、签到时间已过且未签到的,显示“当前时间已超过签到时间”
resultDTO.setSignInButton(GroupActConstant.BLANK);
resultDTO.setSignInDesc("当前时间已超过签到时间");
}
}
public static String getDatePoor(Date endDate, Date nowDate) {
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - nowDate.getTime();
// 计算差多少天
long day = diff / nd;
// 计算差多少小时
long hour = diff % nd / nh;
// 计算差多少分钟
long min = diff % nd % nh / nm;
// 计算差多少秒//输出结果
// long sec = diff % nd % nh % nm / ns;
return day + "天" + hour + "小时" + min + "分钟";
}
/**
* 016活动已读未读列表
*
* @param actReadViewFormDTO
* @return com.epmet.resi.group.dto.act.result.ActDetailResultDTO
*/
@Override
public ActDetailResultDTO queryActDetail(ActDetailFormDTO actDetailFormDTO) {
//todo
return null;
public NoticeReadListResultDTO queryReadList(ActReadViewFormDTO actReadViewFormDTO) {
NoticeReadListResultDTO resultDTO = new NoticeReadListResultDTO();
List<NoticeReadListResultDTO.NoticeReafdRecord> readList = new ArrayList<>();
List<NoticeReadListResultDTO.NoticeReafdRecord> unReadList = new ArrayList<>();
//1.根据活动id,查询应读人员列表
List<ActReadRecordEntity> list = actReadRecordDao.selectByGroupActId(actReadViewFormDTO.getGroupActId());
//2.调用user服务,查询人员基础数据
List<String> userIdList = list.stream().map(ActReadRecordEntity::getUserId).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> result = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if (!result.success()) {
throw new RenException("调用user服务,获取用户基础数据失败");
}
List<UserBaseInfoResultDTO> resultDTOList = result.getData();
if (!CollectionUtils.isEmpty(resultDTOList)) {
//3.遍历封装数据并返回
list.forEach(l -> {
StringBuffer name = new StringBuffer();
StringBuffer url = new StringBuffer();
resultDTOList.forEach(user -> {
if (l.getUserId().equals(user.getUserId())) {
name.append(user.getSurname()).append(user.getName());
url.append(user.getHeadImgUrl());
}
});
if (GroupActConstant.READ.equals(l.getReadFlag())) {
//已读
NoticeReadListResultDTO.NoticeReafdRecord read = new NoticeReadListResultDTO.NoticeReafdRecord();
read.setUserId(l.getUserId());
read.setUserName(name.toString());
read.setUserHeadPhoto(url.toString());
readList.add(read);
} else {
//未读
NoticeReadListResultDTO.NoticeReafdRecord unRead = new NoticeReadListResultDTO.NoticeReafdRecord();
unRead.setUserId(l.getUserId());
unRead.setUserName(name.toString());
unRead.setUserHeadPhoto(url.toString());
unReadList.add(unRead);
}
});
}
//已读人数
resultDTO.setReadCount(readList.size());
//未读人数
resultDTO.setUnReadCount(unReadList.size());
//已读列表
resultDTO.setReadList(readList);
//未读列表
resultDTO.setUnReadList(unReadList);
return resultDTO;
}
/**
* 011取消活动
*
* @param formDTO
* @return com.epmet.resi.group.dto.act.GroupActIdDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public GroupActIdDTO cancelAct(CancelActFormDTO formDTO) {
GroupActInfoEntity actInfoEntity=baseDao.selectById(formDTO.getGroupActId());
//1、只有组长才可以取消活动
ResiGroupMemberDTO groupMemberDTO = resiGroupMemberService.getLeaderMember(actInfoEntity.getGroupId());
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());
}
//2、活动已关闭,不能取消
if (GroupActConstant.CLOSED.equals(actInfoEntity.getStatus())) {
throw new RenException(EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getCode(), String.format(EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getMsg(), "已关闭"));
} else if (GroupActConstant.CANCELED.equals(actInfoEntity.getStatus())) {
throw new RenException(EpmetErrorCode.GROUP_ACT_CAN_NOT_CANCEL.getCode(), "活动已取消");
}
//3、取消原因审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(formDTO.getReason());
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()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg());
}
}
//4、记录取消时间
Date nowDate=new Date();
actInfoEntity.setCanceledTime(nowDate);
actInfoEntity.setStatus(GroupActConstant.CANCELED);
baseDao.updateById(actInfoEntity);
//5、插入一条操作日志
ActOperationRecordEntity actOperationRecordEntity = new ActOperationRecordEntity();
actOperationRecordEntity.setCustomerId(actInfoEntity.getCustomerId());
actOperationRecordEntity.setOperateUserId(formDTO.getUserId());
actOperationRecordEntity.setGroupActId(formDTO.getGroupActId());
actOperationRecordEntity.setOperationType(GroupActConstant.CANCEL);
actOperationRecordEntity.setCreatedTime(nowDate);
actOperationRecordEntity.setUpdatedTime(nowDate);
actOperationRecordDao.insert(actOperationRecordEntity);
baseDao.updateById(actInfoEntity);
GroupActIdDTO resultDTO=new GroupActIdDTO();
resultDTO.setGroupActId(formDTO.getGroupActId());
return resultDTO;
}
/**
* 查询活动主信息
*
* @param groupActId
* @return com.epmet.resi.group.dto.act.GroupActInfoDTO
*/
@Override
public GroupActInfoDTO getGroupActInfoDTO(String groupActId) {
return ConvertUtils.sourceToTarget(baseDao.selectById(groupActId), GroupActInfoDTO.class);
}
}

4
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/GroupActConstant.java

@ -33,4 +33,8 @@ public interface GroupActConstant {
// 已读: read未读:un_read
String READ="read";
String UN_READ="un_read";
// blank: 不显示; display:显示
String BLANK="blank";
String DISPLAY="display";
}

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

@ -31,6 +31,8 @@ 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;
@ -497,4 +499,16 @@ public class ResiGroupController {
return new Result();
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 所有小组查询
**/
@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));
}
}

40
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupSetupController.java

@ -0,0 +1,40 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.controller;
import com.epmet.modules.group.service.ResiGroupSetupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 建组设置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-20
*/
@RestController
@RequestMapping("resigroupsetup")
public class ResiGroupSetupController {
@Autowired
private ResiGroupSetupService resiGroupSetupService;
}

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

@ -27,7 +27,6 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@ -237,4 +236,10 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @Date 2020/12/25 13:18
**/
List<GroupProcessingCountResultDTO> queryGroupProcessingCount(@Param("gridIdList") List<String> gridIdList);
/**
* @Author sun
* @Description 分页查询网格下所有小组列表
**/
List<AllGroupListResultDTO> selectAllGroupList(AllGroupListFormDTO formDTO);
}

33
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupSetupDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.group.entity.ResiGroupSetupEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 建组设置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-20
*/
@Mapper
public interface ResiGroupSetupDao extends BaseDao<ResiGroupSetupEntity> {
}

71
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupSetupEntity.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 建组设置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_group_setup")
public class ResiGroupSetupEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID,初始默认为default
*/
private String customerId;
/**
* 默认小组头像
*/
private String logo;
/**
* 小组名称
*/
private String name;
/**
* 小组简介
*/
private String describe;
/**
* 小组类型(ordinary:楼院小组 branch:支部小组)
*/
private String groupType;
/**
* 专用dedicated常用common_used
*/
private String category;
}

47
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupSetupRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 建组设置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-20
*/
@Component
public class ResiGroupSetupRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

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

@ -20,6 +20,7 @@ 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;
@ -370,4 +371,12 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
* @return void
*/
void setVisitSwitch(ManageInitFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author sun
* @Description 所有小组查询
**/
List<AllGroupListResultDTO> allGroupList(TokenDto tokenDto, AllGroupListFormDTO formDTO);
}

31
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupSetupService.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.group.entity.ResiGroupSetupEntity;
/**
* 建组设置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-20
*/
public interface ResiGroupSetupService extends BaseService<ResiGroupSetupEntity> {
}

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

@ -30,6 +30,7 @@ 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;
@ -87,6 +88,7 @@ import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -1491,4 +1493,48 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupRedis.delGroup(param.getGroupId());
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 所有小组查询
**/
@Override
public List<AllGroupListResultDTO> allGroupList(TokenDto tokenDto, AllGroupListFormDTO formDTO) {
//1.分页查询网格下所有小组列表且是审核通过状态的,以组内人员数从多到少排序
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
List<AllGroupListResultDTO> resultList = baseDao.selectAllGroupList(formDTO);
if (null == resultList || resultList.size() == 0) {
return new ArrayList<>();
}
//2.查询当前用户居民端角色列表
AtomicBoolean isPartymember = new AtomicBoolean(false);
Result<List<UserRoleResultDTO>> resultDTOList = epmetUserOpenFeignClient.getUserRoleInfoByUserId(tokenDto.getUserId());
if (!resultDTOList.success()) {
throw new RenException("调用user服务,获取用户基础数据失败");
}
List<UserRoleResultDTO> roleList = resultDTOList.getData();
roleList.forEach(rl -> {
if ("partymember".equals(rl.getRoleKey())) {
isPartymember.set(true);
}
});
//3.调用已有方法赋值当前人员是否可以入组值
for (AllGroupListResultDTO dto : resultList) {
//非党员角色不允许加入支部小组
if ("branch".equals(dto.getGroupType()) && !isPartymember.get()) {
dto.setStatus("rejected");
continue;
}
GroupMemeberOperationDTO operation = groupMemeberOperationService.selectLatestRecord(dto.getGroupId(), tokenDto.getUserId());
if (null != operation) {
dto.setStatus(operation.getOperateStatus());
}
}
return resultList;
}
}

40
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupSetupServiceImpl.java

@ -0,0 +1,40 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.modules.group.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.modules.group.dao.ResiGroupSetupDao;
import com.epmet.modules.group.entity.ResiGroupSetupEntity;
import com.epmet.modules.group.redis.ResiGroupSetupRedis;
import com.epmet.modules.group.service.ResiGroupSetupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 建组设置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-20
*/
@Service
public class ResiGroupSetupServiceImpl extends BaseServiceImpl<ResiGroupSetupDao, ResiGroupSetupEntity> implements ResiGroupSetupService {
@Autowired
private ResiGroupSetupRedis resiGroupSetupRedis;
}

17
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java

@ -32,6 +32,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.constant.UserMessageConstant;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.feign.ResiGuideFeignClient;
@ -46,6 +47,7 @@ import com.epmet.modules.member.dao.ResiGroupMemberDao;
import com.epmet.modules.member.service.GroupMemeberOperationService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.member.service.impl.ResiGroupMemberServiceImpl;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.constant.EnterGroupTypeConstant;
import com.epmet.resi.group.constant.GroupStateConstant;
import com.epmet.resi.group.constant.LeaderFlagConstant;
@ -106,6 +108,8 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl<GroupInvitationD
private ResiGroupRedis resiGroupRedis;
@Autowired
private ResiGroupMemberServiceImpl resiGroupMemberServiceImpl;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<GroupInvitationDTO> page(Map<String, Object> params) {
@ -455,6 +459,19 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl<GroupInvitationD
logger.info("已经在群内,直接返回成功");
return resultDTO;
}
// 查询小组类型,楼院小组:支部小组
ResiGroupDTO resiGroupInfo = resiGroupService.get(groupInvitationDTO.getResiGroupId());
if (resiGroupInfo.getGroupType().equals(ModuleConstant.GROUP_TYPE_BRANCH)){
Result<Boolean> booleanResult = epmetUserOpenFeignClient.selectIsPartyMemberByUserId(formDTO.getUserId());
if (!booleanResult.success()){
throw new RenException(ModuleConstant.IS_PARTY_MEMBER_ERR);
}
// 不是党员直接抛出
if (!booleanResult.getData()){
throw new RenException(EpmetErrorCode.PARTY_MEMBER_JOIN_BRANCH_GROUP.getCode());
}
}
//2020.11.26 sun start
//先判断用户是否有在审核的入组申请,有的话直接给提示
GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationService.selectLatestRecord(groupInvitationDTO.getResiGroupId(), formDTO.getUserId());

1
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/InvitationRecordServiceImpl.java

@ -25,7 +25,6 @@ import com.epmet.modules.invitation.dao.InvitationRecordDao;
import com.epmet.modules.invitation.entity.InvitationRecordEntity;
import com.epmet.modules.invitation.service.InvitationRecordService;
import com.epmet.modules.notice.dao.NoticeDao;
import com.epmet.modules.notice.dao.NoticeReafdRecordDao;
import com.epmet.modules.notice.entity.NoticeEntity;
import com.epmet.resi.group.dto.invitation.form.ShareFormDTO;
import com.epmet.resi.group.dto.invitation.result.ShareResultDTO;

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

@ -27,6 +27,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
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.utils.ConvertUtils;
@ -247,6 +248,18 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
result.setStatus("entered");
return result;
}
// 查询小组类型
ResiGroupDTO resiGroupInfo = groupService.get(groupId);
if (resiGroupInfo.getGroupType().equals(ModuleConstant.GROUP_TYPE_BRANCH)){
Result<Boolean> booleanResult = userClient.selectIsPartyMemberByUserId(param.getUserId());
if (!booleanResult.success()){
throw new RenException(ModuleConstant.IS_PARTY_MEMBER_ERR);
}
// 不是党员直接抛出
if (!booleanResult.getData()){
throw new RenException(EpmetErrorCode.PARTY_MEMBER_JOIN_BRANCH_GROUP.getCode());
}
}
//先判断用户是否有在审核的入组申请,有的话直接给提示
GroupMemeberOperationDTO groupMemeberOperationDTO = operationDao.selectLatestRecord(groupId, param.getUserId());

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -218,6 +218,18 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
//校验是否已经注册居民
ResiGroupDTO resiGroupDTO = resiGroupService.get(applyJoinGroupFormDTO.getGroupId());
if (null != resiGroupDTO) {
// 校验小组类型,并做出相应操作
if (resiGroupDTO.getGroupType().equals(ModuleConstant.GROUP_TYPE_BRANCH)){
Result<Boolean> booleanResult = userOpenFeignClient.selectIsPartyMemberByUserId(applyJoinGroupFormDTO.getUserId());
if (!booleanResult.success()){
throw new RenException(ModuleConstant.IS_PARTY_MEMBER_ERR);
}
// 不是党员直接抛出
if (!booleanResult.getData()){
throw new RenException(EpmetErrorCode.PARTY_MEMBER_JOIN_BRANCH_GROUP.getCode());
}
}
UserRoleDTO userRoleDTO = resiGroupService.checkPartyMemberOrWarmHeated(applyJoinGroupFormDTO.getApp(),
applyJoinGroupFormDTO.getUserId(),
resiGroupDTO.getCustomerId(),

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

@ -17,7 +17,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;
@ -28,6 +30,9 @@ 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.*;
@ -91,4 +96,29 @@ public class NoticeCommentController {
ExcelUtils.exportExcelToTarget(response, null, list, NoticeCommentExcel.class);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 发布通知评论
**/
@PostMapping(value = "noticecomment")
public Result noticeComment(@LoginUser TokenDto tokenDto, @RequestBody NoticeCommentFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NoticeCommentFormDTO.Comment.class);
noticeCommentService.noticeComment(tokenDto, formDTO);
return new Result();
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 通知评论列表查询
**/
@PostMapping(value = "noticecommentlist")
public Result<List<NoticeCommentListResultDTO>> noticeCommentList(@LoginUser TokenDto tokenDto, @RequestBody NoticeCommentListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NoticeCommentListFormDTO.CommentList.class);
return new Result<List<NoticeCommentListResultDTO>>().ok(noticeCommentService.noticeCommentList(tokenDto, formDTO));
}
}

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

@ -27,10 +27,11 @@ 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.NoticeReafdRecordExcel;
import com.epmet.modules.notice.service.NoticeReafdRecordService;
import com.epmet.resi.group.dto.notice.NoticeReafdRecordDTO;
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.*;
@ -48,25 +49,25 @@ import java.util.Map;
*/
@RestController
@RequestMapping("noticereafdrecord")
public class NoticeReafdRecordController {
public class NoticeReadRecordController {
@Autowired
private NoticeReafdRecordService noticeReafdRecordService;
private NoticeReadRecordService noticeReafdRecordService;
@GetMapping("page")
public Result<PageData<NoticeReafdRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<NoticeReafdRecordDTO> page = noticeReafdRecordService.page(params);
return new Result<PageData<NoticeReafdRecordDTO>>().ok(page);
public Result<PageData<NoticeReadRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<NoticeReadRecordDTO> page = noticeReafdRecordService.page(params);
return new Result<PageData<NoticeReadRecordDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<NoticeReafdRecordDTO> get(@PathVariable("id") String id){
NoticeReafdRecordDTO data = noticeReafdRecordService.get(id);
return new Result<NoticeReafdRecordDTO>().ok(data);
public Result<NoticeReadRecordDTO> get(@PathVariable("id") String id){
NoticeReadRecordDTO data = noticeReafdRecordService.get(id);
return new Result<NoticeReadRecordDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody NoticeReafdRecordDTO dto){
public Result save(@RequestBody NoticeReadRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
noticeReafdRecordService.save(dto);
@ -74,7 +75,7 @@ public class NoticeReafdRecordController {
}
@PutMapping
public Result update(@RequestBody NoticeReafdRecordDTO dto){
public Result update(@RequestBody NoticeReadRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
noticeReafdRecordService.update(dto);
@ -91,8 +92,8 @@ public class NoticeReafdRecordController {
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<NoticeReafdRecordDTO> list = noticeReafdRecordService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, NoticeReafdRecordExcel.class);
List<NoticeReadRecordDTO> list = noticeReafdRecordService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, NoticeReadRecordExcel.class);
}
/**
@ -107,4 +108,17 @@ public class NoticeReafdRecordController {
return new Result<NoticeReadListResultDTO>().ok(noticeReafdRecordService.noticeReadList(tokenDto, formDTO));
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 小组通知阅读状态修改
**/
@PostMapping(value = "readtype")
public Result readType(@LoginUser TokenDto tokenDto, @RequestBody ReadTypeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ReadTypeFormDTO.Read.class);
noticeReafdRecordService.readType(tokenDto, formDTO);
return new Result();
}
}

11
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentDao.java

@ -19,8 +19,12 @@ package com.epmet.modules.notice.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.notice.entity.NoticeCommentEntity;
import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO;
import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 小组通知评论表
*
@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface NoticeCommentDao extends BaseDao<NoticeCommentEntity> {
/**
* @Author sun
* @Description 分页查询通知评论列表
**/
List<NoticeCommentListResultDTO> getNoticeCommentList(NoticeCommentListFormDTO formDTO);
}

8
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeDao.java

@ -20,6 +20,7 @@ package com.epmet.modules.notice.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.notice.entity.NoticeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 小组通知表
@ -29,5 +30,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface NoticeDao extends BaseDao<NoticeEntity> {
/**
* @Author sun
* @Description 查询通知对应的小组的组长Id
**/
String selectNoticeGroupLeader(@Param("noticeId") String noticeId);
}

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

@ -18,8 +18,8 @@
package com.epmet.modules.notice.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.notice.entity.NoticeReafdRecordEntity;
import com.epmet.resi.group.dto.notice.NoticeReafdRecordDTO;
import com.epmet.modules.notice.entity.NoticeReadRecordEntity;
import com.epmet.resi.group.dto.notice.NoticeReadRecordDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -32,7 +32,7 @@ import java.util.List;
* @since v1.0.0 2021-04-19
*/
@Mapper
public interface NoticeReafdRecordDao extends BaseDao<NoticeReafdRecordEntity> {
public interface NoticeReadRecordDao extends BaseDao<NoticeReadRecordEntity> {
/**
* @Author sun
@ -44,5 +44,11 @@ public interface NoticeReafdRecordDao extends BaseDao<NoticeReafdRecordEntity> {
* @Author sun
* @Description 根据通知Id查询组成员已读未读数据
**/
List<NoticeReafdRecordDTO> getByNoticeId(@Param("noticeId") String noticeId);
List<NoticeReadRecordDTO> getByNoticeId(@Param("noticeId") String noticeId);
/**
* @Author sun
* @Description 查询当前人员是否存在对通知已读未读数据
**/
NoticeReadRecordEntity selectByNoticeId(@Param("noticeId") String noticeId, @Param("userId") String userId);
}

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeReafdRecordEntity.java → epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeReadRecordEntity.java

@ -34,7 +34,7 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("notice_reafd_record")
public class NoticeReafdRecordEntity extends BaseEpmetEntity {
public class NoticeReadRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/excel/NoticeReafdRecordExcel.java → epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/excel/NoticeReadRecordExcel.java

@ -29,7 +29,7 @@ import java.util.Date;
* @since v1.0.0 2021-04-19
*/
@Data
public class NoticeReafdRecordExcel {
public class NoticeReadRecordExcel {
@Excel(name = "主键")
private String id;

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/redis/NoticeReafdRecordRedis.java → epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/redis/NoticeReadRecordRedis.java

@ -28,7 +28,7 @@ import org.springframework.stereotype.Component;
* @since v1.0.0 2021-04-19
*/
@Component
public class NoticeReafdRecordRedis {
public class NoticeReadRecordRedis {
@Autowired
private RedisUtils redisUtils;

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

@ -19,8 +19,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;
@ -92,4 +96,20 @@ public interface NoticeCommentService extends BaseService<NoticeCommentEntity> {
* @date 2021-04-19
*/
void delete(String[] ids);
/**
* @param formDTO
* @return
* @Author sun
* @Description 发布通知评论
**/
void noticeComment(TokenDto tokenDto, NoticeCommentFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author sun
* @Description 通知评论列表查询
**/
List<NoticeCommentListResultDTO> noticeCommentList(TokenDto tokenDto, NoticeCommentListFormDTO formDTO);
}

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

@ -20,9 +20,10 @@ 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.NoticeReafdRecordEntity;
import com.epmet.resi.group.dto.notice.NoticeReafdRecordDTO;
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;
@ -34,7 +35,7 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-19
*/
public interface NoticeReafdRecordService extends BaseService<NoticeReafdRecordEntity> {
public interface NoticeReadRecordService extends BaseService<NoticeReadRecordEntity> {
/**
* 默认分页
@ -44,7 +45,7 @@ public interface NoticeReafdRecordService extends BaseService<NoticeReafdRecordE
* @author generator
* @date 2021-04-19
*/
PageData<NoticeReafdRecordDTO> page(Map<String, Object> params);
PageData<NoticeReadRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
@ -54,7 +55,7 @@ public interface NoticeReafdRecordService extends BaseService<NoticeReafdRecordE
* @author generator
* @date 2021-04-19
*/
List<NoticeReafdRecordDTO> list(Map<String, Object> params);
List<NoticeReadRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
@ -64,7 +65,7 @@ public interface NoticeReafdRecordService extends BaseService<NoticeReafdRecordE
* @author generator
* @date 2021-04-19
*/
NoticeReafdRecordDTO get(String id);
NoticeReadRecordDTO get(String id);
/**
* 默认保存
@ -74,7 +75,7 @@ public interface NoticeReafdRecordService extends BaseService<NoticeReafdRecordE
* @author generator
* @date 2021-04-19
*/
void save(NoticeReafdRecordDTO dto);
void save(NoticeReadRecordDTO dto);
/**
* 默认更新
@ -84,7 +85,7 @@ public interface NoticeReafdRecordService extends BaseService<NoticeReafdRecordE
* @author generator
* @date 2021-04-19
*/
void update(NoticeReafdRecordDTO dto);
void update(NoticeReadRecordDTO dto);
/**
* 批量删除
@ -103,4 +104,12 @@ public interface NoticeReafdRecordService extends BaseService<NoticeReafdRecordE
* @Description 通知已读未读列表查询
**/
NoticeReadListResultDTO noticeReadList(TokenDto tokenDto, NoticeReadListFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author sun
* @Description 小组通知阅读状态修改
**/
void readType(TokenDto tokenDto, ReadTypeFormDTO formDTO);
}

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

@ -21,21 +21,45 @@ 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;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.notice.dao.NoticeCommentDao;
import com.epmet.modules.notice.entity.NoticeCommentEntity;
import com.epmet.modules.notice.redis.NoticeCommentRedis;
import com.epmet.modules.notice.service.NoticeCommentService;
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;
import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO;
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;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* 小组通知评论表
@ -45,9 +69,20 @@ import java.util.Map;
*/
@Service
public class NoticeCommentServiceImpl extends BaseServiceImpl<NoticeCommentDao, NoticeCommentEntity> implements NoticeCommentService {
private final Log logger = LogFactory.getLog(getClass());
@Autowired
private NoticeCommentRedis noticeCommentRedis;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Autowired
private NoticeService noticeService;
@Autowired
private ResiGroupMemberService resiGroupMemberService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<NoticeCommentDTO> page(Map<String, Object> params) {
@ -65,8 +100,8 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl<NoticeCommentDao,
return ConvertUtils.sourceToTarget(entityList, NoticeCommentDTO.class);
}
private QueryWrapper<NoticeCommentEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<NoticeCommentEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<NoticeCommentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -101,4 +136,105 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl<NoticeCommentDao,
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 发布通知评论
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void noticeComment(TokenDto tokenDto, NoticeCommentFormDTO formDTO) {
//1.内容安全校验
String commentContent = formDTO.getCommentContent();
if (StringUtils.isNotBlank(commentContent)) {
//评论话题内容审核
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(commentContent);
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()) {
logger.error(String.format(TopicConstant.REVIEW_TOPIC, commentContent));
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//2.判断当前用户是否被禁言、移除、非本组成员
NoticeDTO notice = noticeService.get(formDTO.getNoticeId());
if (null == notice) {
logger.error(ModuleConstant.NO_SUCH_TOPIC);
throw new RenException(ModuleConstant.NO_SUCH_TOPIC);
}
ResiGroupMemberDTO resiGroupMemberDTO =
resiGroupMemberService.getResiGroupMember(notice.getGroupId(), tokenDto.getUserId());
//查看当前用户是否被禁言或者被移除
if (null != resiGroupMemberDTO) {
if (MemberStateConstant.SILENT.equals(resiGroupMemberDTO.getStatus())) {
//当前用户被禁言
logger.error(ModuleConstant.SLIENT_MEMBER);
throw new RenException(ModuleConstant.SLIENT_MEMBER);
} else if (MemberStateConstant.REMOVED.equals(resiGroupMemberDTO.getStatus())) {
//当前用户已被移出群
logger.error(ModuleConstant.REMOVED_MEMBER);
throw new RenException(ModuleConstant.REMOVED_MEMBER);
}
} else {
//当前用户非组内成员
logger.error(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
throw new RenException(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
}
//3.通知评论表新增数据
NoticeCommentEntity entity = new NoticeCommentEntity();
entity.setCustomerId(notice.getCustomerId());
entity.setNoticeId(formDTO.getNoticeId());
entity.setCommentContent(formDTO.getCommentContent());
insert(entity);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 通知评论列表查询
**/
@Override
public List<NoticeCommentListResultDTO> noticeCommentList(TokenDto tokenDto, NoticeCommentListFormDTO formDTO) {
//1.分页查询通知评论列表
formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize());
List<NoticeCommentListResultDTO> resultList = baseDao.getNoticeCommentList(formDTO);
if (resultList.size() < NumConstant.ONE) {
return new ArrayList<>();
}
//2.调用user服务,查询评论人员基础信息
List<String> userIdList = resultList.stream().map(NoticeCommentListResultDTO::getUserId).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> result = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if (!result.success()) {
throw new RenException("调用user服务,获取用户基础数据失败");
}
List<UserBaseInfoResultDTO> resultDTOList = result.getData();
//3.封装数据并返回
resultList.forEach(l -> {
StringBuffer name = new StringBuffer();
resultDTOList.forEach(user -> {
if (l.getUserId().equals(user.getUserId())) {
name.append(null == user.getSurname() ? "" : user.getSurname()).append(null == user.getName() ? "" : user.getName());
l.setCommentUserHeadPhoto(user.getHeadImgUrl());
}
});
l.setCommentUserName(name.toString());
});
return resultList;
}
}

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

@ -26,14 +26,18 @@ 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;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.notice.dao.NoticeReafdRecordDao;
import com.epmet.modules.notice.entity.NoticeReafdRecordEntity;
import com.epmet.modules.notice.redis.NoticeReafdRecordRedis;
import com.epmet.modules.notice.service.NoticeReafdRecordService;
import com.epmet.resi.group.dto.notice.NoticeReafdRecordDTO;
import com.epmet.modules.notice.dao.NoticeDao;
import com.epmet.modules.notice.dao.NoticeReadRecordDao;
import com.epmet.modules.notice.entity.NoticeEntity;
import com.epmet.modules.notice.entity.NoticeReadRecordEntity;
import com.epmet.modules.notice.redis.NoticeReadRecordRedis;
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.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -44,7 +48,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -54,55 +57,57 @@ import java.util.stream.Collectors;
* @since v1.0.0 2021-04-19
*/
@Service
public class NoticeReafdRecordServiceImpl extends BaseServiceImpl<NoticeReafdRecordDao, NoticeReafdRecordEntity> implements NoticeReafdRecordService {
public class NoticeReadRecordServiceImpl extends BaseServiceImpl<NoticeReadRecordDao, NoticeReadRecordEntity> implements NoticeReadRecordService {
@Autowired
private NoticeReafdRecordRedis noticeReafdRecordRedis;
private NoticeReadRecordRedis noticeReafdRecordRedis;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private NoticeDao noticeDao;
@Override
public PageData<NoticeReafdRecordDTO> page(Map<String, Object> params) {
IPage<NoticeReafdRecordEntity> page = baseDao.selectPage(
public PageData<NoticeReadRecordDTO> page(Map<String, Object> params) {
IPage<NoticeReadRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, NoticeReafdRecordDTO.class);
return getPageData(page, NoticeReadRecordDTO.class);
}
@Override
public List<NoticeReafdRecordDTO> list(Map<String, Object> params) {
List<NoticeReafdRecordEntity> entityList = baseDao.selectList(getWrapper(params));
public List<NoticeReadRecordDTO> list(Map<String, Object> params) {
List<NoticeReadRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, NoticeReafdRecordDTO.class);
return ConvertUtils.sourceToTarget(entityList, NoticeReadRecordDTO.class);
}
private QueryWrapper<NoticeReafdRecordEntity> getWrapper(Map<String, Object> params){
private QueryWrapper<NoticeReadRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<NoticeReafdRecordEntity> wrapper = new QueryWrapper<>();
QueryWrapper<NoticeReadRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public NoticeReafdRecordDTO get(String id) {
NoticeReafdRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, NoticeReafdRecordDTO.class);
public NoticeReadRecordDTO get(String id) {
NoticeReadRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, NoticeReadRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(NoticeReafdRecordDTO dto) {
NoticeReafdRecordEntity entity = ConvertUtils.sourceToTarget(dto, NoticeReafdRecordEntity.class);
public void save(NoticeReadRecordDTO dto) {
NoticeReadRecordEntity entity = ConvertUtils.sourceToTarget(dto, NoticeReadRecordEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(NoticeReafdRecordDTO dto) {
NoticeReafdRecordEntity entity = ConvertUtils.sourceToTarget(dto, NoticeReafdRecordEntity.class);
public void update(NoticeReadRecordDTO dto) {
NoticeReadRecordEntity entity = ConvertUtils.sourceToTarget(dto, NoticeReadRecordEntity.class);
updateById(entity);
}
@ -124,11 +129,14 @@ public class NoticeReafdRecordServiceImpl extends BaseServiceImpl<NoticeReafdRec
NoticeReadListResultDTO resultDTO = new NoticeReadListResultDTO();
List<NoticeReadListResultDTO.NoticeReafdRecord> readList = new ArrayList<>();
List<NoticeReadListResultDTO.NoticeReafdRecord> unReadList = new ArrayList<>();
//0.查询通知对应的小组的组长Id
String leaderId = noticeDao.selectNoticeGroupLeader(formDTO.getNoticeId());
//1.根据通知Id查询组成员已读未读数据
List<NoticeReafdRecordDTO> list = baseDao.getByNoticeId(formDTO.getNoticeId());
List<NoticeReadRecordDTO> list = baseDao.getByNoticeId(formDTO.getNoticeId());
//2.调用user服务,查询人员基础数据
List<String> userIdList = list.stream().map(NoticeReafdRecordDTO::getUserId).collect(Collectors.toList());
List<String> userIdList = list.stream().map(NoticeReadRecordDTO::getUserId).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> result = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if (!result.success()){
throw new RenException("调用user服务,获取用户基础数据失败");
@ -167,4 +175,39 @@ public class NoticeReafdRecordServiceImpl extends BaseServiceImpl<NoticeReafdRec
return resultDTO;
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 小组通知阅读状态修改
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void readType(TokenDto tokenDto, ReadTypeFormDTO formDTO) {
//1.根据通知Id和当前用户查询是否存在通知阅读记录
NoticeReadRecordEntity entity = baseDao.selectByNoticeId(formDTO.getNoticeId(), tokenDto.getUserId());
//2.不存在记录时新增已读记录
if (null == entity || StringUtils.isEmpty(entity.getId())) {
//查询通知详情
NoticeEntity notice = noticeDao.selectById(formDTO.getNoticeId());
//新增当前人员已读数据
NoticeReadRecordEntity reafdRecord = new NoticeReadRecordEntity();
reafdRecord.setCustomerId(notice.getCustomerId());
reafdRecord.setGridId(notice.getGridId());
reafdRecord.setGroupId(notice.getGroupId());
reafdRecord.setNoticeId(notice.getId());
reafdRecord.setUserId(tokenDto.getUserId());
reafdRecord.setReadFlag(ReadFlagConstant.READ);
insert(reafdRecord);
} else {
//3.已存在记录且是已读状态不在修改
if (ReadFlagConstant.UN_READ.equals(entity.getReadFlag())) {
entity.setReadFlag(ReadFlagConstant.READ);
baseDao.updateById(entity);
}
}
}
}

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

@ -49,18 +49,17 @@ import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.member.dao.ResiGroupMemberDao;
import com.epmet.modules.notice.dao.NoticeAttachmentDao;
import com.epmet.modules.notice.dao.NoticeDao;
import com.epmet.modules.notice.dao.NoticeReafdRecordDao;
import com.epmet.modules.notice.dao.NoticeReadRecordDao;
import com.epmet.modules.notice.entity.NoticeAttachmentEntity;
import com.epmet.modules.notice.entity.NoticeEntity;
import com.epmet.modules.notice.entity.NoticeReafdRecordEntity;
import com.epmet.modules.notice.entity.NoticeReadRecordEntity;
import com.epmet.modules.notice.redis.NoticeRedis;
import com.epmet.modules.notice.service.NoticeAttachmentService;
import com.epmet.modules.notice.service.NoticeReafdRecordService;
import com.epmet.modules.notice.service.NoticeReadRecordService;
import com.epmet.modules.notice.service.NoticeService;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.notice.NoticeDTO;
import com.epmet.resi.group.dto.notice.NoticeReafdRecordDTO;
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;
@ -110,9 +109,9 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
@Autowired
private NoticeAttachmentDao noticeAttachmentDao;
@Autowired
private NoticeReafdRecordService noticeReafdRecordService;
private NoticeReadRecordService noticeReafdRecordService;
@Autowired
private NoticeReafdRecordDao noticeReafdRecordDao;
private NoticeReadRecordDao noticeReafdRecordDao;
@Override
@ -273,18 +272,20 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
}
//6.通知已读未读表初始数据
List<NoticeReafdRecordEntity> reafdRecordList = new ArrayList<>();
List<NoticeReadRecordEntity> reafdRecordList = new ArrayList<>();
memberList.forEach(m -> {
if (!"".equals(m.getGroupLeaderFlag())) {
NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity();
reafdRecord.setCustomerId(resultDTO.getCustomerId());
reafdRecord.setGridId(groupEntity.getGridId());
reafdRecord.setGroupId(formDTO.getGroupId());
reafdRecord.setNoticeId(entity.getId());
reafdRecord.setUserId(m.getCustomerUserId());
NoticeReadRecordEntity reafdRecord = new NoticeReadRecordEntity();
reafdRecord.setCustomerId(resultDTO.getCustomerId());
reafdRecord.setGridId(groupEntity.getGridId());
reafdRecord.setGroupId(formDTO.getGroupId());
reafdRecord.setNoticeId(entity.getId());
reafdRecord.setUserId(m.getCustomerUserId());
if ("leader".equals(m.getGroupLeaderFlag())) {
reafdRecord.setReadFlag(ReadFlagConstant.READ);
}else {
reafdRecord.setReadFlag(ReadFlagConstant.UN_READ);
reafdRecordList.add(reafdRecord);
}
reafdRecordList.add(reafdRecord);
});
if (reafdRecordList.size() > NumConstant.ZERO) {
noticeReafdRecordService.insertBatch(reafdRecordList);
@ -392,18 +393,20 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeDao, NoticeEntity>
//6.通知已读未读消息表数据先删后增
noticeReafdRecordDao.delByNoticeId(formDTO.getNoticeId());
List<NoticeReafdRecordEntity> reafdRecordList = new ArrayList<>();
List<NoticeReadRecordEntity> reafdRecordList = new ArrayList<>();
memberList.forEach(m -> {
if (!"".equals(m.getGroupLeaderFlag())) {
NoticeReafdRecordEntity reafdRecord = new NoticeReafdRecordEntity();
reafdRecord.setCustomerId(entity.getCustomerId());
reafdRecord.setGridId(entity.getGridId());
reafdRecord.setGroupId(entity.getGroupId());
reafdRecord.setNoticeId(entity.getId());
reafdRecord.setUserId(m.getCustomerUserId());
NoticeReadRecordEntity reafdRecord = new NoticeReadRecordEntity();
reafdRecord.setCustomerId(entity.getCustomerId());
reafdRecord.setGridId(entity.getGridId());
reafdRecord.setGroupId(entity.getGroupId());
reafdRecord.setNoticeId(entity.getId());
reafdRecord.setUserId(m.getCustomerUserId());
if ("leader".equals(m.getGroupLeaderFlag())) {
reafdRecord.setReadFlag(ReadFlagConstant.READ);
}else {
reafdRecord.setReadFlag(ReadFlagConstant.UN_READ);
reafdRecordList.add(reafdRecord);
}
reafdRecordList.add(reafdRecord);
});
if (reafdRecordList.size() > NumConstant.ZERO) {
noticeReafdRecordService.insertBatch(reafdRecordList);

14
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java

@ -441,4 +441,18 @@ public class ResiTopicController {
}
return new Result<>();
}
/**
* @Description 查询组内近十条数据
* @Param tokenDto
* @Param formDTO
* @author zxc
* @date 2021/4/20 下午2:34
*/
@PostMapping("getlatestv2")
public Result<GetLatestV2ResultDTO> getLatestV2(@LoginUser TokenDto tokenDto,@RequestBody GetLatestV2FormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, GetLatestV2FormDTO.GetLatestV2Form.class);
formDTO.setUserId(tokenDto.getUserId());
return new Result<GetLatestV2ResultDTO>().ok(topicService.getLatestV2(formDTO));
}
}

9
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java

@ -354,4 +354,13 @@ public interface ResiTopicService extends BaseService<ResiTopicEntity> {
ResiTopicDTO queryTopicInfoByIssueId(String issueId);
/**
* @Description 查询组内近十条数据
* @Param tokenDto
* @Param formDTO
* @author zxc
* @date 2021/4/20 下午2:34
*/
GetLatestV2ResultDTO getLatestV2(GetLatestV2FormDTO formDTO);
}

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

@ -2183,6 +2183,18 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
return baseDao.selectByIssueId(issueId);
}
/**
* @Description 查询组内近十条数据
* @Param tokenDto
* @Param formDTO
* @author zxc
* @date 2021/4/20 下午2:34
*/
@Override
public GetLatestV2ResultDTO getLatestV2(GetLatestV2FormDTO formDTO) {
return null;
}
}

16
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentDao.xml

@ -3,6 +3,20 @@
<mapper namespace="com.epmet.modules.act.dao.ActCommentDao">
<select id="selectCommentList" resultType="com.epmet.resi.group.dto.act.result.CommentResultDTO"
parameterType="java.lang.String">
SELECT
ac.id as commentId,
ac.COMMENT_CONTENT as commentContent,
ac.CREATED_TIME as commentTime,
ac.COMMENT_USER_ID as commentUserId
FROM
act_comment ac
WHERE
ac.DEL_FLAG = '0'
AND ac.GROUP_ACT_ID = #{groupActId}
ORDER BY
ac.CREATED_TIME DESC
</select>
</mapper>

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

@ -3,6 +3,19 @@
<mapper namespace="com.epmet.modules.act.dao.ActOperationRecordDao">
<!-- 查询活动取消的原因 -->
<select id="selectCanceledReason" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
aor.NOTE
FROM
act_operation_record aor
WHERE
aor.DEL_FLAG = '0'
AND aor.OPERATION_TYPE = 'cancel'
AND aor.GROUP_ACT_ID = #{groupActId}
ORDER BY
aor.CREATED_TIME DESC
LIMIT 1
</select>
</mapper>

24
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActReadRecordDao.xml

@ -2,9 +2,33 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.modules.act.dao.ActReadRecordDao">
<!-- 重新发布活动,删除原来的已读未读记录,重新插入应读记录 -->
<delete id="deleteByActId" parameterType="java.lang.String">
delete from act_read_record where GROUP_ACT_ID=#{groupActId}
</delete>
<!-- 查询当前活动,应读人员列表 -->
<select id="selectByGroupActId" parameterType="java.lang.String" resultType="com.epmet.modules.act.entity.ActReadRecordEntity">
SELECT
*
FROM
act_read_record arr
WHERE
arr.DEL_FLAG = '0'
AND arr.GROUP_ACT_ID = #{groupActId}
AND arr.SHOULD_BE_READ = 'yes'
</select>
<!-- 查询用户是否阅读过此活动 -->
<select id="selectUserRec" parameterType="map" resultType="com.epmet.modules.act.entity.ActReadRecordEntity">
SELECT
*
FROM
act_read_record arr
WHERE
arr.DEL_FLAG = '0'
AND arr.GROUP_ACT_ID = #{groupActId}
AND arr.USER_ID=#{userId}
</select>
</mapper>

9
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSignInCodeDao.xml

@ -2,7 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.modules.act.dao.ActSignInCodeDao">
<select id="selectLastRec" parameterType="java.lang.String" resultType="com.epmet.resi.group.dto.act.ActSignInCodeDTO">
select m.*
from act_sign_in_code m
where m.DEL_FLAG='0'
and m.GROUP_ACT_ID=#{groupActId}
order by m.CREATED_TIME desc
limit 1
</select>
</mapper>

21
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSignInRecordDao.xml

@ -3,6 +3,27 @@
<mapper namespace="com.epmet.modules.act.dao.ActSignInRecordDao">
<!-- 查询当前用户是否签到 -->
<select id="selectCountUserRec" resultType="int" parameterType="map">
SELECT
count(*)
FROM
act_sign_in_record acr
WHERE
acr.DEL_FLAG = '0'
AND acr.GROUP_ACT_ID = #{groupActId}
AND acr.SIGN_USER_ID =#{signUserId}
</select>
<!-- 查询活动的签到记录 -->
<select id="selectListByGroupActId" resultType="com.epmet.modules.act.entity.ActSignInRecordEntity" parameterType="java.lang.String">
SELECT
*
FROM
act_sign_in_record acr
WHERE
acr.DEL_FLAG = '0'
AND acr.GROUP_ACT_ID = #{groupActId}
</select>
</mapper>

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

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.modules.act.dao.GroupActContentDao">
<!-- 重新编辑活动提交,将原来的内容置为已删除 -->
<update id="updateToDel" parameterType="map">
UPDATE group_act_content
SET DEL_FLAG = '1',
@ -12,4 +12,17 @@
GROUP_ACT_ID = #{groupActId}
</update>
<!-- 活动内容,升序返回 -->
<select id="selectContentList" parameterType="map" resultType="java.lang.String">
SELECT
gac.CONTENT
FROM
group_act_content gac
WHERE
gac.DEL_FLAG = '0'
AND gac.GROUP_ACT_ID = #{groupActId}
AND gac.CONTENT_TYPE = #{contentType}
ORDER BY
gac.SORT ASC
</select>
</mapper>

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

@ -527,4 +527,27 @@
GROUP BY
temp.gridId
</select>
<select id="selectAllGroupList" resultType="com.epmet.resi.group.dto.group.result.AllGroupListResultDTO">
SELECT
rg.id AS groupId,
rg.group_head_photo AS groupHeadPhoto,
rg.group_name AS groupName,
rg.group_type AS groupType,
rgs.total_members AS totalMember,
rgs.total_party_members AS totalPartyMember
FROM
resi_group rg
LEFT JOIN resi_group_statistical rgs ON (rg.id = rgs.resi_group_id)
WHERE
rg.del_flag = '0'
AND rgs.del_flag = '0'
AND rg.grid_id = #{gridId}
AND rg.state = 'approved'
ORDER BY
totalMember DESC
LIMIT
#{pageNo}, #{pageSize}
</select>
</mapper>

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

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiGroupSetupDao">
</mapper>

15
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentDao.xml

@ -3,5 +3,20 @@
<mapper namespace="com.epmet.modules.notice.dao.NoticeCommentDao">
<select id="getNoticeCommentList" resultType="com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO">
SELECT
id AS noticeCommentId,
comment_content AS commentContent,
created_time AS commentTime,
created_by AS userId
FROM
notice_comment
WHERE
del_flag = '0'
AND notice_id = #{noticeId}
ORDER BY
created_time DESC
LIMIT #{pageNo}, #{pageSize}
</select>
</mapper>

14
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeDao.xml

@ -3,5 +3,19 @@
<mapper namespace="com.epmet.modules.notice.dao.NoticeDao">
<select id="selectNoticeGroupLeader" resultType="java.lang.String">
SELECT
rgm.customer_user_id
FROM
notice n
INNER JOIN resi_group rg ON n.group_id = rg.id
INNER JOIN resi_group_member rgm ON n.group_id = rgm.resi_group_id
WHERE
n.del_flag = '0'
AND rg.del_flag = '0'
AND rgm.del_flag = '0'
AND rgm.group_leader_flag = 'leader'
AND n.id = #{noticeId}
</select>
</mapper>

15
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReafdRecordDao.xml → epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeReadRecordDao.xml

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.modules.notice.dao.NoticeReafdRecordDao">
<mapper namespace="com.epmet.modules.notice.dao.NoticeReadRecordDao">
<select id="getByNoticeId" resultType="com.epmet.resi.group.dto.notice.NoticeReafdRecordDTO">
<select id="getByNoticeId" resultType="com.epmet.resi.group.dto.notice.NoticeReadRecordDTO">
SELECT
*
FROM
@ -13,6 +13,17 @@
AND notice_id = #{noticeId}
</select>
<select id="selectByNoticeId" resultType="com.epmet.modules.notice.entity.NoticeReadRecordEntity">
SELECT
*
FROM
notice_reafd_record
WHERE
del_flag = '0'
AND notice_id = #{noticeId}
AND user_id = #{userId}
</select>
<delete id="delByNoticeId">
DELETE
FROM
Loading…
Cancel
Save