Browse Source

月度数据 修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
812c432263
  1. 9
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenProjectDataController.java
  2. 14
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenPublicDataController.java
  3. 4
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenProjectDataDao.java
  4. 7
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenPublicDataDao.java
  5. 4
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenProjectDataService.java
  6. 6
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenPublicDataService.java
  7. 21
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenProjectDataServiceImpl.java
  8. 33
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenPublicDataServiceImpl.java
  9. 12
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  10. 124
      esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenPublicDataDao.xml
  11. 42
      esua-epdc/epdc-module/epdc-job/epdc-job-client/src/main/java/com/elink/esua/epdc/dto/ScreenJobMonthDataParamDTO.java
  12. 10
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClient.java
  13. 22
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClientFallback.java
  14. 134
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectDataPushDayTaskImpl.java
  15. 107
      esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectDataPushMonthTaskImpl.java

9
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenProjectDataController.java

@ -1,6 +1,7 @@
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.dto.screen.form.ScreenProjectFormDTO;
import com.elink.esua.epdc.modules.screen.service.ScreenProjectDataService;
import org.springframework.beans.factory.annotation.Autowired;
@ -78,8 +79,8 @@ public class ScreenProjectDataController {
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
@PostMapping("quantity-grid-monthly")
private Result quantityGridMonthly(){
return screenProjectDataService.quantityGridMonthly();
private Result quantityGridMonthly(@RequestBody ScreenJobFormDTO formDto){
return screenProjectDataService.quantityGridMonthly(formDto.getYearMonth());
}
/**
@ -90,7 +91,7 @@ public class ScreenProjectDataController {
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
@PostMapping("quantity-org-monthly")
private Result quantityOrgMonthly(){
return screenProjectDataService.quantityOrgMonthly();
private Result quantityOrgMonthly(@RequestBody ScreenJobFormDTO formDto){
return screenProjectDataService.quantityOrgMonthly(formDto.getYearMonth());
}
}

14
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/controller/ScreenPublicDataController.java

@ -1,9 +1,11 @@
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.ScreenPublicDataService;
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;
@ -98,8 +100,8 @@ public class ScreenPublicDataController {
* @Date: 2020/08/19
*/
@PostMapping("orgrankdata")
public Result orgrankdata() {
return screenPublicDataService.getOrgrankdata();
public Result orgrankdata(@RequestBody ScreenJobFormDTO formDto) {
return screenPublicDataService.getOrgrankdata(formDto.getYearMonth());
}
/**
* 005党建引领|基层治理-居民党员积分排行榜
@ -132,8 +134,8 @@ public class ScreenPublicDataController {
* @Date: 2020/08/20
*/
@PostMapping("userjoin")
public Result userjoin() {
return screenPublicDataService.getUserjoin();
public Result userjoin(@RequestBody ScreenJobFormDTO formDto) {
return screenPublicDataService.getUserjoin(formDto.getYearMonth());
}
/**
@ -155,8 +157,8 @@ public class ScreenPublicDataController {
* @Date: 2020/08/19
*/
@PostMapping("governrankdata")
public Result governrankdata() {
return screenPublicDataService.getGovernrankdata();
public Result governrankdata(@RequestBody ScreenJobFormDTO formDto) {
return screenPublicDataService.getGovernrankdata(formDto.getYearMonth());
}
/**
* @describe: 010中央区各类总数

4
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenProjectDataDao.java

@ -57,7 +57,7 @@ public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataResultDTO
* @params [lastMonth]
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.QuantityGridMonthly>
*/
List<QuantityGridMonthly> selectQuantityGridMonthly(@Param("lastMonth") String lastMonth);
List<QuantityGridMonthly> selectQuantityGridMonthly(@Param("yearMonth") String yearMonth);
/**
* @describe: 事件/项目分析组织内月度数量统计
@ -66,5 +66,5 @@ public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataResultDTO
* @params [lastMonth]
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.QuantityOrgMonthlyDTO>
*/
List<QuantityOrgMonthlyDTO> selectQuantityOrgMonthly(@Param("lastMonth") String lastMonth);
List<QuantityOrgMonthlyDTO> selectQuantityOrgMonthly(@Param("yearMonth") String yearMonth);
}

7
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/dao/ScreenPublicDataDao.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.modules.screen.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.screen.result.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -81,7 +82,7 @@ public interface ScreenPublicDataDao extends BaseDao<ScreenPublicDataResultDTO>
* @Author: wanggongfeng
* @Date: 2020/08/19
*/
List<OrgrankdataResultDTO> getOrgrankdata();
List<OrgrankdataResultDTO> getOrgrankdata(@Param("yearMonth")String yearMonth);
/**
* 005党建引领|基层治理-居民党员积分排行榜
* @Params:
@ -106,7 +107,7 @@ public interface ScreenPublicDataDao extends BaseDao<ScreenPublicDataResultDTO>
* @Author: wanggongfeng
* @Date: 2020/08/20
*/
List<UserjoinResultDTO> getUserjoin();
List<UserjoinResultDTO> getUserjoin(@Param("yearMonth")String yearMonth);
/**
* @describe: 008公众参与各类总数
@ -123,5 +124,5 @@ public interface ScreenPublicDataDao extends BaseDao<ScreenPublicDataResultDTO>
* @Author: wanggongfeng
* @Date: 2020/08/19
*/
List<GovernrankdataResultDTO> getGovernrankdata();
List<GovernrankdataResultDTO> getGovernrankdata(@Param("yearMonth")String yearMonth);
}

4
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenProjectDataService.java

@ -56,7 +56,7 @@ public interface ScreenProjectDataService {
* @params []
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result quantityGridMonthly();
Result quantityGridMonthly(String yearMonth);
/**
* @describe: 事件/项目分析组织内月度数量统计
@ -65,5 +65,5 @@ public interface ScreenProjectDataService {
* @params []
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result quantityOrgMonthly();
Result quantityOrgMonthly(String yearMonth);
}

6
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/ScreenPublicDataService.java

@ -77,7 +77,7 @@ public interface ScreenPublicDataService {
* @Author: wanggongfeng
* @Date: 2020/08/19
*/
Result getOrgrankdata();
Result getOrgrankdata(String yearMonth);
/**
* 005党建引领|基层治理-居民党员积分排行榜
* @Params:
@ -102,7 +102,7 @@ public interface ScreenPublicDataService {
* @Author: wanggongfeng
* @Date: 2020/08/20
*/
Result getUserjoin();
Result getUserjoin(String yearMonth);
/**
* @describe: 008公众参与各类总数
* @author wangtong
@ -119,5 +119,5 @@ public interface ScreenPublicDataService {
* @Author: wanggongfeng
* @Date: 2020/08/19
*/
Result getGovernrankdata();
Result getGovernrankdata(String yearMonth);
}

21
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenProjectDataServiceImpl.java

@ -3,6 +3,7 @@ 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.constant.NumConstant;
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.ScreenProjectFormDTO;
import com.elink.esua.epdc.dto.screen.result.*;
@ -10,9 +11,11 @@ import com.elink.esua.epdc.modules.screen.dao.ScreenProjectDataDao;
import com.elink.esua.epdc.modules.screen.service.ScreenProjectDataService;
import com.elink.esua.epdc.utils.EpmetUtils;
import com.elink.esua.epdc.utils.ScreenDataUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
@ -101,24 +104,26 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
}
@Override
public Result quantityGridMonthly() {
String lastMonth = ScreenDataUtils.getLastMonthDate();
public Result quantityGridMonthly(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
// 数据统计
List<QuantityGridMonthly> data = baseDao.selectQuantityGridMonthly(lastMonth);
List<QuantityGridMonthly> data = baseDao.selectQuantityGridMonthly(yearMonth);
// 数据格式化
String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, null,true);
String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, yearMonth,true);
// 数据上报
epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_GRID_MONTHLY, dataJson);
return new Result();
}
@Override
public Result quantityOrgMonthly() {
String lastMonth = ScreenDataUtils.getLastMonthDate();
public Result quantityOrgMonthly(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
// 数据统计
List<QuantityOrgMonthlyDTO> data = baseDao.selectQuantityOrgMonthly(lastMonth);
List<QuantityOrgMonthlyDTO> data = baseDao.selectQuantityOrgMonthly(yearMonth);
// 数据格式化
String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, null,true);
String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, yearMonth,true);
// 数据上报
epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_ORG_MONTHLY, dataJson);
return new Result();

