Browse Source

数据对接

newMaster
zzc 3 months ago
parent
commit
7d31af857e
  1. 25
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/system/SysUserController.java
  2. 2
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminDmsUserController.java
  3. 12
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java
  4. 149
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java
  5. 6
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/PmsTreatmentController.java
  6. 17
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ScreeningController.java
  7. 14
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/WxQrCodeController.java
  8. 2
      acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java
  9. 1
      acupuncture-admin/src/main/resources/application-stage.yml
  10. 3
      acupuncture-common/src/main/java/com/acupuncture/common/utils/SecurityUtils.java
  11. 2
      acupuncture-framework/src/main/java/com/acupuncture/framework/config/SecurityConfig.java
  12. 157
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ExternalDto.java
  13. 8
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/PmsTreatmentDto.java
  14. 2
      acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ScreeningDto.java
  15. 12
      acupuncture-system/src/main/java/com/acupuncture/system/domain/po/UplReportImage.java
  16. 56
      acupuncture-system/src/main/java/com/acupuncture/system/domain/po/UplReportImageExample.java
  17. 4
      acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/PmsTreatmentVo.java
  18. 224
      acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/UplRtcfInfoVo.java
  19. 4
      acupuncture-system/src/main/java/com/acupuncture/system/mapper/SysRoleMapper.java
  20. 4
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/DmsUserDao.java
  21. 9
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/ScreeningDetailDao.java
  22. 3
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/UmsDataSourceDao.java
  23. 11
      acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java
  24. 21
      acupuncture-system/src/main/java/com/acupuncture/system/service/ExternalService.java
  25. 4
      acupuncture-system/src/main/java/com/acupuncture/system/service/IScreeningService.java
  26. 9
      acupuncture-system/src/main/java/com/acupuncture/system/service/PmsTreatmentService.java
  27. 4
      acupuncture-system/src/main/java/com/acupuncture/system/service/WxQrCodeService.java
  28. 102
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java
  29. 3
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsPatientServiceImpl.java
  30. 218
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java
  31. 133
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java
  32. 50
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/WxQrCodeServiceImpl.java
  33. 2
      acupuncture-system/src/main/resources/mapper/dao/ExternalDao.xml
  34. 1
      acupuncture-system/src/main/resources/mapper/dao/PmsTreatmentDao.xml
  35. 53
      acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml
  36. 14
      acupuncture-system/src/main/resources/mapper/dao/SysPowerDao.xml
  37. 3
      acupuncture-system/src/main/resources/mapper/dao/UmsDataSourceDao.xml
  38. 42
      acupuncture-system/src/main/resources/mapper/dao/WxQrCodeDao.xml
  39. 28
      acupuncture-system/src/main/resources/mapper/system/UplReportImageMapper.xml

25
acupuncture-admin/src/main/java/com/acupuncture/web/controller/system/SysUserController.java

@ -2,7 +2,15 @@ package com.acupuncture.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.acupuncture.framework.datasource.DynamicDataSourceContextHolder;
import com.acupuncture.system.domain.po.DmsTenant;
import com.acupuncture.system.domain.po.UmsDataSource;
import com.acupuncture.system.domain.vo.UmsDataSourceVo;
import com.acupuncture.system.persist.mapper.DmsTenantMapper;
import com.acupuncture.system.persist.mapper.UmsDataSourceMapper;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@ -53,6 +61,12 @@ public class SysUserController extends BaseController
@Autowired
private ISysPostService postService;
@Resource
private DmsTenantMapper dmsTenantMapper;
@Resource
private UmsDataSourceMapper umsDataSourceMapper;
/**
* 获取用户列表
*/
@ -151,6 +165,7 @@ public class SysUserController extends BaseController
@PutMapping
public AjaxResult edit(@Validated @RequestBody SysUser user)
{
// changeDataSource(user.getTenantId());
userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId());
deptService.checkDeptDataScope(user.getDeptId());
@ -171,6 +186,16 @@ public class SysUserController extends BaseController
return toAjax(userService.updateUser(user));
}
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());
}
}
}
/**
* 删除用户
*/

2
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminDmsUserController.java

@ -85,7 +85,7 @@ public class AdminDmsUserController {
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
return JsonResponse.ok().fail("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
}
user.setTenantId(SecurityUtils.getTenantId());
user.setTenantId(dto.getTenantId());
user.setCreateBy(SecurityUtils.getUsername());
user.setPhonenumber(dto.getContactPhone());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));

12
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/AdminPmsTreatmentController.java

@ -84,4 +84,16 @@ public class AdminPmsTreatmentController {
private static void changeDataSource(String dataSourceKey) {
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("/admin/exportTreatmentPg")
public JsonResponse<String> adminExportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){
return JsonResponse.ok(treatmentService.adminExportTreatmentPg(response, dto));
}
}

149
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java

