Browse Source

HT 查询未完成测评

master
zhizhi wu 5 years ago
parent
commit
dcabc44f8c
  1. 28
      ht/src/main/java/com/ccsens/ht/api/PatientReportController.java
  2. 8
      ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java
  3. 46
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java
  4. 210
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java
  5. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReport.java
  6. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportExample.java
  7. 245
      ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java
  8. 13
      ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java
  9. 15
      ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java
  10. 30
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java
  11. 4
      ht/src/main/java/com/ccsens/ht/service/PatientService.java
  12. 34
      ht/src/main/java/com/ccsens/ht/service/QuestionService.java
  13. 10
      ht/src/main/java/com/ccsens/ht/uitl/Constant.java
  14. 4
      ht/src/main/resources/application.yml
  15. 18
      ht/src/main/resources/mapper_dao/HtPatientReportDao.xml
  16. 85
      ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml
  17. 28
      ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml
  18. 4
      pom.xml
  19. 2
      tall/src/main/java/com/ccsens/tall/bean/vo/DomainVo.java
  20. 3
      tall/src/main/java/com/ccsens/tall/service/SysDomainService.java
  21. 40
      util/src/main/java/com/ccsens/util/PdfUtil.java
  22. 2
      util/src/test/java/com/ccsens/util/PdfUtilTest.java

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

@ -35,6 +35,34 @@ public class PatientReportController {
@Autowired
private IPatientReportService patientReportService;
@MustLogin
@DoctorAudit
@ApiOperation(value = "忽略未完成的报告单",notes = "忽略未完成的报告单")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "报告单信息", required = true)
})
@RequestMapping(value="/ignoreComplete", method = RequestMethod.POST)
public JsonResponse ignoreComplete(@RequestBody @ApiParam @Valid QueryDto<PatientReportDto.Ignore> dto){
log.info("忽略未完成的报告单:{}", dto);
patientReportService.ignoreComplete(dto.getParam(), dto.getUserId());
log.info("忽略未完成的报告单已完成");
return JsonResponse.newInstance().ok();
}
@MustLogin
@DoctorAudit
@ApiOperation(value = "检查是否有未完成的报告单",notes = "检查是否有未完成的报告单")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "报告单信息", required = true)
})
@RequestMapping(value="/checkComplete", method = RequestMethod.POST)
public JsonResponse<PatientReportVo.Complete> checkComplete(@RequestBody @ApiParam @Valid QueryDto dto){
log.info("检查是否有未完成的报告单:{}", dto);
PatientReportVo.Complete complete = patientReportService.checkComplete(dto.getUserId());
log.info("检查是否有未完成的报告单返回:{}", complete);
return JsonResponse.newInstance().ok(complete);
}
@MustLogin
@DoctorAudit
@ApiOperation(value = "生成报告单",notes = "生成报告单")

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

