Browse Source

20210427

sd
zy_Java 4 years ago
parent
commit
3c75de9df1
  1. 9
      beneficiation/HELP.md
  2. 93
      ht/src/main/java/com/ccsens/ht/api/ImportController.java
  3. 21
      ht/src/main/java/com/ccsens/ht/api/PatientReportController.java
  4. 65
      ht/src/main/java/com/ccsens/ht/api/PatientReportExportController.java
  5. 64
      ht/src/main/java/com/ccsens/ht/api/PatientReportSearchController.java
  6. 14
      ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java
  7. 47
      ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportSearchDto.java
  8. 5
      ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java
  9. 117
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportRecordDesc.java
  10. 761
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportRecordDescExample.java
  11. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestion.java
  12. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionExample.java
  13. 117
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionOptionDesc.java
  14. 761
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionOptionDescExample.java
  15. 161
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionRecord.java
  16. 1021
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionRecordExample.java
  17. 117
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionRecordOption.java
  18. 771
      ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionRecordOptionExample.java
  19. 33
      ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportSearchVo.java
  20. 288
      ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java
  21. 111
      ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java
  22. 30
      ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java
  23. 9
      ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionDao.java
  24. 26
      ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionOptionDescDao.java
  25. 16
      ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionRecordDao.java
  26. 15
      ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionRecordOptionDao.java
  27. 25
      ht/src/main/java/com/ccsens/ht/persist/dao/HtReportDao.java
  28. 30
      ht/src/main/java/com/ccsens/ht/persist/mapper/HtPatientReportRecordDescMapper.java
  29. 30
      ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionOptionDescMapper.java
  30. 30
      ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionRecordMapper.java
  31. 30
      ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionRecordOptionMapper.java
  32. 15
      ht/src/main/java/com/ccsens/ht/service/IImportService.java
  33. 24
      ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java
  34. 278
      ht/src/main/java/com/ccsens/ht/service/ImportService.java
  35. 349
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java
  36. 404
      ht/src/main/java/com/ccsens/ht/service/QuestionService.java
  37. 108
      ht/src/main/java/com/ccsens/ht/uitl/Constant.java
  38. 3
      ht/src/main/resources/application-dev.yml
  39. 2
      ht/src/main/resources/application-test.yml
  40. 106
      ht/src/main/resources/mapper_dao/HtPatientReportDao.xml
  41. 98
      ht/src/main/resources/mapper_dao/HtQuestionDao.xml
  42. 15
      ht/src/main/resources/mapper_dao/HtQuestionOptionDao.xml
  43. 21
      ht/src/main/resources/mapper_dao/HtQuestionOptionDescDao.xml
  44. 16
      ht/src/main/resources/mapper_dao/HtQuestionRecordDao.xml
  45. 14
      ht/src/main/resources/mapper_dao/HtQuestionRecordOptionDao.xml
  46. 95
      ht/src/main/resources/mapper_dao/HtReportDao.xml
  47. 276
      ht/src/main/resources/mapper_raw/HtPatientReportRecordDescMapper.xml
  48. 35
      ht/src/main/resources/mapper_raw/HtQuestionMapper.xml
  49. 275
      ht/src/main/resources/mapper_raw/HtQuestionOptionDescMapper.xml
  50. 338
      ht/src/main/resources/mapper_raw/HtQuestionRecordMapper.xml
  51. 276
      ht/src/main/resources/mapper_raw/HtQuestionRecordOptionMapper.xml
  52. 58
      question/src/main/java/com/ccsens/question/api/PatientReportSearchController.java
  53. 38
      question/src/main/java/com/ccsens/question/bean/dto/PatientReportSearchDto.java
  54. 2
      question/src/main/java/com/ccsens/question/bean/dto/QuestionDto.java
  55. 33
      question/src/main/java/com/ccsens/question/bean/vo/PatientReportSearchVo.java
  56. 36
      question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java
  57. 9
      question/src/main/java/com/ccsens/question/persist/dao/HtPatientReportDao.java
  58. 8
      question/src/main/java/com/ccsens/question/persist/dao/HtReportDao.java
  59. 15
      question/src/main/java/com/ccsens/question/service/IPatientReportService.java
  60. 163
      question/src/main/java/com/ccsens/question/service/PatientReportService.java
  61. 10
      question/src/main/java/com/ccsens/question/service/QuestionService.java
  62. 18
      question/src/main/java/com/ccsens/question/uitl/Constant.java
  63. 4
      question/src/main/resources/application-dev.yml
  64. 8
      question/src/main/resources/application-green.yml
  65. 6
      question/src/main/resources/druid-dev.yml
  66. 38
      question/src/main/resources/mapper_dao/HtPatientReportDao.xml
  67. 31
      question/src/main/resources/mapper_dao/HtReportDao.xml
  68. 8
      tall/src/main/resources/application-dev.yml
  69. 5
      tall/src/main/resources/application-test.yml
  70. 9
      tcm/HELP.md
  71. 29
      util/src/main/java/com/ccsens/util/PdfUtil.java
  72. 2
      util/src/test/java/com/ccsens/util/PdfUtilTest.java

9
beneficiation/HELP.md

@ -0,0 +1,9 @@
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.2/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.2/maven-plugin/reference/html/#build-image)

93
ht/src/main/java/com/ccsens/ht/api/ImportController.java

@ -1,5 +1,6 @@
package com.ccsens.ht.api;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.ht.service.IImportService;
import com.ccsens.ht.uitl.Constant;
import com.ccsens.util.JsonResponse;
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.Part;
import java.io.File;
import java.util.List;
/**
@ -54,19 +56,27 @@ public class ImportController {
String allowedExts = "xls,xlsx";
String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File execlFile = new File(dir+path);
File excelFile = new File(dir+path);
long time2 = System.currentTimeMillis();
log.info("解析文件耗时:{}", (time2 - time1));
importService.importPosition(execlFile, 0);
importService.importPosition(excelFile, 0);
long time3 = System.currentTimeMillis();
log.info("导入职务耗时:{}", (time3 - time2));
importService.importTitle(execlFile, 1);
importService.importTitle(excelFile, 1);
long time4 = System.currentTimeMillis();
log.info("导入职称耗时:{}", (time4 - time3));
importService.importReport(execlFile, 2);
List<String> codes = importService.importReport(excelFile, 2);
long time5 = System.currentTimeMillis();
log.info("导入报告单耗时:{}", (time5 - time4));
importService.importQuestion(execlFile, Constant.Ht.Question.ALL);
importService.importReportRecord(excelFile, 3);
log.info("导入报告单其他记录耗时:{}", System.currentTimeMillis() - time5);
if (CollectionUtil.isNotEmpty(codes)) {
for (String code: codes) {
importService.importQuestion(excelFile, code);
log.info("{}导入完成",code);
}
}
return JsonResponse.newInstance().ok();
}
@ -84,24 +94,45 @@ public class ImportController {
@RequestMapping(value = "/importReportType", method = RequestMethod.POST)
public JsonResponse importReportType(@RequestParam(required = true) Part file) throws Exception{
long time1 = System.currentTimeMillis();
//1.上传文件
String allowedExts = "xls,xlsx";
String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File execlFile = new File(dir+path);
long time2 = System.currentTimeMillis();
log.info("解析文件耗时:{}", (time2 - time1));
// importService.importPosition(execlFile, 0);
// long time3 = System.currentTimeMillis();
// log.info("导入职务耗时:{}", (time3 - time2));
// importService.importTitle(execlFile, 1);
long time4 = System.currentTimeMillis();
// log.info("导入职称耗时:{}", (time4 - time3));
importService.importReport(execlFile, 2);
long time5 = System.currentTimeMillis();
log.info("导入报告单耗时:{}", (time5 - time4));
// importService.importQuestion(execlFile, Constant.Ht.Question.ALL);
File excelFile = new File(dir+path);
importService.importReport(excelFile, 2);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "单独导入报告单类型",notes = "文件大小不能超过20M,支持后缀:.xls|.xlsx")
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "医疗项目表", required = true, paramType = "form",dataType = "__file")
})
@RequestMapping(value = "/importReportTypeRecord", method = RequestMethod.POST)
public JsonResponse importReportTypeRecord(@RequestParam(required = true) Part file) throws Exception{
//1.上传文件
String allowedExts = "xls,xlsx";
String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File excelFile = new File(dir+path);
importService.importReportRecord(excelFile, 3);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "导入指定测评类型",notes = "文件大小不能超过20M,支持后缀:.xls|.xlsx")
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "医疗项目表", required = true, paramType = "form",dataType = "__file"),
@ApiImplicitParam(name = "code", value = "测评类型", required = true, paramType = "form",dataType = "__file")
})
@RequestMapping(value = "/importEvaluation", method = RequestMethod.POST)
public JsonResponse importEvaluation(@RequestParam(required = true) Part file, @RequestParam(required = true) String code) throws Exception{
//1.上传文件
String allowedExts = "xls,xlsx";
String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File excelFile = new File(dir+path);
importService.importQuestion(excelFile, code);
log.info("导入{}",code);
return JsonResponse.newInstance().ok();
}
@ -120,14 +151,12 @@ public class ImportController {
@RequestMapping(value = "/importMoca", method = RequestMethod.POST)
public JsonResponse importMoca(@RequestParam(required = true) Part file) throws Exception{
long time1 = System.currentTimeMillis();
//1.上传文件
String allowedExts = "xls,xlsx";
String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File execlFile = new File(dir+path);
long time2 = System.currentTimeMillis();
importService.importQuestion(execlFile, Constant.Ht.Report.MOCA);
File excelFile = new File(dir+path);
importService.importQuestion(excelFile, Constant.Ht.Report.MOCA);
log.info("导入moca");
return JsonResponse.newInstance().ok();
}
@ -146,14 +175,12 @@ public class ImportController {
@RequestMapping(value = "/importMMSE", method = RequestMethod.POST)
public JsonResponse importMMSE(@RequestParam(required = true) Part file) throws Exception{
long time1 = System.currentTimeMillis();
//1.上传文件
String allowedExts = "xls,xlsx";
String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File execlFile = new File(dir+path);
long time2 = System.currentTimeMillis();
importService.importQuestion(execlFile, Constant.Ht.Report.MMSE);
File excelFile = new File(dir+path);
importService.importQuestion(excelFile, Constant.Ht.Report.MMSE);
log.info("导入mmse");
return JsonResponse.newInstance().ok();
}
@ -172,14 +199,12 @@ public class ImportController {
@RequestMapping(value = "/importRey", method = RequestMethod.POST)
public JsonResponse importRey(@RequestParam(required = true) Part file) throws Exception{
long time1 = System.currentTimeMillis();
//1.上传文件
String allowedExts = "xls,xlsx";
String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File execlFile = new File(dir+path);
long time2 = System.currentTimeMillis();
importService.importQuestion(execlFile, Constant.Ht.Report.REY);
File excelFile = new File(dir+path);
importService.importQuestion(excelFile, Constant.Ht.Report.REY);
log.info("导入Rey");
return JsonResponse.newInstance().ok();
}
@ -199,14 +224,12 @@ public class ImportController {
@RequestMapping(value = "/importXFXPD", method = RequestMethod.POST)
public JsonResponse importXFXPD(@RequestParam(required = true) Part file) throws Exception{
long time1 = System.currentTimeMillis();
//1.上传文件
String allowedExts = "xls,xlsx";
String dir = WebConstant.UPLOAD_PROJECT_WBS + File.separator;
String path = UploadFileUtil_Servlet3.uploadFile(file, allowedExts, dir);
File execlFile = new File(dir+path);
long time2 = System.currentTimeMillis();
importService.importQuestion(execlFile, Constant.Ht.Report.XFXPD);
File excelFile = new File(dir+path);
importService.importQuestion(excelFile, Constant.Ht.Report.XFXPD);
log.info("导入XFXPD");
return JsonResponse.newInstance().ok();
}

21
ht/src/main/java/com/ccsens/ht/api/PatientReportController.java

@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
@ -35,7 +36,7 @@ import java.util.List;
@RestController
public class PatientReportController {
@Autowired
@Resource
private IPatientReportService patientReportService;
@MustLogin
@ -142,20 +143,10 @@ public class PatientReportController {
return JsonResponse.newInstance().ok(authority);
}
@ApiOperation(value = "导出报告单",notes = "导出报告单")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "导出报告单", required = true)
})
@RequestMapping(value="/exportReport", method = RequestMethod.POST)
public JsonResponse<PatientReportVo.Export> exportReport(@RequestBody @ApiParam @Valid QueryDto<PatientReportDto.QueryDetail> param){
//查询报告单信息
log.info("查询报告单详情:{}", param);
String path = patientReportService.exportReport(param.getParam(), param.getUserId());
log.info("文件路径:{}", path);
PatientReportVo.Export export = new PatientReportVo.Export();
export.setPath(path);
return JsonResponse.newInstance().ok(export);
}
@ApiOperation(value = "分享报告单",notes = "分享报告单")
@ApiImplicitParams({

65
ht/src/main/java/com/ccsens/ht/api/PatientReportExportController.java

@ -0,0 +1,65 @@
package com.ccsens.ht.api;
import cn.hutool.core.util.CharsetUtil;
import com.ccsens.ht.bean.dto.PatientReportDto;
import com.ccsens.ht.bean.vo.PatientReportVo;
import com.ccsens.ht.service.IPatientReportService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
/**
* @description:
* @author: whj
* @time: 2021/4/21 19:01
*/
@Slf4j
@Api(tags = "报告单导出",value = "报告单导出")
@RestController
public class PatientReportExportController {
@Resource
private IPatientReportService patientReportService;
@ApiOperation(value = "导出报告单",notes = "导出报告单")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "导出报告单", required = true)
})
@RequestMapping(value="/exportReport", method = RequestMethod.POST)
public JsonResponse<PatientReportVo.Export> exportReport(@RequestBody @ApiParam @Valid QueryDto<PatientReportDto.QueryDetail> param){
//查询报告单信息
log.info("查询报告单详情:{}", param);
String path = patientReportService.exportReport(param.getParam(), param.getUserId());
log.info("文件路径:{}", path);
PatientReportVo.Export export = new PatientReportVo.Export();
export.setPath(path);
return JsonResponse.newInstance().ok(export);
}
@ApiOperation(value = "导出指定报告单",notes = "导出报告单")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "导出报告单", required = true)
})
@RequestMapping(value="/export", method = RequestMethod.POST)
public JsonResponse<PatientReportVo.Export> export(@RequestBody @ApiParam @Valid QueryDto<PatientReportDto.ExportCode> param) {
//查询报告单信息
log.info("导出指定报告单:{}", param);
String path = patientReportService.export(param.getParam(), param.getUserId());
log.info("文件路径:{}", path);
PatientReportVo.Export export = new PatientReportVo.Export();
export.setPath(path);
return JsonResponse.newInstance().ok(export);
}
}

64
ht/src/main/java/com/ccsens/ht/api/PatientReportSearchController.java

@ -0,0 +1,64 @@
package com.ccsens.ht.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.ht.annotation.DoctorAudit;
import com.ccsens.ht.bean.dto.PatientReportDto;
import com.ccsens.ht.bean.dto.PatientReportSearchDto;
import com.ccsens.ht.bean.vo.PatientReportSearchVo;
import com.ccsens.ht.bean.vo.PatientReportVo;
import com.ccsens.ht.service.IPatientReportService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/3/10 15:03
*/
@Slf4j
@Api(tags = "报告单搜索",value = "报告单搜索条件,搜索")
@RestController
@RequestMapping("/patientReport")
public class PatientReportSearchController {
@Resource
private IPatientReportService patientReportService;
@MustLogin
@DoctorAudit
@ApiOperation(value = "查询搜索条件",notes = "whj 查询搜索条件")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "查询搜索条件", required = true)
})
@RequestMapping(value="/searchParam", method = RequestMethod.POST)
public JsonResponse<PatientReportSearchVo.SearchParam> searchParam(@RequestBody @ApiParam @Valid QueryDto<PatientReportSearchDto.SearchParam> dto){
log.info("查询搜索条件:{}", dto);
List<PatientReportSearchVo.SearchParam> params = patientReportService.searchParam(dto.getParam());
log.info("查询搜索条件已完成");
return JsonResponse.newInstance().ok(params);
}
@MustLogin
@DoctorAudit
@ApiOperation(value = "根据条件搜索报告单",notes = "whj 搜索报告单")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "查询搜索条件", required = true)
})
@RequestMapping(value="/search", method = RequestMethod.POST)
public JsonResponse<PatientReportSearchVo.Search> search(@RequestBody @ApiParam @Valid QueryDto<PatientReportSearchDto.SearchList> dto){
log.info("搜索报告单:{}", dto);
PageInfo<PatientReportSearchVo.Search> params = patientReportService.search(dto.getParam());
log.info("搜索报告单已完成");
return JsonResponse.newInstance().ok(params);
}
}

14
ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java

@ -83,8 +83,20 @@ public class PatientReportDto {
private Long id;
@ApiModelProperty("是否需要rey 默认为0 0全部查询导出 1不导出rey 2只导出rey")
private int rey = 0;
@ApiModelProperty("报告单类型")
private String report = "REPORT1.0";
}
@ApiModel("导出指定某一种报告单")
@Data
public static class ExportCode{
@ApiModelProperty("病人报告单ID")
@NotNull(message = "病人报告单ID不能为空")
private Long id;
@ApiModelProperty("报告单类型")
private String code;
}
/**医生对报告单权限*/
@ApiModel("PatientReportDtoAuthority")

47
ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportSearchDto.java

@ -0,0 +1,47 @@
package com.ccsens.ht.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/3/10 16:21
*/
public class PatientReportSearchDto {
@Data
@ApiModel("搜索条件-请求参数")
public static class SearchParam{
@ApiModelProperty("查询类型")
@NotEmpty(message = "请输入查询报告单类型")
private String parentCode;
}
@Data
@ApiModel("搜索报告单参数列表-请求")
public static class SearchList {
private List<Search> codes;
@ApiModelProperty("第几页")
@Min(value = 1)
private int pageNum = 1;
@ApiModelProperty("每页多少条")
@Min(value = 1)
@Max(value=100)
private int pageSize = 10;
}
@Data
@ApiModel("搜索报告单参数-请求")
public static class Search {
@NotEmpty(message="请选择查询类型")
private String code;
private Integer start;
private Integer end;
}
}

5
ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java

@ -7,6 +7,7 @@ import lombok.Data;
import javax.servlet.http.Part;
import javax.validation.constraints.NotNull;
import java.io.File;
import java.math.BigDecimal;
import java.util.List;
/**
@ -101,6 +102,10 @@ public class QuestionDto {
@NotNull(message = "测评试题id不能为空")
@ApiModelProperty("测评试题id")
private Long questionId;
@ApiModelProperty("参考长度")
private BigDecimal referenceLength;
@ApiModelProperty("参考思考时间")
private BigDecimal referenceReflectOnTime;
}
@Data

117
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportRecordDesc.java

@ -0,0 +1,117 @@
package com.ccsens.ht.bean.po;
import java.io.Serializable;
import java.util.Date;
public class HtPatientReportRecordDesc implements Serializable {
private Long id;
private Long patientReportId;
private Long recordId;
private String answer;
private String remark;
private Date createTime;
private Date updateTime;
private Byte isDel;
private Long answerTime;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPatientReportId() {
return patientReportId;
}
public void setPatientReportId(Long patientReportId) {
this.patientReportId = patientReportId;
}
public Long getRecordId() {
return recordId;
}
public void setRecordId(Long recordId) {
this.recordId = recordId;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer == null ? null : answer.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Byte getIsDel() {
return isDel;
}
public void setIsDel(Byte isDel) {
this.isDel = isDel;
}
public Long getAnswerTime() {
return answerTime;
}
public void setAnswerTime(Long answerTime) {
this.answerTime = answerTime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", patientReportId=").append(patientReportId);
sb.append(", recordId=").append(recordId);
sb.append(", answer=").append(answer);
sb.append(", remark=").append(remark);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", answerTime=").append(answerTime);
sb.append("]");
return sb.toString();
}
}

761
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportRecordDescExample.java

@ -0,0 +1,761 @@
package com.ccsens.ht.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class HtPatientReportRecordDescExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public HtPatientReportRecordDescExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andPatientReportIdIsNull() {
addCriterion("patient_report_id is null");
return (Criteria) this;
}
public Criteria andPatientReportIdIsNotNull() {
addCriterion("patient_report_id is not null");
return (Criteria) this;
}
public Criteria andPatientReportIdEqualTo(Long value) {
addCriterion("patient_report_id =", value, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdNotEqualTo(Long value) {
addCriterion("patient_report_id <>", value, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdGreaterThan(Long value) {
addCriterion("patient_report_id >", value, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdGreaterThanOrEqualTo(Long value) {
addCriterion("patient_report_id >=", value, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdLessThan(Long value) {
addCriterion("patient_report_id <", value, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdLessThanOrEqualTo(Long value) {
addCriterion("patient_report_id <=", value, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdIn(List<Long> values) {
addCriterion("patient_report_id in", values, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdNotIn(List<Long> values) {
addCriterion("patient_report_id not in", values, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdBetween(Long value1, Long value2) {
addCriterion("patient_report_id between", value1, value2, "patientReportId");
return (Criteria) this;
}
public Criteria andPatientReportIdNotBetween(Long value1, Long value2) {
addCriterion("patient_report_id not between", value1, value2, "patientReportId");
return (Criteria) this;
}
public Criteria andRecordIdIsNull() {
addCriterion("record_id is null");
return (Criteria) this;
}
public Criteria andRecordIdIsNotNull() {
addCriterion("record_id is not null");
return (Criteria) this;
}
public Criteria andRecordIdEqualTo(Long value) {
addCriterion("record_id =", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotEqualTo(Long value) {
addCriterion("record_id <>", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdGreaterThan(Long value) {
addCriterion("record_id >", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdGreaterThanOrEqualTo(Long value) {
addCriterion("record_id >=", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdLessThan(Long value) {
addCriterion("record_id <", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdLessThanOrEqualTo(Long value) {
addCriterion("record_id <=", value, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdIn(List<Long> values) {
addCriterion("record_id in", values, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotIn(List<Long> values) {
addCriterion("record_id not in", values, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdBetween(Long value1, Long value2) {
addCriterion("record_id between", value1, value2, "recordId");
return (Criteria) this;
}
public Criteria andRecordIdNotBetween(Long value1, Long value2) {
addCriterion("record_id not between", value1, value2, "recordId");
return (Criteria) this;
}
public Criteria andAnswerIsNull() {
addCriterion("answer is null");
return (Criteria) this;
}
public Criteria andAnswerIsNotNull() {
addCriterion("answer is not null");
return (Criteria) this;
}
public Criteria andAnswerEqualTo(String value) {
addCriterion("answer =", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerNotEqualTo(String value) {
addCriterion("answer <>", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerGreaterThan(String value) {
addCriterion("answer >", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerGreaterThanOrEqualTo(String value) {
addCriterion("answer >=", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerLessThan(String value) {
addCriterion("answer <", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerLessThanOrEqualTo(String value) {
addCriterion("answer <=", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerLike(String value) {
addCriterion("answer like", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerNotLike(String value) {
addCriterion("answer not like", value, "answer");
return (Criteria) this;
}
public Criteria andAnswerIn(List<String> values) {
addCriterion("answer in", values, "answer");
return (Criteria) this;
}
public Criteria andAnswerNotIn(List<String> values) {
addCriterion("answer not in", values, "answer");
return (Criteria) this;
}
public Criteria andAnswerBetween(String value1, String value2) {
addCriterion("answer between", value1, value2, "answer");
return (Criteria) this;
}
public Criteria andAnswerNotBetween(String value1, String value2) {
addCriterion("answer not between", value1, value2, "answer");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andIsDelIsNull() {
addCriterion("is_del is null");
return (Criteria) this;
}
public Criteria andIsDelIsNotNull() {
addCriterion("is_del is not null");
return (Criteria) this;
}
public Criteria andIsDelEqualTo(Byte value) {
addCriterion("is_del =", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotEqualTo(Byte value) {
addCriterion("is_del <>", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThan(Byte value) {
addCriterion("is_del >", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThanOrEqualTo(Byte value) {
addCriterion("is_del >=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThan(Byte value) {
addCriterion("is_del <", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThanOrEqualTo(Byte value) {
addCriterion("is_del <=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelIn(List<Byte> values) {
addCriterion("is_del in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotIn(List<Byte> values) {
addCriterion("is_del not in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelBetween(Byte value1, Byte value2) {
addCriterion("is_del between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotBetween(Byte value1, Byte value2) {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andAnswerTimeIsNull() {
addCriterion("answer_time is null");
return (Criteria) this;
}
public Criteria andAnswerTimeIsNotNull() {
addCriterion("answer_time is not null");
return (Criteria) this;
}
public Criteria andAnswerTimeEqualTo(Long value) {
addCriterion("answer_time =", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeNotEqualTo(Long value) {
addCriterion("answer_time <>", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeGreaterThan(Long value) {
addCriterion("answer_time >", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeGreaterThanOrEqualTo(Long value) {
addCriterion("answer_time >=", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeLessThan(Long value) {
addCriterion("answer_time <", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeLessThanOrEqualTo(Long value) {
addCriterion("answer_time <=", value, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeIn(List<Long> values) {
addCriterion("answer_time in", values, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeNotIn(List<Long> values) {
addCriterion("answer_time not in", values, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeBetween(Long value1, Long value2) {
addCriterion("answer_time between", value1, value2, "answerTime");
return (Criteria) this;
}
public Criteria andAnswerTimeNotBetween(Long value1, Long value2) {
addCriterion("answer_time not between", value1, value2, "answerTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

11
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestion.java

@ -22,6 +22,8 @@ public class HtQuestion implements Serializable {
private String relationCode;
private Long relationId;
private Byte operateType;
private Byte recodeStarttime;
@ -116,6 +118,14 @@ public class HtQuestion implements Serializable {
this.relationCode = relationCode == null ? null : relationCode.trim();
}
public Long getRelationId() {
return relationId;
}
public void setRelationId(Long relationId) {
this.relationId = relationId;
}
public Byte getOperateType() {
return operateType;
}
@ -211,6 +221,7 @@ public class HtQuestion implements Serializable {
sb.append(", recordType=").append(recordType);
sb.append(", recordContent=").append(recordContent);
sb.append(", relationCode=").append(relationCode);
sb.append(", relationId=").append(relationId);
sb.append(", operateType=").append(operateType);
sb.append(", recodeStarttime=").append(recodeStarttime);
sb.append(", timeWabei=").append(timeWabei);

60
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionExample.java

@ -705,6 +705,66 @@ public class HtQuestionExample {
return (Criteria) this;
}
public Criteria andRelationIdIsNull() {
addCriterion("relation_id is null");
return (Criteria) this;
}
public Criteria andRelationIdIsNotNull() {
addCriterion("relation_id is not null");
return (Criteria) this;
}
public Criteria andRelationIdEqualTo(Long value) {
addCriterion("relation_id =", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotEqualTo(Long value) {
addCriterion("relation_id <>", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdGreaterThan(Long value) {
addCriterion("relation_id >", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdGreaterThanOrEqualTo(Long value) {
addCriterion("relation_id >=", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdLessThan(Long value) {
addCriterion("relation_id <", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdLessThanOrEqualTo(Long value) {
addCriterion("relation_id <=", value, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdIn(List<Long> values) {
addCriterion("relation_id in", values, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotIn(List<Long> values) {
addCriterion("relation_id not in", values, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdBetween(Long value1, Long value2) {
addCriterion("relation_id between", value1, value2, "relationId");
return (Criteria) this;
}
public Criteria andRelationIdNotBetween(Long value1, Long value2) {
addCriterion("relation_id not between", value1, value2, "relationId");
return (Criteria) this;
}
public Criteria andOperateTypeIsNull() {
addCriterion("operate_type is null");
return (Criteria) this;

117
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionOptionDesc.java

@ -0,0 +1,117 @@
package com.ccsens.ht.bean.po;
import java.io.Serializable;
import java.util.Date;
public class HtQuestionOptionDesc implements Serializable {
private Long id;
private Long optionId;
private Integer sort;
private Byte type;
private String content;
private String remark;
private Date createTime;
private Date updateTime;
private Byte isDel;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getOptionId() {
return optionId;
}
public void setOptionId(Long optionId) {
this.optionId = optionId;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Byte getIsDel() {
return isDel;
}
public void setIsDel(Byte isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", optionId=").append(optionId);
sb.append(", sort=").append(sort);
sb.append(", type=").append(type);
sb.append(", content=").append(content);
sb.append(", remark=").append(remark);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append("]");
return sb.toString();
}
}

761
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionOptionDescExample.java

@ -0,0 +1,761 @@
package com.ccsens.ht.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class HtQuestionOptionDescExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public HtQuestionOptionDescExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andOptionIdIsNull() {
addCriterion("option_id is null");
return (Criteria) this;
}
public Criteria andOptionIdIsNotNull() {
addCriterion("option_id is not null");
return (Criteria) this;
}
public Criteria andOptionIdEqualTo(Long value) {
addCriterion("option_id =", value, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdNotEqualTo(Long value) {
addCriterion("option_id <>", value, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdGreaterThan(Long value) {
addCriterion("option_id >", value, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdGreaterThanOrEqualTo(Long value) {
addCriterion("option_id >=", value, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdLessThan(Long value) {
addCriterion("option_id <", value, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdLessThanOrEqualTo(Long value) {
addCriterion("option_id <=", value, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdIn(List<Long> values) {
addCriterion("option_id in", values, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdNotIn(List<Long> values) {
addCriterion("option_id not in", values, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdBetween(Long value1, Long value2) {
addCriterion("option_id between", value1, value2, "optionId");
return (Criteria) this;
}
public Criteria andOptionIdNotBetween(Long value1, Long value2) {
addCriterion("option_id not between", value1, value2, "optionId");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;
}
public Criteria andSortIsNotNull() {
addCriterion("sort is not null");
return (Criteria) this;
}
public Criteria andSortEqualTo(Integer value) {
addCriterion("sort =", value, "sort");
return (Criteria) this;
}
public Criteria andSortNotEqualTo(Integer value) {
addCriterion("sort <>", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThan(Integer value) {
addCriterion("sort >", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThanOrEqualTo(Integer value) {
addCriterion("sort >=", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThan(Integer value) {
addCriterion("sort <", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThanOrEqualTo(Integer value) {
addCriterion("sort <=", value, "sort");
return (Criteria) this;
}
public Criteria andSortIn(List<Integer> values) {
addCriterion("sort in", values, "sort");
return (Criteria) this;
}
public Criteria andSortNotIn(List<Integer> values) {
addCriterion("sort not in", values, "sort");
return (Criteria) this;
}
public Criteria andSortBetween(Integer value1, Integer value2) {
addCriterion("sort between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andSortNotBetween(Integer value1, Integer value2) {
addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Byte value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Byte value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Byte value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Byte value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Byte value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Byte> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Byte> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Byte value1, Byte value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Byte value1, Byte value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andContentIsNull() {
addCriterion("content is null");
return (Criteria) this;
}
public Criteria andContentIsNotNull() {
addCriterion("content is not null");
return (Criteria) this;
}
public Criteria andContentEqualTo(String value) {
addCriterion("content =", value, "content");
return (Criteria) this;
}
public Criteria andContentNotEqualTo(String value) {
addCriterion("content <>", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThan(String value) {
addCriterion("content >", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThanOrEqualTo(String value) {
addCriterion("content >=", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThan(String value) {
addCriterion("content <", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThanOrEqualTo(String value) {
addCriterion("content <=", value, "content");
return (Criteria) this;
}
public Criteria andContentLike(String value) {
addCriterion("content like", value, "content");
return (Criteria) this;
}
public Criteria andContentNotLike(String value) {
addCriterion("content not like", value, "content");
return (Criteria) this;
}
public Criteria andContentIn(List<String> values) {
addCriterion("content in", values, "content");
return (Criteria) this;
}
public Criteria andContentNotIn(List<String> values) {
addCriterion("content not in", values, "content");
return (Criteria) this;
}
public Criteria andContentBetween(String value1, String value2) {
addCriterion("content between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andContentNotBetween(String value1, String value2) {
addCriterion("content not between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andIsDelIsNull() {
addCriterion("is_del is null");
return (Criteria) this;
}
public Criteria andIsDelIsNotNull() {
addCriterion("is_del is not null");
return (Criteria) this;
}
public Criteria andIsDelEqualTo(Byte value) {
addCriterion("is_del =", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotEqualTo(Byte value) {
addCriterion("is_del <>", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThan(Byte value) {
addCriterion("is_del >", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThanOrEqualTo(Byte value) {
addCriterion("is_del >=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThan(Byte value) {
addCriterion("is_del <", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThanOrEqualTo(Byte value) {
addCriterion("is_del <=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelIn(List<Byte> values) {
addCriterion("is_del in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotIn(List<Byte> values) {
addCriterion("is_del not in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelBetween(Byte value1, Byte value2) {
addCriterion("is_del between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotBetween(Byte value1, Byte value2) {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

161
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionRecord.java

@ -0,0 +1,161 @@
package com.ccsens.ht.bean.po;
import java.io.Serializable;
import java.util.Date;
public class HtQuestionRecord implements Serializable {
private Long id;
private Byte recordType;
private Long questionId;
private Integer sort;
private Byte calcType;
private String showTitle;
private String showForm;
private String defaultValue;
private Byte type;
private String remark;
private Date createTime;
private Date updateTime;
private Byte isDel;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Byte getRecordType() {
return recordType;
}
public void setRecordType(Byte recordType) {
this.recordType = recordType;
}
public Long getQuestionId() {
return questionId;
}
public void setQuestionId(Long questionId) {
this.questionId = questionId;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Byte getCalcType() {
return calcType;
}
public void setCalcType(Byte calcType) {
this.calcType = calcType;
}
public String getShowTitle() {
return showTitle;
}
public void setShowTitle(String showTitle) {
this.showTitle = showTitle == null ? null : showTitle.trim();
}
public String getShowForm() {
return showForm;
}
public void setShowForm(String showForm) {
this.showForm = showForm == null ? null : showForm.trim();
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue == null ? null : defaultValue.trim();
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Byte getIsDel() {
return isDel;
}
public void setIsDel(Byte isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", recordType=").append(recordType);
sb.append(", questionId=").append(questionId);
sb.append(", sort=").append(sort);
sb.append(", calcType=").append(calcType);
sb.append(", showTitle=").append(showTitle);
sb.append(", showForm=").append(showForm);
sb.append(", defaultValue=").append(defaultValue);
sb.append(", type=").append(type);
sb.append(", remark=").append(remark);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append("]");
return sb.toString();
}
}

1021
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionRecordExample.java

File diff suppressed because it is too large

117
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionRecordOption.java

@ -0,0 +1,117 @@
package com.ccsens.ht.bean.po;
import java.io.Serializable;
import java.util.Date;
public class HtQuestionRecordOption implements Serializable {
private Long id;
private Long questionRecordId;
private Integer sort;
private String dataKey;
private String dataValue;
private String remark;
private Date createTime;
private Date updateTime;
private Byte isDel;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getQuestionRecordId() {
return questionRecordId;
}
public void setQuestionRecordId(Long questionRecordId) {
this.questionRecordId = questionRecordId;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getDataKey() {
return dataKey;
}
public void setDataKey(String dataKey) {
this.dataKey = dataKey == null ? null : dataKey.trim();
}
public String getDataValue() {
return dataValue;
}
public void setDataValue(String dataValue) {
this.dataValue = dataValue == null ? null : dataValue.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Byte getIsDel() {
return isDel;
}
public void setIsDel(Byte isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", questionRecordId=").append(questionRecordId);
sb.append(", sort=").append(sort);
sb.append(", dataKey=").append(dataKey);
sb.append(", dataValue=").append(dataValue);
sb.append(", remark=").append(remark);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append("]");
return sb.toString();
}
}

771
ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionRecordOptionExample.java

@ -0,0 +1,771 @@
package com.ccsens.ht.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class HtQuestionRecordOptionExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public HtQuestionRecordOptionExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andQuestionRecordIdIsNull() {
addCriterion("question_record_id is null");
return (Criteria) this;
}
public Criteria andQuestionRecordIdIsNotNull() {
addCriterion("question_record_id is not null");
return (Criteria) this;
}
public Criteria andQuestionRecordIdEqualTo(Long value) {
addCriterion("question_record_id =", value, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdNotEqualTo(Long value) {
addCriterion("question_record_id <>", value, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdGreaterThan(Long value) {
addCriterion("question_record_id >", value, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdGreaterThanOrEqualTo(Long value) {
addCriterion("question_record_id >=", value, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdLessThan(Long value) {
addCriterion("question_record_id <", value, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdLessThanOrEqualTo(Long value) {
addCriterion("question_record_id <=", value, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdIn(List<Long> values) {
addCriterion("question_record_id in", values, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdNotIn(List<Long> values) {
addCriterion("question_record_id not in", values, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdBetween(Long value1, Long value2) {
addCriterion("question_record_id between", value1, value2, "questionRecordId");
return (Criteria) this;
}
public Criteria andQuestionRecordIdNotBetween(Long value1, Long value2) {
addCriterion("question_record_id not between", value1, value2, "questionRecordId");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;
}
public Criteria andSortIsNotNull() {
addCriterion("sort is not null");
return (Criteria) this;
}
public Criteria andSortEqualTo(Integer value) {
addCriterion("sort =", value, "sort");
return (Criteria) this;
}
public Criteria andSortNotEqualTo(Integer value) {
addCriterion("sort <>", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThan(Integer value) {
addCriterion("sort >", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThanOrEqualTo(Integer value) {
addCriterion("sort >=", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThan(Integer value) {
addCriterion("sort <", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThanOrEqualTo(Integer value) {
addCriterion("sort <=", value, "sort");
return (Criteria) this;
}
public Criteria andSortIn(List<Integer> values) {
addCriterion("sort in", values, "sort");
return (Criteria) this;
}
public Criteria andSortNotIn(List<Integer> values) {
addCriterion("sort not in", values, "sort");
return (Criteria) this;
}
public Criteria andSortBetween(Integer value1, Integer value2) {
addCriterion("sort between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andSortNotBetween(Integer value1, Integer value2) {
addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andDataKeyIsNull() {
addCriterion("data_key is null");
return (Criteria) this;
}
public Criteria andDataKeyIsNotNull() {
addCriterion("data_key is not null");
return (Criteria) this;
}
public Criteria andDataKeyEqualTo(String value) {
addCriterion("data_key =", value, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyNotEqualTo(String value) {
addCriterion("data_key <>", value, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyGreaterThan(String value) {
addCriterion("data_key >", value, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyGreaterThanOrEqualTo(String value) {
addCriterion("data_key >=", value, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyLessThan(String value) {
addCriterion("data_key <", value, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyLessThanOrEqualTo(String value) {
addCriterion("data_key <=", value, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyLike(String value) {
addCriterion("data_key like", value, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyNotLike(String value) {
addCriterion("data_key not like", value, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyIn(List<String> values) {
addCriterion("data_key in", values, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyNotIn(List<String> values) {
addCriterion("data_key not in", values, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyBetween(String value1, String value2) {
addCriterion("data_key between", value1, value2, "dataKey");
return (Criteria) this;
}
public Criteria andDataKeyNotBetween(String value1, String value2) {
addCriterion("data_key not between", value1, value2, "dataKey");
return (Criteria) this;
}
public Criteria andDataValueIsNull() {
addCriterion("data_value is null");
return (Criteria) this;
}
public Criteria andDataValueIsNotNull() {
addCriterion("data_value is not null");
return (Criteria) this;
}
public Criteria andDataValueEqualTo(String value) {
addCriterion("data_value =", value, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueNotEqualTo(String value) {
addCriterion("data_value <>", value, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueGreaterThan(String value) {
addCriterion("data_value >", value, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueGreaterThanOrEqualTo(String value) {
addCriterion("data_value >=", value, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueLessThan(String value) {
addCriterion("data_value <", value, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueLessThanOrEqualTo(String value) {
addCriterion("data_value <=", value, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueLike(String value) {
addCriterion("data_value like", value, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueNotLike(String value) {
addCriterion("data_value not like", value, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueIn(List<String> values) {
addCriterion("data_value in", values, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueNotIn(List<String> values) {
addCriterion("data_value not in", values, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueBetween(String value1, String value2) {
addCriterion("data_value between", value1, value2, "dataValue");
return (Criteria) this;
}
public Criteria andDataValueNotBetween(String value1, String value2) {
addCriterion("data_value not between", value1, value2, "dataValue");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andIsDelIsNull() {
addCriterion("is_del is null");
return (Criteria) this;
}
public Criteria andIsDelIsNotNull() {
addCriterion("is_del is not null");
return (Criteria) this;
}
public Criteria andIsDelEqualTo(Byte value) {
addCriterion("is_del =", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotEqualTo(Byte value) {
addCriterion("is_del <>", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThan(Byte value) {
addCriterion("is_del >", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelGreaterThanOrEqualTo(Byte value) {
addCriterion("is_del >=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThan(Byte value) {
addCriterion("is_del <", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelLessThanOrEqualTo(Byte value) {
addCriterion("is_del <=", value, "isDel");
return (Criteria) this;
}
public Criteria andIsDelIn(List<Byte> values) {
addCriterion("is_del in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotIn(List<Byte> values) {
addCriterion("is_del not in", values, "isDel");
return (Criteria) this;
}
public Criteria andIsDelBetween(Byte value1, Byte value2) {
addCriterion("is_del between", value1, value2, "isDel");
return (Criteria) this;
}
public Criteria andIsDelNotBetween(Byte value1, Byte value2) {
addCriterion("is_del not between", value1, value2, "isDel");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

33
ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportSearchVo.java

@ -0,0 +1,33 @@
package com.ccsens.ht.bean.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/3/10 16:06
*/
public class PatientReportSearchVo {
@Data
@ApiModel("搜索条件-响应")
public static class SearchParam {
private Long id;
private String code;
private String name;
private byte optionStatus;
private String parentCode;
private List<SearchParam> children = new ArrayList<>();
}
@Data
@ApiModel("搜索-响应")
public static class Search {
private Long id;
private String name;
}
}

288
ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java

@ -129,10 +129,49 @@ public class PatientReportVo {
private String hospital;
public List<PdfUtil.Row> toPdfRow(){
List<PdfUtil.Row> rows = getInitRows();
//第四栏
rows.add(
fillRow(
"临床诊断:" + this.clinicalDiagnosis,
"","")
);
return rows;
}
public List<PdfUtil.Row> toPdfSimpleCodeRow(){
List<PdfUtil.Row> rows = getInitRows();
//第四栏
Date date = new Date();
if (this.reportTime != null && this.reportTime > 0) {
date.setTime(this.reportTime);
}
PdfUtil.Row fourRow = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent("临床诊断:" );
cell.setCenter(false);
cell.setColSpan(2);
cell.setBorderLeft(0);
cell.setBorderBottom(0);
fourRow.addCell(cell);
PdfUtil.Cell cell2 = new PdfUtil.Cell();
cell2.setContent("检查日期:" + DateUtil.format(date, "yyyy-MM-dd"));
cell2.setCenter(false);
cell2.setBorderLeft(0);
cell2.setBorderBottom(0);
fourRow.addCell(cell2);
rows.add(fourRow);
return rows;
}
private List<PdfUtil.Row> getInitRows() {
Map<Byte, String> careerMap = new HashMap<>(16);
String careerMsg = "1:农林牧渔水利生产人员 2:教师 3:医务工作者 4:专业技术人员 5:生产、运输设备操作人员及有关人员 6:商业、服务业人员 7:国家机关、事业单位、企业负责人 8:国家机关、事业单位、企业办事人员和有关人员 9:军人 10:媒体、文体类工作人员 11:在校学生 12:未就业 13:家务 14:其他";
String splitStr = " ";
for (String careerOne: careerMsg.split(splitStr)) {
for (String careerOne : careerMsg.split(splitStr)) {
String splitStr2 = ":";
careerMap.put(Byte.parseByte(careerOne.split(splitStr2)[0]), careerOne.split(splitStr2)[1]);
}
@ -161,20 +200,6 @@ public class PatientReportVo {
"床号:" + this.bedNumber,
"病案号:" + this.hospitalNumber)
);
//第四栏
// Date date = null;
// if (this.reportTime > 0) {
// date = new Date();
// date.setTime(this.reportTime);
// }
rows.add(
fillRow(
"临床诊断:" + this.clinicalDiagnosis,
"","")
// "检查日期:" + (date == null ? "" : DateUtil.format(date, "yyyy-MM-dd")))
);
return rows;
}
@ -223,35 +248,57 @@ public class PatientReportVo {
this.subReport.add(score);
}
/**
* 将mmse的多层嵌套转成一层
* @param score 报告
* @param list 转换后的list
*/
public void dealMMSE(ReportScore score, List<ReportScore> list) {
if (CollectionUtil.isEmpty(score.subReport)) {
list.add(score);
} else {
score.subReport.forEach(subScore -> dealMMSE(subScore, list));
}
}
public List<PdfUtil.Row> toRow() {
int colNum = 8;
int colNum = 8;
int headNum = 2;
List<PdfUtil.Row> rows = new ArrayList<>();
if (CollectionUtil.isEmpty(subReport)) {
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell cell1 = new PdfUtil.Cell();
cell1.setContent(this.code + (StrUtil.isBlank(this.remark) ? "" : "("+this.remark+")"));
cell1.setColSpan(headNum);
PdfUtil.Cell cell2 = new PdfUtil.Cell();
cell2.setContent(this.score == null ? "" : this.score + (this.totalScore > 0 ? "/" + this.totalScore : ""));
cell2.setColSpan(colNum - headNum);
cell2.setBorderRight(1);
row.addCell(cell1);
row.addCell(cell2);
rows.add(row);
toRowOnlyTotal(colNum, headNum, rows);
} else {
String mmse = Constant.Ht.Report.MMSE;
String npi = Constant.Ht.Report.NPI;
if (mmse.equalsIgnoreCase(this.code) || npi.equalsIgnoreCase(this.code)) {
fillMmseOrNpi(headNum, rows, mmse, npi);
} else {
fillMoca(rows);
switch (this.code) {
case Constant.Ht.Report.MMSE:
case Constant.Ht.Report.NPI:
fillMmseOrNpi(headNum, rows, mmse, npi);
break;
case Constant.Ht.Report.MOCA:
fillMoca(rows);
break;
case Constant.Ht.Report.HAMD:
case Constant.Ht.Report.HAMA:
case Constant.Ht.Report.ADL:
toRowOnlyTotal(colNum, headNum, rows);
break;
default:
fillCommon(rows);
break;
}
}
toDescRow(colNum, headNum, rows);
return rows;
}
private void toDescRow(int colNum, int headNum, List<PdfUtil.Row> rows) {
if (StrUtil.isBlank(this.description)) {
return rows;
return ;
}
PdfUtil.Row descRow = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
@ -264,10 +311,156 @@ public class PatientReportVo {
// MOCA中,视直觉单独展示
fillSzj(colNum, headNum, rows);
}
private void toRowOnlyTotal(int colNum, int headNum, List<PdfUtil.Row> rows) {
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell cell1 = new PdfUtil.Cell();
cell1.setContent(this.code + (StrUtil.isBlank(this.remark) ? "" : "(" + this.remark + ")"));
cell1.setColSpan(headNum);
PdfUtil.Cell cell2 = new PdfUtil.Cell();
cell2.setContent(this.score == null ? "" : this.score + (this.totalScore > 0 ? "/" + this.totalScore : ""));
cell2.setColSpan(colNum - headNum);
cell2.setBorderRight(1);
row.addCell(cell1);
row.addCell(cell2);
rows.add(row);
}
public List<PdfUtil.Row> toSingleRow() {
int colNum = Constant.Ht.Report.HAMD.equalsIgnoreCase(code) ? 9 : 8;
int headNum = 2;
List<PdfUtil.Row> rows = new ArrayList<>();
if (CollectionUtil.isEmpty(subReport)) {
toRowOnlyTotal(colNum, headNum, rows);
} else {
String mmse = Constant.Ht.Report.MMSE;
String npi = Constant.Ht.Report.NPI;
switch (this.code) {
case Constant.Ht.Report.MMSE:
fillMMSE(rows);
break;
case Constant.Ht.Report.NPI:
fillMmseOrNpi(headNum, rows, mmse, npi);
break;
case Constant.Ht.Report.MOCA:
fillMoca(rows);
break;
default:
fillCommon(rows);
break;
}
}
toDescRow(colNum, headNum, rows);
return rows;
}
private void fillMMSE(List<PdfUtil.Row> rows) {
List<ReportScore> mmseList = new ArrayList<>();
dealMMSE(this, mmseList);
PdfUtil.Row titleRow = new PdfUtil.Row();
PdfUtil.Row scoreRow = new PdfUtil.Row();
for (int i = 0; i < mmseList.size() ; i++) {
if (i == 0) {
PdfUtil.Cell cell = new PdfUtil.Cell("简明心理状况测验(MMSE)");
cell.setRowSpan(4);
titleRow.addCell(cell);
rows.add(titleRow);
rows.add(scoreRow);
} else if (i==7){
titleRow = new PdfUtil.Row();
scoreRow = new PdfUtil.Row();
rows.add(titleRow);
rows.add(scoreRow);
}
ReportScore score = mmseList.get(i);
PdfUtil.Cell titleCell = new PdfUtil.Cell(score.getName());
titleRow.addCell(titleCell);
titleCell.setBorderRight(i == 6 ? 1 : 0);
PdfUtil.Cell scoreCell = new PdfUtil.Cell(score.score == null ? "" : score.score + (score.totalScore > 0 ? "/" + score.totalScore : ""));
scoreCell.setBorderRight(i == 6 ? 1 : 0);
scoreRow.addCell(scoreCell);
if (i == mmseList.size() - 1) {
PdfUtil.Cell titleTotalCell = new PdfUtil.Cell("总分");
titleTotalCell.setColSpan(3);
titleTotalCell.setBorderRight(1);
titleRow.addCell(titleTotalCell);
PdfUtil.Cell scoreTotalCell = new PdfUtil.Cell(this.score == null ? "" : this.score + (this.totalScore > 0 ? "/" + this.totalScore : ""));
scoreTotalCell.setColSpan(3);
scoreTotalCell.setBorderRight(1);
scoreRow.addCell(scoreTotalCell);
}
}
}
/**
* 通用项目得分
* @param rows pdf的内容
*/
private void fillCommon(List<PdfUtil.Row> rows) {
//总列数
int total = Constant.Ht.Report.HAMD.equalsIgnoreCase(code) ? 9 : 8;
// 标题
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent(this.name + "(" + this.code + ")各项目的因子分和总分");
cell.setColSpan(total);
cell.setBorderTop(0);
cell.setBorderRight(0);
cell.setBorderLeft(0);
row.addCell(cell);
rows.add(row);
// 默认两行
PdfUtil.Row row1 = new PdfUtil.Row();
PdfUtil.Row row2 = new PdfUtil.Row();
// 题目
PdfUtil.Cell firstCell1 = new PdfUtil.Cell();
firstCell1.setContent("项目");
row1.addCell(firstCell1);
PdfUtil.Cell firstCell2 = new PdfUtil.Cell();
firstCell2.setContent("计分");
row2.addCell(firstCell2);
// 子类型
int colspan = (total - 1) / (this.subReport.size() + 1);
int lastSpan = total - 1 - colspan * this.subReport.size();
this.subReport.forEach(score -> {
PdfUtil.Cell cell1 = new PdfUtil.Cell();
PdfUtil.Cell cell2 = new PdfUtil.Cell();
cell1.setContent(score.name);
cell1.setColSpan(colspan);
cell2.setContent(score.score == null ? "" : score.score + (score.totalScore > 0 ? "/" + score.totalScore : ""));
cell2.setColSpan(colspan);
row1.addCell(cell1);
row2.addCell(cell2);
});
// 总分
PdfUtil.Cell lastCell1 = new PdfUtil.Cell();
lastCell1.setContent("总分");
lastCell1.setColSpan(lastSpan);
lastCell1.setBorderRight(1);
row1.addCell(lastCell1);
PdfUtil.Cell lastCell2 = new PdfUtil.Cell();
lastCell2.setContent(this.score == null ? "" : this.score + (this.totalScore > 0 ? "/" + this.totalScore : ""));
lastCell2.setColSpan(lastSpan);
lastCell2.setBorderRight(1);
row2.addCell(lastCell2);
rows.add(row1);
rows.add(row2);
}
private void fillMmseOrNpi(int headNum, List<PdfUtil.Row> rows, String mmse, String npi) {
PdfUtil.Row row1 = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
@ -397,8 +590,8 @@ public class PatientReportVo {
//名称
PdfUtil.Cell cell1 = new PdfUtil.Cell();
cell1.setContent(name);
cell1.setBorderTop(isTop? 1 : 0);
cell1.setBorderRight(isRight? 1 : 0);
cell1.setBorderTop(isTop? 1 : null);
cell1.setBorderRight(isRight? 1 : null);
cell1.setColSpan(colspan == null || colspan.length == 0 ? 1 : colspan[0]);
row1.addCell(cell1);
@ -406,7 +599,7 @@ public class PatientReportVo {
PdfUtil.Cell cell2 = new PdfUtil.Cell();
cell2.setContent(score);
cell2.setColSpan(colspan == null || colspan.length <= 1 ? 1 : colspan[1]);
cell2.setBorderRight(isRight? 1 : 0);
cell2.setBorderRight(isRight? 1 : null);
row2.addCell(cell2);
}
}
@ -519,4 +712,27 @@ public class PatientReportVo {
@ApiModelProperty("图片路径")
private String imgPath;
}
@Data
@ApiModel("导出试题")
public static class QuestionAndAnswer{
private Long id;
@ApiModelProperty("排序")
private int sort;
@ApiModelProperty("试题")
private String question;
@ApiModelProperty("选项")
private List<Option> optionList;
}
@ApiModel("导出选项")
@Data
public static class Option{
private Long id;
@ApiModelProperty("选项内容")
private String name;
@ApiModelProperty("选中状态 0:未选中 1:选中")
private byte chooseStatus;
@ApiModelProperty("答案")
private String answer;
}
}

111
ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java

@ -7,9 +7,11 @@ import com.ccsens.ht.bean.po.HtQuestionIntroducer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.javassist.runtime.Desc;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -70,12 +72,14 @@ public class QuestionVo {
}
@Data
@ApiModel("QuestionVoReport")
@ApiModel("报告单类型")
public static class Report{
@ApiModelProperty("报告单编码")
private String code;
@ApiModelProperty("")
@ApiModelProperty("名字")
private String name;
@ApiModelProperty("补充内容")
List<QuestionRecord> codeRecords;
}
@Data
@ -113,6 +117,8 @@ public class QuestionVo {
public static class Question{
@ApiModelProperty("试题ID")
private Long id;
@ApiModelProperty("一级评测类型")
private String evaluationCode;
@ApiModelProperty("评测类型")
private String parentCode;
@ApiModelProperty("排序")
@ -137,15 +143,16 @@ public class QuestionVo {
private Integer clearTimes;
@ApiModelProperty("定时器时长")
private Integer timingLength;
@ApiModelProperty("答案路径")
private String path;
// @ApiModelProperty("答案路径")
// private String path;
@ApiModelProperty("共享答案的试题Id")
private List<Long> shareAnswerIds;
@ApiModelProperty("是否展示关联的试题的答案 0否 1是")
private byte showShareAnswer;
@ApiModelProperty("关联试题")
List<QuestionOption> relationQuestions = new ArrayList<>();
@ApiModelProperty("补充内容")
List<QuestionRecord> questionRecords;
/**
* 将HtQuestion转化成Question
* @param question
@ -176,6 +183,36 @@ public class QuestionVo {
}
}
@Data
@ApiModel("题目或code补充")
public static final class QuestionRecord{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("0:点击过程 1:自动计算 2:手动计算")
private Byte calcType;
@ApiModelProperty("显示内容")
private String showTitle;
@ApiModelProperty("显示形式")
private String showForm;
@ApiModelProperty("默认值")
private String defaultValue;
@ApiModelProperty("自动计算规则:0:答案个数 1:插入数 同一物品两次以上插入算为一个插入 2:重复数 每次重复均算为一次重复")
private Byte type;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("答案")
private List<String> answers;
}
@Data
@ApiModel("选项补充")
public static final class OptionDesc{
@ApiModelProperty("id")
private Long id;
private Byte type;
private String content;
}
@Data
@ApiModel("(可以共享答案的试题)关联的试题id")
@ -215,8 +252,13 @@ public class QuestionVo {
private String answer;
@ApiModelProperty("是否选中")
private Byte choose;
@ApiModelProperty("选项补充")
private List<OptionDesc> optionDescList;
}
@Data
@ApiModel("QuestionVoIntroduce")
public static class Introduce {
@ -311,10 +353,27 @@ public class QuestionVo {
private Long pointId;
@ApiModelProperty("颜色")
private Integer color;
@ApiModelProperty("轨迹坐标值")
@ApiModelProperty("轨迹坐标值 x,y,time,type type:0 普通 1左 2右 3 上 4 下")
private String value;
}
@Data
@ApiModel("坐标")
public static class Coordinate {
@ApiModelProperty("横坐标")
private int x;
@ApiModelProperty("横坐标")
private int y;
public Coordinate() {
}
public Coordinate(int x, int y) {
this.x = x;
this.y = y;
}
}
@Data
@ApiModel("画板信息")
@ -343,8 +402,12 @@ public class QuestionVo {
private int lineNums;
@ApiModelProperty("最长笔画长度")
private double longLine;
@ApiModelProperty("最长笔画速度")
private double longSpeed;
@ApiModelProperty("最短笔画长度")
private double shortLine;
@ApiModelProperty("最短笔画速度")
private double shortSpeed;
@ApiModelProperty("笔画中间值")
private double centre;
@ApiModelProperty("平均每分钟画几笔")
@ -356,16 +419,41 @@ public class QuestionVo {
/*20210112新加统计数据*/
@ApiModelProperty("思考总时间(所有笔画间隔时间)")
private Long reflectOnTime;
@ApiModelProperty("落笔总时间(所有笔画绘图时间)")
private long paintTime;
@ApiModelProperty("原点坐标 x,y")
private String center;
@ApiModelProperty("中心 暂定为坐标:X,Y")
private String centreCoordinate;
@ApiModelProperty("面积 暂定均为最小外接长方形 单位为px")
private double acreage;
@ApiModelProperty("中心相对原点坐标 X,Y")
private String showCentreCoordinate;
@ApiModelProperty("重心 暂定为坐标:X,Y")
private String barycenterCoordinate;
// 上下左右应部分图片存在倒转展示的问题,前端应反向展示
@ApiModelProperty("上边距距离画板中心的距离")
private Coordinate top;
@ApiModelProperty("下边距距离画板中心的距离")
private Coordinate bottom ;
@ApiModelProperty("上边距距离画板中心的距离")
private Coordinate left;
@ApiModelProperty("下边距距离画板中心的距离")
private Coordinate right;
@ApiModelProperty("最小外接长方形面积 单位为px")
private double minRectangleAcreage;
@ApiModelProperty("最小外接圆面积 单位为px 保留两位小数")
private BigDecimal minCircleAcreage;
@ApiModelProperty("平均笔画长度")
private double aveLength;
@ApiModelProperty("平均思考时间")
private double aveReflectOnTime;
@ApiModelProperty("长笔画数量")
private int longNums;
@ApiModelProperty("长笔画数量")
@ApiModelProperty("笔画数量")
private int shortNums;
@ApiModelProperty("快速思考数量")
private int quickNums;
@ApiModelProperty("长久思考数量")
private int slowNums;
}
@Data
@ -379,5 +467,10 @@ public class QuestionVo {
private double speed;
@ApiModelProperty("时间间隔,和上一笔比较")
private long intervalDuration;
@ApiModelProperty("长度状态 0:短笔画 1:长笔画 ")
private byte lengthStatus;
@ApiModelProperty("思考时间状态 0:快速 1:迟疑")
private byte reflectOnStatus;
}
}

30
ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java

@ -1,6 +1,8 @@
package com.ccsens.ht.persist.dao;
import com.ccsens.ht.bean.dto.PatientReportDto;
import com.ccsens.ht.bean.dto.PatientReportSearchDto;
import com.ccsens.ht.bean.vo.PatientReportSearchVo;
import com.ccsens.ht.bean.vo.PatientReportVo;
import com.ccsens.ht.persist.mapper.HtPatientReportMapper;
import org.apache.ibatis.annotations.Param;
@ -24,12 +26,13 @@ public interface HtPatientReportDao extends HtPatientReportMapper {
PatientReportVo.ReprotPatient queryReportResult(@Param("id") Long id);
/**
* 根据病人报告单ID查询报告单各项相关分数
* @param id
* @param id 报告单ID
* @param report 报告单类型
*@return: com.ccsens.ht.bean.vo.PatientReportVo.ReportScore
*@Author: wuHuiJuan
*@date: 2019/11/19 11:46
*/
List<PatientReportVo.ReportScore> queryReportScore(@Param("id") Long id,@Param("rey") int rey);
List<PatientReportVo.ReportScore> queryReportScore(@Param("id") Long id,@Param("rey") int rey, @Param("report") String report);
/**
* 查询NPI的分数
@ -95,4 +98,27 @@ public interface HtPatientReportDao extends HtPatientReportMapper {
* @return
*/
List<PatientReportVo.ReportDetailAnswer> queryReportAnswer(@Param("id")Long id, @Param("evaluationCode")String evaluationCode);
/**
* 根据分数搜索报告单
* @param codes 分数
* @return 报告单
*/
List<PatientReportSearchVo.Search> search(@Param("codes") List<PatientReportSearchDto.Search> codes);
/**
* 根据病人报告单ID查询报告单各项相关分数
* @param id 报告单ID
* @param code 量表类型
* @return
*/
List<PatientReportVo.ReportScore> queryReportScore2(@Param("id") Long id, @Param("code") String code);
/**
* 查询evaluate_code = code的所有试题选项及答案
* @param id 报告单ID
* @param code code
* @return 题目
*/
List<PatientReportVo.QuestionAndAnswer> queryQuestionAndScore(@Param("id") Long id, @Param("code") String code);
}

9
ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionDao.java

@ -28,4 +28,13 @@ public interface HtQuestionDao extends HtQuestionMapper {
* 查询可以共享答案的试题id
*/
List<QuestionVo.ShareAnswer> queryShareAnswer(@Param("questionId")Long questionId, @Param("patientReportId") Long patientReportId);
/**
* 查询试题和其他记录以及其他记录的答案
* @param code evaluation_code
* @param num sort
* @param patientReportId 报告单ID
* @return 试题
*/
QuestionVo.Question queryQuestionAndRecord(@Param("code") String code, @Param("num") int num, @Param("patientReportId") Long patientReportId);
}

26
ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionOptionDescDao.java

@ -0,0 +1,26 @@
package com.ccsens.ht.persist.dao;
import com.ccsens.ht.bean.po.HtQuestionOptionDesc;
import com.ccsens.ht.persist.mapper.HtQuestionOptionDescMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @description: 选项补充
* @author: whj
* @time: 2021/4/21 0:43
*/
public interface HtQuestionOptionDescDao extends HtQuestionOptionDescMapper {
/**
* 删除指定选项的补充
* @param optionDescDelList 指定选项
*/
void delete(@Param("list") List<Long> optionDescDelList);
/**
* 批量插入
* @param optionDescList 选项补充
*/
void insertBatch(List<HtQuestionOptionDesc> optionDescList);
}

16
ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionRecordDao.java

@ -0,0 +1,16 @@
package com.ccsens.ht.persist.dao;
import com.ccsens.ht.bean.po.HtQuestionRecord;
import com.ccsens.ht.persist.mapper.HtQuestionRecordMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface HtQuestionRecordDao extends HtQuestionRecordMapper {
/**
* 批量添加试题
* @param questionRecords 试题
*/
void insertBatch(@Param("list") List<HtQuestionRecord> questionRecords);
}

15
ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionRecordOptionDao.java

@ -0,0 +1,15 @@
package com.ccsens.ht.persist.dao;
import com.ccsens.ht.bean.po.HtQuestionRecordOption;
import com.ccsens.ht.persist.mapper.HtQuestionRecordOptionMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface HtQuestionRecordOptionDao extends HtQuestionRecordOptionMapper {
/**
* 批量插入
* @param questionRecordOptions options
*/
void insertBatch(@Param("list") List<HtQuestionRecordOption> questionRecordOptions);
}

25
ht/src/main/java/com/ccsens/ht/persist/dao/HtReportDao.java

@ -1,7 +1,10 @@
package com.ccsens.ht.persist.dao;
import com.ccsens.ht.bean.po.HtReport;
import com.ccsens.ht.bean.vo.PatientReportSearchVo;
import com.ccsens.ht.bean.vo.QuestionVo;
import com.ccsens.ht.persist.mapper.HtReportMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -28,4 +31,26 @@ public interface HtReportDao extends HtReportMapper {
*@date: 2019/11/19 10:10
*/
List<HtReport> queryReportShow();
/**
* 查询所有下级菜单和是否有试题
* @param parentCode 父code
* @return 搜索条件
*/
List<PatientReportSearchVo.SearchParam> queryParam(@Param("parentCode") String parentCode);
/**
* 查询指定等级的报告单code
* @param type type
* @return code
*/
List<String> queryCode(@Param("type") byte type);
/**
* 查询报告单和记录
* @param code code
* @param patientReportId patientReportId
* @return report+record
*/
QuestionVo.Report queryReportAndRecord(@Param("code") String code, @Param("patientReportId") Long patientReportId);
}

30
ht/src/main/java/com/ccsens/ht/persist/mapper/HtPatientReportRecordDescMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ht.persist.mapper;
import com.ccsens.ht.bean.po.HtPatientReportRecordDesc;
import com.ccsens.ht.bean.po.HtPatientReportRecordDescExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface HtPatientReportRecordDescMapper {
long countByExample(HtPatientReportRecordDescExample example);
int deleteByExample(HtPatientReportRecordDescExample example);
int deleteByPrimaryKey(Long id);
int insert(HtPatientReportRecordDesc record);
int insertSelective(HtPatientReportRecordDesc record);
List<HtPatientReportRecordDesc> selectByExample(HtPatientReportRecordDescExample example);
HtPatientReportRecordDesc selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") HtPatientReportRecordDesc record, @Param("example") HtPatientReportRecordDescExample example);
int updateByExample(@Param("record") HtPatientReportRecordDesc record, @Param("example") HtPatientReportRecordDescExample example);
int updateByPrimaryKeySelective(HtPatientReportRecordDesc record);
int updateByPrimaryKey(HtPatientReportRecordDesc record);
}

30
ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionOptionDescMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ht.persist.mapper;
import com.ccsens.ht.bean.po.HtQuestionOptionDesc;
import com.ccsens.ht.bean.po.HtQuestionOptionDescExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface HtQuestionOptionDescMapper {
long countByExample(HtQuestionOptionDescExample example);
int deleteByExample(HtQuestionOptionDescExample example);
int deleteByPrimaryKey(Long id);
int insert(HtQuestionOptionDesc record);
int insertSelective(HtQuestionOptionDesc record);
List<HtQuestionOptionDesc> selectByExample(HtQuestionOptionDescExample example);
HtQuestionOptionDesc selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") HtQuestionOptionDesc record, @Param("example") HtQuestionOptionDescExample example);
int updateByExample(@Param("record") HtQuestionOptionDesc record, @Param("example") HtQuestionOptionDescExample example);
int updateByPrimaryKeySelective(HtQuestionOptionDesc record);
int updateByPrimaryKey(HtQuestionOptionDesc record);
}

30
ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionRecordMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ht.persist.mapper;
import com.ccsens.ht.bean.po.HtQuestionRecord;
import com.ccsens.ht.bean.po.HtQuestionRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface HtQuestionRecordMapper {
long countByExample(HtQuestionRecordExample example);
int deleteByExample(HtQuestionRecordExample example);
int deleteByPrimaryKey(Long id);
int insert(HtQuestionRecord record);
int insertSelective(HtQuestionRecord record);
List<HtQuestionRecord> selectByExample(HtQuestionRecordExample example);
HtQuestionRecord selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") HtQuestionRecord record, @Param("example") HtQuestionRecordExample example);
int updateByExample(@Param("record") HtQuestionRecord record, @Param("example") HtQuestionRecordExample example);
int updateByPrimaryKeySelective(HtQuestionRecord record);
int updateByPrimaryKey(HtQuestionRecord record);
}

30
ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionRecordOptionMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ht.persist.mapper;
import com.ccsens.ht.bean.po.HtQuestionRecordOption;
import com.ccsens.ht.bean.po.HtQuestionRecordOptionExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface HtQuestionRecordOptionMapper {
long countByExample(HtQuestionRecordOptionExample example);
int deleteByExample(HtQuestionRecordOptionExample example);
int deleteByPrimaryKey(Long id);
int insert(HtQuestionRecordOption record);
int insertSelective(HtQuestionRecordOption record);
List<HtQuestionRecordOption> selectByExample(HtQuestionRecordOptionExample example);
HtQuestionRecordOption selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") HtQuestionRecordOption record, @Param("example") HtQuestionRecordOptionExample example);
int updateByExample(@Param("record") HtQuestionRecordOption record, @Param("example") HtQuestionRecordOptionExample example);
int updateByPrimaryKeySelective(HtQuestionRecordOption record);
int updateByPrimaryKey(HtQuestionRecordOption record);
}

15
ht/src/main/java/com/ccsens/ht/service/IImportService.java

@ -1,6 +1,7 @@
package com.ccsens.ht.service;
import java.io.File;
import java.util.List;
/**
* @program: ptpro
@ -30,13 +31,14 @@ public interface IImportService {
String importTitle(File file, int sheetIndex) throws Exception;
/**
*@Description:导入测评报告单分类
*@param file
*@param sheetIndex
*@return: void
*@Author: wuhuijuan
*@date: 2019/10/21 15:08
* @return 报告单类型
* @param file 文件
* @param index report是第几个sheet
*/
void importReport(File file, int sheetIndex) throws Exception;
List<String> importReport(File file, int index) throws Exception;
/**
*@Description:导入测评报告单分类
@ -47,4 +49,11 @@ public interface IImportService {
*@date: 2019/10/21 15:08
*/
void importQuestion(File file, String type) throws Exception;
/**
* 导入报告单其他记录
* @param excelFile excel
* @param sheetIndex 第几个
*/
void importReportRecord(File excelFile, int sheetIndex) throws Exception;
}

24
ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java

@ -1,11 +1,14 @@
package com.ccsens.ht.service;
import com.ccsens.ht.bean.dto.PatientReportDto;
import com.ccsens.ht.bean.dto.PatientReportSearchDto;
import com.ccsens.ht.bean.po.HtDoctor;
import com.ccsens.ht.bean.vo.PatientReportSearchVo;
import com.ccsens.ht.bean.vo.PatientReportVo;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.JsonResponse;
import com.github.pagehelper.PageInfo;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.IOException;
import java.util.List;
@ -142,4 +145,25 @@ public interface IPatientReportService {
List<PatientReportVo.ReportDetailAnswer> queryReportAnswer(PatientReportDto.QueryReportAnswer param, Long userId);
/**
* 查询报告单的搜索条件
* @param param 父code
* @return 搜索条件
*/
List<PatientReportSearchVo.SearchParam> searchParam(PatientReportSearchDto.SearchParam param);
/**
* 搜索报告单
* @param param 搜索列表
* @return 报告单
*/
PageInfo<PatientReportSearchVo.Search> search(PatientReportSearchDto.SearchList param);
/**
* 导出指定报告单
* @param param 指定报告单类型
* @param userId userId
* @return path
*/
String export(PatientReportDto.ExportCode param, Long userId);
}

278
ht/src/main/java/com/ccsens/ht/service/ImportService.java

@ -3,21 +3,26 @@ package com.ccsens.ht.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ht.bean.po.*;
import com.ccsens.ht.persist.dao.*;
import com.ccsens.ht.uitl.Constant;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.PoiUtil;
import com.ccsens.util.PropUtil;
import com.ccsens.util.StringUtil;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.io.File;
import java.util.*;
@ -31,22 +36,29 @@ import java.util.*;
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class ImportService implements IImportService {
@Autowired
@Resource
private Snowflake snowflake;
@Autowired
@Resource
private HtTitleDao htTitleDao;
@Autowired
@Resource
private HtPositionDao htPositionDao;
@Autowired
@Resource
private HtReportDao htReportDao;
@Autowired
@Resource
private HtQuestionDao htQuestionDao;
@Autowired
@Resource
private HtQuestionOptionDao htQuestionOptionDao;
@Autowired
@Resource
private HtQuestionIntroducerDao htQuestionIntroducerDao;
@Autowired
@Resource
private HtQuestionScoringRuleDao htQuestionScoringRuleDao;
@Resource
private HtQuestionRecordDao htQuestionRecordDao;
@Resource
private HtQuestionRecordOptionDao htQuestionRecordOptionDao;
@Resource
private HtQuestionOptionDescDao htQuestionOptionDescDao;
@Override
public String importPosition(File file, int sheetIndex) throws Exception {
@ -189,7 +201,8 @@ public class ImportService implements IImportService {
}
@Override
public void importReport(File file, int sheetIndex) throws Exception{
public List<String> importReport(File file, int sheetIndex) throws Exception{
List<String> codes = new ArrayList<>();
List<Object[]> reports = PoiUtil.readExce(file, sheetIndex, null,1, false);
log.info("导入职务,读取数据完成");
List<HtReport> reportList = new ArrayList<>();
@ -200,10 +213,14 @@ public class ImportService implements IImportService {
}
HtReport report = initReport(objs);
reportList.add(report);
if (report.getType() == Constant.Ht.Report.TYPE_EVALUATION) {
codes.add(report.getCode());
}
}
if (!reportList.isEmpty()) {
htReportDao.insertBatch(reportList);
}
return codes;
}
@Override
@ -211,18 +228,51 @@ public class ImportService implements IImportService {
log.info("导入试题参数:{}, {}", file, type);
List<String> types = new ArrayList<>();
if (Constant.Ht.Question.ALL.equalsIgnoreCase(type)) {
types.addAll(Constant.Ht.Question.QUESTION_TYPE);
types.addAll(htReportDao.queryCode(Constant.Ht.Report.TYPE_EVALUATION));
} else {
types.add(type);
}
log.info("导入试题类型:{}", types);
StringBuilder builder = new StringBuilder();
for (String sheetName: types) {
List<Object[]> questions = PoiUtil.readExce(file, -1, sheetName,1, true);
saveQuestions(questions, sheetName);
}
}
@Override
public void importReportRecord(File excelFile, int sheetIndex) throws Exception {
List<Object[]> reports = PoiUtil.readExce(excelFile, sheetIndex, null,1, false);
log.info("导入报告单其他记录,读取数据完成");
List<HtReport> htReports = htReportDao.selectByExample(new HtReportExample());
Map<String, Long> reportMap = new HashMap<>();
htReports.forEach(htReport -> reportMap.put(htReport.getCode(), htReport.getId()));
log.info("报告单类型查询完成");
List<HtQuestionRecord> reportRecordList = new ArrayList<>();
List<HtQuestionRecordOption> optionList = new ArrayList<>();
for (Object[] objs: reports) {
if (!pageData(objs)) {
log.info("测评报告单数据不足,跳转下一行");
continue;
}
Long id = reportMap.get(String.valueOf(objs[0]));
if (id == null) {
log.info("报告单类型不存在:{}", objs[0]);
throw new BaseException(CodeEnum.PARAM_ERROR);
}
HtQuestionRecord record = initRecord(objs, id , optionList, Constant.Ht.QuestionRecord.RECORD_TYPE_CODE, 1);
reportRecordList.add(record);
}
if (!reportRecordList.isEmpty()) {
htQuestionRecordDao.insertBatch(reportRecordList);
}
if (!optionList.isEmpty()) {
htQuestionRecordOptionDao.insertBatch(optionList);
}
}
/**
* 保存试题
* */
@ -231,6 +281,10 @@ public class ImportService implements IImportService {
List<HtQuestionOption> optionList = new ArrayList<>();
List<HtQuestionIntroducer> introduceList = new ArrayList<>();
List<HtQuestionScoringRule> ruleList = new ArrayList<>();
List<HtQuestionRecord> questionRecordList = new ArrayList<>();
List<HtQuestionRecordOption> questionRecordOptionList = new ArrayList<>();
List<HtQuestionOptionDesc> optionDescList = new ArrayList<>();
List<Long> optionDescDelList = new ArrayList<>();
//记录那类型题是关联试题
Map<String, String> parentCode = new HashMap<>();
for(Object[] objs : questions) {
@ -241,48 +295,7 @@ public class ImportService implements IImportService {
int sort = objs.length > 3 && StringUtil.checkNum(String.valueOf(objs[3]), false) ? Integer.parseInt(String.valueOf(objs[3])) : 1;
String type = String.valueOf(objs[0]);
switch (type) {
case "题目" :
HtQuestion question = initQuestion(objs, evaluationCode, sort);
if (StrUtil.isNotEmpty(question.getRelationCode())) {
String[] split = question.getRelationCode().split("[,,]");
for (String code: split) {
parentCode.put(code, question.getParentCode());
}
}
if (parentCode.containsKey(question.getParentCode())) {
question.setEvaluationCode(parentCode.get(question.getParentCode()));
}
questionList.add(question);
break;
case "选项" :
if (questionList.isEmpty()) {
break;
}
HtQuestionOption option = initOption(objs, questionList.get(questionList.size()-1).getId(), sort);
optionList.add(option);
break;
case "解析" :
if (questionList.isEmpty()) {
break;
}
HtQuestionIntroducer introduce = initIntroduce(objs, questionList.get(questionList.size()-1).getId(), sort);
introduceList.add(introduce);
break;
case "规则" :
if (questionList.isEmpty()) {
break;
}
HtQuestionScoringRule rule = initRule(objs, questionList.get(questionList.size() - 1).getId());
ruleList.add(rule);
break;
default:
log.info("{}类型未知,不解析", type);
break;
}
initData(evaluationCode, questionList, optionList, introduceList, ruleList, questionRecordList, questionRecordOptionList, optionDescList, optionDescDelList, parentCode, objs, sort, type);
}
if (!questionList.isEmpty()) {
@ -297,8 +310,130 @@ public class ImportService implements IImportService {
if (!ruleList.isEmpty()) {
htQuestionScoringRuleDao.insertBatch(ruleList);
}
if (!questionRecordList.isEmpty()) {
htQuestionRecordDao.insertBatch(questionRecordList);
}
if (!questionRecordOptionList.isEmpty()) {
htQuestionRecordOptionDao.insertBatch(questionRecordOptionList);
}
if (!optionDescDelList.isEmpty()) {
htQuestionOptionDescDao.delete(optionDescDelList);
}
if (!optionDescList.isEmpty()) {
htQuestionOptionDescDao.insertBatch(optionDescList);
}
}
/**
* 试题导入将obj[] 转换成 对应的data
*/
private void initData(String evaluationCode, List<HtQuestion> questionList, List<HtQuestionOption> optionList, List<HtQuestionIntroducer> introduceList, List<HtQuestionScoringRule> ruleList, List<HtQuestionRecord> questionRecordList, List<HtQuestionRecordOption> questionRecordOptionList, List<HtQuestionOptionDesc> optionDescList, List<Long> optionDescDelList, Map<String, String> parentCode, Object[] objs, int sort, String type) {
switch (type) {
case Constant.Import.EVALUATION_QUESTION :
HtQuestion question = initQuestion(objs, evaluationCode, sort);
question.setEvaluationCode(parentCode.getOrDefault(question.getParentCode(), question.getEvaluationCode()));
questionList.add(question);
break;
case Constant.Import.EVALUATION_RELATION:
HtQuestion relationQuestion = initQuestion(objs, evaluationCode, sort);
relationQuestion.setEvaluationCode(parentCode.getOrDefault(relationQuestion.getParentCode(), relationQuestion.getEvaluationCode()));
if (CollectionUtil.isNotEmpty(questionList)) {
HtQuestion prev = questionList.get(questionList.size() - 1);
if (prev.getRelationId() != null && prev.getRelationId() >0) {
relationQuestion.setRelationId(prev.getRelationId());
} else {
relationQuestion.setRelationId(prev.getId());
}
}
questionList.add(relationQuestion);
break;
case Constant.Import.EVALUATION_OPTION :
if (questionList.isEmpty()) {
break;
}
HtQuestionOption option = initOption(objs, questionList.get(questionList.size()-1).getId(), sort, optionDescList, optionDescDelList);
optionList.add(option);
break;
case Constant.Import.EVALUATION_PARSE :
if (questionList.isEmpty()) {
break;
}
HtQuestionIntroducer introduce = initIntroduce(objs, questionList.get(questionList.size()-1).getId(), sort);
introduceList.add(introduce);
break;
case Constant.Import.EVALUATION_RULE :
if (questionList.isEmpty()) {
break;
}
HtQuestionScoringRule rule = initRule(objs, questionList.get(questionList.size() - 1).getId());
ruleList.add(rule);
break;
case Constant.Import.EVALUATION_RECORD:
if (questionList.isEmpty()) {
break;
}
HtQuestionRecord record = initRecord(objs, questionList.get(questionList.size() - 1).getId(), questionRecordOptionList, Constant.Ht.QuestionRecord.RECORD_TYPE_QUESTION, (byte)3);
questionRecordList.add(record);
break;
default:
log.info("{}类型未知,不解析", type);
break;
}
}
/**
* 封装record option
* @param objs 一列
* @param id 试题ID
* @param questionRecordOptions record选项
* @return record
*/
private HtQuestionRecord initRecord(Object[] objs, Long id, List<HtQuestionRecordOption> questionRecordOptions, byte recordType, int sortIndex ) {
HtQuestionRecord record = new HtQuestionRecord();
String content = (String)objs[2];
JSONObject json = JSONObject.parseObject(content);
BeanUtils.copyProperties(json, record);
record.setRecordType(recordType);
// 判断是否存在,设置id
int sort = StringUtil.checkNum(String.valueOf(objs[sortIndex]), false) ?
Integer.parseInt(String.valueOf(objs[sortIndex])) : Constant.Ht.Question.RULE_TYPE_DEFAULT;
record.setSort(sort);
HtQuestionRecordExample recordExample = new HtQuestionRecordExample();
recordExample.createCriteria().andQuestionIdEqualTo(id).andSortEqualTo(sort);
List<HtQuestionRecord> questionRecords = htQuestionRecordDao.selectByExample(recordExample);
if (CollectionUtil.isEmpty(questionRecords)) {
record.setId(snowflake.nextId());
} else {
record.setId(questionRecords.get(0).getId());
}
log.info("添加record:{}", record);
if (!json.containsKey(Constant.Import.RELATION_OPTION)) {
return record;
}
log.info("追加选项{}", json.get(Constant.Import.RELATION_OPTION));
JSONArray options = json.getJSONArray(Constant.Import.RELATION_OPTION);
for (Object obj: options) {
HtQuestionRecordOption recordOption = JSONObject.parseObject(((JSONObject) obj).toJSONString(), HtQuestionRecordOption.class);
if (CollectionUtil.isEmpty(questionRecords)) {
recordOption.setId(snowflake.nextId());
questionRecordOptions.add(recordOption);
continue;
}
HtQuestionRecordOptionExample optionExample = new HtQuestionRecordOptionExample();
optionExample.createCriteria().andQuestionRecordIdEqualTo(questionRecords.get(0).getId())
.andSortEqualTo(recordOption.getSort());
List<HtQuestionRecordOption> optionList = htQuestionRecordOptionDao.selectByExample(optionExample);
if (CollectionUtil.isNotEmpty(optionList)) {
recordOption.setId(optionList.get(0).getId());
} else {
recordOption.setId(snowflake.nextId());
}
questionRecordOptions.add(recordOption);
}
return record;
}
private HtQuestionScoringRule initRule(Object[] objs, Long questionId) {
@ -340,8 +475,14 @@ public class ImportService implements IImportService {
return introduce;
}
/**初始化选项*/
private HtQuestionOption initOption(Object[] objs, Long questionId, int sort) throws Exception {
/**初始化选项
* @param objs 表格一行
* @param questionId 试题ID
* @param sort 排序
* @param optionDescList 记录其他补充
* @return 选项
*/
private HtQuestionOption initOption(Object[] objs, Long questionId, int sort, List<HtQuestionOptionDesc> optionDescList, List<Long> optionIds) {
HtQuestionOptionExample example = new HtQuestionOptionExample();
@ -363,7 +504,28 @@ public class ImportService implements IImportService {
option.setQuestionId(questionId);
option.setSort(sort);
option.setScore(option.getScore() == null ? Constant.Ht.NUMBER_DEFAULT_BIGDECIMAL : option.getScore());
// 判断有无补充
JSONObject json = JSONObject.parseObject(String.valueOf(objs[2]));
if (json.containsKey(Constant.Import.OPTION_DESC)) {
log.info("选项补充:{}",json.get(Constant.Import.OPTION_DESC));
// 删除原有的补充
if (CollectionUtil.isNotEmpty(options)) {
// 统计选项是否有补充
HtQuestionOptionDescExample descExample = new HtQuestionOptionDescExample();
descExample.createCriteria().andOptionIdEqualTo(option.getId());
long count = htQuestionOptionDescDao.countByExample(descExample);
if (count > 0) {
optionIds.add(options.get(0).getId());
}
}
JSONArray descArr = json.getJSONArray(Constant.Import.OPTION_DESC);
for (Object obj: descArr) {
HtQuestionOptionDesc desc = JSONObject.parseObject(JSON.toJSONString(obj), HtQuestionOptionDesc.class);
desc.setId(snowflake.nextId());
optionDescList.add(desc);
}
}
log.info("导入选项:{}", option);
return option;
}
@ -512,7 +674,7 @@ public class ImportService implements IImportService {
report.setParentCode(objs.length > 2 && !StringUtils.isEmpty(objs[2]) ? (String) objs[2] : Constant.Ht.STRING_DEFAULT);
report.setDescription(objs.length > 3 && !StringUtils.isEmpty(objs[3]) ? (String) objs[3] : Constant.Ht.STRING_DEFAULT);
report.setTotalScore(objs.length > 4 && StringUtil.checkNum(String.valueOf(objs[4]), false) ? Integer.parseInt(String.valueOf(objs[4])) : Constant.Ht.NUMBER_DEFAULT);
report.setType(objs.length > 5 && Constant.Ht.Report.TYPE.get((String)objs[5])!=null ? Constant.Ht.Report.TYPE.get((String)objs[5]) : Constant.Ht.NUMBER_DEFAULT);
report.setType(objs.length > 5 && Constant.Ht.Report.TYPE.get(objs[5])!=null ? Constant.Ht.Report.TYPE.get((String)objs[5]) : Constant.Ht.NUMBER_DEFAULT);
report.setIsShow(objs.length>6 && StringUtil.checkNum(String.valueOf(objs[6]), false) ? Byte.parseByte(String.valueOf(objs[6])) : Constant.Ht.NUMBER_DEFAULT);
report.setRemark(objs.length>7 && !StringUtils.isEmpty(objs[7]) ? (String) objs[7] : Constant.Ht.STRING_DEFAULT);
report.setSort(objs.length > 8 && StringUtil.checkNum(String.valueOf(objs[8]), false) ? Integer.parseInt(String.valueOf(objs[8])) : Constant.Ht.NUMBER_DEFAULT);

349
ht/src/main/java/com/ccsens/ht/service/PatientReportService.java

@ -7,11 +7,14 @@ import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.ht.bean.dto.PatientReportDto;
import com.ccsens.ht.bean.dto.PatientReportSearchDto;
import com.ccsens.ht.bean.po.*;
import com.ccsens.ht.bean.vo.PatientReportSearchVo;
import com.ccsens.ht.bean.vo.PatientReportVo;
import com.ccsens.ht.persist.dao.HtDoctorDao;
import com.ccsens.ht.persist.dao.HtPatientReportDao;
import com.ccsens.ht.persist.dao.HtPositionDao;
import com.ccsens.ht.persist.dao.HtReportDao;
import com.ccsens.ht.persist.mapper.HtPatientFollowUpMapper;
import com.ccsens.ht.persist.mapper.HtPatientMapper;
import com.ccsens.ht.persist.mapper.HtPatientReportRecordMapper;
@ -22,7 +25,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -46,7 +48,7 @@ import java.util.concurrent.atomic.AtomicReference;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class PatientReportService implements IPatientReportService {
@Autowired
@Resource
private Snowflake snowflake;
@Resource
private HtDoctorDao htDoctorDao;
@ -60,6 +62,8 @@ public class PatientReportService implements IPatientReportService {
private HtPatientReportRecordMapper htPatientReportRecordMapper;
@Resource
private HtPatientFollowUpMapper htPatientFollowUpMapper;
@Resource
private HtReportDao htReportDao;
@Override
public JsonResponse<PatientReportVo.Generate> generatePatientReport(PatientReportDto.Generate generate, Long userId) {
@ -112,7 +116,7 @@ public class PatientReportService implements IPatientReportService {
example.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS);
List<HtDoctor> doctors = htDoctorDao.selectByExample(example);
if (CollectionUtils.isEmpty(doctors)) {
log.info("{}医生信息尚未审核通过");
log.info("{}医生信息尚未审核通过", userId);
return CodeEnum.AUDIT_NOT_PASS;
}
HtDoctor doctor = doctors.get(0);
@ -146,6 +150,7 @@ public class PatientReportService implements IPatientReportService {
copy.setUrl(Constant.Ht.STRING_DEFAULT);
copy.setQrCodeUrl(Constant.Ht.STRING_DEFAULT);
copy.setCompleteStatus(Constant.Ht.Report.COMPLETE_OK);
copy.setShowStatus(Constant.Ht.Report.SHOW_HISTORY);
htPatientReportDao.updateByPrimaryKeySelective(copy);
log.info("成功编辑报告单信息");
HtPatientReportRecord record = new HtPatientReportRecord();
@ -218,54 +223,25 @@ public class PatientReportService implements IPatientReportService {
//查询报告单信息和病人信息
PatientReportVo.ReprotPatient reportPatient = htPatientReportDao.queryReportResult(queryDetail.getId());
//查询报告单分数
List<PatientReportVo.ReportScore> reportScore = htPatientReportDao.queryReportScore(queryDetail.getId(),queryDetail.getRey());
List<PatientReportVo.ReportScore> reportScore = htPatientReportDao.queryReportScore(queryDetail.getId(), queryDetail.getRey(), queryDetail.getReport());
long reportId = queryDetail.getId();
//重新封装报告单信息
Map<String, PatientReportVo.ReportScore> map = new HashMap<>(32);
List<PatientReportVo.ReportScore> scores = new ArrayList<>();
reportScore.forEach(score -> {
if(ObjectUtil.isNotNull(score.getScore())){
if(BigDecimal.valueOf(score.getScore().intValue()).compareTo(score.getScore()) == 0){
score.setScore(score.getScore().setScale(0,BigDecimal.ROUND_HALF_UP));
}
}
map.put(score.getCode(), score);
//测评类(MOCA等)
if (Constant.Ht.Report.TYPE_EVALUATION.equals(score.getType())) {
String specialCode = "NPI";
if (specialCode.equalsIgnoreCase(score.getCode())) {
initNPI(queryDetail, score);
}
scores.add(score);
} else {
log.info("score:{}", score);
map.get(score.getParentCode()).addSub(score);
}
});
scores.forEach(score -> {
if (Constant.Ht.Report.MOCA_SJZ.equalsIgnoreCase(score.getCode())) {
return;
}
sumScore(score);
});
List<PatientReportVo.ReportScore> scores = getReportScores(reportScore, reportId);
detail.setPatient(reportPatient);
detail.setScores(scores);
return detail;
}
private void initNPI(PatientReportDto.QueryDetail queryDetail, PatientReportVo.ReportScore score) {
List<Map<String, Object>> list = htPatientReportDao.queryNPIScore(queryDetail.getId());
private void initNPI(long id, PatientReportVo.ReportScore score) {
List<Map<String, Object>> list = htPatientReportDao.queryNPIScore(id);
Map<String,Object> npiScore = new HashMap<>();
list.forEach(map -> {
npiScore.put((String)map.get("optionName"), map.get("score"));
});
list.forEach(map -> npiScore.put((String)map.get("optionName"), map.get("score")));
PatientReportVo.ReportScore carer = new PatientReportVo.ReportScore();
carer.setCode("carer");
carer.setName("照顾者");
carer.setTotalScore(-1);
carer.setScore(npiScore == null || npiScore.get("carer") == null ? null : ((BigDecimal)npiScore.get("carer")));
carer.setScore(npiScore.get("carer") == null ? null : ((BigDecimal)npiScore.get("carer")));
if(ObjectUtil.isNotNull(carer.getScore())){
carer.setScore(carer.getScore().setScale(0,BigDecimal.ROUND_HALF_UP));
}
@ -276,7 +252,7 @@ public class PatientReportService implements IPatientReportService {
patient.setCode("result");
patient.setName("患者");
patient.setTotalScore(-1);
patient.setScore(npiScore == null || npiScore.get("result") == null ? null : ((BigDecimal) npiScore.get("result")));
patient.setScore(npiScore.get("result") == null ? null : ((BigDecimal) npiScore.get("result")));
if(ObjectUtil.isNotNull(patient.getScore())){
patient.setScore(patient.getScore().setScale(0,BigDecimal.ROUND_HALF_UP));
}
@ -326,27 +302,24 @@ public class PatientReportService implements IPatientReportService {
/**
* 为上级求和
* @param score
*@return: java.lang.Integer
*@Author: wuHuiJuan
* @param score 分数
*@author wuHuiJuan
*@date: 2019/11/19 15:42
*/
private BigDecimal sumScore(PatientReportVo.ReportScore score){
AtomicReference<BigDecimal> sum = new AtomicReference<>(score.getScore() == null ? BigDecimal.valueOf(0) : score.getScore());
AtomicBoolean hasAdd = new AtomicBoolean(false);
if (!CollectionUtils.isEmpty(score.getSubReport())) {
score.getSubReport().forEach(sub -> {
sum.updateAndGet(v -> {
BigDecimal sumScore = sumScore(sub);
if (sumScore== null) {
return v;
}
hasAdd.set(true);
// return v += sumScore;
v = v.add(sumScore);
score.getSubReport().forEach(sub -> sum.updateAndGet(v -> {
BigDecimal sumScore = sumScore(sub);
if (sumScore== null) {
return v;
});
});
}
hasAdd.set(true);
// return v += sumScore;
v = v.add(sumScore);
return v;
}));
} else {
if (StringUtil.isNotEmpty(score.getRemark()) && score.getRemark().matches(Constant.Ht.Report.IGNORE_SCORE)) {
return score.getScore() == null ? null : BigDecimal.valueOf(0);
@ -382,9 +355,7 @@ public class PatientReportService implements IPatientReportService {
throw new BaseException(CodeEnum.REPORT_NOT_FOUND);
}
List<PdfUtil.Row> content = new ArrayList<>();
detail.getScores().forEach(reportScore -> {
content.addAll(reportScore.toRow());
});
detail.getScores().forEach(reportScore -> content.addAll(reportScore.toRow()));
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell initWordCell = addCell(row, "初步印象", 2, 2);
initWordCell.setHeight(PdfUtil.Cell.defaultHeight * 2);
@ -393,16 +364,9 @@ public class PatientReportService implements IPatientReportService {
initImplCell.setBorderRight(1);
initImplCell.setCenter(false);
content.add(row);
PdfUtil.Row row2 = new PdfUtil.Row();
PdfUtil.Cell doctorCell = addCell(row2, "测评员:", 4, 1, 0);
doctorCell.setBorderBottom(null);
doctorCell.setBorderLeft(null);
PdfUtil.Cell dateCell = addCell(row2, "报告日期:", 4, 1, 0);
dateCell.setBorderBottom(null);
dateCell.setBorderLeft(null);
content.add(row2);
initLast(content, 8);
String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, detail.getPatient().toPdfRow(), content, new PdfUtil.Margin());
String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, new PdfUtil.Margin(), detail.getPatient().toPdfRow(), content);
report.setUrl(path);
htPatientReportDao.updateByPrimaryKeySelective(report);
log.info("生成文件路径:{}", path);
@ -426,8 +390,7 @@ public class PatientReportService implements IPatientReportService {
@Override
public PatientReportVo.Complete checkComplete(Long userId) {
PatientReportVo.Complete complete = htPatientReportDao.checkComplete(userId);
return complete;
return htPatientReportDao.checkComplete(userId);
}
@Override
@ -486,9 +449,7 @@ public class PatientReportService implements IPatientReportService {
log.info("未查询到报告单");
return new PageInfo<>(reports);
}
reports.forEach(report -> {
report.setAuthority((byte)1);
});
reports.forEach(report -> report.setAuthority((byte)1));
return new PageInfo<>(reports);
}
@ -526,7 +487,7 @@ public class PatientReportService implements IPatientReportService {
}
byte prevAge = ages.get(ages.size() - 1);
PatientReportVo.AgeAndSexGroup prevGroup = groups.get(groups.size()-1);
byte nowAge = ageAndSex.getAgeLevel().byteValue();
byte nowAge = ageAndSex.getAgeLevel();
if (prevAge == nowAge) {
fillBySex(ageAndSex, prevGroup);
} else {
@ -559,8 +520,7 @@ public class PatientReportService implements IPatientReportService {
private void fillBySex(PatientReportVo.AgeAndSex ageAndSex, PatientReportVo.AgeAndSexGroup group) {
if (ageAndSex.getAgeLevel() == null) {
log.info("性别不确定");
return;
} else if (ageAndSex.getSex().byteValue() == Constant.Ht.SEX_MAN) {
} else if (ageAndSex.getSex()== Constant.Ht.SEX_MAN) {
group.setMan(ageAndSex);
} else {
group.setWoman(ageAndSex);
@ -577,5 +537,246 @@ public class PatientReportService implements IPatientReportService {
return htPatientReportDao.queryReportAnswer(param.getId(),param.getEvaluationCode());
}
@Override
public List<PatientReportSearchVo.SearchParam> searchParam(PatientReportSearchDto.SearchParam param) {
List<PatientReportSearchVo.SearchParam> list = htReportDao.queryParam(param.getParentCode());
if (CollectionUtil.isEmpty(list)) {
return list;
}
Map<String, PatientReportSearchVo.SearchParam> map = new HashMap<>();
List<PatientReportSearchVo.SearchParam> nodes = new ArrayList<>();
list.forEach(searchParam -> {
if (param.getParentCode().equals(searchParam.getParentCode())) {
nodes.add(searchParam);
} else {
PatientReportSearchVo.SearchParam parent = map.get(searchParam.getParentCode());
parent.getChildren().add(searchParam);
}
map.put(searchParam.getCode(), searchParam);
});
return nodes;
}
@Override
public PageInfo<PatientReportSearchVo.Search> search(PatientReportSearchDto.SearchList param) {
PageHelper.startPage(param.getPageNum(), param.getPageSize());
List<PatientReportSearchVo.Search> list = htPatientReportDao.search(param.getCodes());
return new PageInfo<>(list);
}
@Override
public String export(PatientReportDto.ExportCode param, Long userId) {
// 详细试题
List<PdfUtil.Row> questionTable = new ArrayList<>();
if (Constant.Export.TITLE_MAP.containsKey(param.getCode())) {
List<PatientReportVo.QuestionAndAnswer> questionAndAnswerList = htPatientReportDao.queryQuestionAndScore(param.getId(), param.getCode());
// 几列试题
int cols = questionAndAnswerList.size() > 20 ? 2 : 1;
// 题目占几行
int questionSpan = 2;
// 表格头
initQuestionTitle(param.getCode(), cols, questionSpan, questionTable);
// 表格体
int rowNum = cols > 1 ? (questionAndAnswerList.size() + 1)/ 2 : questionAndAnswerList.size();
int optionSize = Constant.Export.TITLE_MAP.get(param.getCode()).optionList.size();
for (int i = 0; i < rowNum; i++) {
PatientReportVo.QuestionAndAnswer question = questionAndAnswerList.get(i);
PdfUtil.Row row = new PdfUtil.Row();
initQuestionBody(questionSpan, question, row, cols == 1, optionSize);
if (cols > 1) {
PatientReportVo.QuestionAndAnswer question2 = null;
if (rowNum + i < questionAndAnswerList.size()) {
question2 = questionAndAnswerList.get(rowNum + i);
}
initQuestionBody(questionSpan, question2, row, true, Constant.Export.TITLE_MAP.get(param.getCode()).optionList.size());
}
questionTable.add(row);
}
if (Constant.Ht.Report.ADL.equals(param.getCode())) {
List<PatientReportVo.ReportScore> reportScores = htPatientReportDao.queryReportScore2(param.getId(),param.getCode());
PdfUtil.Row row = new PdfUtil.Row();
addCell(row, "总分", questionSpan+1, 1);
int scoreSpan = 1+questionSpan + cols * optionSize;
String score = (reportScores.isEmpty() ? "" : reportScores.get(0).getScore() == null ? "" : reportScores.get(0).getScore().intValue()) + (reportScores.get(0).getTotalScore() > 0 ? "/" + reportScores.get(0).getTotalScore() : "");
PdfUtil.Cell scoreCell = addCell(row, score, scoreSpan, 1);
scoreCell.setBorderRight(1);
questionTable.add(row);
PdfUtil.Row tempRow = new PdfUtil.Row();
PdfUtil.Cell cell = addCell(tempRow, "仅供临床医生参考。", scoreSpan + questionSpan + 1, 1);
initLast(questionTable, scoreSpan + questionSpan + 1);
}
}
List<PdfUtil.Row> content = new ArrayList<>();
//查询报告单信息和病人信息
PatientReportVo.ReprotPatient reportPatient = htPatientReportDao.queryReportResult(param.getId());
//查询报告单分数
List<PatientReportVo.ReportScore> reportScores = htPatientReportDao.queryReportScore2(param.getId(),param.getCode());
if (!Constant.Ht.Report.ADL.equals(param.getCode())) {
getReportScores(param, content, reportScores);
}
String subHead = CollectionUtil.isEmpty(reportScores) ? "" : reportScores.get(0).getName() + "(" + reportScores.get(0).getCode() + ")报告单";
PdfUtil.Margin margin = new PdfUtil.Margin();
margin.setTop(12);
margin.setBottom(12);
margin.setLeft(36);
String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, reportPatient.getHospital(), subHead, margin , reportPatient.toPdfSimpleCodeRow(),questionTable, content);
log.info("{}报告单导出路径:{}", param, path);
return path;
}
private List<PatientReportVo.ReportScore> getReportScores(PatientReportDto.ExportCode param, List<PdfUtil.Row> content, List<PatientReportVo.ReportScore> reportScores) {
long reportId = param.getId();
//重新封装报告单信息
List<PatientReportVo.ReportScore> scores = getReportScores(reportScores, reportId);
// 分数汇总
int colNum = Constant.Ht.Report.HAMD.equalsIgnoreCase(param.getCode()) ? 9 : 8;
scores.forEach(reportScore -> content.addAll(reportScore.toSingleRow()));
PdfUtil.Row row = new PdfUtil.Row();
int titleSpan = 2;
PdfUtil.Cell initWordCell = addCell(row, "初步印象", titleSpan, 2);
initWordCell.setHeight(PdfUtil.Cell.defaultHeight * 2);
String initialImpression = "";
PdfUtil.Cell initImplCell = addCell(row, initialImpression, colNum - titleSpan, 2);
initImplCell.setHeight(PdfUtil.Cell.defaultHeight * 2);
initImplCell.setBorderRight(1);
initImplCell.setCenter(false);
content.add(row);
PdfUtil.Row tempRow = new PdfUtil.Row();
PdfUtil.Cell cell = addCell(tempRow, "仅供临床医生参考。", colNum, 1);
initLast(content, colNum);
return scores;
}
private List<PatientReportVo.ReportScore> getReportScores(List<PatientReportVo.ReportScore> reportScores, long reportId) {
Map<String, PatientReportVo.ReportScore> map = new HashMap<>(32);
List<PatientReportVo.ReportScore> scores = new ArrayList<>();
reportScores.forEach(score -> {
if (ObjectUtil.isNotNull(score.getScore())) {
if (BigDecimal.valueOf(score.getScore().intValue()).compareTo(score.getScore()) == 0) {
score.setScore(score.getScore().setScale(0, BigDecimal.ROUND_HALF_UP));
}
}
map.put(score.getCode(), score);
//测评类(MOCA等)
if (Constant.Ht.Report.TYPE_EVALUATION == score.getType()) {
String specialCode = "NPI";
if (specialCode.equalsIgnoreCase(score.getCode())) {
initNPI(reportId, score);
}
scores.add(score);
} else {
log.info("score:{}", score);
map.get(score.getParentCode()).addSub(score);
}
});
scores.forEach(score -> {
if (Constant.Ht.Report.MOCA_SJZ.equalsIgnoreCase(score.getCode())) {
return;
}
sumScore(score);
});
return scores;
}
private void initQuestionBody(int questionSpan, PatientReportVo.QuestionAndAnswer question, PdfUtil.Row row, boolean isLast, int optionSize) {
addCell(row, question == null ? Constant.Ht.STRING_DEFAULT : String.valueOf(question.getSort()), 1, 1);
addCell(row, question == null ? Constant.Ht.STRING_DEFAULT : question.getQuestion(), questionSpan, 1);
if (question == null) {
for (int i = 0; i < optionSize; i++) {
PdfUtil.Cell cell = addCell(row, "", 1, 1);
cell.setBorderRight(isLast && i == optionSize - 1 ? 1 : 0);
}
return ;
}
int size = question.getOptionList().size();
for (int j = 0; j < size ; j++) {
String content = question.getOptionList().get(j).getChooseStatus() == 1 ? "√" : "--";
PdfUtil.Cell cell = addCell(row, content, 1, 1);
cell.setBorderRight(isLast && j == optionSize - 1 ? 1 : 0);
}
if (size >= optionSize) {
return;
}
for (int i = size; i < optionSize; i++) {
PdfUtil.Cell cell = addCell(row, "--", 1, 1);
cell.setBorderRight(isLast && i == optionSize - 1 ? 1 : 0);
}
}
/**
* 表格头
* @param code code
* @param cols 几列题目
* @param questionSpan 题目占几列
* @param questionTable 表格
*/
private void initQuestionTitle(String code, int cols, int questionSpan, List<PdfUtil.Row> questionTable) {
Constant.ReportExportTitle title = Constant.Export.TITLE_MAP.get(code);
// 检查目的
if (StrUtil.isNotBlank(title.checkPurpose)) {
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell cell = addCell(row, title.checkPurpose, (title.optionList.size() + questionSpan + 1 ) * cols, 1);
cell.setCenter(false);
cell.setBorderRight(1);
questionTable.add(row);
}
// 设置表头
PdfUtil.Row row1 = new PdfUtil.Row();
PdfUtil.Row row2 = new PdfUtil.Row();
for (int i = 0; i < cols ; i++) {
addCell(row1, "序号", 1, 2);
// addCell(row2, "", 1, 1);
if (StrUtil.isBlank(title.projectDesc)) {
addCell(row1, "项目", questionSpan, 2);
// addCell(row2, "", questionSpan, 1);
} else {
addCell(row1, title.projectDesc, questionSpan, 1);
addCell(row2, "项目", questionSpan, 1);
}
// 选项
PdfUtil.Cell optionDescCell = addCell(row1, title.optionDesc, title.optionList.size(), 1);
optionDescCell.setBorderRight(i == cols - 1 ? 1 : 0);
for (int j = 0; j < title.optionList.size() ; j++) {
PdfUtil.Cell optionCell = addCell(row2, title.optionList.get(j), 1, 1);
optionCell.setBorderRight(i == cols - 1 && j == title.optionList.size() - 1 ? 1 : 0);
}
}
questionTable.add(row1);
questionTable.add(row2);
}
private void initLast(List<PdfUtil.Row> content, int totalSpan) {
PdfUtil.Row row2 = new PdfUtil.Row();
PdfUtil.Cell doctorCell = addCell(row2, "测评员:", 4, 1, 0);
doctorCell.setBorderBottom(null);
doctorCell.setBorderLeft(null);
PdfUtil.Cell dateCell = addCell(row2, "报告日期:", totalSpan - 4, 1, 0);
dateCell.setBorderBottom(null);
dateCell.setBorderLeft(null);
content.add(row2);
}
}

404
ht/src/main/java/com/ccsens/ht/service/QuestionService.java

@ -15,13 +15,14 @@ import com.ccsens.ht.persist.mapper.*;
import com.ccsens.ht.uitl.Constant;
import com.ccsens.util.*;
import com.ccsens.util.exception.BaseException;
import io.swagger.annotations.ApiModel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.script.ScriptEngine;
@ -74,22 +75,19 @@ public class QuestionService implements IQuestionService {
@Override
public QuestionVo.Query queryQuestion(QuestionDto.Query query, Long userId) {
log.info("请求参数:{},{}", query, userId);
//1.根据类型和题号,查询试题
HtQuestionExample questionExample = new HtQuestionExample();
questionExample.createCriteria().andEvaluationCodeEqualTo(query.getCode()).andSortEqualTo(query.getNum());
List<HtQuestion> questionList = htQuestionDao.selectByExample(questionExample);
log.info("测评试题:{}", questionList);
if (CollectionUtils.isEmpty(questionList)) {
//1.根据类型和题号,查询试题 和 补充内容
QuestionVo.Question questionVo = htQuestionDao.queryQuestionAndRecord(query.getCode(), query.getNum(), query.getPatientReportId());
if (questionVo == null) {
throw new BaseException(CodeEnum.QUESTION_NOT_FOUND);
}
HtQuestion question = questionList.get(0);
QuestionVo.Question questionVo = QuestionVo.Question.toQuestionVo(question);
//获取code信息及补充信息
QuestionVo.Report reportVo = htReportDao.queryReportAndRecord(questionVo.getParentCode(), query.getPatientReportId());
//检查当前试题是否有答案,共享答案的试题是否有答案
boolean f = false;
if(ObjectUtil.isNotNull(query.getPatientReportId())){
HtPatientScoreExample scoreExample = new HtPatientScoreExample();
scoreExample.createCriteria().andPatientReportIdEqualTo(query.getPatientReportId()).andQuestionIdEqualTo(question.getId())
scoreExample.createCriteria().andPatientReportIdEqualTo(query.getPatientReportId()).andQuestionIdEqualTo(questionVo.getId())
.andTypeBetween((byte)0,(byte)1);
if(htPatientScoreDao.countByExample(scoreExample) > 0){
f = true;
@ -99,7 +97,7 @@ public class QuestionService implements IQuestionService {
//查询可以共享答案的试题的id
List<Long> shareAnswerIds = new ArrayList<>();
List<QuestionVo.ShareAnswer> shareAnswers = htQuestionDao.queryShareAnswer(question.getId(),query.getPatientReportId());
List<QuestionVo.ShareAnswer> shareAnswers = htQuestionDao.queryShareAnswer(questionVo.getId(),query.getPatientReportId());
log.info("答案关联的试题id:{}", shareAnswers);
if(CollectionUtil.isNotEmpty(shareAnswers)){
for(QuestionVo.ShareAnswer shareAnswer : shareAnswers){
@ -118,53 +116,38 @@ public class QuestionService implements IQuestionService {
//获取评测信息
HtReportExample reportExample = new HtReportExample();
reportExample.createCriteria().andCodeEqualTo(question.getEvaluationCode());
List<HtReport> htReports = htReportDao.selectByExample(reportExample);
QuestionVo.Report reportVo = new QuestionVo.Report();
if (CollectionUtil.isNotEmpty(htReports)) {
HtReport htReport = htReports.get(0);
reportVo.setCode(htReport.getCode());
reportVo.setName(htReport.getName());
}
Integer maxSort = htQuestionDao.selectMaxSort(query.getCode());
//查询关联题目
if (!StringUtils.isEmpty(question.getRelationCode())) {
String[] codes = question.getRelationCode().split(Constant.COMMA);
HtQuestionExample example = new HtQuestionExample();
example.createCriteria().andParentCodeIn(CollectionUtils.arrayToList(codes));
example.setOrderByClause("id");
List<HtQuestion> relationQuestions = htQuestionDao.selectByExample(example);
List<QuestionVo.QuestionOption> vos = new ArrayList<>();
if (CollectionUtil.isNotEmpty(relationQuestions)) {
relationQuestions.forEach(relation -> {
//试题选项
List<QuestionVo.Option> options = htQuestionOptionDao.queryOption(relation.getId(), query.getPatientReportId());
QuestionVo.QuestionOption questionOption = QuestionVo.QuestionOption.toQuestionOption(relation, options);
vos.add(questionOption);
});
}
log.info("关联试题:{}", vos);
questionVo.setRelationQuestions(vos);
HtQuestionExample example = new HtQuestionExample();
example.createCriteria().andRelationIdEqualTo(questionVo.getId());
example.setOrderByClause("id");
List<HtQuestion> relationQuestions = htQuestionDao.selectByExample(example);
List<QuestionVo.QuestionOption> vos = new ArrayList<>();
if (CollectionUtil.isNotEmpty(relationQuestions)) {
relationQuestions.forEach(relation -> {
//试题选项
List<QuestionVo.Option> options = htQuestionOptionDao.queryOption(relation.getId(), query.getPatientReportId());
QuestionVo.QuestionOption questionOption = QuestionVo.QuestionOption.toQuestionOption(relation, options);
vos.add(questionOption);
});
}
log.info("关联试题:{}", vos);
questionVo.setRelationQuestions(vos);
//试题引导语
HtQuestionIntroducerExample introduceExample = new HtQuestionIntroducerExample();
introduceExample.createCriteria().andQuestionIdEqualTo(question.getId());
introduceExample.createCriteria().andQuestionIdEqualTo(questionVo.getId());
introduceExample.setOrderByClause("sort");
List<HtQuestionIntroducer> introduces = htQuestionIntroducerDao.selectByExample(introduceExample);
List<QuestionVo.Introduce> introduceVos = QuestionVo.Introduce.toIntroduces(introduces);
//试题选项
List<QuestionVo.Option> optionList = htQuestionOptionDao.queryOption(question.getId(), query.getPatientReportId());
List<QuestionVo.Option> optionList = htQuestionOptionDao.queryOption(questionVo.getId(), query.getPatientReportId());
//答题记录
List<QuestionVo.Record> recordVos;
if (query.getPatientReportId() != null && query.getPatientReportId() != 0) {
HtPatientQuestionRecordExample recordExample = new HtPatientQuestionRecordExample();
recordExample.createCriteria().andPatientReportIdEqualTo(query.getPatientReportId()).andQuestionIdEqualTo(question.getId());
recordExample.createCriteria().andPatientReportIdEqualTo(query.getPatientReportId()).andQuestionIdEqualTo(questionVo.getId());
recordExample.setOrderByClause("record_time");
List<HtPatientQuestionRecord> records = htPatientQuestionRecordMapper.selectByExample(recordExample);
recordVos = QuestionVo.Record.toRecords(records);
@ -326,13 +309,18 @@ public class QuestionService implements IQuestionService {
private void saveAnswerRecord(QuestionDto.Score score, HtQuestion question) {
if (StrUtil.isNotBlank(score.getPath())) {
HtPatientQuestionRecordExample example = new HtPatientQuestionRecordExample();
String type = "";
String type;
switch (question.getOperateType()) {
case 1://语音
case 4://敲击
case Constant.Ht.Operation.VOICE://语音
case Constant.Ht.Operation.KNOCK://敲击
type = Constant.Ht.Record.ANSWER_AUDIO;
break;
case 2: //画图
case Constant.Ht.Operation.PAINT: //画图
case Constant.Ht.Operation.PAINT_HALF: //画图
case Constant.Ht.Operation.PAINT_HALF_IMG: //画图
case Constant.Ht.Operation.PAINT_NO_IMG: //画图
type = Constant.Ht.Record.ANSWER_IMG;
break;
default:
@ -515,11 +503,14 @@ public class QuestionService implements IQuestionService {
if(CollectionUtil.isNotEmpty(param.getPoints())){
param.getPoints().forEach(point -> {
log.info("添加轨迹信息");
HtPatientCanvasLine patientCanvasLine = new HtPatientCanvasLine();
patientCanvasLine.setId(snowflake.nextId());
patientCanvasLine.setPatientCanvasId(patientCanvas.getId());
patientCanvasLine.setPoints(point);
patientCanvasLineMapper.insertSelective(patientCanvasLine);
if (StrUtil.isNotBlank(point)) {
HtPatientCanvasLine patientCanvasLine = new HtPatientCanvasLine();
patientCanvasLine.setId(snowflake.nextId());
patientCanvasLine.setPatientCanvasId(patientCanvas.getId());
patientCanvasLine.setPoints(point);
patientCanvasLineMapper.insertSelective(patientCanvasLine);
}
});
}
//查询轨迹信息
@ -571,7 +562,7 @@ public class QuestionService implements IQuestionService {
List<QuestionVo.Point> canvasPoints = getCanvasPoints(htPatientCanvas);
patientCanvas.setPoints(canvasPoints);
//计算参数
QuestionVo.Parameter parameter = getParameter(htPatientCanvas);
QuestionVo.Parameter parameter = getParameter(question, htPatientCanvas, param);
patientCanvas.setParameters(parameter);
canvasList.add(patientCanvas);
});
@ -611,12 +602,46 @@ public class QuestionService implements IQuestionService {
return canvasPoints;
}
/**
* 点位置
*/
private static class PointPosition{
/** 对应值 */
public int value;
/** 第几条线 */
public int line;
/** 第几个点 */
public int point;
public int x;
public int y;
public PointPosition(){}
public PointPosition(int value, int line, int point, int x, int y) {
this.value = value;
this.line = line;
this.point = point;
this.x = x;
this.y = y;
}
public void change(int value, int line, int point, int x, int y) {
this.value = value;
this.line = line;
this.point = point;
this.x = x;
this.y = y;
}
}
/**
* 统计画图的参数
*
* @param question
* @param htPatientCanvas 画板信息
* @param param 请求参数 参考长度 参考思考时间
* @return 返回此次画图的参数
*/
private QuestionVo.Parameter getParameter(HtPatientCanvas htPatientCanvas) {
private QuestionVo.Parameter getParameter(HtQuestion question, HtPatientCanvas htPatientCanvas, QuestionDto.QueryPatientCanvas param) {
QuestionVo.Parameter parameter = new QuestionVo.Parameter();
//开始画图时长:打开画板到第一笔画图时长
parameter.setStartDuration(htPatientCanvas.getBeginTime() - htPatientCanvas.getOpenCanvasTime());
@ -647,37 +672,69 @@ public class QuestionService implements IQuestionService {
parameter.setAveTimes((int) Math.round(canvasPoints.size() / d));
//每笔数据
List<QuestionVo.LineParameter> lineParameterList = new ArrayList<>();
long intervalDuration = 0;
// long intervalDuration = 0;
//最长的笔画
double longLine = 0;
int longIndex = 0;
//最短的笔画
double shortLine = 0;
int shortIndex = 0;
//思考总时间 每笔间隔相加
long reflectOnTime = 0;
// 落笔总时间(所有笔画绘图时间)
long paintTime = 0;
//X最小值
int minX = 0;
PointPosition minX = null;
//X最大值
int maxX = 0;
PointPosition maxX = null;
//Y最小值
int minY = 0;
PointPosition minY = null;
//Y最大值
int maxY = 0;
PointPosition maxY = null;
//总长度
double totalLength = 0;
for(QuestionVo.Point canvas : canvasPoints){
/**已经给最大最小点赋值*/
boolean hadValue = false;
for (int i = 0; i < canvasPoints.size(); i++) {
QuestionVo.Point canvas = canvasPoints.get(i);
//时间
QuestionVo.LineParameter lineParameter = new QuestionVo.LineParameter();
String[] a = canvas.getValue().split(";");
if(a.length <= 0){
continue;
}
//获取最边缘的四个点
for (String value : a) {
for (int j = 0; j < a.length ; j++) {
String value = a[j];
String[] split1 = value.split(",");
minX = Math.min(Integer.parseInt(split1[0]), minX);
maxX = Math.max(Integer.parseInt(split1[0]), maxX);
minY = Math.min(Integer.parseInt(split1[1]), minY);
maxY = Math.max(Integer.parseInt(split1[1]), maxY);
int x = Integer.parseInt(split1[0]);
int y = Integer.parseInt(split1[1]);
if (!hadValue) {
minX = new PointPosition(x, i, j, x, y);
maxX = new PointPosition(x, i, j, x, y);
minY = new PointPosition(y, i, j, x, y);
maxY = new PointPosition(y, i, j, x, y);
hadValue = true;
continue;
}
// 最大最小横坐标
if (minX.value > x) {
minX.change(x,i,j, x, y);
} else if (maxX.value < x) {
maxX.change(x,i,j, x, y);
}
// 最大最小纵坐标
if (minY.value > y) {
minY.change(y,i,j, x, y);
} else if (maxY.value < y) {
maxY.change(y,i,j, x, y);
}
}
String[] s = a[0].split(",");
if(s.length <= 0){
@ -697,13 +754,17 @@ public class QuestionService implements IQuestionService {
//计算最长最短
if(longLine == 0){
longLine = length;
longIndex = i;
}else if(length > longLine){
longLine = length;
longIndex = i;
}
if(shortLine == 0){
shortLine = length;
shortIndex = i;
}else if(length < shortLine){
shortLine = length;
shortIndex = i;
}
//速度
double speed = 0;
@ -711,64 +772,215 @@ public class QuestionService implements IQuestionService {
speed = BigDecimal.valueOf(length / duration).setScale(2, RoundingMode.HALF_UP).doubleValue();
}
lineParameter.setSpeed(speed);
// 落笔总时间
paintTime += Long.parseLong(e[e.length - 1]) - Long.parseLong(s[s.length - 1]);
//和上一笔的间隔 & 思考总时长
if(Long.parseLong(e[e.length - 1]) == 0){
lineParameter.setIntervalDuration(htPatientCanvas.getBeginTime() - htPatientCanvas.getOpenCanvasTime());
reflectOnTime += htPatientCanvas.getBeginTime() - htPatientCanvas.getOpenCanvasTime();
}else {
intervalDuration = Long.parseLong(e[e.length - 1]) - intervalDuration;
lineParameter.setIntervalDuration(intervalDuration);
reflectOnTime += intervalDuration;
// if(Long.parseLong(e[e.length - 1]) == 0){
// lineParameter.setIntervalDuration(htPatientCanvas.getBeginTime() - htPatientCanvas.getOpenCanvasTime());
// reflectOnTime += htPatientCanvas.getBeginTime() - htPatientCanvas.getOpenCanvasTime();
// }else {
// intervalDuration = Long.parseLong(e[e.length - 1]) - intervalDuration;
// lineParameter.setIntervalDuration(intervalDuration);
// reflectOnTime += intervalDuration;
// }
if (i == 0) {
lineParameter.setIntervalDuration(parameter.getStartDuration());
reflectOnTime += parameter.getStartDuration();
} else {
String[] prevPoints = canvasPoints.get(i - 1).getValue().split(";");
String prevEnd = prevPoints[prevPoints.length - 1].split(",")[2];
lineParameter.setIntervalDuration(Long.parseLong(s[s.length - 1]) - Long.parseLong(prevEnd));
reflectOnTime += lineParameter.getIntervalDuration();
}
lineParameterList.add(lineParameter);
}
parameter.setLineParameterList(lineParameterList);
//最长笔画
parameter.setLongLine(longLine);
//最短笔画
parameter.setShortLine(shortLine);
//思考总时长
parameter.setReflectOnTime(reflectOnTime);
//计算中心
int x = minX + ((maxX - minX) / 2);
int y = minY + ((maxY - minY) / 2);
// 落笔总时长
parameter.setPaintTime(paintTime);
// 计算原点(画板中心) 画板是否为canvas的一半
int canvasHeight = htPatientCanvas.getCanvasHeight();
int canvasWidth = htPatientCanvas.getCanvasWidth();
boolean half = question.getOperateType() == Constant.Ht.Operation.PAINT_HALF ||
question.getOperateType() == Constant.Ht.Operation.PAINT_HALF_IMG;
int centerX = half ? (canvasWidth / 2 + 30) / 2 : canvasWidth / 2;
int centerY = canvasHeight / 2;
log.info("画板中心:{},{}", centerX, centerY);
//计算图形中心
int x = (maxX.value + minX.value) / 2;
int y = (maxY.value + minY.value) / 2;
String centreCoordinate = x + "," + y;
parameter.setCentreCoordinate(centreCoordinate);
//面积
double acreage = (maxX - minX) * (maxY - minY);
parameter.setAcreage(acreage);
parameter.setShowCentreCoordinate((x-centerX) + "," + (y-centerY));
// TODO 重心
parameter.setBarycenterCoordinate(centreCoordinate);
//最小长方形面积
double acreage = (maxX.value - minX.value) * (maxY.value - minY.value);
parameter.setMinRectangleAcreage(acreage);
// 计算四个边界点构成的长方形距离画板重心的距离
// 四个边界点 + 最小圆面积 四舍五入 sqrt
int radiusSqrt = setFourPoint(canvasPoints, minX, maxX, minY, maxY, x, y);
parameter.setMinCircleAcreage(new BigDecimal(Math.PI * radiusSqrt).setScale(2, BigDecimal.ROUND_HALF_UP));
log.info("half:",half);
if (half) {
// x:-y, y:x
parameter.setTop(new QuestionVo.Coordinate(maxY.y - centerY, maxY.x - centerX ));
parameter.setBottom(new QuestionVo.Coordinate(minY.y - centerY, minY.x - centerX));
parameter.setLeft(new QuestionVo.Coordinate(minX.y - centerY, minX.x - centerX));
parameter.setRight(new QuestionVo.Coordinate(maxX.y - centerY, maxX.x - centerX));
} else {
parameter.setTop(new QuestionVo.Coordinate(centerX - maxY.x , maxY.y - centerY));
parameter.setBottom(new QuestionVo.Coordinate(centerX - minY.x, minY.y - centerY));
parameter.setLeft(new QuestionVo.Coordinate(centerX - minX.x , minX.y - centerY));
parameter.setRight(new QuestionVo.Coordinate(centerX - maxX.x , maxX.y - centerY));
}
log.info("上:{},{};{},{}",maxY.x, maxY.y, parameter.getTop().getX(), parameter.getTop().getY());
log.info("下:{},{};{},{}",minY.x, minY.y, parameter.getBottom().getX(), parameter.getBottom().getY());
log.info("左:{},{};{},{}",minX.x, minX.y, parameter.getLeft().getX(), parameter.getLeft().getY());
log.info("右:{},{};{},{}",maxX.x, maxX.y, parameter.getRight().getX(), parameter.getRight().getY());
//平均长度
double aveLength = BigDecimal.valueOf(totalLength / canvasPoints.size()).setScale(2, RoundingMode.HALF_UP).doubleValue();
parameter.setAveLength(aveLength);
BigDecimal aveLength = BigDecimal.valueOf(totalLength / canvasPoints.size()).setScale(2, RoundingMode.HALF_UP);
BigDecimal aveReflectOnTime = BigDecimal.valueOf(reflectOnTime / canvasPoints.size()).setScale(2, RoundingMode.HALF_UP);
parameter.setAveLength(aveLength.doubleValue());
parameter.setAveReflectOnTime(aveReflectOnTime.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
//短笔画数量
double coefficient = 1.00;
int shortNums = getShortNums(aveLength,coefficient,lineParameterList);
parameter.setShortNums(shortNums);
// double coefficient = 1.00;
BigDecimal referenceLength = param.getReferenceLength() != null && param.getReferenceLength().compareTo(new BigDecimal(0)) > 0 ? param.getReferenceLength() : aveLength;
BigDecimal referenceReflectOnTime = param.getReferenceReflectOnTime() != null && param.getReferenceReflectOnTime().compareTo(new BigDecimal(0)) > 0 ? param.getReferenceReflectOnTime() : aveReflectOnTime;
// 获取短笔画数量、快思考数量,计算并赋值最长最短笔画速度
Nums nums = getShortNums( referenceLength, referenceReflectOnTime, lineParameterList, longIndex, shortIndex, parameter);
parameter.setShortNums(nums.shortNums);
//长笔画数量,等于总笔画减去短笔画的数量
parameter.setLongNums(lineParameterList.size() - shortNums);
//TODO 笔画中间值
parameter.setLongNums(lineParameterList.size() - nums.shortNums);
parameter.setQuickNums(nums.quickNums);
parameter.setSlowNums(lineParameterList.size() - nums.quickNums);
return parameter;
}
/**
* 设置 四个特殊点计算中心点四个特殊点相对原点画板中心的距离 计算点到中心点距离的平方的最大值
* @param canvasPoints 记录
* @param minX 最左点
* @param maxX 最右点
* @param minY 最上点
* @param maxY 最下点
* @param x 中心点 x
* @param y 中心点 y
* @return 点到中心点距离的平方的最大值
*/
private int setFourPoint(List<QuestionVo.Point> canvasPoints, PointPosition minX, PointPosition maxX, PointPosition minY, PointPosition maxY, int x, int y) {
int max = 0;
for (int i = 0; i < canvasPoints.size(); i++) {
QuestionVo.Point point = canvasPoints.get(i);
if (StrUtil.isEmpty(point.getValue())) {
continue;
}
String[] pointArr = point.getValue().split(";");
if (pointArr == null || pointArr.length <= 0) {
continue;
}
//1左 2右 3 上 4 下
for (int j = 0; j < pointArr.length; j++) {
String s = pointArr[j];
if (StrUtil.isEmpty(s)) {
continue;
}
if (i == minX.line && j == minX.point) {
pointArr[j] += ",1";
} else if (i == maxX.line && j == maxX.point) {
pointArr[j] += ",2";
} else if (i == minY.line && j == minY.point) {
pointArr[j] += ",4";
} else if (i == maxY.line && j == maxY.point) {
pointArr[j] += ",3";
} else {
pointArr[j] += ",0";
}
String[] strArr = s.split(",");
if (strArr == null || strArr.length < 2) {
continue;
}
int pointX = Integer.parseInt(strArr[0]);
int pointY = Integer.parseInt(strArr[1]);
max = (int) Math.max(max, Math.pow(pointX-x, 2) + Math.pow(pointY - y, 2));
}
point.setValue(StringUtils.join(pointArr, ";"));
}
return max;
}
@ApiModel("短线和短时间思考数目")
private static class Nums{
public int shortNums;
public int quickNums;
}
/**
* 获取短笔画的数量
* @param aveLength 平均长度
* @param coefficient 自定义系数
*
*
* @param aveLength 参考长度
* @param referenceReflectOnTime 参考思考时间
* @param lineParameterList 所有笔画的参数
* @param longIndex
* @param shortIndex
* @param parameter
* @return 返回短笔画的数量
*/
private int getShortNums(double aveLength, double coefficient, List<QuestionVo.LineParameter> lineParameterList) {
private Nums getShortNums(BigDecimal aveLength, BigDecimal referenceReflectOnTime, List<QuestionVo.LineParameter> lineParameterList, int longIndex, int shortIndex, QuestionVo.Parameter parameter) {
Nums nums = new Nums();
int shortNums = 0;
double a = aveLength * coefficient;
int quickNums = 0;
// double a = aveLength * coefficient;
if(CollectionUtil.isNotEmpty(lineParameterList)){
for(QuestionVo.LineParameter lineParameter : lineParameterList){
if(lineParameter.getLength() <= a){
for (int i = 0; i < lineParameterList.size(); i++) {
QuestionVo.LineParameter lineParameter = lineParameterList.get(i);
if(aveLength.compareTo(new BigDecimal(lineParameter.getLength())) >= 0){
lineParameter.setLengthStatus(Constant.LineColour.LENGTH_STATUS_SHORT);
shortNums++;
} else {
lineParameter.setLengthStatus(Constant.LineColour.LENGTH_STATUS_LONG);
}
if(referenceReflectOnTime.compareTo(new BigDecimal(lineParameter.getIntervalDuration())) >= 0){
lineParameter.setReflectOnStatus(Constant.LineColour.REFLECT_ON_STATUS_QUICK);
quickNums++;
} else {
lineParameter.setReflectOnStatus(Constant.LineColour.REFLECT_ON_STATUS_SLOW);
}
if (longIndex == i) {
parameter.setLongSpeed(lineParameter.getSpeed());
}
if (shortIndex == i) {
parameter.setShortSpeed(lineParameter.getSpeed());
}
}
}
return shortNums;
nums.shortNums = shortNums;
nums.quickNums = quickNums;
return nums;
}
private double getLengthByCanvas(String[] canvas) {

108
ht/src/main/java/com/ccsens/ht/uitl/Constant.java

@ -1,6 +1,6 @@
package com.ccsens.ht.uitl;
import com.ccsens.util.PropUtil;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
@ -23,8 +23,78 @@ public class Constant {
/**上传图片访问路径*/
public static final String UPLOAD_URL = "uploads/";
/**导入相关*/
public static final class Import{
public final static String EVALUATION_RECORD = "其他记录";
public final static String EVALUATION_QUESTION = "题目";
public final static String EVALUATION_OPTION = "选项";
public final static String EVALUATION_RELATION = "关联题目";
public final static String EVALUATION_PARSE = "解析";
public final static String EVALUATION_RULE = "规则";
public final static String RELATION_OPTION = "option";
public static final String RELATION_OPTION_SORT = "sort";
public static final String OPTION_DESC = "desc";
}
public static final class Export{
public final static Map<String, ReportExportTitle> TITLE_MAP = new HashMap<>();
static {
TITLE_MAP.put("HAMA", new ReportExportTitle("检查目的:用于焦虑症的诊断及程度划分的依据。",
"近一周内", "圈出最符合病人情况的分数",
"无(0)","轻度(1)","中度(2)","重度(3)","极重度(4)"));
TITLE_MAP.put("HAMD", new ReportExportTitle("检查目的:临床评定抑郁状态。",
"", "圈出最符合病人情况的分数",
"无(0)","轻度(1)","中度(2)","重度(3)","极重度(4)"));
TITLE_MAP.put("ADL", new ReportExportTitle("检查目的:ADL量表用于评定被测试人日常生活能力(包括躯体功能和使用工具能力)。",
"", "圈出最符合的情况",
"自己可以做(1)","有些困难(2)","需要帮助(3)","根本无法做(4)"));
}
}
public static final class ReportExportTitle{
@ApiModelProperty("检查目的")
public String checkPurpose;
@ApiModelProperty("项目描述")
public String projectDesc;
@ApiModelProperty("选项描述")
public String optionDesc;
@ApiModelProperty("选项描述")
public List<String> optionList = new ArrayList<>();
public ReportExportTitle() {
}
public ReportExportTitle(String checkPurpose, String projectDesc, String optionDesc, String... options) {
this.checkPurpose = checkPurpose;
this.projectDesc = projectDesc;
this.optionDesc = optionDesc;
if (options == null || options.length <= 0) {
return;
}
for (String option: options) {
this.optionList.add(option);
}
}
public List<String> addOption(String option) {
optionList.add(option);
return optionList;
}
}
/**病友画图轨迹颜色*/
public static final class LineColour {
public final static byte LENGTH_STATUS_SHORT = 0;
public final static byte LENGTH_STATUS_LONG = 1;
public final static byte REFLECT_ON_STATUS_QUICK = 0;
public final static byte REFLECT_ON_STATUS_SLOW = 1;
public final static List<Integer> COLOUR = new ArrayList<>();
static {
COLOUR.add(0);
@ -44,6 +114,7 @@ public class Constant {
/**
* 医疗职称相关常量
*/
@ -61,6 +132,30 @@ public class Constant {
/**删除*/
public final static byte IS_DEL = 1;
public final static class QuestionRecord{
public static final byte RECORD_TYPE_CODE = 0;
public static final byte RECORD_TYPE_QUESTION = 1;
}
public final static class Operation {
//用户操作类型(0无,1语音,2画图,3.画图显示中线和图形,4敲击,5画图不显示图形,6画图只显示中线)
/**画图*/
public final static byte VOICE = 1;
/**画图*/
public final static byte PAINT = 2;
/**画图显示中线和图形*/
public final static byte PAINT_HALF_IMG = 3;
/**画图显示中线和图形*/
public final static byte KNOCK = 4;
/**画图显示中线和图形*/
public final static byte PAINT_NO_IMG = 5;
/**画图只显示中线*/
public final static byte PAINT_HALF = 6;
}
public final static class Rule {
public static final byte SMALL = 0;
public static final String SMALL_NUM = "small";
@ -127,10 +222,13 @@ public class Constant {
public static class Report{
public final static String PARENT_CODE = "REPORT1.0";
public final static String PARENT_NAME = "认知功能神经心理量表检查报告单";
public final static Byte TYPE_EVALUATION = 2;
public final static byte TYPE_EVALUATION = 2;
public final static String IGNORE_SCORE = "[个]";
public final static String MOCA_SJZ = "SZJ";
public final static String MOCA = "MoCA";
public final static String HAMD = "HAMD";
public static final String HAMA = "HAMA";
public static final String ADL = "ADL";
public final static String MMSE = "MMSE";
public final static String NPI = "NPI";
public final static String REY = "Rey";
@ -142,9 +240,15 @@ public class Constant {
/**忽略报告单*/
public final static Byte COMPLETE_IGNORE = 2;
/**在历史报告单中显示*/
public final static byte SHOW_HISTORY = 1;
public final static Map<String, Byte> TYPE = new HashMap<>();
static {
//1:报告单 2:测评 3:测评子类 4:二级子类
TYPE.put("报告单",(byte)1);

3
ht/src/main/resources/application-dev.yml

@ -8,7 +8,8 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 127.0.0.1
host: 192.168.31.13
# host: 127.0.0.1
password: 111111
port: 5672
username: admin

2
ht/src/main/resources/application-test.yml

@ -39,4 +39,4 @@ ht:
name: 认知功能评测云平台系统
eureka:
instance:
ip-address: 192.168.0.99
ip-address: 127.0.0.1

106
ht/src/main/resources/mapper_dao/HtPatientReportDao.xml

@ -37,6 +37,17 @@
<result column="type" jdbcType="TINYINT" property="type"/>
<result column="score" jdbcType="INTEGER" property="score"/>
</resultMap>
<resultMap id="QuestionMap" type="com.ccsens.ht.bean.vo.PatientReportVo$QuestionAndAnswer">
<id column="id" property="id"/>
<result column="question" property="question"/>
<result column="sort" property="sort"/>
<collection property="optionList" ofType="com.ccsens.ht.bean.vo.PatientReportVo$Option">
<id column="optionId" property="id"/>
<result column="name" property="name"/>
<result column="answer" property="answer"/>
<result column="chooseStatus" property="chooseStatus"/>
</collection>
</resultMap>
<select id="queryReportResult" resultMap="BaseResultMap">
select r.*, d.name as doctor_name, p.name as patient_name, p.sex, p.educational_status, p.educational_status_unit, p.career, p.hospital_number, p.patient_number
@ -47,17 +58,25 @@
<select id="queryReportScore" resultMap="ScoreMap">
select t1.code,t1.name, t1.description, t1.total_score, t1.remark,t1.type,t1.parent_code, sum(t2.score) as score
from
(select code,name, description, total_score, remark, type, parent_code, sort from t_ht_report
where is_show = 1 and is_del = 0
<if test="rey == 1">
and `code` != 'Rey' and `code` != 'XFXPD' and parent_code != 'Rey'
</if>
(
select code,name, description, total_score, remark, type, parent_code, sort from (
select t1.*, if (find_in_set(t1.parent_code, @pcode) > 0, @pcode := concat(@pcode,',',t1.code) ,0 )as ischild
from
(select * from t_ht_report where is_show = 1 and is_del = 0
<if test="rey == 1">
and `code` != 'Rey' and `code` != 'XFXPD' and parent_code != 'Rey'
</if>
<if test="rey == 2">
AND (`code` = 'Rey' or parent_code = 'Rey')
</if>
ORDER BY type, sort) t1 ,
(select @pcode:=#{report} ) t2
) t where ischild != '0'
) t1
left join t_ht_question q on t1.code = q.parent_code and q.is_del = 0
left join t_ht_patient_score t2
on t1.code = t2.question_parent_code and
on q.id = t2.question_id and
(
(t2.patient_report_id = #{id, jdbcType=BIGINT} and t2.type in (0,2) and t2.is_del = 0) or t2.id is null
)
@ -224,6 +243,81 @@
and a.questionId = t.question_id
ORDER BY a.questionId ,a.sort
</select>
<select id="search" resultType="com.ccsens.ht.bean.vo.PatientReportSearchVo$Search">
<foreach collection="codes" item="item" separator="INTERSECT">
<if test="item.code != null and item.code != '' and (item.start != null or item.end != null)">
SELECT
r.id,
r.NAME
FROM
t_ht_patient_score s,
t_ht_question q,
t_ht_patient_report r
WHERE
s.question_id = q.id
AND s.patient_report_id = r.id
AND s.question_parent_code = #{item.code}
AND s.type IN ( 0, 2 )
AND s.is_del = 0
AND q.is_del = 0
GROUP BY
patient_report_id
HAVING
<trim suffixOverrides="AND">
<if test="item.start != null">
sum( score ) &gt;= #{item.start} AND
</if>
<if test="item.end != null">
sum( score ) &lt;= #{item.end} AND
</if>
</trim>
</if>
</foreach>
</select>
<select id="queryReportScore2" resultMap="ScoreMap">
select t1.code,t1.name, t1.description, t1.total_score, t1.remark,t1.type,t1.parent_code, sum(t2.score) as score
from
(
select code,name, description, total_score, remark, type, parent_code, sort from (
select t1.*, if (find_in_set(t1.parent_code, @pcode) > 0 or t1.code = @pcode, @pcode := concat(@pcode,',',t1.code) ,0 )as ischild
from
(select * from t_ht_report where is_show = 1 and is_del = 0
ORDER BY type, sort) t1 ,
(select @pcode:=#{code} ) t2
) t where ischild != '0'
) t1
left join t_ht_question q on t1.code = q.parent_code and q.is_del = 0
left join t_ht_patient_score t2
on q.id = t2.question_id and
(
(t2.patient_report_id = #{id, jdbcType=BIGINT} and t2.type in (0,2) and t2.is_del = 0) or t2.id is null
)
GROUP BY t1.code
order by t1.type,t1.sort
</select>
<select id="queryQuestionAndScore" resultMap="QuestionMap">
SELECT
q.id,
q.question,
q.sort,
o.id AS optionId,
o.NAME,
IF( s.id IS NULL, 0, 1 ) AS chooseStatus,
s.answer
FROM
( SELECT * FROM t_ht_question WHERE evaluation_code = #{code} AND is_del = 0 ) q
LEFT JOIN t_ht_question_option o ON q.id = o.question_id
AND o.is_del = 0
LEFT JOIN t_ht_patient_score s ON q.id = s.question_id
AND o.id = s.option_id
AND s.is_del = 0
AND s.patient_report_id = #{id}
ORDER BY
q.sort,
o.sort
</select>
</mapper>

98
ht/src/main/resources/mapper_dao/HtQuestionDao.xml

@ -1,29 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.dao.HtQuestionDao">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.po.HtQuestion">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.vo.QuestionVo$Question">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="evaluation_code" jdbcType="VARCHAR" property="evaluationCode" />
<result column="parent_code" jdbcType="VARCHAR" property="parentCode" />
<result column="evaluationCode" jdbcType="VARCHAR" property="evaluationCode" />
<result column="parentCode" jdbcType="VARCHAR" property="parentCode" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="question" jdbcType="VARCHAR" property="question" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="record_type" jdbcType="VARCHAR" property="recordType" />
<result column="record_content" jdbcType="VARCHAR" property="recordContent" />
<result column="relation_code" jdbcType="VARCHAR" property="relationCode" />
<result column="operate_type" jdbcType="TINYINT" property="operateType" />
<result column="recode_starttime" jdbcType="TINYINT" property="recodeStarttime" />
<result column="time_wabei" jdbcType="TINYINT" property="timeWabei" />
<result column="allow_clear" jdbcType="TINYINT" property="allowClear" />
<result column="clear_times" jdbcType="INTEGER" property="clearTimes" />
<result column="timing_length" jdbcType="INTEGER" property="timingLength" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recordType" jdbcType="VARCHAR" property="recordType" />
<result column="recordContent" jdbcType="VARCHAR" property="recordContent" />
<result column="operateType" jdbcType="TINYINT" property="operateType" />
<result column="recodeStarttime" jdbcType="TINYINT" property="recodeStarttime" />
<result column="timeWabei" jdbcType="TINYINT" property="timeWabei" />
<result column="allowClear" jdbcType="TINYINT" property="allowClear" />
<result column="clearTimes" jdbcType="INTEGER" property="clearTimes" />
<result column="timingLength" jdbcType="INTEGER" property="timingLength" />
<collection property="questionRecords" ofType="com.ccsens.ht.bean.vo.QuestionVo$QuestionRecord">
<id column="rid" property="id"></id>
<result column="rCalcType" property="calcType"/>
<result column="rShowTitle" property="showTitle"/>
<result column="rShowForm" property="showForm"/>
<result column="rDefaultValue" property="defaultValue"/>
<result column="rType" property="type"/>
<result column="rRemark" property="remark"/>
<collection property="answers" ofType="String">
<id column="answer"/>
</collection>
</collection>
</resultMap>
<insert id="insertBatch" parameterType="List">
<insert id="insertBatch" parameterType="java.util.List">
replace into t_ht_question (id, evaluation_code, parent_code,
sort, question, type,
record_type, record_content, relation_code,
@ -60,4 +67,61 @@
r.question_id = #{questionId}
GROUP BY r.relevance_id
</select>
<select id="queryQuestionAndRecord" resultMap="BaseResultMap">
SELECT
*
FROM
(
SELECT
q.id,
q.evaluation_code AS evaluationCode,
q.parent_code AS parentCode,
q.sort,
q.question,
q.type,
q.record_type AS recordType,
q.record_content AS recordContent,
q.operate_type AS operateType,
q.recode_starttime AS recodeStarttime,
q.time_wabei AS timeWabei,
q.allow_clear AS allowClear,
q.clear_times AS clearTimes,
q.timing_length AS timingLength
FROM
t_ht_question q
WHERE
q.evaluation_code = #{code}
AND q.sort = #{num}
AND q.relation_id = 0
AND q.is_del = 0
LIMIT 1
) q
LEFT JOIN (
SELECT
r.id AS rId,
r.question_id,
r.calc_type AS rCalcType,
r.show_title AS rShowTitle,
r.show_form AS rShowForm,
r.default_value AS rDefaultValue,
r.type AS rType,
r.remark AS rRemark,
qr.answer
FROM
( SELECT * FROM t_ht_question_record WHERE record_type = 1 AND is_del = 0 ) r
LEFT JOIN ( SELECT * FROM t_ht_patient_report_record_desc WHERE
<choose>
<when test="patientReportId != null and patientReportId != 0">
patient_report_id = #{patientReportId} AND is_del = 0
</when>
<otherwise>
1=2
</otherwise>
</choose>
) qr ON r.id = qr.record_id
ORDER BY
r.question_id,
r.sort
) r ON q.id = r.question_id
</select>
</mapper>

15
ht/src/main/resources/mapper_dao/HtQuestionOptionDao.xml

@ -23,9 +23,14 @@
<result column="display" jdbcType="VARCHAR" property="display" />
<result column="choose" jdbcType="TINYINT" property="choose" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
<collection property="optionDescList" ofType="com.ccsens.ht.bean.vo.QuestionVo$OptionDesc">
<id column="descId" property="id"/>
<result column="descType" property="type"/>
<result column="content" property="content"/>
</collection>
</resultMap>
<insert id="insertBatch" parameterType="List">
<insert id="insertBatch" parameterType="java.util.List">
replace into t_ht_question_option (id, question_id, sort,
type, name, score,
display, remark, create_time,
@ -41,11 +46,15 @@
<select id="queryOption" resultMap="OptionMap">
select t1.id, t1.type, t1.question_id, t1.name, t1.score, t1.display, case when t1.type = 'hidden' then 0 when t2.id is null then 0 else 1 end as choose , if(t2.type = 3, null, t2.answer) as answer
select t1.id, t1.type, t1.question_id, t1.name, t1.score, t1.display,
case when t1.type = 'hidden' then 0 when t2.id is null then 0 else 1 end as choose ,
if(t2.type = 3, null, t2.answer) as answer,
t3.id as descId, t3.type as descType, t3.content
from t_ht_question_option t1 left join t_ht_patient_score t2 on t1.id = t2.option_id and (t2.id is null or (t2.patient_report_id = #{patientReportId,jdbcType=BIGINT} and t2.is_del = 0))
left join (select * from t_ht_question_option_desc where is_del = 0) t3 on t1.id = t3.option_id
where t1.question_id = #{questionId,jdbcType=BIGINT}
and t1.is_del = 0
group by t1.id
order by t1.sort
order by t1.sort, t3.sort
</select>
</mapper>

21
ht/src/main/resources/mapper_dao/HtQuestionOptionDescDao.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.dao.HtQuestionOptionDescDao">
<insert id="insertBatch">
replace into t_ht_question_option_desc (id, option_id, type,
sort, content, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.optionId}, #{item.type}, #{item.sort},
#{item.content}, #{item.remark})
</foreach>
</insert>
<delete id="delete">
update t_ht_question_option_desc set rec_status = 0 where option_id in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</delete>
</mapper>

16
ht/src/main/resources/mapper_dao/HtQuestionRecordDao.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.dao.HtQuestionRecordDao">
<insert id="insertBatch">
replace into t_ht_question_record (id, record_type, question_id,
sort, calc_type, show_title, show_form, default_value, type, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.recordType}, #{item.questionId}, #{item.sort},
#{item.calcType}, #{item.showTitle}, #{item.showForm}, #{item.defaultValue},
#{item.type}, #{item.remark})
</foreach>
</insert>
</mapper>

14
ht/src/main/resources/mapper_dao/HtQuestionRecordOptionDao.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.dao.HtQuestionRecordOptionDao">
<insert id="insertBatch">
replace into t_ht_question_record_option (id, question_record_id, sort, data_key, data_value, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.questionRecordId}, #{item.sort}, #{item.dataKey},
#{item.dataValue}, #{item.remark})
</foreach>
</insert>
</mapper>

95
ht/src/main/resources/mapper_dao/HtReportDao.xml

@ -1,23 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.dao.HtReportDao">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.po.HtReport">
<id column="id" jdbcType="BIGINT" property="id" />
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.vo.QuestionVo$Report">
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="parent_code" jdbcType="VARCHAR" property="parentCode" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="total_score" jdbcType="INTEGER" property="totalScore" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="is_show" jdbcType="TINYINT" property="isShow" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<collection property="codeRecords" ofType="com.ccsens.ht.bean.vo.QuestionVo$QuestionRecord">
<id column="rid" property="id"></id>
<result column="rCalcType" property="calcType"/>
<result column="rShowTitle" property="showTitle"/>
<result column="rShowForm" property="showForm"/>
<result column="rDefaultValue" property="defaultValue"/>
<result column="rType" property="type"/>
<result column="rRemark" property="remark"/>
<collection property="answers" ofType="String">
<id column="answer"/>
</collection>
</collection>
</resultMap>
<insert id="insertBatch" parameterType="List">
<insert id="insertBatch" parameterType="java.util.List">
replace into t_ht_report (id, code, name,
parent_code, description, total_score,
type, is_show, sort,
@ -32,8 +33,74 @@
</foreach>
</insert>
<select id="queryReportShow" resultMap="BaseResultMap">
<select id="queryReportShow" resultMap="com.ccsens.ht.persist.mapper.HtReportMapper.BaseResultMap">
select * from t_ht_report where is_show = 1 and is_del = 0 order by type,sort
</select>
<select id="queryParam" resultType="com.ccsens.ht.bean.vo.PatientReportSearchVo$SearchParam">
SELECT
t.id,
t.code,
t.parent_code as parentCode,
t.name,
IF( count( q.id ) > 0, 1, 0 ) AS optionStatus
FROM
(
SELECT
t.id,
t.CODE,
t.parent_code,
t.NAME,
t.type,
t.sort
FROM
(
SELECT
t1.*,
IF ( find_in_set( parent_code, @pcodes ) > 0, @pcodes := concat( @pcodes, ',', CODE ), 0 ) AS ischild
FROM
( SELECT id, CODE, parent_code, NAME, type, sort FROM t_ht_report WHERE is_del = 0 ) t1,
( SELECT @pcodes := #{parentCode} ) t2
) t
WHERE t.ischild != '0'
) t
LEFT JOIN t_ht_question q ON t.CODE = q.parent_code AND q.is_del = 0
GROUP BY t.CODE
ORDER BY t.type,t.parent_code,t.sort
</select>
<select id="queryCode" resultType="java.lang.String">
select code from t_ht_report where type = #{type} and is_del = 0
</select>
<select id="queryReportAndRecord" resultMap="BaseResultMap">
select * from
(select id, code, name from t_ht_report where code = #{code} and is_del = 0 ) report
left join
(
SELECT
r.id AS rId,
r.question_id,
r.calc_type AS rCalcType,
r.show_title AS rShowTitle,
r.show_form AS rShowForm,
r.default_value AS rDefaultValue,
r.type AS rType,
r.remark AS rRemark,
qr.answer
FROM
( SELECT * FROM t_ht_question_record WHERE record_type = 0 AND is_del = 0 ) r
LEFT JOIN ( SELECT * FROM t_ht_patient_report_record_desc WHERE
<choose>
<when test="patientReportId != null and patientReportId != 0">
patient_report_id = #{patientReportId} AND is_del = 0
</when>
<otherwise>
1=2
</otherwise>
</choose>
) qr ON r.id = qr.record_id
ORDER BY
r.question_id,
r.sort
) record on report.id = record.question_id
</select>
</mapper>

276
ht/src/main/resources/mapper_raw/HtPatientReportRecordDescMapper.xml

@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.mapper.HtPatientReportRecordDescMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.po.HtPatientReportRecordDesc">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="patient_report_id" jdbcType="BIGINT" property="patientReportId" />
<result column="record_id" jdbcType="BIGINT" property="recordId" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="answer_time" jdbcType="BIGINT" property="answerTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, patient_report_id, record_id, answer, remark, create_time, update_time, is_del,
answer_time
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientReportRecordDescExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_ht_patient_report_record_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_ht_patient_report_record_desc
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_ht_patient_report_record_desc
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ht.bean.po.HtPatientReportRecordDescExample">
delete from t_ht_patient_report_record_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ht.bean.po.HtPatientReportRecordDesc">
insert into t_ht_patient_report_record_desc (id, patient_report_id, record_id,
answer, remark, create_time,
update_time, is_del, answer_time
)
values (#{id,jdbcType=BIGINT}, #{patientReportId,jdbcType=BIGINT}, #{recordId,jdbcType=BIGINT},
#{answer,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}, #{answerTime,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientReportRecordDesc">
insert into t_ht_patient_report_record_desc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="patientReportId != null">
patient_report_id,
</if>
<if test="recordId != null">
record_id,
</if>
<if test="answer != null">
answer,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDel != null">
is_del,
</if>
<if test="answerTime != null">
answer_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="patientReportId != null">
#{patientReportId,jdbcType=BIGINT},
</if>
<if test="recordId != null">
#{recordId,jdbcType=BIGINT},
</if>
<if test="answer != null">
#{answer,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
<if test="answerTime != null">
#{answerTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientReportRecordDescExample" resultType="java.lang.Long">
select count(*) from t_ht_patient_report_record_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_ht_patient_report_record_desc
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.patientReportId != null">
patient_report_id = #{record.patientReportId,jdbcType=BIGINT},
</if>
<if test="record.recordId != null">
record_id = #{record.recordId,jdbcType=BIGINT},
</if>
<if test="record.answer != null">
answer = #{record.answer,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
<if test="record.answerTime != null">
answer_time = #{record.answerTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_ht_patient_report_record_desc
set id = #{record.id,jdbcType=BIGINT},
patient_report_id = #{record.patientReportId,jdbcType=BIGINT},
record_id = #{record.recordId,jdbcType=BIGINT},
answer = #{record.answer,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT},
answer_time = #{record.answerTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ht.bean.po.HtPatientReportRecordDesc">
update t_ht_patient_report_record_desc
<set>
<if test="patientReportId != null">
patient_report_id = #{patientReportId,jdbcType=BIGINT},
</if>
<if test="recordId != null">
record_id = #{recordId,jdbcType=BIGINT},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
<if test="answerTime != null">
answer_time = #{answerTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ht.bean.po.HtPatientReportRecordDesc">
update t_ht_patient_report_record_desc
set patient_report_id = #{patientReportId,jdbcType=BIGINT},
record_id = #{recordId,jdbcType=BIGINT},
answer = #{answer,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT},
answer_time = #{answerTime,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

35
ht/src/main/resources/mapper_raw/HtQuestionMapper.xml

@ -11,6 +11,7 @@
<result column="record_type" jdbcType="VARCHAR" property="recordType" />
<result column="record_content" jdbcType="VARCHAR" property="recordContent" />
<result column="relation_code" jdbcType="VARCHAR" property="relationCode" />
<result column="relation_id" jdbcType="BIGINT" property="relationId" />
<result column="operate_type" jdbcType="TINYINT" property="operateType" />
<result column="recode_starttime" jdbcType="TINYINT" property="recodeStarttime" />
<result column="time_wabei" jdbcType="TINYINT" property="timeWabei" />
@ -82,8 +83,8 @@
</sql>
<sql id="Base_Column_List">
id, evaluation_code, parent_code, sort, question, type, record_type, record_content,
relation_code, operate_type, recode_starttime, time_wabei, allow_clear, clear_times,
timing_length, remark, create_time, update_time, is_del
relation_code, relation_id, operate_type, recode_starttime, time_wabei, allow_clear,
clear_times, timing_length, remark, create_time, update_time, is_del
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionExample" resultMap="BaseResultMap">
select
@ -119,17 +120,17 @@
insert into t_ht_question (id, evaluation_code, parent_code,
sort, question, type,
record_type, record_content, relation_code,
operate_type, recode_starttime, time_wabei,
allow_clear, clear_times, timing_length,
remark, create_time, update_time,
is_del)
relation_id, operate_type, recode_starttime,
time_wabei, allow_clear, clear_times,
timing_length, remark, create_time,
update_time, is_del)
values (#{id,jdbcType=BIGINT}, #{evaluationCode,jdbcType=VARCHAR}, #{parentCode,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{question,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
#{recordType,jdbcType=VARCHAR}, #{recordContent,jdbcType=VARCHAR}, #{relationCode,jdbcType=VARCHAR},
#{operateType,jdbcType=TINYINT}, #{recodeStarttime,jdbcType=TINYINT}, #{timeWabei,jdbcType=TINYINT},
#{allowClear,jdbcType=TINYINT}, #{clearTimes,jdbcType=INTEGER}, #{timingLength,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{isDel,jdbcType=TINYINT})
#{relationId,jdbcType=BIGINT}, #{operateType,jdbcType=TINYINT}, #{recodeStarttime,jdbcType=TINYINT},
#{timeWabei,jdbcType=TINYINT}, #{allowClear,jdbcType=TINYINT}, #{clearTimes,jdbcType=INTEGER},
#{timingLength,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtQuestion">
insert into t_ht_question
@ -161,6 +162,9 @@
<if test="relationCode != null">
relation_code,
</if>
<if test="relationId != null">
relation_id,
</if>
<if test="operateType != null">
operate_type,
</if>
@ -220,6 +224,9 @@
<if test="relationCode != null">
#{relationCode,jdbcType=VARCHAR},
</if>
<if test="relationId != null">
#{relationId,jdbcType=BIGINT},
</if>
<if test="operateType != null">
#{operateType,jdbcType=TINYINT},
</if>
@ -288,6 +295,9 @@
<if test="record.relationCode != null">
relation_code = #{record.relationCode,jdbcType=VARCHAR},
</if>
<if test="record.relationId != null">
relation_id = #{record.relationId,jdbcType=BIGINT},
</if>
<if test="record.operateType != null">
operate_type = #{record.operateType,jdbcType=TINYINT},
</if>
@ -334,6 +344,7 @@
record_type = #{record.recordType,jdbcType=VARCHAR},
record_content = #{record.recordContent,jdbcType=VARCHAR},
relation_code = #{record.relationCode,jdbcType=VARCHAR},
relation_id = #{record.relationId,jdbcType=BIGINT},
operate_type = #{record.operateType,jdbcType=TINYINT},
recode_starttime = #{record.recodeStarttime,jdbcType=TINYINT},
time_wabei = #{record.timeWabei,jdbcType=TINYINT},
@ -375,6 +386,9 @@
<if test="relationCode != null">
relation_code = #{relationCode,jdbcType=VARCHAR},
</if>
<if test="relationId != null">
relation_id = #{relationId,jdbcType=BIGINT},
</if>
<if test="operateType != null">
operate_type = #{operateType,jdbcType=TINYINT},
</if>
@ -418,6 +432,7 @@
record_type = #{recordType,jdbcType=VARCHAR},
record_content = #{recordContent,jdbcType=VARCHAR},
relation_code = #{relationCode,jdbcType=VARCHAR},
relation_id = #{relationId,jdbcType=BIGINT},
operate_type = #{operateType,jdbcType=TINYINT},
recode_starttime = #{recodeStarttime,jdbcType=TINYINT},
time_wabei = #{timeWabei,jdbcType=TINYINT},

275
ht/src/main/resources/mapper_raw/HtQuestionOptionDescMapper.xml

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.mapper.HtQuestionOptionDescMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.po.HtQuestionOptionDesc">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="option_id" jdbcType="BIGINT" property="optionId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, option_id, sort, type, content, remark, create_time, update_time, is_del
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionOptionDescExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_ht_question_option_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_ht_question_option_desc
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_ht_question_option_desc
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionOptionDescExample">
delete from t_ht_question_option_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ht.bean.po.HtQuestionOptionDesc">
insert into t_ht_question_option_desc (id, option_id, sort,
type, content, remark,
create_time, update_time, is_del
)
values (#{id,jdbcType=BIGINT}, #{optionId,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER},
#{type,jdbcType=TINYINT}, #{content,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtQuestionOptionDesc">
insert into t_ht_question_option_desc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="optionId != null">
option_id,
</if>
<if test="sort != null">
sort,
</if>
<if test="type != null">
type,
</if>
<if test="content != null">
content,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDel != null">
is_del,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="optionId != null">
#{optionId,jdbcType=BIGINT},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionOptionDescExample" resultType="java.lang.Long">
select count(*) from t_ht_question_option_desc
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_ht_question_option_desc
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.optionId != null">
option_id = #{record.optionId,jdbcType=BIGINT},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_ht_question_option_desc
set id = #{record.id,jdbcType=BIGINT},
option_id = #{record.optionId,jdbcType=BIGINT},
sort = #{record.sort,jdbcType=INTEGER},
type = #{record.type,jdbcType=TINYINT},
content = #{record.content,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ht.bean.po.HtQuestionOptionDesc">
update t_ht_question_option_desc
<set>
<if test="optionId != null">
option_id = #{optionId,jdbcType=BIGINT},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ht.bean.po.HtQuestionOptionDesc">
update t_ht_question_option_desc
set option_id = #{optionId,jdbcType=BIGINT},
sort = #{sort,jdbcType=INTEGER},
type = #{type,jdbcType=TINYINT},
content = #{content,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

338
ht/src/main/resources/mapper_raw/HtQuestionRecordMapper.xml

@ -0,0 +1,338 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.mapper.HtQuestionRecordMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.po.HtQuestionRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="record_type" jdbcType="TINYINT" property="recordType" />
<result column="question_id" jdbcType="BIGINT" property="questionId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="calc_type" jdbcType="TINYINT" property="calcType" />
<result column="show_title" jdbcType="VARCHAR" property="showTitle" />
<result column="show_form" jdbcType="VARCHAR" property="showForm" />
<result column="default_value" jdbcType="VARCHAR" property="defaultValue" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, record_type, question_id, sort, calc_type, show_title, show_form, default_value,
type, remark, create_time, update_time, is_del
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_ht_question_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_ht_question_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_ht_question_record
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordExample">
delete from t_ht_question_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ht.bean.po.HtQuestionRecord">
insert into t_ht_question_record (id, record_type, question_id,
sort, calc_type, show_title,
show_form, default_value, type,
remark, create_time, update_time,
is_del)
values (#{id,jdbcType=BIGINT}, #{recordType,jdbcType=TINYINT}, #{questionId,jdbcType=BIGINT},
#{sort,jdbcType=INTEGER}, #{calcType,jdbcType=TINYINT}, #{showTitle,jdbcType=VARCHAR},
#{showForm,jdbcType=VARCHAR}, #{defaultValue,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{isDel,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtQuestionRecord">
insert into t_ht_question_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="recordType != null">
record_type,
</if>
<if test="questionId != null">
question_id,
</if>
<if test="sort != null">
sort,
</if>
<if test="calcType != null">
calc_type,
</if>
<if test="showTitle != null">
show_title,
</if>
<if test="showForm != null">
show_form,
</if>
<if test="defaultValue != null">
default_value,
</if>
<if test="type != null">
type,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDel != null">
is_del,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="recordType != null">
#{recordType,jdbcType=TINYINT},
</if>
<if test="questionId != null">
#{questionId,jdbcType=BIGINT},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="calcType != null">
#{calcType,jdbcType=TINYINT},
</if>
<if test="showTitle != null">
#{showTitle,jdbcType=VARCHAR},
</if>
<if test="showForm != null">
#{showForm,jdbcType=VARCHAR},
</if>
<if test="defaultValue != null">
#{defaultValue,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordExample" resultType="java.lang.Long">
select count(*) from t_ht_question_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_ht_question_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.recordType != null">
record_type = #{record.recordType,jdbcType=TINYINT},
</if>
<if test="record.questionId != null">
question_id = #{record.questionId,jdbcType=BIGINT},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.calcType != null">
calc_type = #{record.calcType,jdbcType=TINYINT},
</if>
<if test="record.showTitle != null">
show_title = #{record.showTitle,jdbcType=VARCHAR},
</if>
<if test="record.showForm != null">
show_form = #{record.showForm,jdbcType=VARCHAR},
</if>
<if test="record.defaultValue != null">
default_value = #{record.defaultValue,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_ht_question_record
set id = #{record.id,jdbcType=BIGINT},
record_type = #{record.recordType,jdbcType=TINYINT},
question_id = #{record.questionId,jdbcType=BIGINT},
sort = #{record.sort,jdbcType=INTEGER},
calc_type = #{record.calcType,jdbcType=TINYINT},
show_title = #{record.showTitle,jdbcType=VARCHAR},
show_form = #{record.showForm,jdbcType=VARCHAR},
default_value = #{record.defaultValue,jdbcType=VARCHAR},
type = #{record.type,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ht.bean.po.HtQuestionRecord">
update t_ht_question_record
<set>
<if test="recordType != null">
record_type = #{recordType,jdbcType=TINYINT},
</if>
<if test="questionId != null">
question_id = #{questionId,jdbcType=BIGINT},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="calcType != null">
calc_type = #{calcType,jdbcType=TINYINT},
</if>
<if test="showTitle != null">
show_title = #{showTitle,jdbcType=VARCHAR},
</if>
<if test="showForm != null">
show_form = #{showForm,jdbcType=VARCHAR},
</if>
<if test="defaultValue != null">
default_value = #{defaultValue,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ht.bean.po.HtQuestionRecord">
update t_ht_question_record
set record_type = #{recordType,jdbcType=TINYINT},
question_id = #{questionId,jdbcType=BIGINT},
sort = #{sort,jdbcType=INTEGER},
calc_type = #{calcType,jdbcType=TINYINT},
show_title = #{showTitle,jdbcType=VARCHAR},
show_form = #{showForm,jdbcType=VARCHAR},
default_value = #{defaultValue,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

276
ht/src/main/resources/mapper_raw/HtQuestionRecordOptionMapper.xml

@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ht.persist.mapper.HtQuestionRecordOptionMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ht.bean.po.HtQuestionRecordOption">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="question_record_id" jdbcType="BIGINT" property="questionRecordId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="data_key" jdbcType="VARCHAR" property="dataKey" />
<result column="data_value" jdbcType="VARCHAR" property="dataValue" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, question_record_id, sort, data_key, data_value, remark, create_time, update_time,
is_del
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordOptionExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_ht_question_record_option
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_ht_question_record_option
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_ht_question_record_option
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordOptionExample">
delete from t_ht_question_record_option
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordOption">
insert into t_ht_question_record_option (id, question_record_id, sort,
data_key, data_value, remark,
create_time, update_time, is_del
)
values (#{id,jdbcType=BIGINT}, #{questionRecordId,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER},
#{dataKey,jdbcType=VARCHAR}, #{dataValue,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordOption">
insert into t_ht_question_record_option
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="questionRecordId != null">
question_record_id,
</if>
<if test="sort != null">
sort,
</if>
<if test="dataKey != null">
data_key,
</if>
<if test="dataValue != null">
data_value,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="isDel != null">
is_del,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="questionRecordId != null">
#{questionRecordId,jdbcType=BIGINT},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="dataKey != null">
#{dataKey,jdbcType=VARCHAR},
</if>
<if test="dataValue != null">
#{dataValue,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
#{isDel,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordOptionExample" resultType="java.lang.Long">
select count(*) from t_ht_question_record_option
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_ht_question_record_option
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.questionRecordId != null">
question_record_id = #{record.questionRecordId,jdbcType=BIGINT},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.dataKey != null">
data_key = #{record.dataKey,jdbcType=VARCHAR},
</if>
<if test="record.dataValue != null">
data_value = #{record.dataValue,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isDel != null">
is_del = #{record.isDel,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_ht_question_record_option
set id = #{record.id,jdbcType=BIGINT},
question_record_id = #{record.questionRecordId,jdbcType=BIGINT},
sort = #{record.sort,jdbcType=INTEGER},
data_key = #{record.dataKey,jdbcType=VARCHAR},
data_value = #{record.dataValue,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordOption">
update t_ht_question_record_option
<set>
<if test="questionRecordId != null">
question_record_id = #{questionRecordId,jdbcType=BIGINT},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="dataKey != null">
data_key = #{dataKey,jdbcType=VARCHAR},
</if>
<if test="dataValue != null">
data_value = #{dataValue,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="isDel != null">
is_del = #{isDel,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ht.bean.po.HtQuestionRecordOption">
update t_ht_question_record_option
set question_record_id = #{questionRecordId,jdbcType=BIGINT},
sort = #{sort,jdbcType=INTEGER},
data_key = #{dataKey,jdbcType=VARCHAR},
data_value = #{dataValue,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

58
question/src/main/java/com/ccsens/question/api/PatientReportSearchController.java

@ -0,0 +1,58 @@
package com.ccsens.question.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.question.bean.dto.PatientReportSearchDto;
import com.ccsens.question.bean.vo.PatientReportSearchVo;
import com.ccsens.question.service.IPatientReportService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/3/10 15:03
*/
@Slf4j
@Api(tags = "报告单搜索",value = "报告单搜索条件,搜索")
@RestController
@RequestMapping("/patientReport")
public class PatientReportSearchController {
@Resource
private IPatientReportService patientReportService;
@MustLogin
@ApiOperation(value = "查询搜索条件",notes = "whj 查询搜索条件")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "查询搜索条件", required = true)
})
@RequestMapping(value="/searchParam", method = RequestMethod.POST)
public JsonResponse<PatientReportSearchVo.SearchParam> searchParam(@RequestBody @ApiParam @Valid QueryDto<PatientReportSearchDto.SearchParam> dto){
log.info("查询搜索条件:{}", dto);
List<PatientReportSearchVo.SearchParam> params = patientReportService.searchParam(dto.getParam());
log.info("查询搜索条件已完成:{}", params);
return JsonResponse.newInstance().ok(params);
}
@MustLogin
@ApiOperation(value = "根据条件搜索报告单",notes = "whj 搜索报告单")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "查询搜索条件", required = true)
})
@RequestMapping(value="/search", method = RequestMethod.POST)
public JsonResponse<PatientReportSearchVo.Search> search(@RequestBody @ApiParam @Valid QueryDto<PatientReportSearchDto.SearchList> dto){
log.info("搜索报告单:{}", dto);
List<PatientReportSearchVo.Search> params = patientReportService.search(dto.getParam());
log.info("搜索报告单已完成");
return JsonResponse.newInstance().ok(params);
}
}

38
question/src/main/java/com/ccsens/question/bean/dto/PatientReportSearchDto.java

@ -0,0 +1,38 @@
package com.ccsens.question.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/3/10 16:21
*/
public class PatientReportSearchDto {
@Data
@ApiModel("搜索条件-请求参数")
public static class SearchParam{
@ApiModelProperty("查询类型")
@NotEmpty(message = "请输入查询报告单类型")
private String parentCode;
}
@Data
@ApiModel("搜索报告单参数列表-请求")
public static class SearchList {
private List<Search> codes;
}
@Data
@ApiModel("搜索报告单参数-请求")
public static class Search {
@NotEmpty(message="请选择查询类型")
private String code;
private Integer start;
private Integer end;
}
}

2
question/src/main/java/com/ccsens/question/bean/dto/QuestionDto.java

@ -115,6 +115,8 @@ public class QuestionDto {
@NotBlank(message = "上级code不能为空")
@ApiModelProperty("上级code")
private String code;
@ApiModelProperty("是否显示报告单 0:否 1:是,默认为是")
private byte showReport = 1;
}
}

33
question/src/main/java/com/ccsens/question/bean/vo/PatientReportSearchVo.java

@ -0,0 +1,33 @@
package com.ccsens.question.bean.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/3/10 16:06
*/
public class PatientReportSearchVo {
@Data
@ApiModel("搜索条件-响应")
public static class SearchParam {
private Long id;
private String code;
private String name;
private byte optionStatus;
private String parentCode;
private List<SearchParam> children = new ArrayList<>();
}
@Data
@ApiModel("搜索-响应")
public static class Search {
private Long id;
private String name;
}
}

36
question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java

@ -142,23 +142,23 @@ public class PatientReportVo {
//第一栏
rows.add(
fillRow(
"姓名:" + this.patientName,
"性别:" + (this.sex == 0 ? "男" : "女"),
"年龄:" + this.patientAge + " 岁")
"姓名:" + (StrUtil.isEmpty(this.patientName) ? "" : this.patientName),
"性别:" + (this.sex == null ? "" : this.sex == 0 ? "男" : "女"),
"年龄:" + (this.patientAge != null && this.patientAge != 0 ? this.patientAge + " 岁" : ""))
);
//第二栏
rows.add(
fillRow(
"文化程度:" + this.educationalStatusUnit + "年",
"编号:" + this.serialNumber,
"职业:" + careerMap.get(this.career))
"文化程度:" + (StrUtil.isEmpty(this.educationalStatusUnit) ? "" : this.educationalStatusUnit + "年"),
"编号:" + (StrUtil.isEmpty(this.serialNumber) ? "" : this.serialNumber),
"职业:" + (this.career != null ? careerMap.get(this.career) : ""))
);
//第三栏
rows.add(
fillRow(
"科别:" + this.department,
"床号:" + this.bedNumber,
"病案号:" + this.hospitalNumber)
"科别:" + (StrUtil.isEmpty(this.department) ? "" : this.department),
"床号:" + (StrUtil.isEmpty(this.bedNumber) ? "" : this.bedNumber),
"病案号:" + (StrUtil.isEmpty(this.hospitalNumber) ? "" : this.hospitalNumber))
);
//第四栏
// Date date = null;
@ -169,7 +169,7 @@ public class PatientReportVo {
rows.add(
fillRow(
"临床诊断:" + this.clinicalDiagnosis,
"临床诊断:" + (StrUtil.isEmpty(this.clinicalDiagnosis) ? "" : this.clinicalDiagnosis),
"","")
// "检查日期:" + (date == null ? "" : DateUtil.format(date, "yyyy-MM-dd")))
);
@ -273,7 +273,7 @@ public class PatientReportVo {
cell.setContent(this.code + (StrUtil.isBlank(this.remark) ? "" : "("+this.remark+")"));
cell.setRowSpan(2);
cell.setColSpan(npi.equalsIgnoreCase(this.code) ? headNum : 1);
cell.setBorderTop(mmse.equalsIgnoreCase(this.code) ? 1 : 0);
// cell.setBorderTop(mmse.equalsIgnoreCase(this.code) ? 1 : 0);
row1.addCell(cell);
//被合并cell
PdfUtil.Row row2 = new PdfUtil.Row();
@ -282,11 +282,11 @@ public class PatientReportVo {
this.subReport.forEach(reportScore -> {
String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : "");
boolean isLast = npi.equalsIgnoreCase(this.code) && this.subReport.indexOf(reportScore) == this.subReport.size() - 1;
fillRow(row1,row2, reportScore.getName(), score, mmse.equalsIgnoreCase(this.code), isLast, npi.equalsIgnoreCase(this.code) ? new int[]{3,3} : null);
fillRow(row1,row2, reportScore.getName(), score, isLast, npi.equalsIgnoreCase(this.code) ? new int[]{3,3} : null);
});
// 总分
if (mmse.equalsIgnoreCase(this.code)) {
fillRow(row1,row2, "总分", (this.score == null ? "" : this.score) + (this.totalScore > 0 ? "/" + this.totalScore : ""), mmse.equalsIgnoreCase(this.code), true);
fillRow(row1,row2, "总分", (this.score == null ? "" : this.score) + (this.totalScore > 0 ? "/" + this.totalScore : ""), true);
}
rows.add(row1);
rows.add(row2);
@ -305,10 +305,10 @@ public class PatientReportVo {
ReportScore reportScore = this.subReport.get(i);
String jy = "JY";
if (jy.equalsIgnoreCase(reportScore.getCode())) {
fillRow(row1, row2, reportScore.getName(), " ", false, false, i == 0 ? new int[]{2,2}: null);
fillRow(row1, row2, reportScore.getName(), " ", false, i == 0 ? new int[]{2,2}: null);
} else {
String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : "");
fillRow(row1, row2, reportScore.getName(), score, false, false, i == 0 ? new int[]{2,2}: null);
fillRow(row1, row2, reportScore.getName(), score, false, i == 0 ? new int[]{2,2}: null);
}
}
PdfUtil.Cell scoreNameCell = new PdfUtil.Cell();
@ -328,7 +328,7 @@ public class PatientReportVo {
PdfUtil.Row row5 = new PdfUtil.Row();
//延迟回忆特殊处理
String ychy = "YCHY";
int size = this.subReport.size() - 1;
int size = this.subReport.size();
for (int i = firstIndex; i < size; i++) {
ReportScore reportScore = this.subReport.get(i);
//设置名字
@ -392,11 +392,11 @@ public class PatientReportVo {
// }
// }
private void fillRow(PdfUtil.Row row1, PdfUtil.Row row2, String name, String score, boolean isTop, boolean isRight, int... colspan){
private void fillRow(PdfUtil.Row row1, PdfUtil.Row row2, String name, String score, boolean isRight, int... colspan){
//名称
PdfUtil.Cell cell1 = new PdfUtil.Cell();
cell1.setContent(name);
cell1.setBorderTop(isTop? 1 : 0);
// cell1.setBorderTop(isTop? 1 : 0);
cell1.setBorderRight(isRight? 1 : 0);
cell1.setColSpan(colspan == null || colspan.length == 0 ? 1 : colspan[0]);
row1.addCell(cell1);

9
question/src/main/java/com/ccsens/question/persist/dao/HtPatientReportDao.java

@ -1,6 +1,8 @@
package com.ccsens.question.persist.dao;
import com.ccsens.question.bean.dto.PatientReportDto;
import com.ccsens.question.bean.dto.PatientReportSearchDto;
import com.ccsens.question.bean.vo.PatientReportSearchVo;
import com.ccsens.question.bean.vo.PatientReportVo;
import com.ccsens.question.persist.mapper.HtPatientReportMapper;
import org.apache.ibatis.annotations.Param;
@ -95,4 +97,11 @@ public interface HtPatientReportDao extends HtPatientReportMapper {
* @return
*/
List<PatientReportVo.ReportDetailAnswer> queryReportAnswer(@Param("id") Long id, @Param("evaluationCode") String evaluationCode);
/**
* 根据分数搜索报告单
* @param codes 分数
* @return 报告单
*/
List<PatientReportSearchVo.Search> search(@Param("codes") List<PatientReportSearchDto.Search> codes);
}

8
question/src/main/java/com/ccsens/question/persist/dao/HtReportDao.java

@ -1,6 +1,7 @@
package com.ccsens.question.persist.dao;
import com.ccsens.question.bean.po.HtReport;
import com.ccsens.question.bean.vo.PatientReportSearchVo;
import com.ccsens.question.bean.vo.QuestionVo;
import com.ccsens.question.persist.mapper.HtReportMapper;
import org.apache.ibatis.annotations.Param;
@ -37,4 +38,11 @@ public interface HtReportDao extends HtReportMapper {
* @return 返回测评类型
*/
List<QuestionVo.ReportCode> queryReportCode(@Param("code") String code);
/**
* 查询所有下级菜单和是否有试题
* @param parentCode 父code
* @return 搜索条件
*/
List<PatientReportSearchVo.SearchParam> queryParam(@Param("parentCode") String parentCode);
}

15
question/src/main/java/com/ccsens/question/service/IPatientReportService.java

@ -1,7 +1,9 @@
package com.ccsens.question.service;
import com.ccsens.question.bean.dto.PatientReportDto;
import com.ccsens.question.bean.dto.PatientReportSearchDto;
import com.ccsens.question.bean.po.HtDoctor;
import com.ccsens.question.bean.vo.PatientReportSearchVo;
import com.ccsens.question.bean.vo.PatientReportVo;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.JsonResponse;
@ -142,4 +144,17 @@ public interface IPatientReportService {
List<PatientReportVo.ReportDetailAnswer> queryReportAnswer(PatientReportDto.QueryReportAnswer param, Long userId);
/**
* 查询报告单的搜索条件
* @param param 父code
* @return 搜索条件
*/
List<PatientReportSearchVo.SearchParam> searchParam(PatientReportSearchDto.SearchParam param);
/**
* 搜索报告单
* @param param 搜索列表
* @return 报告单
*/
List<PatientReportSearchVo.Search> search(PatientReportSearchDto.SearchList param);
}

163
question/src/main/java/com/ccsens/question/service/PatientReportService.java

@ -3,15 +3,17 @@ package com.ccsens.question.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.question.bean.dto.PatientReportDto;
import com.ccsens.question.bean.dto.PatientReportSearchDto;
import com.ccsens.question.bean.po.*;
import com.ccsens.question.bean.vo.PatientReportSearchVo;
import com.ccsens.question.bean.vo.PatientReportVo;
import com.ccsens.question.persist.dao.HtDoctorDao;
import com.ccsens.question.persist.dao.HtPatientReportDao;
import com.ccsens.question.persist.dao.HtPositionDao;
import com.ccsens.question.persist.dao.HtReportDao;
import com.ccsens.question.persist.mapper.HtPatientFollowUpMapper;
import com.ccsens.question.persist.mapper.HtPatientMapper;
import com.ccsens.question.persist.mapper.HtPatientReportRecordMapper;
@ -22,7 +24,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -46,7 +47,7 @@ import java.util.concurrent.atomic.AtomicReference;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class PatientReportService implements IPatientReportService {
@Autowired
@Resource
private Snowflake snowflake;
@Resource
private HtDoctorDao htDoctorDao;
@ -60,11 +61,13 @@ public class PatientReportService implements IPatientReportService {
private HtPatientReportRecordMapper htPatientReportRecordMapper;
@Resource
private HtPatientFollowUpMapper htPatientFollowUpMapper;
@Resource
private HtReportDao htReportDao;
@Override
public JsonResponse<PatientReportVo.Generate> generatePatientReport(PatientReportDto.Generate generate, Long userId) {
log.info("生成报告单请求参数:userId:{}, patientReport:{}", userId, generate);
// //查询医生信息
//查询医生信息
// HtDoctorExample doctorExample = new HtDoctorExample();
// doctorExample.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS).andIsDelEqualTo(Constant.Ht.NUMBER_DEFAULT);
// List<HtDoctor> doctors = htDoctorDao.selectByExample(doctorExample);
@ -83,7 +86,6 @@ public class PatientReportService implements IPatientReportService {
HtPatientReport htPatientReport = new HtPatientReport();
htPatientReport.setId(snowflake.nextId());
// htPatientReport.setDoctorId(doctors.get(0).getId());
htPatientReport.setUserId(userId);
htPatientReport.setPatientId(generate.getPatientId());
// htPatientReport.setPatientIdcard(htPatient.getIdcard());
// htPatientReport.setPatientAge(StrUtil.isEmpty(htPatient.getIdcard()) ? null : (byte)IdcardUtil.getAgeByIdCard(htPatient.getIdcard()));
@ -109,50 +111,51 @@ public class PatientReportService implements IPatientReportService {
return CodeEnum.PARAM_ERROR;
}
//查询修改医生信息
HtDoctorExample example = new HtDoctorExample();
example.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS);
List<HtDoctor> doctors = htDoctorDao.selectByExample(example);
if (CollectionUtils.isEmpty(doctors)) {
log.info("{}医生信息尚未审核通过");
return CodeEnum.AUDIT_NOT_PASS;
}
HtDoctor doctor = doctors.get(0);
//判断该报告单是否为该医生的
HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(htPatientReport.getDoctorId());
// 上级医生和报告单医生允许修改
List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId());
if (!doctor.getId().equals(reportDoctor.getId()) && !lowerPositionIds.contains(reportDoctor.getPositionId())) {
log.info("不具备修改权限");
return CodeEnum.REPORT_DOCTOR_ERROR;
}
// HtDoctorExample example = new HtDoctorExample();
// example.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS);
// List<HtDoctor> doctors = htDoctorDao.selectByExample(example);
// if (CollectionUtils.isEmpty(doctors)) {
// log.info("{}医生信息尚未审核通过");
// return CodeEnum.AUDIT_NOT_PASS;
// }
// HtDoctor doctor = doctors.get(0);
// //判断该报告单是否为该医生的
// HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(htPatientReport.getDoctorId());
// // 上级医生和报告单医生允许修改
// List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId());
// if (!doctor.getId().equals(reportDoctor.getId()) && !lowerPositionIds.contains(reportDoctor.getPositionId())) {
// log.info("不具备修改权限");
// return CodeEnum.REPORT_DOCTOR_ERROR;
// }
//记录病人的随访记录
if (StrUtil.isEmpty(htPatientReport.getInitialImpression())) {
//1.统计病人的报告单的总数
HtPatientReportExample patientReportExample = new HtPatientReportExample();
patientReportExample.createCriteria().andPatientIdEqualTo(htPatientReport.getPatientId()).andInitialImpressionIsNotNull();
long count = htPatientReportDao.countByExample(patientReportExample);
HtPatientFollowUp followUp = new HtPatientFollowUp();
followUp.setId(snowflake.nextId());
followUp.setPatientId(htPatientReport.getPatientId());
followUp.setFollowUpDatetime(new Date());
followUp.setFollowUpTimes((int)count+1);
followUp.setRecorder(htPatientReport.getDoctorId());
followUp.setDiagnose(doctor.getId());
htPatientFollowUpMapper.insertSelective(followUp);
}
// //记录病人的随访记录
// if (StrUtil.isEmpty(htPatientReport.getInitialImpression())) {
// //1.统计病人的报告单的总数
// HtPatientReportExample patientReportExample = new HtPatientReportExample();
// patientReportExample.createCriteria().andPatientIdEqualTo(htPatientReport.getPatientId()).andInitialImpressionIsNotNull();
// long count = htPatientReportDao.countByExample(patientReportExample);
// HtPatientFollowUp followUp = new HtPatientFollowUp();
// followUp.setId(snowflake.nextId());
// followUp.setPatientId(htPatientReport.getPatientId());
// followUp.setFollowUpDatetime(new Date());
// followUp.setFollowUpTimes((int)count+1);
// followUp.setRecorder(htPatientReport.getDoctorId());
// followUp.setDiagnose(doctor.getId());
// htPatientFollowUpMapper.insertSelective(followUp);
// }
//修改报告单
HtPatientReport copy = patientReport.copy();
copy.setUrl(Constant.Ht.STRING_DEFAULT);
copy.setQrCodeUrl(Constant.Ht.STRING_DEFAULT);
copy.setCompleteStatus(Constant.Ht.Report.COMPLETE_OK);
copy.setShowStatus(Constant.Ht.Report.SHOW_HISTORY);
htPatientReportDao.updateByPrimaryKeySelective(copy);
log.info("成功编辑报告单信息");
HtPatientReportRecord record = new HtPatientReportRecord();
record.setId(snowflake.nextId());
record.setReportId(htPatientReport.getId());
record.setDoctorId(doctor.getId());
record.setDoctorId(userId);
record.setContent(patientReport.toString());
htPatientReportRecordMapper.insertSelective(record);
log.info("记录编辑日志");
@ -182,34 +185,34 @@ public class PatientReportService implements IPatientReportService {
//分页查询报告单列表
PageHelper.startPage(query.getPageNum(), query.getPageSize());
List<PatientReportVo.ReportName> reportVos = htPatientReportDao.queryReportName(doctorId, patientId);
if (CollectionUtils.isEmpty(reportVos)) {
return new PageInfo<>(reportVos);
}
if (CollectionUtil.isEmpty(doctors)) {
return new PageInfo<>(reportVos);
}
HtDoctor doctor = doctors.get(0);
//查询下属职务
List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId());
reportVos.forEach(reportVo -> {
//自己的可见详情
if (doctor.getId().equals(reportVo.getDoctorId())) {
reportVo.setAuthority((byte)1);
} else if (CollectionUtils.isEmpty(lowerPositionIds)) {
reportVo.setAuthority((byte)0);
} else {
HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(reportVo.getDoctorId());
//自己下属的可见详情
if (lowerPositionIds.contains(reportDoctor.getPositionId())) {
reportVo.setAuthority((byte)1);
} else {
reportVo.setAuthority((byte)0);
}
}
});
// if (CollectionUtils.isEmpty(reportVos)) {
// return new PageInfo<>(reportVos);
// }
//
//
// if (CollectionUtil.isEmpty(doctors)) {
// return new PageInfo<>(reportVos);
// }
// HtDoctor doctor = doctors.get(0);
// //查询下属职务
// List<Long> lowerPositionIds = htPositionDao.queryAllLowerPosition(doctor.getPositionId());
// reportVos.forEach(reportVo -> {
//
// //自己的可见详情
// if (doctor.getId().equals(reportVo.getDoctorId())) {
// reportVo.setAuthority((byte)1);
// } else if (CollectionUtils.isEmpty(lowerPositionIds)) {
// reportVo.setAuthority((byte)0);
// } else {
// HtDoctor reportDoctor = htDoctorDao.selectByPrimaryKey(reportVo.getDoctorId());
// //自己下属的可见详情
// if (lowerPositionIds.contains(reportDoctor.getPositionId())) {
// reportVo.setAuthority((byte)1);
// } else {
// reportVo.setAuthority((byte)0);
// }
// }
// });
return new PageInfo<>(reportVos);
}
@ -403,7 +406,7 @@ public class PatientReportService implements IPatientReportService {
dateCell.setBorderLeft(null);
content.add(row2);
String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, detail.getPatient().toPdfRow(), content, new PdfUtil.Margin());
String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, new PdfUtil.Margin(), detail.getPatient().toPdfRow(), content);
report.setUrl(path);
htPatientReportDao.updateByPrimaryKeySelective(report);
log.info("生成文件路径:{}", path);
@ -578,5 +581,31 @@ public class PatientReportService implements IPatientReportService {
return htPatientReportDao.queryReportAnswer(param.getId(),param.getEvaluationCode());
}
@Override
public List<PatientReportSearchVo.SearchParam> searchParam(PatientReportSearchDto.SearchParam param) {
List<PatientReportSearchVo.SearchParam> list = htReportDao.queryParam(param.getParentCode());
if (CollectionUtil.isEmpty(list)) {
return list;
}
Map<String, PatientReportSearchVo.SearchParam> map = new HashMap<>();
List<PatientReportSearchVo.SearchParam> nodes = new ArrayList<>();
list.forEach(searchParam -> {
if (param.getParentCode().equals(searchParam.getParentCode())) {
nodes.add(searchParam);
} else {
PatientReportSearchVo.SearchParam parent = map.get(searchParam.getParentCode());
parent.getChildren().add(searchParam);
}
map.put(searchParam.getCode(), searchParam);
});
return nodes;
}
@Override
public List<PatientReportSearchVo.Search> search(PatientReportSearchDto.SearchList param) {
List<PatientReportSearchVo.Search> list = htPatientReportDao.search(param.getCodes());
return list;
}
}

10
question/src/main/java/com/ccsens/question/service/QuestionService.java

@ -803,6 +803,14 @@ public class QuestionService implements IQuestionService {
*/
@Override
public List<QuestionVo.ReportCode> queryReportCode(QuestionDto.QueryReportCode param, Long userId) {
return htReportDao.queryReportCode(param.getCode());
List<QuestionVo.ReportCode> codes = htReportDao.queryReportCode(param.getCode());
if (param.getShowReport() == Constant.STATUS_YES) {
log.info("添加生成报告单");
QuestionVo.ReportCode code = new QuestionVo.ReportCode();
code.setCode("BGDSC");
code.setName("报告单编辑");
codes.add(code);
}
return codes;
}
}

18
question/src/main/java/com/ccsens/question/uitl/Constant.java

@ -20,6 +20,11 @@ public class Constant {
public static final String VIDEO = ".flv,swf,mkv,avi,rm,rmvb,mpeg,mpg,.ogg,ogv,mov,wmv,mp4,webm,mp3,wav,mid,.wma";
/**上传图片访问路径*/
public static final String UPLOAD_URL = "uploads/";
/**状态:是*/
public static final byte STATUS_YES = 1;
/**状态:否*/
public static final byte STATUS_NO = 0;
/**病友画图轨迹颜色*/
public static final class LineColour {
@ -55,10 +60,11 @@ public class Constant {
public final static String DOCTOR_PARAM = "doctor";
public final static byte SEX_MAN = 0;
public final static byte SEX_WOMAN = 1;
/**删除*/
public final static byte IS_DEL = 1;
public final static class Rule {
public static final byte SMALL = 0;
public static final String SMALL_NUM = "small";
@ -111,14 +117,14 @@ public class Constant {
public final static List<String> QUESTION_TYPE = new ArrayList<>();
public final static Map<String, Byte> TYPE = new HashMap<>();
static {
QUESTION_TYPE.add("NIHSS");
QUESTION_TYPE.add("BI");
QUESTION_TYPE.add("ADL");
QUESTION_TYPE.add("HIS");
QUESTION_TYPE.add("MMSE");
QUESTION_TYPE.add("HAMA");
QUESTION_TYPE.add("HAMD");
QUESTION_TYPE.add("NPI");
QUESTION_TYPE.add("MMSE");
QUESTION_TYPE.add("MoCA");
QUESTION_TYPE.add("Rey");
QUESTION_TYPE.add("XFXPD");
}
}

4
question/src/main/resources/application-dev.yml

@ -30,8 +30,8 @@ swagger:
file:
path: /home/cloud/question/uploads/
#domain: https://api.ccsens.com/test/
domain: http://localhost:7040/
imgDomain: http://localhost:7040/uploads
domain: http://localhost:7160/
imgDomain: http://localhost:7160/uploads
ht:
project:
patientUrl: https://www.baidu.com/

8
question/src/main/resources/application-green.yml

@ -1,5 +1,5 @@
server:
port: 7040
port: 7160
servlet:
context-path:
spring:
@ -31,11 +31,11 @@ swagger:
file:
path: /home/cloud/question/uploads/
#domain: https://api.ccsens.com/test/
domain: https://test.tall.wiki/gateway/question/
imgDomain: https://test.tall.wiki/gateway/question/uploads
domain: https://sxzxyzzlm.tall.wiki/gateway/question/
imgDomain: https://sxzxyzzlm.tall.wiki/gateway/question/uploads
ht:
project:
patientUrl: https://test.tall.wiki/ht-dev/htPatientRegister
patientUrl: https://sxzxyzzlm.tall.wiki/ht-dev/htPatientRegister
name: 认知功能评测云平台系统
eureka:
instance:

6
question/src/main/resources/druid-dev.yml

@ -15,7 +15,7 @@ spring:
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password: b3fd300ad4694070007fdcca961c4018211dc53235dd806ad62abc0cc0abb8e5
password: 1b01d55a27843cfc487ce8dd6915fc22
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
@ -27,7 +27,7 @@ spring:
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://49.233.89.188:3306/question?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://49.232.6.143:3306/question?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_HT
env: CCSENS_ENTERPRISE

38
question/src/main/resources/mapper_dao/HtPatientReportDao.xml

@ -40,9 +40,10 @@
<select id="queryReportResult" resultMap="BaseResultMap">
select r.*, d.name as doctor_name, p.name as patient_name, p.sex, p.educational_status, p.educational_status_unit, p.career, p.hospital_number, p.patient_number
from t_ht_patient_report r, t_ht_patient p, t_ht_doctor d
where r.patient_id = p.id and r.doctor_id = d.id and r.id = #{id, jdbcType=BIGINT}
and r.is_del = 0 and p.is_del = 0 and d.is_del = 0
from t_ht_patient_report r left join t_ht_patient p on r.patient_id = p.id and p.is_del = 0
left join t_ht_doctor d on r.doctor_id = d.id and d.is_del = 0
where r.id = #{id, jdbcType=BIGINT}
and r.is_del = 0
</select>
<select id="queryReportScore" resultMap="ScoreMap">
select t1.code,t1.name, t1.description, t1.total_score, t1.remark,t1.type,t1.parent_code, sum(t2.score) as score
@ -224,6 +225,37 @@
and a.questionId = t.question_id
ORDER BY a.questionId ,a.sort
</select>
<select id="search" resultType="com.ccsens.question.bean.vo.PatientReportSearchVo$Search">
<foreach collection="codes" item="item" separator="INTERSECT">
<if test="item.code != null and item.code != '' and (item.start != null or item.end != null)">
SELECT
r.id,
r.NAME
FROM
t_ht_patient_score s,
t_ht_question q,
t_ht_patient_report r
WHERE
s.question_id = q.id
AND s.patient_report_id = r.id
AND s.question_parent_code = #{item.code}
AND s.type IN ( 0, 2 )
AND s.is_del = 0
AND q.is_del = 0
GROUP BY
patient_report_id
HAVING
<trim suffixOverrides="AND">
<if test="item.start != null">
sum( score ) &gt;= #{item.start} AND
</if>
<if test="item.end != null">
sum( score ) &lt;= #{item.end} AND
</if>
</trim>
</if>
</foreach>
</select>
</mapper>

31
question/src/main/resources/mapper_dao/HtReportDao.xml

@ -47,5 +47,36 @@
parent_code = #{code}
ORDER BY sort
</select>
<select id="queryParam" resultType="com.ccsens.question.bean.vo.PatientReportSearchVo$SearchParam">
SELECT
t.id,
t.code,
t.parent_code as parentCode,
t.name,
IF( count( q.id ) > 0, 1, 0 ) AS optionStatus
FROM
(
SELECT
t.id,
t.CODE,
t.parent_code,
t.NAME,
t.type,
t.sort
FROM
(
SELECT
t1.*,
IF ( find_in_set( parent_code, @pcodes ) > 0, @pcodes := concat( @pcodes, ',', CODE ), 0 ) AS ischild
FROM
( SELECT id, CODE, parent_code, NAME, type, sort FROM t_ht_report WHERE is_del = 0 ) t1,
( SELECT @pcodes := #{parentCode} ) t2
) t
WHERE t.ischild != '0'
) t
LEFT JOIN t_ht_question q ON t.CODE = q.parent_code AND q.is_del = 0
GROUP BY t.CODE
ORDER BY t.type,t.parent_code,t.sort
</select>
</mapper>

8
tall/src/main/resources/application-dev.yml

@ -11,11 +11,11 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
# host: 192.168.0.99
host: 127.0.0.1
password: guest
host: 192.168.31.13
# host: 127.0.0.1
password: 111111
port: 5672
username: guest
username: admin
redis:
database: 0
host: 127.0.0.1

5
tall/src/main/resources/application-test.yml

@ -31,6 +31,7 @@ swagger:
enable: true
eureka:
instance:
ip-address: 192.168.31.13
gatewayUrl: http://192.168.0.99/gateway/
ip-address: 127.0.0.1
gatewayUrl: http://test.tall.wiki/gateway/
smsCode: 0

9
tcm/HELP.md

@ -0,0 +1,9 @@
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.2/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.2/maven-plugin/reference/html/#build-image)

29
util/src/main/java/com/ccsens/util/PdfUtil.java

@ -28,14 +28,14 @@ public class PdfUtil {
/**
* 生成pdf
* @param parentPath
* @param title
* @param parentPath 文件夹路径
* @param title 标题
* @param subhead 副标题
* @param intros
* @param content
* @param intros 介绍
* @param contentArr 正文
* @return
*/
public static String credatePdf(String parentPath, String title, String subhead, List<Row> intros, List<Row> content, Margin margin) {
public static String createPdf(String parentPath, String title, String subhead, Margin margin, List<Row> intros, List<Row>... contentArr) {
String fileName = "pdf/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".pdf";
log.info("pdf文件名:{}", fileName );
File file = new File(parentPath, fileName);
@ -66,15 +66,20 @@ public class PdfUtil {
document.add(subheadPar);
}
// 每行加空白
fillBlankRow(document, titleChinese);
fillBlankRow(document, new Font(bfChinese, 12, Font.NORMAL));
//设置介绍内容
if (CollectionUtil.isNotEmpty(intros)) {
fillRow(intros, document);
}
if (CollectionUtil.isNotEmpty(content)) {
fillRow(content, document);
if (contentArr != null && contentArr.length > 0 ) {
for (List<Row> content:contentArr) {
if (CollectionUtil.isNotEmpty(content)) {
fillRow(content, document);
}
}
}
} catch (DocumentException e) {
e.printStackTrace();
log.error("导出pdf异常", e);
@ -129,8 +134,9 @@ public class PdfUtil {
for (int i = 0; i < row.cells.size(); i++) {
Cell cell = row.cells.get(i);
PdfPCell pdfpCell = new PdfPCell(new Phrase(cell.content,font));
pdfpCell.setBorderWidthTop(cell.borderTop == null ? 0 : cell.borderTop);
pdfpCell.setBorderWidthTop(j == 0 && cell.borderTop == null && cell.borderBottom != null ? cell.borderBottom : cell.borderTop == null ? 0 : cell.borderTop);
pdfpCell.setBorderWidthLeft(cell.borderLeft == null ? 0 : cell.borderLeft);
// pdfpCell.setBorderWidthRight(i==row.cells.size() && cell.borderRight == null && cell.borderLeft != null ? cell.borderLeft : cell.borderRight == null ? 0 : cell.borderRight);
pdfpCell.setBorderWidthRight(cell.borderRight == null ? 0 : cell.borderRight);
pdfpCell.setBorderWidthBottom(cell.borderBottom == null ? 0 : cell.borderBottom);
pdfpCell.setColspan(cell.colSpan);
@ -195,6 +201,11 @@ public class PdfUtil {
// 单元格是否居中
private boolean isCenter = true;
public Cell() {
}
public Cell(String content) {
this.content = content;
}
}
/**

2
util/src/test/java/com/ccsens/util/PdfUtilTest.java

@ -49,7 +49,7 @@ public class PdfUtilTest {
contents.add(row);
contents.add(row2);
}
PdfUtil.credatePdf("/home/", "山大一院","评测", rows, contents, new PdfUtil.Margin());
PdfUtil.createPdf("/home/", "山大一院","评测", new PdfUtil.Margin(), rows, contents);
}

Loading…
Cancel
Save