From dcabc44f8c65d223e91e0f10be154c79b6c2b109 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Wed, 29 Apr 2020 09:28:25 +0800 Subject: [PATCH] =?UTF-8?q?HT=20=E6=9F=A5=E8=AF=A2=E6=9C=AA=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E6=B5=8B=E8=AF=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ht/api/PatientReportController.java | 28 ++ .../ccsens/ht/bean/dto/PatientReportDto.java | 8 + .../ccsens/ht/bean/po/HtPatientPersional.java | 46 +++- .../ht/bean/po/HtPatientPersionalExample.java | 210 ++++++++++++--- .../ccsens/ht/bean/po/HtPatientReport.java | 11 + .../ht/bean/po/HtPatientReportExample.java | 60 +++++ .../ccsens/ht/bean/vo/PatientReportVo.java | 245 +++++++++++------- .../ht/persist/dao/HtPatientReportDao.java | 13 + .../ht/service/IPatientReportService.java | 15 ++ .../ht/service/PatientReportService.java | 30 ++- .../com/ccsens/ht/service/PatientService.java | 4 +- .../ccsens/ht/service/QuestionService.java | 34 ++- .../java/com/ccsens/ht/uitl/Constant.java | 10 + ht/src/main/resources/application.yml | 4 +- .../mapper_dao/HtPatientReportDao.xml | 18 +- .../mapper_raw/HtPatientPersionalMapper.xml | 85 ++++-- .../mapper_raw/HtPatientReportMapper.xml | 28 +- pom.xml | 4 +- .../com/ccsens/tall/bean/vo/DomainVo.java | 2 +- .../ccsens/tall/service/SysDomainService.java | 3 +- .../main/java/com/ccsens/util/PdfUtil.java | 40 ++- .../java/com/ccsens/util/PdfUtilTest.java | 2 +- 22 files changed, 699 insertions(+), 201 deletions(-) diff --git a/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java b/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java index 6d9ed511..72dcaefb 100644 --- a/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java +++ b/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 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 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 = "生成报告单") diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java index 6d241b62..4f0fc819 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java +++ b/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{ diff --git a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java b/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java index 24308198..6587fc53 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java +++ b/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(); } diff --git a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java b/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java index f5f696eb..2947d5a8 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java +++ b/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 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 values) { addCriterion("drink_type in", values, "drinkType"); return (Criteria) this; } - public Criteria andDrinkTypeNotIn(List values) { + public Criteria andDrinkTypeNotIn(List 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 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 values) { addCriterion("tea_coffee_type in", values, "teaCoffeeType"); return (Criteria) this; } - public Criteria andTeaCoffeeTypeNotIn(List values) { + public Criteria andTeaCoffeeTypeNotIn(List 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 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 values) { addCriterion("dietary_habit in", values, "dietaryHabit"); return (Criteria) this; } - public Criteria andDietaryHabitNotIn(List values) { + public Criteria andDietaryHabitNotIn(List 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 values) { + addCriterion("drink_quit in", values, "drinkQuit"); + return (Criteria) this; + } + + public Criteria andDrinkQuitNotIn(List 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 values) { + addCriterion("drink_quit_year in", values, "drinkQuitYear"); + return (Criteria) this; + } + + public Criteria andDrinkQuitYearNotIn(List 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 { diff --git a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReport.java b/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReport.java index 5424f0fc..908cc542 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReport.java +++ b/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(); } diff --git a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportExample.java b/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportExample.java index 9254abb1..ef59a979 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportExample.java +++ b/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 values) { + addCriterion("complete_status in", values, "completeStatus"); + return (Criteria) this; + } + + public Criteria andCompleteStatusNotIn(List 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 { diff --git a/ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java b/ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java index 24e58b4e..2d1fddb7 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java +++ b/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 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 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 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); } } diff --git a/ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java b/ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java index 6415b86c..0e3272ae 100644 --- a/ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java +++ b/ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java @@ -37,4 +37,17 @@ public interface HtPatientReportDao extends HtPatientReportMapper { */ List> 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); } diff --git a/ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java b/ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java index 1f8fa78a..45ec9d11 100644 --- a/ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java +++ b/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); } diff --git a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java b/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java index 254d94d0..d4d6005c 100644 --- a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java +++ b/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); diff --git a/ht/src/main/java/com/ccsens/ht/service/PatientService.java b/ht/src/main/java/com/ccsens/ht/service/PatientService.java index 7287ba37..1dd36425 100644 --- a/ht/src/main/java/com/ccsens/ht/service/PatientService.java +++ b/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(); } diff --git a/ht/src/main/java/com/ccsens/ht/service/QuestionService.java b/ht/src/main/java/com/ccsens/ht/service/QuestionService.java index dbce28fd..820bbfa5 100644 --- a/ht/src/main/java/com/ccsens/ht/service/QuestionService.java +++ b/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); } diff --git a/ht/src/main/java/com/ccsens/ht/uitl/Constant.java b/ht/src/main/java/com/ccsens/ht/uitl/Constant.java index 0df8ce23..2d6e8267 100644 --- a/ht/src/main/java/com/ccsens/ht/uitl/Constant.java +++ b/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 TYPE = new HashMap<>(); diff --git a/ht/src/main/resources/application.yml b/ht/src/main/resources/application.yml index 5889ff7f..d082c0ea 100644 --- a/ht/src/main/resources/application.yml +++ b/ht/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: test - include: common, util-test \ No newline at end of file + active: prod + include: common, util-prod \ No newline at end of file diff --git a/ht/src/main/resources/mapper_dao/HtPatientReportDao.xml b/ht/src/main/resources/mapper_dao/HtPatientReportDao.xml index 4c29308e..ae52767f 100644 --- a/ht/src/main/resources/mapper_dao/HtPatientReportDao.xml +++ b/ht/src/main/resources/mapper_dao/HtPatientReportDao.xml @@ -56,12 +56,28 @@ GROUP BY t1.code order by t1.type,t1.sort - 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; + + \ No newline at end of file diff --git a/ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml b/ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml index 5463ac95..7667aff0 100644 --- a/ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml +++ b/ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml @@ -11,15 +11,15 @@ - + - + - + @@ -28,6 +28,8 @@ + + @@ -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 @@ -343,7 +360,7 @@ drink_year = #{record.drinkYear,jdbcType=INTEGER}, - drink_type = #{record.drinkType,jdbcType=TINYINT}, + drink_type = #{record.drinkType,jdbcType=VARCHAR}, drink_amount = #{record.drinkAmount,jdbcType=INTEGER}, @@ -355,7 +372,7 @@ 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}, @@ -367,7 +384,7 @@ 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}, @@ -393,6 +410,12 @@ recorder = #{record.recorder,jdbcType=BIGINT}, + + drink_quit = #{record.drinkQuit,jdbcType=TINYINT}, + + + drink_quit_year = #{record.drinkQuitYear,jdbcType=INTEGER}, + @@ -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} @@ -458,7 +483,7 @@ drink_year = #{drinkYear,jdbcType=INTEGER}, - drink_type = #{drinkType,jdbcType=TINYINT}, + drink_type = #{drinkType,jdbcType=VARCHAR}, drink_amount = #{drinkAmount,jdbcType=INTEGER}, @@ -470,7 +495,7 @@ tea_coffee_year = #{teaCoffeeYear,jdbcType=INTEGER}, - tea_coffee_type = #{teaCoffeeType,jdbcType=TINYINT}, + tea_coffee_type = #{teaCoffeeType,jdbcType=VARCHAR}, tea_coffee_frequency = #{teaCoffeeFrequency,jdbcType=TINYINT}, @@ -482,7 +507,7 @@ tea_coffee_quit_year = #{teaCoffeeQuitYear,jdbcType=INTEGER}, - dietary_habit = #{dietaryHabit,jdbcType=TINYINT}, + dietary_habit = #{dietaryHabit,jdbcType=VARCHAR}, workout_time = #{workoutTime,jdbcType=TINYINT}, @@ -508,6 +533,12 @@ recorder = #{recorder,jdbcType=BIGINT}, + + drink_quit = #{drinkQuit,jdbcType=TINYINT}, + + + drink_quit_year = #{drinkQuitYear,jdbcType=INTEGER}, + where id = #{id,jdbcType=BIGINT} @@ -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} \ No newline at end of file diff --git a/ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml b/ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml index 5a932103..9670a2ca 100644 --- a/ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml +++ b/ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml @@ -25,6 +25,7 @@ + @@ -87,7 +88,8 @@ 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 @@ -360,6 +370,9 @@ hospital = #{record.hospital,jdbcType=VARCHAR}, + + complete_status = #{record.completeStatus,jdbcType=TINYINT}, + @@ -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} @@ -463,6 +477,9 @@ hospital = #{hospital,jdbcType=VARCHAR}, + + complete_status = #{completeStatus,jdbcType=TINYINT}, + where id = #{id,jdbcType=BIGINT} @@ -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} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 93a7517a..e1cc5e6e 100644 --- a/pom.xml +++ b/pom.xml @@ -64,12 +64,12 @@ spring-boot-starter-jetty - + org.springframework.boot spring-boot-configuration-processor diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/DomainVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/DomainVo.java index 2f35101b..ed8a77e9 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/vo/DomainVo.java +++ b/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; } diff --git a/tall/src/main/java/com/ccsens/tall/service/SysDomainService.java b/tall/src/main/java/com/ccsens/tall/service/SysDomainService.java index 2e027abd..ecb14ab7 100644 --- a/tall/src/main/java/com/ccsens/tall/service/SysDomainService.java +++ b/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; } diff --git a/util/src/main/java/com/ccsens/util/PdfUtil.java b/util/src/main/java/com/ccsens/util/PdfUtil.java index 7237b2de..0116bb91 100644 --- a/util/src/main/java/com/ccsens/util/PdfUtil.java +++ b/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 intros, List content) { + public static String credatePdf(String parentPath, String title, String subhead, List intros, List 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; + } } diff --git a/util/src/test/java/com/ccsens/util/PdfUtilTest.java b/util/src/test/java/com/ccsens/util/PdfUtilTest.java index 738f41fe..cf481300 100644 --- a/util/src/test/java/com/ccsens/util/PdfUtilTest.java +++ b/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()); }