Browse Source

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

linzhuo 8 years ago
parent
commit
00980bd094

+ 40 - 0
CacheCleanJob.java

@ -0,0 +1,40 @@
package com.yihu.wlyy.statistics.job.cache;
import com.yihu.wlyy.statistics.etl.mycache.CachePool;
import com.yihu.wlyy.statistics.etl.storage.DBStorage;
import com.yihu.wlyy.statistics.model.job.QuartzJobLog;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * Created by Administrator on 2016.10.19.
 */
@Component
@Scope("prototype")
public class CacheCleanJob implements Job {
    public static String jobKey="CLEAN_CACHE_JOB";
    public static String cron="0 55 23 * * ?";
    @Autowired
    private DBStorage dbStorage;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        QuartzJobLog quartzJobLog = new QuartzJobLog();
        quartzJobLog.setJobStartTime(new Date());
        quartzJobLog.setJobId(jobKey);
        quartzJobLog.setJobName(jobKey);
        CachePool.cleanAllCache();
        quartzJobLog.setJobEndTime(new Date());
        quartzJobLog.setJobContent("清空缓存成功:"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        quartzJobLog.setJobType("1");
        dbStorage.saveLog(quartzJobLog);
    }
}

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -687,10 +687,12 @@ public class ConsultTeamService extends ConsultService {
        } else if (ct.getType() == 2) {
            // 咨询家庭医生
            SignFamily sf = signFamilyDao.findByjiatingPatient(patient);
            if (sf == null) {
                // 不存在家庭签约
                return -1;
            }
            ct.setTeam(sf.getTeamCode());
            // 设置健康管理师,家庭医生咨询默认给健康管理师处理
            //查找病人所在的团队
            DoctorTeam doctorTeam = doctorTeamDao.findByParientCode(patient);