Browse Source

【灵山-党建引领】1.新增:大屏中间,各党相关对象的数量统计。2:新增:党组织逐级点入,根据行政组织id查询下级党相关对象的名称,坐标,党员数量

master
wxz 2 years ago
parent
commit
d7fe8bedc2
  1. 17
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/LingShanPartyUnitRstDTO.java
  2. 25
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  3. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  4. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  5. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  6. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  7. 23
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanPartyServiceCenterQtyRstDTO.java
  8. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanScreenPartyObjectByTypeRstDTO.java
  9. 25
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  10. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  11. 38
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  12. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java
  13. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
  14. 54
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  15. 10
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyMemQtyStatsInOrgRstDTO.java
  16. 25
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyOrgAndOtherObjQtyRstDTO.java
  17. 19
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanScreenPartyObjectByTypeRstDTO.java
  18. 30
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/enums/LingShanPartyObjEnums.java
  19. 7
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  20. 16
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  21. 5
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java
  22. 13
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/LingShanPartyOrgService.java
  23. 189
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/LingShanPartyOrgServiceImpl.java
  24. 35
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java
  25. 26
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

17
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/LingShanPartyUnitRstDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
/**
* @Description 灵山联建单位
* @Author wangxianzhang
* @Time 2023/5/12 2:38 PM
*/
@Data
public class LingShanPartyUnitRstDTO {
private String orgName;
private String longitude;
private String latitude;
}

25
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -17,15 +17,13 @@ import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.CheckStaffInfoResultDTO;
import com.epmet.dto.result.LingShanPartyUnitRstDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -182,4 +180,23 @@ public interface EpmetHeartOpenFeignClient {
@PostMapping("/heart/userdemand/deleteByOriginId/{originId}/{origin}")
Result<Integer> deleteUserDemandByOriginId(@PathVariable("originId") String originId, @PathVariable("origin")String origin);
/**
* @Description: 组织下的联建单位数量
* @param agencyId: 组织id
* @Return void
* @Author: wangxianzhang
* @Date: 2023/5/12 10:22 AM
*/
@RequestMapping("/heart/icpartyunit/qtyInAgency")
Result<Integer> qtyInAgency(@RequestParam(value = "agencyId", required = false) String agencyId);
/**
* @Description: 灵山大屏联建单位列表
* @param orgId:
* @Return com.epmet.commons.tools.utils.Result
* @Author: wangxianzhang
* @Date: 2023/5/12 2:36 PM
*/
@GetMapping("/heart/icpartyunit/lingshan/partyUnitList")
Result<List<LingShanPartyUnitRstDTO>> lingshanPartyUnitList(@RequestParam(value = "orgId", required = false) String orgId);
}

11
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -18,6 +18,7 @@ import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.CheckStaffInfoResultDTO;
import com.epmet.dto.result.LingShanPartyUnitRstDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
@ -175,4 +176,14 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<Integer> deleteUserDemandByOriginId(String originId, String origin) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "deleteUserDemandByOriginId", originId,origin);
}
@Override
public Result<Integer> qtyInAgency(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "qtyInAgency", agencyId);
}
@Override
public Result<List<LingShanPartyUnitRstDTO>> lingshanPartyUnitList(String orgId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "lingshanPartyUnitList", orgId);
}
}

29
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -367,4 +367,33 @@ public class IcPartyUnitController implements ResultDataResolver {
}
}
}
/**
* @Description: 组织下的联建单位数量
* @param agencyId: 组织id
* @Return void
* @Author: wangxianzhang
* @Date: 2023/5/12 10:22 AM
*/
@RequestMapping("qtyInAgency")
public Result<Integer> qtyInAgency(@RequestParam(value = "agencyId", required = false) String agencyId) {
Integer q = icPartyUnitService.qtyInAgency(agencyId);
return new Result<Integer>().ok(q);
}
/**
* @Description: 灵山大屏联建单位列表
* @param orgId:
* @Return com.epmet.commons.tools.utils.Result
* @Author: wangxianzhang
* @Date: 2023/5/12 2:36 PM
*/
@GetMapping("lingshan/partyUnitList")
public Result<List<LingShanPartyUnitRstDTO>> lingshanScreenPartyUnitList(@RequestParam(value = "orgId", required = false) String orgId) {
List<LingShanPartyUnitRstDTO> l = icPartyUnitService.lingshanScreenPartyUnitList(orgId);
return new Result<List<LingShanPartyUnitRstDTO>>().ok(l);
}
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -8,10 +8,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.CheckStaffInfoResultDTO;
import com.epmet.dto.result.PartyTypepercentResultDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
@ -181,4 +178,8 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
* @param filePath
*/
void execAsyncExcelImport(Path filePath, String importTaskId,String customerId,String userId);
Integer qtyInAgency(String agencyId);
List<LingShanPartyUnitRstDTO> lingshanScreenPartyUnitList(String orgId);
}

