|
@ -14,6 +14,8 @@ import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@ -42,6 +44,9 @@ public class JobService {
|
|
|
|
|
|
@Autowired
|
|
|
private DoctorPatientGroupInfoDao doctorPatientGroupInfoDao;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
public void stopById(String id) throws Exception {
|
|
@ -170,6 +175,7 @@ public class JobService {
|
|
|
}
|
|
|
|
|
|
public void productDataByOneDay(String yesterday) throws Exception {
|
|
|
String sql="select * from wlyy_job_config_new a where a.del='1' and a.id !=11 order by a.id asc";
|
|
|
SimpleDateFormat dataSimple = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
Date date = dataSimple.parse(yesterday);
|
|
@ -181,7 +187,7 @@ public class JobService {
|
|
|
calendar.add(calendar.DATE, -1);//把日期往后增加一天.整数往后推,负数往前移动
|
|
|
Date nowDate = calendar.getTime(); //这个时间就是日期往后推一天的结果
|
|
|
String daybefore = new SimpleDateFormat("yyyy-MM-dd").format(nowDate.getTime());
|
|
|
List<QuartzJobConfig> quartzJobConfigs = wlyyJobConfigDao.findByIds();
|
|
|
List<QuartzJobConfig> quartzJobConfigs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(QuartzJobConfig.class));
|
|
|
for (QuartzJobConfig quartzJobConfig : quartzJobConfigs) {
|
|
|
|
|
|
WlyyJobConfigVO wlyyJobConfigVO = new WlyyJobConfigVO();
|
|
@ -300,7 +306,7 @@ public class JobService {
|
|
|
int day = daysBetween(startDate, endDate);
|
|
|
for (int i = 0; i < day; i++) {
|
|
|
Cache.cleanCache();//清空缓存
|
|
|
Thread.sleep(60000L);//休息60秒
|
|
|
// Thread.sleep(60000L);//休息60秒
|
|
|
productDataByOneDay(getYesterday(i, startDate));
|
|
|
}
|
|
|
}
|