Browse Source

楼院小组redis的get操作修改,缓存、数据库全流程封装,其余服务只需调用即可。政府端接口①待审核的小组列表②审核小组的详情(包含已审核与未审核)③同意建组申请④驳回建组申请。在resi-guide模块加上snakeYaml依赖解决bootstrap.yml无法试别@的问题。

master
wangchao 5 years ago
parent
commit
f6da4109b3
  1. 63
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java
  2. 46
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java
  3. 52
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java
  4. 41
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiGroupService.java
  5. 34
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiGroupServiceImpl.java
  6. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java
  7. 9
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyingGroupsFormDTO.java
  8. 29
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGroupIdFromDTO.java
  9. 78
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java
  10. 16
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupResultDTO.java
  11. 46
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  12. 19
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  13. 83
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java
  14. 20
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  15. 107
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  16. 82
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java
  17. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  18. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java
  19. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  20. 40
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java
  21. 2
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/db.sql
  22. 49
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  23. 5
      epmet-module/resi-guide/resi-guide-server/pom.xml
  24. 1
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
  25. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

63
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java

@ -1,7 +1,12 @@
package com.epmet.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.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.service.ResiGroupService;
import org.springframework.beans.factory.annotation.Autowired;
@ -33,4 +38,60 @@ public class ResiGroupController {
public Result<List<GroupAuditedResultDTO>> audited(@RequestBody GroupAuditedFromDTO formDTO) {
return resiGroupService.audited(formDTO);
}
/**
* @Description 查询小组待审核列表
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
@PostMapping("auditing")
public Result<List<ApplyingGroupResultDTO>> auditing(@LoginUser TokenDto tokenDto, @RequestBody ApplyingGroupsFormDTO applyingGroupsFormDTO){
applyingGroupsFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(applyingGroupsFormDTO);
return resiGroupService.auditing(applyingGroupsFormDTO);
}
/**
* @Description 得到待审核/未审核小组信息的详情
* @Param CommonGroupIdFromDTO -> String groupId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
@PostMapping("applygroupdetail")
public Result<ApplyingGroupDetailResultDTO> applyGroupDetail(@LoginUser TokenDto tokenDto, @RequestBody CommonGroupIdFromDTO groupIdFromDTO){
groupIdFromDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(groupIdFromDTO);
return resiGroupService.applyGroupDetail(groupIdFromDTO);
}
/**
* @Description 建组申请-审核通过
* @Param AgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:25
**/
@PostMapping("approve")
public Result agreeApplying(@LoginUser TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO){
agreeApplyGroupFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(agreeApplyGroupFormDTO);
return resiGroupService.agreeApplying(agreeApplyGroupFormDTO);
}
/**
* @Description 建组申请-审核驳回
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
@PostMapping("reject")
public Result disagreeApplying(@LoginUser TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO){
disAgreeApplyGroupFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO);
return resiGroupService.disagreeApplying(disAgreeApplyGroupFormDTO);
}
}

46
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java

@ -3,7 +3,9 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.fallback.ResiGroupFeignClientFallBack;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@ -25,4 +27,46 @@ public interface ResiGroupFeignClient {
*/
@PostMapping("/resi/group/group/audited")
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* @Description 得到小组待审核列表用户信息不注入TokenDTO通过外部服务调用直接传入参数
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
@PostMapping("/resi/group/group/getapplyinggroups")
Result<List<ApplyingGroupResultDTO>> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO);
/**
* @Description 得到待审核/未审核小组信息的详情
* @Param CommonGroupIdFromDTO -> String groupId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
@PostMapping("/resi/group/group/getapplyinggroupdetail")
Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(CommonGroupIdFromDTO groupId);
/**
* @Description 建组申请-审核通过
* @Param AgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:25
**/
@PostMapping("/resi/group/group/agreeapplying")
Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO);
/**
* @Description 建组申请-审核驳回
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
@PostMapping("/resi/group/group/disagreeapplying")
Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO);
}

52
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java

@ -4,7 +4,9 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import org.springframework.stereotype.Component;
@ -21,4 +23,52 @@ public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient {
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "audited", formDTO);
}
/**
* @Description 得到小组待审核列表用户信息不注入TokenDTO通过外部服务调用直接传入参数
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
@Override
public Result<List<ApplyingGroupResultDTO>> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getApplyingGroups", applyingGroupsFormDTO);
}
/**
* @Description 得到待审核/未审核小组信息的详情
* @Param CommonGroupIdFromDTO -> String groupId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
@Override
public Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(CommonGroupIdFromDTO groupId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getApplyingGroupDetail", groupId);
}
/**
* @Description 建组申请-审核通过
* @Param AgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:25
**/
@Override
public Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "agreeApplying", agreeApplyGroupFormDTO);
}
/**
* @Description 建组申请-审核驳回
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
@Override
public Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "disagreeApplying", disAgreeApplyGroupFormDTO);
}
}

41
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiGroupService.java

@ -1,7 +1,9 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import java.util.List;
@ -19,4 +21,41 @@ public interface ResiGroupService {
* @return Result<List<GroupAuditedResultDTO>>
*/
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* @Description 查询小组待审核列表-调用resi-group服务
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
Result<List<ApplyingGroupResultDTO>> auditing(ApplyingGroupsFormDTO applyingGroupsFormDTO);
/**
* @Description 得到待审核/未审核小组信息的详情-调用resi-group服务
* @Param CommonGroupIdFromDTO -> String groupId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
Result<ApplyingGroupDetailResultDTO> applyGroupDetail(CommonGroupIdFromDTO groupIdFromDTO);
/**
* @Description 建组申请-审核通过-调用resi-group服务
* @Param AgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:25
**/
Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO);
/**
* @Description 建组申请-审核驳回-调用resi-group服务
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO);
}

34
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiGroupServiceImpl.java

@ -2,7 +2,9 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.service.ResiGroupService;
import org.springframework.beans.factory.annotation.Autowired;
@ -18,10 +20,32 @@ import java.util.List;
*/
@Service
public class ResiGroupServiceImpl implements ResiGroupService{
@Autowired
private ResiGroupFeignClient resiGroupFeignClient;
@Autowired
private ResiGroupFeignClient resiGroupFeignClient;
@Override
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
return resiGroupFeignClient.audited(formDTO);
}
@Override
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
return resiGroupFeignClient.audited(formDTO);
public Result<List<ApplyingGroupResultDTO>> auditing(ApplyingGroupsFormDTO applyingGroupsFormDTO) {
return resiGroupFeignClient.getApplyingGroups(applyingGroupsFormDTO);
}
@Override
public Result<ApplyingGroupDetailResultDTO> applyGroupDetail(CommonGroupIdFromDTO groupIdFromDTO) {
return resiGroupFeignClient.getApplyingGroupDetail(groupIdFromDTO);
}
@Override
public Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) {
return resiGroupFeignClient.agreeApplying(agreeApplyGroupFormDTO);
}
@Override
public Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) {
return resiGroupFeignClient.disagreeApplying(disAgreeApplyGroupFormDTO);
}
}

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java

