Procházet zdrojové kódy

随访量统计数据源修改

yeshijie před 8 roky
rodič
revize
9538b77362

+ 5 - 20
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -66,10 +66,8 @@ public class CurrentDayAllQuotaJob implements Job {
    private HealthGuideDataFilter healthGuideDataFilter;
    @Autowired
    private FollowUpDataFilter followUpDataFilter;
    private org.apache.tomcat.jdbc.pool.DataSource fvdataSource = new org.apache.tomcat.jdbc.pool.DataSource();//随访数据源
    private JdbcTemplate fv_jdbcTemplate = new JdbcTemplate();
    @Autowired
    private JdbcTemplate jdbcTemplate;
    List<Town> towns = null;//厦门市全部的区
    List<Hospital> hospitals = null;//系统全部的机构
@ -82,19 +80,11 @@ public class CurrentDayAllQuotaJob implements Job {
    private String tomorrow = getDayString(1);
    private StringBuffer allContent=new StringBuffer();//日志内容
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Value("${fv.jdbc.driver}")
    String fv_jdbc_driver;
    @Value("${fv.jdbc.url}")
    String fv_jdbc_url;
    @Value("${fv.jdbc.username}")
    String fv_jdbc_username;
    @Value("${fv.jdbc.password}")
    String fv_jdbc_password;
    @Value("${redis.quota.current.expire}")
    String currentExpire="2";
@ -104,12 +94,7 @@ public class CurrentDayAllQuotaJob implements Job {
            throws JobExecutionException {
        try {
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
            fvdataSource.setDriverClassName(fv_jdbc_driver);
            fvdataSource.setUrl(fv_jdbc_url);
            fvdataSource.setUsername(fv_jdbc_username);
            fvdataSource.setPassword(fv_jdbc_password);
            fv_jdbcTemplate.setDataSource(fvdataSource);//初始化随访的数据源
            towns = townDao.findByCityCode(Constant.city); //查找出厦门市全部的区
            hospitals = hospitalDao.findHospitalzxFWZ(); //查找出系统全部的机构
            adminTeams=doctorAdminTeamDao.findAllTeam();//查找出系统全部的全科医生
@ -504,10 +489,10 @@ public class CurrentDayAllQuotaJob implements Job {
        String quotaId="4";
        try{
            //找出今天的随访信息
            String sql=" select * from fv_plan a where  a.update_time< '"+tomorrow+"' and a.update_time>= '"+now+"' ";
            String sql=" select * from wlyy_followup a where  a.update_time< '"+tomorrow+"' and a.update_time>= '"+now+"' ";
            //找出今天的随访信息
            List<Map<String, Object>> plans = fv_jdbcTemplate.queryForList(sql);
            List<Map<String, Object>> plans = jdbcTemplate.queryForList(sql);
            FilterModel etlModels = followUpDataFilter.filter(plans, sql, null);
            // 统计数据

+ 3 - 21
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/FollowUpJob.java

@ -45,7 +45,7 @@ public class FollowUpJob implements Job {
    @Autowired
    private QuartzJobLogDao quartzJobLogDao;//执行日志Dao
    @Autowired
    private JdbcTemplate jdbcTemplate_wlyy;
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private Level1Role levelRole;
    @Autowired
@ -53,20 +53,8 @@ public class FollowUpJob implements Job {
    @Autowired
    private FollowUpDataFilter followUpDataFilter;
    private org.apache.tomcat.jdbc.pool.DataSource fvdataSource = new org.apache.tomcat.jdbc.pool.DataSource();//随访数据源
    private JdbcTemplate jdbcTemplate = new JdbcTemplate();
    String yesterday;
    String daybefore;
    @Value("${fv.jdbc.driver}")
    String fv_jdbc_driver;
    @Value("${fv.jdbc.url}")
    String fv_jdbc_url;
    @Value("${fv.jdbc.username}")
    String fv_jdbc_username;
    @Value("${fv.jdbc.password}")
    String fv_jdbc_password;
    @Override
    public void execute(JobExecutionContext context)
@ -78,12 +66,6 @@ public class FollowUpJob implements Job {
            wlyyQuota = (WlyyQuotaVO) map.get("quota");
            wlyyJobConfig = (WlyyJobConfigVO) map.get("jobConfig");
            fvdataSource.setDriverClassName(fv_jdbc_driver);
            fvdataSource.setUrl(fv_jdbc_url);
            fvdataSource.setUsername(fv_jdbc_username);
            fvdataSource.setPassword(fv_jdbc_password);
            //计算指标
            jdbcTemplate.setDataSource(fvdataSource);//初始化随访的数据源
            //線刪除今天的数据
            daybefore = StringUtils.isEmpty(map.get("daybefore")) ? SignJob.getDayString(-2) : map.get("daybefore").toString();
            yesterday = StringUtils.isEmpty(map.get("yesterday")) ? SignJob.getDayString(-1) : map.get("yesterday").toString();
@ -99,7 +81,7 @@ public class FollowUpJob implements Job {
    @Transactional
    private void computequota() {
        try {
            jdbcTemplate_wlyy.execute("delete from wlyy_quota_result where quota_date='" + yesterday + "' and quato_code='" + 4 + "'");
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='" + yesterday + "' and quato_code='" + 4 + "'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();
@ -109,7 +91,7 @@ public class FollowUpJob implements Job {
            String sql = " select * from wlyy_followup a where a.update_time>='" + daybefore + Constant.quota_date_last + "' and a.update_time< '" + yesterday + Constant.quota_date_last + "'  ";
            //找出今天的随访信息
            List<Map<String, Object>> plans = jdbcTemplate_wlyy.queryForList(sql);
            List<Map<String, Object>> plans = jdbcTemplate.queryForList(sql);
            FilterModel etlModels = followUpDataFilter.filter(plans, sql, yesterday);
            // 统计数据
            List<Map<String, List<ETLModel>>> returnDatas = levelRole.elt(etlModels.getEtlModelList());