Browse Source

添加 本网格的小组和小组管理界面信息

dev_shibei_match
zhaoqifeng 5 years ago
parent
commit
dfa93ecb9e
  1. 28
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java
  2. 21
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java
  3. 13
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java
  4. 19
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiGroupService.java
  5. 13
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiGroupServiceImpl.java
  6. 19
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java
  7. 43
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GovGroupSummarizeResultDTO.java
  8. 41
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupsInGridResultDTO.java
  9. 23
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  10. 7
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  11. 25
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  12. 47
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  13. 12
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

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

@ -1,8 +1,12 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import com.epmet.service.ResiGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -33,4 +37,28 @@ public class ResiGroupController {
public Result<List<GroupAuditedResultDTO>> audited(@RequestBody GroupAuditedFromDTO formDTO) {
return resiGroupService.audited(formDTO);
}
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
@PostMapping("groupsingrid")
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.getGroupsInGrid(formDTO);
}
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
@PostMapping("getgroupsummarize")
public Result<GovGroupSummarizeResultDTO> getGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.getGroupSummarize(formDTO);
}
}

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

@ -3,8 +3,11 @@ 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.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@ -25,4 +28,22 @@ public interface ResiGroupFeignClient {
*/
@PostMapping("/resi/group/group/audited")
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
@PostMapping("/resi/group/group/groupsingrid")
Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO);
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
@PostMapping("/resi/group/group/getgovgroupsummarize")
Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO);
}

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

@ -4,8 +4,11 @@ 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.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import org.springframework.stereotype.Component;
import java.util.List;
@ -21,4 +24,14 @@ public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient {
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "audited", formDTO);
}
@Override
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getGroupsInGrid", formDTO);
}
@Override
public Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getGovGroupSummarize", formDTO);
}
}

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

@ -1,8 +1,11 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import java.util.List;
@ -19,4 +22,20 @@ public interface ResiGroupService {
* @return Result<List<GroupAuditedResultDTO>>
*/
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List<GroupsInGridResultDTO>>
*/
Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO);
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
Result<GovGroupSummarizeResultDTO> getGroupSummarize(GovGroupSummarizeFromDTO formDTO);
}

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

@ -2,8 +2,11 @@ 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.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import com.epmet.service.ResiGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,4 +27,14 @@ public class ResiGroupServiceImpl implements ResiGroupService{
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
return resiGroupFeignClient.audited(formDTO);
}
@Override
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
return resiGroupFeignClient.getGroupsInGrid(formDTO);
}
@Override
public Result<GovGroupSummarizeResultDTO> getGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
return resiGroupFeignClient.getGovGroupSummarize(formDTO);
}
}

19
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java

@ -0,0 +1,19 @@
package com.epmet.resi.group.dto.group.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/20 9:30
*/
@Data
public class GovGroupSummarizeFromDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 小组id
*/
private String groupId;
}

43
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GovGroupSummarizeResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/20 9:24
*/
@Data
public class GovGroupSummarizeResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组id
*/
private String groupId;
/**
* 组头像
*/
private String groupHeadPhoto;
/**
* 组名
*/
private String groupName;
/**
* 成员总数
*/
private Integer totalMember;
/**
* 组长名称
*/
private String leaderName;
/**
* 组介绍
*/
private String groupIntroduction;
/**
* 话题总数
*/
private Integer totalTopics;
}

41
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupsInGridResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/17 15:53
*/
@NoArgsConstructor
@Data
public class GroupsInGridResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 小组id
*/
private String groupId;
/**
* 小组名称
*/
private String groupName;
/**
* 小组头像
*/
private String groupHeadPhoto;
/**
* 成员总数
*/
private Integer totalMember;
/**
* 党员总数
*/
private Integer totalPartyMember;
/**
* 当前状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
*/
private String status;
}

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

@ -230,4 +230,27 @@ public class ResiGroupController {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.audited(formDTO);
}
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
@PostMapping("groupsingrid")
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.getGroupsInGrid(formDTO);
}
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
@PostMapping("getgovgroupsummarize")
public Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
return resiGroupService.getGovGroupSummarize(formDTO);
}
}

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

