|
|
@ -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; |
|
|
@ -49,7 +50,7 @@ import java.util.List; |
|
|
|
@Slf4j |
|
|
|
@Api(tags = "外部接口") |
|
|
|
@RestController |
|
|
|
@RequestMapping("/api") |
|
|
|
@RequestMapping("") |
|
|
|
public class ExternalController { |
|
|
|
|
|
|
|
@Resource |
|
|
@ -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) { |
|
|
@ -180,13 +186,13 @@ public class ExternalController { |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据住院号/门诊号查询人体成分信息") |
|
|
|
@PostMapping("/http/selectByMemberId") |
|
|
|
@PostMapping("/api/http/selectByMemberId") |
|
|
|
public JsonResponse<UplRtcfInfoVo.Result> selectByMemberId(@RequestBody @Validated ExternalDto.MemberDto dto){ |
|
|
|
return JsonResponse.ok(externalService.selectByMemberId(dto.getMemberId())); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("根据住院号/门诊号查询人体成分报告") |
|
|
|
@PostMapping("/http/selectReportByMemberId") |
|
|
|
@PostMapping("/api/http/selectReportByMemberId") |
|
|
|
public JsonResponse<UplReportImage> selectReportByMemberId(@RequestBody @Validated ExternalDto.MemberDto dto){ |
|
|
|
return JsonResponse.ok(externalService.selectReportByMemberId(dto.getMemberId())); |
|
|
|
} |
|
|
|