Browse Source

v0807

master
zy_Java 5 years ago
parent
commit
85d36246e2
  1. 3
      health/src/main/java/com/ccsens/health/api/DebugController.java
  2. 18
      ht/src/main/java/com/ccsens/ht/api/DoctorController.java
  3. 3
      ht/src/main/java/com/ccsens/ht/api/PatientController.java
  4. 28
      ht/src/main/java/com/ccsens/ht/api/PatientReportController.java
  5. 8
      ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportDto.java
  6. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtDoctor.java
  7. 70
      ht/src/main/java/com/ccsens/ht/bean/po/HtDoctorExample.java
  8. 46
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersional.java
  9. 210
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientPersionalExample.java
  10. 11
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReport.java
  11. 60
      ht/src/main/java/com/ccsens/ht/bean/po/HtPatientReportExample.java
  12. 258
      ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportVo.java
  13. 13
      ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java
  14. 40
      ht/src/main/java/com/ccsens/ht/service/DoctorService.java
  15. 7
      ht/src/main/java/com/ccsens/ht/service/IDoctorService.java
  16. 15
      ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java
  17. 40
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java
  18. 4
      ht/src/main/java/com/ccsens/ht/service/PatientService.java
  19. 34
      ht/src/main/java/com/ccsens/ht/service/QuestionService.java
  20. 10
      ht/src/main/java/com/ccsens/ht/uitl/Constant.java
  21. 4
      ht/src/main/resources/application-dev.yml
  22. 1
      ht/src/main/resources/application-prod.yml
  23. 1
      ht/src/main/resources/application-test.yml
  24. 18
      ht/src/main/resources/mapper_dao/HtPatientReportDao.xml
  25. 25
      ht/src/main/resources/mapper_raw/HtDoctorMapper.xml
  26. 85
      ht/src/main/resources/mapper_raw/HtPatientPersionalMapper.xml
  27. 28
      ht/src/main/resources/mapper_raw/HtPatientReportMapper.xml
  28. 4
      pom.xml
  29. 1
      tall/src/main/java/com/ccsens/tall/service/SysDomainService.java
  30. 4
      util/src/main/java/com/ccsens/util/CodeEnum.java
  31. 61
      util/src/main/java/com/ccsens/util/PdfUtil.java
  32. 13
      util/src/main/java/com/ccsens/util/RestTemplateUtil.java
  33. 2
      util/src/test/java/com/ccsens/util/PdfUtilTest.java

3
health/src/main/java/com/ccsens/health/api/DebugController.java

@ -23,8 +23,7 @@ public class DebugController {
})
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debug(HttpServletRequest request) throws Exception {
return JsonResponse.newInstance().ok("测试");
return JsonResponse.newInstance().ok("测试0\\\\\\\0");
}
@ApiOperation(value = "/测试二维码",notes = "")

18
ht/src/main/java/com/ccsens/ht/api/DoctorController.java

@ -4,6 +4,7 @@ package com.ccsens.ht.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.ht.annotation.DoctorAudit;
import com.ccsens.ht.bean.dto.DoctorDto;
import com.ccsens.ht.bean.vo.PatientReportVo;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.ht.bean.vo.DoctorVo;
import com.ccsens.ht.service.IDoctorService;
@ -94,5 +95,22 @@ public class DoctorController {
return JsonResponse.newInstance().ok(dtos);
}
@MustLogin
@DoctorAudit
@ApiOperation(value = "分享编辑病友信息",notes = "分享编辑病友信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "分享编辑病友信息", required = true)
})
@RequestMapping(value="/patientFillShare", method = RequestMethod.POST)
public JsonResponse<PatientReportVo.Export> patientFillShare(@RequestBody @ApiParam @Valid QueryDto params) throws Exception {
log.info("查询其他信息请求参数:{}", params);
Long userId = params.getUserId();
String path = doctorService.getShareUrl(userId);
PatientReportVo.Export export = new PatientReportVo.Export();
export.setPath(path);
log.info("{}分享路径:{}", userId, export);
return JsonResponse.newInstance().ok(export);
}
}

3
ht/src/main/java/com/ccsens/ht/api/PatientController.java

