|
|
@ -7,9 +7,14 @@ import com.acupuncture.common.annotation.Anonymous; |
|
|
|
import com.acupuncture.common.core.domain.BaseDto; |
|
|
|
import com.acupuncture.common.core.domain.JsonResponse; |
|
|
|
import com.acupuncture.common.utils.SecurityUtils; |
|
|
|
import com.acupuncture.framework.datasource.DynamicDataSourceContextHolder; |
|
|
|
import com.acupuncture.system.domain.dto.ScreeningDto; |
|
|
|
import com.acupuncture.system.domain.po.DmsTenant; |
|
|
|
import com.acupuncture.system.domain.po.UmsDataSource; |
|
|
|
import com.acupuncture.system.domain.vo.QuestionnaireVo; |
|
|
|
import com.acupuncture.system.domain.vo.ScrScreenVo; |
|
|
|
import com.acupuncture.system.persist.mapper.DmsTenantMapper; |
|
|
|
import com.acupuncture.system.persist.mapper.UmsDataSourceMapper; |
|
|
|
import com.acupuncture.system.service.IScreeningService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
@ -36,10 +41,15 @@ import java.util.List; |
|
|
|
public class ScreeningController { |
|
|
|
@Resource |
|
|
|
private IScreeningService screeningService; |
|
|
|
@Resource |
|
|
|
private DmsTenantMapper dmsTenantMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private UmsDataSourceMapper umsDataSourceMapper; |
|
|
|
|
|
|
|
@ApiOperation(value = "查询筛查列表", notes = "原:查询医院是否填写了调查筛查") |
|
|
|
@RequestMapping(value = "/queryDetail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse<PageInfo<ScrScreenVo.Result>> queryDetail(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.Query> param){ |
|
|
|
public JsonResponse<PageInfo<ScrScreenVo.Result>> queryDetail(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.Query> param) { |
|
|
|
log.info("查询筛查列表"); |
|
|
|
if (param.getPageNum() > 0) { |
|
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize()); |
|
|
@ -49,7 +59,7 @@ public class ScreeningController { |
|
|
|
|
|
|
|
@ApiOperation(value = "后台查询筛查列表", notes = "原:查询医院是否填写了调查筛查") |
|
|
|
@RequestMapping(value = "/admin/queryDetail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse<PageInfo<ScrScreenVo.Result>> adminQueryDetail(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.Query> param){ |
|
|
|
public JsonResponse<PageInfo<ScrScreenVo.Result>> adminQueryDetail(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.Query> param) { |
|
|
|
log.info("查询筛查列表"); |
|
|
|
if (param.getPageNum() > 0) { |
|
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize()); |
|
|
@ -72,11 +82,22 @@ public class ScreeningController { |
|
|
|
@RequestMapping(value = "/createNoToken", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse<QuestionnaireVo.DetailInfo> createNoToken(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.CreateDetail> params) throws Exception { |
|
|
|
log.info("创建筛查详情{}", params); |
|
|
|
QuestionnaireVo.DetailInfo detailInfo = screeningService.createDetail(params.getParam(), params.getParam().getUserId(), params.getParam().getTenantId()); |
|
|
|
// changeDataSource(params.getParam().getTenantId());
|
|
|
|
QuestionnaireVo.DetailInfo detailInfo = screeningService.createDetail(params.getParam(), params.getParam().getUserId(), params.getParam().getTenantId()); |
|
|
|
log.info("创建筛查详情结束"); |
|
|
|
return JsonResponse.ok(detailInfo); |
|
|
|
} |
|
|
|
|
|
|
|
private void changeDataSource(Long tenantId) { |
|
|
|
DmsTenant dmsTenant = dmsTenantMapper.selectByPrimaryKey(tenantId); |
|
|
|
if (dmsTenant != null) { |
|
|
|
UmsDataSource umsDataSource = umsDataSourceMapper.selectByPrimaryKey(dmsTenant.getDataSourceId()); |
|
|
|
if (umsDataSource != null) { |
|
|
|
DynamicDataSourceContextHolder.setDataSourceType(umsDataSource.getDataSourceKey()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "提交筛查", notes = "") |
|
|
|
@RequestMapping(value = "/submit", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse submitQuestionnaire(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.SubmitScreeningQuestionnaire> params) throws Exception { |
|
|
@ -90,16 +111,17 @@ public class ScreeningController { |
|
|
|
@RequestMapping(value = "/submitNoToken", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse submitNoToken(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.SubmitScreeningQuestionnaire> params) throws Exception { |
|
|
|
log.info("提交筛查开始{}", params); |
|
|
|
screeningService.submitQuestionnaire(params.getParam(), 0L); |
|
|
|
// changeDataSource(params.getParam().getTenantId());
|
|
|
|
screeningService.submitQuestionnaire(params.getParam(), 0L); |
|
|
|
return JsonResponse.ok(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Anonymous |
|
|
|
@ApiOperation(value = "保存调查筛查**", notes = "") |
|
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse saveQuestionnaire(@ApiParam @Validated @RequestBody BaseDto<ScreeningDto.SaveQuestionnaire> params) throws Exception { |
|
|
|
log.info("保存调查筛查开始{}", params); |
|
|
|
// changeDataSource(params.getParam().getTenantId());
|
|
|
|
screeningService.saveQuestionnaire(params.getParam(), params.getParam().getUserId()); |
|
|
|
log.info("保存调查筛查结束"); |
|
|
|
return JsonResponse.ok(); |
|
|
@ -107,7 +129,7 @@ public class ScreeningController { |
|
|
|
|
|
|
|
@ApiOperation(value = "筛查随访", notes = "") |
|
|
|
@RequestMapping(value = "/follow", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse follow(@Validated @RequestBody BaseDto<ScreeningDto.ScreenFollow> screenFollow){ |
|
|
|
public JsonResponse follow(@Validated @RequestBody BaseDto<ScreeningDto.ScreenFollow> screenFollow) { |
|
|
|
screeningService.follow(screenFollow.getParam().getPatientId(), screenFollow.getParam().getStatus()); |
|
|
|
return JsonResponse.ok(); |
|
|
|
} |
|
|
@ -123,19 +145,19 @@ public class ScreeningController { |
|
|
|
|
|
|
|
@ApiOperation(value = "导出筛查列表", notes = "") |
|
|
|
@RequestMapping(value = "/exportScreen", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public void export(HttpServletResponse response, @RequestBody @Validated BaseDto<ScreeningDto.Query> param) { |
|
|
|
public void export(HttpServletResponse response, @RequestBody @Validated BaseDto<ScreeningDto.Query> param) { |
|
|
|
screeningService.export(response, param.getParam()); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "导出筛查列表", notes = "") |
|
|
|
@RequestMapping(value = "/admin/exportScreen", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public void adminExport(HttpServletResponse response, @RequestBody @Validated BaseDto<ScreeningDto.Query> param) { |
|
|
|
public void adminExport(HttpServletResponse response, @RequestBody @Validated BaseDto<ScreeningDto.Query> param) { |
|
|
|
screeningService.adminExport(response, param.getParam()); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "导出认知筛查列表", notes = "") |
|
|
|
@RequestMapping(value = "/exportRzScreen", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public void exportRzScreen(HttpServletResponse response, @RequestBody @Validated BaseDto<ScreeningDto.Query> param) { |
|
|
|
public void exportRzScreen(HttpServletResponse response, @RequestBody @Validated BaseDto<ScreeningDto.Query> param) { |
|
|
|
screeningService.exportRzScreen(response, param.getParam()); |
|
|
|
} |
|
|
|
|
|
|
|