1747191978@qq.com 3 months ago
parent
commit
79d3eebb0d
  1. 12
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java
  2. 43
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java
  3. 40
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ScreeningController.java
  4. 16
      acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java
  5. 2
      acupuncture-common/src/main/java/com/acupuncture/common/constant/UserConstants.java
  6. 25
      acupuncture-framework/src/main/java/com/acupuncture/framework/aspectj/AdminGlobalDataSourceAspect.java
  7. 2
      acupuncture-framework/src/main/java/com/acupuncture/framework/config/SecurityConfig.java
  8. 2
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/AdminTenantUserDto.java
  9. 2
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ExternalDto.java
  10. 2
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/FmsFollowupDto.java
  11. 2
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ScreeningDto.java
  12. 29
      acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/PmsTreatmentVo.java
  13. 1
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/PmsTreatmentDao.java
  14. 40
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java
  15. 49
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java
  16. 139
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java
  17. 3
      acupuncture-system/src/main/resources/mapper/dao/AdminDmsUserDao.xml
  18. 3
      acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml

12
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<String> exportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){
return JsonResponse.ok(treatmentService.exportTreatmentPg(response, dto));
}
// @ApiOperation("导出诊疗档案评估报告")
// @PostMapping("/exportTreatmentPg")
// public JsonResponse<String> exportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){
// return JsonResponse.ok(treatmentService.exportTreatmentPg(response, dto));
// }
@ApiOperation("后台导出诊疗档案评估报告")
@PostMapping("/admin/exportTreatmentPg")
@PostMapping("/exportTreatmentPg")
public JsonResponse<String> adminExportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){
return JsonResponse.ok(treatmentService.adminExportTreatmentPg(response, dto));
}

43
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<ExternalDto.RtcfInfoDto> 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<ExternalDto.RtcfInfoDto> list = new ArrayList<>();
for (Object object : objects) {
list.add(BeanUtil.copyProperties(object, ExternalDto.RtcfInfoDto.class));
}
log.info("上传数据dto123:{}",list);
// List<ExternalDto.RtcfInfoDto> 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("上传数据")

40
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ScreeningController.java

@ -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());
}

