Browse Source

Merge remote-tracking branch 'origin/lingshan_master' into lingshan_master

master
yinzuomei 2 years ago
parent
commit
8e131a01b1
  1. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java
  2. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java
  3. 11
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java
  4. 1
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java
  5. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  6. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
  7. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
  8. 43
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  9. 124
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  10. 3
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/result/IcPartyActPageResultDTO.java
  11. 1
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanScreenPartyObjectByTypeRstDTO.java
  12. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  13. 7
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  14. 14
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/LingShanPartyOrgServiceImpl.java
  15. 11
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java
  16. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/LingShanScreenService.java
  17. 47
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/LingShanScreenServiceImpl.java
  18. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml
  19. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml
  20. 35
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/DataSyncRecordMaritalPageFormDTO.java
  21. 72
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DataSyncRecordMaritalPageResultDTO.java
  22. 68
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordMaritalController.java
  23. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordMaritalDao.java
  24. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  25. 64
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordMaritalExcel.java
  26. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java
  27. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordMaritalService.java
  28. 175
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java
  29. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordMaritalServiceImpl.java
  30. 62
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java
  31. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java
  32. 30
      epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordMaritalDao.xml
  33. 32
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java

@ -42,7 +42,9 @@ public class ResiMyCreatedAgentServiceResultDTO {
private String processStatusName;
private Integer satisfaction;
private Integer satisfication;
private String satisficationName;
private List<String> attachments;
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java

@ -122,6 +122,17 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ
log.error("【红色待办】居民-我创建的列表:未找到服务类别数据:{}", e.getServiceCategory());
}
// 满意度中文
if (e.getSatisfication() != null) {
if (e.getSatisfication().intValue() == -1) {
d.setSatisficationName("不满意");
} else if (e.getSatisfication().intValue() == 0) {
d.setSatisficationName("基本满意");
} else if (e.getSatisfication().intValue() == 1) {
d.setSatisficationName("非常满意");
}
}
// 反序列化附件列表
d.setAttachments(JSON.parseArray(e.getAttachments(), String.class));

11
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java

@ -4,6 +4,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -67,6 +68,16 @@ public class IcEventDTO implements Serializable {
*/
private String sourceType;
/**
* 响应级别
*/
private String eventType;
/**
* 二类分类Id
*/
private List<String> categoryList;
/**
* 发生时间
*/

1
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java

@ -22,5 +22,6 @@ public class IcEventResultDTO {
private String mobile;
private String address;
private String happenTime;
private String imgUrl;
}

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java

@ -657,9 +657,11 @@ public class IcEventController {
@GetMapping("getEventListByManageStatus")
public Result<List<IcEventResultDTO>> getEventListByTypeOrStatus(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType,
@RequestParam("eventType") String eventType,
@RequestParam("sourceType") String sourceType,
@RequestParam("status") String status) {
return new Result<List<IcEventResultDTO>>().ok(icEventService.getListByStatus(orgId, orgType, sourceType, status));
@RequestParam("status") String status,
@RequestParam("categoryCode") String categoryCode) {
return new Result<List<IcEventResultDTO>>().ok(icEventService.getListByStatus(orgId, orgType, eventType, sourceType, status, categoryCode));
}

11
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java

@ -205,15 +205,18 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
* 处理中 只要包含一条阅收数据即为处理中
* 已结案 只要包含一条完结数据即为已结案
* 已归档 只要包含一条归档数据即为已归档
* manageType: 0上报 1阅收 3完结 4审核 5事件评价 6结案归档
* manageType: 0上报 1阅收 2完结 3审核 4事件评价 5结案归档
*/
Integer getEventByReplyTypeCount(@Param("orgIdPath") String orgPath,
@Param("sourceType") String sourceType,
@Param("manageType") String manageType);
List<IcEventResultDTO> getListByStatus(@Param("orgIdPath") String orgPath, @Param("sourceType") String sourceType, @Param("status") String status);
List<IcEventResultDTO> getListByStatus(@Param("orgIdPath") String orgPath, @Param("eventType") String eventType,
@Param("sourceType") String sourceType, @Param("status") String status,
@Param("categoryCode") String categoryCode);
List<IcEventResultDTO> getListBySourceTypeOrEventType(@Param("orgIdPath") String orgPath, @Param("sourceType") String sourceType, @Param("eventType") String eventType);
List<IcEventResultDTO> getListBySourceTypeOrEventType(@Param("orgIdPath") String orgPath,
@Param("sourceType") String sourceType, @Param("eventType") String eventType);
List<GridOrVillageEventRateResultDTO> getEventRateByGridIds(@Param("orgIds") List<String> orgIds);
GridOrVillageEventRateResultDTO getEventRateByGridIds(@Param("orgId") String orgId);
}

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java

@ -282,7 +282,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
* @param status 事件处理状态
* @return
*/
List<IcEventResultDTO> getListByStatus(String orgId, String orgType, String sourceType, String status);
List<IcEventResultDTO> getListByStatus(String orgId, String orgType, String eventType,String sourceType, String status,String categoryCode);
List<IcEventResultDTO> getListBySourceTypeOrEventType(String orgId, String orgType, String sourceType, String eventType);
}

