Browse Source

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

master
wxz 3 years ago
parent
commit
19893705b6
  1. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java
  2. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml
  3. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
  4. 16
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  5. 43
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java

@ -79,4 +79,8 @@ public class PlaceOrgDetailResultDTO implements Serializable {
private String reportPhone;
private String dangerType;
private String dangerName;
}

1
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml

@ -139,6 +139,7 @@
p.LONGITUDE longitude,
p.LATITUDE latitude,
p.COMPANY_PROFILE companyProfile,
pr.DANGER_TYPE dangerType,pr.DANGER_NAME dangerName,
s.NAME reporter,s.MOBILE reportPhone
FROM ic_place_org p
LEFT JOIN customer_grid b ON p.GRID_ID = b.ID

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

@ -218,5 +218,5 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
List<IcEventResultDTO> getListBySourceTypeOrEventType(@Param("orgIdPath") String orgPath,
@Param("sourceType") String sourceType, @Param("eventType") String eventType);
GridOrVillageEventRateResultDTO getEventRateByGridIds(@Param("orgId") String orgId);
GridOrVillageEventRateResultDTO getEventRateByGridIds(@Param("orgId") String orgId,@Param("orgType") String orgType);
}

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

@ -2034,16 +2034,20 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
@Override
public List<GridOrVillageEventRateResultDTO> getEventRateByAgencyId(String agencyId) {
List<GridOrVillageEventRateResultDTO> dtoList = new ArrayList<>();
String orgType = "";
if (StringUtils.isNotEmpty(agencyId)) {
List<IcEventAnalysisOrgResDTO> orgs = getSubOrgs(agencyId);
if (null != orgs && orgs.size() > 0) {//获取所有的新村,根据新村的agencyId 查询事件,统计事件的各类完成情况;
Map<String, String> namesMap = new HashMap<>();
for (IcEventAnalysisOrgResDTO org : orgs) {
if (StringUtils.isEmpty(orgType)) {
orgType = org.getOrgType();
}
namesMap.put(org.getOrgId(), org.getOrgName());
}
List<String> ids = orgs.stream().map(IcEventAnalysisOrgResDTO::getOrgId).collect(Collectors.toList());
for (String id : ids) {
GridOrVillageEventRateResultDTO resultDto = baseDao.getEventRateByGridIds(id);
GridOrVillageEventRateResultDTO resultDto = baseDao.getEventRateByGridIds(id, orgType);
if (null != resultDto) {
resultDto.setAgencyName(namesMap.get(id));
resultDto.setOrgId(id);
@ -2092,12 +2096,10 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
}
for (SubOrgResDTO org : orgs.getData()) {
IcEventAnalysisOrgResDTO resultDto = ConvertUtils.sourceToTarget(org, IcEventAnalysisOrgResDTO.class);
if ("agency".equals(org.getOrgType())) {
resultDto.setOrgName(org.getOrgName());
resultDto.setOrgType(org.getOrgType());
resultDto.setOrgId(org.getOrgId());
orgList.add(resultDto);
}
resultDto.setOrgName(org.getOrgName());
resultDto.setOrgType(org.getOrgType());
resultDto.setOrgId(org.getOrgId());
orgList.add(resultDto);
}
return orgList;
}

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

@ -664,36 +664,21 @@
</select>
<select id="getEventRateByGridIds" resultType="com.epmet.dto.result.GridOrVillageEventRateResultDTO">
SELECT
ea.total AS total,
eb.total,
round( eb.total / ea.total, 2 ) AS rate
count( e.id ) AS total,
ROUND( sum( CASE WHEN (e.REPLY_STATUS = 2 OR e.REPLY_STATUS = 3 OR e.REPLY_STATUS = 4) THEN 1 ELSE 0 END ) / count( e.id ), 2 ) AS rate
FROM
(
SELECT count( e.id ) AS total, 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>
) ea,
(
SELECT count( r.id ) AS total FROM ic_event_reply r
<where>
r.DEL_FLAG = 0
AND r.MANAGE_STATUS = 2 OR r.MANAGE_STATUS = 3 OR r.MANAGE_STATUS = 4
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
ic_event e
<where>
e.DEL_FLAG = 0
<if test="null != orgId and orgId != ''">
<if test="null != orgType and orgType !='' and orgType == 'agency'">
AND e.AGENCY_ID = #{orgId}
</if>
<if test="null != orgType and orgType !='' and orgType == 'grid'">
AND e.GRID_ID = #{orgId}
</if>
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save