16
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<Object> queueResults = redisCache.getCacheList("common_followup_queue");
List<FmsFollowupVo.FollowupQueueVO> followupQueueVOS = new ArrayList<>();
if (CollectionUtil.isEmpty(queueResults)) {
followupQueueVOS = fmsFollowupQueueService.queryCommonQueue(null);
}
// List<FmsFollowupVo.FollowupQueueVO> 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<FmsFollowupVo.FollowupPatient> patientList = fmsFollowupService.queryPatient(followupPatientQueryDTO);
// List<FmsFollowupVo.FollowupPatient> patientList = fmsFollowupDao.queryPatient(followupQueueVO.getId(), null, null);
if (CollectionUtil.isEmpty(patientList)) {

2
acupuncture-common/src/main/java/com/acupuncture/common/constant/UserConstants.java

@ -81,6 +81,8 @@ public class UserConstants
public static final String HEADER_KEY_TOKEN = "Authorization";
public static final String DEPT = "TENANT_ID";
/**
* QuestionAnswer分隔符
*/

25
acupuncture-framework/src/main/java/com/acupuncture/framework/aspectj/AdminGlobalDataSourceAspect.java

@ -42,7 +42,7 @@ 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)")
public void dsPointCut() {
}
@ -70,16 +70,21 @@ public class AdminGlobalDataSourceAspect {
// 获取请求携带的令牌
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest();
String authHeader = request.getHeader(UserConstants.HEADER_KEY_TOKEN);
//token为空
if(StrUtil.isEmpty(authHeader)){
return null;
}
Long tenantId;
String header = request.getHeader(UserConstants.DEPT);
if(StrUtil.isNotEmpty(header)){
tenantId = Long.parseLong(header);
}else {
// String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID);
Long tenantId = SecurityUtils.getTenantId();
if (tenantId == null) {
return null;
String authHeader = request.getHeader(UserConstants.HEADER_KEY_TOKEN);
if (StrUtil.isEmpty(authHeader)) {
return null;
}
tenantId = SecurityUtils.getTenantId();
if (tenantId == null) {
return null;
}
}
//设置所属医院和数据源
@ -90,7 +95,7 @@ public class AdminGlobalDataSourceAspect {
// if(ObjectUtil.isNull(loginUser) || loginUser.getUser().isAdmin()){
// return null;
// }
//根据部门ID查询数据源
//根据组织ID查询数据源
UmsDataSource dataSource = dmsLoginService.getDataSourceByTenantId(tenantId);
if (dataSource == null) {
throw new BaseException(DATASOURCE_NOT_FOUND);

2
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()

2
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;
}
}

2
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;

2
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;

2
acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ScreeningDto.java

@ -183,6 +183,7 @@ public class ScreeningDto {
@NotNull(message = "问卷详情id不能为空")
@ApiModelProperty("问卷详情id")
private Long detailId;
private Long tenantId;
}
@Data
@ -229,6 +230,7 @@ public class ScreeningDto {
@ApiModelProperty("答案")
private String answer;
private Long userId;
private Long tenantId;
}
@Data

29
acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/PmsTreatmentVo.java

@ -65,25 +65,51 @@ public class PmsTreatmentVo {
@Data
public static class TreatmentRecordVO {
private Long id;
private Long treatmentId;
private Long patientId;
private String name;
private String pinyinFull;
private String pinyinSimple;
private Byte gender;
private Integer age;
private Date birthDate;
private String ethnicity;
private Integer educationYears;
private String phone;
private Byte idCardType;
private String idCard;
private Byte visitType;
private String visitNumber;
private Date visitTime;
private Date dischargeTime;
private String doctor;
private String deptName;
private String diagnosisCode;
private String diagnosisName;
private Byte status;
private Long treatmentId;
private Long organizationId;
@ApiModelProperty("生效的code和答案字典")
private Map<String, TreatmentRecord> validRecordValDict;
@ -118,7 +144,6 @@ public class PmsTreatmentVo {
this.diagnosisName = pmsTreatment.getDiagnosisName();
this.status = pmsTreatment.getStatus();
this.organizationId = pmsTreatment.getTenantId();
}
}

1
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/PmsTreatmentDao.java

@ -33,5 +33,6 @@ public interface PmsTreatmentDao {
@DataSource(DataSourceType.MASTER)
List<PmsTreatmentVo.TreatmentVO> adminQuery(@Param("query") PmsTreatmentDto.TreatmentQueryDTO query);
@DataSource(DataSourceType.MASTER)
PmsTreatmentVo.TreatmentRecordVO adminQueryTreatment(@Param("id") Long id);
}

40
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) {

49
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<Object> commonFollowupQueue = redisCache.getCacheList("common_followup_queue");
PmsTreatmentRecordExample pmsTreatmentRecordExample = new PmsTreatmentRecordExample();
pmsTreatmentRecordExample.createCriteria().andDelFlagEqualTo((byte) 0).andQuestionCodeEqualTo("JBXX_ZYZD").andTreatmentIdEqualTo(pmsTreatment.getId());
List<PmsTreatmentRecord> pmsTreatmentRecords = pmsTreatmentRecordMapper.selectByExample(pmsTreatmentRecordExample);
if (CollectionUtil.isNotEmpty(pmsTreatmentRecords)) {
String answer = pmsTreatmentRecords.get(0).getAnswer();
if (StrUtil.isNotEmpty(answer)) {
pmsTreatment.setDiagnosisName(answer.replace("!@#", ","));
}
}
List<PmsTreatmentVo.TreatmentVO.QueueVo> queueVos = fmsFollowupDao.queryQueueListByPatientId(pmsTreatment.getPatientId());
if (CollectionUtil.isNotEmpty(queueVos)) {
Map<Long, FmsFollowupVo.FollowupQueueVO> map = new HashMap<>();
if (CollectionUtil.isNotEmpty(commonFollowupQueue)) {
List<FmsFollowupVo.FollowupQueueVO> followupQueueVOS1 = BeanUtil.copyToList(commonFollowupQueue, FmsFollowupVo.FollowupQueueVO.class);
map = followupQueueVOS1.stream().collect(Collectors.toMap(FmsFollowupVo.FollowupQueueVO::getId, Function.identity()));
}
List<PmsTreatmentVo.TreatmentVO.QueueVo> 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<String> 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;
}
@ -565,7 +610,7 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService {
if (StrUtil.isNotEmpty(idcard) && IdcardUtil.isValidCard(idcard)) {
dto.setBirthDate(IdcardUtil.getBirthDate(idcard));
}
dto.setIdCardType(rowList.get(7).toString().trim().equals("身份证") ? 0 : rowList.get(7).toString().trim().equals("护照或外国人永居证") ? 1 : rowList.get(7).toString().trim().equals("港澳居民来往内地通行证") ? 2 : rowList.get(7).toString().trim().equals("台湾居民来往大陆通行证") ? 3 : 4);
// dto.setIdCardType(rowList.get(7).toString().trim().equals("身份证") ? 0 : rowList.get(7).toString().trim().equals("护照或外国人永居证") ? 1 : rowList.get(7).toString().trim().equals("港澳居民来往内地通行证") ? 2 : rowList.get(7).toString().trim().equals("台湾居民来往大陆通行证") ? 3 : 4);
dto.setIdCard(idcard);
dto.setVisitType(rowList.get(9).toString().trim().equals("门诊") ? 0 : 1);
dto.setVisitNumber(rowList.get(10).toString());

139
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java

@ -87,23 +87,20 @@ public class ScreeningServiceImpl implements IScreeningService {
List<String> headerList = CollectionUtil.newArrayList(
"姓名",
"性别",
"年龄",
"身份证",
"出生日期",
"手机号",
"有高血压,>=140/90mmHg",
"血脂异常,或不清楚",
"有糖尿病",
"心跳不规则",
"吸烟",
"明显超重或肥胖",
"缺乏运动",
"有卒中家族史",
"有既往脑卒中病史",
"有既往短暂脑缺血病史",
"筛查结果",
"数据来源",
"科室名称");
"年龄",
// "身份证",
"联系方式",
"身高",
"体重",
"BMI",
"体重自评结论",
"失眠自评(SRSS)得分",
"可接受的治疗方式",
"可接受的治疗周期",
"筛查时间",
"组织"
);
excelWriter.writeHeadRow(headerList);
PageInfo<ScrScreenVo.Result> page = queryDetailByPage(param, -1, -1);
@ -124,55 +121,66 @@ public class ScreeningServiceImpl implements IScreeningService {
row += 1;
excelWriter.writeCellValue(0, row, detailVos.get(i).getName() + "");
excelWriter.writeCellValue(1, row, map.get("SCWJ-SEX") == null ? "未知" : map.get("SCWJ-SEX").getAnswer());
excelWriter.writeCellValue(2, row, map.get("SCWJ-AGE") == null ? "" : map.get("SCWJ-AGE").getAnswer());
excelWriter.writeCellValue(3, row, map.get("SCWJ-idCard") == null ? "" : map.get("SCWJ-idCard").getAnswer());
excelWriter.writeCellValue(4, row, map.get("SCWJ-BIRTH") == null ? "" : map.get("SCWJ-BIRTH").getAnswer());
excelWriter.writeCellValue(5, row, map.get("SCWJ-PHONE") == null ? "" : map.get("SCWJ-PHONE").getAnswer());
// excelWriter.writeCellValue(3, row, map.get("SCWJ-idCard") == null ? "" : map.get("SCWJ-idCard").getAnswer());
excelWriter.writeCellValue(2, row, map.get("SCWJ-BIRTH") == null ? "" : map.get("SCWJ-BIRTH").getAnswer());
excelWriter.writeCellValue(3, row, map.get("SCWJ-AGE") == null ? "" : map.get("SCWJ-AGE").getAnswer());
excelWriter.writeCellValue(4, row, map.get("SCWJ-PHONE") == null ? "" : map.get("SCWJ-PHONE").getAnswer());
if (record == null || StrUtil.isEmpty(record.getAnswer())) {
excelWriter.writeCellValue(6, row, "否");
excelWriter.writeCellValue(7, row, "否");
excelWriter.writeCellValue(8, row, "否");
excelWriter.writeCellValue(9, row, "否");
excelWriter.writeCellValue(10, row, "否");
excelWriter.writeCellValue(11, row, "否");
excelWriter.writeCellValue(12, row, "否");
excelWriter.writeCellValue(13, row, "否");
excelWriter.writeCellValue(14, row, "否");
excelWriter.writeCellValue(15, row, "否");
} else {
String answer = record.getAnswer();
String[] split = answer.split(",");
excelWriter.writeCellValue(6, row, Arrays.asList(split).contains("01") ? "是" : "否");
excelWriter.writeCellValue(7, row, Arrays.asList(split).contains("02") ? "是" : "否");
excelWriter.writeCellValue(8, row, Arrays.asList(split).contains("03") ? "是" : "否");
excelWriter.writeCellValue(9, row, Arrays.asList(split).contains("04") ? "是" : "否");
excelWriter.writeCellValue(10, row, Arrays.asList(split).contains("05") ? "是" : "否");
excelWriter.writeCellValue(11, row, Arrays.asList(split).contains("06") ? "是" : "否");
excelWriter.writeCellValue(12, row, Arrays.asList(split).contains("07") ? "是" : "否");
excelWriter.writeCellValue(13, row, Arrays.asList(split).contains("08") ? "是" : "否");
excelWriter.writeCellValue(14, row, Arrays.asList(split).contains("09") ? "是" : "否");
excelWriter.writeCellValue(15, row, Arrays.asList(split).contains("10") ? "是" : "否");
}
String str = "";
if (map.get("SCWJ-RESULT") != null && StrUtil.isNotEmpty(map.get("SCWJ-RESULT").getAnswer())) {
String answer1 = map.get("SCWJ-RESULT").getAnswer();
if ("0".equals(answer1)) {
str = "正常";
}
if ("1".equals(answer1)) {
str = "低危";
}
if ("2".equals(answer1)) {
str = "中危";
}
if ("3".equals(answer1)) {
str = "高危";
}
}
excelWriter.writeCellValue(16, row, str);
excelWriter.writeCellValue(17, row, map.get("SCWJ-SQMC") == null ? "" : map.get("SCWJ-SQMC").getAnswer());
excelWriter.writeCellValue(18, row, map.get("SCWJ-DEPT") == null ? "" : map.get("SCWJ-DEPT").getAnswer());
excelWriter.writeCellValue(5, row, map.get("SCWJ-HEIGHT") == null ? "" : map.get("SCWJ-HEIGHT").getAnswer());
excelWriter.writeCellValue(6, row, map.get("SCWJ-WEIGHT") == null ? "" : map.get("SCWJ-WEIGHT").getAnswer());
excelWriter.writeCellValue(7, row, map.get("SCWJ-BMI") == null ? "" : map.get("SCWJ-BMI").getAnswer());
excelWriter.writeCellValue(8, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer());
excelWriter.writeCellValue(9, row, map.get("SCWJ-RESULT") == null ? "" : map.get("SCWJ-RESULT").getAnswer());
excelWriter.writeCellValue(10, row, map.get("SCWJ-ZLFS") == null ? "" : map.get("SCWJ-ZLFS").getAnswer());
excelWriter.writeCellValue(11, row, map.get("SCWJ-ZLZQ") == null ? "" : map.get("SCWJ-ZLZQ").getAnswer());
excelWriter.writeCellValue(12, row, DateUtil.format(detailVos.get(i).getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
excelWriter.writeCellValue(13, row, detailVos.get(i).getTenantName());
// if (record == null || StrUtil.isEmpty(record.getAnswer())) {
// excelWriter.writeCellValue(6, row, "否");
// excelWriter.writeCellValue(7, row, "否");
// excelWriter.writeCellValue(8, row, "否");
// excelWriter.writeCellValue(9, row, "否");
// excelWriter.writeCellValue(10, row, "否");
// excelWriter.writeCellValue(11, row, "否");
// excelWriter.writeCellValue(12, row, "否");
// excelWriter.writeCellValue(13, row, "否");
// excelWriter.writeCellValue(14, row, "否");
// excelWriter.writeCellValue(15, row, "否");
// } else {
// String answer = record.getAnswer();
// String[] split = answer.split(",");
// excelWriter.writeCellValue(6, row, Arrays.asList(split).contains("01") ? "是" : "否");
// excelWriter.writeCellValue(7, row, Arrays.asList(split).contains("02") ? "是" : "否");
// excelWriter.writeCellValue(8, row, Arrays.asList(split).contains("03") ? "是" : "否");
// excelWriter.writeCellValue(9, row, Arrays.asList(split).contains("04") ? "是" : "否");
// excelWriter.writeCellValue(10, row, Arrays.asList(split).contains("05") ? "是" : "否");
// excelWriter.writeCellValue(11, row, Arrays.asList(split).contains("06") ? "是" : "否");
// excelWriter.writeCellValue(12, row, Arrays.asList(split).contains("07") ? "是" : "否");
// excelWriter.writeCellValue(13, row, Arrays.asList(split).contains("08") ? "是" : "否");
// excelWriter.writeCellValue(14, row, Arrays.asList(split).contains("09") ? "是" : "否");
// excelWriter.writeCellValue(15, row, Arrays.asList(split).contains("10") ? "是" : "否");
// }
// String str = "";
// if (map.get("SCWJ-RESULT") != null && StrUtil.isNotEmpty(map.get("SCWJ-RESULT").getAnswer())) {
// String answer1 = map.get("SCWJ-RESULT").getAnswer();
// if ("0".equals(answer1)) {
// str = "正常";
// }
// if ("1".equals(answer1)) {
// str = "低危";
// }
// if ("2".equals(answer1)) {
// str = "中危";
// }
// if ("3".equals(answer1)) {
// str = "高危";
// }
// }
// excelWriter.writeCellValue(16, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer());
// excelWriter.writeCellValue(17, row, map.get("SCWJ-SQMC") == null ? "" : map.get("SCWJ-SQMC").getAnswer());
// excelWriter.writeCellValue(18, row, map.get("SCWJ-DEPT") == null ? "" : map.get("SCWJ-DEPT").getAnswer());
}
}
}
@ -320,6 +328,7 @@ public class ScreeningServiceImpl implements IScreeningService {
}
@Override
public PageInfo<ScrScreenVo.Result> queryDetailByPage(ScreeningDto.Query param, Integer pageNum, Integer pageSize) {
param.setTenantId(SecurityUtils.getTenantId());
List<ScrScreenVo.Result> results = screeningDetailDao.queryResult(null, null, param);
if (CollectionUtil.isNotEmpty(results)) {
List<ScrScreenVo.ScreeningDetailVo> screeningDetailVos = screeningDetailDao.queryDetailList(results.stream().map(ScrScreenVo.Result::getId).collect(Collectors.toList()));
@ -382,6 +391,7 @@ public class ScreeningServiceImpl implements IScreeningService {
}
if (param.getCode().equals("SCWJ-BIRTH")) {
questionnaireDetail.setAge(DateUtil.ageOfNow(param.getAnswer()));
// param.setAnswer(DateUtil.format(DateUtil.parse(param.getAnswer()), "yyyy-MM-dd"));
}
log.info("questionnaireDetail:{}", questionnaireDetail.getId());
log.info("questionnaireDetail:{}", questionnaireDetail.getName());
@ -465,6 +475,7 @@ public class ScreeningServiceImpl implements IScreeningService {
detail.setScreenId(detailInfo.getId());
detail.setTenantId(hospitailId);
detail.setSubmitStatus(UserConstants.SubmitStatus.save.status);
detail.setCreateTime(new Date());
detail.setDelFlag((byte) 0);
scrScreeningRecordMapper.insertSelective(detail);
detailInfo.setDetailId(detail.getId());

3
acupuncture-system/src/main/resources/mapper/dao/AdminDmsUserDao.xml

@ -30,6 +30,9 @@
<if test="dto.tenantId != null">
AND u.tenant_id = #{dto.tenantId}
</if>
<if test="dto.tenantName != null">
AND t.name like concat('%',#{dto.tenantName},'%')
</if>
</where>
</select>

3
acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml

@ -87,6 +87,9 @@
)
</if>
</if>
<if test="param.tenantId != null">
and r.tenant_id = #{param.tenantId}
</if>
<if test="param.startTime != null and param.startTime != ''">
and r.create_time &gt;= #{param.startTime}
</if>

Loading…
Cancel
Save