forked from luyan/epmet-cloud-lingshan
				
			
				 6 changed files with 85 additions and 1 deletions
			
			
		@ -0,0 +1,10 @@ | 
				
			|||
package com.epmet.service; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; | 
				
			|||
 | 
				
			|||
public interface BizDataStatsService { | 
				
			|||
 | 
				
			|||
    Result exeStaffPatrolStats(StaffPatrolStatsFormDTO formDTO); | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,23 @@ | 
				
			|||
package com.epmet.service.impl; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; | 
				
			|||
import com.epmet.feign.DataStatisticalOpenFeignClient; | 
				
			|||
import com.epmet.service.BizDataStatsService; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * desc:业务库 数据统计服务实现 | 
				
			|||
 * | 
				
			|||
 * @author: LiuJanJun | 
				
			|||
 * @date: 2021/7/2 2:58 下午 | 
				
			|||
 * @version: 1.0 | 
				
			|||
 */ | 
				
			|||
public class BizDataStatsServiceImpl implements BizDataStatsService { | 
				
			|||
    @Autowired | 
				
			|||
    private DataStatisticalOpenFeignClient feignClient; | 
				
			|||
    @Override | 
				
			|||
    public Result exeStaffPatrolStats(StaffPatrolStatsFormDTO formDTO) { | 
				
			|||
        return feignClient.staffPatrolStats(formDTO); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,34 @@ | 
				
			|||
package com.epmet.task; | 
				
			|||
 | 
				
			|||
import com.alibaba.fastjson.JSON; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; | 
				
			|||
import com.epmet.service.BizDataStatsService; | 
				
			|||
import lombok.extern.slf4j.Slf4j; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Component; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @author zhaoqifeng | 
				
			|||
 * @dscription | 
				
			|||
 * @date 2020/6/23 14:36 | 
				
			|||
 */ | 
				
			|||
@Slf4j | 
				
			|||
@Component("dimInitTask") | 
				
			|||
public class StaffPatrolStatsTask implements ITask { | 
				
			|||
 | 
				
			|||
	@Autowired | 
				
			|||
	private BizDataStatsService bizDataStatsService; | 
				
			|||
 | 
				
			|||
	@Override | 
				
			|||
	public void run(String params) { | 
				
			|||
		log.debug("DimInitTask定时任务正在执行,参数为:{}", params); | 
				
			|||
		StaffPatrolStatsFormDTO formDTO = JSON.parseObject(params, StaffPatrolStatsFormDTO.class); | 
				
			|||
		Result result = bizDataStatsService.exeStaffPatrolStats(formDTO); | 
				
			|||
		if (result.success()){ | 
				
			|||
			log.debug("StaffPatrolStatsTask定时任务正在执行定时任务执行成功"); | 
				
			|||
		}else { | 
				
			|||
			log.debug("StaffPatrolStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); | 
				
			|||
		} | 
				
			|||
	} | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue