|  | @ -0,0 +1,62 @@
 | 
	
		
			
				|  |  | package com.yihu.jw.job;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.internet.service.InternetService;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
		
			
				|  |  | import org.quartz.Job;
 | 
	
		
			
				|  |  | import org.quartz.JobExecutionContext;
 | 
	
		
			
				|  |  | import org.quartz.JobExecutionException;
 | 
	
		
			
				|  |  | import org.slf4j.Logger;
 | 
	
		
			
				|  |  | import org.slf4j.LoggerFactory;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * 互联网监管平台更新 job
 | 
	
		
			
				|  |  |  * Created by cws on 2019/2/20.
 | 
	
		
			
				|  |  |  */
 | 
	
		
			
				|  |  | public class InternetUpdateJob implements Job {
 | 
	
		
			
				|  |  |     private static final Logger logger = LoggerFactory.getLogger(InternetUpdateJob.class);
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private InternetService internetService;
 | 
	
		
			
				|  |  |     @Override
 | 
	
		
			
				|  |  |     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
 | 
	
		
			
				|  |  |         logger.info("START========InternetUpdateJob========");
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             //1、获取 JOB 执行区间  执行时间点的前一天  时间点定在每天的 00:00:00 执行,同步前一天的数据
 | 
	
		
			
				|  |  |             String endDate = DateUtil.dateToStrLong(DateUtil.getNow());
 | 
	
		
			
				|  |  |             String startDate = DateUtil.dateToStrLong(DateUtil.getPreDays(DateUtil.getNow(),1));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             String res = "";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             // 2、分步执行需要JOB执行的服务
 | 
	
		
			
				|  |  |             logger.info("START========2.3 网上预约挂号上传开始========");
 | 
	
		
			
				|  |  |             res = internetService.upNsDoctorRecord(startDate,endDate);
 | 
	
		
			
				|  |  |             logger.info("END==========2.3 网上预约挂号上传结束 ========" + res);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             logger.info("START========2.5 网上预约挂号上传开始========");
 | 
	
		
			
				|  |  |             res = internetService.upAppointmentOnline(startDate,endDate);
 | 
	
		
			
				|  |  |             logger.info("END==========2.5 网上预约挂号上传结束========" + res);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             logger.info("START========2.7 医生评价信息开始========");
 | 
	
		
			
				|  |  |             res = internetService.upNsDoctorScore(startDate,endDate);
 | 
	
		
			
				|  |  |             logger.info("END==========2.7 医生评价信息结束========" + res);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             logger.info("START========2.8 网络咨询服务信息开始========");
 | 
	
		
			
				|  |  |             res = internetService.upNsOnlineAsk(startDate,endDate);
 | 
	
		
			
				|  |  |             logger.info("END==========2.8 网络咨询服务信息结束========" + res);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             logger.info("START========2.10 电子处方表开始========");
 | 
	
		
			
				|  |  |             res = internetService.upPrescription(startDate,endDate);
 | 
	
		
			
				|  |  |             logger.info("END==========2.10 电子处方表结束========" + res);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             logger.info("START========2.11 电子处方_药品明细表开始 ========");
 | 
	
		
			
				|  |  |             res = internetService.upPrescriptionDrug(startDate,endDate);
 | 
	
		
			
				|  |  |             logger.info("END==========2.11 电子处方_药品明细表结束 ========" + res);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             logger.info("END========InternetUpdateJob 执行结束========");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             logger.error("END===ERROE===InternetUpdateJob,message:"+e.getMessage());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |