Bladeren bron

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

lyr 8 jaren geleden
bovenliggende
commit
82a6e941c1

+ 36 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -0,0 +1,36 @@
package com.yihu.wlyy.event;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.SignEndJob;
import com.yihu.wlyy.util.SystemConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;
import java.util.HashMap;
/**
 * Created by lyr-pc on 2017/3/10.
 */
@Service
public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent>{
    @Autowired
    QuartzHelper quartzHelper;
    @Override
    public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {
        try {
            String trigger = SystemConf.getInstance().getSystemProperties().getProperty("sign_end_job_trigger");
            if (!quartzHelper.isExistJob("sign_end_job")) {
                quartzHelper.addJob(SignEndJob.class, trigger, "sign_end_job", new HashMap<String, Object>());
                System.out.println("sign end job start success");
            } else {
                System.out.println("sign end job exist");
            }
        } catch (Exception e) {
            System.out.println("sign end job start failed");
        }
    }
}

+ 3 - 0
patient-co-wlyy/src/main/resources/system.properties

@ -49,6 +49,9 @@ chat_file_path=/var/local/upload/chat
admin_uid=admin
admin_token=0a5c5258-8863-4b07-a3f9-88c768528ab4
# 签约到期JOB触发时间
sign_end_job_trigger=0 0 0 * * ?
#-------------------------开发环境配置-------------------------#
# 服务器基本配置
server_ip=weixin.xmtyw.cn