@ -113,4 +113,11 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @return
*/
List<GroupAuditedResultDTO> selectAuditedGroupList(GroupAuditedFromDTO formDTO);
/**
* 查询网格小组列表
* @param formDTO
* @return
*/
List<ResiGroupEntity> selectGroupsByGridId(GroupAuditedFromDTO formDTO);
}

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

@ -173,8 +173,8 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
Result initApplyCreatedGroup(InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO);
/**
* @return com.epmet.commons.tools.utils.Result
* @param agreeApplyGroupFormDTO
* @return com.epmet.commons.tools.utils.Result
* @Author yinzuomei
* @Description 审核(同意)群申请-测试用后面会放到政府端
* @Date 2020/3/31 12:44
@ -182,8 +182,8 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
Result agreeApplyGroup(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO);
/**
* @return com.epmet.commons.tools.utils.Result
* @param disAgreeApplyGroupFormDTO
* @return com.epmet.commons.tools.utils.Result
* @Author yinzuomei
* @Description 审核拒绝群申请-测试用后面会放到政府端
* @Date 2020/3/31 13:22
@ -191,11 +191,11 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
Result disagreeApplyGroup(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO);
/**
* @return com.epmet.resi.group.dto.UserRoleDTO
* @param app
* @param userId
* @param customerId
* @param gridId
* @return com.epmet.resi.group.dto.UserRoleDTO
* @Author yinzuomei
* @Description 判断用户当前角色
* @Date 2020/4/1 0:00
@ -204,8 +204,25 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
/**
* 小组审核历史列表
*
* @param formDTO 参数
* @return Result<List<GroupAuditedResultDTO>>
* @return Result<List < GroupAuditedResultDTO>>
*/
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List<GroupsInGridResultDTO>>
*/
Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO);
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO);
}

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

@ -17,6 +17,7 @@
package com.epmet.modules.group.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -563,6 +564,52 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
return result.ok(resultList);
}
@Override
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
List<GroupsInGridResultDTO> resultList = new ArrayList<>();
//查询条件
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
List<ResiGroupEntity> list = baseDao.selectGroupsByGridId(formDTO);
list.forEach(i -> {
//缓存中获取组信息
ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(i.getId());
GroupsInGridResultDTO groupsInGridResultDTO = new GroupsInGridResultDTO();
groupsInGridResultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId());
groupsInGridResultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName());
groupsInGridResultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto());
groupsInGridResultDTO.setStatus(resiGroupInfoRedisDTO.getGroupState());
groupsInGridResultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers());
groupsInGridResultDTO.setTotalPartyMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalPartyMembers());
resultList.add(groupsInGridResultDTO);
});
return new Result<List<GroupsInGridResultDTO>>().ok(resultList);
}
@Override
public Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
GovGroupSummarizeResultDTO resultDTO = new GovGroupSummarizeResultDTO();
//从缓存中获取组相关信息
ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(formDTO.getGroupId());
resultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId());
resultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto());
resultDTO.setGroupIntroduction(resiGroupInfoRedisDTO.getGroupIntroduction());
resultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName());
resultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers());
resultDTO.setTotalTopics(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalTopics());
//获取组长信息
Result<UserResiInfoResultDTO> groupLeaderUserInfo = this.getGroupLeaderUserInfo(formDTO.getGroupId());
if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) {
resultDTO.setLeaderName(groupLeaderUserInfo.getData().getShowName());
} else {
logger.info("组长注册信息查询失败" + groupLeaderUserInfo.getMsg());
}
return new Result<GovGroupSummarizeResultDTO>().ok(resultDTO);
}
/**
* @return ResiGroupInfoRedisDTO
* @Description 将ResiGroupDTO与ResiGroupStatisticalDTO转换成ResiGroupInfoRedisDTO

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

@ -215,4 +215,16 @@
rgo.UPDATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectGroupsByGridId" resultType="com.epmet.modules.group.entity.ResiGroupEntity">
SELECT
*
FROM
resi_group
WHERE CUSTOMER_ID = #{customerId}
AND GRID_ID = #{gridId}
AND DEL_FLAG = '0'
ORDER BY
UPDATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
</mapper>

Loading…
Cancel
Save