diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/system/SysLoginController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/system/SysLoginController.java index 9f9672e4..745ac45c 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/system/SysLoginController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/system/SysLoginController.java @@ -66,6 +66,23 @@ public class SysLoginController return ajax; } + /** + * 登录方法 + * + * @param loginBody 登录信息 + * @return 结果 + */ + @PostMapping("/loginSimple") + public AjaxResult loginSimple(@RequestBody LoginBody loginBody) + { + AjaxResult ajax = AjaxResult.success(); + // 生成令牌 + String token = loginService.loginSimple(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), + loginBody.getUuid()); + ajax.put(Constants.TOKEN, token); + return ajax; + } + /** * 获取用户信息 * diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminFmsFollowupController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminFmsFollowupController.java index 4c8ab572..8a56bc2a 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminFmsFollowupController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminFmsFollowupController.java @@ -1,8 +1,10 @@ package com.acupuncture.web.controller.web; import com.acupuncture.common.annotation.Anonymous; +import com.acupuncture.common.annotation.DataSource; import com.acupuncture.common.core.domain.BaseDto; import com.acupuncture.common.core.domain.JsonResponse; +import com.acupuncture.common.enums.DataSourceType; import com.acupuncture.system.domain.dto.FmsFollowupDto; import com.acupuncture.system.domain.vo.FmsFollowupVo; import com.acupuncture.system.service.AdminFmsFollowupQueueService; @@ -36,6 +38,7 @@ public class AdminFmsFollowupController { @ApiOperation("查询队列") @PostMapping("/query") @Anonymous + @DataSource(DataSourceType.MASTER) public JsonResponse> queryCommonQueue(@RequestBody @Validated BaseDto dto) { if (dto.getPageNum() > 0) { PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); @@ -45,6 +48,7 @@ public class AdminFmsFollowupController { @ApiOperation("添加随访队列") @PostMapping("/add") + @DataSource(DataSourceType.MASTER) public JsonResponse addQueue(@RequestBody @Validated FmsFollowupDto.Add dto){ return JsonResponse.ok(fmsFollowupQueueService.addQueue(dto)); } @@ -57,12 +61,14 @@ public class AdminFmsFollowupController { @ApiOperation("删除随访队列") @PostMapping("/del") + @DataSource(DataSourceType.MASTER) public JsonResponse delQueue(@RequestBody @Validated FmsFollowupDto.Del dto){ return JsonResponse.ok(fmsFollowupQueueService.delQueue(dto)); } @ApiOperation("查询随访患者") @PostMapping("/queryPatient") + @DataSource(DataSourceType.MASTER) public JsonResponse> queryPatient(@RequestBody @Validated BaseDto dto) { if (dto.getPageNum() > 0) { PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); @@ -72,6 +78,7 @@ public class AdminFmsFollowupController { @ApiOperation("查询随访任务") @PostMapping("/queryTask") + @DataSource(DataSourceType.MASTER) public JsonResponse> queryTask(@RequestBody @Validated BaseDto dto) { if (dto.getPageNum() > 0) { PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsPatientController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsPatientController.java index d03c0f0b..79e9634a 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsPatientController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsPatientController.java @@ -1,7 +1,9 @@ package com.acupuncture.web.controller.web; +import com.acupuncture.common.annotation.DataSource; import com.acupuncture.common.core.domain.BaseDto; import com.acupuncture.common.core.domain.JsonResponse; +import com.acupuncture.common.enums.DataSourceType; import com.acupuncture.system.domain.dto.FmsFollowupDto; import com.acupuncture.system.domain.dto.PmsPatientDto; import com.acupuncture.system.domain.vo.FmsFollowupVo; @@ -47,6 +49,7 @@ public class AdminPmsPatientController { */ @ApiOperation("查询上报类型") @PostMapping("/list") + @DataSource(DataSourceType.MASTER) public JsonResponse> adminQuery( @RequestBody @Validated BaseDto dto) { if (dto.getPageNum() > 0) { PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); @@ -56,6 +59,7 @@ public class AdminPmsPatientController { @ApiOperation("导出") @PostMapping("/export") + @DataSource(DataSourceType.MASTER) public void adminExportPatient(HttpServletResponse response, @RequestBody @Validated PmsPatientDto.PatientQuery dto) { pmsPatientService.adminExportPatient(response, dto); } diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java index cb215b8b..2f976d16 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java @@ -1,7 +1,9 @@ package com.acupuncture.web.controller.web; +import com.acupuncture.common.annotation.DataSource; import com.acupuncture.common.core.domain.BaseDto; import com.acupuncture.common.core.domain.JsonResponse; +import com.acupuncture.common.enums.DataSourceType; import com.acupuncture.framework.datasource.DynamicDataSourceContextHolder; import com.acupuncture.system.domain.dto.PmsTreatmentDto; import com.acupuncture.system.domain.po.DmsTenant; @@ -41,13 +43,10 @@ public class AdminPmsTreatmentController { @Resource private PmsTreatmentService treatmentService; - @Resource - private DmsTenantMapper dmsTenantMapper; - @Resource - private UmsDataSourceMapper umsDataSourceMapper; @ApiOperation("查询诊疗档案") @PostMapping("/list") + @DataSource(DataSourceType.MASTER) public JsonResponse> listTreatment(@RequestBody @Validated BaseDto queryDTO) { if (queryDTO.getPageNum() > 0) { PageHelper.startPage(queryDTO.getPageNum(), queryDTO.getPageSize()); @@ -57,12 +56,14 @@ public class AdminPmsTreatmentController { @ApiOperation("查询诊疗档案数据") @PostMapping("/queryRecord") + @DataSource(DataSourceType.MASTER) public JsonResponse queryRecord(@RequestBody @Validated PmsTreatmentDto.QueryRecord dto) { return JsonResponse.ok(treatmentService.adminQueryRecord(dto.getTreatmentId(), dto.getCodeList())); } @ApiOperation("导出诊疗档案数据") @PostMapping("/exportTreatment") + @DataSource(DataSourceType.MASTER) public void exportTreatment(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.TreatmentQueryDTO dto) { treatmentService.adminExportTreatment(response, dto); } diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java index 2b5a8a70..2ec33f90 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminStatisticsController.java @@ -1,6 +1,8 @@ package com.acupuncture.web.controller.web; +import com.acupuncture.common.annotation.DataSource; import com.acupuncture.common.core.domain.JsonResponse; +import com.acupuncture.common.enums.DataSourceType; import com.acupuncture.system.domain.dto.StatisticsDto; import com.acupuncture.system.domain.vo.AdminStatisticsVo; import com.acupuncture.system.service.AdminStatisticsService; @@ -33,30 +35,35 @@ public class AdminStatisticsController { @ApiOperation("患者统计") @PostMapping("/patientTotal") + @DataSource(DataSourceType.MASTER) public JsonResponse queryPatientStatistics(@RequestBody @Validated StatisticsDto.Query dto) { return JsonResponse.ok(statisticsService.queryPatientStatistics(dto)); } @ApiOperation("诊疗统计") @PostMapping("/zlInfo") + @DataSource(DataSourceType.MASTER) public JsonResponse queryZlStatistics(@RequestBody @Validated StatisticsDto.Query dto) { return JsonResponse.ok(statisticsService.queryZlStatistics(dto)); } @ApiOperation("治疗类型统计") @PostMapping("/zlType") + @DataSource(DataSourceType.MASTER) public JsonResponse queryZlTypeStatistics(@RequestBody @Validated StatisticsDto.Query dto) { return JsonResponse.ok(statisticsService.queryZlTypeStatistics(dto)); } @ApiOperation("随访分布统计") @PostMapping("/sffb") + @DataSource(DataSourceType.MASTER) public JsonResponse> querySfStatistics(@RequestBody @Validated StatisticsDto.Query dto) { return JsonResponse.ok(statisticsService.querySfStatistics(dto)); } @ApiOperation("失访统计") @PostMapping("/sftj") + @DataSource(DataSourceType.MASTER) public JsonResponse> querySfTjStatistics(@RequestBody @Validated StatisticsDto.Query dto) { return JsonResponse.ok(statisticsService.querySfTjStatistics(dto)); } diff --git a/acupuncture-framework/src/main/java/com/acupuncture/framework/config/SecurityConfig.java b/acupuncture-framework/src/main/java/com/acupuncture/framework/config/SecurityConfig.java index aeb17097..8bc43fea 100644 --- a/acupuncture-framework/src/main/java/com/acupuncture/framework/config/SecurityConfig.java +++ b/acupuncture-framework/src/main/java/com/acupuncture/framework/config/SecurityConfig.java @@ -114,7 +114,7 @@ public class SecurityConfig .authorizeHttpRequests((requests) -> { permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - requests.antMatchers("/login", "/register", "/captchaImage", "/web/login", "/web/queryTenantById", "/api/http/getUserInfo", "/api/http/addReportImage", "/api/http/uploadMemberInfo", "/task/task").permitAll() + requests.antMatchers("/login", "/register", "/captchaImage", "/web/login", "/web/queryTenantById", "/api/http/getUserInfo", "/api/http/addReportImage", "/api/http/uploadMemberInfo", "/task/task", "/loginSimple").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**", "/static/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/SysLoginService.java b/acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/SysLoginService.java index 8efafe15..ec76ab47 100644 --- a/acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/SysLoginService.java +++ b/acupuncture-framework/src/main/java/com/acupuncture/framework/web/service/SysLoginService.java @@ -100,6 +100,53 @@ public class SysLoginService return tokenService.createToken(loginUser); } + /** + * 登录验证 + * + * @param username 用户名 + * @param password 密码 + * @param code 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public String loginSimple(String username, String password, String code, String uuid) + { + // 验证码校验 +// validateCaptcha(username, code, uuid); + // 登录前置校验 + loginPreCheck(username, password); + // 用户验证 + Authentication authentication = null; + try + { + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); + AuthenticationContextHolder.setContext(authenticationToken); + // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername + authentication = authenticationManager.authenticate(authenticationToken); + } + catch (Exception e) + { + if (e instanceof BadCredentialsException) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); + throw new UserPasswordNotMatchException(); + } + else + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); + throw new ServiceException(e.getMessage()); + } + } + finally + { + AuthenticationContextHolder.clearContext(); + } + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); + LoginUser loginUser = (LoginUser) authentication.getPrincipal(); + recordLoginInfo(loginUser.getUserId()); + // 生成token + return tokenService.createToken(loginUser); + } /** * 登录验证 * diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminTongjiDao.java b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminTongjiDao.java index 39159e86..85eb828e 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminTongjiDao.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/AdminTongjiDao.java @@ -25,7 +25,6 @@ public interface AdminTongjiDao { * @param tenantId * @return */ - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.PatientVo.GenderVo queryGenderStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); @@ -36,53 +35,37 @@ public interface AdminTongjiDao { * @param tenantId * @return */ - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.PatientVo.AgeVo queryAgeStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.PatientVo.JwbzVo queryJwbzStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) List queryZyzdStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) Integer queryTotalPatient(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.TreamentVo.TxfbVo queryTxfbStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.TreamentVo.ZytzVo queryZytzStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.ZlTypeVo.Zllxtj queryZllxtjStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.ZlTypeVo.BzfffbVo.Fpz queryFpzStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.ZlTypeVo.ZlxgVo queryZlxgStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.ZlTypeVo.ZlfyVo queryZlfyStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) List querySftjStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) List querySfStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.TreamentVo.TtfbVo queryTtfbStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.TreamentVo.SmfbVo querySmfbStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.TreamentVo.JlfbVo queryJlfbStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) AdminStatisticsVo.ZlTypeVo.BzfffbVo.Smz querySmzStatistics(@Param("dto") StatisticsDto.Query dto, @Param("tenantId") Long tenantId); List queryTxStatistics(@Param("dto") StatisticsDto.Query dto, diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/FmsFollowupDao.java b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/FmsFollowupDao.java index 8c5cfaab..daff610a 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/FmsFollowupDao.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/FmsFollowupDao.java @@ -22,10 +22,8 @@ public interface FmsFollowupDao { * @param name * @return */ - @DataSource(DataSourceType.MASTER) List queryCommonQueue(@Param("name") String name); - @DataSource(DataSourceType.MASTER) List queryAll(@Param("name") String name, @Param("tenantId") Long tenantId); @@ -44,13 +42,6 @@ public interface FmsFollowupDao { @Param("haveQueue")Integer haveQueue, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) - List queryTaskPatient(@Param("id") Long id, - @Param("taskFlag") Byte taskFlag, - @Param("haveQueue")Integer haveQueue, - @Param("tenantId") Long tenantId, - @Param("dataScore") String dataScore); - List adminQueryPatient(@Param("id") Long id, @Param("taskFlag") Byte taskFlag, @Param("haveQueue")Integer haveQueue, diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/PmsTreatmentDao.java b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/PmsTreatmentDao.java index c92171c0..f01a853c 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/PmsTreatmentDao.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/PmsTreatmentDao.java @@ -25,14 +25,14 @@ public interface PmsTreatmentDao { List selectRecord(@Param("treatmentId") Long treatmentId, @Param("codeList") List codeList); - @DataSource(DataSourceType.MASTER) +// @DataSource(DataSourceType.MASTER) List adminSelectRecord(@Param("treatmentId") Long treatmentId, @Param("codeList") List codeList); // void batchInsert(@Param("pmsPatientList") List pmsPatientList); - @DataSource(DataSourceType.MASTER) +// @DataSource(DataSourceType.MASTER) List adminQuery(@Param("query") PmsTreatmentDto.TreatmentQueryDTO query); - @DataSource(DataSourceType.MASTER) +// @DataSource(DataSourceType.MASTER) PmsTreatmentVo.TreatmentRecordVO adminQueryTreatment(@Param("id") Long id); } diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java index a6192b03..f0769021 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java @@ -9,7 +9,7 @@ import java.util.List; public interface WxQrCodeDao { - @DataSource(DataSourceType.MASTER) +// @DataSource(DataSourceType.MASTER) AmsWxQrCodeVo.Result queryById(@Param("id")Long id); /** @@ -28,7 +28,7 @@ public interface WxQrCodeDao { @Param("userId") Long userId, @Param("tenantId") Long tenantId); - @DataSource(DataSourceType.MASTER) +// @DataSource(DataSourceType.MASTER) List adminSelectScreenList(@Param("hospitalIdList") List hospitalIdList); diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/AdminFmsFollowupQueueService.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/AdminFmsFollowupQueueService.java index 0aed8d23..8ff6c239 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/AdminFmsFollowupQueueService.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/AdminFmsFollowupQueueService.java @@ -19,7 +19,7 @@ public interface AdminFmsFollowupQueueService { * 查询公共队列 * @return */ - @DataSource(DataSourceType.MASTER) +// @DataSource(DataSourceType.MASTER) List queryCommonQueue(String name, Long tenantId); /** @@ -46,13 +46,6 @@ public interface AdminFmsFollowupQueueService { @DataSource(DataSourceType.MASTER) int delQueue(FmsFollowupDto.Del dto); - /** - * 查询随访患者 - * @param dto - * @return - */ - List queryPatient(FmsFollowupDto.FollowupPatientQueryDTO dto); - /** * 查询随访患者 * @param dto diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/FmsFollowupService.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/FmsFollowupService.java index 0e32835b..ee6d2cf5 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/FmsFollowupService.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/FmsFollowupService.java @@ -51,14 +51,6 @@ public interface FmsFollowupService { */ List queryPatient(FmsFollowupDto.FollowupPatientQueryDTO dto); - /** - * 查询随访患者 - * @param dto - * @return - */ - @DataSource(DataSourceType.MASTER) - List queryTaskPatient(FmsFollowupDto.FollowupPatientQueryDTO dto); - /** * 更新随访患者 * @param dto diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminFmsFollowupQueueServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminFmsFollowupQueueServiceImpl.java index 58e022ef..57c63ca1 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminFmsFollowupQueueServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/AdminFmsFollowupQueueServiceImpl.java @@ -40,7 +40,7 @@ public class AdminFmsFollowupQueueServiceImpl implements AdminFmsFollowupQueueSe private FmsFollowupQueueMapper fmsFollowupQueueMapper; @Override - @DataSource(DataSourceType.MASTER) +// @DataSource(DataSourceType.MASTER) public List queryCommonQueue(String name, Long tenantId) { return fmsFollowupDao.queryAll(name, tenantId); } @@ -75,41 +75,6 @@ public class AdminFmsFollowupQueueServiceImpl implements AdminFmsFollowupQueueSe return fmsFollowupQueueMapper.updateByExampleSelective(fmsFollowupQueue, fmsFollowupQueueExample); } - @Override - public List queryPatient(FmsFollowupDto.FollowupPatientQueryDTO dto) { - List followupPatients = fmsFollowupDao.queryPatient(dto.getQueueId(), null, dto.getHaveQueue(), SecurityUtils.getTenantId()); - if (CollectionUtil.isNotEmpty(followupPatients)) { - List commonFollowupQueue = redisCache.getCacheList("common_followup_queue"); - for (FmsFollowupVo.FollowupPatient followupPatient : followupPatients) { - if (CollectionUtil.isNotEmpty(followupPatient.getQueueList())) { - - List queueVos = fmsFollowupDao.adminQueryQueueListByPatientId(followupPatient.getPatientId()); - List queueVoList = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(queueVos)) { - queueVoList = BeanUtil.copyToList(queueVos, FmsFollowupVo.FollowupPatient.QueueVo.class); - Map map = new HashMap<>(); - if (CollectionUtil.isNotEmpty(commonFollowupQueue)) { - List followupQueueVOS1 = BeanUtil.copyToList(commonFollowupQueue, FmsFollowupVo.FollowupQueueVO.class); - map = followupQueueVOS1.stream().collect(Collectors.toMap(FmsFollowupVo.FollowupQueueVO::getId, Function.identity())); - } - for (FmsFollowupVo.FollowupPatient.QueueVo queueVo : queueVoList) { - if (queueVo == null || queueVo.getQueueId() == null) { - continue; - } - FmsFollowupVo.FollowupQueueVO followupQueueVO = map.get(queueVo.getQueueId()); - if (followupQueueVO != null) { - queueVo.setQueueName(followupQueueVO.getName()); - } - } - } - followupPatient.setQueueList(queueVoList); - - } - } - } - return followupPatients; - } - @Override public List adminQueryPatient(FmsFollowupDto.FollowupPatientQueryDTO dto) { List followupPatients = fmsFollowupDao.adminQueryPatient(dto.getQueueId(), null, dto.getHaveQueue(), dto.getTenantId()); diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/FmsFollowupServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/FmsFollowupServiceImpl.java index 50ae8ec9..884ac311 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/FmsFollowupServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/FmsFollowupServiceImpl.java @@ -131,42 +131,6 @@ public class FmsFollowupServiceImpl implements FmsFollowupService { return followupPatients; } - - @Override - @DataSource(DataSourceType.MASTER) - public List queryTaskPatient(FmsFollowupDto.FollowupPatientQueryDTO dto) { - List followupPatients = fmsFollowupDao.queryTaskPatient(dto.getQueueId(), null, dto.getHaveQueue(), dto.getTenantId(), dto.getDataScore()); - if (CollectionUtil.isNotEmpty(followupPatients)) { - List commonFollowupQueue = redisCache.getCacheList("common_followup_queue"); - for (FmsFollowupVo.FollowupPatient followupPatient : followupPatients) { - if (CollectionUtil.isNotEmpty(followupPatient.getQueueList())) { - - List queueVos = fmsFollowupDao.queryQueueListByPatientId(followupPatient.getPatientId()); - List queueVoList = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(queueVos)) { - queueVoList = BeanUtil.copyToList(queueVos, FmsFollowupVo.FollowupPatient.QueueVo.class); - Map map = new HashMap<>(); - if (CollectionUtil.isNotEmpty(commonFollowupQueue)) { - List followupQueueVOS1 = BeanUtil.copyToList(commonFollowupQueue, FmsFollowupVo.FollowupQueueVO.class); - map = followupQueueVOS1.stream().collect(Collectors.toMap(FmsFollowupVo.FollowupQueueVO::getId, Function.identity())); - } - for (FmsFollowupVo.FollowupPatient.QueueVo queueVo : queueVoList) { - if (queueVo == null || queueVo.getQueueId() == null) { - continue; - } - FmsFollowupVo.FollowupQueueVO followupQueueVO = map.get(queueVo.getQueueId()); - if (followupQueueVO != null) { - queueVo.setQueueName(followupQueueVO.getName()); - } - } - } - followupPatient.setQueueList(queueVoList); - } - } - } - return followupPatients; - } - @Override public Integer updPatient(FmsFollowupDto.UpdPatient dto) { FmsPatientQueueRelationExample fmsPatientQueueRelationExample = new FmsPatientQueueRelationExample();