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 8f900a27..b6dd684b 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 @@ -85,14 +85,14 @@ public class AdminPmsTreatmentController { DynamicDataSourceContextHolder.setDataSourceType(dataSourceKey); } - @ApiOperation("导出诊疗档案评估报告") - @PostMapping("/exportTreatmentPg") - public JsonResponse exportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){ - return JsonResponse.ok(treatmentService.exportTreatmentPg(response, dto)); - } +// @ApiOperation("导出诊疗档案评估报告") +// @PostMapping("/exportTreatmentPg") +// public JsonResponse exportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){ +// return JsonResponse.ok(treatmentService.exportTreatmentPg(response, dto)); +// } @ApiOperation("后台导出诊疗档案评估报告") - @PostMapping("/admin/exportTreatmentPg") + @PostMapping("/exportTreatmentPg") public JsonResponse adminExportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){ return JsonResponse.ok(treatmentService.adminExportTreatmentPg(response, dto)); } diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java index ba6c7c30..469dadbe 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java @@ -1,8 +1,10 @@ package com.acupuncture.web.controller.web; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONArray; import com.acupuncture.common.annotation.Anonymous; import com.acupuncture.common.config.RuoYiConfig; import com.acupuncture.common.core.domain.AjaxResult; @@ -35,6 +37,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; /** @@ -103,24 +106,28 @@ public class ExternalController { // return "upload ok"; // } -// @Anonymous -// @ApiOperation("上传数据") -// @PostMapping("/http/uploadMemberInfo") -// public Object add(@RequestBody String str){ -// JsonArray jsonValues = new JsonArray(); -// -// log.info("上传数据dto123:{}",list); -//// List list = dto.getList(); -// int add = 0; -// for (ExternalDto.RtcfInfoDto rtcfInfoDto : list) { -// checkoutData(rtcfInfoDto.getUUID()); -// add += externalService.add(rtcfInfoDto); -// } -// if (add == 0) { -// return "upload fail"; -// } -// return "upload ok"; -// } + @Anonymous + @ApiOperation("上传数据") + @PostMapping("/http/uploadMemberInfo") + public Object add(@RequestBody String str){ + + JSONArray objects = new JSONArray(str); + List list = new ArrayList<>(); + for (Object object : objects) { + list.add(BeanUtil.copyProperties(object, ExternalDto.RtcfInfoDto.class)); + } + log.info("上传数据dto123:{}",list); +// List list = dto.getList(); + int add = 0; + for (ExternalDto.RtcfInfoDto rtcfInfoDto : list) { + checkoutData(rtcfInfoDto.getUUID()); + add += externalService.add(rtcfInfoDto); + } + if (add == 0) { + return "upload fail"; + } + return "upload ok"; + } @Anonymous @ApiOperation("上传数据") diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java index 58fdcd19..ae352a71 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java @@ -17,6 +17,7 @@ import com.acupuncture.system.persist.dao.FmsFollowupDao; import com.acupuncture.system.persist.dao.UmsDataSourceDao; import com.acupuncture.system.persist.mapper.FmsFollowupTaskMapper; import com.acupuncture.system.persist.mapper.FmsPatientQueueRelationMapper; +import com.acupuncture.system.service.FmsFollowupQueueService; import com.acupuncture.system.service.FmsFollowupService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -60,6 +61,8 @@ public class TaskController { private FmsPatientQueueRelationMapper fmsPatientQueueRelationMapper; @Resource private RedisCache redisCache; + @Resource + private FmsFollowupQueueService fmsFollowupQueueService; @ApiOperation("定时任务添加随访工单") @PostMapping("/task") @@ -78,10 +81,14 @@ public class TaskController { } //查询公共队列 List queueResults = redisCache.getCacheList("common_followup_queue"); + List followupQueueVOS = new ArrayList<>(); + if (CollectionUtil.isEmpty(queueResults)) { + followupQueueVOS = fmsFollowupQueueService.queryCommonQueue(null); + } // List queueResults = fmsFollowupDao.queryCommonQueue(null); //切换数据源 for (UmsDataSourceVo.Result result : query) { - if ("MASTER".equals(result.getDataSourceKey())) { + if ("MASTER".equals(result.getDataSourceKey()) || "SXYFYY".equals(result.getDataSourceKey())) { continue; } changeDataSource(result); @@ -92,11 +99,11 @@ public class TaskController { if (CollectionUtil.isEmpty(queueList)) { if (CollectionUtil.isEmpty(queueResults)) { - queueList = BeanUtil.copyToList(queueResults, FmsFollowupVo.FollowupQueueVO.class); + queueList = followupQueueVOS; } } else { if (CollectionUtil.isEmpty(queueResults)) { - queueList.addAll(BeanUtil.copyToList(queueResults, FmsFollowupVo.FollowupQueueVO.class)); + queueList.addAll(followupQueueVOS); } } for (FmsFollowupVo.FollowupQueueVO followupQueueVO : queueList) { @@ -106,6 +113,9 @@ public class TaskController { // changeDataSource(result); FmsFollowupDto.FollowupPatientQueryDTO followupPatientQueryDTO = new FmsFollowupDto.FollowupPatientQueryDTO(); followupPatientQueryDTO.setQueueId(followupQueueVO.getId()); + followupPatientQueryDTO.setTenantId(followupQueueVO.getTenantId()); + changeDataSource(result); + List patientList = fmsFollowupService.queryPatient(followupPatientQueryDTO); // List patientList = fmsFollowupDao.queryPatient(followupQueueVO.getId(), null, null); if (CollectionUtil.isEmpty(patientList)) { diff --git a/acupuncture-framework/src/main/java/com/acupuncture/framework/aspectj/AdminGlobalDataSourceAspect.java b/acupuncture-framework/src/main/java/com/acupuncture/framework/aspectj/AdminGlobalDataSourceAspect.java index 56b94a62..a2ef04ab 100644 --- a/acupuncture-framework/src/main/java/com/acupuncture/framework/aspectj/AdminGlobalDataSourceAspect.java +++ b/acupuncture-framework/src/main/java/com/acupuncture/framework/aspectj/AdminGlobalDataSourceAspect.java @@ -42,7 +42,8 @@ public class AdminGlobalDataSourceAspect { private static final String DATASOURCE_NOT_FOUND = "未找到数据源"; - @Pointcut("(execution(* com.acupuncture.web.controller..*.*(..))) && !@annotation(com.acupuncture.common.annotation.DataSource)") + @Pointcut("(execution(* com.acupuncture.web.controller..*.*(..))) && !@annotation(com.acupuncture.common.annotation.DataSource)" + + "|| @within(com.acupuncture.web.task.*)") public void dsPointCut() { } 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 1ab1b6ce..aeb17097 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").permitAll() + requests.antMatchers("/login", "/register", "/captchaImage", "/web/login", "/web/queryTenantById", "/api/http/getUserInfo", "/api/http/addReportImage", "/api/http/uploadMemberInfo", "/task/task").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-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java b/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java index 51288f14..ea3dfb94 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java @@ -71,6 +71,8 @@ public class AdminTenantUserDto { @Data public static class Query { private Long tenantId; + + private String tenantName; } } diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ExternalDto.java b/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ExternalDto.java index ca5ed4bb..45c63fa4 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ExternalDto.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ExternalDto.java @@ -2,6 +2,7 @@ package com.acupuncture.system.domain.dto; import com.acupuncture.system.domain.po.UplReportImage; import com.acupuncture.system.domain.po.UplRtcfInfo; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import lombok.Data; @@ -34,6 +35,7 @@ public class ExternalDto { private String message; + @JsonProperty(value = "UUID") private String UUID; private String deviceID; diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/FmsFollowupDto.java b/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/FmsFollowupDto.java index 038bb3f4..11cba362 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/FmsFollowupDto.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/FmsFollowupDto.java @@ -107,6 +107,8 @@ public class FmsFollowupDto { private Integer educationYears; + private Date dischargeTime; + private String phone; private Byte idCardType; diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/PmsTreatmentVo.java b/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/PmsTreatmentVo.java index 80ab8576..9ec92e90 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/PmsTreatmentVo.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/PmsTreatmentVo.java @@ -94,9 +94,6 @@ public class PmsTreatmentVo { private Date createTime; - public TreatmentRecordVO() { - } - public TreatmentRecordVO(PmsTreatment pmsTreatment) { this.treatmentId = pmsTreatment.getId(); this.name = pmsTreatment.getName(); @@ -118,7 +115,6 @@ public class PmsTreatmentVo { this.diagnosisName = pmsTreatment.getDiagnosisName(); this.status = pmsTreatment.getStatus(); this.organizationId = pmsTreatment.getTenantId(); - } } diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java index 5062df71..9def122e 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java @@ -53,7 +53,7 @@ public class ExternalServiceImpl implements ExternalService { uplRtcfInfos.setId(IdUtil.getSnowflakeNextId()); uplRtcfInfos.setCreateTime(new Date()); uplRtcfInfos.setDelFlag((byte) 0); - + uplRtcfInfos.setUuid(rtcfInfoDto.getUUID()); uplRtcfInfos.setAsmi(rtcfInfoDto.getASMI()); uplRtcfInfos.setBmi(rtcfInfoDto.getBMI()); uplRtcfInfos.setDeviceId(rtcfInfoDto.getDeviceID()); @@ -100,6 +100,44 @@ public class ExternalServiceImpl implements ExternalService { uplRtcfInfos.setRlFat(rtcfInfoDto.getRL_fat()); uplRtcfInfos.setTrWater(rtcfInfoDto.getTR_water()); uplRtcfInfos.setLaWater(rtcfInfoDto.getLA_water()); + uplRtcfInfos.setBoneMax(rtcfInfoDto.getBoneMax()); + uplRtcfInfos.setBoneMin(rtcfInfoDto.getBoneMin()); + uplRtcfInfos.setBone(rtcfInfoDto.getBone()); + uplRtcfInfos.setProtein(rtcfInfoDto.getProtein()); + uplRtcfInfos.setWater(rtcfInfoDto.getWater()); + uplRtcfInfos.setIcw(rtcfInfoDto.getICW()); + uplRtcfInfos.setEcw(rtcfInfoDto.getECW()); + uplRtcfInfos.setMuscleControl(rtcfInfoDto.getMuscle_control()); + uplRtcfInfos.setRaWater(rtcfInfoDto.getRA_water()); + uplRtcfInfos.setRlWater(rtcfInfoDto.getRL_water()); + uplRtcfInfos.setLaMuscle(rtcfInfoDto.getLA_muscle()); + uplRtcfInfos.setTrMuscle(rtcfInfoDto.getTR_muscle()); + uplRtcfInfos.setRaMuscle(rtcfInfoDto.getRA_muscle()); + uplRtcfInfos.setRlMuscle(rtcfInfoDto.getRL_muscle()); + uplRtcfInfos.setTrBone(rtcfInfoDto.getTR_bone()); + uplRtcfInfos.setLaBone(rtcfInfoDto.getLA_bone()); + uplRtcfInfos.setRaBone(rtcfInfoDto.getRA_bone()); + uplRtcfInfos.setRlBone(rtcfInfoDto.getRL_bone()); + uplRtcfInfos.setBoneMin(rtcfInfoDto.getBoneMin()); + uplRtcfInfos.setBoneMax(rtcfInfoDto.getBoneMax()); + uplRtcfInfos.setVfiMax(rtcfInfoDto.getVFIMax()); + uplRtcfInfos.setVfiMin(rtcfInfoDto.getVFIMin()); + uplRtcfInfos.setWhr(rtcfInfoDto.getWHR()); + uplRtcfInfos.setWhrMax(rtcfInfoDto.getWHRMax()); + uplRtcfInfos.setWhrMin(rtcfInfoDto.getWHRMin()); + uplRtcfInfos.setEdemaMax(rtcfInfoDto.getEdemaMax()); + uplRtcfInfos.setEdemaMin(rtcfInfoDto.getEdemaMin()); + uplRtcfInfos.setEdema(rtcfInfoDto.getEdema()); + uplRtcfInfos.setProteinMax(rtcfInfoDto.getProteinMax()); + uplRtcfInfos.setProteinMin(rtcfInfoDto.getProteinMin()); + uplRtcfInfos.setWaterMax(rtcfInfoDto.getWaterMax()); + uplRtcfInfos.setWaterMin(rtcfInfoDto.getWaterMin()); + uplRtcfInfos.setMuscleMax(rtcfInfoDto.getMuscleMax()); + uplRtcfInfos.setWaterMin(rtcfInfoDto.getWaterMin()); + uplRtcfInfos.setSmmMax(rtcfInfoDto.getSMMMax()); + uplRtcfInfos.setSmmMin(rtcfInfoDto.getSMMMin()); + uplRtcfInfos.setBmiMax(rtcfInfoDto.getBMIMax()); + uplRtcfInfos.setBmiMin(rtcfInfoDto.getBMIMin()); int insert = uplRtcfInfoMapper.insert(uplRtcfInfos); if (insert > 0) { diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java index d22b9bd4..db2e47bc 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java @@ -284,6 +284,7 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService { patientQueueRelation.setId(IdUtil.getSnowflakeNextId()); patientQueueRelation.setDelFlag((byte) 0); patientQueueRelation.setIdCard(pmsTreatment.getIdCard()); + patientQueueRelation.setDischargeTime(pmsTreatment.getDischargeTime()); patientQueueRelation.setIdCardType(pmsTreatment.getIdCardType().byteValue()); patientQueueRelation.setCreateBy(SecurityUtils.getUsername()); patientQueueRelation.setPatientId(pmsTreatment.getPatientId()); @@ -298,6 +299,7 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService { patientQueueRelation.setIdCard(pmsTreatment.getIdCard()); patientQueueRelation.setIdCardType(pmsTreatment.getIdCardType().byteValue()); patientQueueRelation.setCreateBy(SecurityUtils.getUsername()); + patientQueueRelation.setDischargeTime(pmsTreatment.getDischargeTime()); patientQueueRelation.setPatientId(pmsTreatment.getPatientId()); patientQueueRelation.setQueueId(null); patientQueueRelation.setCreateTime(new Date()); @@ -345,8 +347,51 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService { } else { recordVoMap = MapUtil.newHashMap(); } - treatmentRecordVO.setRecordValDict(recordVoMap); + //查询公共队列 + List commonFollowupQueue = redisCache.getCacheList("common_followup_queue"); + PmsTreatmentRecordExample pmsTreatmentRecordExample = new PmsTreatmentRecordExample(); + pmsTreatmentRecordExample.createCriteria().andDelFlagEqualTo((byte) 0).andQuestionCodeEqualTo("JBXX_ZYZD").andTreatmentIdEqualTo(pmsTreatment.getId()); + List pmsTreatmentRecords = pmsTreatmentRecordMapper.selectByExample(pmsTreatmentRecordExample); + if (CollectionUtil.isNotEmpty(pmsTreatmentRecords)) { + String answer = pmsTreatmentRecords.get(0).getAnswer(); + if (StrUtil.isNotEmpty(answer)) { + pmsTreatment.setDiagnosisName(answer.replace("!@#", ",")); + } + } + List queueVos = fmsFollowupDao.queryQueueListByPatientId(pmsTreatment.getPatientId()); + if (CollectionUtil.isNotEmpty(queueVos)) { + 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())); + } + List list = new ArrayList<>(); + for (PmsTreatmentVo.TreatmentVO.QueueVo queueVo : queueVos) { + if (queueVo == null || queueVo.getQueueId() == null) { + list.add(queueVo); + continue; + } + FmsFollowupVo.FollowupQueueVO followupQueueVO = map.get(queueVo.getQueueId()); + if (followupQueueVO != null) { + queueVo.setQueueName(followupQueueVO.getName()); + } + } + queueVos.removeAll(list); + } + + PmsTreatmentVo.TreatmentRecord treatmentRecord = new PmsTreatmentVo.TreatmentRecord(); + List queueIdList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(queueVos)) { + for (PmsTreatmentVo.TreatmentVO.QueueVo vo : queueVos) { + queueIdList.add(vo.getQueueId() + ""); + } + } + treatmentRecord.setValid(true); + treatmentRecord.setAnswerString(queueIdList.stream().collect(Collectors.joining("!@#"))); + treatmentRecord.setQuestionCode("SFDL"); + recordVoMap.put("SFDL", CollectionUtil.newArrayList(treatmentRecord)); + treatmentRecordVO.setRecordValDict(recordVoMap); return treatmentRecordVO; } diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java index 84df4a3a..c073475b 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java @@ -320,6 +320,7 @@ public class ScreeningServiceImpl implements IScreeningService { } @Override public PageInfo queryDetailByPage(ScreeningDto.Query param, Integer pageNum, Integer pageSize) { + param.setTenantId(SecurityUtils.getTenantId()); List results = screeningDetailDao.queryResult(null, null, param); if (CollectionUtil.isNotEmpty(results)) { List screeningDetailVos = screeningDetailDao.queryDetailList(results.stream().map(ScrScreenVo.Result::getId).collect(Collectors.toList())); diff --git a/acupuncture-system/src/main/resources/mapper/dao/AdminDmsUserDao.xml b/acupuncture-system/src/main/resources/mapper/dao/AdminDmsUserDao.xml index 351a7b0d..ac387340 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/AdminDmsUserDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/AdminDmsUserDao.xml @@ -30,6 +30,9 @@ AND u.tenant_id = #{dto.tenantId} + + AND t.name like concat('%',#{dto.tenantName},'%') + diff --git a/acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml b/acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml index a9181da4..54db2bbd 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml @@ -87,6 +87,9 @@ ) + + and r.tenant_id = #{tenantId} + and r.create_time >= #{param.startTime}