瀏覽代碼

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 8 年之前
父節點
當前提交
8b5596d942

+ 1 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/QuartzHelper.java

@ -101,7 +101,7 @@ public class QuartzHelper {
        SimpleTrigger trigger = TriggerBuilder.newTrigger().withIdentity("trigger-id:" + id, "group-group:" + id)
                .startAt(time)
                .withSchedule(simpleSchedule().withIntervalInSeconds(10).withRepeatCount(0))
                .withSchedule(simpleSchedule().withIntervalInSeconds(10).withRepeatCount(0).withMisfireHandlingInstructionFireNow())
                .build();
        scheduler.scheduleJob(job, trigger);

+ 5 - 17
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -14,6 +14,7 @@ import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
import com.yihu.wlyy.statistics.vo.WlyyQuotaVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.ClassArrayEditor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
@ -151,7 +152,7 @@ public class JobService {
                params.put("yesterday", getYesterday(0 - i));
                if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                    quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-",""), params);
                    Thread.sleep(8000L);
                    Thread.sleep(12000L);
                }
            }
        }
@ -193,7 +194,7 @@ public class JobService {
            params.put("yesterday", yesterday);
            if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-",""), params);
                Thread.sleep(8000L);
                Thread.sleep(12000L);
            }
        }
@ -206,20 +207,7 @@ public class JobService {
     * @throws ClassNotFoundException
     */
    private Class getRightClass(QuartzJobConfig quartzJobConfig) throws ClassNotFoundException {
        String packageString="com.yihu.wlyy.statistics.job.business.";
        Class classTemp;
        try{
            classTemp=Class.forName(quartzJobConfig.getJobClass());
        }catch (Exception e){
            try{
            String classString=quartzJobConfig.getJobClass().replace("wlyy","wlyy.statistics").replace("job","job.business");
            classTemp=Class.forName(classString);
            }catch (Exception e1){
                packageString=packageString+quartzJobConfig.getJobClass().substring(quartzJobConfig.getJobClass().lastIndexOf("."));
                classTemp=Class.forName(packageString);
            }
        }
        return classTemp;
        return Class.forName(quartzJobConfig.getJobClass());
    }
    public void productDataByOneDayWithId(String yesterday, String id) throws Exception {
@ -316,7 +304,7 @@ public class JobService {
                params.put("yesterday", getYesterday(0 - i));
                if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                    quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-",""), params);
                    Thread.sleep(8000L);
                    Thread.sleep(12000L);
                }
            }
    }