29
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -41,10 +41,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
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.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.UserDemandConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPartyUnitDao;
@ -725,4 +722,28 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
}
return false;
}
@Override
public Integer qtyInAgency(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
String orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
LambdaQueryWrapper<IcPartyUnitEntity> q = new LambdaQueryWrapper<>();
q.and(q1 -> q1.eq(IcPartyUnitEntity::getAgencyId, agencyId).or(q2 -> q2.eq(IcPartyUnitEntity::getPids, orgIdPath)));
return baseDao.selectCount(q);
}
@Override
public List<LingShanPartyUnitRstDTO> lingshanScreenPartyUnitList(String orgId) {
LambdaQueryWrapper<IcPartyUnitEntity> q = new LambdaQueryWrapper<>();
q.eq(IcPartyUnitEntity::getAgencyId, orgId);
return baseDao.selectList(q).stream().map(e -> {
LingShanPartyUnitRstDTO d = new LingShanPartyUnitRstDTO();
d.setLatitude(e.getLatitude());
d.setLongitude(e.getLongitude());
d.setOrgName(e.getUnitName());
return d;
}).collect(Collectors.toList());
}
}

23
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanPartyServiceCenterQtyRstDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
@Data
public class LingShanPartyServiceCenterQtyRstDTO {
/**
* 名称
*/
// private String orgId;
/**
* 组织类型
*/
private String orgType;
/**
* 数量
*/
private Integer qty;
}

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanScreenPartyObjectByTypeRstDTO.java

@ -0,0 +1,12 @@
package com.epmet.dto.result;
import lombok.Data;
@Data
public class LingShanScreenPartyObjectByTypeRstDTO {
private String orgName;
private String longitude;
private String latitude;
}

25
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -757,4 +757,29 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/enterprise/sendEnterprisePatrolRemindMessage")
Result sendEnterprisePatrolRemindMessage();
/**
* @Description: 灵山:根据行政组织id查询组织下的党群服务中心/站的列表
* @param orgId: 组织id
* @param orgType: agency,grid
* @Return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.LingShanPartyServiceCenterQtyRstDTO>
* @Author: wangxianzhang
* @Date: 2023/5/12 9:23 AM
*/
@GetMapping("/gov/org/icpartyservicecenter/lingshan/partyServiceCenterQtyStats")
Result<List<LingShanPartyServiceCenterQtyRstDTO>> partyServiceCenterQtyStats(@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType);
/**
* @Description: 灵山党群服务中心站列表查询
* @param objType:
* @param orgId:
* @Return com.epmet.commons.tools.utils.Result
* @Author: wangxianzhang
* @Date: 2023/5/12 2:14 PM
*/
@GetMapping("/gov/org/icpartyservicecenter/lingshan/partyServiceCenterList")
Result<List<LingShanScreenPartyObjectByTypeRstDTO>> lingshanPartyServiceCenterList(
@RequestParam(value = "objType", required = false) String objType,
@RequestParam(value = "orgId", required = false) String orgId);
}

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -474,4 +474,13 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto);
}
@Override
public Result<List<LingShanPartyServiceCenterQtyRstDTO>> partyServiceCenterQtyStats(String orgId, String orgType) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "partyServiceCenterQtyStats", orgId, orgType);
}
@Override
public Result<List<LingShanScreenPartyObjectByTypeRstDTO>> lingshanPartyServiceCenterList(String objType, String orgId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "lingshanPartyServiceCenterList", objType, orgId);
}
}

38
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java