@ -1,16 +1,36 @@
package com.acupuncture.web.controller.web;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.acupuncture.common.annotation.Anonymous;
import com.acupuncture.common.config.RuoYiConfig;
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.exception.base.BaseException;
import com.acupuncture.common.utils.file.FileUploadUtils;
import com.acupuncture.common.utils.file.FileUtils;
import com.acupuncture.framework.config.ServerConfig;
import com.acupuncture.framework.datasource.DynamicDataSourceContextHolder;
import com.acupuncture.system.domain.dto.ExternalDto;
import com.acupuncture.system.domain.po.UplReportImage;
import com.acupuncture.system.domain.po.UplRtcfInfo;
import com.acupuncture.system.domain.vo.ExternalVo;
import com.acupuncture.system.domain.vo.UmsDataSourceVo;
import com.acupuncture.system.domain.vo.UplRtcfInfoVo;
import com.acupuncture.system.persist.dao.UmsDataSourceDao;
import com.acupuncture.system.service.ExternalService;
import com.mysql.cj.xdevapi.JsonArray;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.runtime.logging.Logger;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.apache.regexp.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -31,10 +51,19 @@ public class ExternalController {
@Resource
private ExternalService externalService;
@Autowired
private ServerConfig serverConfig;
@Resource
private UmsDataSourceDao umsDataSourceDao;
@Resource
private RedisCache redisCache;
@Anonymous
@ApiOperation("获取人员信息")
@GetMapping("/http/getUserInfo")
public Object test(@RequestParam("from") String from, @RequestParam("memberid") String memberid) {
log.info("获取人员信息:{},{}",from, memberid);
checkoutData(from);
ExternalVo.Result query = externalService.query(from, memberid);
if (query == null) {
return "no person";
@ -42,22 +71,116 @@ public class ExternalController {
return query;
}
@ApiOperation("上传数据")
@PostMapping("/http/uploadMemberInfo")
public Object add(@RequestBody BaseDto<ExternalDto.Insert> dto){
int add = externalService.add(dto.getParam().getList());
if (add == 0) {
return "upload fail";
//切换数据源
private void checkoutData(String from) {
//根据社区ID查询数据源
List<UmsDataSourceVo.Result> dataSourceList = umsDataSourceDao.query(Long.parseLong(from));
if (CollectionUtil.isEmpty(dataSourceList)) {
throw new BaseException("查询不到社区");
}
return "upload ok";
//切换数据源查询
changeDataSource(dataSourceList.get(0).getDataSourceKey());
}
// /**
// * 上传测试报告
// * @param reportImageVo
// * @return
// */
// int addReportImage(ExternalDto.ReportImageDto reportImageVo){
private static void changeDataSource(String key) {
DynamicDataSourceContextHolder.setDataSourceType(key);
}
// @Anonymous
// @ApiOperation("上传数据")
// @PostMapping("/http/uploadMemberInfo")
// public Object add(@RequestBody List<ExternalDto.RtcfInfoDto> list){
// 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 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/addReportImage")
public Object addReportImage(MultipartFile image){
try {
//切换数据源
String str = removeExtension(image.getOriginalFilename());
Object o = redisCache.get("rtcfInfo:" + str);
if (ObjectUtil.isEmpty(o)) {
throw new BaseException("未查询到数据源");
}
checkoutData(o.toString());
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, image);
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", image.getOriginalFilename());
ExternalDto.ReportImageDto reportImageDto = new ExternalDto.ReportImageDto();
reportImageDto.setFileName(fileName);
reportImageDto.setFilePath(url);
reportImageDto.setMemberId(str);
externalService.addReportImage(reportImageDto);
return ajax;
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
private static String removeExtension(String fileName) {
if (StrUtil.isEmpty(fileName)) {
return "";
}
int lastDotIndex = fileName.lastIndexOf('.');
return (lastDotIndex > 0) ? fileName.substring(0, lastDotIndex) : fileName;
}
@ApiOperation("上传数据查询")
@PostMapping("/http/list")
public List<UplRtcfInfo> list(){
return externalService.list();
}
@ApiOperation("根据住院号/门诊号查询人体成分信息")
@PostMapping("/http/selectByMemberId")
public JsonResponse<UplRtcfInfoVo.Result> selectByMemberId(@RequestBody @Validated ExternalDto.MemberDto dto){
return JsonResponse.ok(externalService.selectByMemberId(dto.getMemberId()));
}
@ApiOperation("根据住院号/门诊号查询人体成分报告")
@PostMapping("/http/selectReportByMemberId")
public JsonResponse<UplReportImage> selectReportByMemberId(@RequestBody @Validated ExternalDto.MemberDto dto){
return JsonResponse.ok(externalService.selectReportByMemberId(dto.getMemberId()));
}
}

6
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/PmsTreatmentController.java

@ -93,4 +93,10 @@ public class PmsTreatmentController {
treatmentService.importTreatment(file);
return JsonResponse.ok();
}
@ApiOperation("导出诊疗档案评估报告")
@PostMapping("/exportTreatmentPg")
public JsonResponse<String> exportTreatmentPg(HttpServletResponse response, @RequestBody @Validated PmsTreatmentDto.ExportVO dto){
return JsonResponse.ok(treatmentService.exportTreatmentPg(response, dto));
}
}

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

@ -47,6 +47,16 @@ public class ScreeningController {
return JsonResponse.ok(screeningService.queryDetailByPage(param.getParam(), param.getPageNum(), param.getPageSize()));
}
@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){
log.info("查询筛查列表");
if (param.getPageNum() > 0) {
PageHelper.startPage(param.getPageNum(), param.getPageSize());
}
return JsonResponse.ok(screeningService.adminQueryDetailByPage(param.getParam(), param.getPageNum(), param.getPageSize()));
}
@ApiOperation(value = "创建筛查详情", notes = "")
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
@ -117,12 +127,19 @@ public class ScreeningController {
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) {
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) {
screeningService.exportRzScreen(response, param.getParam());
}
// @Anonymous
// @ApiOperation(value = "导出筛查记录", notes = "")
// @RequestMapping(value = "/export", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})

14
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/WxQrCodeController.java

@ -66,6 +66,15 @@ public class WxQrCodeController {
return JsonResponse.ok(new PageInfo<>(wxQrCodeService.queryList(dto.getParam().getTenantId())));
}
@ApiOperation(value = "查询筛查二维码")
@PostMapping("/admin/queryScreenList")
public JsonResponse<PageInfo<AmsWxQrCodeVo.ScreenResult>> adminQueryScreenList(@Validated @RequestBody BaseDto<AmsWxQrCodeDto.ScreenSelect> dto){
if (dto.getPageNum() > 0) {
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
}
return JsonResponse.ok(new PageInfo<>(wxQrCodeService.queryList(dto.getParam().getTenantId())));
}
@ApiOperation(value = "查询客户端筛查二维码")
@PostMapping("/queryClientScreenList")
public JsonResponse<List<AmsWxQrCodeVo.ScreenResult>> queryClientScreenList(){
@ -91,6 +100,11 @@ public class WxQrCodeController {
public JsonResponse exportScreen(@Validated @RequestBody AmsWxQrCodeDto.Query query) throws Exception{
return JsonResponse.ok(wxQrCodeService.exportScreen(query.getUrl(), query.getTenantId()));
}
@ApiOperation(value = "导出筛查")
@PostMapping("/admin/exportScreen")
public JsonResponse adminExportScreen(@Validated @RequestBody AmsWxQrCodeDto.Query query) throws Exception{
return JsonResponse.ok(wxQrCodeService.adminExportScreen(query.getUrl(), query.getTenantId()));
}
@ApiOperation(value = "导出海报筛查")
@PostMapping("/exportHbScreen")

2
acupuncture-admin/src/main/java/com/acupuncture/web/task/TaskController.java

@ -72,7 +72,7 @@ public class TaskController {
// UmsDataSourceVo.Result result1 = new UmsDataSourceVo.Result();
// result1.setDataSourceKey("MASTER");
// changeDataSource(result1);
List<UmsDataSourceVo.Result> query = umsDataSourceDao.query();
List<UmsDataSourceVo.Result> query = umsDataSourceDao.query(null);
if (CollectionUtil.isEmpty(query)) {
return;
}

1
acupuncture-admin/src/main/resources/application-stage.yml

@ -66,4 +66,5 @@ file:
screenQrCodeTemplate: /home/acupuncture/server/profile/screenQrCodeTemplate.docx
hbTemplate: /home/acupuncture/server/profile/screenHbQrCodeTemplate.docx
screenPath: http://test.tall.wiki/acupuncture/web-admin/screening/H5?hospitalId=hosId&hospitalName=hosName&centerId=cId
pgTemplate: /home/acupuncture/server/profile/TreamtmentPgTemplate.docx
jmrsUrl: /home/acupuncture/server/profile/uploads/jmrsTemplate.docx

3
acupuncture-common/src/main/java/com/acupuncture/common/utils/SecurityUtils.java

@ -186,7 +186,8 @@ public class SecurityUtils
}
catch (Exception e)
{
throw new ServiceException("获取租户ID异常", HttpStatus.UNAUTHORIZED);
return 1901557972215377920L;
// throw new ServiceException("获取租户ID异常", HttpStatus.UNAUTHORIZED);
}
}
}

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").permitAll()
requests.antMatchers("/login", "/register", "/captchaImage", "/web/login", "/web/queryTenantById", "/api/http/getUserInfo", "/api/http/addReportImage", "/api/http/uploadMemberInfo").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**", "/static/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

157
acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/ExternalDto.java

@ -5,6 +5,7 @@ import com.acupuncture.system.domain.po.UplRtcfInfo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
@ -16,9 +17,16 @@ import java.util.List;
public class ExternalDto {
@Data
public static class Insert{
@NotNull(message = "信息不能为空")
private List<RtcfInfoDto> list;
}
@Data
public static class MemberDto{
@NotNull
private String memberId;
}
@Data
@ApiModel("人体成分数据上传")
public static class RtcfInfoDto{
@ -26,15 +34,15 @@ public class ExternalDto {
private String message;
private String uuid;
private String UUID;
private String deviceId;
private String deviceID;
private String deviceType;
private String memberid;
private String testId;
private String testID;
private String testDate;
@ -46,146 +54,145 @@ public class ExternalDto {
private String birthYear;
private String weight;
private String fat;
private String Weight;
private String bone;
private String Fat;
private String protein;
private String Bone;
private String water;
private String Protein;
private String muscle;
private String Water;
private String smm;
private String Muscle;
private String pbf;
private String SMM;
private String bmi;
private String PBF;
private String bmr;
private String BMI;
private String whr;
private String BMR;
private String edema;
private String WHR;
private String vfi;
private String Edema;
private String bodyAge;
private String VFI;
private String score;
private String BodyAge;
private String bodyType;
private String Score;
private String lbm;
private String BodyType;
private String icw;
private String LBM;
private String ecw;
private String ICW;
private String standardWeight;
private String ECW;
private String weightControl;
private String Standard_weight;
private String fatControl;
private String Weight_control;
private String muscleControl;
private String Fat_control;
private String liverRisk;
private String Muscle_control;
private String asmi;
private String LiverRisk;
private String trFat;
private String ASMI;
private String laFat;
private String TR_fat;
private String raFat;
private String LA_fat;
private String llFat;
private String RA_fat;
private String rlFat;
private String LL_fat;
private String trWater;
private String RL_fat;
private String laWater;
private String TR_water;
private String raWater;
private String LA_water;
private String llWater;
private String RA_water;
private String rlWater;
private String LL_water;
private String trMuscle;
private String RL_water;
private String laMuscle;
private String TR_muscle;
private String raMuscle;
private String LA_muscle;
private String llMuscle;
private String RA_muscle;
private String rlMuscle;
private String LL_muscle;
private String trBone;
private String RL_muscle;
private String laBone;
private String TR_bone;
private String raBone;
private String LA_bone;
private String llBone;
private String RA_bone;
private String rlBone;
private String LL_bone;
private String weightMax;
private String RL_bone;
private String weightMin;
private String WeightMax;
private String fatMax;
private String WeightMin;
private String fatMin;
private String FatMax;
private String boneMax;
private String FatMin;
private String boneMin;
private String BoneMax;
private String proteinMax;
private String BoneMin;
private String proteinMin;
private String ProteinMax;
private String waterMax;
private String ProteinMin;
private String waterMin;
private String WaterMax;
private String muscleMax;
private String WaterMin;
private String muscleMin;
private String MuscleMax;
private String smmMax;
private String MuscleMin;
private String smmMin;
private String SMMMax;
private String pbfMax;
private String SMMMin;
private String pbfMin;
private String PBFMax;
private String bmiMax;
private String PBFMin;
private String bmiMin;
private String BMIMax;
private String whrMax;
private String BMIMin;
private String whrMin;
private String WHRMax;
private String edemaMax;
private String WHRMin;
private String edemaMin;
private String EdemaMax;
private String vfiMax;
private String EdemaMin;
private String vfiMin;
private String VFIMax;
private String diagnosis;
private String VFIMin;
private String Diagnosis;
}
@Data
@ -193,7 +200,7 @@ public class ExternalDto {
public static class ReportImageDto{
private Long id;
private String patientId;
private String memberId;
private String fileName;

8
acupuncture-system/src/main/java/com/acupuncture/system/domain/dto/PmsTreatmentDto.java

@ -51,6 +51,7 @@ public class PmsTreatmentDto {
private Long organizationId;
private String createBy;
private String remark;
private Byte source = 1;
@ApiModelProperty("随访队列ID集合")
private List<Long> queueIdList;
@ -213,4 +214,11 @@ public class PmsTreatmentDto {
@ApiModelProperty("code集合")
private List<String> codeList;
}
@Data
public static class ExportVO {
@NotNull
private Long treatmentId;
}
}

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

@ -40,6 +40,8 @@ public class ScreeningDto {
private Integer endAge;
private Long hospitalId;
private Long tenantId;
private String province;
private String city;
private String county;

12
acupuncture-system/src/main/java/com/acupuncture/system/domain/po/UplReportImage.java

@ -6,7 +6,7 @@ import java.util.Date;
public class UplReportImage implements Serializable {
private Long id;
private String patientId;
private String memberId;
private String fileName;
@ -36,12 +36,12 @@ public class UplReportImage implements Serializable {
this.id = id;
}
public String getPatientId() {
return patientId;
public String getMemberId() {
return memberId;
}
public void setPatientId(String patientId) {
this.patientId = patientId == null ? null : patientId.trim();
public void setMemberId(String memberId) {
this.memberId = memberId == null ? null : memberId.trim();
}
public String getFileName() {
@ -123,7 +123,7 @@ public class UplReportImage implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", patientId=").append(patientId);
sb.append(", memberId=").append(memberId);
sb.append(", fileName=").append(fileName);
sb.append(", filePath=").append(filePath);
sb.append(", delFlag=").append(delFlag);

56
acupuncture-system/src/main/java/com/acupuncture/system/domain/po/UplReportImageExample.java

@ -165,73 +165,73 @@ public class UplReportImageExample {
return (Criteria) this;
}
public Criteria andPatientIdIsNull() {
addCriterion("patient_id is null");
public Criteria andMemberIdIsNull() {
addCriterion("member_id is null");
return (Criteria) this;
}
public Criteria andPatientIdIsNotNull() {
addCriterion("patient_id is not null");
public Criteria andMemberIdIsNotNull() {
addCriterion("member_id is not null");
return (Criteria) this;
}
public Criteria andPatientIdEqualTo(String value) {
addCriterion("patient_id =", value, "patientId");
public Criteria andMemberIdEqualTo(String value) {
addCriterion("member_id =", value, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdNotEqualTo(String value) {
addCriterion("patient_id <>", value, "patientId");
public Criteria andMemberIdNotEqualTo(String value) {
addCriterion("member_id <>", value, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdGreaterThan(String value) {
addCriterion("patient_id >", value, "patientId");
public Criteria andMemberIdGreaterThan(String value) {
addCriterion("member_id >", value, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdGreaterThanOrEqualTo(String value) {
addCriterion("patient_id >=", value, "patientId");
public Criteria andMemberIdGreaterThanOrEqualTo(String value) {
addCriterion("member_id >=", value, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdLessThan(String value) {
addCriterion("patient_id <", value, "patientId");
public Criteria andMemberIdLessThan(String value) {
addCriterion("member_id <", value, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdLessThanOrEqualTo(String value) {
addCriterion("patient_id <=", value, "patientId");
public Criteria andMemberIdLessThanOrEqualTo(String value) {
addCriterion("member_id <=", value, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdLike(String value) {
addCriterion("patient_id like", value, "patientId");
public Criteria andMemberIdLike(String value) {
addCriterion("member_id like", value, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdNotLike(String value) {
addCriterion("patient_id not like", value, "patientId");
public Criteria andMemberIdNotLike(String value) {
addCriterion("member_id not like", value, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdIn(List<String> values) {
addCriterion("patient_id in", values, "patientId");
public Criteria andMemberIdIn(List<String> values) {
addCriterion("member_id in", values, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdNotIn(List<String> values) {
addCriterion("patient_id not in", values, "patientId");
public Criteria andMemberIdNotIn(List<String> values) {
addCriterion("member_id not in", values, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdBetween(String value1, String value2) {
addCriterion("patient_id between", value1, value2, "patientId");
public Criteria andMemberIdBetween(String value1, String value2) {
addCriterion("member_id between", value1, value2, "memberId");
return (Criteria) this;
}
public Criteria andPatientIdNotBetween(String value1, String value2) {
addCriterion("patient_id not between", value1, value2, "patientId");
public Criteria andMemberIdNotBetween(String value1, String value2) {
addCriterion("member_id not between", value1, value2, "memberId");
return (Criteria) this;
}

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

@ -90,6 +90,10 @@ public class PmsTreatmentVo {
@ApiModelProperty("code和答案列表")
private Map<String, List<TreatmentRecord>> recordValDict;
private String createBy;
private Date createTime;
public TreatmentRecordVO() {
}

224
acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/UplRtcfInfoVo.java

@ -0,0 +1,224 @@
package com.acupuncture.system.domain.vo;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import java.util.Date;
/**
* @Author zzc
* @Package com.acupuncture.system.domain.vo
* @Date 2025/3/17 15:47
* @description:
*/
public class UplRtcfInfoVo {
@Data
public static class Result{
private Long id;
private String message;
private String uuid;
private String deviceId;
private String deviceType;
private String memberid;
private String testId;
private String testDate;
private String name;
private String sex;
private String height;
private String birthYear;
private String weight;
private String fat;
private String bone;
private String protein;
private String water;
private String muscle;
private String smm;
private String pbf;
private String bmi;
private String bmr;
private String whr;
private String edema;
private String vfi;
private String bodyAge;
private String score;
private String bodyType;
private String lbm;
private String icw;
private String ecw;
private String standardWeight;
private String weightControl;
private String fatControl;
private String muscleControl;
private String liverRisk;
private String asmi;
private String trFat;
private String laFat;
private String raFat;
private String llFat;
private String rlFat;
private String trWater;
private String laWater;
private String raWater;
private String llWater;
private String rlWater;
private String trMuscle;
private String laMuscle;
private String raMuscle;
private String llMuscle;
private String rlMuscle;
private String trBone;
private String laBone;
private String raBone;
private String llBone;
private String rlBone;
private String weightMax;
private String weightMin;
private String fatMax;
private String fatMin;
private String boneMax;
private String boneMin;
private String proteinMax;
private String proteinMin;
private String waterMax;
private String waterMin;
private String muscleMax;
private String muscleMin;
private String smmMax;
private String smmMin;
private String pbfMax;
private String pbfMin;
private String bmiMax;
private String bmiMin;
private String whrMax;
private String whrMin;
private String edemaMax;
private String edemaMin;
private String vfiMax;
private String vfiMin;
private String diagnosis;
private Byte status;
private Byte delFlag;
private Long tenantId;
private String createBy;
private Date createTime;
private String updateBy;
private Date updateTime;
private String remark;
public String getBodyType() {
if (StrUtil.isNotBlank(bodyType)) {
switch (bodyType) {
case "1":
return "隐形肥胖型";
case "2":
return "肌肉不足型";
case "3":
return "消瘦型";
case "4":
return "脂肪过多型";
case "5":
return "健康匀称型";
case "6":
return "低脂肪型";
case "7":
return "肥胖型";
case "8":
return "超重肌肉型";
case "9":
return "运动员型";
}
}
return bodyType;
}
}
}

4
acupuncture-system/src/main/java/com/acupuncture/system/mapper/SysRoleMapper.java

@ -1,7 +1,10 @@
package com.acupuncture.system.mapper;
import java.util.List;
import com.acupuncture.common.annotation.DataSource;
import com.acupuncture.common.core.domain.entity.SysRole;
import com.acupuncture.common.enums.DataSourceType;
/**
* 角色表 数据层
@ -24,6 +27,7 @@ public interface SysRoleMapper
* @param userId 用户ID
* @return 角色列表
*/
@DataSource(DataSourceType.MASTER)
public List<SysRole> selectRolePermissionByUserId(Long userId);
/**

4
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/DmsUserDao.java

@ -3,6 +3,7 @@ package com.acupuncture.system.persist.dao;
import com.acupuncture.common.annotation.DataSource;
import com.acupuncture.common.core.domain.entity.SysUser;
import com.acupuncture.common.enums.DataSourceType;
import com.acupuncture.system.domain.po.DmsTenant;
import com.acupuncture.system.domain.po.DmsUser;
import com.acupuncture.system.domain.vo.DmsLoginUserVo;
import org.apache.ibatis.annotations.Param;
@ -15,6 +16,9 @@ import org.apache.ibatis.annotations.Param;
*/
public interface DmsUserDao {
@DataSource(DataSourceType.MASTER)
DmsTenant queryById(@Param("id") Long id);
/**
* 通过用户名查询用户
*

9
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/ScreeningDetailDao.java

@ -1,5 +1,7 @@
package com.acupuncture.system.persist.dao;
import com.acupuncture.common.annotation.DataSource;
import com.acupuncture.common.enums.DataSourceType;
import com.acupuncture.system.domain.dto.ScreeningDto;
import com.acupuncture.system.domain.vo.QuestionnaireVo;
import com.acupuncture.system.domain.vo.ScrScreenVo;
@ -40,5 +42,12 @@ public interface ScreeningDetailDao extends ScrScreeningDetailMapper {
@Param("type") Byte type,
@Param("param") ScreeningDto.Query param);
@DataSource(DataSourceType.MASTER)
List<ScrScreenVo.Result> adminQueryResult(@Param("detailId") Long detailId,
@Param("type") Byte type,
@Param("param") ScreeningDto.Query param);
List<ScrScreenVo.ScreeningDetailVo> queryDetailList(@Param("detailIdList") List<Long> detailIdList);
List<ScrScreenVo.ScreeningDetailVo> adminQueryDetailList(@Param("detailIdList") List<Long> detailIdList);
}

3
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/UmsDataSourceDao.java

@ -3,6 +3,7 @@ package com.acupuncture.system.persist.dao;
import com.acupuncture.common.annotation.DataSource;
import com.acupuncture.common.enums.DataSourceType;
import com.acupuncture.system.domain.vo.UmsDataSourceVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -15,6 +16,6 @@ import java.util.List;
public interface UmsDataSourceDao {
@DataSource(DataSourceType.MASTER)
List<UmsDataSourceVo.Result> query();
List<UmsDataSourceVo.Result> query(@Param("tenantId") Long tenantId);
}

11
acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java

@ -1,5 +1,7 @@
package com.acupuncture.system.persist.dao;
import com.acupuncture.common.annotation.DataSource;
import com.acupuncture.common.enums.DataSourceType;
import com.acupuncture.system.domain.vo.AmsWxQrCodeVo;
import org.apache.ibatis.annotations.Param;
@ -7,6 +9,9 @@ import java.util.List;
public interface WxQrCodeDao {
@DataSource(DataSourceType.MASTER)
AmsWxQrCodeVo.Result queryById(@Param("id")Long id);
/**
* 查询
* @return
@ -20,4 +25,10 @@ public interface WxQrCodeDao {
List<AmsWxQrCodeVo.ScreenResult> selectScreen(@Param("hospitalId") Long hospitalId);
List<AmsWxQrCodeVo.ScreenResult> selectScreenList(@Param("hospitalIdList") List<Long> hospitalIdList);
@DataSource(DataSourceType.MASTER)
List<AmsWxQrCodeVo.ScreenResult> adminSelectScreenList(@Param("hospitalIdList") List<Long> hospitalIdList);
}

21
acupuncture-system/src/main/java/com/acupuncture/system/service/ExternalService.java

@ -1,7 +1,10 @@
package com.acupuncture.system.service;
import com.acupuncture.system.domain.dto.ExternalDto;
import com.acupuncture.system.domain.po.UplReportImage;
import com.acupuncture.system.domain.po.UplRtcfInfo;
import com.acupuncture.system.domain.vo.ExternalVo;
import com.acupuncture.system.domain.vo.UplRtcfInfoVo;
import java.util.List;
@ -26,7 +29,7 @@ public interface ExternalService {
* @param rtcfInfoDtoList
* @return
*/
int add(List<ExternalDto.RtcfInfoDto> rtcfInfoDtoList);
int add(ExternalDto.RtcfInfoDto rtcfInfoDto);
/**
* 上传测试报告
@ -35,4 +38,20 @@ public interface ExternalService {
*/
int addReportImage(ExternalDto.ReportImageDto reportImageVo);
List<UplRtcfInfo> list();
/**
* 根据住院号/门诊号查询人体成分信息
* @param membreId
* @return
*/
UplRtcfInfoVo.Result selectByMemberId(String membreId);
/**
* 根据住院号/门诊号查询人体成分信息
* @param membreId
* @return
*/
UplReportImage selectReportByMemberId(String membreId);
}

4
acupuncture-system/src/main/java/com/acupuncture/system/service/IScreeningService.java

@ -20,10 +20,14 @@ public interface IScreeningService {
void export(HttpServletResponse response, ScreeningDto.Query param);
void adminExport(HttpServletResponse response, ScreeningDto.Query param);
void exportRzScreen(HttpServletResponse response, ScreeningDto.Query param);
PageInfo<ScrScreenVo.Result> queryDetailByPage(ScreeningDto.Query param, Integer pageNum, Integer pageSize);
PageInfo<ScrScreenVo.Result> adminQueryDetailByPage(ScreeningDto.Query param, Integer pageNum, Integer pageSize);
/**
*
* 保存问卷调查信息

9
acupuncture-system/src/main/java/com/acupuncture/system/service/PmsTreatmentService.java

@ -50,6 +50,15 @@ public interface PmsTreatmentService {
void exportTreatment(HttpServletResponse response, PmsTreatmentDto.TreatmentQueryDTO dto);
/**
* 当初诊疗档案评估报告
* @param response
* @param dto
*/
String exportTreatmentPg(HttpServletResponse response, PmsTreatmentDto.ExportVO dto);
String adminExportTreatmentPg(HttpServletResponse response, PmsTreatmentDto.ExportVO dto);
void importTreatment(MultipartFile file) throws IOException;
/**
* 查询诊疗档案

4
acupuncture-system/src/main/java/com/acupuncture/system/service/WxQrCodeService.java

@ -20,6 +20,8 @@ public interface WxQrCodeService {
List<AmsWxQrCodeVo.ScreenResult> queryList(Long hospitalId);
List<AmsWxQrCodeVo.ScreenResult> adminQueryList(Long hospitalId);
List<AmsWxQrCodeVo.ScreenResult> queryScreenList();
AmsScreenWxQrCode add(AmsWxQrCodeDto.ScreenInsert amsScreenWxQrCode) throws Exception;
@ -28,5 +30,7 @@ public interface WxQrCodeService {
String exportScreen(String url, Long hostpitalId) throws Exception;
String adminExportScreen(String url, Long hostpitalId) throws Exception;
String exportHbScreen(String url, Long hostpitalId) throws Exception;
}

102
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java

@ -1,11 +1,16 @@
package com.acupuncture.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil;
import com.acupuncture.common.core.redis.RedisCache;
import com.acupuncture.system.domain.dto.ExternalDto;
import com.acupuncture.system.domain.po.UplReportImage;
import com.acupuncture.system.domain.po.UplReportImageExample;
import com.acupuncture.system.domain.po.UplRtcfInfo;
import com.acupuncture.system.domain.po.UplRtcfInfoExample;
import com.acupuncture.system.domain.vo.ExternalVo;
import com.acupuncture.system.domain.vo.UplRtcfInfoVo;
import com.acupuncture.system.persist.dao.ExternalDao;
import com.acupuncture.system.persist.mapper.UplReportImageMapper;
import com.acupuncture.system.persist.mapper.UplRtcfInfoMapper;
@ -31,6 +36,8 @@ public class ExternalServiceImpl implements ExternalService {
private UplRtcfInfoMapper uplRtcfInfoMapper;
@Resource
private ExternalDao externalDao;
@Resource
private RedisCache redisCache;
@Override
public ExternalVo.Result query(String from, String memberid) {
@ -41,15 +48,64 @@ public class ExternalServiceImpl implements ExternalService {
}
@Override
public int add(List<ExternalDto.RtcfInfoDto> rtcfInfoDtoList) {
List<UplRtcfInfo> uplRtcfInfos = BeanUtil.copyToList(rtcfInfoDtoList, UplRtcfInfo.class);
int i = 0;
for (UplRtcfInfo uplRtcfInfo : uplRtcfInfos) {
uplRtcfInfo.setId(IdUtil.getSnowflakeNextId());
uplRtcfInfo.setCreateTime(new Date());
i += uplRtcfInfoMapper.insert(uplRtcfInfo);
public int add(ExternalDto.RtcfInfoDto rtcfInfoDto) {
UplRtcfInfo uplRtcfInfos = BeanUtil.copyProperties(rtcfInfoDto, UplRtcfInfo.class);
uplRtcfInfos.setId(IdUtil.getSnowflakeNextId());
uplRtcfInfos.setCreateTime(new Date());
uplRtcfInfos.setDelFlag((byte) 0);
uplRtcfInfos.setAsmi(rtcfInfoDto.getASMI());
uplRtcfInfos.setBmi(rtcfInfoDto.getBMI());
uplRtcfInfos.setDeviceId(rtcfInfoDto.getDeviceID());
uplRtcfInfos.setDeviceType(rtcfInfoDto.getDeviceType());
uplRtcfInfos.setDiagnosis(rtcfInfoDto.getDiagnosis());
uplRtcfInfos.setEdema(rtcfInfoDto.getEdema());
uplRtcfInfos.setFat(rtcfInfoDto.getFat());
uplRtcfInfos.setFatControl(rtcfInfoDto.getFat_control());
uplRtcfInfos.setFatMax(rtcfInfoDto.getFatMax());
uplRtcfInfos.setFatMin(rtcfInfoDto.getFatMin());
uplRtcfInfos.setHeight(rtcfInfoDto.getHeight());
uplRtcfInfos.setLbm(rtcfInfoDto.getLBM());
uplRtcfInfos.setLlBone(rtcfInfoDto.getLL_bone());
uplRtcfInfos.setLlFat(rtcfInfoDto.getLL_fat());
uplRtcfInfos.setLlMuscle(rtcfInfoDto.getLL_muscle());
uplRtcfInfos.setLlWater(rtcfInfoDto.getLL_water());
uplRtcfInfos.setLlWater(rtcfInfoDto.getLL_water());
uplRtcfInfos.setLlWater(rtcfInfoDto.getLL_water());
uplRtcfInfos.setMemberid(rtcfInfoDto.getMemberid());
uplRtcfInfos.setMuscle(rtcfInfoDto.getMuscle());
uplRtcfInfos.setSmm(rtcfInfoDto.getSMM());
uplRtcfInfos.setPbf(rtcfInfoDto.getPBF());
uplRtcfInfos.setPbfMax(rtcfInfoDto.getPBFMax());
uplRtcfInfos.setPbfMin(rtcfInfoDto.getPBFMin());
uplRtcfInfos.setBodyAge(rtcfInfoDto.getBodyAge());
uplRtcfInfos.setBodyType(rtcfInfoDto.getBodyType());
uplRtcfInfos.setScore(rtcfInfoDto.getScore());
uplRtcfInfos.setStandardWeight(rtcfInfoDto.getStandard_weight());
uplRtcfInfos.setWeight(rtcfInfoDto.getWeight());
uplRtcfInfos.setWeightControl(rtcfInfoDto.getWeight_control());
uplRtcfInfos.setWeightMax(rtcfInfoDto.getWeightMax());
uplRtcfInfos.setWeightMin(rtcfInfoDto.getWeightMin());
uplRtcfInfos.setBmi(rtcfInfoDto.getBMI());
uplRtcfInfos.setBmr(rtcfInfoDto.getBMR());
uplRtcfInfos.setWhr(rtcfInfoDto.getWHR());
uplRtcfInfos.setEdema(rtcfInfoDto.getEdema());
uplRtcfInfos.setVfi(rtcfInfoDto.getVFI());
uplRtcfInfos.setLiverRisk(rtcfInfoDto.getLiverRisk());
uplRtcfInfos.setAsmi(rtcfInfoDto.getASMI());
uplRtcfInfos.setTrFat(rtcfInfoDto.getTR_fat());
uplRtcfInfos.setLaFat(rtcfInfoDto.getLA_fat());
uplRtcfInfos.setRaFat(rtcfInfoDto.getRA_fat());
uplRtcfInfos.setLlFat(rtcfInfoDto.getLL_fat());
uplRtcfInfos.setRlFat(rtcfInfoDto.getRL_fat());
uplRtcfInfos.setTrWater(rtcfInfoDto.getTR_water());
uplRtcfInfos.setLaWater(rtcfInfoDto.getLA_water());
int insert = uplRtcfInfoMapper.insert(uplRtcfInfos);
if (insert > 0) {
redisCache.set("rtcfInfo:" + uplRtcfInfos.getMemberid(), uplRtcfInfos.getUuid());
}
return i;
return insert;
}
@Override
@ -57,6 +113,36 @@ public class ExternalServiceImpl implements ExternalService {
UplReportImage uplReportImage = BeanUtil.copyProperties(reportImageVo, UplReportImage.class);
uplReportImage.setId(IdUtil.getSnowflakeNextId());
uplReportImage.setCreateTime(new Date());
uplReportImage.setDelFlag((byte) 0);
return uplReportImageMapper.insertSelective(uplReportImage);
}
@Override
public List<UplRtcfInfo> list() {
return uplRtcfInfoMapper.selectByExample(new UplRtcfInfoExample());
}
@Override
public UplRtcfInfoVo.Result selectByMemberId(String membreId) {
UplRtcfInfoExample uplRtcfInfoExample = new UplRtcfInfoExample();
uplRtcfInfoExample.createCriteria().andMemberidEqualTo(membreId).andDelFlagEqualTo((byte) 0);
List<UplRtcfInfo> uplRtcfInfos = uplRtcfInfoMapper.selectByExample(uplRtcfInfoExample);
if (CollectionUtil.isNotEmpty(uplRtcfInfos)) {
return BeanUtil.copyProperties(uplRtcfInfos.get(0), UplRtcfInfoVo.Result.class);
}
return new UplRtcfInfoVo.Result();
}
@Override
public UplReportImage selectReportByMemberId(String membreId) {
UplReportImageExample uplReportImageExample = new UplReportImageExample();
uplReportImageExample.createCriteria().andMemberIdEqualTo(membreId).andDelFlagEqualTo((byte) 0);
List<UplReportImage> uplReportImages = uplReportImageMapper.selectByExample(uplReportImageExample);
if (CollectionUtil.isNotEmpty(uplReportImages)) {
return uplReportImages.get(0);
}
return new UplReportImage();
}
}

3
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsPatientServiceImpl.java

@ -74,6 +74,9 @@ public class PmsPatientServiceImpl implements PmsPatientService {
pmsPatient.setDelFlag((byte) 0);
pmsPatient.setCreateTime(new Date());
pmsPatient.setTenantId(SecurityUtils.getTenantId());
if (pmsPatient.getSource() == null) {
pmsPatient.setSource((byte) 1);
}
pmsPatientMapper.insertSelective(pmsPatient);
return pmsPatient.getId();
}

218
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java

@ -3,6 +3,7 @@ package com.acupuncture.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
@ -13,6 +14,7 @@ import cn.hutool.poi.excel.BigExcelWriter;
import cn.hutool.poi.excel.ExcelUtil;
import com.acupuncture.common.core.redis.RedisCache;
import com.acupuncture.common.exception.base.BaseException;
import com.acupuncture.common.utils.AsposeUtils;
import com.acupuncture.common.utils.ExceptionUtil;
import com.acupuncture.common.utils.SecurityUtils;
import com.acupuncture.system.domain.dto.PmsPatientDto;
@ -29,6 +31,7 @@ import com.acupuncture.system.persist.mapper.PmsTreatmentMapper;
import com.acupuncture.system.persist.mapper.PmsTreatmentRecordMapper;
import com.acupuncture.system.service.PmsPatientService;
import com.acupuncture.system.service.PmsTreatmentService;
import com.deepoove.poi.XWPFTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -36,7 +39,10 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -68,6 +74,13 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService {
private RedisCache redisCache;
@Value("${file.TreamentTemplate}")
private String treamentTemplate;
@Value("${file.pgTemplate}")
private String pgTemplate;
@Value("${acupuncture.profile}")
private String profilePath;
@Value("${acupuncture.profileUrl}")
private String profileUrl;
@Override
public void addTreatment(PmsTreatmentDto.TreatmentAdd dto) {
@ -112,7 +125,7 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService {
patientQueueRelation.setCreateTime(new Date());
fmsPatientQueueRelationMapper.insertSelective(patientQueueRelation);
}
}else {
} else {
FmsPatientQueueRelation patientQueueRelation = BeanUtil.copyProperties(dto, FmsPatientQueueRelation.class);
patientQueueRelation.setId(IdUtil.getSnowflakeNextId());
patientQueueRelation.setDelFlag((byte) 0);
@ -134,36 +147,36 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService {
pmsTreatment.setUpdateTime(new Date());
treatmentMapper.updateByPrimaryKeySelective(pmsTreatment);
//删除队列
//如有患者档案信息,则需要判断患者是否有随访队列,如果有,则需要删除(先删除后新增)
FmsPatientQueueRelationExample fmsPatientQueueRelationExample = new FmsPatientQueueRelationExample();
fmsPatientQueueRelationExample.createCriteria().andPatientIdEqualTo(pmsTreatment.getPatientId()).andDelFlagEqualTo((byte) 0);
FmsPatientQueueRelation fmsPatientQueueRelation = new FmsPatientQueueRelation();
fmsPatientQueueRelation.setDelFlag((byte) 1);
fmsPatientQueueRelationMapper.updateByExampleSelective(fmsPatientQueueRelation, fmsPatientQueueRelationExample);
// //删除队列
// //如有患者档案信息,则需要判断患者是否有随访队列,如果有,则需要删除(先删除后新增)
// FmsPatientQueueRelationExample fmsPatientQueueRelationExample = new FmsPatientQueueRelationExample();
// fmsPatientQueueRelationExample.createCriteria().andPatientIdEqualTo(pmsTreatment.getPatientId()).andDelFlagEqualTo((byte) 0);
// FmsPatientQueueRelation fmsPatientQueueRelation = new FmsPatientQueueRelation();
// fmsPatientQueueRelation.setDelFlag((byte) 1);
// fmsPatientQueueRelationMapper.updateByExampleSelective(fmsPatientQueueRelation, fmsPatientQueueRelationExample);
//新增随访队列
if (CollectionUtil.isNotEmpty(dto.getQueueIdList())) {
for (Long queueId : dto.getQueueIdList()) {
FmsPatientQueueRelation patientQueueRelation = BeanUtil.copyProperties(dto, FmsPatientQueueRelation.class);
patientQueueRelation.setDelFlag((byte) 0);
patientQueueRelation.setCreateBy(SecurityUtils.getUsername());
patientQueueRelation.setPatientId(pmsTreatment.getPatientId());
patientQueueRelation.setQueueId(queueId);
patientQueueRelation.setCreateTime(new Date());
patientQueueRelation.setId(IdUtil.getSnowflakeNextId());
fmsPatientQueueRelationMapper.insertSelective(patientQueueRelation);
}
}else {
FmsPatientQueueRelation patientQueueRelation = BeanUtil.copyProperties(dto, FmsPatientQueueRelation.class);
patientQueueRelation.setId(IdUtil.getSnowflakeNextId());
patientQueueRelation.setDelFlag((byte) 0);
patientQueueRelation.setCreateBy(SecurityUtils.getUsername());
patientQueueRelation.setPatientId(pmsTreatment.getPatientId());
patientQueueRelation.setTenantId(pmsTreatment.getTenantId());
patientQueueRelation.setQueueId(null);
patientQueueRelation.setCreateTime(new Date());
fmsPatientQueueRelationMapper.insertSelective(patientQueueRelation);
}
// if (CollectionUtil.isNotEmpty(dto.getQueueIdList())) {
// for (Long queueId : dto.getQueueIdList()) {
// FmsPatientQueueRelation patientQueueRelation = BeanUtil.copyProperties(dto, FmsPatientQueueRelation.class);
// patientQueueRelation.setDelFlag((byte) 0);
// patientQueueRelation.setCreateBy(SecurityUtils.getUsername());
// patientQueueRelation.setPatientId(pmsTreatment.getPatientId());
// patientQueueRelation.setQueueId(queueId);
// patientQueueRelation.setCreateTime(new Date());
// patientQueueRelation.setId(IdUtil.getSnowflakeNextId());
// fmsPatientQueueRelationMapper.insertSelective(patientQueueRelation);
// }
// }else {
// FmsPatientQueueRelation patientQueueRelation = BeanUtil.copyProperties(dto, FmsPatientQueueRelation.class);
// patientQueueRelation.setId(IdUtil.getSnowflakeNextId());
// patientQueueRelation.setDelFlag((byte) 0);
// patientQueueRelation.setCreateBy(SecurityUtils.getUsername());
// patientQueueRelation.setPatientId(pmsTreatment.getPatientId());
// patientQueueRelation.setTenantId(pmsTreatment.getTenantId());
// patientQueueRelation.setQueueId(null);
// patientQueueRelation.setCreateTime(new Date());
// fmsPatientQueueRelationMapper.insertSelective(patientQueueRelation);
// }
}
@ -253,6 +266,44 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService {
willSavedRecord.setCreateTime(now);
willSavedRecord.setCreateBy(SecurityUtils.getUsername());
willSavedFirstAidRecordList.add(willSavedRecord);
//处理随访队列
//删除队列
//如有患者档案信息,则需要判断患者是否有随访队列,如果有,则需要删除(先删除后新增)
FmsPatientQueueRelationExample fmsPatientQueueRelationExample = new FmsPatientQueueRelationExample();
fmsPatientQueueRelationExample.createCriteria().andPatientIdEqualTo(pmsTreatment.getPatientId()).andDelFlagEqualTo((byte) 0);
FmsPatientQueueRelation fmsPatientQueueRelation = new FmsPatientQueueRelation();
fmsPatientQueueRelation.setDelFlag((byte) 1);
fmsPatientQueueRelationMapper.updateByExampleSelective(fmsPatientQueueRelation, fmsPatientQueueRelationExample);
if ("SFDL".equals(codeAndAnswer.getQuestionCode())) {
//新增随访队列
if (CollectionUtil.isNotEmpty(codeAndAnswer.getAnswer())) {
List<String> answer = codeAndAnswer.getAnswer();
for (String queueId : answer) {
FmsPatientQueueRelation patientQueueRelation = BeanUtil.copyProperties(pmsTreatment, FmsPatientQueueRelation.class);
patientQueueRelation.setId(IdUtil.getSnowflakeNextId());
patientQueueRelation.setDelFlag((byte) 0);
patientQueueRelation.setIdCard(pmsTreatment.getIdCard());
patientQueueRelation.setIdCardType(pmsTreatment.getIdCardType().byteValue());
patientQueueRelation.setCreateBy(SecurityUtils.getUsername());
patientQueueRelation.setPatientId(pmsTreatment.getPatientId());
patientQueueRelation.setQueueId(Long.parseLong(queueId));
patientQueueRelation.setCreateTime(new Date());
fmsPatientQueueRelationMapper.insertSelective(patientQueueRelation);
}
} else {
FmsPatientQueueRelation patientQueueRelation = BeanUtil.copyProperties(pmsTreatment, FmsPatientQueueRelation.class);
patientQueueRelation.setId(IdUtil.getSnowflakeNextId());
patientQueueRelation.setDelFlag((byte) 0);
patientQueueRelation.setIdCard(pmsTreatment.getIdCard());
patientQueueRelation.setIdCardType(pmsTreatment.getIdCardType().byteValue());
patientQueueRelation.setCreateBy(SecurityUtils.getUsername());
patientQueueRelation.setPatientId(pmsTreatment.getPatientId());
patientQueueRelation.setQueueId(null);
patientQueueRelation.setCreateTime(new Date());
fmsPatientQueueRelationMapper.insertSelective(patientQueueRelation);
}
}
}
//批量保存
batchSave(willSavedFirstAidRecordList);
@ -387,12 +438,117 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService {
}
}
@Override
public String exportTreatmentPg(HttpServletResponse response, PmsTreatmentDto.ExportVO dto) {
PmsTreatment pmsTreatment = treatmentMapper.selectByPrimaryKey(dto.getTreatmentId());
if (pmsTreatment == null) {
throw new BaseException("诊疗信息不存在");
}
PmsTreatmentRecordExample pmsTreatmentRecordExample = new PmsTreatmentRecordExample();
pmsTreatmentRecordExample.createCriteria().andTreatmentIdEqualTo(dto.getTreatmentId()).andDelFlagEqualTo((byte) 0);
List<PmsTreatmentRecord> pmsTreatmentRecords = pmsTreatmentRecordMapper.selectByExample(pmsTreatmentRecordExample);
String pdfName = pmsTreatment.getName() + "_" + pmsTreatment.getVisitNumber();
String wordPath = profilePath + File.separator + pdfName + ".docx";
String pdfPath = profilePath + File.separator + pdfName + ".pdf";
try {
XWPFTemplate template = XWPFTemplate.compile(pgTemplate);
Map<String, Object> map = new HashMap<>();
map.put("name", pmsTreatment.getName());
map.put("sex", pmsTreatment.getGender() == 0 ? "男" : "女");
map.put("age", pmsTreatment.getAge());
map.put("phone", pmsTreatment.getPhone());
map.put("visitNum", pmsTreatment.getVisitNumber());
map.put("visitTime", DateUtil.format(pmsTreatment.getVisitTime(), "yyyy-MM-dd HH:mm:ss"));
map.put("doctor", pmsTreatment.getDoctor());
map.put("createBy", pmsTreatment.getCreateBy());
map.put("createTime", DateUtil.format(pmsTreatment.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
map.put("status", pmsTreatment.getStatus() == 0 ? "未完成" : "已完成");
if (CollectionUtil.isNotEmpty(pmsTreatmentRecords)) {
Map<String, PmsTreatmentRecord> recordMap = pmsTreatmentRecords.stream().collect(Collectors.toMap(PmsTreatmentRecord::getQuestionCode, Function.identity()));
map.put("score1", recordMap.get("PG_TT_TAPS_DF") == null ? "" : recordMap.get("PG_TT_TAPS_DF").getAnswer());
map.put("score2", recordMap.get("PG_TT_TRACE_DF") == null ? "" : recordMap.get("PG_TT_TRACE_DF").getAnswer());
map.put("score3", recordMap.get("PG_TT_SRS22_DF") == null ? "" : recordMap.get("PG_TT_SRS22_DF").getAnswer());
map.put("score4", recordMap.get("PG_SM_PHQ-9_DF") == null ? "" : recordMap.get("PG_SM_PHQ-9_DF").getAnswer());
map.put("score5", recordMap.get("PG_SM_EPSW_DF") == null ? "" : recordMap.get("PG_SM_EPSW_DF").getAnswer());
map.put("score6", recordMap.get("PG_SM_PSQI_DF") == null ? "" : recordMap.get("PG_SM_PSQI_DF").getAnswer());
map.put("score7", recordMap.get("PG_JL_HAMD-24_DF") == null ? "" : recordMap.get("PG_JL_HAMD-24_DF").getAnswer());
map.put("score8", recordMap.get("PG_JL_SAS_DF") == null ? "" : recordMap.get("PG_JL_SAS_DF").getAnswer());
}
//渲染
template.render(map);
//以文件形式输出
template.writeAndClose(Files.newOutputStream(Paths.get(wordPath)));
//转换为pdf
AsposeUtils.doc2pdf(wordPath, pdfPath);
//删除word
FileUtil.del(wordPath);
} catch (Exception e) {
e.printStackTrace();
}
return profileUrl + "/" + pdfName + ".pdf";
}
@Override
public String adminExportTreatmentPg(HttpServletResponse response, PmsTreatmentDto.ExportVO dto) {
PmsTreatmentVo.TreatmentRecordVO treatmentRecordVO = pmsTreatmentDao.adminQueryTreatment(dto.getTreatmentId());
if (treatmentRecordVO == null) {
throw new BaseException("诊疗信息不存在");
}
PmsTreatmentRecordExample pmsTreatmentRecordExample = new PmsTreatmentRecordExample();
pmsTreatmentRecordExample.createCriteria().andTreatmentIdEqualTo(dto.getTreatmentId()).andDelFlagEqualTo((byte) 0);
List<PmsTreatmentRecord> pmsTreatmentRecords = pmsTreatmentRecordMapper.selectByExample(pmsTreatmentRecordExample);
String pdfName = treatmentRecordVO.getName() + "_" + treatmentRecordVO.getVisitNumber();
String wordPath = profilePath + File.separator + pdfName + ".docx";
String pdfPath = profilePath + File.separator + pdfName + ".pdf";
try {
XWPFTemplate template = XWPFTemplate.compile(pgTemplate);
Map<String, Object> map = new HashMap<>();
map.put("name", treatmentRecordVO.getName());
map.put("sex", treatmentRecordVO.getGender() == 0 ? "男" : "女");
map.put("age", treatmentRecordVO.getAge());
map.put("phone", treatmentRecordVO.getPhone());
map.put("visitNum", treatmentRecordVO.getVisitNumber());
map.put("visitTime", DateUtil.format(treatmentRecordVO.getVisitTime(), "yyyy-MM-dd HH:mm:ss"));
map.put("doctor", treatmentRecordVO.getDoctor());
map.put("createBy", treatmentRecordVO.getCreateBy());
map.put("createTime", DateUtil.format(treatmentRecordVO.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
map.put("status", treatmentRecordVO.getStatus() == 0 ? "未完成" : "已完成");
if (CollectionUtil.isNotEmpty(pmsTreatmentRecords)) {
Map<String, PmsTreatmentRecord> recordMap = pmsTreatmentRecords.stream().collect(Collectors.toMap(PmsTreatmentRecord::getQuestionCode, Function.identity()));
map.put("score1", recordMap.get("PG_TT_TAPS_DF") == null ? "" : recordMap.get("PG_TT_TAPS_DF").getAnswer());
map.put("score2", recordMap.get("PG_TT_TRACE_DF") == null ? "" : recordMap.get("PG_TT_TRACE_DF").getAnswer());
map.put("score3", recordMap.get("PG_TT_SRS22_DF") == null ? "" : recordMap.get("PG_TT_SRS22_DF").getAnswer());
map.put("score4", recordMap.get("PG_SM_PHQ-9_DF") == null ? "" : recordMap.get("PG_SM_PHQ-9_DF").getAnswer());
map.put("score5", recordMap.get("PG_SM_EPSW_DF") == null ? "" : recordMap.get("PG_SM_EPSW_DF").getAnswer());
map.put("score6", recordMap.get("PG_SM_PSQI_DF") == null ? "" : recordMap.get("PG_SM_PSQI_DF").getAnswer());
map.put("score7", recordMap.get("PG_JL_HAMD-24_DF") == null ? "" : recordMap.get("PG_JL_HAMD-24_DF").getAnswer());
map.put("score8", recordMap.get("PG_JL_SAS_DF") == null ? "" : recordMap.get("PG_JL_SAS_DF").getAnswer());
}
//渲染
template.render(map);
//以文件形式输出
template.writeAndClose(Files.newOutputStream(Paths.get(wordPath)));
//转换为pdf
AsposeUtils.doc2pdf(wordPath, pdfPath);
//删除word
FileUtil.del(wordPath);
} catch (Exception e) {
e.printStackTrace();
}
return profileUrl + "/" + pdfName + ".pdf";
}
@Override
public void importTreatment(MultipartFile file) throws IOException {
//读取excel
List<PmsPatient> pmsPatientList = CollectionUtil.newArrayList();
ExcelUtil.readBySax(file.getInputStream(), 0, (sheetIndex, rowIndex, rowList) -> {
// 建档时间 患者姓名 性别 年龄 民族 受教育程度 手机号码 证件类型(0身份证;1护照或外国人永居证; 2港澳居民来往内地通行; 3台湾居民来往大陆通行证; 4其他;) 证件号码 门诊/住院 门诊号/住院号 门诊时间/住院时间 出院时间 责任医生 建档人
// 建档时间 患者姓名 性别 年龄 民族 受教育程度 手机号码 证件类型(0身份证;1护照或外国人永居证; 2港澳居民来往内地通行; 3台湾居民来往大陆通行证; 4其他;) 证件号码 门诊/住院 门诊号/住院号 门诊时间/住院时间 出院时间 责任医生 建档人
try {
if (rowIndex < 1) {
return;

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

@ -197,6 +197,123 @@ public class ScreeningServiceImpl implements IScreeningService {
}
}
@Override
public void adminExport(HttpServletResponse response, ScreeningDto.Query param) {
ExcelWriter excelWriter = ExcelUtil.getWriter();
List<String> headerList = CollectionUtil.newArrayList(
"姓名",
"性别",
"年龄",
"身份证",
"出生日期",
"手机号",
"有高血压,>=140/90mmHg",
"血脂异常,或不清楚",
"有糖尿病",
"心跳不规则",
"吸烟",
"明显超重或肥胖",
"缺乏运动",
"有卒中家族史",
"有既往脑卒中病史",
"有既往短暂脑缺血病史",
"筛查结果",
"数据来源",
"科室名称");
excelWriter.writeHeadRow(headerList);
PageInfo<ScrScreenVo.Result> page = adminQueryDetailByPage(param, -1, -1);
if (page != null) {
List<ScrScreenVo.Result> detailVos = page.getList();
if (CollectionUtil.isNotEmpty(detailVos)) {
int row = 0;
for (int i = 0; i < detailVos.size(); i++) {
List<ScrScreenVo.ScreeningDetailVo> recordList = detailVos.get(i).getDetailList();
Map<String, ScrScreenVo.ScreeningDetailVo> map = new HashMap<>();
if (CollectionUtil.isNotEmpty(recordList)) {
map = recordList.stream().collect(Collectors.toMap(ScrScreenVo.ScreeningDetailVo::getQuestionCode, Function.identity()));
}
//筛查信息
ScrScreenVo.ScreeningDetailVo record = map.get("SCWJ-ILLNESS");
//筛查结果
ScrScreenVo.ScreeningDetailVo result = map.get("SCWJ-RESULT");
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());
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());
}
}
}
String filename = StrUtil.format("筛查-{}.xlsx", DateUtil.date().toString("yyyyMMdd"));
//response为HttpServletResponse对象
response.setContentType("application/vnd.ms-excel;charset=utf-8");
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
response.setHeader("Content-Disposition", "attachment;filename=" + filename);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
excelWriter.flush(out);
} catch (IOException e) {
e.printStackTrace();
} finally {
// 关闭writer,释放内存
excelWriter.close();
//此处记得关闭输出Servlet流
IoUtil.close(out);
}
}
@Override
public void exportRzScreen(HttpServletResponse response, ScreeningDto.Query param) {
@ -215,6 +332,22 @@ public class ScreeningServiceImpl implements IScreeningService {
}
return new PageInfo<>(results);
}
@Override
public PageInfo<ScrScreenVo.Result> adminQueryDetailByPage(ScreeningDto.Query param, Integer pageNum, Integer pageSize) {
List<ScrScreenVo.Result> results = screeningDetailDao.adminQueryResult(null, null, param);
if (CollectionUtil.isNotEmpty(results)) {
List<ScrScreenVo.ScreeningDetailVo> screeningDetailVos = screeningDetailDao.adminQueryDetailList(results.stream().map(ScrScreenVo.Result::getId).collect(Collectors.toList()));
if (CollectionUtil.isNotEmpty(screeningDetailVos)) {
Map<Long, List<ScrScreenVo.ScreeningDetailVo>> map = screeningDetailVos.stream().collect(Collectors.groupingBy(ScrScreenVo.ScreeningDetailVo::getRecordId));
results.forEach(result -> {
result.setDetailList(map.get(result.getId()));
});
}
}
return new PageInfo<>(results);
}
@Override
public void saveQuestionnaire(ScreeningDto.SaveQuestionnaire param, Long userId) throws Exception {
//redis判断是否已有

50
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/WxQrCodeServiceImpl.java

@ -4,7 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.IdUtil;
import com.acupuncture.common.exception.base.BaseException;
import com.acupuncture.system.domain.dto.AmsWxQrCodeDto;
import com.acupuncture.system.persist.dao.DmsUserDao;
import com.acupuncture.system.persist.dao.WxQrCodeDao;
import com.acupuncture.system.persist.mapper.AmsScreenWxQrCodeMapper;
import com.acupuncture.common.utils.*;
@ -45,6 +47,9 @@ public class WxQrCodeServiceImpl implements WxQrCodeService {
@Resource
private WxQrCodeDao wxQrCodeDao;
@Resource
private DmsUserDao dmsUserDao;
@Value("${file.wxQrCodeTemplate}")
public String wxQrCodeTemplate;
@ -201,6 +206,11 @@ public class WxQrCodeServiceImpl implements WxQrCodeService {
return wxQrCodeDao.selectScreenList(hospitalId == null ? null : CollectionUtil.newArrayList(hospitalId));
}
@Override
public List<AmsWxQrCodeVo.ScreenResult> adminQueryList(Long hospitalId) {
return wxQrCodeDao.adminSelectScreenList(hospitalId == null ? null : CollectionUtil.newArrayList(hospitalId));
}
// @Override
// public List<AmsWxQrCodeVo.ScreenResult> queryList(Long hospitalId) {
// if (SecurityUtils.getUserId() == 1) {
@ -277,6 +287,46 @@ public class WxQrCodeServiceImpl implements WxQrCodeService {
DmsTenant amsHospital = dmsTenantMapper.selectByPrimaryKey(hostpitalId);
AmsScreenWxQrCodeExample amsScreenWxQrCodeExample = new AmsScreenWxQrCodeExample();
amsScreenWxQrCodeExample.createCriteria().andTenantIdEqualTo(hostpitalId).andDelFlagEqualTo((byte) 0);
List<AmsScreenWxQrCode> amsScreenWxQrCodes = wxQrCodeMapper.selectByExample(amsScreenWxQrCodeExample);
if (CollectionUtil.isNotEmpty(amsScreenWxQrCodes)) {
url = amsScreenWxQrCodes.get(0).getUrl();
}
File file = new File(screenQrCodeTemplate);
XWPFTemplate template = XWPFTemplate.compile(file.getAbsolutePath());
HashMap<String, Object> params = new HashMap<>();
PictureRenderData pictureRenderData = Pictures.ofLocal("/home/acupuncture/server" + url).size(200, 200).create();
params.put("pic", pictureRenderData);
String hospitalName = "";
if (amsHospital != null) {
hospitalName = amsHospital.getName();
}
params.put("hospitalName", hospitalName);
Long l = System.currentTimeMillis();
//成图
template.render(params);
//word转pdf
String filePath = "/home/acupuncture/server/profile/upload/" + hospitalName + "卒中筛查二维码.docx";
template.writeAndClose(Files.newOutputStream(Paths.get(filePath)));
String pdfPath = "/home/acupuncture/server/profile/upload/" + hospitalName + "卒中筛查二维码.pdf";
AsposeUtils.doc2pdf(filePath, pdfPath);
return "/profile/upload/" + hospitalName + "卒中筛查二维码.pdf";
}
@Override
public String adminExportScreen(String url, Long hostpitalId) throws IOException {
DmsTenant amsHospital = dmsUserDao.queryById(hostpitalId);
AmsWxQrCodeVo.Result result = wxQrCodeDao.queryById(hostpitalId);
if (result == null) {
throw new BaseException("未找到数据");
}
url = result.getUrl();
File file = new File(screenQrCodeTemplate);
XWPFTemplate template = XWPFTemplate.compile(file.getAbsolutePath());
HashMap<String, Object> params = new HashMap<>();

2
acupuncture-system/src/main/resources/mapper/dao/ExternalDao.xml

@ -15,7 +15,7 @@
left join
pms_patient p on t.patient_id = p.id
<where>
t.delete_flag = 0
t.del_flag = 0
<if test="query.memberid != null and query.memberid != ''">
and t.visit_number = #{query.memberid}
</if>

1
acupuncture-system/src/main/resources/mapper/dao/PmsTreatmentDao.xml

@ -99,6 +99,7 @@
left join
dms_tenant d on t.tenant_id = d.id
where t.del_flag = 0
and t.status = 2
<if test="query.tenantId != null">
AND t.tenant_id = #{query.tenantId}
</if>

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

@ -101,6 +101,46 @@
order by r.create_time desc
</select>
<select id="adminQueryResult" resultMap="BaseResultMap" parameterType="com.acupuncture.system.domain.dto.ScreeningDto$Query">
select r.*,
t.name as tenantName
from
v_scr_screening_record r
left join
dms_tenant t on r.tenant_id = t.id
<where>
r.del_flag = 0
<if test="type != null">
and r.screen_type = #{type}
</if>
<if test="param.keywords != null and param.keywords != ''">
<if test="param.keywords.length() &gt; 0">
and (
r.name like concat('%', #{param.keywords}, '%')
or r.pinyin_full like concat('%', #{param.keywords}, '%')
or r.pinyin_simple like concat('%', #{param.keywords}, '%')
or r.idcard like concat('%', #{param.keywords}, '%')
or r.phone like concat('%', #{param.keywords}, '%')
)
</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>
<if test="param.endTime != null and param.endTime != ''">
and r.create_time &lt;= #{param.endTime}
</if>
<if test="param.startAge != null and param.endAge != ''">
and r.age between #{param.startAge} and #{param.endAge}
</if>
</where>
-- group by r.id
order by r.create_time desc
</select>
<select id="queryDetailList" resultType="com.acupuncture.system.domain.vo.ScrScreenVo$ScreeningDetailVo">
select id as detailId,
question_code as questionCode,
@ -113,4 +153,17 @@
#{item}
</foreach>
</select>
<select id="adminQueryDetailList" resultType="com.acupuncture.system.domain.vo.ScrScreenVo$ScreeningDetailVo">
select id as detailId,
question_code as questionCode,
answer,
record_id as recordId
from v_scr_screening_detail
where del_flag = 0
and record_id in
<foreach collection="detailIdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper>

14
acupuncture-system/src/main/resources/mapper/dao/SysPowerDao.xml

@ -2,6 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.acupuncture.system.persist.dao.DmsUserDao">
<select id="queryById" resultType="com.acupuncture.system.domain.po.DmsTenant">
select id,
tenant_id as tenantId,
user_name as userName,
password,
nick_name as nickName,
email,
phonenumber,
sex,
status
from dms_tenant
where id = #{id}
</select>
<select id="selectUserByUserName" resultType="com.acupuncture.system.domain.vo.DmsLoginUserVo$DmsUserVo">
select
id,

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

@ -21,6 +21,9 @@
t.del_flag = 0
and
s.del_flag = 0
<if test="tenantId != null">
and t.id = #{tenantId}
</if>
group by
t.id
</select>

42
acupuncture-system/src/main/resources/mapper/dao/WxQrCodeDao.xml

@ -2,6 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.acupuncture.system.persist.dao.WxQrCodeDao">
<select id="queryById" resultType="com.acupuncture.system.domain.vo.AmsWxQrCodeVo$Result">
select
id,
url,
path
from
v_ams_screen_wx_qr_code
where
tenant_id = #{id}
and del_flag = 0
</select>
<select id="select" resultType="com.acupuncture.system.domain.vo.AmsWxQrCodeVo$Result">
SELECT
c.id,
@ -86,4 +98,34 @@
GROUP BY c.id
order by c.create_time desc
</select>
<select id="adminSelectScreenList" resultType="com.acupuncture.system.domain.vo.AmsWxQrCodeVo$ScreenResult">
SELECT
c.id,
c.url,
c.path,
c.tenant_id as tenantId,
c.remark,
c.create_time as createTime,
c.create_by as createBy,
c.contacts,
c.phone,
c.address,
h.name as tenantName
FROM
v_ams_screen_wx_qr_code c
left join dms_tenant h on c.tenant_id = h.id
<where>
c.del_flag = 0
and c.center_id is null
<if test="hospitalIdList != null and hospitalIdList.size() > 0">
AND c.tenant_id in
<foreach collection="hospitalIdList" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
GROUP BY c.id
order by c.create_time desc
</select>
</mapper>

28
acupuncture-system/src/main/resources/mapper/system/UplReportImageMapper.xml

@ -3,7 +3,7 @@
<mapper namespace="com.acupuncture.system.persist.mapper.UplReportImageMapper">
<resultMap id="BaseResultMap" type="com.acupuncture.system.domain.po.UplReportImage">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="patient_id" jdbcType="VARCHAR" property="patientId" />
<result column="member_id" jdbcType="VARCHAR" property="memberId" />
<result column="file_name" jdbcType="VARCHAR" property="fileName" />
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" />
@ -73,7 +73,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, patient_id, file_name, file_path, del_flag, tenant_id, create_by, create_time,
id, member_id, file_name, file_path, del_flag, tenant_id, create_by, create_time,
update_by, update_time, remark
</sql>
<select id="selectByExample" parameterType="com.acupuncture.system.domain.po.UplReportImageExample" resultMap="BaseResultMap">
@ -101,11 +101,11 @@
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.acupuncture.system.domain.po.UplReportImage">
insert into upl_report_image (id, patient_id, file_name,
insert into upl_report_image (id, member_id, file_name,
file_path, del_flag, tenant_id,
create_by, create_time, update_by,
update_time, remark)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR},
values (#{id,jdbcType=BIGINT}, #{memberId,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR},
#{filePath,jdbcType=VARCHAR}, #{delFlag,jdbcType=TINYINT}, #{tenantId,jdbcType=BIGINT},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
@ -116,8 +116,8 @@
<if test="id != null">
id,
</if>
<if test="patientId != null">
patient_id,
<if test="memberId != null">
member_id,
</if>
<if test="fileName != null">
file_name,
@ -151,8 +151,8 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="patientId != null">
#{patientId,jdbcType=VARCHAR},
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="fileName != null">
#{fileName,jdbcType=VARCHAR},
@ -195,8 +195,8 @@
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.patientId != null">
patient_id = #{record.patientId,jdbcType=VARCHAR},
<if test="record.memberId != null">
member_id = #{record.memberId,jdbcType=VARCHAR},
</if>
<if test="record.fileName != null">
file_name = #{record.fileName,jdbcType=VARCHAR},
@ -233,7 +233,7 @@
<update id="updateByExample" parameterType="map">
update upl_report_image
set id = #{record.id,jdbcType=BIGINT},
patient_id = #{record.patientId,jdbcType=VARCHAR},
member_id = #{record.memberId,jdbcType=VARCHAR},
file_name = #{record.fileName,jdbcType=VARCHAR},
file_path = #{record.filePath,jdbcType=VARCHAR},
del_flag = #{record.delFlag,jdbcType=TINYINT},
@ -250,8 +250,8 @@
<update id="updateByPrimaryKeySelective" parameterType="com.acupuncture.system.domain.po.UplReportImage">
update upl_report_image
<set>
<if test="patientId != null">
patient_id = #{patientId,jdbcType=VARCHAR},
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="fileName != null">
file_name = #{fileName,jdbcType=VARCHAR},
@ -285,7 +285,7 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.acupuncture.system.domain.po.UplReportImage">
update upl_report_image
set patient_id = #{patientId,jdbcType=VARCHAR},
set member_id = #{memberId,jdbcType=VARCHAR},
file_name = #{fileName,jdbcType=VARCHAR},
file_path = #{filePath,jdbcType=VARCHAR},
del_flag = #{delFlag,jdbcType=TINYINT},

Loading…
Cancel
Save