|
|
@ -11,6 +11,7 @@ import com.acupuncture.common.core.domain.AjaxResult; |
|
|
|
import com.acupuncture.common.core.domain.BaseDto; |
|
|
|
import com.acupuncture.common.core.domain.JsonResponse; |
|
|
|
import com.acupuncture.common.core.redis.RedisCache; |
|
|
|
import com.acupuncture.common.core.text.Convert; |
|
|
|
import com.acupuncture.common.exception.base.BaseException; |
|
|
|
import com.acupuncture.common.utils.file.FileUploadUtils; |
|
|
|
import com.acupuncture.common.utils.file.FileUtils; |
|
|
@ -76,13 +77,18 @@ public class ExternalController { |
|
|
|
|
|
|
|
//切换数据源
|
|
|
|
private void checkoutData(String from) { |
|
|
|
//根据社区ID查询数据源
|
|
|
|
List<UmsDataSourceVo.Result> dataSourceList = umsDataSourceDao.query(Long.parseLong(from)); |
|
|
|
if (CollectionUtil.isEmpty(dataSourceList)) { |
|
|
|
throw new BaseException("查询不到社区"); |
|
|
|
try { |
|
|
|
//根据社区ID查询数据源
|
|
|
|
List<UmsDataSourceVo.Result> dataSourceList = umsDataSourceDao.query(Long.parseLong(from)); |
|
|
|
if (CollectionUtil.isEmpty(dataSourceList)) { |
|
|
|
throw new BaseException("查询不到社区"); |
|
|
|
} |
|
|
|
//切换数据源查询
|
|
|
|
changeDataSource(dataSourceList.get(0).getDataSourceKey()); |
|
|
|
}catch (Exception e) { |
|
|
|
throw new BaseException("UUID错误:{}", from); |
|
|
|
} |
|
|
|
//切换数据源查询
|
|
|
|
changeDataSource(dataSourceList.get(0).getDataSourceKey()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private static void changeDataSource(String key) { |
|
|
|