@ -112,7 +112,7 @@ public class PatientController {
patient.setIdcard(null);
}
//设置记录值
patient.setRecorder(patient.getId() == null ? Constant.Ht.NUMBER_DEFAULT : params.getUserId());
// patient.setRecorder(patient.getId() == null ? Constant.Ht.NUMBER_DEFAULT : params.getUserId());
long id = patientService.editPatient(patient.copy(), params.getUserId());
log.info("病友编辑结果:{}", id);
if (id <= 0) {
@ -160,4 +160,5 @@ public class PatientController {
json.put("id", id);
return JsonResponse.newInstance().ok(CodeEnum.SUCCESS, json);
}
}

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{

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

@ -24,6 +24,8 @@ public class HtDoctor implements Serializable {
private String remark;
private String sharePatientEdit;
private Date createTime;
private Date updateTime;
@ -112,6 +114,14 @@ public class HtDoctor implements Serializable {
this.remark = remark == null ? null : remark.trim();
}
public String getSharePatientEdit() {
return sharePatientEdit;
}
public void setSharePatientEdit(String sharePatientEdit) {
this.sharePatientEdit = sharePatientEdit == null ? null : sharePatientEdit.trim();
}
public Date getCreateTime() {
return createTime;
}
@ -152,6 +162,7 @@ public class HtDoctor implements Serializable {
sb.append(", auditorId=").append(auditorId);
sb.append(", auditState=").append(auditState);
sb.append(", remark=").append(remark);
sb.append(", sharePatientEdit=").append(sharePatientEdit);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isDel=").append(isDel);

70
ht/src/main/java/com/ccsens/ht/bean/po/HtDoctorExample.java

@ -725,6 +725,76 @@ public class HtDoctorExample {
return (Criteria) this;
}
public Criteria andSharePatientEditIsNull() {
addCriterion("share_patient_edit is null");
return (Criteria) this;
}
public Criteria andSharePatientEditIsNotNull() {
addCriterion("share_patient_edit is not null");
return (Criteria) this;
}
public Criteria andSharePatientEditEqualTo(String value) {
addCriterion("share_patient_edit =", value, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditNotEqualTo(String value) {
addCriterion("share_patient_edit <>", value, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditGreaterThan(String value) {
addCriterion("share_patient_edit >", value, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditGreaterThanOrEqualTo(String value) {
addCriterion("share_patient_edit >=", value, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditLessThan(String value) {
addCriterion("share_patient_edit <", value, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditLessThanOrEqualTo(String value) {
addCriterion("share_patient_edit <=", value, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditLike(String value) {
addCriterion("share_patient_edit like", value, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditNotLike(String value) {
addCriterion("share_patient_edit not like", value, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditIn(List<String> values) {
addCriterion("share_patient_edit in", values, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditNotIn(List<String> values) {
addCriterion("share_patient_edit not in", values, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditBetween(String value1, String value2) {
addCriterion("share_patient_edit between", value1, value2, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andSharePatientEditNotBetween(String value1, String value2) {
addCriterion("share_patient_edit not between", value1, value2, "sharePatientEdit");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;

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 {

258
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
@ -108,6 +133,7 @@ public class PatientReportVo {
List<PdfUtil.Row> rows = new ArrayList<>();
//第一栏
rows.add(
fillRow(
@ -118,7 +144,7 @@ public class PatientReportVo {
//第二栏
rows.add(
fillRow(
"文化程度(年或月):" + this.educationalStatusUnit,
"文化程度:" + this.educationalStatusUnit + "年",
"编号:" + this.serialNumber,
"职业:" + careerMap.get(this.career))
);
@ -151,7 +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);
}
@ -198,117 +229,153 @@ 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);
// fillBlankCell(row1, row2);
rows.add(row1);
rows.add(row2);
//下一行
PdfUtil.Row row3 = new PdfUtil.Row();
PdfUtil.Row row4 = new PdfUtil.Row();
PdfUtil.Row row5 = new PdfUtil.Row();
// fillBlankCell(row3, row4, row5);
//延迟回忆特殊处理
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);
// fillBlankCell(row5);
}
// fillBlankCell(row3);
// fillBlankCell(row3, row4, row5);
rows.add(row3);
rows.add(row4);
rows.add(row5);
fillMoca(rows);
}
}
if (StrUtil.isBlank(this.description)) {
return rows;
}
PdfUtil.Row descRow = new PdfUtil.Row();
PdfUtil.Cell cell = new PdfUtil.Cell();
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
@ -320,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);
@ -331,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);
}

40
ht/src/main/java/com/ccsens/ht/service/DoctorService.java

@ -1,6 +1,8 @@
package com.ccsens.ht.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.cloudutil.bean.tall.dto.MemberRoleDto;
import com.ccsens.cloudutil.feign.TallFeignClient;
@ -13,17 +15,20 @@ import com.ccsens.ht.persist.dao.HtTitleDao;
import com.ccsens.ht.persist.mapper.HtDoctorMapper;
import com.ccsens.ht.uitl.Constant;
import com.ccsens.util.*;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -41,16 +46,18 @@ public class DoctorService implements IDoctorService {
@Autowired
private Snowflake snowflake;
@Autowired
@Resource
private HtDoctorMapper htDoctorMapper;
@Autowired
@Resource
private HtPositionDao htPositionDao;
@Autowired
@Resource
private HtTitleDao htTitleDao;
@Autowired
@Resource
private HtDoctorAuditDao htDoctorAuditDao;
@Autowired
private TallFeignClient tallFeignClient;
@Value("${ht.project.patientUrl}")
private String patientUrl;
@ -274,6 +281,31 @@ public class DoctorService implements IDoctorService {
return htDoctorMapper.selectByExample(doctorExample);
}
@Override
public String getShareUrl(Long userId) throws Exception {
HtDoctorExample example = new HtDoctorExample();
example.createCriteria().andUserIdEqualTo(userId).andAuditStateEqualTo(Constant.Ht.Doctor.CHECK_SUCCESS);
List<HtDoctor> htDoctors = htDoctorMapper.selectByExample(example);
if (CollectionUtil.isEmpty(htDoctors)) {
log.info("没有找到{}对应的医生信息", userId);
throw new BaseException(CodeEnum.PARAM_ERROR);
}
HtDoctor doctor = htDoctors.get(0);
if (StrUtil.isNotBlank(doctor.getSharePatientEdit())) {
return doctor.getSharePatientEdit();
}
log.info("生成分享评测对象信息录入页面");
String shareUrl = patientUrl + "?userId=" + userId;
String codePath = QrCodeUtil.urlToQRCode(shareUrl, PropUtil.path);
String codeUrl = PropUtil.imgDomain + "/" + codePath;
log.info("生成的二维码路径:{}", codeUrl);
doctor.setSharePatientEdit(codeUrl);
log.info("修改医生分享评测对象信息录入页面路径");
return codeUrl;
}
@Override
public DoctorVo.Query queryDoctorStatus(Long userId) {
DoctorVo.Query query = htDoctorAuditDao.queryDoctorStatus(userId);

7
ht/src/main/java/com/ccsens/ht/service/IDoctorService.java

@ -58,4 +58,11 @@ public interface IDoctorService {
/**查询医生审核状态*/
DoctorVo.Query queryDoctorStatus(Long userId);
/**
* 医生分享病人编辑路径
* @param userId
* @return
*/
String getShareUrl(Long userId) throws Exception;
}

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

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

@ -78,9 +78,7 @@ public class PatientReportService implements IPatientReportService {
return JsonResponse.newInstance().ok(CodeEnum.PARAM_ERROR);
}
HtPatientReportExample example = new HtPatientReportExample();
example.createCriteria().andPatientIdEqualTo(htPatient.getId());
long times = htPatientReportDao.countByExample(example);
HtPatientReport htPatientReport = new HtPatientReport();
htPatientReport.setId(snowflake.nextId());
htPatientReport.setDoctorId(doctors.get(0).getId());
@ -89,7 +87,6 @@ public class PatientReportService implements IPatientReportService {
htPatientReport.setPatientAge(StrUtil.isEmpty(htPatient.getIdcard()) ? null : (byte)IdcardUtil.getAgeByIdCard(htPatient.getIdcard()));
htPatientReport.setEvaluationCode(Constant.Ht.Report.PARENT_CODE);
htPatientReport.setName(Constant.Ht.Report.PARENT_NAME + DateUtil.today());
htPatientReport.setSerialNumber(htPatient.getId() + "_" + (times + 1));
htPatientReport.setReportTime(System.currentTimeMillis());
// 查询医院信息
String hospital = htPositionDao.queryHospital(doctors.get(0).getPositionId());
@ -147,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();
@ -254,6 +252,9 @@ public class PatientReportService implements IPatientReportService {
});
scores.forEach(score -> {
if (Constant.Ht.Report.MOCA_SJZ.equalsIgnoreCase(score.getCode())) {
return;
}
sumScore(score);
});
@ -383,28 +384,47 @@ public class PatientReportService implements IPatientReportService {
content.addAll(reportScore.toRow());
});
PdfUtil.Row row = new PdfUtil.Row();
addCell(row,"初步印象",2,2);
addCell(row, detail.getPatient().getInitialImpression(), 6, 2);
PdfUtil.Cell initWordCell = addCell(row, "初步印象", 2, 2);
initWordCell.setHeight(PdfUtil.Cell.defaultHeight * 2);
PdfUtil.Cell initImplCell = addCell(row, detail.getPatient().getInitialImpression(), 6, 2);
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);
return path;
}
private void addCell(PdfUtil.Row row, String content, int colSpan, int rowSpan, int... border) {
private PdfUtil.Cell addCell(PdfUtil.Row row, String content, int colSpan, int rowSpan, int... border) {
PdfUtil.Cell cell1 = new PdfUtil.Cell();
cell1.setContent(content);
cell1.setColSpan(colSpan);
cell1.setRowSpan(rowSpan);
cell1.setBorder(border == null || border.length == 0 ? 1 : border[0]);
row.addCell(cell1);
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

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-dev.yml

@ -34,4 +34,6 @@ file:
imgDomain: http://localhost:7040/uploads
ht:
project:
name: 认知功能评测云平台系统
patientUrl: https://www.baidu.com/
name: 认知功能评测云平台系统

1
ht/src/main/resources/application-prod.yml

@ -34,6 +34,7 @@ file:
imgDomain: https://www.tall.wiki/gateway/ht/uploads
ht:
project:
patientUrl: https://www.tall.wiki/ht-dev/htPatientRegister
name: 认知功能评测云平台系统
eureka:
instance:

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

@ -35,6 +35,7 @@ file:
imgDomain: https://test.tall.wiki/gateway/ht/uploads
ht:
project:
patientUrl: https://test.tall.wiki/ht-dev/htPatientRegister
name: 认知功能评测云平台系统
eureka:
instance:

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>

25
ht/src/main/resources/mapper_raw/HtDoctorMapper.xml

@ -12,6 +12,7 @@
<result column="auditor_id" jdbcType="BIGINT" property="auditorId" />
<result column="audit_state" jdbcType="TINYINT" property="auditState" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="share_patient_edit" jdbcType="VARCHAR" property="sharePatientEdit" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_del" jdbcType="TINYINT" property="isDel" />
@ -76,7 +77,7 @@
</sql>
<sql id="Base_Column_List">
id, user_id, position_id, title_id, name, sex, age, auditor_id, audit_state, remark,
create_time, update_time, is_del
share_patient_edit, create_time, update_time, is_del
</sql>
<select id="selectByExample" parameterType="com.ccsens.ht.bean.po.HtDoctorExample" resultMap="BaseResultMap">
select
@ -112,13 +113,13 @@
insert into t_ht_doctor (id, user_id, position_id,
title_id, name, sex,
age, auditor_id, audit_state,
remark, create_time, update_time,
is_del)
remark, share_patient_edit, create_time,
update_time, is_del)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{positionId,jdbcType=BIGINT},
#{titleId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{sex,jdbcType=TINYINT},
#{age,jdbcType=INTEGER}, #{auditorId,jdbcType=BIGINT}, #{auditState,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{isDel,jdbcType=TINYINT})
#{remark,jdbcType=VARCHAR}, #{sharePatientEdit,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDel,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ht.bean.po.HtDoctor">
insert into t_ht_doctor
@ -153,6 +154,9 @@
<if test="remark != null">
remark,
</if>
<if test="sharePatientEdit != null">
share_patient_edit,
</if>
<if test="createTime != null">
create_time,
</if>
@ -194,6 +198,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="sharePatientEdit != null">
#{sharePatientEdit,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
@ -244,6 +251,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.sharePatientEdit != null">
share_patient_edit = #{record.sharePatientEdit,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
@ -270,6 +280,7 @@
auditor_id = #{record.auditorId,jdbcType=BIGINT},
audit_state = #{record.auditState,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR},
share_patient_edit = #{record.sharePatientEdit,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_del = #{record.isDel,jdbcType=TINYINT}
@ -307,6 +318,9 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="sharePatientEdit != null">
share_patient_edit = #{sharePatientEdit,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
@ -330,6 +344,7 @@
auditor_id = #{auditorId,jdbcType=BIGINT},
audit_state = #{auditState,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},
share_patient_edit = #{sharePatientEdit,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_del = #{isDel,jdbcType=TINYINT}

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>

1
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

4
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -112,9 +112,13 @@ public enum CodeEnum {
HEALTH_TYPE_ERROR(94,"您的健康状态异常,打卡失败。",true),
NOT_HEALTH_RECORD(95,"您今天还未上报健康信息,请上报后再试。",true),
SELECT_TIME_ERROR(96,"请输入正确的查询时间",true),
TASK_PREPARATION(97,"任务已经开始了,请勿重复操作",true),
NOT_COMMENT(98,"该评论不存在",true),
NOT_MESSAGE_TYPE(99,"找不到消息类型,请检查名称是否正确",true),
DINGDING_EXCEPTION(100,"钉钉接口调用异常。",true),
URL_ERROR(101, "请求路径转换异常", true),
;
public CodeEnum addMsg(String msg){

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

@ -2,6 +2,7 @@ package com.ccsens.util;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
@ -29,11 +30,12 @@ public class PdfUtil {
* 生成pdf
* @param parentPath
* @param title
* @param subhead 副标题
* @param intros
* @param content
* @return
*/
public static String credatePdf(String parentPath, String title, 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);
@ -43,21 +45,28 @@ 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);
// 标题字体
Font titleChinese = new Font(bfChinese, 18, Font.BOLD);
Font titleChinese = new Font(bfChinese, 24, Font.BOLD);
//设置标题
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);
//设置标题
Paragraph subheadPar = new Paragraph(subhead, subheadChinese);
subheadPar.setAlignment(Element.ALIGN_CENTER);
document.add(subheadPar);
}
// 每行加空白
fillBlankRow(document, titleChinese);
//设置介绍内容
if (CollectionUtil.isNotEmpty(intros)) {
fillRow(intros, document);
@ -112,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);
@ -120,12 +129,20 @@ 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) {
//水平居中
pdfpCell.setHorizontalAlignment(Element.ALIGN_CENTER);
}
//垂直居中
pdfpCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
pdfpCell.setMinimumHeight(cell.height);
table.addCell(pdfpCell);
}
}
@ -156,14 +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 = 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;
}
}

13
util/src/main/java/com/ccsens/util/RestTemplateUtil.java

@ -3,6 +3,7 @@ package com.ccsens.util;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
@ -15,6 +16,8 @@ import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
@Slf4j
@ -61,7 +64,15 @@ public class RestTemplateUtil {
JSONObject json = JSON.parseObject(JSON.toJSONString(params));
HttpEntity<Map<String, Object>> objectHttpEntity = new HttpEntity<>(json,httpHeaders);
ResponseEntity<String> response = util.restTemplate.postForEntity(url, objectHttpEntity, String.class);
URI uri = null;
try {
uri = new URI(url);
}catch (URISyntaxException e) {
log.error("转换路径异常:{}", e);
throw new BaseException(CodeEnum.URL_ERROR);
}
ResponseEntity<String> response = util.restTemplate.postForEntity(uri, objectHttpEntity, String.class);
log.info("返回:{}", response);
return response.getBody();
}

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