| | |
| | | import com.ltkj.framework.config.DruidConfig; |
| | | import com.ltkj.hosp.domain.DictHosp; |
| | | import com.ltkj.hosp.service.IDictHospService; |
| | | import org.jboss.logging.MDC; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | dataSourceConfig.addDataSource(hosp.getDbname()); |
| | | // druidConfig.addDataSource(hosp.getDbname()); |
| | | DataSourceContextHolder.setDataSourceKey(hosp.getDbname()); |
| | | // 设置到 MDC 中 |
| | | MDC.put("hospitalCode",hosp.getCode()); |
| | | } catch (IOException e) { |
| | | return false; |
| | | } |
| | |
| | | DataSourceContextHolder.setDataSourceKey("default"); |
| | | DataSourceContextHolder.clear(); |
| | | HandlerInterceptor.super.afterCompletion(request, response, handler, ex); |
| | | MDC.remove("hospitalCode"); |
| | | } |
| | | } |