@ -67,4 +67,9 @@ public interface TopicConstant {
* 构造queryWrapper 附件排序
* */
String SORT = "SORT";
/**
* 构造queryWrapper 用户Id
* */
String CUSTOMER_USER_ID = "CUSTOMER_USER_ID";
}

9
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyingGroupsFormDTO.java

@ -3,6 +3,7 @@ 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;
/**
@ -18,11 +19,13 @@ public class ApplyingGroupsFormDTO implements Serializable{
/**
* 客户Id
* */
@NotBlank(message = "客户Id不能为空")
private String customerId;
/**
* 网格Id
* */
@NotBlank(message = "网格Id不能为空")
private String gridId;
/**
@ -35,4 +38,10 @@ public class ApplyingGroupsFormDTO implements Serializable{
* 每页数据 默认20
* */
private Integer pageSize = 20;
/**
* 用户Id
* */
@NotBlank(message = "用户Id不能为空")
private String userId;
}

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

@ -0,0 +1,29 @@
package com.epmet.resi.group.dto.group.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 通用的传参DTO 只传groupId和userId
* @ClassName CommonGroupIdFromDTO
* @Author wangc
* @date 2020.04.20 14:04
*/
@Data
public class CommonGroupIdFromDTO implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 组Id
* */
@NotBlank(message = "组Id不能为空")
private String groupId;
/**
* 用户Id
* */
@NotBlank(message = "用户Id不能为空")
private String userId;
}

78
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java

