|
@ -9,14 +9,17 @@ import com.yihu.wlyy.statistics.etl.mycache.CachePool;
|
|
|
import com.yihu.wlyy.statistics.job.business.QuartzHelper;
|
|
|
import com.yihu.wlyy.statistics.job.cache.CacheCleanJob;
|
|
|
import com.yihu.wlyy.statistics.job.check.CheckSignJob;
|
|
|
import com.yihu.wlyy.statistics.job.message.HealthMessageJob;
|
|
|
import com.yihu.wlyy.statistics.model.doctor.DoctorPatientGroupInfo;
|
|
|
import com.yihu.wlyy.statistics.model.job.QuartzJobConfig;
|
|
|
import com.yihu.wlyy.statistics.model.job.WlyyQuota;
|
|
|
import com.yihu.wlyy.statistics.model.signfamily.SignFamily;
|
|
|
import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
|
|
|
import com.yihu.wlyy.statistics.vo.WlyyQuotaVO;
|
|
|
import org.quartz.SchedulerException;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
@ -250,42 +253,9 @@ public class JobService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
public void startaaaa() {
|
|
|
List<SignFamily> s = signFamilyDao.findByDate("2016-08-05 15:40:00");
|
|
|
for (SignFamily ss : s) {
|
|
|
List<DoctorPatientGroupInfo> DoctorPatientGroupInfos = doctorPatientGroupInfoDao.findByPatient(ss.getPatient());
|
|
|
if (DoctorPatientGroupInfos != null && DoctorPatientGroupInfos.size() == 0) {
|
|
|
DoctorPatientGroupInfo qkDoctorPatientGroupInfo = new DoctorPatientGroupInfo();
|
|
|
qkDoctorPatientGroupInfo.setCzrq(new Date());
|
|
|
qkDoctorPatientGroupInfo.setQyrq(ss.getApplyDate());
|
|
|
qkDoctorPatientGroupInfo.setGroup("2");
|
|
|
qkDoctorPatientGroupInfo.setPatient(ss.getPatient());
|
|
|
qkDoctorPatientGroupInfo.setPartAmount(0);
|
|
|
qkDoctorPatientGroupInfo.setStatus(ss.getStatus() > 0 ? 1 : 0);
|
|
|
if (ss.getStatus() < 0) {
|
|
|
qkDoctorPatientGroupInfo.setDqrq(ss.getApplyUnsignDate());
|
|
|
}
|
|
|
qkDoctorPatientGroupInfo.setSignType("1");
|
|
|
qkDoctorPatientGroupInfo.setDoctor(ss.getDoctor());
|
|
|
doctorPatientGroupInfoDao.save(qkDoctorPatientGroupInfo);
|
|
|
|
|
|
qkDoctorPatientGroupInfo = new DoctorPatientGroupInfo();
|
|
|
qkDoctorPatientGroupInfo.setCzrq(new Date());
|
|
|
qkDoctorPatientGroupInfo.setQyrq(ss.getApplyDate());
|
|
|
qkDoctorPatientGroupInfo.setGroup("2");
|
|
|
qkDoctorPatientGroupInfo.setPatient(ss.getPatient());
|
|
|
qkDoctorPatientGroupInfo.setPartAmount(0);
|
|
|
qkDoctorPatientGroupInfo.setStatus(ss.getStatus() > 0 ? 1 : 0);
|
|
|
if (ss.getStatus() < 0) {
|
|
|
qkDoctorPatientGroupInfo.setDqrq(ss.getApplyUnsignDate());
|
|
|
}
|
|
|
qkDoctorPatientGroupInfo.setSignType("1");
|
|
|
qkDoctorPatientGroupInfo.setDoctor(ss.getDoctorHealth());
|
|
|
doctorPatientGroupInfoDao.save(qkDoctorPatientGroupInfo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
s = signFamilyDao.findByDate("2016-08-16 00:00:00");
|
|
|
@Async("dbExtractExecutor")
|
|
|
public void startaaaa() throws Exception{
|
|
|
quartzHelper.startNow(HealthMessageJob.class,UUID.randomUUID().toString().replace("-",""),new HashMap<>());
|
|
|
}
|
|
|
|
|
|
public void productDataByDayAndId(Integer day, String id) throws Exception{
|
|
@ -345,6 +315,7 @@ public class JobService {
|
|
|
String yesterday = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
|
|
|
return yesterday;
|
|
|
}
|
|
|
|
|
|
public static int daysBetween(Date smdate,Date bdate) throws ParseException
|
|
|
{
|
|
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
|
@ -407,4 +378,16 @@ public class JobService {
|
|
|
returnMessage+="diseaseGroupCache"+(diseaseGroupCache.size()>0?"有缓存":"没有缓存");
|
|
|
return returnMessage;
|
|
|
}
|
|
|
|
|
|
public void startHealthMessageJob() throws Exception {
|
|
|
if(!quartzHelper.isExistJob(HealthMessageJob.jobKey)){
|
|
|
quartzHelper.addJob(HealthMessageJob.class,HealthMessageJob.cron,HealthMessageJob.jobKey,new HashMap<>());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void stopHealthMessageJob()throws Exception {
|
|
|
if(quartzHelper.isExistJob(HealthMessageJob.jobKey)){
|
|
|
quartzHelper.removeJob(HealthMessageJob.jobKey);
|
|
|
}
|
|
|
}
|
|
|
}
|