23 changed files with 749 additions and 126 deletions
@ -0,0 +1,123 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 网格员数据分析上报 |
|||
* @Auther: songyunpeng |
|||
* @Date: 2021-06-25 09:59 |
|||
*/ |
|||
@Data |
|||
public class GridManagerUploadDataResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
/** |
|||
* 日期ID |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 月ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 年ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
|
|||
/** |
|||
* 机关id:网格所属的组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 工作人员id【网格员基础信息接口获取】 |
|||
*/ |
|||
private String staffId ; |
|||
|
|||
/** |
|||
* 工作人员姓名【网格员基础信息接口获取】 |
|||
*/ |
|||
private String staffName; |
|||
|
|||
/** |
|||
* 项目立项数,截止到当前dateId的总数 |
|||
*/ |
|||
private Integer projectCount; |
|||
|
|||
/** |
|||
* 议题转项目数,截止到当前dateId的总数 |
|||
*/ |
|||
private Integer issueToProjectCount ; |
|||
|
|||
/** |
|||
* 议题关闭数,截止到当前dateId的总数 |
|||
*/ |
|||
private Integer closedIssueCount ; |
|||
|
|||
/** |
|||
* 项目响应数,截止到当前dateId的总数 |
|||
*/ |
|||
private Integer projectResponseCount ; |
|||
|
|||
/** |
|||
* 项目吹哨数,截止到当前dateId的总数 |
|||
*/ |
|||
private Integer projectTransferCount ; |
|||
|
|||
/** |
|||
* 项目结案数,dateId这一天的增量 |
|||
*/ |
|||
private Integer projectClosedCount ; |
|||
|
|||
/** |
|||
* 项目结案数,dateId这一天的增量 |
|||
*/ |
|||
private Integer projectIncr ; |
|||
|
|||
/** |
|||
* 议题转项目数,dateId这一天的增量 |
|||
*/ |
|||
private Integer issueToProjectIncr ; |
|||
|
|||
/** |
|||
* 议题关闭数,dateId这一天的增量 |
|||
*/ |
|||
private Integer closedIssueIncr ; |
|||
|
|||
/** |
|||
* 项目响应数,dateId这一天的增量 |
|||
*/ |
|||
private Integer projectResponseIncr ; |
|||
|
|||
/** |
|||
* 项目吹哨数,dateId这一天的增量 |
|||
*/ |
|||
private Integer projectTransferIncr ; |
|||
/** |
|||
* 项目结案数,截止到当前dateId的总数 |
|||
*/ |
|||
private Integer projectClosedIncr ; |
|||
|
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 网格员事件总数上报 |
|||
* @Auther: songyunpeng |
|||
* @Date: 2021-06-25 09:59 |
|||
*/ |
|||
@Data |
|||
public class GridManagerUploadEventResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
/** |
|||
* 日期ID |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 月ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 年ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 周ID |
|||
*/ |
|||
private String weekId; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 季度ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
|
|||
/** |
|||
* 机关id:网格所属的组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 产品这边工作人员用户id |
|||
*/ |
|||
private String staffId ; |
|||
|
|||
/** |
|||
* 事件数 |
|||
*/ |
|||
private Integer reportProjectCount; |
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.elink.esua.epdc.modules.screen.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenGridManagerService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @author songyunpeng |
|||
* @Description 网格员管理 |
|||
* @create 2021-06-25 |
|||
*/ |
|||
|
|||
@RestController |
|||
@RequestMapping("girdManager") |
|||
public class ScreenGridManagerController { |
|||
|
|||
@Autowired |
|||
private ScreenGridManagerService screenGridManagerService; |
|||
/** |
|||
* @Description 网格员数据分析上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/7/12 |
|||
* @Param [yearMonthDay] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.screen.result.GridManagerUploadDataResultDTO>> |
|||
**/ |
|||
@PostMapping("gridManagerUploadData") |
|||
public Result selectGridManagerUploadData() { |
|||
return screenGridManagerService.selectGridManagerUploadData(); |
|||
} |
|||
/** |
|||
* @Description 网格员事件分析上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/7/12 |
|||
* @Param [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.screen.result.GridManagerUploadEventResultDTO>> |
|||
**/ |
|||
@PostMapping("gridManagerUploadEvent") |
|||
public Result selectGridManagerUploadEvent(@RequestBody ScreenJobFormDTO formDto) { |
|||
return screenGridManagerService.selectGridManagerUploadEvent(formDto.getYearMonth()); |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.elink.esua.epdc.modules.screen.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenBaseReportDataFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.*; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 网格员管理信息 |
|||
* @Author songyunpeng |
|||
* @Date 2021/6/25 |
|||
**/ |
|||
@Mapper |
|||
public interface ScreenGridManagerDao extends BaseDao<ScreenBaseReportDataFormDTO> { |
|||
|
|||
/** |
|||
* @Description 网格员数据分析上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/7/12 |
|||
* @Param [customId] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.GridManagerUploadDataResultDTO> |
|||
**/ |
|||
List<GridManagerUploadDataResultDTO> selectGridManagerUploadData(@Param("customId")String customId,@Param("yearMonthDay") String yearMonthDay); |
|||
/** |
|||
* @Description 网格员事件总数上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/7/12 |
|||
* @Param [customId] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.GridManagerUploadEventResultDTO> |
|||
**/ |
|||
List<GridManagerUploadEventResultDTO> selectGridManagerUploadEvent(@Param("customId")String customId,@Param("yearMonthDay") String yearMonthDay); |
|||
|
|||
|
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.elink.esua.epdc.modules.screen.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
|
|||
/** |
|||
* 网格管理 |
|||
* |
|||
* @Author:syp |
|||
* @Date:2021/6/25 18:04 |
|||
*/ |
|||
public interface ScreenGridManagerService { |
|||
|
|||
/** |
|||
* @Description 网格员数据分析上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/7/12 |
|||
* @Param [customId] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.GridManagerUploadDataResultDTO> |
|||
**/ |
|||
Result selectGridManagerUploadData(); |
|||
/** |
|||
* @Description 网格员事件总数上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/7/12 |
|||
* @Param [customId] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.GridManagerUploadEventResultDTO> |
|||
**/ |
|||
Result selectGridManagerUploadEvent(String yearMonthDay); |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
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.EpmetConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenBaseReportDataFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.GridManagerUploadDataResultDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.GridManagerUploadEventResultDTO; |
|||
import com.elink.esua.epdc.modules.screen.dao.ScreenGridManagerDao; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenGridManagerService; |
|||
import com.elink.esua.epdc.utils.EpmetUtils; |
|||
import com.elink.esua.epdc.utils.ScreenDataUtils; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author:liuchuang |
|||
* @Date:2020/9/9 18:05 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class ScreenGridManagerServiceImpl extends BaseServiceImpl<ScreenGridManagerDao, ScreenBaseReportDataFormDTO> implements ScreenGridManagerService { |
|||
@Autowired |
|||
private EpmetUtils epmetUtils; |
|||
|
|||
@Value("${epmet.config.customerId}") |
|||
private String customerId; |
|||
|
|||
@Override |
|||
public Result selectGridManagerUploadData() { |
|||
// 统计截止到昨天的数据
|
|||
String yearMonthDay = DateUtils.format(DateUtils.addDateDays(new Date(), -1)); |
|||
List<GridManagerUploadDataResultDTO> gridManagerUploadDataResultDTOS = baseDao.selectGridManagerUploadData(customerId, yearMonthDay); |
|||
if(gridManagerUploadDataResultDTOS.size()!=0){ |
|||
String dataJson = ScreenDataUtils.getScreenDateJson(gridManagerUploadDataResultDTOS,true); |
|||
// 数据上报
|
|||
String body = epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_STATS_USER_GRID_MANAGER_UPLOAD_DATA, dataJson); |
|||
log.info(body); |
|||
} |
|||
|
|||
return new Result<>(); |
|||
} |
|||
|
|||
@Override |
|||
public Result selectGridManagerUploadEvent(String yearMonthDay) { |
|||
// 如果统计年月日为空,则统计当前天的数据
|
|||
yearMonthDay = StringUtils.isEmpty(yearMonthDay) ? DateUtils.format(new Date()) : yearMonthDay; |
|||
List<GridManagerUploadEventResultDTO> gridManagerUploadEventResultDTOS = baseDao.selectGridManagerUploadEvent(customerId, yearMonthDay); |
|||
if(gridManagerUploadEventResultDTOS.size()>0){ |
|||
String dataJson = ScreenDataUtils.getScreenDateJson(gridManagerUploadEventResultDTOS,true); |
|||
// 数据上报
|
|||
String body = epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_STATS_USER_GRID_MANAGER_UPLOAD_EVENT, dataJson); |
|||
log.info(body); |
|||
} |
|||
return new Result<>(); |
|||
} |
|||
} |
@ -0,0 +1,186 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.screen.dao.ScreenGridManagerDao"> |
|||
|
|||
<select id="selectGridManagerUploadData" |
|||
resultType="com.elink.esua.epdc.dto.screen.result.GridManagerUploadDataResultDTO"> |
|||
|
|||
select |
|||
'${customId}' as customerId, |
|||
DATE_FORMAT(#{yearMonthDay}, '%Y%m%d') as dateId, |
|||
CONCAT(DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y'), '%Y'), |
|||
'W', |
|||
WEEK(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y-%m-%d'))) weekId, |
|||
DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y'), '%Y') AS yearId, |
|||
CONCAT(DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y'), '%Y'), |
|||
'Q', |
|||
QUARTER(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), |
|||
'%Y-%m-%d'))) quarterId, |
|||
DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y-%m'), '%Y%m') AS monthId, |
|||
a.staffId, |
|||
a.staffName, |
|||
a.gridId, |
|||
a.pid AS agencyId, |
|||
SUM(a.projectCount) as projectCount, |
|||
SUM(a.projectIncr)projectIncr, |
|||
SUM(a.issueToProjectCount)issueToProjectCount, |
|||
SUM(a.closedIssueCount)closedIssueCount, |
|||
SUM(a.projectResponseCount)projectResponseCount, |
|||
SUM(a.projectTransferCount)projectTransferCount, |
|||
SUM(a.projectClosedCount)projectClosedCount, |
|||
SUM(a.issueToProjectIncr)issueToProjectIncr, |
|||
SUM(a.closedIssueIncr)closedIssueIncr, |
|||
SUM(a.projectResponseIncr)projectResponseIncr, |
|||
SUM(a.projectTransferIncr)projectTransferIncr, |
|||
SUM(a.projectClosedIncr)projectClosedIncr |
|||
|
|||
from( |
|||
select |
|||
seur.STAFF_ID as staffId, |
|||
seur.STAFF_NAME as staffName, |
|||
ee.GRID_ID as gridId, |
|||
sd.pid, |
|||
count(DATE_FORMAT(ee.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} or null) as projectCount, -- 项目立项数,截止到当前dateId的总数 |
|||
count(DATE_FORMAT(ee.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} or null) as projectIncr, -- 项目立项数,dateId这一天的增量 |
|||
0 as issueToProjectCount, |
|||
0 as closedIssueCount, |
|||
0 as projectResponseCount, |
|||
0 as projectTransferCount, |
|||
0 as projectClosedCount, |
|||
0 as issueToProjectIncr, |
|||
0 as closedIssueIncr, |
|||
0 as projectResponseIncr, |
|||
0 as projectTransferIncr, |
|||
0 as projectClosedIncr |
|||
|
|||
|
|||
from js_esua_epdc_admin.sys_epmet_user_relation seur |
|||
right join js_esua_epdc_events.epdc_events ee on ee.MOBILE = seur.MOBILE and ee.DEL_FLAG = '0' |
|||
left join js_esua_epdc_admin.sys_dept sd on sd.id = ee.GRID_ID and sd.DEL_FLAG = '0' |
|||
where seur.DEL_FLAG = '0' AND ee.GRID_ID NOT IN ( |
|||
SELECT t.DEPT_ID FROM `js_esua_epdc_admin`.`sys_dept_config` t WHERE t.DEL_FLAG = '0' |
|||
) |
|||
group by ee.MOBILE,ee.GRID_ID |
|||
|
|||
union all |
|||
|
|||
select |
|||
seur.STAFF_ID as staffId, |
|||
seur.STAFF_NAME as staffName, |
|||
ei.GRID_ID as gridId, |
|||
sd.pid, |
|||
0 as projectCount, |
|||
0 as projectIncr, |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} or null) as issueToProjectCount, -- 议题转项目数,截止到当前dateId的总数 |
|||
0 as closedIssueCount, |
|||
0 as projectResponseCount, |
|||
0 as projectTransferCount, |
|||
0 as projectClosedCount, |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} or null) as issueToProjectIncr, -- 议题转项目数,dateId这一天的增量 |
|||
0 as closedIssueIncr, |
|||
0 as projectResponseIncr, |
|||
0 as projectTransferIncr, |
|||
0 as projectClosedIncr |
|||
|
|||
from js_esua_epdc_admin.sys_epmet_user_relation seur |
|||
left join js_esua_epdc_admin.sys_user eu on eu.MOBILE = seur.MOBILE |
|||
right join js_esua_epdc_events.epdc_item ei on ei.CREATED_BY = eu.id and ei.DEL_FLAG = '0' |
|||
left join js_esua_epdc_admin.sys_dept sd on sd.id = ei.GRID_ID and sd.DEL_FLAG = '0' |
|||
where seur.DEL_FLAG = '0' and eu.DEL_FLAG = '0' AND ei.GRID_ID NOT IN ( |
|||
SELECT t.DEPT_ID FROM `js_esua_epdc_admin`.`sys_dept_config` t WHERE t.DEL_FLAG = '0' |
|||
) |
|||
group by ei.CREATED_BY,ei.GRID_ID |
|||
|
|||
union all |
|||
|
|||
select |
|||
seur.STAFF_ID as staffId, |
|||
seur.STAFF_NAME as staffName, |
|||
eii.GRID_ID as gridId, |
|||
sd.pid, |
|||
0 as projectCount, |
|||
0 as projectIncr, |
|||
0 as issueToProjectCount, |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} or null) as closedIssueCount, -- 议题关闭数,截止到当前dateId的总数 |
|||
0 as projectResponseCount, |
|||
0 as projectTransferCount, |
|||
0 as projectClosedCount, |
|||
0 as issueToProjectIncr, |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} or null) as closedIssueIncr, -- 议题关闭数,dateId这一天的增量 |
|||
0 as projectResponseIncr, |
|||
0 as projectTransferIncr, |
|||
0 as projectClosedIncr |
|||
from js_esua_epdc_admin.sys_epmet_user_relation seur |
|||
left join js_esua_epdc_admin.sys_user eu on eu.MOBILE = seur.MOBILE |
|||
right join js_esua_epdc_events.epdc_issue_handle ei on ei.CREATED_BY = eu.id and ei.DEL_FLAG = '0' and ei.STATE = 2 |
|||
right join js_esua_epdc_events.epdc_issue eii on ei.ISSUE_ID = eii.id and eii.DEL_FLAG = '0' |
|||
left join js_esua_epdc_admin.sys_dept sd on sd.id = eii.GRID_ID and sd.DEL_FLAG = '0' |
|||
where seur.DEL_FLAG = '0' and eu.DEL_FLAG = '0' AND eii.GRID_ID NOT IN ( |
|||
SELECT t.DEPT_ID FROM `js_esua_epdc_admin`.`sys_dept_config` t WHERE t.DEL_FLAG = '0' |
|||
) |
|||
group by ei.CREATED_BY,eii.GRID_ID |
|||
|
|||
union all |
|||
|
|||
|
|||
select |
|||
seur.STAFF_ID as staffId, |
|||
seur.STAFF_NAME as staffName, |
|||
eii.GRID_ID as gridId, |
|||
sd.pid , |
|||
0 as projectCount, |
|||
0 as projectIncr, |
|||
0 as issueToProjectCount, |
|||
0 as closedIssueCount, |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} and ei.STATE = 0 and eid.ID is null or null) as projectResponseCount, -- 项目响应数,截止到当前dateId的总数 |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} and ei.STATE = 0 and eid.ID is not null or null) as projectTransferCount, -- 项目吹哨数,截止到当前dateId的总数 |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') <= #{yearMonthDay} and ei.STATE = 10 or null) as projectClosedCount, -- 项目结案数,截止到当前dateId的总数 |
|||
0 as issueToProjectIncr, |
|||
0 as closedIssueIncr, |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} and ei.STATE = 0 and eid.ID is null or null) as projectResponseIncr, -- 项目响应数,dateId这一天的增量 |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} and ei.STATE = 0 and eid.ID is not null or null) as projectTransferIncr, -- 项目吹哨数,dateId这一天的增量 |
|||
count(DATE_FORMAT(ei.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} and ei.STATE = 10 or null) as projectClosedIncr -- 项目结案数,dateId这一天的增量 |
|||
from js_esua_epdc_admin.sys_epmet_user_relation seur |
|||
left join js_esua_epdc_admin.sys_user eu on eu.MOBILE = seur.MOBILE |
|||
right join js_esua_epdc_events.epdc_item_handle_process ei on ei.CREATED_BY = eu.id and ei.DEL_FLAG = '0' |
|||
right join js_esua_epdc_events.epdc_item eii on ei.ITEM_ID = eii.id and eu.del_flag = '0' |
|||
left join js_esua_epdc_admin.sys_dept sd on sd.id = eii.GRID_ID and sd.DEL_FLAG = '0' |
|||
left join js_esua_epdc_events.epdc_item_dept eid on eid.ITEM_HANDLE_ID = ei.ID and eid.DEL_FLAG = '0' |
|||
where seur.DEL_FLAG = '0' and eu.DEL_FLAG = '0' AND eii.GRID_ID NOT IN ( |
|||
SELECT t.DEPT_ID FROM `js_esua_epdc_admin`.`sys_dept_config` t WHERE t.DEL_FLAG = '0' |
|||
) |
|||
group by ei.CREATED_BY,eii.GRID_ID |
|||
|
|||
)a group by a.staffId,a.gridId; |
|||
|
|||
|
|||
</select> |
|||
<select id="selectGridManagerUploadEvent" |
|||
resultType="com.elink.esua.epdc.dto.screen.result.GridManagerUploadEventResultDTO"> |
|||
select |
|||
'${customId}' as customerId, |
|||
DATE_FORMAT(#{yearMonthDay}, '%Y%m%d') as dateId, |
|||
CONCAT(DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y'), '%Y'), |
|||
'W', |
|||
WEEK(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y-%m-%d'))) weekId, |
|||
DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y'), '%Y') AS yearId, |
|||
CONCAT(DATE_FORMAScreenBaseReportDataFormDTOT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y'), '%Y'), |
|||
'Q', |
|||
QUARTER(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), |
|||
'%Y-%m-%d'))) quarterId, |
|||
DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(#{yearMonthDay}, '%Y-%m-%d'), '%Y-%m'), '%Y%m') AS monthId, |
|||
seur.STAFF_ID, |
|||
ee.GRID_ID, |
|||
sd.pid AS agencyId, |
|||
count(ee.ID) as reportProjectCount |
|||
from js_esua_epdc_admin.sys_epmet_user_relation seur |
|||
right join js_esua_epdc_events.epdc_events ee on ee.MOBILE = seur.MOBILE and ee.DEL_FLAG = '0' |
|||
and DATE_FORMAT(ee.CREATED_TIME, '%Y-%m-%d') = #{yearMonthDay} |
|||
left join js_esua_epdc_admin.sys_dept sd on sd.id = ee.GRID_ID and sd.DEL_FLAG = '0' |
|||
where seur.DEL_FLAG = '0' AND ee.GRID_ID NOT IN ( |
|||
SELECT t.DEPT_ID FROM `js_esua_epdc_admin`.`sys_dept_config` t WHERE t.DEL_FLAG = '0' |
|||
) |
|||
group by ee.MOBILE,ee.GRID_ID |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,24 @@ |
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 网格员事件管理定时任务入参 |
|||
* |
|||
* @Author:songyunpeng |
|||
* @Date:2021/03/02 10:30 |
|||
*/ |
|||
@Data |
|||
public class ScreenGridManagerParamDTO implements Serializable { |
|||
private static final long serialVersionUID = -8868143963953751575L; |
|||
|
|||
/** |
|||
* 网格员事件管理 |
|||
*/ |
|||
private String gridManagerUploadEvent; |
|||
|
|||
|
|||
|
|||
} |
@ -1,18 +0,0 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
/** |
|||
* 大屏基础信息上报 |
|||
* |
|||
* @Author:songyunpeng |
|||
* @Date:2021/6/25 |
|||
*/ |
|||
public interface ScreenBaseReportDataPushTask { |
|||
/** |
|||
* @Description 大屏基础信息上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/6/25 |
|||
* @Param [param] |
|||
* @return void |
|||
**/ |
|||
void run(String param); |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
import com.elink.esua.epdc.feign.AnalysisFeignClient; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @program: esua-epdc |
|||
* @description: 网格员事件管理 |
|||
* @author: syp |
|||
* @create: 2021-02-24 13:48 |
|||
**/ |
|||
@Component("screenGridManagerDataTask") |
|||
public class ScreenGridManagerDataTaskImpl implements ScreenIndexDataPushTask { |
|||
|
|||
private final Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
|
|||
@Autowired |
|||
private AnalysisFeignClient analysisFeignClient; |
|||
|
|||
|
|||
@Override |
|||
public void run(String param) { |
|||
// 网格员数据管理
|
|||
gridManagerUploadData(); |
|||
} |
|||
|
|||
|
|||
private void gridManagerUploadData() { |
|||
// 方法名
|
|||
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
|||
logger.info("<" + methodName + "|【网格员管理】网格员数据管理>定时任务开始执行"); |
|||
analysisFeignClient.selectGridManagerUploadData(); |
|||
logger.info("<" + methodName + "|【网格员管理】网格员数据管理>定时任务执行结束"); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.elink.esua.epdc.dto.ScreenGridManagerParamDTO; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; |
|||
import com.elink.esua.epdc.feign.AnalysisFeignClient; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @program: esua-epdc |
|||
* @description: 网格员事件管理 |
|||
* @author: syp |
|||
* @create: 2021-02-24 13:48 |
|||
**/ |
|||
@Component("screenGridManagerEventsTask") |
|||
public class ScreenGridManagerEventsTaskImpl implements ScreenIndexDataPushTask { |
|||
|
|||
private final Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
|
|||
@Autowired |
|||
private AnalysisFeignClient analysisFeignClient; |
|||
|
|||
|
|||
@Override |
|||
public void run(String param) { |
|||
// 参数处理
|
|||
ScreenGridManagerParamDTO paramDto = new ScreenGridManagerParamDTO(); |
|||
if (StringUtils.isNotEmpty(param)) { |
|||
paramDto = JSONObject.parseObject(param, ScreenGridManagerParamDTO.class); |
|||
} |
|||
// 网格员事件管理
|
|||
gridManagerUploadEvent(paramDto.getGridManagerUploadEvent()); |
|||
} |
|||
|
|||
|
|||
private void gridManagerUploadEvent(String gridManagerUploadEvent) { |
|||
ScreenJobFormDTO formDto = new ScreenJobFormDTO(); |
|||
formDto.setYearMonth(gridManagerUploadEvent); |
|||
// 方法名
|
|||
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
|||
logger.info("<" + methodName + "|【网格员管理】网格员事件管理>定时任务开始执行"); |
|||
analysisFeignClient.selectGridManagerUploadEvent(formDto); |
|||
logger.info("<" + methodName + "|【网格员管理】网格员事件管理>定时任务执行结束"); |
|||
} |
|||
|
|||
} |
@ -1,19 +0,0 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
/** |
|||
* 大屏【事件/项目分析】信息统计上报 |
|||
* |
|||
* @Author: wangtong |
|||
* @Date: 2021/2/24 14:16 |
|||
*/ |
|||
public interface ScreenProjectDataDayPushTask { |
|||
/** |
|||
* 大屏数据推送 |
|||
* |
|||
* @param param 入参 |
|||
* @return void |
|||
* @author wangtong |
|||
* @since 2021/2/24 14:16 |
|||
*/ |
|||
void run(String param); |
|||
} |
@ -1,19 +0,0 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
/** |
|||
* 大屏【事件/项目分析】信息统计上报 |
|||
* |
|||
* @Author: wangtong |
|||
* @Date: 2021/2/24 14:16 |
|||
*/ |
|||
public interface ScreenProjectDataMonthPushTask { |
|||
/** |
|||
* 大屏数据推送 |
|||
* |
|||
* @param param 入参 |
|||
* @return void |
|||
* @author wangtong |
|||
* @since 2021/2/24 14:16 |
|||
*/ |
|||
void run(String param); |
|||
} |
@ -1,19 +0,0 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
/** |
|||
* 大屏项目信息统计上报 |
|||
* |
|||
* @Author: wangtong |
|||
* @Date: 2021/2/24 14:16 |
|||
*/ |
|||
public interface ScreenProjectPushTask { |
|||
/** |
|||
* 大屏数据推送 |
|||
* |
|||
* @param param 入参 |
|||
* @return void |
|||
* @author wangtong |
|||
* @since 2021/2/24 14:16 |
|||
*/ |
|||
void run(String param); |
|||
} |
@ -1,20 +0,0 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
/** |
|||
* 大屏公共信息统计上报 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/9/17 13:56 |
|||
*/ |
|||
public interface ScreenPublicDataPushTask { |
|||
|
|||
/** |
|||
* 大屏数据推送 |
|||
* |
|||
* @param param 入参 |
|||
* @return void |
|||
* @author Liuchuang |
|||
* @since 2020/9/9 15:21 |
|||
*/ |
|||
void run(String param); |
|||
} |
Loading…
Reference in new issue