@ -0,0 +1,78 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 建组申请详情
* @ClassName ApplyingGroupDetailResultDTO
* @Author wangc
* @date 2020.04.17 16:13
*/
@Data
public class ApplyingGroupDetailResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组Id
* */
private String groupId;
/**
* 组名称
* */
private String groupName;
/**
* 组头像
* */
private String groupHeadPhoto;
/**
* 组介绍
* */
private String groupIntroduction;
/**
* 申请时间
* */
private Date createdTime;
/**
* 组长名称
* */
private String groupLeaderName;
/**
* 已同意该申请approved 已驳回rejected
* */
private String status;
/**
* 驳回理由
* */
private String rejectReason;
/**
* 从数据库中获取组长的用户Id,方便获取组长用户信息,返回时将此值置为NULL
* */
private String leaderId;
/**
* 街道
* */
private String street;
/**
* 未读已读标识 unread read
* */
private String readFlag;
/**
* 从数据库中获取组操作记录Id,返回时将此值置为NULL
* */
private String operationId;
}

16
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupsResultDTO.java → epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupResultDTO.java

@ -3,16 +3,16 @@ package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 政府端查询待审核的小组
* @ClassName ApplyingGroupsResultDTO
* @ClassName ApplyingGroupResultDTO
* @Author wangc
* @date 2020.04.17 15:20
*/
@Data
public class ApplyingGroupsResultDTO implements Serializable{
public class ApplyingGroupResultDTO implements Serializable{
private static final long serialVersionUID = 1L;
/**
@ -30,15 +30,10 @@ public class ApplyingGroupsResultDTO implements Serializable{
* */
private String groupHeadPhoto;
/**
* 组介绍
* */
private String groupIntroduction;
/**
* 申请时间
* */
private Date createdTime;
private String createdTime;
/**
* 审核人员已读未读标识(未读:unread ; 已读:read )
@ -49,4 +44,7 @@ public class ApplyingGroupsResultDTO implements Serializable{
* 消息通知内容
* */
private String messageText;
}

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

@ -22,7 +22,6 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.dto.group.form.*;
@ -230,4 +229,49 @@ public class ResiGroupController {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.audited(formDTO);
}
/**
* @Description 得到小组待审核列表用户信息不注入TokenDTO通过外部服务调用直接传入参数
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
@PostMapping("getapplyinggroups")
public Result<List<ApplyingGroupResultDTO>> getApplyingGroups(@RequestBody ApplyingGroupsFormDTO applyingGroupsFormDTO){
ValidatorUtils.validateEntity(applyingGroupsFormDTO);
return resiGroupService.getApplyingGroups(applyingGroupsFormDTO);
}
/**
* @Description 得到待审核/未审核小组信息的详情
* @Param CommonGroupIdFromDTO -> String groupId; String userId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
@PostMapping("getapplyinggroupdetail")
public Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(@RequestBody CommonGroupIdFromDTO groupIdFromDTO){
ValidatorUtils.validateEntity(groupIdFromDTO);
return resiGroupService.getApplyingGroupDetail(groupIdFromDTO);
}
@PostMapping("agreeapplying")
public Result agreeApplying( @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) {
ValidatorUtils.validateEntity(agreeApplyGroupFormDTO);
return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO);
}
/**
* @Description 建组申请-审核驳回-供外部服务调用当前用户Id需要调用时一并传入
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
@PostMapping("disagreeapplying")
public Result disagreeApplying(@RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) {
ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO);
return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO);
}
}

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

@ -23,6 +23,7 @@ import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -113,4 +114,22 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @return
*/
List<GroupAuditedResultDTO> selectAuditedGroupList(GroupAuditedFromDTO formDTO);
/**
* @Description 查询申请中的的小组
* @Param ApplyingGroupsFormDTO
* @return List<ApplyingGroupResultDTO>
* @Author wangc
* @Date 2020.04.20 00:11
**/
List<ApplyingGroupResultDTO> getApplyingGroupsByCustIdAndGridId(ApplyingGroupsFormDTO applyingGroupsFormDTO);
/**
* @Description 获取组审核信息详情:已审核/未审核通用
* @Param groupId
* @return ApplyingGroupDetailResultDTO
* @Author wangc
* @Date 2020.04.20 11:17
**/
ApplyingGroupDetailResultDTO getApplyingGroupDetailByGroupId(@Param("groupId") String groupId);
}

83
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java

@ -17,13 +17,24 @@
package com.epmet.modules.group.redis;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.group.service.ResiGroupStatisticalService;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO;
import com.epmet.resi.group.dto.group.ResiGroupStatisticalDTO;
import com.epmet.resi.group.dto.group.ResiGroupStatisticalInfoRedisDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* 群组信息表
*
@ -35,6 +46,13 @@ public class ResiGroupRedis {
@Autowired
private RedisUtils redisUtils;
@Autowired
private ResiGroupService groupService;
@Autowired
private ResiGroupStatisticalService statisticalService;
public void delete(Object[] ids) {
}
@ -51,10 +69,75 @@ public class ResiGroupRedis {
}
}
/**
* @Description 查询组的缓存信息如果有直接返回如果没有则从数据库中查询将数据放入缓存并返回
* @Param
* @return
* @Author wangc
* @Date 2020.04.18 12:00
**/
public ResiGroupInfoRedisDTO get(String groupId){
if(StringUtils.isNotBlank(groupId)){
ResiGroupInfoRedisDTO groupCache = (ResiGroupInfoRedisDTO)
redisUtils.get(RedisKeys.getResiGroupInfoKey(groupId));
if(null == groupCache || StringUtils.isBlank(groupCache.getGroupId())){
//如果缓存中没有该组信息,从数据库中查询并放入缓存
ResiGroupDTO groupMySql = groupService.get(groupId);
if(null != groupMySql && StringUtils.isNotBlank(groupMySql.getId())){
ResiGroupInfoRedisDTO groupRedis = ConvertUtils.sourceToTarget(groupMySql,ResiGroupInfoRedisDTO.class);
groupRedis.setGroupId(groupMySql.getId());
groupRedis.setGroupState(groupMySql.getState());
Map<String,Object> param = new HashMap<>();
param.put(TopicConstant.RESI_GROUP_ID,groupId);
param.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR);
List<ResiGroupStatisticalDTO> statisticalMySql = statisticalService.list(param);
if(null != statisticalMySql && statisticalMySql.size() >= 1){
if(statisticalMySql.size() > 1){
/*
Collections.sort(statisticalMySql, new Comparator<ResiGroupStatisticalDTO>() {
@Override
public int compare(ResiGroupStatisticalDTO o1, ResiGroupStatisticalDTO o2) {
if(null != o1.getCreatedTime() && null != o2.getCreatedTime()){
return
o1.getCreatedTime().getTime() > o2.getCreatedTime().getTime() ?
-1 : (o1.getCreatedTime().getTime() == o2.getCreatedTime().getTime() ?
0: 1);
}else{
return 0;
}
}
});
statisticalMySql.sort((ResiGroupStatisticalDTO o1, ResiGroupStatisticalDTO o2) ->
o1.getCreatedTime().compareTo(o2.getCreatedTime())
);
//升序
statisticalMySql.sort(Comparator.comparing(e -> e.getCreatedTime()));
statisticalMySql.sort(Comparator.comparing(ResiGroupStatisticalDTO :: getCreatedTime,
(o1 , o2) -> {
return o2.compareTo(o 1);
}));
*/
//按照createdTime降序排序
statisticalMySql.sort(Comparator.comparing(ResiGroupStatisticalDTO :: getCreatedTime,
Collections.reverseOrder()));
}
ResiGroupStatisticalDTO statistical = statisticalMySql.get(0);
ResiGroupStatisticalInfoRedisDTO statisticalRedis =
ConvertUtils.sourceToTarget(statistical,ResiGroupStatisticalInfoRedisDTO.class);
statisticalRedis.setTotalEarnestMembers(statistical.getTotalEarnestMemebers());
statisticalRedis.setTotalNormalMembers(statistical.getTotalNormalMemebers());
groupRedis.setGroupStatisticalInfo(statisticalRedis);
}
//将从数据库中查询出的数据放入缓存
set(groupRedis);
//返回数据
return groupRedis;
}
}
return groupCache;
}
return null;

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

@ -20,9 +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.dto.form.UserResiInfoFormDTO;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.resi.group.dto.UserRoleDTO;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
@ -208,4 +206,22 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
* @return Result<List<GroupAuditedResultDTO>>
*/
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* @Description 查询待审核的小组
* @Param ApplyingGroupsFormDTO
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.18 10:17
**/
Result<List<ApplyingGroupResultDTO>> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO);
/**
* @Description 建组申请详情
* @Param AgreeApplyGroupFormDTO
* @return Result<ApplyingGroupResultDTO>
* @Author wangc
* @Date 2020.04.19 23:32
**/
Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(CommonGroupIdFromDTO groupId);
}

