Browse Source

平阴大屏,项目上报修改

feature/screenDataPush
songyunpeng 5 years ago
parent
commit
155312404f
  1. 3
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/form/ScreenProjectFormDTO.java
  2. 2
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/application.yml
  3. 24
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  4. 12
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTaskImpl.java

3
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;
}

2
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:

24
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
</select>
<resultMap type="com.elink.esua.epdc.dto.screen.result.UploadProjectProcessDTO" id="uploadprojectprocessMap">
@ -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') &lt;= 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 &lt;= 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)

12
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 {

Loading…
Cancel
Save