|
@ -1,12 +1,15 @@
|
|
|
package com.yihu.jw.web.quota;
|
|
|
|
|
|
import com.yihu.jw.internet.service.InternetService;
|
|
|
import com.yihu.jw.job.PrescriptionStatusUpdateJob;
|
|
|
import com.yihu.jw.job.QuartzHelper;
|
|
|
import com.yihu.jw.service.quota.JobService;
|
|
|
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.web.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@ -24,9 +27,15 @@ import java.util.UUID;
|
|
|
@RequestMapping(value = "/job", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "后台-任务控制")
|
|
|
public class JobController extends BaseController {
|
|
|
|
|
|
private org.slf4j.Logger logger = LoggerFactory.getLogger(JobController.class);
|
|
|
|
|
|
private final JobService jobService;
|
|
|
private final QuartzHelper quartzHelper;
|
|
|
|
|
|
@Autowired
|
|
|
private InternetService internetService;
|
|
|
|
|
|
@Autowired
|
|
|
public JobController(JobService jobService, QuartzHelper quartzHelper) {
|
|
|
this.jobService = jobService;
|
|
@ -198,5 +207,55 @@ public class JobController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/internetUpload", method = RequestMethod.GET)
|
|
|
@ApiOperation("监管平台测试")
|
|
|
public String internetUpload(String taskId) {
|
|
|
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.6 网上医技预约上传开始========");
|
|
|
res = internetService.upMedicalOnline(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.9 网络咨询服务信息开始========");
|
|
|
res = internetService.upNsOnlineMed(startDate,endDate);
|
|
|
logger.info("END==========2.9 网络咨询服务信息结束========" + 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 执行结束========");
|
|
|
|
|
|
return success("success");
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "启动失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|