107
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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.form.UserRoleFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
@ -37,12 +38,14 @@ import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.dao.ResiGroupOperationDao;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.group.entity.ResiGroupOperationEntity;
import com.epmet.modules.group.redis.ResiGroupRedis;
import com.epmet.modules.group.service.ResiGroupOperationService;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.group.service.ResiGroupStatisticalService;
import com.epmet.modules.member.dao.GroupMemeberOperationDao;
import com.epmet.modules.member.dao.ResiGroupMemberDao;
import com.epmet.modules.member.redis.ResiGroupMemberRedis;
import com.epmet.modules.member.service.GroupMemeberOperationService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.utils.ModuleConstant;
@ -56,6 +59,7 @@ import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -103,6 +107,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupRedis resiGroupRedis;
@Autowired
private ResiGroupMemberRedis resiGroupMemberRedis;
@Override
public PageData<ResiGroupDTO> page(Map<String, Object> params) {
@ -457,21 +464,45 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
groupMemeberOperationDTO.setOperateUserId(agreeApplyGroupFormDTO.getUserId());
groupMemeberOperationService.update(groupMemeberOperationDTO);
//5、给用户发送消息???待定
//6、新增小组缓存信息
//6、新增小组缓存信息、组员缓存信息
Map<String, Object> param = new HashMap<>();
param.put("resiGroupId", resiGroupDTO.getId());
param.put(ModuleConstant.RESI_GROUP_ID_CAMEL, resiGroupDTO.getId());
param.put(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
List<ResiGroupStatisticalDTO> statisticalList = resiGroupStatisticalService.list(param);
if (null != statisticalList && statisticalList.size() > 0) {
ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO, statisticalList.get(0));
resiGroupRedis.set(groupRedis);
ResiGroupMemberInfoRedisDTO memberRedis = new ResiGroupMemberInfoRedisDTO();
memberRedis.setUserId(resiGroupMemberDTO.getCustomerUserId());
memberRedis.setGroupLeaderFlag("leader");
memberRedis.setEnterGroupType(resiGroupMemberDTO.getEnterGroupType());
memberRedis.setMemberStatus(resiGroupMemberDTO.getStatus());
memberRedis.setGroupId(resiGroupMemberDTO.getResiGroupId());
UserResiInfoFormDTO userParam = new UserResiInfoFormDTO();
userParam.setUserId(resiGroupMemberDTO.getCustomerUserId());
userParam.setCustomerId(resiGroupDTO.getCustomerId());
Result<UserResiInfoResultDTO> userInfo =
epmetUserFeignClient.getUserResiInfoDTO(userParam);
if(userInfo.success() && null != userInfo.getData()){
memberRedis.setUserShowName(userInfo.getData().getShowName());
memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto());
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
resiGroupMemberRedis.set(memberRedis);
} else {
//当没有查询到组统计信息时
UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO();
userRoleFormDTO.setApp("resi");
userRoleFormDTO.setCustomerId(resiGroupDTO.getCustomerId());
userRoleFormDTO.setUserId(agreeApplyGroupFormDTO.getUserId());
//userRoleFormDTO.setGridId
//epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO);
/*
当没有查询到组统计信息时,需要自己封装统计信息
@param UserRoleFormDTO::getApp
@param UserRoleFormDTO::getCustomerId
@param UserRoleFormDTO::getUserId
@param UserRoleFormDTO::getGridId
查询用户身份信息[热心居民/党员]
epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO);
*/
logger.warn(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO);
}
@ -589,4 +620,62 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
return targetObject;
}
/**
* @Description 查询待审核的小组 (不从缓存中取这时还没有成功建组缓存中没有组数据)
* @Param ApplyingGroupsFormDTO
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.18 10:18
**/
@Override
public Result<List<ApplyingGroupResultDTO>> getApplyingGroups(ApplyingGroupsFormDTO params){
if(null == params.getPageNo()){
throw new RenException(ModuleConstant.PAGE_INDEX_NOT_NULL);
}
params.setPageNo((params.getPageNo() - NumConstant.ONE) * params.getPageSize());
return new Result<List<ApplyingGroupResultDTO>>().ok(baseDao.getApplyingGroupsByCustIdAndGridId(params));
}
/**
* @Description 建组申请详情 已审核(更新已读未读标识)/未审核
* @Param AgreeApplyGroupFormDTO
* @return Result<ApplyingGroupResultDTO>
* @Author wangc
* @Date 2020.04.19 23:32
**/
@Override
public Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(CommonGroupIdFromDTO groupId){
//1.查询小组信息
//注意,这里查询出的组申请详情中,无论是已审核还是未审核,都是将该组信息关联到初始化组时状态为[待审核、审核通过、拒绝]其中之一的组操作记录上,并读取审核的已读未读信息,上述三种状态在一个组的所有操作记录当中只可能存在一种,与之后的屏蔽、取消屏蔽、关闭无关,如果查出多条说明建组的逻辑有问题
ApplyingGroupDetailResultDTO detail = baseDao.getApplyingGroupDetailByGroupId(groupId.getGroupId());
//2.查询用户信息(TODO 先走数据库,之后改成走缓存)
List<String> userId = new ArrayList<>();
userId.add(detail.getLeaderId());
Result<List<UserResiInfoResultDTO>> userInfoResult =
epmetUserFeignClient.getUserResiInfoList(new UserResiInfoListFormDTO(userId));
if(userInfoResult.success() && null != userInfoResult.getData() && userInfoResult.getData().size() >= 1){
detail.setGroupHeadPhoto(userInfoResult.getData().get(0).getHeadPhoto());
//姓氏+先生/女士 注:在数据库中拼接成[街道+显示名称]默认格式,故要进行截取
//detail.setGroupLeaderName(userInfoResult.getData().get(0).getShowName().split("-")[NumConstant.ONE]);
//姓氏+名称
detail.setGroupLeaderName(userInfoResult.getData().get(0).getSurname() + userInfoResult.getData().get(0).getName());
detail.setStreet(userInfoResult.getData().get(0).getStreet());
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
//3.未读改成已读
if(StringUtils.equals(detail.getReadFlag(),ModuleConstant.UNREAD)){
ResiGroupOperationEntity operationEntity = new ResiGroupOperationEntity();
operationEntity.setId(detail.getOperationId());
operationEntity.setReadFlag(ModuleConstant.READ);
operationEntity.setUpdatedBy(groupId.getUserId());
resiGroupOperationDao.updateById(operationEntity);
}
//4.将组长用户Id隐藏
detail.setLeaderId(null);
detail.setOperationId(null);
return new Result<ApplyingGroupDetailResultDTO>().ok(detail);
}
}

82
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java

@ -17,15 +17,26 @@
package com.epmet.modules.member.redis;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
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.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO;
import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -42,6 +53,17 @@ public class ResiGroupMemberRedis {
@Autowired
private RedisUtils redisUtils;
@Autowired
private ResiGroupMemberService memberService;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private ResiGroupService groupService;
private Logger logger = LoggerFactory.getLogger(getClass());
public void delete(Object[] ids) {
}
@ -70,14 +92,54 @@ public class ResiGroupMemberRedis {
* @Date 2020.04.13 23:36
**/
public ResiGroupMemberInfoRedisDTO get(String groupId ,String userId){
/*
Map<String, Object> map = redisUtils.hGetAll();
if (MapUtil.isEmpty(map)) {
return null;
ResiGroupMemberInfoRedisDTO memberCache =
(ResiGroupMemberInfoRedisDTO) redisUtils.get(RedisKeys.getResiGroupMemberInfoKey(groupId,userId));
//如果缓存中没有该成员数据
if(null == memberCache && StringUtils.isNotBlank(memberCache.getUserId())){
Map<String,Object> param = new HashMap<>();
param.put(TopicConstant.CUSTOMER_USER_ID,userId);
param.put(TopicConstant.RESI_GROUP_ID,groupId);
param.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR);
List<ResiGroupMemberDTO> memberList = memberService.list(param);
if(null != memberList && memberList.size() >= 1){
if(memberList.size() > 1) {
memberList.sort(Comparator.comparing(ResiGroupMemberDTO::getCreatedTime, Collections.reverseOrder()));
}
ResiGroupMemberDTO memberMySql = memberList.get(0);
ResiGroupMemberInfoRedisDTO memberRedis = ConvertUtils.sourceToTarget(memberMySql,ResiGroupMemberInfoRedisDTO.class);
memberRedis.setUserId(memberMySql.getCustomerUserId());
memberRedis.setGroupId(memberMySql.getResiGroupId());
memberRedis.setMemberStatus(memberMySql.getStatus());
UserResiInfoFormDTO userParam = new UserResiInfoFormDTO();
userParam.setUserId(memberMySql.getCustomerUserId());
userParam.setCustomerId(groupService.get(groupId).getCustomerId());
Result<UserResiInfoResultDTO> userInfo = epmetUserFeignClient.getUserResiInfoDTO(userParam);
if(userInfo.success()){
if(null != userInfo.getData()){
memberRedis.setUserShowName(userInfo.getData().getShowName());
memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto());
}
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
set(memberRedis);
return memberRedis;
}else{
//日志打印效果:找不到组员信息,组Id: ********,用户Id:********
logger.warn(ModuleConstant.GROUO_MEMBER_INFO_NOT_FOUND
.concat(ModuleConstant.GROUP_ID)
.concat(groupId)
.concat(ModuleConstant.USER_ID)
.concat(userId));
}
}
//map to bean
ResiGroupMemberInfoRedisDTO member = BeanUtil.mapToBean(map, ResiGroupMemberInfoRedisDTO.class, true);*/
return (ResiGroupMemberInfoRedisDTO) redisUtils.get(RedisKeys.getResiGroupMemberInfoKey(groupId,userId));
return memberCache;
}

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

@ -132,7 +132,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
QueryWrapper<ResiGroupMemberEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
return wrapper;
}
@ -176,6 +176,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
QueryWrapper<ResiGroupMemberEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(groupId), "RESI_GROUP_ID", groupId)
.eq(StringUtils.isNotBlank(userId), "CUSTOMER_USER_ID", userId);
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
List<ResiGroupMemberEntity> list = baseDao.selectList(wrapper);
if (null == list || list.size() == 0) {
return null;
@ -358,6 +359,8 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
//ResiGroupStatisticalInfoRedisDTO statisticalCache = groupCache.getGroupStatisticalInfo();
Map<String,Object> paramsMap = new HashMap<>();
paramsMap.put(TopicConstant.RESI_GROUP_ID,groupMemeberOperationDTO.getGroupId());
paramsMap.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR);
//不再进行计算,直接从数据库中拉取更新过的数据(在同一个事务中)
List<ResiGroupStatisticalDTO> statisticalDTO = resiGroupStatisticalService.list(paramsMap);
if(null != statisticalDTO && statisticalDTO.size() > 0){
ResiGroupStatisticalInfoRedisDTO statisticalObjct =

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

@ -98,7 +98,7 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
QueryWrapper<ResiTopicCommentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
return wrapper;
}

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

