From 155312404f6c5dce3be5f778eb614e22e8f82205 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Mon, 10 May 2021 17:05:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E5=A4=A7=E5=B1=8F=EF=BC=8C?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=8A=E6=8A=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/form/ScreenProjectFormDTO.java | 3 ++- .../src/main/resources/application.yml | 2 ++ .../mapper/screen/ScreenProjectDataDao.xml | 24 +++++++++---------- .../screen/ScreenProjectPushTaskImpl.java | 12 +++++----- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/form/ScreenProjectFormDTO.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/form/ScreenProjectFormDTO.java index 4caf8e0a..5484c5df 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/form/ScreenProjectFormDTO.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/form/ScreenProjectFormDTO.java @@ -3,6 +3,7 @@ package com.elink.esua.epdc.dto.screen.form; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * 大屏数据统计 定时任务入参 @@ -17,6 +18,6 @@ public class ScreenProjectFormDTO implements Serializable { /** * 统计时间 */ - private String yearMonthDay; + private Date yearMonthDay; } diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application.yml index f3d3c20c..a6a8c4d4 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application.yml @@ -62,6 +62,8 @@ mybatis-plus: map-underscore-to-camel-case: true cache-enabled: false call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + epmet: config: diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index 5f63b245..4154cb47 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -47,8 +47,9 @@ t3.CREATED_TIME as closeCaseTime, case when t1.ITEM_STATE = 10 then 3 - when (select ID from esua_epdc_events.epdc_item_handle_process where STATE != 10 and DEL_FLAG ='0' and ITEM_ID = t1.ID group by t1.ID) is null then 1 - else 2 end as projectLevel + when t1.ITEM_STATE = 0 and (select COUNT(1) from esua_epdc_events.epdc_item_handle_process where DEL_FLAG ='0' and ITEM_ID = t1.ID) = 1 then 1 + when (t1.ITEM_STATE = 0 or t1.ITEM_STATE = 5) and (select COUNT(1) from esua_epdc_events.epdc_item_handle_process where DEL_FLAG ='0' and ITEM_ID = t1.ID) > 1 then 2 + else '' end as projectLevel from (select * from(select * from esua_epdc_events.epdc_item where DEL_FLAG = '0' and GRID_ID not in ( SELECT t.`dept_id` FROM `esua_epdc_admin`.`sys_dept_config` t @@ -56,8 +57,8 @@ order by ID)a group by a.EVENT_ID) t1 left join esua_epdc_events.epdc_img t2 on t1.EVENT_ID = t2.REFERENCE_ID and t1.DEL_FLAG = '0' left join esua_epdc_events.epdc_item_handle_process t3 on t3.ITEM_ID = t1.ID and t3.DEL_FLAG = '0' and t3.STATE = 10 - where date_format(t1.UPDATED_TIME, '%Y-%m-%d') >= STR_TO_DATE(#{yearMonthDay}, '%Y-%m-%d') - and date_format(t1.UPDATED_TIME, '%Y-%m-%d') <= date_sub(curdate(),interval 1 day) + where t1.UPDATED_TIME >= #{yearMonthDay} + and t1.UPDATED_TIME <= now() order by t2.CREATED_TIME @@ -96,19 +97,18 @@ t1.HANDLER_DEPT_ID as handlerId, 'unknown' as handlerType, case - when (t4.ID is not null and t1.STATE = 0 and t1.CREATED_TIME != (select min(t.CREATED_TIME) from esua_epdc_events.epdc_item_handle_process t where t.DEL_FLAG = '0' and t1.ITEM_ID = t.ITEM_ID group by t.ITEM_ID)) then 'transfer' - when (t4.ID is null and t1.STATE = 0 and t1.CREATED_TIME != (select min(t.CREATED_TIME) from esua_epdc_events.epdc_item_handle_process t where t.DEL_FLAG = '0' and t1.ITEM_ID = t.ITEM_ID group by t.ITEM_ID)) then 'response' - when (t1.STATE = 0 and t1.CREATED_TIME = (select min(t.CREATED_TIME) from esua_epdc_events.epdc_item_handle_process t where t.DEL_FLAG = '0' and t1.ITEM_ID = t.ITEM_ID group by t.ITEM_ID)) then 'created' - when t1.STATE = 5 then 'close' when t1.STATE = 10 then 'closed_case' - else '' END as operation, + when t1.STATE = 5 then 'close' + when (t4.ID is not null and t1.STATE = 0 ) then 'transfer' + when (t1.STATE = 0 and t1.CREATED_TIME = (select min(t.CREATED_TIME) from esua_epdc_events.epdc_item_handle_process t where t.DEL_FLAG = '0' and t1.ITEM_ID = t.ITEM_ID group by t.ITEM_ID)) then 'created' + else 'response' END as operation, t1.OUT_HANDLE_ADVICE as publicReply, t1.HANDLE_ADVICE as internalRemark, t1.CREATED_TIME as processTime from esua_epdc_events.epdc_item_handle_process t1 - left join esua_epdc_events.epdc_item_dept t4 on t4.ITEM_HANDLE_ID = t1.ID and t4.DEL_FLAG = '0' - where date_format(t1.UPDATED_TIME, '%Y-%m-%d') >= STR_TO_DATE(#{yearMonthDay}, '%Y-%m-%d') - and date_format(t1.UPDATED_TIME, '%Y-%m-%d') <= date_sub(curdate(),interval 1 day) and t1.DEL_FLAG = '0' + left join esua_epdc_events.epdc_item_dept t4 on t4.ITEM_HANDLE_ID = t1.ID + where t1.UPDATED_TIME >= #{yearMonthDay} + and t1.UPDATED_TIME <= now() and t1.DEL_FLAG = '0' and t1.HANDLER_DEPT_ID not in ( SELECT t.`dept_id` FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.`del_flag`= 0) diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTaskImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTaskImpl.java index 0831409b..9a6bb5dd 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTaskImpl.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTaskImpl.java @@ -86,13 +86,13 @@ public class ScreenProjectPushTaskImpl implements ScreenProjectPushTask { ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity(); ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO(); if (screenRecordEntities == null || screenRecordEntities.size() == 0) { - screenProjectFormDTO.setYearMonthDay("2020-01-01"); + screenProjectFormDTO.setYearMonthDay(DateUtils.parse("2020-01-01 00:00:00",DateUtils.DATE_TIME_PATTERN)); } else { screenRecordEntity = screenRecordEntities.get(0); - screenProjectFormDTO.setYearMonthDay(DateUtils.format(screenRecordEntity.getStatisticsTime(), DateUtils.DATE_PATTERN)); + screenProjectFormDTO.setYearMonthDay(screenRecordEntity.getStatisticsTime()); } //记录此次统计时间 并更新时间或者新增 - screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(), -1)); + screenRecordEntity.setStatisticsTime(new Date()); if (StringUtils.isNotBlank(screenRecordEntity.getId())) { screenRecordDao.updateById(screenRecordEntity); } else { @@ -121,13 +121,13 @@ public class ScreenProjectPushTaskImpl implements ScreenProjectPushTask { ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity(); ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO(); if (screenRecordEntities == null || screenRecordEntities.size() == 0) { - screenProjectFormDTO.setYearMonthDay("2020-01-01"); + screenProjectFormDTO.setYearMonthDay(DateUtils.parse("2020-01-01 00:00:00",DateUtils.DATE_TIME_PATTERN)); } else { screenRecordEntity = screenRecordEntities.get(0); - screenProjectFormDTO.setYearMonthDay(DateUtils.format(screenRecordEntity.getStatisticsTime(), DateUtils.DATE_PATTERN)); + screenProjectFormDTO.setYearMonthDay(screenRecordEntity.getStatisticsTime()); } //记录此次统计时间 并更新时间或者新增 - screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(), -1)); + screenRecordEntity.setStatisticsTime(new Date()); if (StringUtils.isNotBlank(screenRecordEntity.getId())) { screenRecordDao.updateById(screenRecordEntity); } else {