@ -30,10 +30,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.dto.result.*;
import com.epmet.excel.IcPartyServiceCenterExcel;
import com.epmet.service.IcPartyServiceCenterService;
import org.springframework.beans.factory.annotation.Autowired;
@ -249,4 +246,37 @@ public class IcPartyServiceCenterController {
return new Result<PartyServiceCenterListResultDTO>().ok(icPartyServiceCenterService.partyServiceCenterDetail(formDTO));
}
/**
* @Description: 根据行政组织id查询
* @param orgId: 组织id
* @param orgType: agency,grid
* @Return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.LingShanPartyServiceCenterQtyRstDTO>
* @Author: wangxianzhang
* @Date: 2023/5/12 9:23 AM
*/
@GetMapping("/lingshan/partyServiceCenterQtyStats")
public Result<List<LingShanPartyServiceCenterQtyRstDTO>> partyServiceCenterQtyStats(@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType) {
List<LingShanPartyServiceCenterQtyRstDTO> l = icPartyServiceCenterService.partyServiceCenterQtyStats(orgId, orgType);
return new Result<List<LingShanPartyServiceCenterQtyRstDTO>>().ok(l);
}
/**
* @Description: 灵山党群服务中心站列表查询
* @param objType:
* @param orgId:
* @Return com.epmet.commons.tools.utils.Result
* @Author: wangxianzhang
* @Date: 2023/5/12 2:14 PM
*/
@GetMapping("/lingshan/partyServiceCenterList")
public Result<List<LingShanPartyUnitRstDTO>> partyServiceCenterList(
@RequestParam(value = "objType", required = false) String objType,
@RequestParam(value = "orgId", required = false) String orgId) {
List<LingShanPartyUnitRstDTO> l = icPartyServiceCenterService.lingshanPartyServiceCenterList(objType, orgId);
return new Result<List<LingShanPartyUnitRstDTO>>().ok(l);
}
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java

@ -105,4 +105,8 @@ public class IcPartyServiceCenterEntity extends BaseEpmetEntity {
*/
private String address;
/**
* 某种组织类型的数量
*/
private transient int qtyOfType;
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java

@ -22,10 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcPartyServiceCenterEntity;
import java.util.List;
@ -192,4 +189,7 @@ public interface IcPartyServiceCenterService extends BaseService<IcPartyServiceC
*/
PartyServiceCenterListResultDTO partyServiceCenterDetail(PartyServiceCenterDetailFormDTO formDTO);
List<LingShanPartyServiceCenterQtyRstDTO> partyServiceCenterQtyStats(String orgId, String orgType);
List<LingShanPartyUnitRstDTO> lingshanPartyServiceCenterList(String objType, String orgId);
}

54
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -36,6 +36,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyServiceCenterConstant;
import com.epmet.dao.IcMatterAppointmentRecordDao;
@ -83,6 +84,8 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
private IcMatterAppointmentRecordDao matterAppointmentRecordDao;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
@Autowired
private IcPartyServiceCenterDao icPartyServiceCenterDao;
@Override
public PageData<IcPartyServiceCenterDTO> page(Map<String, Object> params) {
@ -748,4 +751,55 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
return simpleDateFormat.format(date);
}
@Override
public List<LingShanPartyServiceCenterQtyRstDTO> partyServiceCenterQtyStats(String orgId, String orgType) {
String orgIdPath;
if (PartyServiceCenterConstant.ORG_TYPE_AGENCY.equals(orgType)) {
// 是行政组织
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
} else {
// 是网格
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId);
orgIdPath = PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids());
}
LambdaQueryWrapper<IcPartyServiceCenterEntity> q = new QueryWrapper<IcPartyServiceCenterEntity>().select(" org_type, count(*) qtyOfType")
.lambda()
.and(c1 -> c1.eq(IcPartyServiceCenterEntity::getOrgId, orgId).or(c2 -> c2.eq(IcPartyServiceCenterEntity::getPids, orgIdPath)))
.groupBy(IcPartyServiceCenterEntity::getOrgType);
List<IcPartyServiceCenterEntity> l = icPartyServiceCenterDao.selectList(q);
return l.stream().map(e -> {
LingShanPartyServiceCenterQtyRstDTO r = new LingShanPartyServiceCenterQtyRstDTO();
r.setQty(e.getQtyOfType());
r.setOrgType(e.getOrgType());
return r;
}).collect(Collectors.toList());
}
@Override
public List<LingShanPartyUnitRstDTO> lingshanPartyServiceCenterList(String objType, String orgId) {
LambdaQueryWrapper<IcPartyServiceCenterEntity> q = new LambdaQueryWrapper<>();;
if (objType.equals("party_service_center")) {
// 党群服务中心
q.eq(IcPartyServiceCenterEntity::getOrgId, orgId);
q.eq(IcPartyServiceCenterEntity::getOrgType, "agency");
} else {
// 党群服务站
q.eq(IcPartyServiceCenterEntity::getOrgId, orgId);
q.eq(IcPartyServiceCenterEntity::getOrgType, "grid");
}
List<IcPartyServiceCenterEntity> es = icPartyServiceCenterDao.selectList(q);
return es.stream().map(e -> {
LingShanPartyUnitRstDTO d = new LingShanPartyUnitRstDTO();
d.setLatitude(e.getLatitude());
d.setLongitude(e.getLongitude());
d.setOrgName(e.getCenterName());
return d;
}).collect(Collectors.toList());
}
}