@ -138,6 +138,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ResiTopicEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
@ -235,6 +236,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//4.小组统计信息,话题数+1
QueryWrapper<ResiGroupStatisticalEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
wrapper.eq(TopicConstant.RESI_GROUP_ID,resiTopicPublishFormDTO.getGroupId());
List<ResiGroupStatisticalEntity> statistical = resiGroupStatisticalDao.selectList(wrapper);
if(null != statistical && statistical.size() >= NumConstant.ONE){
@ -524,6 +526,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
resultDTO.setTopicStatus(topicDetail.getStatus());
//2.查询话题附件
QueryWrapper<ResiTopicAttachmentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
wrapper.eq(TopicConstant.TOPIC_ID,topicId);
wrapper.orderByAsc(TopicConstant.SORT);
List<ResiTopicAttachmentEntity> attachments = resiTopicAttachmentDao.selectList(wrapper);
@ -818,6 +821,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
**/
private void updCacheGroupStatisticalInfo(String groupId,String operation,Integer quantity){
//ResiGroupRedis在get()时已经校验缓存中是否有数据,如果没有数据则从数据库中拉取并重新放入缓存
ResiGroupInfoRedisDTO groupCache =
resiGroupRedis.get(groupId);
if(groupCache != null && StringUtils.isNotBlank(groupCache.getGroupId())){
@ -835,13 +839,11 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
groupCache.setGroupStatisticalInfo(statisticalCache);
}else{
//没有相应的群组缓存信息 TODO 从数据库查找存进缓存
//没有相应的群组统计缓存信息
}
resiGroupRedis.set(groupCache);
}else{
//没有相应的群组缓存信息 TODO 从数据库查找存进缓存
//没有相应的群组缓存信息
}
}

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

@ -178,4 +178,44 @@ public interface ModuleConstant extends Constant {
* 避免重复加入群
* */
String ALREADY_APPLIED_GROUP="该群已申请过,请耐心等待审核";
/**
* 找不到组员信息
* */
String GROUO_MEMBER_INFO_NOT_FOUND = "找不到组员信息,";
/**
* 日志拼接信息
* */
String GROUP_ID = "组Id: ";
/**
* 日志拼接信息
* */
String USER_ID = ",用户Id: ";
/**
* 页码不能为空
* */
String PAGE_INDEX_NOT_NULL = "页码不能位空";
/**
* RESI_GROUP_ID驼峰
* */
String RESI_GROUP_ID_CAMEL = "resiGroupId";
/**
* APP 居民端
* */
String APP_RESI = "resi";
/**
* 审核信息未读
* */
String UNREAD = "unread";
/**
* 审核信息已读
* */
String READ = "read";
}

