chenweida 8 gadi atpakaļ
vecāks
revīzija
7f43e45b30

+ 1 - 1
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/quartz/SchedulerConfig.java

@ -24,7 +24,7 @@ public class SchedulerConfig {
    @Autowired
    private DataSource dataSource;
    @Bean
    SchedulerFactoryBean schedulerFactoryBean_cwd() throws IOException {
    SchedulerFactoryBean schedulerFactoryBean_cwd_local() throws IOException {
        SchedulerFactoryBean bean = new SchedulerFactoryBean();
        bean.setJobFactory(jobFactory);
        bean.setApplicationContext(this.applicationContext);

+ 3 - 8
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java

@ -108,7 +108,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
        this.endTime = DateUtil.getStringDate("yyyy-MM-dd HH:mm:ss");
        //初始化统计年份
        this.year = getNowYearByDate(endTime);
        this.year = getNowYearByDate();
        //初始化开始时间
        if ("2".equals(timeLevel)) {
@ -116,11 +116,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
            startTime = this.year + "-06-30 17:00:00";
        }else{
            //增量
            if (StringUtils.isEmpty(startTime)) {
                this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
            } else {
                startTime = startTime + " 17:00:00";
            }
            this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
        }
        this.quotaDate = DateUtil.strToDate(endTime, "yyyy-MM-dd");
@ -311,10 +307,9 @@ public class CurrentMysqlToEsQuotaJob implements Job {
    /**
     * 获取现在时间属于那个年度
     *
     * @param date
     * @return
     */
    public static String getNowYearByDate(String date) throws Exception {
    public static String getNowYearByDate() throws Exception {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date today = new Date();
        String todayString = simpleDateFormat.format(today);

+ 2 - 2
patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/MysqlToEsQuotaJob.java

@ -303,11 +303,11 @@ public class MysqlToEsQuotaJob implements Job {
     */
    public static String getNowYearByDate(String date) throws Exception {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date today = new Date();
        Date today = simpleDateFormat.parse(date);
        String todayString = simpleDateFormat.format(today);
        String startDateString = (1900 + today.getYear()) + "-07-01";
        String startDateString = (1900 + today.getYear()) + "-06-30";
        Date startDate = simpleDateFormat.parse(startDateString);
        if (simpleDateFormat.parse(todayString).after(startDate)) {
            return (1900 + today.getYear()) + "";