Browse Source

【灵山大屏】1.党组织,党建活动数量查询. 2.党组织树查询

master
wxz 2 years ago
parent
commit
bf48683ca1
  1. 15
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java
  2. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  3. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  4. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  5. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
  6. 9
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  7. 20
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  8. 15
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActTypeAndQtyResultDTO.java
  9. 17
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgCategoryResultDTO.java
  10. 60
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgTreeResultDTO.java
  11. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java
  12. 22
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  13. 65
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java
  14. 36
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java
  15. 130
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java
  16. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java
  17. 14
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml
  18. 44
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

15
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyOrgTypeEnum.java

@ -1,5 +1,7 @@
package com.epmet.commons.tools.enums;
import org.apache.commons.lang3.StringUtils;
public enum PartyOrgTypeEnum {
PROVINCIAL("0", "省委"),
@ -34,4 +36,17 @@ public enum PartyOrgTypeEnum {
public void setName(String name) {
this.name = name;
}
public static PartyOrgTypeEnum getEnumByCode(String code) {
if (StringUtils.isBlank(code)) {
return null;
}
for (PartyOrgTypeEnum en : PartyOrgTypeEnum.values()) {
if (en.getCode().equals(code)) {
return en;
}
}
return null;
}
}

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -348,4 +348,14 @@ public interface ResiGroupOpenFeignClient {
**/
@PostMapping("/resi/group/group/partygrouplist/{partyOrgId}")
Result<List<ResiGroupDTO>> partyGroupList(@PathVariable String partyOrgId);
/**
* @description: 使用行政组织查询党小组数量
* @param agencyId: 行政组织单位id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:33 PM
*/
@GetMapping("/resi/group/group/partyGroupQuantity/byAgencyId/{agencyId}")
Result<Integer> getPartyGroupQuantityByAgencyId(@PathVariable("agencyId") String agencyId);
}

4
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -253,4 +253,8 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "partyGroupList", partyOrgId);
}
@Override
public Result<Integer> getPartyGroupQuantityByAgencyId(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getPartyGroupQuantityByAgencyId", agencyId);
}
}

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

@ -674,5 +674,17 @@ public class ResiGroupController {
return new Result<List<ResiGroupDTO>>().ok(resiGroupService.partyGroupList(partyOrgId));
}
/**
* @description: 使用行政组织查询党小组数量
* @param agencyId: 行政组织单位id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:33 PM
*/
@GetMapping("partyGroupQuantity/byAgencyId/{agencyId}")
Result<Integer> getPartyGroupQuantityByAgencyId(@PathVariable("agencyId") String agencyId) {
return new Result<Integer>().ok(resiGroupService.getPartyGroupQuantityByAgencyId(agencyId));
}
}

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java

@ -98,4 +98,7 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
* 小组等级
*/
private Integer level;
private String agencyId;
private String pids;
}

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

@ -483,4 +483,13 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
Map<String, List<IcPartyOrgTreeDTO>> getBranchGroupList(String customerId);
List<ResiGroupDTO> partyGroupList(String partyOrgId);
/**
* @description: 使用行政组织查询党小组列表
* @param agencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:34 PM
*/
Integer getPartyGroupQuantityByAgencyId(String agencyId);
}

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

@ -30,6 +30,8 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
@ -37,10 +39,7 @@ 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;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.*;
@ -1994,4 +1993,17 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
return ConvertUtils.sourceToTarget(entityList, ResiGroupDTO.class);
}
@Override
public Integer getPartyGroupQuantityByAgencyId(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
"【查询党小组数量】查询组织信息失败:" + agencyId, "【查询党小组数量】查询组织信息失败");
}
LambdaQueryWrapper<ResiGroupEntity> query = new LambdaQueryWrapper<>();
query.eq(ResiGroupEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
query.eq(ResiGroupEntity::getPids, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids()));
return baseDao.selectCount(query);
}
}

15
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyActTypeAndQtyResultDTO.java

@ -0,0 +1,15 @@
package com.epmet.resi.partymember.dto.partymember.result;
import lombok.Data;
/**
* 灵山大屏党建活动和数量
*/
@Data
public class LingShanScreenPartyActTypeAndQtyResultDTO {
private String actTypeKey;
private String name;
private Integer value;
}

17
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgCategoryResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.resi.partymember.dto.partymember.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 灵山大屏党组织和数量dto
*/
@Data
public class LingShanScreenPartyOrgCategoryResultDTO {
private String partyOrgType;
private String name;
private Integer value;
}

60
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/LingShanScreenPartyOrgTreeResultDTO.java

@ -0,0 +1,60 @@
package com.epmet.resi.partymember.dto.partymember.result;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 灵山大屏-党组织树
*/
@Data
public class LingShanScreenPartyOrgTreeResultDTO {
// 中共青岛市即墨区委灵山街道工作委员会
private String title;
private List<PartyOrg> list;
private Integer num;
@Data
public static class PartyOrg {
private String id;
private String pid;
private String name;
private Integer num;
private Integer orgType;
/**
* 子级组织列表
*/
private List<PartyOrg> children = new ArrayList<>();
/**
* 党员列表
*/
private List<Partymember> list = new ArrayList<>();;
}
/**
* @description: 党员信息
*/
@Data
public static class Partymember {
private String name;
private String gender;
private String age;
private String phone;
private String orgname;
private String photo;
private String remarks;
private Integer workStatus;
private Integer isDby;
private Integer isLhdy;
private Integer worknumber;
private Integer workEvent;
}
}

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java

@ -11,6 +11,7 @@ import com.epmet.resi.partymember.dto.partyOrg.form.PartyActStatisFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyActListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.PartyActStatisResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -52,4 +53,13 @@ public interface IcPartyActDao extends BaseDao<IcPartyActEntity> {
List<IcPartyActEntity> selectNoPublishList(String dateId);
List<PartyActStatisResultDTO> getPartActStatis(PartyActStatisFormDTO formDTO);
/**
* @description: 党建活动类型和数量
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:12 PM
*/
List<LingShanScreenPartyActTypeAndQtyResultDTO> getPartyActTypeAndQuantity(@Param("customerId") String customerId,
@Param("orgIdPath") String orgIdPath);
}

22
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java

@ -9,6 +9,8 @@ import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDT
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.PartyOrgListResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -126,4 +128,24 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
* @date 2022/9/7 15:04
*/
void editPrincipal(EditPrincipalFormDTO formDTO);
/**
* @description: 灵山大屏,党建引领党组织和数量
* @param agencyId:
* @param agencyOrgIdPath:
* @return java.util.List<com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO>
* @author: WangXianZhang
* @date: 2023/4/14 11:15 AM
*/
List<LingShanScreenPartyOrgCategoryResultDTO> listPartyOrgCategoryAndQuantity(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("agencyOrgIdPath") String agencyOrgIdPath);
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> getPartyOrgsLteDangwei(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("orgIdpath") String orgIdpath);
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> getPartyOrgsOfBranch(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("orgIdpath") String orgIdpath);
}

65
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java

@ -0,0 +1,65 @@
package com.epmet.modules.partymember.controller;
import com.epmet.commons.tools.enums.PartyOrgTypeEnum;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partymember.service.LingShanScreenService;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("lingshanScreen")
@Slf4j
public class LingShanScreenController {
@Autowired
private LingShanScreenService lingShanScreenService;
/**
* @description: 党建引领党组织和数量
* @param agencyId: 当前组织id
* @return com.epmet.commons.tools.utils.Result
* @author: WangXianZhang
* @date: 2023/4/14 10:57 AM
*/
@GetMapping("partyOrgCategoryAndQuantity")
public Result<List<LingShanScreenPartyOrgCategoryResultDTO>> listPartyOrgCategoryAndQuantity(@RequestParam("agencyId") String agencyId) {
List<LingShanScreenPartyOrgCategoryResultDTO> l = lingShanScreenService.listPartyOrgCategoryAndQuantity(agencyId);
return new Result().ok(l);
}
/**
* @description: 党建活动类型和数量
* @param agencyId: 组织id
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO>>
* @author: WangXianZhang
* @date: 2023/4/14 12:03 PM
*/
@GetMapping("partyActTypeAndQuantity")
public Result<List<LingShanScreenPartyActTypeAndQtyResultDTO>> partyActTypeAndQuantity(@RequestParam("agencyId") String agencyId) {
List<LingShanScreenPartyActTypeAndQtyResultDTO> l = lingShanScreenService.partyActTypeAndQuantity(agencyId);
return new Result().ok(l);
}
/**
* @description: 党组织数(只到党支部没有小组)
* @param agencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 1:00 PM
*/
@GetMapping("partyOrgTree")
public Result<LingShanScreenPartyOrgTreeResultDTO> getPartyOrgTree(@RequestParam("agencyId") String agencyId) {
LingShanScreenPartyOrgTreeResultDTO l = lingShanScreenService.getPartyOrgTree(agencyId);
return new Result().ok(l);
}
}

36
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java

@ -0,0 +1,36 @@
package com.epmet.modules.partymember.service;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import java.util.List;
public interface LingShanScreenService {
/**
* @description: 党建引领党组织和数量
* @param agencyId: 组织id
* @return java.util.List<com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO>
* @author: WangXianZhang
* @date: 2023/4/14 11:02 AM
*/
List<LingShanScreenPartyOrgCategoryResultDTO> listPartyOrgCategoryAndQuantity(String agencyId);
/**
* @description: 党建活动类型和数量
* @param agencyId: 组织id
* @return
* @author: WangXianZhang
* @date: 2023/4/14 12:05 PM
*/
List<LingShanScreenPartyActTypeAndQtyResultDTO> partyActTypeAndQuantity(String agencyId);
/**
* @description:
* @param agencyId:
* @return
* @author: WangXianZhang
* @date: 2023/4/14 1:09 PM
*/
LingShanScreenPartyOrgTreeResultDTO getPartyOrgTree(String agencyId);
}

130
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java

@ -0,0 +1,130 @@
package com.epmet.modules.partymember.service.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.enums.PartyOrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.modules.partyOrg.dao.IcPartyActDao;
import com.epmet.modules.partyOrg.dao.IcPartyOrgDao;
import com.epmet.modules.partymember.service.LingShanScreenService;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class LingShanScreenServiceImpl implements LingShanScreenService, ResultDataResolver {
@Autowired
private IcPartyOrgDao icPartyOrgDao;
@Autowired
private IcPartyActDao partyActDao;
@Autowired
private ResiGroupOpenFeignClient groupOpenFeignClient;
@Override
public List<LingShanScreenPartyOrgCategoryResultDTO> listPartyOrgCategoryAndQuantity(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
// 1.查询党组织
List<LingShanScreenPartyOrgCategoryResultDTO> l = icPartyOrgDao
.listPartyOrgCategoryAndQuantity(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids()));
// 给组织类型名字赋值
l.forEach(i -> {
PartyOrgTypeEnum partyOrgTypeEnum = PartyOrgTypeEnum.getEnumByCode(i.getPartyOrgType());
if (partyOrgTypeEnum != null) {
i.setName(partyOrgTypeEnum.getName());
}
});
// 2.查询党小组
Integer groupQty = getResultDataOrReturnNull(groupOpenFeignClient.getPartyGroupQuantityByAgencyId(agencyId), ServiceConstant.RESI_GROUP_SERVER);
if (groupQty == null) {
logger.error("【灵山大屏】党建引领-查询党小组信息失败,agencyId:" + agencyId);
groupQty = 0;
}
LingShanScreenPartyOrgCategoryResultDTO gq = new LingShanScreenPartyOrgCategoryResultDTO();
gq.setName("党小组");
gq.setPartyOrgType(null);
gq.setValue(groupQty);
l.add(gq);
return l;
}
@Override
public List<LingShanScreenPartyActTypeAndQtyResultDTO> partyActTypeAndQuantity(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
return partyActDao.getPartyActTypeAndQuantity(EpmetRequestHolder.getLoginUserCustomerId(), PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids()));
}
@Override
public LingShanScreenPartyOrgTreeResultDTO getPartyOrgTree(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
String orgIdpath = PidUtils.convertPid2OrgIdPath(agencyId, agencyInfo.getPids());
// 1。查询组织
// 先查党委以上级别的,含党委
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> l = icPartyOrgDao.getPartyOrgsLteDangwei(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, orgIdpath);
// 再查党支部的。因为党委查询的时候使用pids和党支部的时候使用起来不一样,所以要分开
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> s = icPartyOrgDao.getPartyOrgsOfBranch(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, orgIdpath);
l.addAll(s);
// 2.组装树了开始
Map<String, LingShanScreenPartyOrgTreeResultDTO.PartyOrg> lMap = l.stream().collect(Collectors.toMap(e -> e.getId(), Function.identity()));
String parentPartyOrgId = null;
Integer maxLevel = 100;
// 将组织放入到父组织的children列表中
for (Iterator<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> it = l.iterator(); it.hasNext();) {
LingShanScreenPartyOrgTreeResultDTO.PartyOrg e = it.next();
LingShanScreenPartyOrgTreeResultDTO.PartyOrg pOrg = lMap.get(e.getPid());
if (maxLevel > e.getOrgType()) {
maxLevel = e.getOrgType();
parentPartyOrgId = e.getId();
}
if (pOrg != null) {
pOrg.getChildren().add(e);
it.remove();
}
}
LingShanScreenPartyOrgTreeResultDTO.PartyOrg parentOrg = lMap.get(parentPartyOrgId);
LingShanScreenPartyOrgTreeResultDTO r = new LingShanScreenPartyOrgTreeResultDTO();
r.setTitle(parentOrg.getName());
r.setNum(parentOrg.getNum());
r.setList(parentOrg.getChildren());
return r;
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java

@ -58,7 +58,6 @@ import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResul
import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO;
import info.debatty.java.stringsimilarity.Levenshtein;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -534,7 +533,6 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
}
@NotNull
private String getString(String result, double comparisonResult, double most, double small) {
if (comparisonResult == PartyMemberConstant.EQUALS) {
result = result + "11";

14
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

@ -268,4 +268,18 @@
ipao.join_org_id
</select>
<!--党建活动类型和数量-->
<select id="getPartyActTypeAndQuantity"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO">
select t.TYPE_KEY actTypeKey
, t.TYPE_NAME name
, count(*) as value
from ic_party_act a
inner join ic_party_act_type_dict t on (a.ACT_TYPE = t.TYPE_KEY and t.DEL_FLAG = 0)
where a.DEL_FLAG = 0
and a.CUSTOMER_ID = #{customerId}
and a.ORG_ID_PATH like CONCAT(#{orgIdPath}, '%')
group by t.TYPE_KEY
</select>
</mapper>

44
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

@ -249,4 +249,48 @@
ORDER BY org_pids ASC
</select>
<!--党建引领,党组织和数量。AGENCY_PIDS和AGENCY_ID双条件组合。agencyId的所有下级+agencyId的本级-->
<select id="listPartyOrgCategoryAndQuantity"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO">
select PARTY_ORG_TYPE partyOrgType, count(*) as 'value'
from ic_party_org
where CUSTOMER_ID=#{customerId}
and (AGENCY_PIDS like CONCAT(#{agencyOrgIdPath}, '%') or AGENCY_ID = #{agencyId})
and DEL_FLAG = 0
group by PARTY_ORG_TYPE
order by PARTY_ORG_TYPE asc
</select>
<!--获取党委以上组织列表-->
<select id="getPartyOrgsLteDangwei"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO$PartyOrg">
select org.ID id
, org.ORG_PID pid
, org.PARTY_ORG_TYPE org_type
, org.PARTY_ORG_NAME name
, count(mem.ID) num
from ic_party_org org
left join ic_party_member mem on (mem.DEL_FLAG = 0 and mem.ORG_PIDS like concat(org.ORG_PIDS, ':', org.ID, '%'))
where org.DEL_FLAG = 0
and org.PARTY_ORG_TYPE &lt;= '4'
and (org.AGENCY_ID = #{agencyId} or org.AGENCY_PIDS like CONCAT(#{orgIdpath}, '%'))
group by org.ID, org.PARTY_ORG_NAME
</select>
<!--获取支部列表-->
<select id="getPartyOrgsOfBranch"
resultType="com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO$PartyOrg">
select org.ID id
, org.ORG_PID pid
, org.PARTY_ORG_TYPE org_type
, org.PARTY_ORG_NAME name
, count(mem.ID) num
from ic_party_org org
left join ic_party_member mem on (mem.DEL_FLAG = 0 and mem.SSZB = org.ID)
where org.DEL_FLAG = 0
and org.PARTY_ORG_TYPE = '5'
and (org.AGENCY_ID = #{agencyId} or org.AGENCY_PIDS like CONCAT(#{orgIdpath}, '%'))
group by org.ID, org.PARTY_ORG_NAME
</select>
</mapper>

Loading…
Cancel
Save