43
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -1977,9 +1977,9 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
* 处理中 只要包含一条阅收数据即为处理中(可能包含多条)
* 已结案 只要包含一条完结数据即为已结案(应该只有一条)
* 已归档 只要包含一条归档数据即为已归档(应该只有一条)
* 0上报 1阅收 3完结 6结案归档
* manageType: 0上报 1阅收 2完结 3审核 4事件评价 5结案归档
*/
for (int i = 0; i < 5; i++) {
for (int i = 0; i < 4; i++) {
Integer temp;
if (i == 0) {
temp = baseDao.getEventByReplyTypeCount(orgPath, eventType, String.valueOf(i));
@ -1992,12 +1992,11 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
dto.setChuLiZhongRate(new BigDecimal((double) temp / total).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}
if (i == 2) {
i = i + 1;
temp = baseDao.getEventByReplyTypeCount(orgPath, eventType, String.valueOf(i));
dto.setYiJieAn(temp);
dto.setYiJieAnRate(new BigDecimal((double) temp / total).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}
if (i == 4) {
if (i == 3) {
i = i + 2;
temp = baseDao.getEventByReplyTypeCount(orgPath, eventType, String.valueOf(i));
dto.setGuiDang(temp);
@ -2012,45 +2011,29 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
List<GridOrVillageEventRateResultDTO> dtoList = new ArrayList<>();
if (StringUtils.isNotEmpty(agencyId)) {
List<IcEventAnalysisOrgResDTO> orgs = getSubOrgs(agencyId);
if (null != orgs && orgs.size() > 0) {
if (null != orgs && orgs.size() > 0) {//获取所有的新村,根据新村的agencyId 查询事件,统计事件的各类完成情况;
Map<String, String> namesMap = new HashMap<>();
for (IcEventAnalysisOrgResDTO org : orgs) {
namesMap.put(org.getOrgId(), org.getOrgName());
}
List<String> ids = orgs.stream().map(IcEventAnalysisOrgResDTO::getOrgId).collect(Collectors.toList());
List<GridOrVillageEventRateResultDTO> resultList = baseDao.getEventRateByGridIds(ids);
if(null != resultList && resultList.size()> 0){
for (GridOrVillageEventRateResultDTO dto : resultList) {
if (null != dto) {
dto.setAgencyName(namesMap.get(dto.getOrgId()));
dto.setRate(dto.getRate() == null ? 0 : dto.getRate());
dtoList.add(dto);
} else {
dto.setAgencyName(namesMap.get(dto.getOrgId()));
dto.setRate(0.00);
dto.setTotal(0);
dtoList.add(dto);
}
for (String id : ids) {
GridOrVillageEventRateResultDTO resultDto = baseDao.getEventRateByGridIds(id);
if (null != resultDto) {
resultDto.setAgencyName(namesMap.get(id));
resultDto.setOrgId(id);
resultDto.setRate(resultDto.getRate() == null ? 0 : resultDto.getRate());
dtoList.add(resultDto);
}
}else {
namesMap.keySet().forEach(key->{
GridOrVillageEventRateResultDTO dto = new GridOrVillageEventRateResultDTO();
dto.setOrgId(key);
dto.setAgencyName(namesMap.get(key));
dto.setRate(0.00);
dto.setTotal(0);
dtoList.add(dto);
});
}
}
}
return dtoList;
}
@Override
public List<IcEventResultDTO> getListByStatus(String orgId, String orgType, String sourceType, String status) {
return baseDao.getListByStatus(getOrgPath(orgId, orgType), sourceType, status);
public List<IcEventResultDTO> getListByStatus(String orgId, String orgType, String eventType, String sourceType, String status, String categoryCode) {
return baseDao.getListByStatus(getOrgPath(orgId, orgType), eventType, sourceType, status, categoryCode);
}
@Override

124
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -542,60 +542,41 @@
<select id="getEventByReplyTypeCount" resultType="java.lang.Integer">
SELECT
count( ra.eventId )
count( r.id )
FROM
(
SELECT
r.IC_EVENT_ID AS eventId
FROM
ic_event_reply r
<where>
r.DEL_FLAG = 0
AND r.MANAGE_STATUS = #{manageType}
AND r.IC_EVENT_ID IN (
SELECT e.id FROM ic_event e
<where>
e.DEL_FLAG = 0
<if test="null != sourceType and sourceType != ''">
AND e.SOURCE_TYPE = #{sourceType}
</if>
<if test="null != orgIdPath and orgIdPath != ''">
AND e.GRID_PIDS LIKE concat(#{orgIdPath},'%')
</if>
</where>
)
</where>
GROUP BY r.IC_EVENT_ID
) ra
ic_event_reply r
<where>
r.DEL_FLAG = 0 AND r.MANAGE_STATUS = #{manageType}
<if test="null != manageType and manageType != '' and manageType == 2">
OR r.MANAGE_STATUS = 3 OR r.MANAGE_STATUS = 4
</if>
AND r.IC_EVENT_ID IN (
SELECT e.id from ic_event e
<where>
e.DEL_FLAG = 0
<if test="null != sourceType and sourceType != ''">
AND e.SOURCE_TYPE = #{sourceType}
</if>
<if test="null != orgIdPath and orgIdPath != ''">
AND e.GRID_PIDS LIKE concat(#{orgIdPath},'%')
</if>
</where>
)
</where>
</select>
<select id="getEventBySourceTypeCount" resultType="com.epmet.dto.result.EventAnalysisResultDTO">
SELECT
ea.jisujiban as jiSuJiBan,
eb.zhitonglianban as zhiTongLianBan,
ec.wanggehua as wangGeHua
from
(
SELECT count(e.id) as jisujiban from ic_event e
WHERE e.DEL_FLAG = 0 and e.SOURCE_TYPE = 0
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
)ea,
(
SELECT count(e.id) as zhitonglianban from ic_event e
WHERE e.DEL_FLAG = 0 and e.SOURCE_TYPE = 1
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
)eb,
(
SELECT count(e.id) as wanggehua from ic_event e
WHERE e.DEL_FLAG = 0 and e.SOURCE_TYPE = 2
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
)ec
SUM(CASE WHEN e.SOURCE_TYPE = 0 THEN 1 ELSE 0 END) as jiSuJiBan,
SUM(CASE WHEN e.SOURCE_TYPE = 1 THEN 1 ELSE 0 END) as zhiTongLianBan,
SUM(CASE WHEN e.SOURCE_TYPE = 2 THEN 1 ELSE 0 END) as wangGeHua
FROM ic_event e
<where>
e.DEL_FLAG = 0
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
</where>
</select>
<select id="getAnalysis" resultType="java.util.Map">
@ -640,12 +621,18 @@
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS LIKE concat(#{orgIdPath},'%')
</if>
<if test="null != eventType and eventType != ''">
AND e.EVENT_TYPE = #{eventType}
</if>
<if test="null != sourceType and sourceType != ''">
AND e.SOURCE_TYPE = #{sourceType}
</if>
<if test="null != status and status != ''">
AND r.MANAGE_STATUS = #{status}
</if>
<if test="null != categoryCode and categoryCode != ''">
AND c.CATEGORY_CODE = #{categoryCode}
</if>
</where>
GROUP BY e.ID,c.ic_event_id,r.ic_event_id
ORDER BY r.MANAGE_TIME DESC,e.CREATED_TIME DESC
@ -675,38 +662,33 @@
<select id="getEventRateByGridIds" resultType="com.epmet.dto.result.GridOrVillageEventRateResultDTO">
SELECT
ea.total AS total,
ea.gridId AS orgId,
eb.total,
ROUND(eb.total/ea.total,2) AS rate
round( eb.total / ea.total, 2 ) AS rate
FROM
(
SELECT
count( e.id ) AS total,
e.GRID_ID AS gridId
SELECT count( e.id ) AS total, e.id AS id
FROM ic_event e
LEFT JOIN ic_event_reply r ON r.IC_EVENT_ID = e.ID
<where>
e.DEL_FLAG = 0
<if test="null != orgIds and orgIds.size >0">
AND e.GRID_ID IN(
<foreach collection="orgIds" item="orgId" separator=",">
#{orgId}
</foreach>)
<if test="null != orgId and orgId != ''">
AND e.AGENCY_ID = #{orgId}
</if>
</where>
GROUP BY e.GRID_ID
) ea,
) ea,
(
SELECT count( e.id ) AS total FROM ic_event e
LEFT JOIN ic_event_reply r ON r.IC_EVENT_ID = e.ID
SELECT count( r.id ) AS total FROM ic_event_reply r
<where>
e.DEL_FLAG = 0 AND r.MANAGE_STATUS = 3
<if test="null != orgIds and orgIds.size >0">
AND e.GRID_ID IN(
<foreach collection="orgIds" item="orgId" separator=",">
#{orgId}
</foreach>)
</if>
r.DEL_FLAG = 0
AND r.MANAGE_STATUS = 2 OR r.MANAGE_STATUS = 3 OR r.MANAGE_STATUS = 4 OR r.MANAGE_STATUS = 5
AND r.IC_EVENT_ID IN (
SELECT e.id AS id FROM ic_event e
<where>
e.DEL_FLAG = 0
<if test="null != orgId and orgId != ''">
AND e.AGENCY_ID = #{orgId}
</if>
</where>
)
</where>
) eb
</select>

3
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/result/IcPartyActPageResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.resi.partymember.dto.icpartyact.result;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.resi.partymember.dto.icpartyact.form.JoinOrgDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@ -79,5 +80,7 @@ public class IcPartyActPageResultDTO implements Serializable {
private List<JoinOrgDTO> joinOrgList;
//导出用
private String joinOrgNameStr;
private List<FileCommonDTO> attachments;
}

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

@ -10,6 +10,7 @@ import lombok.Data;
@Data
public class LingShanScreenPartyObjectByTypeRstDTO {
private String id;
private String name;
private String longitude;
private String latitude;

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

@ -146,7 +146,7 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
@Param("agencyId") String agencyId,
@Param("orgIdpath") String orgIdpath);
List<LingShanScreenPartyObjectByTypeRstDTO> lingshanListDw(@Param("orgIdPath") String orgIdPath);
List<LingShanScreenPartyObjectByTypeRstDTO> lingshanListDw(@Param("orgIdPath") String orgIdPath, @Param("orgId") String orgId);
/**
* @Description: 灵山直属支部

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

@ -8,6 +8,7 @@ import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@ -288,10 +289,16 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
PageInfo<IcPartyActPageResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPageList(formDTO));
if(!formDTO.getIsPage()){
// 不分页
pageInfo.getList().forEach(l->{
l.setJoinOrgList(icPartyActOrgDao.selectJoinOrgList(l.getIcPartyActId()));
});
}
pageInfo.getList().forEach(l->{
l.setAttachments(resiPartymemberAttachmentDao.selectListByBusinessId(l.getIcPartyActId()));
});
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}

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

@ -49,7 +49,15 @@ public class LingShanPartyOrgServiceImpl implements LingShanPartyOrgService, Res
ArrayList<LingShanPartyOrgAndOtherObjQtyRstDTO> tl = new ArrayList<>();
// 1.党组织
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
AgencyInfoCache agencyInfo = null;
try {
agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
} catch (
Exception e) {
logger.error("【灵山大屏-党对象数量查询】组织未找到:" + agencyId);
return tl;
}
String orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
String level = agencyInfo.getLevel();
@ -60,7 +68,7 @@ public class LingShanPartyOrgServiceImpl implements LingShanPartyOrgService, Res
q = new QueryWrapper<IcPartyOrgEntity>().select(" party_org_type, count(*) childrenQty").lambda()
// 本组织下级的所有子级
.eq(IcPartyOrgEntity::getAgencyId, agencyId)
.eq(IcPartyOrgEntity::getPartyOrgType, PartyOrgTypeEnum.BRANCH.getCode()) // 是社区,就只能查询支部了。这里要控制,因为支部的行政组织也是对应到社区,所以这里必须限制一下
// .eq(IcPartyOrgEntity::getPartyOrgType, PartyOrgTypeEnum.BRANCH.getCode()) // 是社区,就只能查询支部了。这里要控制,因为支部的行政组织也是对应到社区,所以这里必须限制一下
.groupBy(IcPartyOrgEntity::getPartyOrgType);
} else {
// 街道及以上级别,用pids,因为要从社区开始查,本级及下级
@ -160,7 +168,7 @@ public class LingShanPartyOrgServiceImpl implements LingShanPartyOrgService, Res
if (OrgInfoConstant.AGENCY.equals(orgType)) {
// 是行政组织,就要查询组织的下一级。查询下一级只能用AGENCY_PIDS
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
return partyOrgDao.lingshanListDw(PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()));
return partyOrgDao.lingshanListDw(PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()), orgId);
} else {
// 是网格,哪里来的党委?
return new ArrayList<>();

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

@ -14,6 +14,7 @@ import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActT
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.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -81,8 +82,14 @@ public class LingShanScreenController {
* @date: 2023/4/14 3:20 PM
*/
@GetMapping("partymemberList")
public Result<List<LingShanScreenPartyOrgTreeResultDTO.Partymember>> partymemberList(@RequestParam("partyOrgId") String partyOrgId) {
List<LingShanScreenPartyOrgTreeResultDTO.Partymember> l = lingShanScreenService.partymemberListByPartyOrgId(partyOrgId);
public Result<List<LingShanScreenPartyOrgTreeResultDTO.Partymember>> partymemberList(@RequestParam(value = "partyOrgId", required = false) String partyOrgId,
@RequestParam(value = "agencyId", required = false) String agencyId) {
if (StringUtils.isAllBlank(partyOrgId, agencyId)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "党组织ID和行政组织ID必须传一个");
}
List<LingShanScreenPartyOrgTreeResultDTO.Partymember> l = lingShanScreenService.partymemberListByPartyOrgId(partyOrgId, agencyId);
return new Result().ok(l);
}

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

@ -44,7 +44,7 @@ public interface LingShanScreenService {
* @author: WangXianZhang
* @date: 2023/4/14 3:22 PM
*/
List<LingShanScreenPartyOrgTreeResultDTO.Partymember> partymemberListByPartyOrgId(String partyOrgId);
List<LingShanScreenPartyOrgTreeResultDTO.Partymember> partymemberListByPartyOrgId(String partyOrgId, String agencyId);
/**
* @description: agencyId下的党组织活动数统计

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

@ -6,6 +6,7 @@ import com.epmet.commons.tools.enums.GenderEnum;
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.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis;
@ -61,7 +62,14 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
@Override
public List<LingShanScreenPartyOrgCategoryResultDTO> listPartyOrgCategoryAndQuantity(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
AgencyInfoCache agencyInfo = null;
try {
agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
} catch (Exception e) {
logger.error("【灵山大屏-党对象数量查询】组织未找到:" + agencyId);
return new ArrayList<>();
}
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
@ -96,7 +104,14 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
@Override
public List<LingShanScreenPartyActTypeAndQtyResultDTO> partyActTypeAndQuantity(String agencyId) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
AgencyInfoCache agencyInfo = null;
try {
agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
} catch (Exception e) {
logger.warn("【灵山大屏-按活动类型查询党建活动统计】" + ExceptionUtils.getErrorStackTrace(e));
return new ArrayList<>();
}
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
@ -153,7 +168,22 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
}
@Override
public List<LingShanScreenPartyOrgTreeResultDTO.Partymember> partymemberListByPartyOrgId(String partyOrgId) {
public List<LingShanScreenPartyOrgTreeResultDTO.Partymember> partymemberListByPartyOrgId(String partyOrgId, String agencyId) {
if (StringUtils.isBlank(partyOrgId)) {
// 没有传党组织id,使用行政组织id去查询对应的党组织,然后给党组织id赋值
LambdaQueryWrapper<IcPartyOrgEntity> q = new LambdaQueryWrapper<>();
q.eq(IcPartyOrgEntity::getAgencyId, agencyId);
q.le(IcPartyOrgEntity::getPartyOrgType, 4);// agency,那就只查询<=4的,即省委~社区党委
IcPartyOrgEntity partyOrg = icPartyOrgDao.selectOne(q);
if (partyOrg == null) {
logger.warn("根据该行政组织为找到对应的党组织信息:" + agencyId);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "根据该行政组织为找到对应的党组织信息");
}
partyOrgId = partyOrg.getId();
}
IcPartyOrgEntity partyOrg = icPartyOrgDao.selectById(partyOrgId);
LambdaQueryWrapper<IcPartyMemberEntity> query = null;
if (partyOrg == null) {
@ -223,7 +253,15 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
*/
@Override
public List<LingShanScreenPartyActQtyStatsResultDTO> actQtyOfPartyOrgStats(String agencyId, Date holdTimeStart, Date holdTimeEnd) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
ArrayList<LingShanScreenPartyActQtyStatsResultDTO> rl = new ArrayList<>();
AgencyInfoCache agencyInfo = null;
try {
agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
} catch (Exception e) {
logger.warn("【灵山大屏-按组织查询党建活动统计】" + ExceptionUtils.getErrorStackTrace(e));
return rl;
}
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前组织信息失败,agencyId:" + agencyId, "查询当前组织信息失败");
}
@ -298,7 +336,6 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
}
// 将结果map转化为list,返回
ArrayList<LingShanScreenPartyActQtyStatsResultDTO> rl = new ArrayList<>();
orgDimMap.forEach((actType, orgStatsMap) -> {
LingShanScreenPartyActQtyStatsResultDTO re = new LingShanScreenPartyActQtyStatsResultDTO();

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

@ -276,7 +276,7 @@
, 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)
inner join ic_party_act_type_dict t on (a.ACT_TYPE = t.TYPE_KEY and t.DEL_FLAG = 0 and a.CUSTOMER_ID=t.CUSTOMER_ID)
where a.DEL_FLAG = 0
and a.CUSTOMER_ID = #{customerId}
and a.ORG_ID_PATH like CONCAT(#{orgIdPath}, '%')

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

@ -301,8 +301,8 @@
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
and (o.AGENCY_PIDS = #{orgIdPath} or o.AGENCY_ID=#{orgId})
and o.PARTY_ORG_TYPE = 4
group by o.ID, o.PARTY_ORG_NAME, o.LATITUDE, o.LONGITUDE
</select>
@ -314,7 +314,7 @@
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_PIDS like #{orgId}
and o.AGENCY_ID like #{orgId}
and o.PARTY_ORG_TYPE = 5
group by o.ID, o.PARTY_ORG_NAME, o.LATITUDE, o.LONGITUDE
</select>

35
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/DataSyncRecordMaritalPageFormDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.form.dataSync;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2022/10/13 14:16
*/
@Data
public class DataSyncRecordMaritalPageFormDTO extends PageFormDTO {
/**
* 姓名
*/
private String name;
/**
* 身份证
*/
private String idCard;
private String customerId;
/**
* 当前工作人员id
*/
private String staffId;
/**
* 当前工作人员所属组织id
*/
private String agencyId;
private String userId;
}

72
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DataSyncRecordMaritalPageResultDTO.java

@ -0,0 +1,72 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 数据同步记录-居民婚姻信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-18
*/
@Data
public class DataSyncRecordMaritalPageResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 身份证
*/
private String idCard;
/**
* 电话
*/
private String mobile;
/**
* 居民Idic_resi_user.id
*/
private String icResiUserId;
/**
* 婚姻状况
*/
private String maritalStatusName;
/**
* 婚姻状况
*/
private String maritalStatus;
/**
* 处理状态更新至居民信息 0:未处理1:处理成功2处理失败
*/
private Integer dealStatus;
private String dealStatusName;
/**
* 处理结果
*/
private String dealResult;
}

68
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordMaritalController.java

@ -1,19 +1,37 @@
package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.DataSyncRecordDeathDTO;
import com.epmet.dto.DataSyncRecordMaritalDTO;
import com.epmet.dto.form.dataSync.DataSyncRecordDeathPageFormDTO;
import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO;
import com.epmet.dto.form.dataSync.DataSyncRecordMaritalPageFormDTO;
import com.epmet.dto.result.DataSyncRecordMaritalPageResultDTO;
import com.epmet.excel.DataSyncRecordMaritalExcel;
import com.epmet.service.DataSyncRecordMaritalService;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -24,6 +42,7 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-18
*/
@Log4j
@RestController
@RequestMapping("dataSyncRecordMarital")
public class DataSyncRecordMaritalController {
@ -31,10 +50,12 @@ public class DataSyncRecordMaritalController {
@Autowired
private DataSyncRecordMaritalService dataSyncRecordMaritalService;
@RequestMapping("page")
public Result<PageData<DataSyncRecordMaritalDTO>> page(@RequestParam Map<String, Object> params){
PageData<DataSyncRecordMaritalDTO> page = dataSyncRecordMaritalService.page(params);
return new Result<PageData<DataSyncRecordMaritalDTO>>().ok(page);
@PostMapping("page")
public Result<PageData<DataSyncRecordMaritalPageResultDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody DataSyncRecordMaritalPageFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
PageData<DataSyncRecordMaritalPageResultDTO> page = dataSyncRecordMaritalService.page(formDTO);
return new Result<PageData<DataSyncRecordMaritalPageResultDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
@ -69,4 +90,43 @@ public class DataSyncRecordMaritalController {
return new Result();
}
/**
* @Description: 导出
* @param tokenDto:
* @param formDTO:
* @param response:
* @Return void
* @Author: lichao
* @Date: 2023/5/22 16:18
*/
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody DataSyncRecordMaritalPageFormDTO formDTO, HttpServletResponse response) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setIsPage(false);
ExcelWriter excelWriter = null;
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
int pageNo = formDTO.getPageNo();
try {
String today = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_MMDD);
String fileName = "数据比对-婚姻数据".concat(today);
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), DataSyncRecordMaritalExcel.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<DataSyncRecordMaritalPageResultDTO> data = null;
do {
data = dataSyncRecordMaritalService.page(formDTO);
formDTO.setPageNo(++pageNo);
excelWriter.write(data.getList(), writeSheet);
} while (org.apache.commons.collections4.CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
} catch (Exception e) {
log.error("export exception", e);
} finally {
// 千万别忘记finish 会帮忙关闭流
if (excelWriter != null) {
excelWriter.finish();
}
}
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordMaritalDao.java

@ -1,8 +1,13 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.DataSyncRecordMaritalDTO;
import com.epmet.dto.result.DataSyncRecordMaritalPageResultDTO;
import com.epmet.entity.DataSyncRecordMaritalEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 数据同步记录-居民婚姻信息
@ -12,5 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface DataSyncRecordMaritalDao extends BaseDao<DataSyncRecordMaritalEntity> {
List<DataSyncRecordMaritalPageResultDTO> pageSelect(@Param("customerId") String customerId, @Param("idCard") String idCard, @Param("name") String name, @Param("agencyId") String agencyId);
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -24,6 +24,7 @@ import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.IcVolunteerPolyDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO;
import com.epmet.dto.result.resi.ResiPortrayalDetailDTO;
import com.epmet.dto.result.resi.ResiPortrayalResultDTO;
import com.epmet.entity.IcResiUserEntity;
@ -503,4 +504,17 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @return
*/
IcResiUserEntity getById(String icResiUserId);
/**
* @Description: 根据orgIdPath计算各个组织下的特殊人群数量
* @param orgIdPath:
* @Return java.util.List<com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO>
* @Author: wangxianzhang
* @Date: 2023/5/24 9:27 AM
*/
List<LingShanSpecialCrowdStatsByOrgResultDTO> countSpecialQtyOfAllSubOrg(@Param("orgIdPath") String orgIdPath,
@Param("specialType") String specialType);
int countSpecialQtyOfOrg(@Param("orgIdPath") String orgIdPath, @Param("specialType") String specialType);
}

64
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordMaritalExcel.java

@ -1,6 +1,8 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.util.Date;
@ -14,59 +16,27 @@ import java.util.Date;
@Data
public class DataSyncRecordMaritalExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户Id")
private String customerId;
@Excel(name = "组织Id")
private String agencyId;
@Excel(name = "组织的pids 含agencyId本身")
private String pids;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "姓名")
/**
* 姓名
*/
@ColumnWidth(10)
@ExcelProperty("姓名")
private String name;
@Excel(name = "身份证")
@ColumnWidth(25)
@ExcelProperty("身份证")
private String idCard;
@Excel(name = "电话")
private String mobile;
@Excel(name = "居民Id,ic_resi_user.id")
private String icResiUserId;
@Excel(name = "婚姻状况")
private String maritalStatusName;
@ColumnWidth(25)
@ExcelProperty("婚姻状况")
private String maritalStatus;
@Excel(name = "处理状态(更新至居民信息) 0:未处理;1:处理成功;2处理失败")
private Integer dealStatus;
@ColumnWidth(25)
@ExcelProperty("处理状态")
private String dealStatusName;
@Excel(name = "处理结果")
@ColumnWidth(25)
@ExcelProperty("处理结果")
private String dealResult;
@Excel(name = "删除标识:0.未删除 1.已删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/AbstractLingShanSpecialCrowdExcelImportListener.java

@ -9,7 +9,9 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.PidUtils;
@ -244,7 +246,7 @@ public abstract class AbstractLingShanSpecialCrowdExcelImportListener<T extends
* @date: 2023/4/18 3:42 PM
*/
protected void saveBatch() {
String orgIdPath = PidUtils.convertPid2OrgIdPath(currentStaffInfo.getAgencyId(), currentStaffInfo.getAgencyPIds());
// String orgIdPath = PidUtils.convertPid2OrgIdPath(currentStaffInfo.getAgencyId(), currentStaffInfo.getAgencyPIds());
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
Date now = new Date();
Iterator<T> it = getOriginDatas().iterator();
@ -256,9 +258,15 @@ public abstract class AbstractLingShanSpecialCrowdExcelImportListener<T extends
errorDatas.add(row);
it.remove();
} else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(row.getResiGridId());
if (gridInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道-特殊人群】导入:未找到网格: " + row.getResiGridId());
}
specialTypes.add(new PersonSpecialTypeBean(row.getResiId(), row.getIdCard(), specialCrowdType.getType()));
orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), orgIdPath);
String orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), gridInfo.getPids());
E e = ConvertUtils.sourceToTarget(row, entityClass);
e.setCustomerId(customerId);

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordMaritalService.java

@ -5,9 +5,12 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.DataSyncRecordDeathDTO;
import com.epmet.dto.DataSyncRecordMaritalDTO;
import com.epmet.dto.form.dataSync.DataSyncRecordMaritalPageFormDTO;
import com.epmet.dto.result.DataSyncRecordMaritalPageResultDTO;
import com.epmet.entity.DataSyncRecordDeathEntity;
import com.epmet.entity.DataSyncRecordMaritalEntity;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@ -22,12 +25,12 @@ public interface DataSyncRecordMaritalService extends BaseService<DataSyncRecord
/**
* 默认分页
*
* @param params
* @param formDTO
* @return PageData<DataSyncRecordMaritalDTO>
* @author generator
* @date 2023-05-18
*/
PageData<DataSyncRecordMaritalDTO> page(Map<String, Object> params);
PageData<DataSyncRecordMaritalPageResultDTO> page(DataSyncRecordMaritalPageFormDTO formDTO);
/**
* 默认查询
@ -80,4 +83,5 @@ public interface DataSyncRecordMaritalService extends BaseService<DataSyncRecord
void delete(String[] ids);
DataSyncRecordMaritalDTO selectOne(LambdaQueryWrapper<DataSyncRecordMaritalEntity> queryWrapper);
}

175
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java

@ -744,6 +744,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao
if(StringUtils.isBlank(thirdResultData)){
continue;
}
if (thirdResultData.equals("INR:匹配不成功") || thirdResultData.equals("null:null")){
continue;
}
// JSONObject thirdResultObject = JSON.parseObject(thirdResultData);
LambdaQueryWrapper<DataSyncRecordMaritalEntity> queryWrapper = new LambdaQueryWrapper<>();
@ -1674,101 +1677,105 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao
List<NatUserInfoResultDTO> dbResiList = null;
// String scope="";
List<DataSyncScopeDTO> allScope = new ArrayList<>();
for (DataSyncConfigDTO config : configData) {
allScope.addAll(config.getScopeList());
}
String scope = config.getScopeList().stream().map(DataSyncScopeDTO::getId).collect(Collectors.joining(","));
// 查询上一次定时任务 居民位置记录
LambdaQueryWrapper<IcResiUserTaskLogEntity> logEntityLambdaQueryWrapper = new LambdaQueryWrapper<IcResiUserTaskLogEntity>().eq(IcResiUserTaskLogEntity::getDataScope,scope).eq(IcResiUserTaskLogEntity::getType,"hunyin").orderByDesc(IcResiUserTaskLogEntity::getCreatedTime).last("limit 1");
IcResiUserTaskLogEntity logEntity = resiUserTaskLogDao.selectOne(logEntityLambdaQueryWrapper);
// userInfoResultDTOS 待处理的数据存放
List<NatUserInfoResultDTO> userInfoResultDTOS = new ArrayList<>();
boolean isNum = false;
int start = 0;
// 如果没有log数据 说明第一次进入循环
if (logEntity == null){
// 从0开始 优先获取规定的几个社区
userInfoResultDTOS = getNatUserInfoFromDbForSiWang(0,50000);
// 如果不满5000条数据 下面再从别的社区取 isNum = true
if (userInfoResultDTOS.size() < 50000){
isNum = true;
}
}else{
// 如果有log数据 判断一下上次停留在特殊数据还是普通数据 1是特殊数据(优先的几个社区)
if (logEntity.getDataType() == 1){
// 从上次停止的数据开始获取
userInfoResultDTOS = getNatUserInfoFromDbForSiWang(logEntity.getDataCount(),50000);
// 下面再从别的社区取 isNum = true 凑够50000
isNum = true;
}else if (logEntity.getDataType() == 0){
// 如果是普通数据 直接从次停留在特殊数据获取
start = logEntity.getDataCount();
}
// String scope = config.getScopeList().stream().map(DataSyncScopeDTO::getId).collect(Collectors.joining(","));
// 查询上一次定时任务 居民位置记录
LambdaQueryWrapper<IcResiUserTaskLogEntity> logEntityLambdaQueryWrapper = new LambdaQueryWrapper<IcResiUserTaskLogEntity>().eq(IcResiUserTaskLogEntity::getType,"hunyin").orderByDesc(IcResiUserTaskLogEntity::getCreatedTime).last("limit 1");
// .eq(IcResiUserTaskLogEntity::getDataScope,scope)
IcResiUserTaskLogEntity logEntity = resiUserTaskLogDao.selectOne(logEntityLambdaQueryWrapper);
// userInfoResultDTOS 待处理的数据存放
List<NatUserInfoResultDTO> userInfoResultDTOS = new ArrayList<>();
boolean isNum = false;
int start = 0;
// 如果没有log数据 说明第一次进入循环
if (logEntity == null){
// 从0开始 优先获取规定的几个社区
userInfoResultDTOS = getNatUserInfoFromDbForSiWang(0,50000);
// 如果不满5000条数据 下面再从别的社区取 isNum = true
if (userInfoResultDTOS.size() < 50000){
isNum = true;
}
}else{
// 如果有log数据 判断一下上次停留在特殊数据还是普通数据 1是特殊数据(优先的几个社区)
if (logEntity.getDataType() == 1){
// 从上次停止的数据开始获取
userInfoResultDTOS = getNatUserInfoFromDbForSiWang(logEntity.getDataCount(),50000);
// 下面再从别的社区取 isNum = true 凑够50000
isNum = true;
}else if (logEntity.getDataType() == 0){
// 如果是普通数据 直接从次停留在特殊数据获取
start = logEntity.getDataCount();
}
// 建立一个最后插入log的标志
IcResiUserTaskLogEntity newLog = new IcResiUserTaskLogEntity();
newLog.setCreatedTime(new Date());
newLog.setType("hunyin");
newLog.setDataScope(scope);
// 设置查询数据范围
formDTO.setOrgList(config.getScopeList());
DataSyncEnum anEnum = DataSyncEnum.getEnum(config.getDataCode());
// 如果true 说明之前获取过特殊数据了 把50000补完普通数据
if (isNum){
formDTO.setStart(start);
formDTO.setEnd(50000-userInfoResultDTOS.size());
dbResiList = getNatUserInfoFromDbLimit(formDTO);
}
// 建立一个最后插入log的标志
IcResiUserTaskLogEntity newLog = new IcResiUserTaskLogEntity();
newLog.setCreatedTime(new Date());
newLog.setType("hunyin");
// newLog.setDataScope(scope);
// 设置查询数据范围
formDTO.setOrgList(allScope);
DataSyncEnum anEnum = DataSyncEnum.getEnum(EpidemicConstant.DATA_CODE_MARITAL);
// 如果true 说明之前获取过特殊数据了 把50000补完普通数据
if (isNum){
formDTO.setStart(start);
formDTO.setEnd(50000-userInfoResultDTOS.size());
dbResiList = getNatUserInfoFromDbLimit(formDTO);
dbResiList.addAll(userInfoResultDTOS);
newLog.setDataType(0);
newLog.setDataCount(50000-dbResiList.size());
}else{
// false 说明之前没有获取过特殊数据了
formDTO.setStart(start);
formDTO.setEnd(start+50000);
dbResiList = getNatUserInfoFromDbLimit(formDTO);
// 如果不够五万了 从头再来
if (dbResiList.size()<50000){
// 特殊数据
userInfoResultDTOS = getNatUserInfoFromDbForSiWang(0,50000-dbResiList.size());
dbResiList.addAll(userInfoResultDTOS);
newLog.setDataType(0);
newLog.setDataCount(50000-dbResiList.size());
}else{
// false 说明之前没有获取过特殊数据了
formDTO.setStart(start);
formDTO.setEnd(start+50000);
dbResiList = getNatUserInfoFromDbLimit(formDTO);
// 如果不够五万了 从头再来
if (dbResiList.size()<50000){
// 特殊数据
userInfoResultDTOS = getNatUserInfoFromDbForSiWang(0,50000-dbResiList.size());
dbResiList.addAll(userInfoResultDTOS);
// 特殊数据不够 在获取普通数据
if (dbResiList.size() < 50000){
formDTO.setStart(0);
formDTO.setEnd(50000-dbResiList.size());
dbResiList.addAll(getNatUserInfoFromDbLimit(formDTO));
newLog.setDataType(0);
newLog.setDataCount(50000-dbResiList.size());
// 特殊数据不够 在获取普通数据
if (dbResiList.size() < 50000){
formDTO.setStart(0);
formDTO.setEnd(50000-dbResiList.size());
dbResiList.addAll(getNatUserInfoFromDbLimit(formDTO));
newLog.setDataType(0);
newLog.setDataCount(50000-dbResiList.size());
}else{
newLog.setDataType(1);
newLog.setDataCount(50000-dbResiList.size());
}
}else{
newLog.setDataType(0);
newLog.setDataCount(start+50000);
newLog.setDataType(1);
newLog.setDataCount(50000-dbResiList.size());
}
}else{
newLog.setDataType(0);
newLog.setDataCount(start+50000);
}
}
if (CollectionUtils.isEmpty(dbResiList)) {
continue;
}
switch (anEnum) {
case HUN_YIN:
try {
//查询正常状态的居民
hunYin(dbResiList);
resiUserTaskLogDao.insert(newLog);
log.info("======hunyin信息拉取结束======");
} catch (Exception e) {
log.error("marry thread execute exception", e);
}
default:
log.warn("没有要处理的数据");
}
/* if (CollectionUtils.isEmpty(dbResiList)) {
continue;
}*/
switch (anEnum) {
case HUN_YIN:
try {
//查询正常状态的居民
hunYin(dbResiList);
resiUserTaskLogDao.insert(newLog);
log.info("======hunyin信息拉取结束======");
} catch (Exception e) {
log.error("marry thread execute exception", e);
}
default:
log.warn("没有要处理的数据");
}
}

24
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordMaritalServiceImpl.java

@ -4,20 +4,27 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.DataSyncRecordMaritalDao;
import com.epmet.dto.DataSyncRecordDeathDTO;
import com.epmet.dto.DataSyncRecordMaritalDTO;
import com.epmet.dto.form.dataSync.DataSyncRecordMaritalPageFormDTO;
import com.epmet.dto.result.DataSyncRecordMaritalPageResultDTO;
import com.epmet.entity.DataSyncRecordDeathEntity;
import com.epmet.entity.DataSyncRecordMaritalEntity;
import com.epmet.service.DataSyncRecordMaritalService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -32,12 +39,16 @@ import java.util.Map;
public class DataSyncRecordMaritalServiceImpl extends BaseServiceImpl<DataSyncRecordMaritalDao, DataSyncRecordMaritalEntity> implements DataSyncRecordMaritalService {
@Override
public PageData<DataSyncRecordMaritalDTO> page(Map<String, Object> params) {
IPage<DataSyncRecordMaritalEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, DataSyncRecordMaritalDTO.class);
public PageData<DataSyncRecordMaritalPageResultDTO> page(DataSyncRecordMaritalPageFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setAgencyId(null != staffInfoCacheResult ? staffInfoCacheResult.getAgencyId() : null);
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage());
List<DataSyncRecordMaritalPageResultDTO> records = baseDao.pageSelect(formDTO.getCustomerId(),formDTO.getIdCard(), formDTO.getName(), formDTO.getAgencyId());
PageInfo<DataSyncRecordMaritalPageResultDTO> pi = new PageInfo<>(records);
return new PageData<>(records, pi.getTotal());
}
@Override
@ -89,4 +100,5 @@ public class DataSyncRecordMaritalServiceImpl extends BaseServiceImpl<DataSyncRe
return ConvertUtils.sourceToTarget(entity, DataSyncRecordMaritalDTO.class);
}
}

62
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java

@ -47,8 +47,21 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private IcResiUserDao icResiUserDao;
@Override
public List<LingShanSpecialCrowdStatsByOrgResultDTO> specialCrowdStatsCountBySubOrg(String parentAgencyId, String specialType) {
AgencyInfoCache parentAgencyInfo;
try {
parentAgencyInfo = CustomerOrgRedis.getAgencyInfo(parentAgencyId);
} catch (Exception e) {
logger.warn("【灵山大屏-特殊人群柱状图统计】传入的parentAgencyId参数未找到指定的组织信息:" + parentAgencyId);
return new ArrayList<>();
}
List<SubOrgResDTO> subOrgs = getResultDataOrThrowsException(govOrgOpenFeignClient.subOrgList(parentAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, null);
List<String> orgIdPaths = subOrgs.stream().map(sub -> PidUtils.convertPid2OrgIdPath(sub.getOrgId(), sub.getPids())).collect(Collectors.toList());
@ -77,30 +90,14 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
return t;
}).collect(Collectors.toList());
List<LingShanSpecialCrowdStatsByOrgResultDTO> ol = new ArrayList<>();
if (LingShanSpecialCrowdTypeEnums.AZBJ.getType().equals(specialType) || StringUtils.isBlank(specialType)) {
ol.addAll(azbjDao.statsCountsByOrgIds(orgIdPaths));
}
if (LingShanSpecialCrowdTypeEnums.SQJZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) {
ol.addAll(sqjzDao.statsCountsByOrgIds(orgIdPaths));
}
if (LingShanSpecialCrowdTypeEnums.XFRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) {
ol.addAll(xfryDao.statsCountsByOrgIds(orgIdPaths));
}
if (LingShanSpecialCrowdTypeEnums.JDRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) {
ol.addAll(jdryDao.statsCountsByOrgIds(orgIdPaths));
}
if (LingShanSpecialCrowdTypeEnums.JZHZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) {
ol.addAll(jzhzDao.statsCountsByOrgIds(orgIdPaths));
}
List<LingShanSpecialCrowdStatsByOrgResultDTO> ol = icResiUserDao.countSpecialQtyOfAllSubOrg(PidUtils.convertPid2OrgIdPath(parentAgencyInfo.getId(), parentAgencyInfo.getPids()), specialType);
// 开始给rl++
for (LingShanSpecialCrowdStatsByOrgResultDTO o : ol) {
for (LingShanSpecialCrowdStatsByOrgResultDTO r : rl) {
if (o.getOrgIdPath().contains(r.getOrgIdPath())) {
for (LingShanSpecialCrowdStatsByOrgResultDTO qtyData : ol) {
for (LingShanSpecialCrowdStatsByOrgResultDTO subOrg : rl) {
if (qtyData.getOrgIdPath().contains(subOrg.getOrgIdPath())) {
// 如果ol中的数据,orgIdPath包含了这个组织的orgIdPath,说明这条数据就是这个组织的数据,那就++把
r.setQuantity(r.getQuantity() + o.getQuantity());
subOrg.setQuantity(subOrg.getQuantity() + qtyData.getQuantity());
}
}
}
@ -114,25 +111,10 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
ArrayList<LingShanSpecialCrowdStatsBySpecialTypeResultDTO> l = new ArrayList<>();
LambdaQueryWrapper<LingshanSpecialCrowdDetailAzbjEntity> azbjq = new LambdaQueryWrapper<>();
azbjq.likeRight(LingshanSpecialCrowdDetailAzbjEntity::getOrgIdPath, orgIdPath);
l.add(new LingShanSpecialCrowdStatsBySpecialTypeResultDTO(LingShanSpecialCrowdTypeEnums.AZBJ.getType(), LingShanSpecialCrowdTypeEnums.AZBJ.getName(), azbjDao.selectCount(azbjq)));
LambdaQueryWrapper<LingshanSpecialCrowdDetailSqjzEntity> sqjzq = new LambdaQueryWrapper<>();
sqjzq.likeRight(LingshanSpecialCrowdDetailSqjzEntity::getOrgIdPath, orgIdPath);
l.add(new LingShanSpecialCrowdStatsBySpecialTypeResultDTO(LingShanSpecialCrowdTypeEnums.SQJZ.getType(), LingShanSpecialCrowdTypeEnums.SQJZ.getName(), sqjzDao.selectCount(sqjzq)));
LambdaQueryWrapper<LingshanSpecialCrowdDetailXfryEntity> xfryq = new LambdaQueryWrapper<>();
xfryq.likeRight(LingshanSpecialCrowdDetailXfryEntity::getOrgIdPath, orgIdPath);
l.add(new LingShanSpecialCrowdStatsBySpecialTypeResultDTO(LingShanSpecialCrowdTypeEnums.XFRY.getType(), LingShanSpecialCrowdTypeEnums.XFRY.getName(), xfryDao.selectCount(xfryq)));
LambdaQueryWrapper<LingshanSpecialCrowdDetailJdryEntity> jdryq = new LambdaQueryWrapper<>();
jdryq.likeRight(LingshanSpecialCrowdDetailJdryEntity::getOrgIdPath, orgIdPath);
l.add(new LingShanSpecialCrowdStatsBySpecialTypeResultDTO(LingShanSpecialCrowdTypeEnums.JDRY.getType(), LingShanSpecialCrowdTypeEnums.JDRY.getName(), jdryDao.selectCount(jdryq)));
LambdaQueryWrapper<LingshanSpecialCrowdDetailJzhzEntity> jzhzq = new LambdaQueryWrapper<>();
jzhzq.likeRight(LingshanSpecialCrowdDetailJzhzEntity::getOrgIdPath, orgIdPath);
l.add(new LingShanSpecialCrowdStatsBySpecialTypeResultDTO(LingShanSpecialCrowdTypeEnums.JZHZ.getType(), LingShanSpecialCrowdTypeEnums.JZHZ.getName(), jzhzDao.selectCount(jzhzq)));
for (LingShanSpecialCrowdTypeEnums e : LingShanSpecialCrowdTypeEnums.values()) {
int qty = icResiUserDao.countSpecialQtyOfOrg(orgIdPath, e.getType());
l.add(new LingShanSpecialCrowdStatsBySpecialTypeResultDTO(e.getType(), e.getName(), qty));
}
return l;
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanSpecialCrowdServiceImpl.java

@ -433,10 +433,16 @@ public class LingShanSpecialCrowdServiceImpl implements LingShanSpecialCrowdServ
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
String staffId = EpmetRequestHolder.getLoginUserId();
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
String orgIdPath = PidUtils.convertPid2OrgIdPath(staffInfo.getAgencyId(), staffInfo.getAgencyPIds());
// CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
// String orgIdPath = PidUtils.convertPid2OrgIdPath(staffInfo.getAgencyId(), staffInfo.getAgencyPIds());
orgIdPath = PidUtils.convertPid2OrgIdPath(vt.getResiGridId(), orgIdPath);
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(vt.getResiGridId());
if (gridInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道-特殊人群】新增:未找到网格: " + vt.getResiGridId());
}
String orgIdPath = PidUtils.convertPid2OrgIdPath(vt.getResiGridId(), gridInfo.getPids());
Date now = new Date();

30
epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordMaritalDao.xml

@ -24,5 +24,35 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="pageSelect" resultType="com.epmet.dto.result.DataSyncRecordMaritalPageResultDTO">
select
d.ID,
d.IC_RESI_USER_ID,
d.NAME AS name,d.ID_CARD,
if(d.MARITAL_STATUS_NAME = 'IA:结婚','结婚',if(d.MARITAL_STATUS_NAME = 'IB:离婚','离婚','单身')) as maritalStatus,
if(d.DEAL_STATUS = 0,'未处理',if(d.DEAL_STATUS = 1,'已处理','')) as dealStatusName,
d.DEAL_RESULT
from
data_sync_record_marital d
where
d.DEL_FLAG = '0'
and
d.MARITAL_STATUS_NAME!='INR:匹配不成功'
and
d.MARITAL_STATUS_NAME!='null:null'
AND d.CUSTOMER_ID = #{customerId}
<if test="agencyId != null and agencyId != ''">
AND d.PIDS LIKE concat( '%', #{agencyId}, '%' )
</if>
<if test="idCard != null and idCard != ''">
AND d.ID_CARD LIKE concat('%',#{idCard},'%')
</if>
<if test="name != null and name != ''">
AND d.`NAME` LIKE concat('%',#{name},'%')
</if>
ORDER BY
d.CREATED_TIME DESC
</select>
</mapper>

32
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -1741,4 +1741,36 @@
<select id="getById" parameterType="java.lang.String" resultType="com.epmet.entity.IcResiUserEntity">
select r.* from ic_resi_user r where r.id = #{icResiUserId}
</select>
<!--根据orgIdPath计算各个组织下的特殊人群数量-->
<select id="countSpecialQtyOfAllSubOrg"
resultType="com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO">
select count(*) quantity
, r.PIDS orgIdPath
from ic_resi_user r
inner join ic_special s on (s.DEL_FLAG = 0 and r.ID = s.IC_RESI_USER)
where r.DEL_FLAG = 0
and r.PIDS like CONCAT(#{orgIdPath}, '%')
and s.SPECIAL_RQLB is not null
and s.SPECIAL_RQLB != ''
<if test="specialType != null and specialType != ''">
and s.SPECIAL_RQLB like CONCAT('%',#{specialType},'%')
</if>
group by r.PIDS
</select>
<!--指定组织下,指定人群类别,的数量-->
<select id="countSpecialQtyOfOrg"
resultType="int">
select count(*) quantity
from ic_resi_user r
inner join ic_special s on (s.DEL_FLAG = 0 and r.ID = s.IC_RESI_USER)
where r.DEL_FLAG = 0
and r.PIDS like CONCAT(#{orgIdPath}, '%')
and s.SPECIAL_RQLB is not null
and s.SPECIAL_RQLB != ''
<if test="specialType != null and specialType != ''">
and s.SPECIAL_RQLB like CONCAT('%',#{specialType},'%')
</if>
</select>
</mapper>

Loading…
Cancel
Save