2
epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/db.sql

@ -4,4 +4,4 @@
ALTER TABLE resi_group_operation ADD (
READ_FLAG VARCHAR (8) DEFAULT NULL COMMENT '审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)',
MESSAGE_TEXT VARCHAR (500) DEFAULT NULL COMMENT '消息通知内容'
);
);

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

@ -215,4 +215,53 @@
rgo.UPDATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 查询审核中的组信息列表(分页),一条组数据可能对应多条组操作记录,所以要限制组数据和组操作数据当前都在'待审核'状态来锁定唯一的映射关系 -->
<select id="getApplyingGroupsByCustIdAndGridId" parameterType="com.epmet.resi.group.dto.group.form.ApplyingGroupsFormDTO" resultType="com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO">
SELECT
gro.ID AS groupId,
gro.GROUP_NAME AS groupName,
gro.GROUP_HEAD_PHOTO AS groupHeadPhoto,
oper.READ_FLAG AS readFlag,
oper.MESSAGE_TEXT AS messageText,
CASE
WHEN TO_DAYS(oper.CREATED_TIME) = TO_DAYS(NOW()) THEN DATE_FORMAT(oper.CREATED_TIME,'%k:%i')
ELSE DATE_FORMAT(oper.CREATED_TIME,'%Y-%d-%m %k:%i')
END
AS createdTime
FROM
RESI_GROUP gro
LEFT JOIN RESI_GROUP_OPERATION oper ON ( gro.ID = oper.RESI_GROUP_ID AND oper.DEL_FLAG = '0' )
WHERE
gro.DEL_FLAG = '0'
AND gro.CUSTOMER_ID = #{customerId}
AND gro.GRID_ID = #{gridId}
AND gro.STATE = 'under_auditting'
AND oper.STATE = 'under_auditting'
ORDER BY gro.CREATED_TIME DESC
LIMIT #{pageNo},#{pageSize}
</select>
<!-- 获取组审核信息详情,已审核/未审核通用,一条组数据可能对应多条组操作记录,所以要限制组操作数据当前在'待审核'、'通过'、'拒绝通过'这三种状态之中的某个状态来锁定唯一的映射关系,因为每条组数据所对应的组操作记录的上述三种状态只能存在一种 -->
<select id="getApplyingGroupDetailByGroupId" parameterType="java.lang.String" resultType="com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO">
SELECT
gro.ID AS groupId,
gro.GROUP_NAME AS groupName,
gro.GROUP_HEAD_PHOTO AS groupHeadPhoto,
oper.READ_FLAG AS readFlag,
oper.MESSAGE_TEXT AS messageText,
DATE_FORMAT(oper.CREATED_TIME,'%Y-%d-%m %k:%i') AS createdTime,
oper.STATE AS status,
oper.OPERATE_REASON rejectReason,
gro.CREATED_BY AS leaderId,
oper.READ_FLAG AS readFlag,
oper.ID AS operationId
FROM
RESI_GROUP gro
LEFT JOIN RESI_GROUP_OPERATION oper ON ( gro.ID = oper.RESI_GROUP_ID AND oper.DEL_FLAG = '0' )
WHERE
gro.DEL_FLAG = '0'
AND gro.ID = #{groupId}
AND oper.STATE IN ('under_auditting','approved','rejected')
</select>
</mapper>

5
epmet-module/resi-guide/resi-guide-server/pom.xml

@ -76,6 +76,11 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>
</dependencies>
<build>

1
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java

@ -101,6 +101,7 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
QueryWrapper<StrangerAccessRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
Calendar before3daysDate = Calendar.getInstance();
before3daysDate.setTime(new Date());
before3daysDate.add(Calendar.DATE, -3);

1
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

@ -172,6 +172,7 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio
QueryWrapper<UserCustomerEntity> wrapper = new QueryWrapper<>();
wrapper.eq(UserCustomerConstant.CUSTOMER_ID,enterGridFormDTO.getCustomerId());
wrapper.eq(UserCustomerConstant.USER_ID,enterGridFormDTO.getUserId());
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
//1.查找用户注册关系表,如果没有表示当前用户为陌生人(拉取用户微信表信息),如果有表示当前用户已经进行居民认证

Loading…
Cancel
Save