33
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/screen/service/impl/ScreenPublicDataServiceImpl.java

@ -3,16 +3,19 @@ package com.elink.esua.epdc.modules.screen.service.impl;
import com.alibaba.fastjson.JSONObject;
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.result.*;
import com.elink.esua.epdc.modules.screen.dao.ScreenPublicDataDao;
import com.elink.esua.epdc.modules.screen.service.ScreenPublicDataService;
import com.elink.esua.epdc.utils.EpmetUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -137,15 +140,18 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl<ScreenPublicDat
* @Return: OrgrankdataResultDTO
* @Author: wanggongfeng
* @Date: 2020/08/19
* @param yearMonth
*/
@Override
public Result getOrgrankdata() {
List<OrgrankdataResultDTO> list = baseDao.getOrgrankdata();
public Result getOrgrankdata(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
List<OrgrankdataResultDTO> list = baseDao.getOrgrankdata(yearMonth);
// 将list转换为json格式
if(list != null && list.size()>0){
OrgrankdataDTO result = new OrgrankdataDTO();
result.setDataList(list);
result.setMonthId(list.get(0).getMonthId());
result.setMonthId(yearMonth);
String json = JSONObject.toJSONString(result);
String body = epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_COLL_ORG_RANK, json);
log.info(body);
@ -207,22 +213,24 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl<ScreenPublicDat
* @Return: UserjoinResultDTO
* @Author: wanggongfeng
* @Date: 2020/08/20
* @param formDto
*/
@Override
public Result getUserjoin() {
List<UserjoinResultDTO> list = baseDao.getUserjoin();
public Result getUserjoin(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
List<UserjoinResultDTO> list = baseDao.getUserjoin(yearMonth);
// 将list转换为json格式
if(list != null && list.size()>0) {
UserjoinDTO result = new UserjoinDTO();
result.setDataList(list);
result.setMonthId(list.get(0).getMonthId());
result.setMonthId(yearMonth);
String json = JSONObject.toJSONString(result);
String body = epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_COLL_USER_JOIN, json);
log.info(body);
}
return null;
}
/**
* @describe: 008公众参与各类总数
* @author wangtong
@ -242,21 +250,25 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl<ScreenPublicDat
return null;
}
/**
* 009基层治理-治理能力数据
* @Params:
* @Return: GovernrankdataResultDTO
* @Author: wanggongfeng
* @Date: 2020/08/19
* @param formDto
*/
@Override
public Result getGovernrankdata() {
List<GovernrankdataResultDTO> list = baseDao.getGovernrankdata();
public Result getGovernrankdata(String yearMonth) {
// 如果统计月份为空,则统计上个月的数据
yearMonth = StringUtils.isEmpty(yearMonth) ? DateUtils.formatYearMonth(DateUtils.addDateMonths(new Date(),-1)) : yearMonth;
List<GovernrankdataResultDTO> list = baseDao.getGovernrankdata(yearMonth);
// 将list转换为json格式
if(list != null && list.size()>0){
GovernrankdataDTO result = new GovernrankdataDTO();
result.setDataList(list);
result.setMonthId(list.get(0).getMonthId());
result.setMonthId(yearMonth);
String json = JSONObject.toJSONString(result);
String body = epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_COLL_GOVERN_RANK, json);
log.info(body);
@ -265,6 +277,7 @@ public class ScreenPublicDataServiceImpl extends BaseServiceImpl<ScreenPublicDat
}
/**
* 将一组数据固定分组每组n个元素
*

12
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -212,7 +212,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) = #{lastMonth}
AND date_format( lin.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
group by lin.EVENT_ID)li
group by li.GRID_ID)it on it.GRID_ID=sd.id
left join (select al.GRID_ID,
@ -222,7 +222,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;= #{lastMonth}
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;= #{yearMonth}
group by lin.EVENT_ID)al
group by al.GRID_ID)li2 on li2.GRID_ID=sd.id
WHERE sd.`del_flag`= 0
@ -252,7 +252,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{lastMonth}
AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{yearMonth}
group by lin.EVENT_ID)li
group by li.GRID_ID)it on it.GRID_ID=sd.id
left join (select al.GRID_ID,
@ -262,7 +262,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;=#{lastMonth}
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;=#{yearMonth}
group by lin.EVENT_ID)al
group by al.GRID_ID)li2 on li2.GRID_ID=sd.id
WHERE sd.`del_flag`= 0
@ -292,7 +292,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{lastMonth}
AND date_format( lin.CREATED_TIME, '%Y-%m' ) =#{yearMonth}
group by lin.EVENT_ID)li
group by li.GRID_ID)it on it.GRID_ID=sd.id
left join (select al.GRID_ID,
@ -302,7 +302,7 @@
from (select lin.*
from (select * from esua_epdc_events.epdc_item order by id) lin
where lin.DEL_FLAG=0
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;=#{lastMonth}
AND date_format( lin.CREATED_TIME, '%Y-%m' ) &lt;=#{yearMonth}
group by lin.EVENT_ID)al
group by al.GRID_ID)li2 on li2.GRID_ID=sd.id
WHERE sd.`del_flag`= 0

124
esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenPublicDataDao.xml

@ -1466,8 +1466,8 @@ select gr.id as orgId,
IFNULL(t.projectTotal,0) as satisfactionRatioFm
from (
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -1478,9 +1478,9 @@ select gr.id as orgId,
select
count(*) groupTotal
from esua_epdc_party_group.epdc_party_group ws
where ws.DEL_FLAG = '0' and date_format(ws.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ),'%Y-%m' )
where ws.DEL_FLAG = '0' and date_format(ws.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
) groupTotal,
(select count(*) topicTotal from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) ) topicTotal,
(select count(*) topicTotal from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = #{yearMonth} ) topicTotal,
(
SELECT
count( t.a ) issueTotal
@ -1493,7 +1493,7 @@ select gr.id as orgId,
esua_epdc_events.epdc_issue mei
WHERE
mei.DEL_FLAG = '0'
AND date_format( mei.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format( mei.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY
EVENT_ID
)t
@ -1510,14 +1510,14 @@ select gr.id as orgId,
esua_epdc_events.epdc_item item
WHERE
item.DEL_FLAG = '0'
AND date_format( item.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format( item.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY
EVENT_ID
)t
) projectTotal,
(select count(*) itemCloseTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.ITEM_STATE = 10 ) itemCloseTotal,
(select count(*) itemSatisfiedTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 1 ) itemSatisfiedTotal,
(select count(*) itemVeryTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 2 ) itemVeryTotal
(select count(*) itemCloseTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.ITEM_STATE = 10 ) itemCloseTotal,
(select count(*) itemSatisfiedTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 ) itemSatisfiedTotal,
(select count(*) itemVeryTotal from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 ) itemVeryTotal
from esua_epdc_admin.sys_dept sd
where sd.DEL_FLAG = '0'
AND sd.id IS NOT NULL
@ -1526,8 +1526,8 @@ select gr.id as orgId,
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -1570,7 +1570,7 @@ select gr.id as orgId,
left join (
select sum(topn.topNum) topNum ,d2.PID DEPT_ID from
( select top.GRID_ID ,count(*) topNum from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0'
and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) group by top.GRID_ID ) topn
and date_format(top.CREATED_TIME, '%Y-%m' ) = #{yearMonth} group by top.GRID_ID ) topn
left join esua_epdc_admin.sys_dept d1 on d1.ID = topn.GRID_ID
left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID
group by d2.PID
@ -1591,7 +1591,7 @@ select gr.id as orgId,
esua_epdc_events.epdc_issue mei
WHERE
mei.DEL_FLAG = '0'
AND date_format( mei.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format( mei.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY
EVENT_ID,
GRID_ID
@ -1619,7 +1619,7 @@ select gr.id as orgId,
esua_epdc_events.epdc_item item
WHERE
item.DEL_FLAG = '0'
AND date_format( item.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format( item.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY
EVENT_ID,
GRID_ID
@ -1634,7 +1634,7 @@ select gr.id as orgId,
left join (
select sum(itemgrid.itemNum) itemNum ,d2.PID DEPT_ID from
( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.ITEM_STATE = 10 group by item.GRID_ID ) itemgrid
and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.ITEM_STATE = 10 group by item.GRID_ID ) itemgrid
left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID
left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID
group by d2.PID
@ -1642,7 +1642,7 @@ select gr.id as orgId,
left join (
select sum(itemgrid.itemNum) itemNum ,d2.PID DEPT_ID from
( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 1 group by item.GRID_ID ) itemgrid
and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.GRID_ID ) itemgrid
left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID
left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID
group by d2.PID
@ -1650,7 +1650,7 @@ select gr.id as orgId,
left join (
select sum(itemgrid.itemNum) itemNum ,d2.PID DEPT_ID from
( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 2 group by item.GRID_ID ) itemgrid
and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 group by item.GRID_ID ) itemgrid
left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID
left join esua_epdc_admin.sys_dept d2 on d1.PID = d2.ID
group by d2.PID
@ -1661,8 +1661,8 @@ select gr.id as orgId,
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -1704,7 +1704,7 @@ select gr.id as orgId,
left join (
select sum(topn.topNum) topNum ,d1.PID DEPT_ID from
( select top.GRID_ID ,count(*) topNum from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0'
and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) group by top.GRID_ID ) topn
and date_format(top.CREATED_TIME, '%Y-%m' ) = #{yearMonth} group by top.GRID_ID ) topn
left join esua_epdc_admin.sys_dept d1 on d1.ID = topn.GRID_ID group by d1.PID
) topCount on topCount.DEPT_ID = sd.ID
left join (
@ -1723,7 +1723,7 @@ select gr.id as orgId,
esua_epdc_events.epdc_issue mei
WHERE
mei.DEL_FLAG = '0'
AND date_format( mei.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format( mei.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY
EVENT_ID,
GRID_ID
@ -1751,7 +1751,7 @@ select gr.id as orgId,
esua_epdc_events.epdc_item item
WHERE
item.DEL_FLAG = '0'
AND date_format( item.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format( item.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY
EVENT_ID,
GRID_ID
@ -1765,19 +1765,19 @@ select gr.id as orgId,
left join (
select sum(itemgrid.itemNum) itemNum ,d1.PID DEPT_ID from
( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.ITEM_STATE = 10 group by item.GRID_ID ) itemgrid
and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.ITEM_STATE = 10 group by item.GRID_ID ) itemgrid
left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID
) itemCloseCount on itemCloseCount.DEPT_ID = sd.ID
left join (
select sum(itemgrid.itemNum) itemNum ,d1.PID DEPT_ID from
( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 1 group by item.GRID_ID ) itemgrid
and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.GRID_ID ) itemgrid
left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID
) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID
left join (
select sum(itemgrid.itemNum) itemNum ,d1.PID DEPT_ID from
( select item.GRID_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0'
and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 2 group by item.GRID_ID ) itemgrid
and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 group by item.GRID_ID ) itemgrid
left join esua_epdc_admin.sys_dept d1 on d1.ID = itemgrid.GRID_ID group by d1.PID
) itemVeryCount on itemVeryCount.DEPT_ID = sd.ID
where sd.DEL_FLAG = '0'
@ -1789,8 +1789,8 @@ select gr.id as orgId,
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'grid' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -1811,10 +1811,10 @@ select gr.id as orgId,
count(*) as TIMES_TOTAL,
ws.DEPT_ID as DEPT_ID
from esua_epdc_party_group.epdc_party_group ws
where ws.DEL_FLAG = '0' and date_format(ws.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ),'%Y-%m' )
where ws.DEL_FLAG = '0' and date_format(ws.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY ws.DEPT_ID
) tto on tto.DEPT_ID = sd.ID
left join (select top.GRID_ID DEPT_ID ,count(*) topNum from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) group by top.GRID_ID) topCount on topCount.DEPT_ID = sd.ID
left join (select top.GRID_ID DEPT_ID ,count(*) topNum from esua_epdc_party_group.epdc_party_topic top where top.DEL_FLAG = '0' and date_format(top.CREATED_TIME, '%Y-%m' ) = #{yearMonth} group by top.GRID_ID) topCount on topCount.DEPT_ID = sd.ID
left join (
SELECT
count( t.a ) issueNum,
@ -1829,7 +1829,7 @@ select gr.id as orgId,
esua_epdc_events.epdc_issue mei
WHERE
mei.DEL_FLAG = '0'
AND date_format( mei.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format( mei.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY
EVENT_ID,
GRID_ID
@ -1851,7 +1851,7 @@ select gr.id as orgId,
esua_epdc_events.epdc_item item
WHERE
item.DEL_FLAG = '0'
AND date_format( item.CREATED_TIME, '%Y-%m' ) = date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format( item.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY
EVENT_ID,
GRID_ID
@ -1859,9 +1859,9 @@ select gr.id as orgId,
GROUP BY
t.GRID_ID
) itemCount on itemCount.DEPT_ID = sd.ID
left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.ITEM_STATE = 10 group by item.GRID_ID) itemCloseCount on itemCloseCount.DEPT_ID = sd.ID
left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 1 group by item.GRID_ID) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID
left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' ) and item.EVALUATION_SCORE = 2 group by item.GRID_ID) itemVeryCount on itemVeryCount.DEPT_ID = sd.ID
left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.ITEM_STATE = 10 group by item.GRID_ID) itemCloseCount on itemCloseCount.DEPT_ID = sd.ID
left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 1 group by item.GRID_ID) itemSatisfiedCount on itemSatisfiedCount.DEPT_ID = sd.ID
left join (select item.GRID_ID DEPT_ID ,count(*) itemNum from esua_epdc_events.epdc_item item where item.DEL_FLAG = '0' and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth} and item.EVALUATION_SCORE = 2 group by item.GRID_ID) itemVeryCount on itemVeryCount.DEPT_ID = sd.ID
where sd.DEL_FLAG = '0'
AND sd.id IS NOT NULL
AND sd.`id` NOT IN( SELECT t.`dept_id`
@ -1955,8 +1955,8 @@ select gr.id as orgId,
from
(
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -2016,7 +2016,7 @@ select gr.id as orgId,
esua_epdc_analysis.epdc_user_behavior_log behavior
LEFT JOIN esua_epdc_user.epdc_user USER ON USER.ID = behavior.USER_ID AND USER.DEL_FLAG = '0'
WHERE behavior.USER_ID in ( select meu.ID from esua_epdc_user.epdc_user meu )
AND date_format(behavior.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format(behavior.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY USER_ID, USER.DEPT_ID
) behaviorCount
GROUP BY behaviorCount.DEPT_ID) be
@ -2034,7 +2034,7 @@ select gr.id as orgId,
eisu.GRID_ID DEPT_ID,
count(*) issueNum
from esua_epdc_events.epdc_issue eisu
where eisu.DEL_FLAG = '0' AND date_format(eisu.DISTRIBUTE_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
where eisu.DEL_FLAG = '0' AND date_format(eisu.DISTRIBUTE_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY eisu.GRID_ID
) isuCount
left join esua_epdc_admin.sys_dept d1 on d1.ID = isuCount.DEPT_ID
@ -2052,8 +2052,8 @@ select gr.id as orgId,
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -2111,7 +2111,7 @@ select gr.id as orgId,
FROM esua_epdc_analysis.epdc_user_behavior_log behavior
LEFT JOIN esua_epdc_user.epdc_user USER ON USER.ID = behavior.USER_ID AND USER.DEL_FLAG = '0'
WHERE behavior.USER_ID in ( select meu.ID from esua_epdc_user.epdc_user meu )
AND date_format(behavior.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format(behavior.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY USER_ID, USER.DEPT_ID
) behaviorCount
GROUP BY behaviorCount.DEPT_ID) be
@ -2127,7 +2127,7 @@ select gr.id as orgId,
eisu.GRID_ID DEPT_ID,
count(*) issueNum
from esua_epdc_events.epdc_issue eisu
where eisu.DEL_FLAG = '0' AND date_format(eisu.DISTRIBUTE_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
where eisu.DEL_FLAG = '0' AND date_format(eisu.DISTRIBUTE_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY eisu.GRID_ID
) isuCount
left join esua_epdc_admin.sys_dept d1 on d1.ID = isuCount.DEPT_ID
@ -2143,8 +2143,8 @@ select gr.id as orgId,
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -2197,7 +2197,7 @@ select gr.id as orgId,
FROM esua_epdc_analysis.epdc_user_behavior_log behavior
LEFT JOIN esua_epdc_user.epdc_user USER ON USER.ID = behavior.USER_ID AND USER.DEL_FLAG = '0'
WHERE behavior.USER_ID in ( select meu.ID from esua_epdc_user.epdc_user meu )
AND date_format(behavior.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format(behavior.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY USER_ID, USER.DEPT_ID
) behaviorCount
GROUP BY behaviorCount.DEPT_ID) be
@ -2212,7 +2212,7 @@ select gr.id as orgId,
eisu.GRID_ID DEPT_ID,
count(*) issueNum
from esua_epdc_events.epdc_issue eisu
where eisu.DEL_FLAG = '0' AND date_format(eisu.DISTRIBUTE_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
where eisu.DEL_FLAG = '0' AND date_format(eisu.DISTRIBUTE_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY eisu.GRID_ID
) isuCount
left join esua_epdc_admin.sys_dept d1 on d1.ID = isuCount.DEPT_ID group by d1.PID
@ -2227,8 +2227,8 @@ select gr.id as orgId,
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'grid' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -2274,7 +2274,7 @@ select gr.id as orgId,
LEFT JOIN esua_epdc_user.epdc_user USER ON USER.ID = behavior.USER_ID
AND USER.DEL_FLAG = '0'
WHERE behavior.USER_ID in ( select meu.ID from esua_epdc_user.epdc_user meu )
AND date_format(behavior.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
AND date_format(behavior.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY USER_ID, USER.DEPT_ID
) behaviorCount
GROUP BY behaviorCount.DEPT_ID
@ -2284,7 +2284,7 @@ select gr.id as orgId,
eisu.GRID_ID dept_ID,
count(*) issueNum
from esua_epdc_events.epdc_issue eisu
where eisu.DEL_FLAG = '0' AND date_format(eisu.DISTRIBUTE_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
where eisu.DEL_FLAG = '0' AND date_format(eisu.DISTRIBUTE_TIME, '%Y-%m' ) = #{yearMonth}
GROUP BY eisu.GRID_ID
) issueNumber on issueNumber.dept_ID = sd.ID
where sd.DEL_FLAG = '0'
@ -2879,8 +2879,8 @@ union all
<!-- 009 -->
<select id="getGovernrankdata" resultType="com.elink.esua.epdc.dto.screen.result.GovernrankdataResultDTO">
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -2921,7 +2921,7 @@ union all
from (
SELECT *,
( SELECT CREATED_TIME FROM esua_epdc_events.epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME
FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
) mee
LEFT JOIN esua_epdc_events.epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0'
left join (select count(*) as deptCount,ITEM_ID from esua_epdc_events.epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID
@ -2942,8 +2942,8 @@ union all
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -2980,7 +2980,7 @@ union all
from (
SELECT *,
( SELECT CREATED_TIME FROM esua_epdc_events.epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME
FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
) mee
LEFT JOIN esua_epdc_events.epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0'
left join (select count(*) as deptCount,ITEM_ID from esua_epdc_events.epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID
@ -2999,8 +2999,8 @@ union all
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'agency' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -3038,7 +3038,7 @@ union all
from (
SELECT *,
( SELECT CREATED_TIME FROM esua_epdc_events.epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME
FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
) mee
LEFT JOIN esua_epdc_events.epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0'
left join (select count(*) as deptCount,ITEM_ID from esua_epdc_events.epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID
@ -3057,8 +3057,8 @@ union all
union all
select
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y' ) yearId,
date_format( date_add( now( ), INTERVAL - 1 DAY ), '%Y%m' ) monthId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
'grid' as orgType,
sd.ID orgId,
sd.PID parentId,
@ -3095,7 +3095,7 @@ union all
from (
SELECT *,
( SELECT CREATED_TIME FROM esua_epdc_events.epdc_issue_handle WHERE DEL_FLAG = '0' AND STATE = '1' AND ISSUE_ID = issue.id ORDER BY CREATED_TIME DESC, id DESC LIMIT 1) AS HANDLE_CREATED_TIME
FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = date_format(date_add( now( ), INTERVAL - 1 DAY ), '%Y-%m' )
FROM esua_epdc_events.epdc_issue issue where issue.DEL_FLAG = '0' and date_format(issue.CREATED_TIME, '%Y-%m' ) = #{yearMonth}
) mee
LEFT JOIN esua_epdc_events.epdc_item mei ON mee.id = mei.ISSUE_ID and mei.DEL_FLAG = '0'
left join (select count(*) as deptCount,ITEM_ID from esua_epdc_events.epdc_item_dept where DEL_FLAG = '0' group by ITEM_ID) ide on ide.ITEM_ID = mei.ID

42
esua-epdc/epdc-module/epdc-job/epdc-job-client/src/main/java/com/elink/esua/epdc/dto/ScreenJobMonthDataParamDTO.java

@ -0,0 +1,42 @@
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 大屏基础月度定时任务入参
*
* @Authorsongyunpeng
* @Date2021/03/02 10:30
*/
@Data
public class ScreenJobMonthDataParamDTO implements Serializable {
private static final long serialVersionUID = -8868143963953751575L;
/**
* 事件/项目分析网格内月度数量统计
*/
private String gridMonthDataMonthId;
/**
* 事件/项目分析组织内月度数量统计
*/
private String orgMonthDataMonthId;
/**
* 党建引领-先进排行榜单-先进支部排行
*/
private String customerOrgRankDataMonthId;
/**
* 基层治理-公众参与
*/
private String customerUserJoinMonthId;
/**
* 基层治理-治理能力数据
*/
private String customerGovernRankData;
}

10
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClient.java

@ -180,7 +180,7 @@ public interface AnalysisFeignClient {
* @since 2020/9/17 14:02
*/
@PostMapping("analysis/data/stats/screencoll/orgrankdata")
Result orgrankdata();
Result orgrankdata(ScreenJobFormDTO formDto);
/**
* 005党建引领|基层治理-居民党员积分排行榜
*
@ -207,7 +207,7 @@ public interface AnalysisFeignClient {
* @since 2020/9/17 14:02
*/
@PostMapping("analysis/data/stats/screencoll/userjoin")
Result userjoin();
Result userjoin(ScreenJobFormDTO formDto);
/**
* 008公众参与各类总数
*
@ -225,7 +225,7 @@ public interface AnalysisFeignClient {
* @since 2020/9/17 14:02
*/
@PostMapping("analysis/data/stats/screencoll/governrankdata")
Result governrankdata();
Result governrankdata(ScreenJobFormDTO formDto);
/**
* 010中央区各类总数
*
@ -265,7 +265,7 @@ public interface AnalysisFeignClient {
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
@PostMapping("analysis/data/stats/project/quantity-grid-monthly")
Result quantityGridMonthly();
Result quantityGridMonthly(ScreenJobFormDTO formDto);
/**
* @describe: 事件/项目分析组织内月度数量统计
@ -275,7 +275,7 @@ public interface AnalysisFeignClient {
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
@PostMapping("analysis/data/stats/project/quantity-org-monthly")
Result quantityOrgMonthly();
Result quantityOrgMonthly(ScreenJobFormDTO formDto);
/**
* @Description 项目信息上报

22
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClientFallback.java

@ -91,8 +91,8 @@ public class AnalysisFeignClientFallback implements AnalysisFeignClient {
}
@Override
public Result orgrankdata() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "orgrankdata");
public Result orgrankdata(ScreenJobFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "orgrankdata",formDto);
}
@Override
@ -106,20 +106,20 @@ public class AnalysisFeignClientFallback implements AnalysisFeignClient {
}
@Override
public Result userjoin() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "userjoin");
public Result userjoin(ScreenJobFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "userjoin",formDto);
}
@Override
public Result publicpartitotaldata() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "publicpartitotaldata");
}
@Override
public Result governrankdata() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "governrankdata");
public Result governrankdata(ScreenJobFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "governrankdata",formDto);
}
@Override
public Result usertotaldata() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "usertotaldata");
@ -136,13 +136,13 @@ public class AnalysisFeignClientFallback implements AnalysisFeignClient {
}
@Override
public Result quantityGridMonthly() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "quantityGridMonthly");
public Result quantityGridMonthly(ScreenJobFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "quantityGridMonthly",formDto);
}
@Override
public Result quantityOrgMonthly() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "quantityOrgMonthly");
public Result quantityOrgMonthly(ScreenJobFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "quantityOrgMonthly",formDto);
}
@Override

134
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectDataPushDayTaskImpl.java

@ -41,52 +41,43 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
@Override
public void run(String param) {
for(int i = 0 ; i < 14 ; i++){
for (int i = 0; i < 11; i++) {
createThread(i);
}
}
public Integer createThread(Integer methodIndex){
public Integer createThread(Integer methodIndex) {
Future<Integer> future = service.submit(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
Thread.sleep(200);
if (methodIndex == 0) {
projectGridDaily();
} else if (methodIndex == 1){
} else if (methodIndex == 1) {
projectOrgDaily();
}else if (methodIndex == 2){
} else if (methodIndex == 2) {
uploadProjectInfo();
} else if (methodIndex == 3){
} else if (methodIndex == 3) {
uploadProjectProcess();
}else if (methodIndex == 4){
} else if (methodIndex == 4) {
//001、基层党建-党员基本情况
customerCpcbasedata();
}else if (methodIndex == 5){
} else if (methodIndex == 5) {
//002、党建引领-先锋模范数据
customerPioneerdata();
}else if (methodIndex == 6){
} else if (methodIndex == 6) {
//003、党建引领-党员联系群众数据
customerPartylinkmassesdata();
}else if (methodIndex == 7){
//004、党建引领-先进排行榜单-先进支部排行
customerOrgrankdata();
}else if (methodIndex == 8){
} else if (methodIndex == 7) {
//005、党建引领|基层治理-居民(党员)积分排行榜
customerPartyuserrankdata();
}else if (methodIndex == 9){
} else if (methodIndex == 8) {
//006、基层治理-难点赌点项目上报
customerDifficultydata();
}else if (methodIndex == 10){
//007、基层治理-公众参与
customerUserjoin();
}else if (methodIndex == 11){
} else if (methodIndex == 9) {
// 008、公众参与各类总数
customerPublicpartitotaldata();
}else if (methodIndex == 12){
//009、基层治理-治理能力数据
customerGovernrankdata();
}else if (methodIndex == 13){
} else if (methodIndex == 10) {
// 010、中央区各类总数
customerUsertotaldata();
}
@ -96,39 +87,40 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
Integer isSuccess = 0;
try {
isSuccess = future.get();
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return isSuccess;
}
/**
* @Description 项目信息上报
* @return void
* @Description 项目信息上报
* @Author songyunpeng
* @Date 2021/2/24
* @Date 2021/2/24
* @Param []
* @return void
**/
private void uploadProjectInfo() {
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|项目信息上报>定时任务开始执行");
//获取上次统计时间
Map<String,Object> param = new HashMap<>();
param.put("JOB_NAME","uploadProjectInfo");
Map<String, Object> param = new HashMap<>();
param.put("JOB_NAME", "uploadProjectInfo");
List<ScreenRecordEntity> screenRecordEntities = screenRecordDao.selectByMap(param);
ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity();
ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO();
if(screenRecordEntities==null || screenRecordEntities.size()==0){
if (screenRecordEntities == null || screenRecordEntities.size() == 0) {
screenProjectFormDTO.setYearMonthDay("2020-01-01");
}else {
} else {
screenRecordEntity = screenRecordEntities.get(0);
screenProjectFormDTO.setYearMonthDay(DateUtils.format(screenRecordEntity.getStatisticsTime(), DateUtils.DATE_PATTERN));
}
//记录此次统计时间 并更新时间或者新增
screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(),-1));
if(StringUtils.isNotBlank(screenRecordEntity.getId())){
screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(), -1));
if (StringUtils.isNotBlank(screenRecordEntity.getId())) {
screenRecordDao.updateById(screenRecordEntity);
}else {
} else {
screenRecordEntity.setJobName("uploadProjectInfo");
screenRecordDao.insert(screenRecordEntity);
}
@ -137,33 +129,33 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
}
/**
* @Description 项目处理流程信息上报
* @return void
* @Description 项目处理流程信息上报
* @Author songyunpeng
* @Date 2021/2/24
* @Date 2021/2/24
* @Param []
* @return void
**/
private void uploadProjectProcess() {
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|项目处理流程信息上报>定时任务开始执行");
//获取上次统计时间
Map<String,Object> param = new HashMap<>();
param.put("JOB_NAME","uploadProjectProcess");
Map<String, Object> param = new HashMap<>();
param.put("JOB_NAME", "uploadProjectProcess");
List<ScreenRecordEntity> screenRecordEntities = screenRecordDao.selectByMap(param);
ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity();
ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO();
if(screenRecordEntities==null || screenRecordEntities.size()==0){
if (screenRecordEntities == null || screenRecordEntities.size() == 0) {
screenProjectFormDTO.setYearMonthDay("2020-01-01");
}else {
} else {
screenRecordEntity = screenRecordEntities.get(0);
screenProjectFormDTO.setYearMonthDay(DateUtils.format(screenRecordEntity.getStatisticsTime(), DateUtils.DATE_PATTERN));
}
//记录此次统计时间 并更新时间或者新增
screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(),-1));
if(StringUtils.isNotBlank(screenRecordEntity.getId())){
screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(), -1));
if (StringUtils.isNotBlank(screenRecordEntity.getId())) {
screenRecordDao.updateById(screenRecordEntity);
}else {
} else {
screenRecordEntity.setJobName("uploadProjectProcess");
screenRecordDao.insert(screenRecordEntity);
}
@ -172,12 +164,12 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
}
/**
* @describe: 事件/项目分析网格内事件
* @author wangtong
* @date 2021/2/24 13:57
* @params []
* @return void
*/
* @return void
* @describe: 事件/项目分析网格内事件
* @author wangtong
* @date 2021/2/24 13:57
* @params []
*/
private void projectGridDaily() {
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
@ -188,11 +180,11 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
}
/**
* @return void
* @describe: 事件/项目分析组织内事件
* @author wangtong
* @date 2021/2/24 13:57
* @params []
* @return void
*/
private void projectOrgDaily() {
// 方法名
@ -201,6 +193,7 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
analysisFeignClient.projectOrgDaily();
logger.info("<" + methodName + "|事件/项目分析】组织内事件>定时任务执行结束");
}
/**
* 010中央区各类总数
*
@ -216,21 +209,6 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
logger.info("<" + methodName + "|中央区各类总数>定时任务执行结束");
}
/**
* 009基层治理-治理能力数据
*
* @return void
* @author WK
* @since 2020/9/17 14:01
*/
private void customerGovernrankdata() {
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|基层治理-治理能力数据>定时任务开始执行");
analysisFeignClient.governrankdata();
logger.info("<" + methodName + "|基层治理-治理能力数据>定时任务执行结束");
}
/**
* 008公众参与各类总数
*
@ -246,20 +224,6 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
logger.info("<" + methodName + "|公众参与各类总数>定时任务执行结束");
}
/**
* 007基层治理-公众参与
*
* @return void
* @author WK
* @since 2020/9/17 14:01
*/
private void customerUserjoin() {
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|基层治理-公众参与>定时任务开始执行");
analysisFeignClient.userjoin();
logger.info("<" + methodName + "|基层治理-公众参与>定时任务执行结束");
}
/**
* 006基层治理-难点赌点项目上报
@ -291,20 +255,6 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP
logger.info("<" + methodName + "|党建引领|基层治理-居民(党员)积分排行榜>定时任务执行结束");
}
/**
* 004党建引领-先进排行榜单-先进支部排行
*
* @return void
* @author WK
* @since 2020/9/17 14:01
*/
private void customerOrgrankdata() {
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|党建引领-先进排行榜单-先进支部排行>定时任务开始执行");
analysisFeignClient.orgrankdata();
logger.info("<" + methodName + "|党建引领-先进排行榜单-先进支部排行>定时任务执行结束");
}
/**
* 003党建引领-党员联系群众数据

107
esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectDataPushMonthTaskImpl.java

@ -1,6 +1,11 @@
package com.elink.esua.epdc.task.screen;
import com.alibaba.fastjson.JSONObject;
import com.elink.esua.epdc.dao.ScreenRecordDao;
import com.elink.esua.epdc.dto.ScreenJobMonthDataParamDTO;
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;
@ -27,22 +32,37 @@ public class ScreenProjectDataPushMonthTaskImpl implements ScreenProjectDataMont
@Autowired
private AnalysisFeignClient analysisFeignClient;
@Override
public void run(String param) {
for(int i = 0 ; i < 2 ; i++){
createThread(i);
// 参数处理
ScreenJobMonthDataParamDTO paramDto = new ScreenJobMonthDataParamDTO();
if (StringUtils.isNotEmpty(param)) {
paramDto = JSONObject.parseObject(param, ScreenJobMonthDataParamDTO.class);
}
for (int i = 0; i < 5; i++) {
createThread(i, paramDto);
}
}
public Integer createThread(Integer methodIndex){
public Integer createThread(Integer methodIndex, ScreenJobMonthDataParamDTO paramDto) {
Future<Integer> future = service.submit(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
Thread.sleep(200);
if (methodIndex == 0) {
quantityGridMonthly();
} else if (methodIndex == 1){
quantityOrgMonthly();
quantityGridMonthly(paramDto.getGridMonthDataMonthId());
} else if (methodIndex == 1) {
quantityOrgMonthly(paramDto.getOrgMonthDataMonthId());
} else if (methodIndex == 2) {
//004、党建引领-先进排行榜单-先进支部排行 --
customerOrgrankdata(paramDto.getCustomerOrgRankDataMonthId());
} else if (methodIndex == 3) {
//007、基层治理-公众参与 --
customerUserjoin(paramDto.getCustomerUserJoinMonthId());
} else if (methodIndex == 4) {
//009、基层治理-治理能力数据 --
customerGovernrankdata(paramDto.getCustomerGovernRankData());
}
return 0;
}
@ -50,39 +70,100 @@ public class ScreenProjectDataPushMonthTaskImpl implements ScreenProjectDataMont
Integer isSuccess = 0;
try {
isSuccess = future.get();
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return isSuccess;
}
/**
* @param gridMonthDataMonthId
* @return void
* @describe: 事件/项目分析网格内月度数量统计
* @author wangtong
* @date 2021/2/24 13:57
* @params []
* @return void
*/
private void quantityGridMonthly() {
private void quantityGridMonthly(String gridMonthDataMonthId) {
ScreenJobFormDTO formDto = new ScreenJobFormDTO();
formDto.setYearMonth(gridMonthDataMonthId);
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|【事件/项目分析】网格内月度数量统计>定时任务开始执行");
analysisFeignClient.quantityGridMonthly();
analysisFeignClient.quantityGridMonthly(formDto);
logger.info("<" + methodName + "|【事件/项目分析】网格内月度数量统计>定时任务执行结束");
}
/**
* @param orgMonthDataMonthId
* @return void
* @describe: 事件/项目分析组织内月度数量统计
* @author wangtong
* @date 2021/2/24 13:57
* @params []
* @return void
*/
private void quantityOrgMonthly() {
private void quantityOrgMonthly(String orgMonthDataMonthId) {
ScreenJobFormDTO formDto = new ScreenJobFormDTO();
formDto.setYearMonth(orgMonthDataMonthId);
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|事件/项目分析】组织内月度数量统计>定时任务开始执行");
analysisFeignClient.quantityOrgMonthly();
analysisFeignClient.quantityOrgMonthly(formDto);
logger.info("<" + methodName + "|事件/项目分析】组织内月度数量统计>定时任务执行结束");
}
/**
* 004党建引领-先进排行榜单-先进支部排行
*
* @param customerOrgRankDataMonthId
* @return void
* @author WK
* @since 2020/9/17 14:01
*/
private void customerOrgrankdata(String customerOrgRankDataMonthId) {
ScreenJobFormDTO formDto = new ScreenJobFormDTO();
formDto.setYearMonth(customerOrgRankDataMonthId);
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|党建引领-先进排行榜单-先进支部排行>定时任务开始执行");
analysisFeignClient.orgrankdata(formDto);
logger.info("<" + methodName + "|党建引领-先进排行榜单-先进支部排行>定时任务执行结束");
}
/**
* 007基层治理-公众参与
*
* @param customerUserJoinMonthId
* @return void
* @author WK
* @since 2020/9/17 14:01
*/
private void customerUserjoin(String customerUserJoinMonthId) {
ScreenJobFormDTO formDto = new ScreenJobFormDTO();
formDto.setYearMonth(customerUserJoinMonthId);
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|基层治理-公众参与>定时任务开始执行");
analysisFeignClient.userjoin(formDto);
logger.info("<" + methodName + "|基层治理-公众参与>定时任务执行结束");
}
/**
* 009基层治理-治理能力数据
*
* @param customerGovernRankData
* @return void
* @author WK
* @since 2020/9/17 14:01
*/
private void customerGovernrankdata(String customerGovernRankData) {
ScreenJobFormDTO formDto = new ScreenJobFormDTO();
formDto.setYearMonth(customerGovernRankData);
// 方法名
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
logger.info("<" + methodName + "|基层治理-治理能力数据>定时任务开始执行");
analysisFeignClient.governrankdata(formDto);
logger.info("<" + methodName + "|基层治理-治理能力数据>定时任务执行结束");
}
}
Loading…
Cancel
Save