10
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyMemQtyStatsInOrgRstDTO.java

@ -0,0 +1,10 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
/**
* @Description 地图中的党员数量分布
* @Author wangxianzhang
* @Time 2023/5/12 3:25 PM
*/
public class LingShanPartyMemQtyStatsInOrgRstDTO {
private String name;
}

25
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyOrgAndOtherObjQtyRstDTO.java

@ -0,0 +1,25 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LingShanPartyOrgAndOtherObjQtyRstDTO {
/**
* 党建相关对象类型code
*/
private String partyObjectTypeCode;
/**
* 名称
*/
private String name;
/**
* 数量
*/
private Integer value;
}

19
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanScreenPartyObjectByTypeRstDTO.java

@ -0,0 +1,19 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import lombok.Data;
/**
* @Description 灵山街道按照党类型查询党相关对象
* @Author wangxianzhang
* @Time 2023/5/12 1:16 PM
*/
@Data
public class LingShanScreenPartyObjectByTypeRstDTO {
private String name;
private String longitude;
private String latitude;
private Integer partymemberQty;
}

30
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/enums/LingShanPartyObjEnums.java

@ -0,0 +1,30 @@
package com.epmet.resi.partymember.enums;
/**
* @Description 灵山党建相关对象枚举
* @Author wangxianzhang
* @Time 2023/5/12 1:26 PM
*/
public enum LingShanPartyObjEnums {
DW("dw", "党委"),
BRANCH("branch", "支部"),
PARTY_SERVICE_CENTER("party_service_center", "党群服务中心"),
PARTY_SERVICE_STATION("party_service_station", "党群服务站"),
PARTY_UNIT("party_unit", "联建单位");
private String code;
private String name;
LingShanPartyObjEnums(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

7
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -12,6 +12,13 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart-client</artifactId>
<version>
2.0.0
</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-partymember-client</artifactId>

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

@ -5,10 +5,7 @@ import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.EditPrincipalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
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.partyOrg.result.*;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -148,4 +145,15 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
List<LingShanScreenPartyOrgTreeResultDTO.PartyOrg> getPartyOrgsOfBranch(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("orgIdpath") String orgIdpath);
List<LingShanScreenPartyObjectByTypeRstDTO> lingshanListDw(@Param("orgIdPath") String orgIdPath);
/**
* @Description: 灵山直属支部
* @param orgId:
* @Return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO>
* @Author: wangxianzhang
* @Date: 2023/5/12 4:05 PM
*/
List<LingShanScreenPartyObjectByTypeRstDTO> lingshanListZsBranchs(@Param("orgId") String orgId);
}

5
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java

@ -93,4 +93,9 @@ public class IcPartyOrgEntity extends BaseEpmetEntity {
*/
private String introduction;
/**
* 子级数量
*/
private transient Integer childrenQty;
}

13
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/LingShanPartyOrgService.java

@ -0,0 +1,13 @@
package com.epmet.modules.partyOrg.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO;
import java.util.List;
public interface LingShanPartyOrgService {
List<LingShanPartyOrgAndOtherObjQtyRstDTO> partyOrgAndOtherObjectQtyStats(String agencyId);
List<LingShanScreenPartyObjectByTypeRstDTO> partyObjsByType(String objType, String orgId, String orgType);
}

189
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/LingShanPartyOrgServiceImpl.java

@ -0,0 +1,189 @@
package com.epmet.modules.partyOrg.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum;
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.ConvertUtils;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dto.result.LingShanPartyServiceCenterQtyRstDTO;
import com.epmet.dto.result.LingShanPartyUnitRstDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.partyOrg.dao.IcPartyOrgDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.modules.partyOrg.service.LingShanPartyOrgService;
import com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO;
import com.epmet.resi.partymember.enums.LingShanPartyObjEnums;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class LingShanPartyOrgServiceImpl implements LingShanPartyOrgService, ResultDataResolver {
@Autowired
private IcPartyOrgDao partyOrgDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetHeartOpenFeignClient heartOpenFeignClient;
@Override
public List<LingShanPartyOrgAndOtherObjQtyRstDTO> partyOrgAndOtherObjectQtyStats(String agencyId) {
ArrayList<LingShanPartyOrgAndOtherObjQtyRstDTO> tl = new ArrayList<>();
// 1.党组织
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
String orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
String level = agencyInfo.getLevel();
LambdaQueryWrapper<IcPartyOrgEntity> q;
if (OrgLevelEnum.COMMUNITY.getCode().equals(level)) {
// 社区级别,那直接用agencyId查,因为它下面就只有党支部一级了
q = new QueryWrapper<IcPartyOrgEntity>().select(" party_org_type, count(*) childrenQty").lambda()
// 本组织下级的所有子级
.eq(IcPartyOrgEntity::getAgencyId, agencyId)
.eq(IcPartyOrgEntity::getPartyOrgType, PartyOrgTypeEnum.BRANCH.getCode()) // 是社区,就只能查询支部了。这里要控制,因为支部的行政组织也是对应到社区,所以这里必须限制一下
.groupBy(IcPartyOrgEntity::getPartyOrgType);
} else {
// 街道及以上级别,用pids,因为要从社区开始查,本级及下级
q = new QueryWrapper<IcPartyOrgEntity>().select(" party_org_type, count(*) childrenQty").lambda()
// 本组织下级的所有子级,不含本级
.like(IcPartyOrgEntity::getAgencyPids, orgIdPath)
.groupBy(IcPartyOrgEntity::getPartyOrgType);
}
List<IcPartyOrgEntity> es = partyOrgDao.selectList(q);
List<LingShanPartyOrgAndOtherObjQtyRstDTO> l1 = es.stream().map(e -> {
LingShanPartyOrgAndOtherObjQtyRstDTO d = new LingShanPartyOrgAndOtherObjQtyRstDTO();
d.setPartyObjectTypeCode(e.getPartyOrgType().equals("5") ? LingShanPartyObjEnums.BRANCH.getCode() : LingShanPartyObjEnums.DW.getCode());
d.setName(PartyOrgTypeEnum.getEnumByCode(e.getPartyOrgType()).getName());
d.setValue(e.getChildrenQty());
return d;
}).collect(Collectors.toList());
tl.addAll(l1);
// 2.党群服务中心/站
List<LingShanPartyServiceCenterQtyRstDTO> serviceCenters = getResultDataOrReturnNull(govOrgOpenFeignClient.partyServiceCenterQtyStats(agencyId, OrgInfoConstant.AGENCY), ServiceConstant.GOV_ORG_SERVER);
if (serviceCenters == null) {
logger.error("【灵山大屏-党组织数量统计】查询党群服务中心失败,返回空");
} else {
List<LingShanPartyOrgAndOtherObjQtyRstDTO> temp = serviceCenters.stream().map(e -> {
LingShanPartyOrgAndOtherObjQtyRstDTO d = new LingShanPartyOrgAndOtherObjQtyRstDTO();
d.setPartyObjectTypeCode(e.getOrgType().equals(OrgInfoConstant.AGENCY) ? LingShanPartyObjEnums.PARTY_SERVICE_CENTER.getCode() : LingShanPartyObjEnums.PARTY_SERVICE_STATION.getCode());
d.setName(e.getOrgType().equals(OrgInfoConstant.AGENCY) ? "党群服务中心" : "党群服务站");
d.setValue(e.getQty());
return d;
}).collect(Collectors.toList());
temp.addAll(temp);
}
// 3.联建单位
Integer partyUnitQty = getResultDataOrReturnNull(heartOpenFeignClient.qtyInAgency(agencyId), ServiceConstant.EPMET_HEART_SERVER);
tl.add(new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.PARTY_UNIT.getCode(), "联建单位", partyUnitQty));
// 4.检查缺项(党委, 支部, 党群服务中心, 党群服务站, 联建单位几项都要有,没有数据则显示0。党代表工作室目前还没开发,开发了也要有)
Map<String, LingShanPartyOrgAndOtherObjQtyRstDTO> map = tl.stream().collect(Collectors.toMap(LingShanPartyOrgAndOtherObjQtyRstDTO::getName, Function.identity()));
LinkedList rl = new LinkedList<LingShanPartyOrgAndOtherObjQtyRstDTO>();
LingShanPartyOrgAndOtherObjQtyRstDTO dw = map.get("党委");
rl.add(dw != null ? dw : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.DW.getCode(), "党委", 0));
LingShanPartyOrgAndOtherObjQtyRstDTO zb = map.get("支部");
rl.add(zb != null ? zb : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.BRANCH.getCode(), "支部", 0));
LingShanPartyOrgAndOtherObjQtyRstDTO dqfwzx = map.get("党群服务中心");
rl.add(dqfwzx != null ? dqfwzx : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.PARTY_SERVICE_CENTER.getCode(), "党群服务中心", 0));
LingShanPartyOrgAndOtherObjQtyRstDTO dqfwz = map.get("党群服务站");
rl.add(dqfwz != null ? dqfwz : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.PARTY_SERVICE_STATION.getCode(), "党群服务站", 0));
LingShanPartyOrgAndOtherObjQtyRstDTO ljdz = map.get("联建单位");
rl.add(ljdz != null ? ljdz : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.PARTY_UNIT.getCode(), "联建单位", 0));
return rl;
}
@Override
public List<LingShanScreenPartyObjectByTypeRstDTO> partyObjsByType(String objType, String orgId, String orgType) {
if (LingShanPartyObjEnums.DW.getCode().equals(objType)) {
// 党委
return listDw(orgId, orgType);
} else if (LingShanPartyObjEnums.BRANCH.getCode().equals(objType)) {
// 支部
return listBranch(orgId, orgType);
} else if (LingShanPartyObjEnums.PARTY_SERVICE_CENTER.getCode().equals(objType)
|| LingShanPartyObjEnums.PARTY_SERVICE_STATION.getCode().equals(objType)) {
// 党群服务中心
List<com.epmet.dto.result.LingShanScreenPartyObjectByTypeRstDTO> rsts =
getResultDataOrReturnNull(govOrgOpenFeignClient.lingshanPartyServiceCenterList(objType, orgId), ServiceConstant.GOV_ORG_SERVER);
return ConvertUtils.sourceToTarget(rsts, LingShanScreenPartyObjectByTypeRstDTO.class);
} else if (LingShanPartyObjEnums.PARTY_UNIT.getCode().equals(objType)) {
// 联建单位
List<LingShanPartyUnitRstDTO> rsts = getResultDataOrReturnNull(heartOpenFeignClient.lingshanPartyUnitList(orgId), ServiceConstant.EPMET_HEART_SERVER);
if (rsts == null) {
logger.error("【灵山大屏-党建相关对象列表查询】出错,");
}
return ConvertUtils.sourceToTarget(rsts, LingShanScreenPartyObjectByTypeRstDTO.class);
} else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "未知的数据类型");
}
}
/**
* @Description: 查询党委列表
* @param orgId:
* @param orgType:
* @Return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO>
* @Author: wangxianzhang
* @Date: 2023/5/12 1:42 PM
*/
List<LingShanScreenPartyObjectByTypeRstDTO> listDw(String orgId, String orgType) {
if (OrgInfoConstant.AGENCY.equals(orgType)) {
// 是行政组织,就要查询组织的下一级。查询下一级只能用AGENCY_PIDS
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
return partyOrgDao.lingshanListDw(PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()));
} else {
// 是网格,哪里来的党委?
return new ArrayList<>();
}
}
/**
* @Description: 查询支部支部是直属的
* @param orgId:
* @param orgType:
* @Return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO>
* @Author: wangxianzhang
* @Date: 2023/5/12 1:52 PM
*/
List<LingShanScreenPartyObjectByTypeRstDTO> listBranch(String orgId, String orgType) {
if (OrgInfoConstant.AGENCY.equals(orgType)) {
// 是行政组织
// AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
return partyOrgDao.lingshanListZsBranchs(orgId);
} else {
// 是网格
// 这里应该是有问题。因为查询支部,只能用社区id查,不能用网格id查,party_org里面没有网格相关字段去关联
return new ArrayList<>();
}
}
}

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