@ -19,6 +19,14 @@ import javax.validation.constraints.Pattern;
*/
public class PatientReportDto {
@Data
@ApiModel("忽略未完成的报告单")
public static class Ignore{
@ApiModelProperty("病人报告单ID")
@NotNull(message = "病人报告单ID不能为空")
private Long id;
}
@ApiModel("PatientReportDtoGenerate")
@Data
public static class Generate{

46
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java

@ -22,7 +22,7 @@ public class HtPatientPersional implements Serializable {
private Integer drinkYear;
private Byte drinkType;
private String drinkType;
private Integer drinkAmount;
@ -30,7 +30,7 @@ public class HtPatientPersional implements Serializable {
private Integer teaCoffeeYear;
private Byte teaCoffeeType;
private String teaCoffeeType;
private Byte teaCoffeeFrequency;
@ -38,7 +38,7 @@ public class HtPatientPersional implements Serializable {
private Integer teaCoffeeQuitYear;
private Byte dietaryHabit;
private String dietaryHabit;
private Byte workoutTime;
@ -56,6 +56,10 @@ public class HtPatientPersional implements Serializable {
private Long recorder;
private Byte drinkQuit;
private Integer drinkQuitYear;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -130,12 +134,12 @@ public class HtPatientPersional implements Serializable {
this.drinkYear = drinkYear;
}
public Byte getDrinkType() {
public String getDrinkType() {
return drinkType;
}
public void setDrinkType(Byte drinkType) {
this.drinkType = drinkType;
public void setDrinkType(String drinkType) {
this.drinkType = drinkType == null ? null : drinkType.trim();
}
public Integer getDrinkAmount() {
@ -162,12 +166,12 @@ public class HtPatientPersional implements Serializable {
this.teaCoffeeYear = teaCoffeeYear;
}
public Byte getTeaCoffeeType() {
public String getTeaCoffeeType() {
return teaCoffeeType;
}
public void setTeaCoffeeType(Byte teaCoffeeType) {
this.teaCoffeeType = teaCoffeeType;
public void setTeaCoffeeType(String teaCoffeeType) {
this.teaCoffeeType = teaCoffeeType == null ? null : teaCoffeeType.trim();
}
public Byte getTeaCoffeeFrequency() {
@ -194,12 +198,12 @@ public class HtPatientPersional implements Serializable {
this.teaCoffeeQuitYear = teaCoffeeQuitYear;
}
public Byte getDietaryHabit() {
public String getDietaryHabit() {
return dietaryHabit;
}
public void setDietaryHabit(Byte dietaryHabit) {
this.dietaryHabit = dietaryHabit;
public void setDietaryHabit(String dietaryHabit) {
this.dietaryHabit = dietaryHabit == null ? null : dietaryHabit.trim();
}
public Byte getWorkoutTime() {
@ -266,6 +270,22 @@ public class HtPatientPersional implements Serializable {
this.recorder = recorder;
}
public Byte getDrinkQuit() {
return drinkQuit;
}
public void setDrinkQuit(Byte drinkQuit) {
this.drinkQuit = drinkQuit;
}
public Integer getDrinkQuitYear() {
return drinkQuitYear;
}
public void setDrinkQuitYear(Integer drinkQuitYear) {
this.drinkQuitYear = drinkQuitYear;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -298,6 +318,8 @@ public class HtPatientPersional implements Serializable {
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);
sb.append(", recorder=").append(recorder);
sb.append(", drinkQuit=").append(drinkQuit);
sb.append(", drinkQuitYear=").append(drinkQuitYear);
sb.append("]");
return sb.toString();
}

210
ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java

@ -655,52 +655,62 @@ public class HtPatientPersionalExample {
return (Criteria) this;
}
public Criteria andDrinkTypeEqualTo(Byte value) {
public Criteria andDrinkTypeEqualTo(String value) {
addCriterion("drink_type =", value, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeNotEqualTo(Byte value) {
public Criteria andDrinkTypeNotEqualTo(String value) {
addCriterion("drink_type <>", value, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeGreaterThan(Byte value) {
public Criteria andDrinkTypeGreaterThan(String value) {
addCriterion("drink_type >", value, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeGreaterThanOrEqualTo(Byte value) {
public Criteria andDrinkTypeGreaterThanOrEqualTo(String value) {
addCriterion("drink_type >=", value, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeLessThan(Byte value) {
public Criteria andDrinkTypeLessThan(String value) {
addCriterion("drink_type <", value, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeLessThanOrEqualTo(Byte value) {
public Criteria andDrinkTypeLessThanOrEqualTo(String value) {
addCriterion("drink_type <=", value, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeIn(List<Byte> values) {
public Criteria andDrinkTypeLike(String value) {
addCriterion("drink_type like", value, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeNotLike(String value) {
addCriterion("drink_type not like", value, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeIn(List<String> values) {
addCriterion("drink_type in", values, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeNotIn(List<Byte> values) {
public Criteria andDrinkTypeNotIn(List<String> values) {
addCriterion("drink_type not in", values, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeBetween(Byte value1, Byte value2) {
public Criteria andDrinkTypeBetween(String value1, String value2) {
addCriterion("drink_type between", value1, value2, "drinkType");
return (Criteria) this;
}
public Criteria andDrinkTypeNotBetween(Byte value1, Byte value2) {
public Criteria andDrinkTypeNotBetween(String value1, String value2) {
addCriterion("drink_type not between", value1, value2, "drinkType");
return (Criteria) this;
}
@ -895,52 +905,62 @@ public class HtPatientPersionalExample {
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeEqualTo(Byte value) {
public Criteria andTeaCoffeeTypeEqualTo(String value) {
addCriterion("tea_coffee_type =", value, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeNotEqualTo(Byte value) {
public Criteria andTeaCoffeeTypeNotEqualTo(String value) {
addCriterion("tea_coffee_type <>", value, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeGreaterThan(Byte value) {
public Criteria andTeaCoffeeTypeGreaterThan(String value) {
addCriterion("tea_coffee_type >", value, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeGreaterThanOrEqualTo(Byte value) {
public Criteria andTeaCoffeeTypeGreaterThanOrEqualTo(String value) {
addCriterion("tea_coffee_type >=", value, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeLessThan(Byte value) {
public Criteria andTeaCoffeeTypeLessThan(String value) {
addCriterion("tea_coffee_type <", value, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeLessThanOrEqualTo(Byte value) {
public Criteria andTeaCoffeeTypeLessThanOrEqualTo(String value) {
addCriterion("tea_coffee_type <=", value, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeIn(List<Byte> values) {
public Criteria andTeaCoffeeTypeLike(String value) {
addCriterion("tea_coffee_type like", value, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeNotLike(String value) {
addCriterion("tea_coffee_type not like", value, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeIn(List<String> values) {
addCriterion("tea_coffee_type in", values, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeNotIn(List<Byte> values) {
public Criteria andTeaCoffeeTypeNotIn(List<String> values) {
addCriterion("tea_coffee_type not in", values, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeBetween(Byte value1, Byte value2) {
public Criteria andTeaCoffeeTypeBetween(String value1, String value2) {
addCriterion("tea_coffee_type between", value1, value2, "teaCoffeeType");
return (Criteria) this;
}
public Criteria andTeaCoffeeTypeNotBetween(Byte value1, Byte value2) {
public Criteria andTeaCoffeeTypeNotBetween(String value1, String value2) {
addCriterion("tea_coffee_type not between", value1, value2, "teaCoffeeType");
return (Criteria) this;
}
@ -1135,52 +1155,62 @@ public class HtPatientPersionalExample {
return (Criteria) this;
}
public Criteria andDietaryHabitEqualTo(Byte value) {
public Criteria andDietaryHabitEqualTo(String value) {
addCriterion("dietary_habit =", value, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitNotEqualTo(Byte value) {
public Criteria andDietaryHabitNotEqualTo(String value) {
addCriterion("dietary_habit <>", value, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitGreaterThan(Byte value) {
public Criteria andDietaryHabitGreaterThan(String value) {
addCriterion("dietary_habit >", value, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitGreaterThanOrEqualTo(Byte value) {
public Criteria andDietaryHabitGreaterThanOrEqualTo(String value) {
addCriterion("dietary_habit >=", value, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitLessThan(Byte value) {
public Criteria andDietaryHabitLessThan(String value) {
addCriterion("dietary_habit <", value, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitLessThanOrEqualTo(Byte value) {
public Criteria andDietaryHabitLessThanOrEqualTo(String value) {
addCriterion("dietary_habit <=", value, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitIn(List<Byte> values) {
public Criteria andDietaryHabitLike(String value) {
addCriterion("dietary_habit like", value, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitNotLike(String value) {
addCriterion("dietary_habit not like", value, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitIn(List<String> values) {
addCriterion("dietary_habit in", values, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitNotIn(List<Byte> values) {
public Criteria andDietaryHabitNotIn(List<String> values) {
addCriterion("dietary_habit not in", values, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitBetween(Byte value1, Byte value2) {
public Criteria andDietaryHabitBetween(String value1, String value2) {
addCriterion("dietary_habit between", value1, value2, "dietaryHabit");
return (Criteria) this;
}
public Criteria andDietaryHabitNotBetween(Byte value1, Byte value2) {
public Criteria andDietaryHabitNotBetween(String value1, String value2) {
addCriterion("dietary_habit not between", value1, value2, "dietaryHabit");
return (Criteria) this;
}
@ -1674,6 +1704,126 @@ public class HtPatientPersionalExample {
addCriterion("recorder not between", value1, value2, "recorder");
return (Criteria) this;
}
public Criteria andDrinkQuitIsNull() {
addCriterion("drink_quit is null");
return (Criteria) this;
}
public Criteria andDrinkQuitIsNotNull() {
addCriterion("drink_quit is not null");
return (Criteria) this;
}
public Criteria andDrinkQuitEqualTo(Byte value) {
addCriterion("drink_quit =", value, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitNotEqualTo(Byte value) {
addCriterion("drink_quit <>", value, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitGreaterThan(Byte value) {
addCriterion("drink_quit >", value, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitGreaterThanOrEqualTo(Byte value) {
addCriterion("drink_quit >=", value, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitLessThan(Byte value) {
addCriterion("drink_quit <", value, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitLessThanOrEqualTo(Byte value) {
addCriterion("drink_quit <=", value, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitIn(List<Byte> values) {
addCriterion("drink_quit in", values, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitNotIn(List<Byte> values) {
addCriterion("drink_quit not in", values, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitBetween(Byte value1, Byte value2) {
addCriterion("drink_quit between", value1, value2, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitNotBetween(Byte value1, Byte value2) {
addCriterion("drink_quit not between", value1, value2, "drinkQuit");
return (Criteria) this;
}
public Criteria andDrinkQuitYearIsNull() {
addCriterion("drink_quit_year is null");
return (Criteria) this;
}
public Criteria andDrinkQuitYearIsNotNull() {
addCriterion("drink_quit_year is not null");
return (Criteria) this;
}
public Criteria andDrinkQuitYearEqualTo(Integer value) {
addCriterion("drink_quit_year =", value, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearNotEqualTo(Integer value) {
addCriterion("drink_quit_year <>", value, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearGreaterThan(Integer value) {
addCriterion("drink_quit_year >", value, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearGreaterThanOrEqualTo(Integer value) {
addCriterion("drink_quit_year >=", value, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearLessThan(Integer value) {
addCriterion("drink_quit_year <", value, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearLessThanOrEqualTo(Integer value) {
addCriterion("drink_quit_year <=", value, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearIn(List<Integer> values) {
addCriterion("drink_quit_year in", values, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearNotIn(List<Integer> values) {
addCriterion("drink_quit_year not in", values, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearBetween(Integer value1, Integer value2) {
addCriterion("drink_quit_year between", value1, value2, "drinkQuitYear");
return (Criteria) this;
}
public Criteria andDrinkQuitYearNotBetween(Integer value1, Integer value2) {
addCriterion("drink_quit_year not between", value1, value2, "drinkQuitYear");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

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

@ -50,6 +50,8 @@ public class HtPatientReport implements Serializable {
private String hospital;
private Byte completeStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -236,6 +238,14 @@ public class HtPatientReport implements Serializable {
this.hospital = hospital == null ? null : hospital.trim();
}
public Byte getCompleteStatus() {
return completeStatus;
}
public void setCompleteStatus(Byte completeStatus) {
this.completeStatus = completeStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -265,6 +275,7 @@ public class HtPatientReport implements Serializable {
sb.append(", isDel=").append(isDel);
sb.append(", showStatus=").append(showStatus);
sb.append(", hospital=").append(hospital);
sb.append(", completeStatus=").append(completeStatus);
sb.append("]");
return sb.toString();
}

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

@ -1604,6 +1604,66 @@ public class HtPatientReportExample {
addCriterion("hospital not between", value1, value2, "hospital");
return (Criteria) this;
}
public Criteria andCompleteStatusIsNull() {
addCriterion("complete_status is null");
return (Criteria) this;
}
public Criteria andCompleteStatusIsNotNull() {
addCriterion("complete_status is not null");
return (Criteria) this;
}
public Criteria andCompleteStatusEqualTo(Byte value) {
addCriterion("complete_status =", value, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusNotEqualTo(Byte value) {
addCriterion("complete_status <>", value, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusGreaterThan(Byte value) {
addCriterion("complete_status >", value, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("complete_status >=", value, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusLessThan(Byte value) {
addCriterion("complete_status <", value, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusLessThanOrEqualTo(Byte value) {
addCriterion("complete_status <=", value, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusIn(List<Byte> values) {
addCriterion("complete_status in", values, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusNotIn(List<Byte> values) {
addCriterion("complete_status not in", values, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusBetween(Byte value1, Byte value2) {
addCriterion("complete_status between", value1, value2, "completeStatus");
return (Criteria) this;
}
public Criteria andCompleteStatusNotBetween(Byte value1, Byte value2) {
addCriterion("complete_status not between", value1, value2, "completeStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

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

@ -3,6 +3,7 @@ package com.ccsens.ht.bean.vo;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.ht.uitl.Constant;
import com.ccsens.util.PdfUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -18,11 +19,35 @@ import java.util.*;
*/
public class PatientReportVo {
@Data
@ApiModel("报告单遗留未完成")
public static class Complete {
@ApiModelProperty("是否有未完成的项目 1:有 0:无")
private byte hasUnfinished ;
@ApiModelProperty("报告单ID")
private Long id;
@ApiModelProperty("报告单名字")
private String name;
@ApiModelProperty("病人ID")
private Long patientId;
@ApiModelProperty("病人名字")
private String patientName;
@ApiModelProperty("病人身份证号")
private String patientIdCard;
@ApiModelProperty("评测开始时间")
private Date createTime;
@ApiModelProperty("描述")
private String description;
}
@Data
@ApiModel("PatientReportVoGenerate")
public static class Generate{
@ApiModelProperty("病人报告单ID")
private Long id;
@ApiModelProperty("报告单名称")
private String name;
}
@Data
@ -152,8 +177,12 @@ public class PatientReportVo {
for (String param: params) {
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent(param);
cell.setBorder(0);
// cell.setBorder(0);
cell.setCenter(false);
cell.setBorderLeft(0);
cell.setBorderRight(0);
cell.setBorderTop(0);
cell.setBorderBottom(0);
row.addCell(cell);
}
@ -200,99 +229,18 @@ public class PatientReportVo {
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);
} else {
String mmse = "MMSE";
String npi = "NPI";
String mmse = Constant.Ht.Report.MMSE;
String npi = Constant.Ht.Report.NPI;
if (mmse.equalsIgnoreCase(this.code) || npi.equalsIgnoreCase(this.code)) {
PdfUtil.Row row1 = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent(this.code + (StrUtil.isBlank(this.remark) ? "" : "("+this.remark+")"));
cell.setRowSpan(2);
cell.setColSpan(npi.equalsIgnoreCase(this.code) ? headNum : 1);
row1.addCell(cell);
//被合并cell
PdfUtil.Row row2 = new PdfUtil.Row();
// fillBlankCell(row2);
//子测评项
this.subReport.forEach(reportScore -> {
String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : "");
fillRow(row1,row2, reportScore.getName(), score, 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 : ""));
}
rows.add(row1);
rows.add(row2);
fillMmseOrNpi(headNum, rows, mmse, npi);
} else {
//moca
int firstIndex = 5;
PdfUtil.Row row1 = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent(this.name + (StrUtil.isBlank(this.remark) ? "" : "("+this.remark+")"));
cell.setRowSpan(5);
row1.addCell(cell);
PdfUtil.Row row2 = new PdfUtil.Row();
// fillBlankCell(row2);
for (int i = 0; i < firstIndex; i++) {
ReportScore reportScore = this.subReport.get(i);
String jy = "JY";
if (jy.equalsIgnoreCase(reportScore.getCode())) {
fillRow(row1, row2, reportScore.getName(), " ", 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, i == 0 ? new int[]{2,2}: null);
}
}
PdfUtil.Cell scoreNameCell = new PdfUtil.Cell();
scoreNameCell.setContent("总分");
row1.addCell(scoreNameCell);
PdfUtil.Cell scoreCell = new PdfUtil.Cell();
scoreCell.setContent(this.score == null ? "" : this.score + (this.totalScore > 0 ? "/" + this.totalScore : ""));
scoreCell.setRowSpan(4);
row2.addCell(scoreCell);
rows.add(row1);
rows.add(row2);
//下一行
PdfUtil.Row row3 = new PdfUtil.Row();
PdfUtil.Row row4 = new PdfUtil.Row();
PdfUtil.Row row5 = new PdfUtil.Row();
//延迟回忆特殊处理
String ychy = "YCHY";
for (int i = firstIndex; i < this.subReport.size(); i++) {
ReportScore reportScore = this.subReport.get(i);
//设置名字
PdfUtil.Cell scoreTitleCell = new PdfUtil.Cell();
scoreTitleCell.setContent(reportScore.getName());
scoreTitleCell.setColSpan(ychy.equalsIgnoreCase(reportScore.getCode()) ? 2 : 1);
row3.addCell(scoreTitleCell);
//设置子类
if (ychy.equalsIgnoreCase(reportScore.getCode())) {
for (int j = 0; j < reportScore.subReport.size(); j++) {
ReportScore subScore = reportScore.getSubReport().get(j);
PdfUtil.Cell subCell = new PdfUtil.Cell();
subCell.setContent(subScore.name + (subScore.getScore() == null ? " " : subScore.getScore()) + subScore.getRemark());
if (j == 0 ) {
row4.addCell(subCell);
} else {
row5.addCell(subCell);
}
}
}
PdfUtil.Cell scoreScoreCell = new PdfUtil.Cell();
String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : "");
scoreScoreCell.setContent(score);
scoreScoreCell.setRowSpan(2);
row4.addCell(scoreScoreCell);
}
rows.add(row3);
rows.add(row4);
rows.add(row5);
fillMoca(rows);
}
}
@ -304,12 +252,130 @@ public class PatientReportVo {
cell.setColSpan(colNum);
cell.setContent(this.description);
cell.setCenter(false);
cell.setBorderRight(1);
descRow.addCell(cell);
rows.add(descRow);
// MOCA中,视直觉单独展示
fillSzj(colNum, headNum, rows);
return rows;
}
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();
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);
row1.addCell(cell);
//被合并cell
PdfUtil.Row row2 = new PdfUtil.Row();
// fillBlankCell(row2);
//子测评项
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);
});
// 总分
if (mmse.equalsIgnoreCase(this.code)) {
fillRow(row1,row2, "总分", this.score == null ? "" : this.score + (this.totalScore > 0 ? "/" + this.totalScore : ""), mmse.equalsIgnoreCase(this.code), true);
}
rows.add(row1);
rows.add(row2);
}
private void fillMoca(List<PdfUtil.Row> rows) {
//moca
int firstIndex = 5;
PdfUtil.Row row1 = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
cell.setContent(this.name + (StrUtil.isBlank(this.remark) ? "" : "("+this.remark+")"));
cell.setRowSpan(5);
row1.addCell(cell);
PdfUtil.Row row2 = new PdfUtil.Row();
for (int i = 0; i < firstIndex; i++) {
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);
} 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);
}
}
PdfUtil.Cell scoreNameCell = new PdfUtil.Cell();
scoreNameCell.setContent("总分");
scoreNameCell.setBorderRight(1);
row1.addCell(scoreNameCell);
PdfUtil.Cell scoreCell = new PdfUtil.Cell();
scoreCell.setContent(this.score == null ? "" : this.score + (this.totalScore > 0 ? "/" + this.totalScore : ""));
scoreCell.setRowSpan(4);
scoreCell.setBorderRight(1);
row2.addCell(scoreCell);
rows.add(row1);
rows.add(row2);
//下一行
PdfUtil.Row row3 = new PdfUtil.Row();
PdfUtil.Row row4 = new PdfUtil.Row();
PdfUtil.Row row5 = new PdfUtil.Row();
//延迟回忆特殊处理
String ychy = "YCHY";
int size = this.subReport.size() - 1;
for (int i = firstIndex; i < size; i++) {
ReportScore reportScore = this.subReport.get(i);
//设置名字
PdfUtil.Cell scoreTitleCell = new PdfUtil.Cell();
scoreTitleCell.setContent(reportScore.getName());
scoreTitleCell.setColSpan(ychy.equalsIgnoreCase(reportScore.getCode()) ? 3 : 1);
row3.addCell(scoreTitleCell);
//设置子类
if (ychy.equalsIgnoreCase(reportScore.getCode())) {
for (int j = 0; j < reportScore.subReport.size(); j++) {
ReportScore subScore = reportScore.getSubReport().get(j);
PdfUtil.Cell subCell = new PdfUtil.Cell();
subCell.setContent(subScore.name + (subScore.getScore() == null ? " " : subScore.getScore()) + subScore.getRemark());
if (j == 0 ) {
row4.addCell(subCell);
} else {
row5.addCell(subCell);
}
}
}
PdfUtil.Cell scoreScoreCell = new PdfUtil.Cell();
String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : "");
scoreScoreCell.setContent(score);
scoreScoreCell.setRowSpan(2);
scoreScoreCell.setColSpan(ychy.equalsIgnoreCase(reportScore.getCode()) ? 2 : 1);
row4.addCell(scoreScoreCell);
}
rows.add(row3);
rows.add(row4);
rows.add(row5);
}
private void fillSzj(int colNum, int headNum, List<PdfUtil.Row> rows) {
if (Constant.Ht.Report.MOCA.equalsIgnoreCase(this.code) && CollectionUtil.isNotEmpty(this.subReport)) {
ReportScore szj = this.subReport.get(this.subReport.size() - 1);
if (Constant.Ht.Report.MOCA_SJZ.equalsIgnoreCase(szj.code)) {
PdfUtil.Row sjzRow = new PdfUtil.Row();
PdfUtil.Cell titleCell = new PdfUtil.Cell();
titleCell.setColSpan(headNum);
titleCell.setContent(szj.name);
sjzRow.addCell(titleCell);
PdfUtil.Cell sjzScoreCell = new PdfUtil.Cell();
sjzScoreCell.setColSpan(colNum - headNum);
sjzScoreCell.setContent((szj.getScore() == null ? " " : szj.getScore()) + "/" + szj.getTotalScore());
sjzScoreCell.setBorderRight(1);
sjzRow.addCell(sjzScoreCell);
rows.add(sjzRow);
}
}
}
/**
* 添加一个空格
* @param rows
@ -321,10 +387,12 @@ public class PatientReportVo {
}
}
private void fillRow(PdfUtil.Row row1, PdfUtil.Row row2, String name, String score, int... colspan){
private void fillRow(PdfUtil.Row row1, PdfUtil.Row row2, String name, String score, boolean isTop, boolean isRight, int... colspan){
//名称
PdfUtil.Cell cell1 = new PdfUtil.Cell();
cell1.setContent(name);
cell1.setBorderTop(isTop? 1 : 0);
cell1.setBorderRight(isRight? 1 : 0);
cell1.setColSpan(colspan == null || colspan.length == 0 ? 1 : colspan[0]);
row1.addCell(cell1);
@ -332,6 +400,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);
row2.addCell(cell2);
}
}

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

@ -37,4 +37,17 @@ public interface HtPatientReportDao extends HtPatientReportMapper {
*/
List<Map<String, Object>> queryNPIScore(@Param("id") Long id);
/**
* 检查未完成的报告单
* @param userId
* @return
*/
PatientReportVo.Complete checkComplete(@Param("userId") Long userId);
/**
* 忽略报告单
* @param id
* @param userId
*/
void ignoreComplete(@Param("id") Long id, @Param("userId") Long userId);
}

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

@ -74,4 +74,19 @@ public interface IPatientReportService {
* @return
*/
String generateQRCode(PatientReportDto.QueryDetail queryDetail, Long userId) throws IOException;
/**
* 检查有无未完成的报告
* @param userId
* @return
*/
PatientReportVo.Complete checkComplete(Long userId);
/**
* 忽略未完成的报告单
* @param ignore
* @param userId
* @return
*/
void ignoreComplete(PatientReportDto.Ignore ignore, Long userId);
}

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

@ -144,6 +144,7 @@ public class PatientReportService implements IPatientReportService {
HtPatientReport copy = patientReport.copy();
copy.setUrl(Constant.Ht.STRING_DEFAULT);
copy.setQrCodeUrl(Constant.Ht.STRING_DEFAULT);
copy.setCompleteStatus(Constant.Ht.Report.COMPLETE_OK);
htPatientReportDao.updateByPrimaryKeySelective(copy);
log.info("成功编辑报告单信息");
HtPatientReportRecord record = new HtPatientReportRecord();
@ -251,6 +252,9 @@ public class PatientReportService implements IPatientReportService {
});
scores.forEach(score -> {
if (Constant.Ht.Report.MOCA_SJZ.equalsIgnoreCase(score.getCode())) {
return;
}
sumScore(score);
});
@ -381,16 +385,21 @@ public class PatientReportService implements IPatientReportService {
});
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell initWordCell = addCell(row, "初步印象", 2, 2);
initWordCell.setHeight(50);
initWordCell.setHeight(PdfUtil.Cell.defaultHeight * 2);
PdfUtil.Cell initImplCell = addCell(row, detail.getPatient().getInitialImpression(), 6, 2);
initImplCell.setHeight(50);
initImplCell.setHeight(PdfUtil.Cell.defaultHeight * 2);
initImplCell.setBorderRight(1);
content.add(row);
PdfUtil.Row row2 = new PdfUtil.Row();
addCell(row2,"测评员:",4,1, 0);
addCell(row2,"报告日期:",4,1, 0);
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);
String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, detail.getPatient().toPdfRow(), content);
String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, detail.getPatient().toPdfRow(), content, new PdfUtil.Margin());
report.setUrl(path);
htPatientReportDao.updateByPrimaryKeySelective(report);
log.info("生成文件路径:{}", path);
@ -407,6 +416,17 @@ public class PatientReportService implements IPatientReportService {
return cell1;
}
@Override
public void ignoreComplete(PatientReportDto.Ignore ignore, Long userId) {
htPatientReportDao.ignoreComplete(ignore.getId(), userId);
}
@Override
public PatientReportVo.Complete checkComplete(Long userId) {
PatientReportVo.Complete complete = htPatientReportDao.checkComplete(userId);
return complete;
}
@Override
public String generateQRCode(PatientReportDto.QueryDetail queryDetail, Long userId) throws IOException {
log.info("报告单分享:{},用户ID:{}", queryDetail, userId);

4
ht/src/main/java/com/ccsens/ht/service/PatientService.java

@ -179,11 +179,11 @@ public class PatientService implements IPatientService {
throw new BaseException(CodeEnum.RECORDER_NOT);
}
patient.setId(oldPatient.getId());
htPatientMapper.updateByPrimaryKeySelective(patient);
htPatientMapper.updateByPrimaryKey(patient);
} else {
patient.setId(snowflake.nextId());
patient.setRecorder(userId);
htPatientMapper.insertSelective(patient);
htPatientMapper.insert(patient);
}
return patient.getId();
}

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

@ -216,9 +216,12 @@ public class QuestionService implements IQuestionService {
delScore.setIsDel(Constant.Ht.IS_DEL);
htPatientScoreDao.updateByExampleSelective(delScore, delExample);
//保存现在的答案
if (CollectionUtil.isNotEmpty(scores)) {
htPatientScoreDao.insertBatch(scores);
if (CollectionUtil.isEmpty(scores)) {
// 选项为空,默认0分
HtPatientScore zeroScore = getHtPatientScore(score, parentCode, report, 0);
scores.add(zeroScore);
}
htPatientScoreDao.insertBatch(scores);
// 保存答案
saveAnswerRecord(score, question);
@ -227,6 +230,21 @@ public class QuestionService implements IQuestionService {
return CodeEnum.SUCCESS;
}
private HtPatientScore getHtPatientScore(QuestionDto.Score score, String parentCode, HtPatientReport report, int i) {
HtPatientScore zeroScore = new HtPatientScore();
zeroScore.setId(snowflake.nextId());
zeroScore.setPatientReportId(score.getPatientReportId());
zeroScore.setPatientId(report.getPatientId());
zeroScore.setQuestionId(score.getQuestionId());
zeroScore.setQuestionParentCode(parentCode);
zeroScore.setOptionId((long) Constant.Ht.NUMBER_DEFAULT);
zeroScore.setOptionName(Constant.Ht.STRING_DEFAULT);
zeroScore.setScore(i);
zeroScore.setType(Constant.Ht.Score.SCORE);
zeroScore.setAnswer(Constant.Ht.STRING_DEFAULT);
return zeroScore;
}
/**
* 修改报告单显示状态
* @param report
@ -290,17 +308,7 @@ public class QuestionService implements IQuestionService {
patientScore.set(next.getIntValue(Constant.Ht.Rule.SMALL_SCORE));
}
}
HtPatientScore singleScore = new HtPatientScore();
singleScore.setId(snowflake.nextId());
singleScore.setPatientReportId(score.getPatientReportId());
singleScore.setPatientId(report.getPatientId());
singleScore.setQuestionId(score.getQuestionId());
singleScore.setQuestionParentCode(parentCode);
singleScore.setOptionId((long)Constant.Ht.NUMBER_DEFAULT);
singleScore.setOptionName(Constant.Ht.STRING_DEFAULT);
singleScore.setScore(patientScore.get());
singleScore.setType(Constant.Ht.Score.SCORE);
singleScore.setAnswer(Constant.Ht.STRING_DEFAULT);
HtPatientScore singleScore = getHtPatientScore(score, parentCode, report, patientScore.get());
scores.add(singleScore);
}

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

@ -109,6 +109,16 @@ public class Constant {
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 MMSE = "MMSE";
public final static String NPI = "NPI";
/**报告单未完成*/
public final static Byte COMPLETE_NO = 0;
/**报告单已完成*/
public final static Byte COMPLETE_OK = 1;
/**忽略报告单*/
public final static Byte COMPLETE_IGNORE = 2;
/**在历史报告单中显示*/
public final static byte SHOW_HISTORY = 1;
public final static Map<String, Byte> TYPE = new HashMap<>();

4
ht/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: test
include: common, util-test
active: prod
include: common, util-prod

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

@ -56,12 +56,28 @@
GROUP BY t1.code
order by t1.type,t1.sort
</select>
<select id="queryNPIScore" resultType="Map">
<select id="queryNPIScore" resultType="java.util.Map">
select option_name as optionName, sum(score) as score
from t_ht_patient_score
where patient_report_id = #{id, jdbcType=BIGINT} and question_parent_code = 'NPI'
and option_name in ('carer','result') and is_del = 0 group by option_name;
</select>
<select id="checkComplete" resultType="com.ccsens.ht.bean.vo.PatientReportVo$Complete">
select r.id, r.name, p.id as patientId, p.name as patientName, p.idcard as patientIdCard,
r.create_time as createTime,
concat('检测到您在', r.create_time, '为患者', p.name,'的检测报告尚未完成,是否继续?') as description ,
if(r.id = null , 0, 1) as hasUnfinished
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 d.user_id = #{userId, jdbcType=BIGINT} and d.audit_state = 1
and r.complete_status = 0 and d.is_del = 0 and r.is_del = 0 and p.is_del = 0
order by r.create_time desc limit 1;
</select>
<select id="ignoreComplete">
update t_ht_patient_report set complete_status = 2
where id = #{id, jdbcType=BIGINT} and complete_status = 0 and is_del = 0 and doctor_id in
(select doctor_id from t_ht_doctor where user_id = #{userId, jdbcType=BIGINT} and audit_state = 1 and is_del = 0)
</select>
</mapper>

85
ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml

@ -11,15 +11,15 @@
<result column="smoking_quit_year" jdbcType="INTEGER" property="smokingQuitYear" />
<result column="drink_history" jdbcType="TINYINT" property="drinkHistory" />
<result column="drink_year" jdbcType="INTEGER" property="drinkYear" />
<result column="drink_type" jdbcType="TINYINT" property="drinkType" />
<result column="drink_type" jdbcType="VARCHAR" property="drinkType" />
<result column="drink_amount" jdbcType="INTEGER" property="drinkAmount" />
<result column="tea_coffee_history" jdbcType="TINYINT" property="teaCoffeeHistory" />
<result column="tea_coffee_year" jdbcType="INTEGER" property="teaCoffeeYear" />
<result column="tea_coffee_type" jdbcType="TINYINT" property="teaCoffeeType" />
<result column="tea_coffee_type" jdbcType="VARCHAR" property="teaCoffeeType" />
<result column="tea_coffee_frequency" jdbcType="TINYINT" property="teaCoffeeFrequency" />
<result column="tea_coffee_quit" jdbcType="TINYINT" property="teaCoffeeQuit" />
<result column="tea_coffee_quit_year" jdbcType="INTEGER" property="teaCoffeeQuitYear" />
<result column="dietary_habit" jdbcType="TINYINT" property="dietaryHabit" />
<result column="dietary_habit" jdbcType="VARCHAR" property="dietaryHabit" />
<result column="workout_time" jdbcType="TINYINT" property="workoutTime" />
<result column="sleep_time" jdbcType="INTEGER" property="sleepTime" />
<result column="snore" jdbcType="TINYINT" property="snore" />
@ -28,6 +28,8 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="recorder" jdbcType="BIGINT" property="recorder" />
<result column="drink_quit" jdbcType="TINYINT" property="drinkQuit" />
<result column="drink_quit_year" jdbcType="INTEGER" property="drinkQuitYear" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -91,7 +93,8 @@
id, patient_id, smoking_history, smoking_year, smoking_amount, smoking_quit, smoking_quit_year,
drink_history, drink_year, drink_type, drink_amount, tea_coffee_history, tea_coffee_year,
tea_coffee_type, tea_coffee_frequency, tea_coffee_quit, tea_coffee_quit_year, dietary_habit,
workout_time, sleep_time, snore, remark, create_time, update_time, is_del, recorder
workout_time, sleep_time, snore, remark, create_time, update_time, is_del, recorder,
drink_quit, drink_quit_year
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientPersionalExample" resultMap="BaseResultMap">
select
@ -132,16 +135,18 @@
tea_coffee_quit, tea_coffee_quit_year, dietary_habit,
workout_time, sleep_time, snore,
remark, create_time, update_time,
is_del, recorder)
is_del, recorder, drink_quit,
drink_quit_year)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{smokingHistory,jdbcType=TINYINT},
#{smokingYear,jdbcType=INTEGER}, #{smokingAmount,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT},
#{smokingQuitYear,jdbcType=INTEGER}, #{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER},
#{drinkType,jdbcType=TINYINT}, #{drinkAmount,jdbcType=INTEGER}, #{teaCoffeeHistory,jdbcType=TINYINT},
#{teaCoffeeYear,jdbcType=INTEGER}, #{teaCoffeeType,jdbcType=TINYINT}, #{teaCoffeeFrequency,jdbcType=TINYINT},
#{teaCoffeeQuit,jdbcType=TINYINT}, #{teaCoffeeQuitYear,jdbcType=INTEGER}, #{dietaryHabit,jdbcType=TINYINT},
#{drinkType,jdbcType=VARCHAR}, #{drinkAmount,jdbcType=INTEGER}, #{teaCoffeeHistory,jdbcType=TINYINT},
#{teaCoffeeYear,jdbcType=INTEGER}, #{teaCoffeeType,jdbcType=VARCHAR}, #{teaCoffeeFrequency,jdbcType=TINYINT},
#{teaCoffeeQuit,jdbcType=TINYINT}, #{teaCoffeeQuitYear,jdbcType=INTEGER}, #{dietaryHabit,jdbcType=VARCHAR},
#{workoutTime,jdbcType=TINYINT}, #{sleepTime,jdbcType=INTEGER}, #{snore,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{isDel,jdbcType=TINYINT}, #{recorder,jdbcType=BIGINT})
#{isDel,jdbcType=TINYINT}, #{recorder,jdbcType=BIGINT}, #{drinkQuit,jdbcType=TINYINT},
#{drinkQuitYear,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientPersional">
insert into t_ht_patient_persional
@ -224,6 +229,12 @@
<if test="recorder != null">
recorder,
</if>
<if test="drinkQuit != null">
drink_quit,
</if>
<if test="drinkQuitYear != null">
drink_quit_year,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -254,7 +265,7 @@
#{drinkYear,jdbcType=INTEGER},
</if>
<if test="drinkType != null">
#{drinkType,jdbcType=TINYINT},
#{drinkType,jdbcType=VARCHAR},
</if>
<if test="drinkAmount != null">
#{drinkAmount,jdbcType=INTEGER},
@ -266,7 +277,7 @@
#{teaCoffeeYear,jdbcType=INTEGER},
</if>
<if test="teaCoffeeType != null">
#{teaCoffeeType,jdbcType=TINYINT},
#{teaCoffeeType,jdbcType=VARCHAR},
</if>
<if test="teaCoffeeFrequency != null">
#{teaCoffeeFrequency,jdbcType=TINYINT},
@ -278,7 +289,7 @@
#{teaCoffeeQuitYear,jdbcType=INTEGER},
</if>
<if test="dietaryHabit != null">
#{dietaryHabit,jdbcType=TINYINT},
#{dietaryHabit,jdbcType=VARCHAR},
</if>
<if test="workoutTime != null">
#{workoutTime,jdbcType=TINYINT},
@ -304,6 +315,12 @@
<if test="recorder != null">
#{recorder,jdbcType=BIGINT},
</if>
<if test="drinkQuit != null">
#{drinkQuit,jdbcType=TINYINT},
</if>
<if test="drinkQuitYear != null">
#{drinkQuitYear,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientPersionalExample" resultType="java.lang.Long">
@ -343,7 +360,7 @@
drink_year = #{record.drinkYear,jdbcType=INTEGER},
</if>
<if test="record.drinkType != null">
drink_type = #{record.drinkType,jdbcType=TINYINT},
drink_type = #{record.drinkType,jdbcType=VARCHAR},
</if>
<if test="record.drinkAmount != null">
drink_amount = #{record.drinkAmount,jdbcType=INTEGER},
@ -355,7 +372,7 @@
tea_coffee_year = #{record.teaCoffeeYear,jdbcType=INTEGER},
</if>
<if test="record.teaCoffeeType != null">
tea_coffee_type = #{record.teaCoffeeType,jdbcType=TINYINT},
tea_coffee_type = #{record.teaCoffeeType,jdbcType=VARCHAR},
</if>
<if test="record.teaCoffeeFrequency != null">
tea_coffee_frequency = #{record.teaCoffeeFrequency,jdbcType=TINYINT},
@ -367,7 +384,7 @@
tea_coffee_quit_year = #{record.teaCoffeeQuitYear,jdbcType=INTEGER},
</if>
<if test="record.dietaryHabit != null">
dietary_habit = #{record.dietaryHabit,jdbcType=TINYINT},
dietary_habit = #{record.dietaryHabit,jdbcType=VARCHAR},
</if>
<if test="record.workoutTime != null">
workout_time = #{record.workoutTime,jdbcType=TINYINT},
@ -393,6 +410,12 @@
<if test="record.recorder != null">
recorder = #{record.recorder,jdbcType=BIGINT},
</if>
<if test="record.drinkQuit != null">
drink_quit = #{record.drinkQuit,jdbcType=TINYINT},
</if>
<if test="record.drinkQuitYear != null">
drink_quit_year = #{record.drinkQuitYear,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -409,15 +432,15 @@
smoking_quit_year = #{record.smokingQuitYear,jdbcType=INTEGER},
drink_history = #{record.drinkHistory,jdbcType=TINYINT},
drink_year = #{record.drinkYear,jdbcType=INTEGER},
drink_type = #{record.drinkType,jdbcType=TINYINT},
drink_type = #{record.drinkType,jdbcType=VARCHAR},
drink_amount = #{record.drinkAmount,jdbcType=INTEGER},
tea_coffee_history = #{record.teaCoffeeHistory,jdbcType=TINYINT},
tea_coffee_year = #{record.teaCoffeeYear,jdbcType=INTEGER},
tea_coffee_type = #{record.teaCoffeeType,jdbcType=TINYINT},
tea_coffee_type = #{record.teaCoffeeType,jdbcType=VARCHAR},
tea_coffee_frequency = #{record.teaCoffeeFrequency,jdbcType=TINYINT},
tea_coffee_quit = #{record.teaCoffeeQuit,jdbcType=TINYINT},
tea_coffee_quit_year = #{record.teaCoffeeQuitYear,jdbcType=INTEGER},
dietary_habit = #{record.dietaryHabit,jdbcType=TINYINT},
dietary_habit = #{record.dietaryHabit,jdbcType=VARCHAR},
workout_time = #{record.workoutTime,jdbcType=TINYINT},
sleep_time = #{record.sleepTime,jdbcType=INTEGER},
snore = #{record.snore,jdbcType=TINYINT},
@ -425,7 +448,9 @@
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT},
recorder = #{record.recorder,jdbcType=BIGINT}
recorder = #{record.recorder,jdbcType=BIGINT},
drink_quit = #{record.drinkQuit,jdbcType=TINYINT},
drink_quit_year = #{record.drinkQuitYear,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -458,7 +483,7 @@
drink_year = #{drinkYear,jdbcType=INTEGER},
</if>
<if test="drinkType != null">
drink_type = #{drinkType,jdbcType=TINYINT},
drink_type = #{drinkType,jdbcType=VARCHAR},
</if>
<if test="drinkAmount != null">
drink_amount = #{drinkAmount,jdbcType=INTEGER},
@ -470,7 +495,7 @@
tea_coffee_year = #{teaCoffeeYear,jdbcType=INTEGER},
</if>
<if test="teaCoffeeType != null">
tea_coffee_type = #{teaCoffeeType,jdbcType=TINYINT},
tea_coffee_type = #{teaCoffeeType,jdbcType=VARCHAR},
</if>
<if test="teaCoffeeFrequency != null">
tea_coffee_frequency = #{teaCoffeeFrequency,jdbcType=TINYINT},
@ -482,7 +507,7 @@
tea_coffee_quit_year = #{teaCoffeeQuitYear,jdbcType=INTEGER},
</if>
<if test="dietaryHabit != null">
dietary_habit = #{dietaryHabit,jdbcType=TINYINT},
dietary_habit = #{dietaryHabit,jdbcType=VARCHAR},
</if>
<if test="workoutTime != null">
workout_time = #{workoutTime,jdbcType=TINYINT},
@ -508,6 +533,12 @@
<if test="recorder != null">
recorder = #{recorder,jdbcType=BIGINT},
</if>
<if test="drinkQuit != null">
drink_quit = #{drinkQuit,jdbcType=TINYINT},
</if>
<if test="drinkQuitYear != null">
drink_quit_year = #{drinkQuitYear,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -521,15 +552,15 @@
smoking_quit_year = #{smokingQuitYear,jdbcType=INTEGER},
drink_history = #{drinkHistory,jdbcType=TINYINT},
drink_year = #{drinkYear,jdbcType=INTEGER},
drink_type = #{drinkType,jdbcType=TINYINT},
drink_type = #{drinkType,jdbcType=VARCHAR},
drink_amount = #{drinkAmount,jdbcType=INTEGER},
tea_coffee_history = #{teaCoffeeHistory,jdbcType=TINYINT},
tea_coffee_year = #{teaCoffeeYear,jdbcType=INTEGER},
tea_coffee_type = #{teaCoffeeType,jdbcType=TINYINT},
tea_coffee_type = #{teaCoffeeType,jdbcType=VARCHAR},
tea_coffee_frequency = #{teaCoffeeFrequency,jdbcType=TINYINT},
tea_coffee_quit = #{teaCoffeeQuit,jdbcType=TINYINT},
tea_coffee_quit_year = #{teaCoffeeQuitYear,jdbcType=INTEGER},
dietary_habit = #{dietaryHabit,jdbcType=TINYINT},
dietary_habit = #{dietaryHabit,jdbcType=VARCHAR},
workout_time = #{workoutTime,jdbcType=TINYINT},
sleep_time = #{sleepTime,jdbcType=INTEGER},
snore = #{snore,jdbcType=TINYINT},
@ -537,7 +568,9 @@
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT},
recorder = #{recorder,jdbcType=BIGINT}
recorder = #{recorder,jdbcType=BIGINT},
drink_quit = #{drinkQuit,jdbcType=TINYINT},
drink_quit_year = #{drinkQuitYear,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

28
ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml

@ -25,6 +25,7 @@
<result column="is_del" jdbcType="TINYINT" property="isDel" />
<result column="show_status" jdbcType="TINYINT" property="showStatus" />
<result column="hospital" jdbcType="VARCHAR" property="hospital" />
<result column="complete_status" jdbcType="TINYINT" property="completeStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -87,7 +88,8 @@
<sql id="Base_Column_List">
id, name, patient_id, patient_idcard, patient_age, doctor_id, serial_number, initial_impression,
clinical_diagnosis, pasi, department, bed_number, report_time, check_time, evaluation_code,
url, qr_code_url, remark, create_time, update_time, is_del, show_status, hospital
url, qr_code_url, remark, create_time, update_time, is_del, show_status, hospital,
complete_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtPatientReportExample" resultMap="BaseResultMap">
select
@ -127,7 +129,8 @@
report_time, check_time, evaluation_code,
url, qr_code_url, remark,
create_time, update_time, is_del,
show_status, hospital)
show_status, hospital, complete_status
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{patientId,jdbcType=BIGINT},
#{patientIdcard,jdbcType=VARCHAR}, #{patientAge,jdbcType=TINYINT}, #{doctorId,jdbcType=BIGINT},
#{serialNumber,jdbcType=VARCHAR}, #{initialImpression,jdbcType=VARCHAR}, #{clinicalDiagnosis,jdbcType=VARCHAR},
@ -135,7 +138,8 @@
#{reportTime,jdbcType=BIGINT}, #{checkTime,jdbcType=BIGINT}, #{evaluationCode,jdbcType=VARCHAR},
#{url,jdbcType=VARCHAR}, #{qrCodeUrl,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT},
#{showStatus,jdbcType=TINYINT}, #{hospital,jdbcType=VARCHAR})
#{showStatus,jdbcType=TINYINT}, #{hospital,jdbcType=VARCHAR}, #{completeStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtPatientReport">
insert into t_ht_patient_report
@ -209,6 +213,9 @@
<if test="hospital != null">
hospital,
</if>
<if test="completeStatus != null">
complete_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -280,6 +287,9 @@
<if test="hospital != null">
#{hospital,jdbcType=VARCHAR},
</if>
<if test="completeStatus != null">
#{completeStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ht.bean.po.HtPatientReportExample" resultType="java.lang.Long">
@ -360,6 +370,9 @@
<if test="record.hospital != null">
hospital = #{record.hospital,jdbcType=VARCHAR},
</if>
<if test="record.completeStatus != null">
complete_status = #{record.completeStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -389,7 +402,8 @@
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT},
show_status = #{record.showStatus,jdbcType=TINYINT},
hospital = #{record.hospital,jdbcType=VARCHAR}
hospital = #{record.hospital,jdbcType=VARCHAR},
complete_status = #{record.completeStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -463,6 +477,9 @@
<if test="hospital != null">
hospital = #{hospital,jdbcType=VARCHAR},
</if>
<if test="completeStatus != null">
complete_status = #{completeStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -489,7 +506,8 @@
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT},
show_status = #{showStatus,jdbcType=TINYINT},
hospital = #{hospital,jdbcType=VARCHAR}
hospital = #{hospital,jdbcType=VARCHAR},
complete_status = #{completeStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

4
pom.xml

@ -64,12 +64,12 @@
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>

2
tall/src/main/java/com/ccsens/tall/bean/vo/DomainVo.java

@ -30,7 +30,7 @@ public class DomainVo {
private String headline;
@ApiModelProperty("是否显示日历 0不显示 1显示")
private int showCalender;
private int showCalendar;
@ApiModelProperty("不展示日历时。显示的项目的id")
private Long showProjectId;
}

3
tall/src/main/java/com/ccsens/tall/service/SysDomainService.java

@ -11,7 +11,6 @@ import com.ccsens.tall.persist.dao.SysDomainDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Struct;
import java.util.List;
@Service
@ -43,7 +42,7 @@ public class SysDomainService implements ISysDomainService{
domainInfo.setBackdropUrl("");
domainInfo.setCaption("TM");
domainInfo.setHeadline("TALL");
domainInfo.setShowCalender(1);
domainInfo.setShowCalendar(1);
}
return domainInfo;
}

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

@ -35,7 +35,7 @@ public class PdfUtil {
* @param content
* @return
*/
public static String credatePdf(String parentPath, String title, String subhead, List<Row> intros, List<Row> content) {
public static String credatePdf(String parentPath, String title, String subhead, List<Row> intros, List<Row> content, Margin margin) {
String fileName = "pdf/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".pdf";
log.info("pdf文件名:{}", fileName );
File file = new File(parentPath, fileName);
@ -45,10 +45,9 @@ public class PdfUtil {
//新建文件
Document document = new Document();
try {
document.setMargins(margin.left, margin.right, margin.top, margin.bottom);
PdfWriter.getInstance(document, new FileOutputStream(file));
document.open();
// 中文字体
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
// 标题字体
@ -57,6 +56,7 @@ public class PdfUtil {
Paragraph par = new Paragraph(title, titleChinese);
par.setAlignment(Element.ALIGN_CENTER);
document.add(par);
if (StrUtil.isNotBlank(subhead)) {
// 标题字体
Font subheadChinese = new Font(bfChinese, 22, Font.NORMAL);
@ -67,7 +67,6 @@ public class PdfUtil {
}
// 每行加空白
fillBlankRow(document, titleChinese);
//设置介绍内容
if (CollectionUtil.isNotEmpty(intros)) {
fillRow(intros, document);
@ -122,7 +121,7 @@ public class PdfUtil {
PdfPTable table = new PdfPTable(size);
table.setSpacingBefore(0);
table.setWidthPercentage(100);
table.setWidthPercentage(90);
for (int j = 0; j < rows.size(); j++) {
Row row = rows.get(j);
table.setHorizontalAlignment(row.align);
@ -130,10 +129,10 @@ 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(j == 0 ? cell.border : 0);
pdfpCell.setBorderWidthLeft(cell.border);
pdfpCell.setBorderWidthRight(i == row.cells.size() - 1 ? cell.border : 0);
pdfpCell.setBorderWidthBottom(cell.border);
pdfpCell.setBorderWidthTop(cell.borderTop == null ? 0 : cell.borderTop);
pdfpCell.setBorderWidthLeft(cell.borderLeft == null ? 0 : cell.borderLeft);
pdfpCell.setBorderWidthRight(cell.borderRight == null ? 0 : cell.borderRight);
pdfpCell.setBorderWidthBottom(cell.borderBottom == null ? 0 : cell.borderBottom);
pdfpCell.setColspan(cell.colSpan);
pdfpCell.setRowspan(cell.rowSpan);
if (cell.isCenter) {
@ -143,7 +142,6 @@ public class PdfUtil {
//垂直居中
pdfpCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
// pdfpCell.setFixedHeight(cell.height);
pdfpCell.setMinimumHeight(cell.height);
table.addCell(pdfpCell);
}
@ -175,18 +173,38 @@ public class PdfUtil {
}
@Data
public static class Cell{
public final static int defaultHeight = 24;
//内容
private String content;
//边框宽度
private int border = 1;
// 上边框宽度
private Integer borderTop = null;
// 下边框宽度
private Integer borderBottom = 1;
// 左边框宽度
private Integer borderLeft = 1;
// 右边框宽度
private Integer borderRight = null;
//横向合并数
private int colSpan = 1;
//纵向合并数
private int rowSpan = 1;
//单元格高度
private int height = 25;
private int height = defaultHeight;
// 单元格是否居中
private boolean isCenter = true;
}
/**
* pdf位置
*/
@Data
public static class Margin{
private float left = 72;
private float right = 0;
private float top = 32;
private float bottom = 32;
}
}

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);
PdfUtil.credatePdf("/home/", "山大一院","评测", rows, contents, new PdfUtil.Margin());
}

Loading…
Cancel
Save