17 changed files with 855 additions and 20 deletions
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.entity.ScreenRecordEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 大屏增量同步记录表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-02-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ScreenRecordDao extends BaseDao<ScreenRecordEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 大屏增量同步记录表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-02-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_screen_record") |
||||
|
public class ScreenRecordEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 作业名称 |
||||
|
*/ |
||||
|
private String jobName; |
||||
|
|
||||
|
/** |
||||
|
* 统计时间 |
||||
|
*/ |
||||
|
private Date statisticsTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
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); |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
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); |
||||
|
} |
||||
@ -0,0 +1,354 @@ |
|||||
|
package com.elink.esua.epdc.task.screen; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
||||
|
import com.elink.esua.epdc.dao.ScreenRecordDao; |
||||
|
import com.elink.esua.epdc.dto.screen.form.ScreenProjectFormDTO; |
||||
|
import com.elink.esua.epdc.entity.ScreenRecordEntity; |
||||
|
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; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.concurrent.Callable; |
||||
|
import java.util.concurrent.ExecutorService; |
||||
|
import java.util.concurrent.Executors; |
||||
|
import java.util.concurrent.Future; |
||||
|
|
||||
|
/** |
||||
|
* @program: esua-epdc |
||||
|
* @description: 大屏【事件/项目分析】信息统计上报 |
||||
|
* @author: wangtong |
||||
|
* @create: 2021-02-24 13:48 |
||||
|
**/ |
||||
|
@Component("screenProjectDataPushDayTask") |
||||
|
public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthPushTask { |
||||
|
|
||||
|
private final Logger logger = LoggerFactory.getLogger(getClass()); |
||||
|
|
||||
|
private static final ExecutorService service = Executors.newFixedThreadPool(100); |
||||
|
|
||||
|
@Autowired |
||||
|
private AnalysisFeignClient analysisFeignClient; |
||||
|
|
||||
|
@Autowired |
||||
|
private ScreenRecordDao screenRecordDao; |
||||
|
|
||||
|
@Override |
||||
|
public void run(String param) { |
||||
|
for(int i = 0 ; i < 14 ; i++){ |
||||
|
createThread(i); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
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){ |
||||
|
projectOrgDaily(); |
||||
|
}else if (methodIndex == 2){ |
||||
|
uploadProjectInfo(); |
||||
|
} else if (methodIndex == 3){ |
||||
|
uploadProjectProcess(); |
||||
|
}else if (methodIndex == 4){ |
||||
|
//001、基层党建-党员基本情况
|
||||
|
customerCpcbasedata(); |
||||
|
}else if (methodIndex == 5){ |
||||
|
//002、党建引领-先锋模范数据
|
||||
|
customerPioneerdata(); |
||||
|
}else if (methodIndex == 6){ |
||||
|
//003、党建引领-党员联系群众数据
|
||||
|
customerPartylinkmassesdata(); |
||||
|
}else if (methodIndex == 7){ |
||||
|
//004、党建引领-先进排行榜单-先进支部排行
|
||||
|
customerOrgrankdata(); |
||||
|
}else if (methodIndex == 8){ |
||||
|
//005、党建引领|基层治理-居民(党员)积分排行榜
|
||||
|
customerPartyuserrankdata(); |
||||
|
}else if (methodIndex == 9){ |
||||
|
//006、基层治理-难点赌点项目上报
|
||||
|
customerDifficultydata(); |
||||
|
}else if (methodIndex == 10){ |
||||
|
//007、基层治理-公众参与
|
||||
|
customerUserjoin(); |
||||
|
}else if (methodIndex == 11){ |
||||
|
// 008、公众参与各类总数
|
||||
|
customerPublicpartitotaldata(); |
||||
|
}else if (methodIndex == 12){ |
||||
|
//009、基层治理-治理能力数据
|
||||
|
customerGovernrankdata(); |
||||
|
}else if (methodIndex == 13){ |
||||
|
// 010、中央区各类总数
|
||||
|
customerUsertotaldata(); |
||||
|
} |
||||
|
return 0; |
||||
|
} |
||||
|
}); |
||||
|
Integer isSuccess = 0; |
||||
|
try { |
||||
|
isSuccess = future.get(); |
||||
|
}catch (Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return isSuccess; |
||||
|
} |
||||
|
/** |
||||
|
* @Description 项目信息上报 |
||||
|
* @Author songyunpeng |
||||
|
* @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"); |
||||
|
List<ScreenRecordEntity> screenRecordEntities = screenRecordDao.selectByMap(param); |
||||
|
ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity(); |
||||
|
ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO(); |
||||
|
if(screenRecordEntities==null || screenRecordEntities.size()==0){ |
||||
|
screenProjectFormDTO.setYearMonthDay("2020-01-01"); |
||||
|
}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())){ |
||||
|
screenRecordDao.updateById(screenRecordEntity); |
||||
|
}else { |
||||
|
screenRecordEntity.setJobName("uploadProjectInfo"); |
||||
|
screenRecordDao.insert(screenRecordEntity); |
||||
|
} |
||||
|
analysisFeignClient.uploadProjectInfo(screenProjectFormDTO); |
||||
|
logger.info("<" + methodName + "|项目信息上报>定时任务执行结束"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 项目处理流程信息上报 |
||||
|
* @Author songyunpeng |
||||
|
* @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"); |
||||
|
List<ScreenRecordEntity> screenRecordEntities = screenRecordDao.selectByMap(param); |
||||
|
ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity(); |
||||
|
ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO(); |
||||
|
if(screenRecordEntities==null || screenRecordEntities.size()==0){ |
||||
|
screenProjectFormDTO.setYearMonthDay("2020-01-01"); |
||||
|
}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())){ |
||||
|
screenRecordDao.updateById(screenRecordEntity); |
||||
|
}else { |
||||
|
screenRecordEntity.setJobName("uploadProjectProcess"); |
||||
|
screenRecordDao.insert(screenRecordEntity); |
||||
|
} |
||||
|
analysisFeignClient.uploadProjectProcess(screenProjectFormDTO); |
||||
|
logger.info("<" + methodName + "|项目处理流程信息上报>定时任务执行结束"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @describe: 【事件/项目分析】网格内事件 |
||||
|
* @author wangtong |
||||
|
* @date 2021/2/24 13:57 |
||||
|
* @params [] |
||||
|
* @return void |
||||
|
*/ |
||||
|
private void projectGridDaily() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|【事件/项目分析】网格内事件>定时任务开始执行"); |
||||
|
|
||||
|
analysisFeignClient.projectGridDaily(); |
||||
|
logger.info("<" + methodName + "|【事件/项目分析】网格内事件>定时任务执行结束"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @describe: 【事件/项目分析】组织内事件 |
||||
|
* @author wangtong |
||||
|
* @date 2021/2/24 13:57 |
||||
|
* @params [] |
||||
|
* @return void |
||||
|
*/ |
||||
|
private void projectOrgDaily() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|事件/项目分析】组织内事件>定时任务开始执行"); |
||||
|
analysisFeignClient.projectOrgDaily(); |
||||
|
logger.info("<" + methodName + "|事件/项目分析】组织内事件>定时任务执行结束"); |
||||
|
} |
||||
|
/** |
||||
|
* 010、中央区各类总数 |
||||
|
* |
||||
|
* @return void |
||||
|
* @author WK |
||||
|
* @since 2020/9/17 14:01 |
||||
|
*/ |
||||
|
private void customerUsertotaldata() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|中央区各类总数>定时任务开始执行"); |
||||
|
analysisFeignClient.usertotaldata(); |
||||
|
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、公众参与各类总数 |
||||
|
* |
||||
|
* @return void |
||||
|
* @author WK |
||||
|
* @since 2020/9/17 14:01 |
||||
|
*/ |
||||
|
private void customerPublicpartitotaldata() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|公众参与各类总数>定时任务开始执行"); |
||||
|
analysisFeignClient.publicpartitotaldata(); |
||||
|
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、基层治理-难点赌点项目上报 |
||||
|
* |
||||
|
* @return void |
||||
|
* @author WK |
||||
|
* @since 2020/9/17 14:01 |
||||
|
*/ |
||||
|
private void customerDifficultydata() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|基层治理-难点赌点项目上报>定时任务开始执行"); |
||||
|
analysisFeignClient.difficultydata(); |
||||
|
logger.info("<" + methodName + "|基层治理-难点赌点项目上报>定时任务执行结束"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 005、党建引领|基层治理-居民(党员)积分排行榜 |
||||
|
* |
||||
|
* @return void |
||||
|
* @author WK |
||||
|
* @since 2020/9/17 14:01 |
||||
|
*/ |
||||
|
private void customerPartyuserrankdata() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|党建引领|基层治理-居民(党员)积分排行榜>定时任务开始执行"); |
||||
|
analysisFeignClient.partyuserrankdata(); |
||||
|
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、党建引领-党员联系群众数据 |
||||
|
* |
||||
|
* @return void |
||||
|
* @author WK |
||||
|
* @since 2020/9/17 14:01 |
||||
|
*/ |
||||
|
private void customerPartylinkmassesdata() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|党建引领-党员联系群众数据>定时任务开始执行"); |
||||
|
analysisFeignClient.partylinkmassesdata(); |
||||
|
logger.info("<" + methodName + "|党建引领-党员联系群众数据>定时任务执行结束"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 002、党建引领-先锋模范数据 |
||||
|
* |
||||
|
* @return void |
||||
|
* @author WK |
||||
|
* @since 2020/9/17 14:01 |
||||
|
*/ |
||||
|
private void customerPioneerdata() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|党建引领-先锋模范数据>定时任务开始执行"); |
||||
|
analysisFeignClient.pioneerdata(); |
||||
|
logger.info("<" + methodName + "|党建引领-先锋模范数据>定时任务执行结束"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 001、基层党建-党员基本情况 |
||||
|
* |
||||
|
* @return void |
||||
|
* @author WK |
||||
|
* @since 2020/9/17 14:01 |
||||
|
*/ |
||||
|
private void customerCpcbasedata() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|基层党建-党员基本情况>定时任务开始执行"); |
||||
|
analysisFeignClient.cpcbasedata(); |
||||
|
logger.info("<" + methodName + "|基层党建-党员基本情况>定时任务执行结束"); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,88 @@ |
|||||
|
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; |
||||
|
|
||||
|
import java.util.concurrent.Callable; |
||||
|
import java.util.concurrent.ExecutorService; |
||||
|
import java.util.concurrent.Executors; |
||||
|
import java.util.concurrent.Future; |
||||
|
|
||||
|
/** |
||||
|
* @program: esua-epdc |
||||
|
* @description: 大屏【事件/项目分析】信息统计上报 |
||||
|
* @author: wangtong |
||||
|
* @create: 2021-02-24 13:48 |
||||
|
**/ |
||||
|
@Component("screenProjectDataPushMonthTask") |
||||
|
public class ScreenProjectDataPushMonthTaskImpl implements ScreenProjectDataMonthPushTask { |
||||
|
|
||||
|
private final Logger logger = LoggerFactory.getLogger(getClass()); |
||||
|
|
||||
|
private static final ExecutorService service = Executors.newFixedThreadPool(100); |
||||
|
|
||||
|
@Autowired |
||||
|
private AnalysisFeignClient analysisFeignClient; |
||||
|
|
||||
|
@Override |
||||
|
public void run(String param) { |
||||
|
for(int i = 0 ; i < 2 ; i++){ |
||||
|
createThread(i); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
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) { |
||||
|
quantityGridMonthly(); |
||||
|
} else if (methodIndex == 1){ |
||||
|
quantityOrgMonthly(); |
||||
|
} |
||||
|
return 0; |
||||
|
} |
||||
|
}); |
||||
|
Integer isSuccess = 0; |
||||
|
try { |
||||
|
isSuccess = future.get(); |
||||
|
}catch (Exception e){ |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
return isSuccess; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @describe: 【事件/项目分析】网格内月度数量统计 |
||||
|
* @author wangtong |
||||
|
* @date 2021/2/24 13:57 |
||||
|
* @params [] |
||||
|
* @return void |
||||
|
*/ |
||||
|
private void quantityGridMonthly() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|【事件/项目分析】网格内月度数量统计>定时任务开始执行"); |
||||
|
analysisFeignClient.quantityGridMonthly(); |
||||
|
logger.info("<" + methodName + "|【事件/项目分析】网格内月度数量统计>定时任务执行结束"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @describe: 【事件/项目分析】组织内月度数量统计 |
||||
|
* @author wangtong |
||||
|
* @date 2021/2/24 13:57 |
||||
|
* @params [] |
||||
|
* @return void |
||||
|
*/ |
||||
|
private void quantityOrgMonthly() { |
||||
|
// 方法名
|
||||
|
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
||||
|
logger.info("<" + methodName + "|事件/项目分析】组织内月度数量统计>定时任务开始执行"); |
||||
|
analysisFeignClient.quantityOrgMonthly(); |
||||
|
logger.info("<" + methodName + "|事件/项目分析】组织内月度数量统计>定时任务执行结束"); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
<?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.dao.ScreenRecordDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.entity.ScreenRecordEntity" id="screenRecordMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="jobName" column="JOB_NAME"/> |
||||
|
<result property="statisticsTime" column="STATISTICAL_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
Loading…
Reference in new issue