|
@ -1,9 +1,14 @@
|
|
|
package com.yihu.jw.care.web;
|
|
|
|
|
|
import com.yihu.jw.care.job.QuartzHelper;
|
|
|
import com.yihu.jw.care.job.consult.FinishConsultJob;
|
|
|
import com.yihu.jw.care.job.message.DoctorSendUnreadJob;
|
|
|
import com.yihu.jw.care.job.message.PatientSendUnreadJob;
|
|
|
import com.yihu.jw.care.service.JobService;
|
|
|
import com.yihu.jw.care.util.SystemConf;
|
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
|
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;
|
|
@ -11,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
/**
|
|
|
* 任务启动
|
|
|
*
|
|
@ -75,33 +82,33 @@ public class JobController extends BaseController {
|
|
|
quartzHelper.removeJob(taskId);
|
|
|
}
|
|
|
switch(taskId){
|
|
|
// case "data_device_quality_plan_job":
|
|
|
// if (!quartzHelper.isExistJob("data_device_quality_plan_job")) {
|
|
|
// String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_device_quality_plan_job");
|
|
|
// quartzHelper.addJob(DeviceQualityPlanJob.class, trigger, "data_device_quality_plan_job", new HashMap<String, Object>());
|
|
|
// logger.info("data_device_quality_plan_job job success");
|
|
|
// } else {
|
|
|
// logger.info("data_device_quality_plan_job job exist");
|
|
|
// }
|
|
|
// break;
|
|
|
// case "data_sim_Balance_remind_job":
|
|
|
// if (!quartzHelper.isExistJob("data_sim_Balance_remind_job")) {
|
|
|
// String trigger = simBalanceService.getCron();
|
|
|
// quartzHelper.addJob(SimBalanceJob.class, trigger, "data_sim_Balance_remind_job", new HashMap<String, Object>());
|
|
|
// logger.info("data_sim_Balance_remind_job job success");
|
|
|
// } else {
|
|
|
// logger.info("data_sim_Balance_remind_job job exist");
|
|
|
// }
|
|
|
// break;
|
|
|
// case "data_sim_set_meal_job":
|
|
|
// if (!quartzHelper.isExistJob("data_sim_set_meal_job")) {
|
|
|
// String trigger = simBalanceService.getCron();
|
|
|
// quartzHelper.addJob(SimSetMealJob.class, trigger, "data_sim_set_meal_job", new HashMap<String, Object>());
|
|
|
// logger.info("data_sim_set_meal_job job success");
|
|
|
// } else {
|
|
|
// logger.info("data_sim_set_meal_job job exist");
|
|
|
// }
|
|
|
// break;
|
|
|
case "finish_consult_job":
|
|
|
if (!quartzHelper.isExistJob("finish_consult_job")) {
|
|
|
String trigger = SystemConf.getInstance().getSystemProperties().getProperty("finish_consult_job");
|
|
|
quartzHelper.addJob(FinishConsultJob.class, trigger, "finish_consult_job", new HashMap<String, Object>());
|
|
|
logger.info("finish_consult_job success");
|
|
|
} else {
|
|
|
logger.info("finish_consult_job exist");
|
|
|
}
|
|
|
break;
|
|
|
case "DOCTOR_SEND_UNREAD_MES_JOB":
|
|
|
if (!quartzHelper.isExistJob("DOCTOR_SEND_UNREAD_MES_JOB")) {
|
|
|
String trigger = SystemConf.getInstance().getSystemProperties().getProperty("DOCTOR_SEND_UNREAD_MES_JOB");
|
|
|
quartzHelper.addJob(DoctorSendUnreadJob.class, trigger, "DOCTOR_SEND_UNREAD_MES_JOB", new HashMap<String, Object>());
|
|
|
logger.info("DOCTOR_SEND_UNREAD_MES_JOB success");
|
|
|
} else {
|
|
|
logger.info("DOCTOR_SEND_UNREAD_MES_JOB exist");
|
|
|
}
|
|
|
break;
|
|
|
case "PATIENT_SEND_UNREAD_MES_JOB":
|
|
|
if (!quartzHelper.isExistJob("PATIENT_SEND_UNREAD_MES_JOB")) {
|
|
|
String trigger = SystemConf.getInstance().getSystemProperties().getProperty("PATIENT_SEND_UNREAD_MES_JOB");
|
|
|
quartzHelper.addJob(PatientSendUnreadJob.class, trigger, "PATIENT_SEND_UNREAD_MES_JOB", new HashMap<String, Object>());
|
|
|
logger.info("PATIENT_SEND_UNREAD_MES_JOB success");
|
|
|
} else {
|
|
|
logger.info("PATIENT_SEND_UNREAD_MES_JOB exist");
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
default :
|
|
|
}
|
|
@ -247,4 +254,18 @@ public class JobController extends BaseController {
|
|
|
return invalidUserException(e, -1, "启动失败:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/testNow", method = RequestMethod.POST)
|
|
|
@ApiOperation("立即执行")
|
|
|
public String executeSignFamilyPayResultJob() {
|
|
|
try {
|
|
|
quartzHelper.startNow(FinishConsultJob.class, "finish_consult_job", null);
|
|
|
quartzHelper.startNow(DoctorSendUnreadJob.class, "DOCTOR_SEND_UNREAD_MES_JOB", null);
|
|
|
quartzHelper.startNow(PatientSendUnreadJob.class, "PATIENT_SEND_UNREAD_MES_JOB", null);
|
|
|
return write(200, "启动成功");
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|