@ -5,7 +5,10 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partyOrg.service.LingShanPartyOrgService;
import com.epmet.modules.partymember.service.LingShanScreenService;
import com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActQtyStatsResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO;
import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO;
@ -28,6 +31,9 @@ public class LingShanScreenController {
@Autowired
private LingShanScreenService lingShanScreenService;
@Autowired
private LingShanPartyOrgService lingShanPartyOrgService;
/**
* @description: 党建引领党组织和数量
* @param agencyId: 当前组织id
@ -117,4 +123,33 @@ public class LingShanScreenController {
return new Result<Integer>().ok(lingShanScreenService.getPartymemberQtyOfOrg(agencyId));
}
/**
* @Description: 灵山党组织以及其他党相关对象(党群服务中心站等)的数量统计,供选择
* @param :
* @Return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO>>
* @Author: wangxianzhang
* @Date: 2023/5/11 3:45 PM
*/
@GetMapping("partyOrgAndOtherObjectQtyStats")
public Result<List<LingShanPartyOrgAndOtherObjQtyRstDTO>> partyOrgAndOtherObjectQtyStats(@RequestParam(value = "agencyId", required = true) String agencyId) {
List<LingShanPartyOrgAndOtherObjQtyRstDTO> l = lingShanPartyOrgService.partyOrgAndOtherObjectQtyStats(agencyId);
return new Result<List<LingShanPartyOrgAndOtherObjQtyRstDTO>>().ok(l);
}
/**
* @Description: 灵山街道按照党类型查询党相关对象
* @param :
* @Return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO>>
* @Author: wangxianzhang
* @Date: 2023/5/12 1:18 PM
*/
@GetMapping("partyObjsByType")
public Result<List<LingShanScreenPartyObjectByTypeRstDTO>> partyObjsByType(@RequestParam(value = "objType", required = false) String objType,
@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType) {
List<LingShanScreenPartyObjectByTypeRstDTO> l = lingShanPartyOrgService.partyObjsByType(objType, orgId, orgType);
return new Result<List<LingShanScreenPartyObjectByTypeRstDTO>>().ok(l);
}
}

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

