Browse Source

增加事件查询方式,增加新村事件办理情况分析

master
luyan 2 years ago
parent
commit
4d39cac6de
  1. 4
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/GridOrVillageEventRateResultDTO.java
  2. 8
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java
  3. 39
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  4. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
  5. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
  6. 30
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  7. 83
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

4
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/GridOrVillageEventRateResultDTO.java

@ -23,10 +23,10 @@ public class GridOrVillageEventRateResultDTO implements Serializable {
/**
* 完结事件数量
*/
private String total;
private Integer total;
/**
* 事件完结率
*/
private String rate;
private Double rate;
}

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

@ -7,8 +7,13 @@ public class IcEventResultDTO {
private String eventId;
private String eventContent;
private String gridId;
private String gridName;
private String sourceType;
private String eventType;
private String manageStatus;
private String categoryCode;
private String latitude;
private String longitude;
private String gridName;
private String sourceTypeName;
private String processStatus;
private String processStatusName;
@ -17,4 +22,5 @@ public class IcEventResultDTO {
private String mobile;
private String address;
private String happenTime;
}

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

@ -609,8 +609,7 @@ public class IcEventController {
}
/**
* @param * @param null null
* @return null
* @param
* @throws
* @description 根据组织ID获取事件办理统计情况
* @author yan Lu
@ -628,4 +627,40 @@ public class IcEventController {
return new Result();
}
/**
* 根据事件来源类型或者响应级别获取事件列表
*
* @param orgId
* @param orgType
* @param sourceType 事件来源
* @param eventType 响应几杯
* @return
*/
@GetMapping("getListBySourceTypeOrEventType")
public Result<List<IcEventResultDTO>> getListBySourceTypeOrEventType(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType,
@RequestParam("sourceType") String sourceType,
@RequestParam("eventType") String eventType
) {
return new Result<List<IcEventResultDTO>>().ok(icEventService.getListBySourceTypeOrEventType(orgId, orgType, sourceType, eventType));
}
/**
* 根据事件理状态查询列表
*
* @param orgId
* @param orgType
* @param status
* @return
*/
@GetMapping("getEventListByManageStatus")
public Result<List<IcEventResultDTO>> getEventListByTypeOrStatus(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType,
@RequestParam("sourceType") String sourceType,
@RequestParam("status") String status) {
return new Result<List<IcEventResultDTO>>().ok(icEventService.getListByStatus(orgId, orgType, sourceType, status));
}
}

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

@ -210,4 +210,10 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
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> getListBySourceTypeOrEventType(@Param("orgIdPath") String orgPath, @Param("sourceType") String sourceType, @Param("eventType") String eventType);
GridOrVillageEventRateResultDTO getEventRateByGridIds(@Param("orgId") String orgId);
}

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

@ -270,8 +270,19 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 根据组织ID获取下一级组织事件不完结率和完结数量
*
* @return
*/
List<GridOrVillageEventRateResultDTO> getEventRateByAgencyId(String agencyId);
/**
* 根据事件处理状态查询列表
* @param sourceType 事件来源
* @param status 事件处理状态
* @return
*/
List<IcEventResultDTO> getListByStatus(String orgId, String orgType, String sourceType, String status);
List<IcEventResultDTO> getListBySourceTypeOrEventType(String orgId, String orgType, String sourceType, String eventType);
}

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

@ -2009,19 +2009,39 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
@Override
public List<GridOrVillageEventRateResultDTO> getEventRateByAgencyId(String agencyId) {
List<GridOrVillageEventRateResultDTO> dtoList = new ArrayList<>();
if (StringUtils.isNotEmpty(agencyId)) {
List<IcEventAnalysisOrgResDTO> orgs = getSubOrgs(agencyId);
if (null != orgs && orgs.size() > 0) {
for (IcEventAnalysisOrgResDTO org : orgs) {
GridOrVillageEventRateResultDTO dto = baseDao.getEventRateByGridIds(org.getOrgId());
if (null != dto) {
dto.setAgencyName(org.getOrgName());
dto.setRate(dto.getRate() == null ? 0 : dto.getRate());
dtoList.add(dto);
} else {
dto.setAgencyName(org.getOrgName());
dto.setRate(0.00);
dto.setTotal(0);
dtoList.add(dto);
}
}
return null;
}
}
return dtoList;
}
@Override
public List<IcEventResultDTO> getListByStatus(String orgId, String orgType, String sourceType, String status) {
return baseDao.getListByStatus(getOrgPath(orgId, orgType), sourceType, status);
}
@Override
public List<IcEventResultDTO> getListBySourceTypeOrEventType(String orgId, String orgType, String sourceType, String eventType) {
return baseDao.getListBySourceTypeOrEventType(getOrgPath(orgId, orgType), sourceType, eventType);
}
/**
* @param orgId
* @param orgType
* @return
* @deprecationg 获取orgPath
*/
private String getOrgPath(String orgId, String orgType) {

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

@ -617,4 +617,87 @@
<select id="selectByEventId" resultType="com.epmet.entity.IcEventEntity">
select e.* from ic_event e where e.id = #{icEventId}
</select>
<sql id="eventArguments">
e.ID AS eventId,
e.GRID_ID AS gridId,
e.SOURCE_TYPE AS sourceType,
e.EVENT_TYPE AS eventType,
e.LATITUDE,
e.LONGITUDE,
e.EVENT_CONTENT AS eventContent,
r.MANAGE_STATUS AS manageStatus,
c.CATEGORY_CODE AS categoryCode
</sql>
<select id="getListByStatus" resultType="com.epmet.dto.result.IcEventResultDTO">
SELECT
<include refid="eventArguments"/>
FROM ic_event e
LEFT JOIN ic_event_reply r ON r.IC_EVENT_ID = e.ID
LEFT JOIN ic_event_category c ON c.IC_EVENT_ID = e.ID
<where>
e.DEL_FLAG = 0
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS LIKE concat(#{orgIdPath},'%')
</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>
</where>
GROUP BY e.ID,c.ic_event_id,r.ic_event_id
ORDER BY r.MANAGE_TIME DESC,e.CREATED_TIME DESC
</select>
<select id="getListBySourceTypeOrEventType" resultType="com.epmet.dto.result.IcEventResultDTO">
SELECT
<include refid="eventArguments"/>
FROM ic_event e
LEFT JOIN ic_event_reply r ON r.IC_EVENT_ID = e.ID
LEFT JOIN ic_event_category c ON c.IC_EVENT_ID = e.ID
<where>
e.DEL_FLAG = 0
<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>
</where>
GROUP BY e.ID,c.ic_event_id,r.ic_event_id
ORDER BY r.MANAGE_TIME DESC,e.CREATED_TIME DESC
</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
FROM
(
SELECT count( e.id ) AS total 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 != orgId and orgId !=''">
AND e.GRID_ID = #{orgId}
</if>
</where>
) ea,
(
SELECT count( e.id ) AS total FROM ic_event e
LEFT JOIN ic_event_reply r ON r.IC_EVENT_ID = e.ID
<where>
e.DEL_FLAG = 0 AND r.MANAGE_STATUS = 3
<if test="null != orgId and orgId !=''">
AND e.GRID_ID = #{orgId}
</if>
</where>
) eb
</select>
</mapper>

Loading…
Cancel
Save