瀏覽代碼

统计修改

lyr 8 年之前
父節點
當前提交
e61cac0dd7

+ 7 - 3
src/main/java/com/yihu/wlyy/job/consult/FamousConsultTimesJob.java

@ -30,8 +30,12 @@ public class FamousConsultTimesJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        workTimeService.consultTimesRemain(df.format(new Date()));
        try {
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            workTimeService.consultTimesRemain(df.format(new Date()));
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

+ 5 - 0
src/main/java/com/yihu/wlyy/service/app/scheduling/DoctorWorkTimeService.java

@ -471,6 +471,11 @@ public class DoctorWorkTimeService extends BaseService {
        }
    }
    /**
     * 名医咨询次数更新
     *
     * @param date
     */
    @Transactional
    public void consultTimesRemain(String date) {
        try {

+ 16 - 0
src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.common.util;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
@ -10,6 +11,8 @@ import org.springframework.data.redis.hash.HashMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
/**
@ -25,6 +28,8 @@ public class ManagerUtilController extends BaseController{
    StringRedisTemplate redisTemplate;
    @Autowired
    QuartzHelper quartzHelper;
    @Autowired
    DoctorWorkTimeService workTimeService;
    /**
     * 更新到redis
@ -81,4 +86,15 @@ public class ManagerUtilController extends BaseController{
            return error(-1,"启动失败");
        }
    }
    @RequestMapping(value = "/famous_doctor/times_update")
    public String famousConsultTimeUpdate(){
        try{
            workTimeService.consultTimesRemain(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
            return write(200,"更新成功");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"更新失败");
        }
    }
}