diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationInfoResultDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationInfoResultDTO.java new file mode 100644 index 000000000..dd738d2c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.dto.item.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 大屏导出-满意度信息 + * @Author wgf + * @Date 2022-10-10 + */ +@Data +public class EvaluationInfoResultDTO implements Serializable { + private static final long serialVersionUID = -2494874960456321677L; + + /** + * 部门ID + */ + private String deptId; + + /** + * 值 + */ + private String value; + + /** + * 占比 + */ + private String proportion; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/OnTimeDealInfoResultDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/OnTimeDealInfoResultDTO.java new file mode 100644 index 000000000..072ebaf98 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/OnTimeDealInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.dto.item.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 大屏导出-按时 + * @Author wgf + * @Date 2022-10-10 + */ +@Data +public class OnTimeDealInfoResultDTO implements Serializable { + private static final long serialVersionUID = -2494874960456321677L; + + /** + * 部门ID + */ + private String deptId; + + /** + * 值 + */ + private String value; + + /** + * 占比 + */ + private String proportion; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/YellowRedInfoResultDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/YellowRedInfoResultDTO.java new file mode 100644 index 000000000..12948cde3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/YellowRedInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.dto.item.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 大屏导出-红黄灯数 + * @Author wgf + * @Date 2022-10-10 + */ +@Data +public class YellowRedInfoResultDTO implements Serializable { + private static final long serialVersionUID = -2494874960456321677L; + + /** + * 部门ID + */ + private String deptId; + + /** + * 黄灯数 + */ + private Integer yellowNum; + + /** + * 红灯数 + */ + private Integer redNum; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/result/EventStatisticsResultDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/result/EventStatisticsResultDTO.java index d0856e63b..104cb73c2 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/result/EventStatisticsResultDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/screen/result/EventStatisticsResultDTO.java @@ -48,6 +48,10 @@ public class EventStatisticsResultDTO implements Serializable { */ @JsonIgnore private Integer closedCount; + /** + * 结案率 + */ + private String closedRatio; @JsonIgnore private Integer livelihoodClosedCount; @JsonIgnore @@ -55,5 +59,53 @@ public class EventStatisticsResultDTO implements Serializable { @JsonIgnore private Integer lawClosedCount; + /** + * 响应数 + */ private Integer responseCount; + + /** + * 响应率 + */ + private String responseRatio; + + /** + * 满意数 + */ + private String satisfiedCount; + + /** + * 满意率 + */ + private String satisfiedRatio; + + /** + * 按期办结数 + */ + private String scheduleClosedCount; + + /** + * 按期办结率 + */ + private String scheduleClosedRatio; + + /** + * 黄灯预警数 + */ + private Integer yellowCount; + + /** + * 红灯超期数 + */ + private Integer redCount; + + /** + * 不予受理数 + */ + private Integer unAcceptCount; + + /** + * 街道以下、部门办理诉求数 + */ + private Integer gridCommunityDealNum; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventStatDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventStatDao.java index 9bcbec335..ae3e8e070 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventStatDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenDeptEventStatDao.java @@ -18,6 +18,9 @@ package com.elink.esua.epdc.modules.screen.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.item.result.EvaluationInfoResultDTO; +import com.elink.esua.epdc.dto.item.result.OnTimeDealInfoResultDTO; +import com.elink.esua.epdc.dto.item.result.YellowRedInfoResultDTO; import com.elink.esua.epdc.dto.screen.ScreenDeptEventStatDTO; import com.elink.esua.epdc.dto.screen.form.EventStatisticsFormDTO; import com.elink.esua.epdc.dto.screen.result.EventStatisticsResultDTO; @@ -82,5 +85,26 @@ public interface ScreenDeptEventStatDao extends BaseDao getScreenExportData(EventStatisticsFormDTO formDTO); - -} \ No newline at end of file + + /** + * 导出满意数满意率 + * @param formDTO + * @return + */ + List getSatisfiedInfo(EventStatisticsFormDTO formDTO); + + /** + * 导出按时办结信息 + * @param formDTO + * @return + */ + List getOnTimeDealInfo(EventStatisticsFormDTO formDTO); + + /** + * 导出红黄灯数 + * @param formDTO + * @return + */ + List getYellowRedInfo(EventStatisticsFormDTO formDTO); + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/excel/ScreenDataExportExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/excel/ScreenDataExportExcel.java index 5c1b51fc1..8d9d81cae 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/excel/ScreenDataExportExcel.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/excel/ScreenDataExportExcel.java @@ -59,4 +59,7 @@ public class ScreenDataExportExcel { @ColumnWidth(20) @ExcelProperty(value = "不予受理数", order = 16) private Integer unAcceptCount; + @ColumnWidth(20) + @ExcelProperty(value = "街道以下、部门办理诉求数", order = 17) + private Integer gridCommunityDealNum; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventStatServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventStatServiceImpl.java index f09645694..f51f9c7d3 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventStatServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenDeptEventStatServiceImpl.java @@ -20,6 +20,9 @@ package com.elink.esua.epdc.modules.screen.service.impl; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.utils.DateUtils; +import com.elink.esua.epdc.dto.item.result.EvaluationInfoResultDTO; +import com.elink.esua.epdc.dto.item.result.OnTimeDealInfoResultDTO; +import com.elink.esua.epdc.dto.item.result.YellowRedInfoResultDTO; import com.elink.esua.epdc.dto.screen.form.DataStatisticsFormDTO; import com.elink.esua.epdc.dto.screen.form.EventStatisticsFormDTO; import com.elink.esua.epdc.dto.screen.result.*; @@ -228,7 +231,78 @@ public class ScreenDeptEventStatServiceImpl extends BaseServiceImpl resultDTOList = baseDao.getScreenExportData(formDTO); + + // 组装满意度信息 + resultDTOList = getSatisfiedInfo(formDTO,resultDTOList); + + // 获取按期办结信息 + resultDTOList = getOnTimeDealInfo(formDTO,resultDTOList); + + // 获取红黄灯预警数 + resultDTOList = getYellowRedInfo(formDTO,resultDTOList); + + return resultDTOList; + } + + /** + * 获取满意度和满意率 + * @param formDTO + * @return + */ + private List getSatisfiedInfo(EventStatisticsFormDTO formDTO,List resultDTOList){ + List resultDto = baseDao.getSatisfiedInfo(formDTO); + // 组装满意度信息 + for(EventStatisticsResultDTO totalDto : resultDTOList){ + for(EvaluationInfoResultDTO childDto : resultDto){ + if(totalDto.getDeptId().equals(childDto.getDeptId())){ + totalDto.setSatisfiedCount(childDto.getValue()); + totalDto.setSatisfiedRatio(childDto.getProportion()); + break; + } + } + } + return resultDTOList; + } + + /** + * 获取按期办结信息 + * @param formDTO + * @return + */ + private List getOnTimeDealInfo(EventStatisticsFormDTO formDTO,List resultDTOList){ + List resultDto = baseDao.getOnTimeDealInfo(formDTO); + // 组装满意度信息 + for(EventStatisticsResultDTO totalDto : resultDTOList){ + for(OnTimeDealInfoResultDTO childDto : resultDto){ + if(totalDto.getDeptId().equals(childDto.getDeptId())){ + totalDto.setScheduleClosedCount(childDto.getValue()); + totalDto.setScheduleClosedRatio(childDto.getProportion()); + break; + } + } + } + return resultDTOList; + } + + /** + * 获取红黄灯事件数 + * @param formDTO + * @return + */ + private List getYellowRedInfo(EventStatisticsFormDTO formDTO,List resultDTOList){ + List resultDto = baseDao.getYellowRedInfo(formDTO); + // 组装满意度信息 + for(EventStatisticsResultDTO totalDto : resultDTOList){ + for(YellowRedInfoResultDTO childDto : resultDto){ + if(totalDto.getDeptId().equals(childDto.getDeptId())){ + totalDto.setYellowCount(childDto.getYellowNum()); + totalDto.setRedCount(childDto.getRedNum()); + break; + } + } + } + return resultDTOList; } private BarCategoryResultDTO getBarCategoryResultDTO(BarCategoryResultDTO result, List list, String peopleFlag) { @@ -282,4 +356,4 @@ public class ScreenDeptEventStatServiceImpl extends BaseServiceImpl - + + SELECT + a.id AS deptId, + IFNULL(SUM(b.value), 0) AS value, + concat(ROUND(IFNULL(SUM(b.value) / SUM(b.total) * 100 , 0) ,1 ),'%') as proportion FROM meta_sys_dept a - LEFT JOIN ( - SELECT a.ALL_DEPT_IDS, - COUNT(a.ID) AS 'eventCount', - CASE WHEN a.ITEM_STATE = '10' THEN COUNT(a.ID) END AS 'closedCount', - CASE a.PEOPLE_FLAG WHEN '0' THEN COUNT(a.ID) END AS 'livelihoodCount', - CASE a.PEOPLE_FLAG WHEN '1' THEN COUNT(a.ID) END AS 'developCount', - CASE a.PEOPLE_FLAG WHEN '2' THEN COUNT(a.ID) END AS 'lawCount', - COUNT(c.ITEM_ID) AS 'responseCount' - FROM epdc_item a + left join ( + select + item.ALL_DEPT_IDS, + count((item.EVALUATION_SCORE = 1 or item.EVALUATION_SCORE = 2) or null) as value, + count(item.ID) as total + from epdc_item item + where item.DEL_FLAG = '0' + and item.IS_PEOPLE = '1' + and item.EVENT_ID is null + and item.ISSUE_ID is null + and item.EVALUATION_SCORE is not null + and ((SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他' and item.PEOPLE_FLAG = '0') or (item.PEOPLE_FLAG in ('1','2'))) + + AND DATE_FORMAT(item.CREATED_TIME, '%Y-%m-%d') <= #{statDate} + + + AND DATE_FORMAT(item.CREATED_TIME, '%Y-%m') = #{statDate} + AND DATE_FORMAT(item.CREATED_TIME, '%Y-%m-%d') <= #{startDate} + + + AND DATE_FORMAT(item.CREATED_TIME, '%Y') = #{statDate} + AND DATE_FORMAT(item.CREATED_TIME, '%Y-%m-%d') <= #{startDate} + + + AND DATE_FORMAT(item.CREATED_TIME, '%Y-%m-%d') >= #{startDate} + AND DATE_FORMAT(item.CREATED_TIME, '%Y-%m-%d') <= #{endDate} + + + AND item.PEOPLE_FLAG = #{peopleFlag} + + GROUP BY item.ALL_DEPT_IDS + ) b ON b.ALL_DEPT_IDS LIKE CONCAT('%', a.id, '%') + WHERE a.del_flag = '0' + + AND a.pid = #{deptId} + + AND a.type_key != 'street_dept' + AND a.type_key != 'district_dept' + GROUP BY a.id + ORDER BY a.sort, CONVERT(a.`name` USING gbk) ASC + + + + + + + + - \ No newline at end of file +