@ -293,4 +293,30 @@
group by org.ID, org.PARTY_ORG_NAME
</select>
<!-- 灵山:省委~党委党组织+党员数量列表 -->
<select id="lingshanListDw"
resultType="com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO">
select
o.ID, o.PARTY_ORG_NAME name, o.LATITUDE, o.LONGITUDE, count(*) partymember_qty
from ic_party_org o
left join ic_party_member m on (o.AGENCY_ID = m.AGENCY_ID and m.DEL_FLAG = 0)
where o.DEL_FLAG = 0
and o.AGENCY_PIDS = #{orgIdPath}
and o.PARTY_ORG_TYPE &lt;= 4
group by o.ID, o.PARTY_ORG_NAME, o.LATITUDE, o.LONGITUDE
</select>
<!--直属支部-->
<select id="lingshanListZsBranchs"
resultType="com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO">
select
o.ID, o.PARTY_ORG_NAME name, o.LATITUDE, o.LONGITUDE, count(*) partymember_qty
from ic_party_org o
left join ic_party_member m on (o.ID = m.SSZB and m.DEL_FLAG = 0)
where o.DEL_FLAG = 0
and o.AGENCY_ID = #{orgId}
and o.PARTY_ORG_TYPE = 5
group by o.ID, o.PARTY_ORG_NAME, o.LATITUDE, o.LONGITUDE
</select>
</mapper>

Loading…
Cancel
Save