diff --git a/app_client/pages/index/index.vue b/app_client/pages/index/index.vue index 8b823d8..4c299ed 100644 --- a/app_client/pages/index/index.vue +++ b/app_client/pages/index/index.vue @@ -1,30 +1,481 @@ + diff --git a/ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml b/ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml index 057ebe8..25fbf34 100644 --- a/ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml +++ b/ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml @@ -20,9 +20,9 @@ + password="q7510327"> @@ -60,11 +60,11 @@ - + - +
diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/EmsDto.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/EmsDto.java index facc58f..da465cd 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/EmsDto.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/EmsDto.java @@ -101,6 +101,7 @@ public class EmsDto { public static class BindScale { @ApiModelProperty("测评id") private Long evaluationId; + @ApiModelProperty("问题id") private List scaleList; } @@ -110,6 +111,8 @@ public class EmsDto { public static class EvaluationScale{ @ApiModelProperty("量表code") private String scaleCode; + @ApiModelProperty("套餐ID") + private Long comboId; @ApiModelProperty("排序") private Integer sort; } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/PmsPatientDto.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/PmsPatientDto.java index 3ca9c0c..db55c34 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/PmsPatientDto.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/PmsPatientDto.java @@ -33,9 +33,17 @@ public class PmsPatientDto { @ApiModelProperty("结束时间") private String endTime; private String idcardEncrypt; + private Byte sex; + private Long deptId; @ApiModelProperty("每个像素的毫米数") private BigDecimal mmPerPixel = new BigDecimal("0.1"); + + @ApiModelProperty("受教育程度 1:文盲 2:小学 3:初中 4:高中 5:大学 6:大学以上") + private Byte educationalStatus; + + @ApiModelProperty("年龄分组") + private Byte ageStatus; } @ApiModel("根据id查看患者详情") @@ -55,7 +63,7 @@ public class PmsPatientDto { @Data @ApiModel("修改添加患者信息") - public static class EditPatient{ + public static class EditPatient { @ApiModelProperty("病人id") private Long id; @ApiModelProperty("病人用户id") @@ -71,7 +79,7 @@ public class PmsPatientDto { private String patientNumber; @ApiModelProperty("病人住院号") private String hospitalNumber; -// @NotNull(message="请填写身份证号") + // @NotNull(message="请填写身份证号") @ApiModelProperty("病人身份证号") private String idcard; @NotNull(message = "请选择性别") @@ -85,22 +93,22 @@ public class PmsPatientDto { @NotNull(message = "请选择教育程度") @ApiModelProperty("教育程度(1:文盲 2:小学 3:初中 4:高中 5:大学 6:大学以上 7:其他)") private Byte educationalStatus; -// @NotNull(message = "请选择受教育时间") + // @NotNull(message = "请选择受教育时间") // @ApiModelProperty("受教育时间(年或月)") // private String educationalStatusUnit; @ApiModelProperty("民族") private String nation; @ApiModelProperty("籍贯") private String nativePlace; - @NotNull(message="请选择职业") + @NotNull(message = "请选择职业") @ApiModelProperty("职业(1:农林牧渔水利生产人员 2:教师 3:医务工作者 4:专业技术人员 5:生产、运输设备操作人员及有关人员6:商业、服务业人员7:国家机关、事业单位、企业负责人8:国家机关、事业单位、企业办事人员和有关人员9:军人 10:媒体、文体类工作人员 11:在校学生 12:未就业 13:家务 14:其他") private Byte career; -// @NotNull(message="请填写生育数量") + // @NotNull(message="请填写生育数量") // @ApiModelProperty("生育数量") // private Integer birthNumber; @ApiModelProperty("绝经年龄(女)") private Integer menopauseAge; -// @NotNull(message="请填写联系人") + // @NotNull(message="请填写联系人") // @ApiModelProperty("联系人") // private String contact; // @NotNull(message = "请填写联系电话") @@ -152,8 +160,10 @@ public class PmsPatientDto { private String rhBloodType; - /**复制当前的对象为HtPatient*/ - public PmsPatient copy(){ + /** + * 复制当前的对象为HtPatient + */ + public PmsPatient copy() { PmsPatient patient = new PmsPatient(); BeanUtils.copyProperties(this, patient); return patient; @@ -161,14 +171,14 @@ public class PmsPatientDto { public String getNameInitial() { if (StrUtil.isNotEmpty(name)) { - return PinyinUtil.getFirstLetter(name,""); + return PinyinUtil.getFirstLetter(name, ""); } return null; } public String getNameFull() { if (StrUtil.isNotEmpty(name)) { - return PinyinUtil.getPinyin(name,""); + return PinyinUtil.getPinyin(name, ""); } return null; } @@ -176,7 +186,7 @@ public class PmsPatientDto { @Data @ApiModel("修改添加患者信息") - public static class EditPatient1{ + public static class EditPatient1 { @ApiModelProperty("病人id") private Long id; @ApiModelProperty("病人用户id") @@ -245,8 +255,10 @@ public class PmsPatientDto { @ApiModelProperty("出生年份") private Integer birthYear; - /**复制当前的对象为HtPatient*/ - public PmsPatient copy(){ + /** + * 复制当前的对象为HtPatient + */ + public PmsPatient copy() { PmsPatient patient = new PmsPatient(); BeanUtils.copyProperties(this, patient); return patient; @@ -254,14 +266,14 @@ public class PmsPatientDto { public String getNameInitial() { if (StrUtil.isNotEmpty(name)) { - return PinyinUtil.getFirstLetter(name,""); + return PinyinUtil.getFirstLetter(name, ""); } return null; } public String getNameFull() { if (StrUtil.isNotEmpty(name)) { - return PinyinUtil.getPinyin(name,""); + return PinyinUtil.getPinyin(name, ""); } return null; } @@ -271,17 +283,27 @@ public class PmsPatientDto { @ApiModel("PatientDtoEditOtherMsg") public static class EditOtherMsg { @ApiModelProperty("病人其他信息") - @NotNull(message="病人其他信息不能为空") + @NotNull(message = "病人其他信息不能为空") private Object model; @ApiModelProperty("类型") - @NotNull(message="病人类型不能为空") + @NotNull(message = "病人类型不能为空") private String editType; } @Data - public class QueryPatientJz { + public static class QueryPatientJz { @ApiModelProperty("病人id") private Long patientId; + @ApiModelProperty("就诊类型 0门诊 1住院") + private Byte visitType; + @ApiModelProperty("开始时间") + private String beginTime; + @ApiModelProperty("结束时间") + private String endTime; + @ApiModelProperty("部门") + private Long deptId; + @ApiModelProperty("诊断编码") + private String diagnosisCode; } } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/RmsDto.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/RmsDto.java index 9bc666b..8944f6f 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/RmsDto.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/RmsDto.java @@ -41,11 +41,12 @@ public class RmsDto { @ApiModelProperty("完成状态 0:未完成 1:完成 2:中止") private Byte complateStatus; private Byte sex; + } @ApiModel("导出报告单-VO") @Data - public static class ExportReportDto{ + public static class ExportReportDto { @NotNull(message = "报告单ID不能为空") @ApiModelProperty("报告单ID") private Long reportId; @@ -65,7 +66,7 @@ public class RmsDto { @ApiModel("导出报告单-VO") @Data - public static class ExportReport1Dto{ + public static class ExportReport1Dto { @NotNull(message = "报告单ID不能为空") @ApiModelProperty("报告单ID") private Long reportId; @@ -77,12 +78,16 @@ public class RmsDto { @ApiModelProperty("MoCA雷达图路径") private String ldt; + + @ApiModelProperty("测评医生(userID)") + private Long testerId; + private Long deptId; } @ApiModel("导出受试者合作评分报告单-VO") @Data - public static class ExportWorkingScoreDto{ + public static class ExportWorkingScoreDto { @NotNull(message = "报告单ID不能为空") @ApiModelProperty("报告单ID") private Long reportId; @@ -94,13 +99,15 @@ public class RmsDto { @ApiModel("查询历史报告单列表-DTO") @Data - public static class QueryReportHistory{ + public static class QueryReportHistory { @ApiModelProperty("病人ID") private Long patientId; @ApiModelProperty("病人名称/全拼/首字母") private String searchValue; @ApiModelProperty("测评师名称") private String testerName; + @ApiModelProperty("测评师Id") + private Long testerId; @ApiModelProperty("完成状态 0:未完成 1:完成 2:中止") private Byte completeStatus; @ApiModelProperty("是否筛未做题的测评 0查询全部 1只查询已做题的") @@ -110,6 +117,9 @@ public class RmsDto { @ApiModelProperty("结束时间") private String endTime; private Long version; + @ApiModelProperty("测评量表CODE") + private String code; + private Byte needPlan; @ApiModelProperty("每个像素的毫米数") private BigDecimal mmPerPixel = new BigDecimal("0.1"); @@ -118,7 +128,7 @@ public class RmsDto { @ApiModel("修改报告单基本信息-DTO") @Data - public static class UpdateReportBasic{ + public static class UpdateReportBasic { @ApiModelProperty("测评id") private Long evaluationId; @ApiModelProperty("初步印象") @@ -141,7 +151,7 @@ public class RmsDto { @ApiModel("修改量表的初步印象信息-DTO") @Data - public static class UpdateScaleInitialImpression{ + public static class UpdateScaleInitialImpression { @ApiModelProperty("报告单id") private Long reportId; @ApiModelProperty("量表code") @@ -152,7 +162,7 @@ public class RmsDto { @ApiModel("报到单签名-DTO") @Data - public static class ReportSign{ + public static class ReportSign { @ApiModelProperty("病人ID") private Long reportId; @ApiModelProperty("签名id") @@ -200,9 +210,10 @@ public class RmsDto { @ApiModelProperty("分数") private List scores; } + @ApiModel("分数") @Data - public static class Score{ + public static class Score { @ApiModelProperty("量表类型") private String code; @ApiModelProperty("开始") @@ -224,7 +235,7 @@ public class RmsDto { @Data @ApiModel("搜索条件-请求参数") - public static class SearchParam{ + public static class SearchParam { @ApiModelProperty("查询类型") private String parentCode; } @@ -232,7 +243,7 @@ public class RmsDto { @ApiModel("导出历史报告单每题的分数-DTO") @Data - public static class ExportReportWhitScore{ + public static class ExportReportWhitScore { @ApiModelProperty("选择需要导出的量表") private List scaleCodes; @@ -262,4 +273,54 @@ public class RmsDto { private String visitNo; } + @ApiModel("导出历史报告单(查看详细的报告单文件)-DTO") + @Data + public static class queryPdfUrl{ + @ApiModelProperty("报告单ID") + private Long reportId; + @ApiModelProperty("测评ID") + private Long evaluationId; + @ApiModelProperty("导出类型 0医生版 1个人版 2阳性版") + private String version; + @ApiModelProperty("评估医生id") + private Long assessorId; + } + + @Data + public static class ReportQuery { + @ApiModelProperty("量表code") + private String code; + @ApiModelProperty("开始时间") + private String beginTime; + @ApiModelProperty("结束时间") + private String endTime; + @ApiModelProperty("部门id") + private Long deptId; + @ApiModelProperty("评估结果") + private Byte needPlan; + @ApiModelProperty("测评师Id") + private Long testerId; + @ApiModelProperty("病人名称|手机号|身份证号") + private String searchValue; + + } + + @ApiModel("统计四列表之报告单-DTO") + @Data + public static class QueryReportList { + @ApiModelProperty("病人名称/全拼/首字母") + private String searchValue; + @ApiModelProperty("完成状态 0:未完成 1:完成 2:中止") + private Byte completeStatus; + @ApiModelProperty("开始时间") + private String beginTime; + @ApiModelProperty("结束时间") + private String endTime; + @ApiModelProperty("测评师Id") + private Long testerId; + @ApiModelProperty("测评版本信息") + private Long version; + @ApiModelProperty("部门id") + private Long deptId; + } } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/StatisticsDto.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/StatisticsDto.java index ef84135..348ccc5 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/StatisticsDto.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/StatisticsDto.java @@ -2,7 +2,6 @@ package com.ccsens.system.domain.dto; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; -import io.swagger.models.auth.In; import lombok.Data; import java.util.Date; @@ -16,7 +15,7 @@ public class StatisticsDto { @Data public static class Query { @ApiModelProperty("时间类型 0周 1月 2年") - private Byte dateType; + private Byte timeType; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date beginTime; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevance.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevance.java new file mode 100644 index 0000000..07959ef --- /dev/null +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevance.java @@ -0,0 +1,173 @@ +package com.ccsens.system.domain.po; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +public class EmsEvaluationScaleCognitiveRelevance implements Serializable { + private Long id; + + private Long evaluationId; + + private String scaleCode; + + private Long parentId; + + private String cognitiveCode; + + private BigDecimal score; + + private BigDecimal totalScore; + + private Long comboId; + + private Integer sort; + + private String createBy; + + private Date createTime; + + private String updateBy; + + private Date updateTime; + + private Byte delFlag; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getEvaluationId() { + return evaluationId; + } + + public void setEvaluationId(Long evaluationId) { + this.evaluationId = evaluationId; + } + + public String getScaleCode() { + return scaleCode; + } + + public void setScaleCode(String scaleCode) { + this.scaleCode = scaleCode == null ? null : scaleCode.trim(); + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public String getCognitiveCode() { + return cognitiveCode; + } + + public void setCognitiveCode(String cognitiveCode) { + this.cognitiveCode = cognitiveCode == null ? null : cognitiveCode.trim(); + } + + public BigDecimal getScore() { + return score; + } + + public void setScore(BigDecimal score) { + this.score = score; + } + + public BigDecimal getTotalScore() { + return totalScore; + } + + public void setTotalScore(BigDecimal totalScore) { + this.totalScore = totalScore; + } + + public Long getComboId() { + return comboId; + } + + public void setComboId(Long comboId) { + this.comboId = comboId; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Byte getDelFlag() { + return delFlag; + } + + public void setDelFlag(Byte delFlag) { + this.delFlag = delFlag; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", evaluationId=").append(evaluationId); + sb.append(", scaleCode=").append(scaleCode); + sb.append(", parentId=").append(parentId); + sb.append(", cognitiveCode=").append(cognitiveCode); + sb.append(", score=").append(score); + sb.append(", totalScore=").append(totalScore); + sb.append(", comboId=").append(comboId); + sb.append(", sort=").append(sort); + sb.append(", createBy=").append(createBy); + sb.append(", createTime=").append(createTime); + sb.append(", updateBy=").append(updateBy); + sb.append(", updateTime=").append(updateTime); + sb.append(", delFlag=").append(delFlag); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevanceExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevanceExample.java new file mode 100644 index 0000000..b0cefdf --- /dev/null +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevanceExample.java @@ -0,0 +1,1082 @@ +package com.ccsens.system.domain.po; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class EmsEvaluationScaleCognitiveRelevanceExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public EmsEvaluationScaleCognitiveRelevanceExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andEvaluationIdIsNull() { + addCriterion("evaluation_id is null"); + return (Criteria) this; + } + + public Criteria andEvaluationIdIsNotNull() { + addCriterion("evaluation_id is not null"); + return (Criteria) this; + } + + public Criteria andEvaluationIdEqualTo(Long value) { + addCriterion("evaluation_id =", value, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdNotEqualTo(Long value) { + addCriterion("evaluation_id <>", value, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdGreaterThan(Long value) { + addCriterion("evaluation_id >", value, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdGreaterThanOrEqualTo(Long value) { + addCriterion("evaluation_id >=", value, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdLessThan(Long value) { + addCriterion("evaluation_id <", value, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdLessThanOrEqualTo(Long value) { + addCriterion("evaluation_id <=", value, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdIn(List values) { + addCriterion("evaluation_id in", values, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdNotIn(List values) { + addCriterion("evaluation_id not in", values, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdBetween(Long value1, Long value2) { + addCriterion("evaluation_id between", value1, value2, "evaluationId"); + return (Criteria) this; + } + + public Criteria andEvaluationIdNotBetween(Long value1, Long value2) { + addCriterion("evaluation_id not between", value1, value2, "evaluationId"); + return (Criteria) this; + } + + public Criteria andScaleCodeIsNull() { + addCriterion("scale_code is null"); + return (Criteria) this; + } + + public Criteria andScaleCodeIsNotNull() { + addCriterion("scale_code is not null"); + return (Criteria) this; + } + + public Criteria andScaleCodeEqualTo(String value) { + addCriterion("scale_code =", value, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeNotEqualTo(String value) { + addCriterion("scale_code <>", value, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeGreaterThan(String value) { + addCriterion("scale_code >", value, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeGreaterThanOrEqualTo(String value) { + addCriterion("scale_code >=", value, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeLessThan(String value) { + addCriterion("scale_code <", value, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeLessThanOrEqualTo(String value) { + addCriterion("scale_code <=", value, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeLike(String value) { + addCriterion("scale_code like", value, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeNotLike(String value) { + addCriterion("scale_code not like", value, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeIn(List values) { + addCriterion("scale_code in", values, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeNotIn(List values) { + addCriterion("scale_code not in", values, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeBetween(String value1, String value2) { + addCriterion("scale_code between", value1, value2, "scaleCode"); + return (Criteria) this; + } + + public Criteria andScaleCodeNotBetween(String value1, String value2) { + addCriterion("scale_code not between", value1, value2, "scaleCode"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(Long value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(Long value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(Long value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(Long value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(Long value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(Long value1, Long value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(Long value1, Long value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeIsNull() { + addCriterion("cognitive_code is null"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeIsNotNull() { + addCriterion("cognitive_code is not null"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeEqualTo(String value) { + addCriterion("cognitive_code =", value, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeNotEqualTo(String value) { + addCriterion("cognitive_code <>", value, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeGreaterThan(String value) { + addCriterion("cognitive_code >", value, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeGreaterThanOrEqualTo(String value) { + addCriterion("cognitive_code >=", value, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeLessThan(String value) { + addCriterion("cognitive_code <", value, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeLessThanOrEqualTo(String value) { + addCriterion("cognitive_code <=", value, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeLike(String value) { + addCriterion("cognitive_code like", value, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeNotLike(String value) { + addCriterion("cognitive_code not like", value, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeIn(List values) { + addCriterion("cognitive_code in", values, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeNotIn(List values) { + addCriterion("cognitive_code not in", values, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeBetween(String value1, String value2) { + addCriterion("cognitive_code between", value1, value2, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andCognitiveCodeNotBetween(String value1, String value2) { + addCriterion("cognitive_code not between", value1, value2, "cognitiveCode"); + return (Criteria) this; + } + + public Criteria andScoreIsNull() { + addCriterion("score is null"); + return (Criteria) this; + } + + public Criteria andScoreIsNotNull() { + addCriterion("score is not null"); + return (Criteria) this; + } + + public Criteria andScoreEqualTo(BigDecimal value) { + addCriterion("score =", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotEqualTo(BigDecimal value) { + addCriterion("score <>", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreGreaterThan(BigDecimal value) { + addCriterion("score >", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("score >=", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreLessThan(BigDecimal value) { + addCriterion("score <", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreLessThanOrEqualTo(BigDecimal value) { + addCriterion("score <=", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreIn(List values) { + addCriterion("score in", values, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotIn(List values) { + addCriterion("score not in", values, "score"); + return (Criteria) this; + } + + public Criteria andScoreBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("score between", value1, value2, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("score not between", value1, value2, "score"); + return (Criteria) this; + } + + public Criteria andTotalScoreIsNull() { + addCriterion("total_score is null"); + return (Criteria) this; + } + + public Criteria andTotalScoreIsNotNull() { + addCriterion("total_score is not null"); + return (Criteria) this; + } + + public Criteria andTotalScoreEqualTo(BigDecimal value) { + addCriterion("total_score =", value, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreNotEqualTo(BigDecimal value) { + addCriterion("total_score <>", value, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreGreaterThan(BigDecimal value) { + addCriterion("total_score >", value, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("total_score >=", value, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreLessThan(BigDecimal value) { + addCriterion("total_score <", value, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreLessThanOrEqualTo(BigDecimal value) { + addCriterion("total_score <=", value, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreIn(List values) { + addCriterion("total_score in", values, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreNotIn(List values) { + addCriterion("total_score not in", values, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_score between", value1, value2, "totalScore"); + return (Criteria) this; + } + + public Criteria andTotalScoreNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_score not between", value1, value2, "totalScore"); + return (Criteria) this; + } + + public Criteria andComboIdIsNull() { + addCriterion("combo_id is null"); + return (Criteria) this; + } + + public Criteria andComboIdIsNotNull() { + addCriterion("combo_id is not null"); + return (Criteria) this; + } + + public Criteria andComboIdEqualTo(Long value) { + addCriterion("combo_id =", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdNotEqualTo(Long value) { + addCriterion("combo_id <>", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdGreaterThan(Long value) { + addCriterion("combo_id >", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdGreaterThanOrEqualTo(Long value) { + addCriterion("combo_id >=", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdLessThan(Long value) { + addCriterion("combo_id <", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdLessThanOrEqualTo(Long value) { + addCriterion("combo_id <=", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdIn(List values) { + addCriterion("combo_id in", values, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdNotIn(List values) { + addCriterion("combo_id not in", values, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdBetween(Long value1, Long value2) { + addCriterion("combo_id between", value1, value2, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdNotBetween(Long value1, Long value2) { + addCriterion("combo_id not between", value1, value2, "comboId"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(Integer value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(Integer value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(Integer value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(Integer value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(Integer value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(Integer value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(Integer value1, Integer value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(Integer value1, Integer value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andCreateByIsNull() { + addCriterion("create_by is null"); + return (Criteria) this; + } + + public Criteria andCreateByIsNotNull() { + addCriterion("create_by is not null"); + return (Criteria) this; + } + + public Criteria andCreateByEqualTo(String value) { + addCriterion("create_by =", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotEqualTo(String value) { + addCriterion("create_by <>", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThan(String value) { + addCriterion("create_by >", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThanOrEqualTo(String value) { + addCriterion("create_by >=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThan(String value) { + addCriterion("create_by <", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThanOrEqualTo(String value) { + addCriterion("create_by <=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLike(String value) { + addCriterion("create_by like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotLike(String value) { + addCriterion("create_by not like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByIn(List values) { + addCriterion("create_by in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotIn(List values) { + addCriterion("create_by not in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByBetween(String value1, String value2) { + addCriterion("create_by between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotBetween(String value1, String value2) { + addCriterion("create_by not between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateByIsNull() { + addCriterion("update_by is null"); + return (Criteria) this; + } + + public Criteria andUpdateByIsNotNull() { + addCriterion("update_by is not null"); + return (Criteria) this; + } + + public Criteria andUpdateByEqualTo(String value) { + addCriterion("update_by =", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotEqualTo(String value) { + addCriterion("update_by <>", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByGreaterThan(String value) { + addCriterion("update_by >", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByGreaterThanOrEqualTo(String value) { + addCriterion("update_by >=", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLessThan(String value) { + addCriterion("update_by <", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLessThanOrEqualTo(String value) { + addCriterion("update_by <=", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLike(String value) { + addCriterion("update_by like", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotLike(String value) { + addCriterion("update_by not like", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByIn(List values) { + addCriterion("update_by in", values, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotIn(List values) { + addCriterion("update_by not in", values, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByBetween(String value1, String value2) { + addCriterion("update_by between", value1, value2, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotBetween(String value1, String value2) { + addCriterion("update_by not between", value1, value2, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andDelFlagIsNull() { + addCriterion("del_flag is null"); + return (Criteria) this; + } + + public Criteria andDelFlagIsNotNull() { + addCriterion("del_flag is not null"); + return (Criteria) this; + } + + public Criteria andDelFlagEqualTo(Byte value) { + addCriterion("del_flag =", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotEqualTo(Byte value) { + addCriterion("del_flag <>", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagGreaterThan(Byte value) { + addCriterion("del_flag >", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagGreaterThanOrEqualTo(Byte value) { + addCriterion("del_flag >=", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagLessThan(Byte value) { + addCriterion("del_flag <", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagLessThanOrEqualTo(Byte value) { + addCriterion("del_flag <=", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagIn(List values) { + addCriterion("del_flag in", values, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotIn(List values) { + addCriterion("del_flag not in", values, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagBetween(Byte value1, Byte value2) { + addCriterion("del_flag between", value1, value2, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotBetween(Byte value1, Byte value2) { + addCriterion("del_flag not between", value1, value2, "delFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevance.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevance.java index eec16a5..d5dc19d 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevance.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevance.java @@ -1,6 +1,7 @@ package com.ccsens.system.domain.po; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; public class EmsEvaluationScaleRelevance implements Serializable { @@ -10,6 +11,10 @@ public class EmsEvaluationScaleRelevance implements Serializable { private String scaleCode; + private Long comboId; + + private BigDecimal score; + private Integer sort; private String createBy; @@ -48,6 +53,22 @@ public class EmsEvaluationScaleRelevance implements Serializable { this.scaleCode = scaleCode == null ? null : scaleCode.trim(); } + public Long getComboId() { + return comboId; + } + + public void setComboId(Long comboId) { + this.comboId = comboId; + } + + public BigDecimal getScore() { + return score; + } + + public void setScore(BigDecimal score) { + this.score = score; + } + public Integer getSort() { return sort; } @@ -105,6 +126,8 @@ public class EmsEvaluationScaleRelevance implements Serializable { sb.append(", id=").append(id); sb.append(", evaluationId=").append(evaluationId); sb.append(", scaleCode=").append(scaleCode); + sb.append(", comboId=").append(comboId); + sb.append(", score=").append(score); sb.append(", sort=").append(sort); sb.append(", createBy=").append(createBy); sb.append(", createTime=").append(createTime); diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevanceExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevanceExample.java index da622fc..2a7b595 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevanceExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevanceExample.java @@ -1,5 +1,6 @@ package com.ccsens.system.domain.po; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -295,6 +296,126 @@ public class EmsEvaluationScaleRelevanceExample { return (Criteria) this; } + public Criteria andComboIdIsNull() { + addCriterion("combo_id is null"); + return (Criteria) this; + } + + public Criteria andComboIdIsNotNull() { + addCriterion("combo_id is not null"); + return (Criteria) this; + } + + public Criteria andComboIdEqualTo(Long value) { + addCriterion("combo_id =", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdNotEqualTo(Long value) { + addCriterion("combo_id <>", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdGreaterThan(Long value) { + addCriterion("combo_id >", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdGreaterThanOrEqualTo(Long value) { + addCriterion("combo_id >=", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdLessThan(Long value) { + addCriterion("combo_id <", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdLessThanOrEqualTo(Long value) { + addCriterion("combo_id <=", value, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdIn(List values) { + addCriterion("combo_id in", values, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdNotIn(List values) { + addCriterion("combo_id not in", values, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdBetween(Long value1, Long value2) { + addCriterion("combo_id between", value1, value2, "comboId"); + return (Criteria) this; + } + + public Criteria andComboIdNotBetween(Long value1, Long value2) { + addCriterion("combo_id not between", value1, value2, "comboId"); + return (Criteria) this; + } + + public Criteria andScoreIsNull() { + addCriterion("score is null"); + return (Criteria) this; + } + + public Criteria andScoreIsNotNull() { + addCriterion("score is not null"); + return (Criteria) this; + } + + public Criteria andScoreEqualTo(BigDecimal value) { + addCriterion("score =", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotEqualTo(BigDecimal value) { + addCriterion("score <>", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreGreaterThan(BigDecimal value) { + addCriterion("score >", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("score >=", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreLessThan(BigDecimal value) { + addCriterion("score <", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreLessThanOrEqualTo(BigDecimal value) { + addCriterion("score <=", value, "score"); + return (Criteria) this; + } + + public Criteria andScoreIn(List values) { + addCriterion("score in", values, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotIn(List values) { + addCriterion("score not in", values, "score"); + return (Criteria) this; + } + + public Criteria andScoreBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("score between", value1, value2, "score"); + return (Criteria) this; + } + + public Criteria andScoreNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("score not between", value1, value2, "score"); + return (Criteria) this; + } + public Criteria andSortIsNull() { addCriterion("sort is null"); return (Criteria) this; diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReport.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReport.java index 94d9818..0949fdc 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReport.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReport.java @@ -28,6 +28,10 @@ public class RmsReport implements Serializable { private String url; + private String persionUrl; + + private String positiveUrl; + private String qrCodeUrl; private String signUrl; @@ -150,6 +154,22 @@ public class RmsReport implements Serializable { this.url = url == null ? null : url.trim(); } + public String getPersionUrl() { + return persionUrl; + } + + public void setPersionUrl(String persionUrl) { + this.persionUrl = persionUrl == null ? null : persionUrl.trim(); + } + + public String getPositiveUrl() { + return positiveUrl; + } + + public void setPositiveUrl(String positiveUrl) { + this.positiveUrl = positiveUrl == null ? null : positiveUrl.trim(); + } + public String getQrCodeUrl() { return qrCodeUrl; } @@ -264,6 +284,8 @@ public class RmsReport implements Serializable { sb.append(", reportTime=").append(reportTime); sb.append(", evaluationCode=").append(evaluationCode); sb.append(", url=").append(url); + sb.append(", persionUrl=").append(persionUrl); + sb.append(", positiveUrl=").append(positiveUrl); sb.append(", qrCodeUrl=").append(qrCodeUrl); sb.append(", signUrl=").append(signUrl); sb.append(", remark=").append(remark); diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportExample.java index ba89234..04d9fda 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportExample.java @@ -895,6 +895,146 @@ public class RmsReportExample { return (Criteria) this; } + public Criteria andPersionUrlIsNull() { + addCriterion("persion_url is null"); + return (Criteria) this; + } + + public Criteria andPersionUrlIsNotNull() { + addCriterion("persion_url is not null"); + return (Criteria) this; + } + + public Criteria andPersionUrlEqualTo(String value) { + addCriterion("persion_url =", value, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlNotEqualTo(String value) { + addCriterion("persion_url <>", value, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlGreaterThan(String value) { + addCriterion("persion_url >", value, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlGreaterThanOrEqualTo(String value) { + addCriterion("persion_url >=", value, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlLessThan(String value) { + addCriterion("persion_url <", value, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlLessThanOrEqualTo(String value) { + addCriterion("persion_url <=", value, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlLike(String value) { + addCriterion("persion_url like", value, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlNotLike(String value) { + addCriterion("persion_url not like", value, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlIn(List values) { + addCriterion("persion_url in", values, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlNotIn(List values) { + addCriterion("persion_url not in", values, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlBetween(String value1, String value2) { + addCriterion("persion_url between", value1, value2, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPersionUrlNotBetween(String value1, String value2) { + addCriterion("persion_url not between", value1, value2, "persionUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlIsNull() { + addCriterion("positive_url is null"); + return (Criteria) this; + } + + public Criteria andPositiveUrlIsNotNull() { + addCriterion("positive_url is not null"); + return (Criteria) this; + } + + public Criteria andPositiveUrlEqualTo(String value) { + addCriterion("positive_url =", value, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlNotEqualTo(String value) { + addCriterion("positive_url <>", value, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlGreaterThan(String value) { + addCriterion("positive_url >", value, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlGreaterThanOrEqualTo(String value) { + addCriterion("positive_url >=", value, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlLessThan(String value) { + addCriterion("positive_url <", value, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlLessThanOrEqualTo(String value) { + addCriterion("positive_url <=", value, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlLike(String value) { + addCriterion("positive_url like", value, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlNotLike(String value) { + addCriterion("positive_url not like", value, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlIn(List values) { + addCriterion("positive_url in", values, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlNotIn(List values) { + addCriterion("positive_url not in", values, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlBetween(String value1, String value2) { + addCriterion("positive_url between", value1, value2, "positiveUrl"); + return (Criteria) this; + } + + public Criteria andPositiveUrlNotBetween(String value1, String value2) { + addCriterion("positive_url not between", value1, value2, "positiveUrl"); + return (Criteria) this; + } + public Criteria andQrCodeUrlIsNull() { addCriterion("qr_code_url is null"); return (Criteria) this; diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScore.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScore.java index 62e0129..0c1f595 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScore.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScore.java @@ -15,15 +15,7 @@ public class RmsReportScaleScore implements Serializable { private String impression; - private Integer sort; - - private Long scaleAssConf; - - private String result; - - private String needPlan; - - private String plan; + private Long comboId; private String createBy; @@ -35,6 +27,18 @@ public class RmsReportScaleScore implements Serializable { private Byte delFlag; + private Long scaleAssConf; + + private String result; + + private String needPlan; + + private String plan; + + private Integer sort; + + private Byte isShow; + private static final long serialVersionUID = 1L; public Long getId() { @@ -77,44 +81,12 @@ public class RmsReportScaleScore implements Serializable { this.impression = impression == null ? null : impression.trim(); } - public Integer getSort() { - return sort; - } - - public void setSort(Integer sort) { - this.sort = sort; + public Long getComboId() { + return comboId; } - public Long getScaleAssConf() { - return scaleAssConf; - } - - public void setScaleAssConf(Long scaleAssConf) { - this.scaleAssConf = scaleAssConf; - } - - public String getResult() { - return result; - } - - public void setResult(String result) { - this.result = result == null ? null : result.trim(); - } - - public String getNeedPlan() { - return needPlan; - } - - public void setNeedPlan(String needPlan) { - this.needPlan = needPlan == null ? null : needPlan.trim(); - } - - public String getPlan() { - return plan; - } - - public void setPlan(String plan) { - this.plan = plan == null ? null : plan.trim(); + public void setComboId(Long comboId) { + this.comboId = comboId; } public String getCreateBy() { @@ -157,6 +129,54 @@ public class RmsReportScaleScore implements Serializable { this.delFlag = delFlag; } + public Long getScaleAssConf() { + return scaleAssConf; + } + + public void setScaleAssConf(Long scaleAssConf) { + this.scaleAssConf = scaleAssConf; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result == null ? null : result.trim(); + } + + public String getNeedPlan() { + return needPlan; + } + + public void setNeedPlan(String needPlan) { + this.needPlan = needPlan == null ? null : needPlan.trim(); + } + + public String getPlan() { + return plan; + } + + public void setPlan(String plan) { + this.plan = plan == null ? null : plan.trim(); + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Byte getIsShow() { + return isShow; + } + + public void setIsShow(Byte isShow) { + this.isShow = isShow; + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -168,16 +188,18 @@ public class RmsReportScaleScore implements Serializable { sb.append(", scaleCode=").append(scaleCode); sb.append(", score=").append(score); sb.append(", impression=").append(impression); - sb.append(", sort=").append(sort); - sb.append(", scaleAssConf=").append(scaleAssConf); - sb.append(", result=").append(result); - sb.append(", needPlan=").append(needPlan); - sb.append(", plan=").append(plan); + sb.append(", comboId=").append(comboId); sb.append(", createBy=").append(createBy); sb.append(", createTime=").append(createTime); sb.append(", updateBy=").append(updateBy); sb.append(", updateTime=").append(updateTime); sb.append(", delFlag=").append(delFlag); + sb.append(", scaleAssConf=").append(scaleAssConf); + sb.append(", result=").append(result); + sb.append(", needPlan=").append(needPlan); + sb.append(", plan=").append(plan); + sb.append(", sort=").append(sort); + sb.append(", isShow=").append(isShow); sb.append("]"); return sb.toString(); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScoreExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScoreExample.java index 0520304..2df6c27 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScoreExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScoreExample.java @@ -426,653 +426,773 @@ public class RmsReportScaleScoreExample { return (Criteria) this; } - public Criteria andSortIsNull() { - addCriterion("sort is null"); + public Criteria andComboIdIsNull() { + addCriterion("combo_id is null"); return (Criteria) this; } - public Criteria andSortIsNotNull() { - addCriterion("sort is not null"); + public Criteria andComboIdIsNotNull() { + addCriterion("combo_id is not null"); return (Criteria) this; } - public Criteria andSortEqualTo(Integer value) { - addCriterion("sort =", value, "sort"); + public Criteria andComboIdEqualTo(Long value) { + addCriterion("combo_id =", value, "comboId"); return (Criteria) this; } - public Criteria andSortNotEqualTo(Integer value) { - addCriterion("sort <>", value, "sort"); + public Criteria andComboIdNotEqualTo(Long value) { + addCriterion("combo_id <>", value, "comboId"); return (Criteria) this; } - public Criteria andSortGreaterThan(Integer value) { - addCriterion("sort >", value, "sort"); + public Criteria andComboIdGreaterThan(Long value) { + addCriterion("combo_id >", value, "comboId"); return (Criteria) this; } - public Criteria andSortGreaterThanOrEqualTo(Integer value) { - addCriterion("sort >=", value, "sort"); + public Criteria andComboIdGreaterThanOrEqualTo(Long value) { + addCriterion("combo_id >=", value, "comboId"); return (Criteria) this; } - public Criteria andSortLessThan(Integer value) { - addCriterion("sort <", value, "sort"); + public Criteria andComboIdLessThan(Long value) { + addCriterion("combo_id <", value, "comboId"); return (Criteria) this; } - public Criteria andSortLessThanOrEqualTo(Integer value) { - addCriterion("sort <=", value, "sort"); + public Criteria andComboIdLessThanOrEqualTo(Long value) { + addCriterion("combo_id <=", value, "comboId"); return (Criteria) this; } - public Criteria andSortIn(List values) { - addCriterion("sort in", values, "sort"); + public Criteria andComboIdIn(List values) { + addCriterion("combo_id in", values, "comboId"); return (Criteria) this; } - public Criteria andSortNotIn(List values) { - addCriterion("sort not in", values, "sort"); + public Criteria andComboIdNotIn(List values) { + addCriterion("combo_id not in", values, "comboId"); return (Criteria) this; } - public Criteria andSortBetween(Integer value1, Integer value2) { - addCriterion("sort between", value1, value2, "sort"); + public Criteria andComboIdBetween(Long value1, Long value2) { + addCriterion("combo_id between", value1, value2, "comboId"); return (Criteria) this; } - public Criteria andSortNotBetween(Integer value1, Integer value2) { - addCriterion("sort not between", value1, value2, "sort"); + public Criteria andComboIdNotBetween(Long value1, Long value2) { + addCriterion("combo_id not between", value1, value2, "comboId"); return (Criteria) this; } - public Criteria andScaleAssConfIsNull() { - addCriterion("scale_ass_conf is null"); + public Criteria andCreateByIsNull() { + addCriterion("create_by is null"); return (Criteria) this; } - public Criteria andScaleAssConfIsNotNull() { - addCriterion("scale_ass_conf is not null"); + public Criteria andCreateByIsNotNull() { + addCriterion("create_by is not null"); return (Criteria) this; } - public Criteria andScaleAssConfEqualTo(Long value) { - addCriterion("scale_ass_conf =", value, "scaleAssConf"); + public Criteria andCreateByEqualTo(String value) { + addCriterion("create_by =", value, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfNotEqualTo(Long value) { - addCriterion("scale_ass_conf <>", value, "scaleAssConf"); + public Criteria andCreateByNotEqualTo(String value) { + addCriterion("create_by <>", value, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfGreaterThan(Long value) { - addCriterion("scale_ass_conf >", value, "scaleAssConf"); + public Criteria andCreateByGreaterThan(String value) { + addCriterion("create_by >", value, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfGreaterThanOrEqualTo(Long value) { - addCriterion("scale_ass_conf >=", value, "scaleAssConf"); + public Criteria andCreateByGreaterThanOrEqualTo(String value) { + addCriterion("create_by >=", value, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfLessThan(Long value) { - addCriterion("scale_ass_conf <", value, "scaleAssConf"); + public Criteria andCreateByLessThan(String value) { + addCriterion("create_by <", value, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfLessThanOrEqualTo(Long value) { - addCriterion("scale_ass_conf <=", value, "scaleAssConf"); + public Criteria andCreateByLessThanOrEqualTo(String value) { + addCriterion("create_by <=", value, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfIn(List values) { - addCriterion("scale_ass_conf in", values, "scaleAssConf"); + public Criteria andCreateByLike(String value) { + addCriterion("create_by like", value, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfNotIn(List values) { - addCriterion("scale_ass_conf not in", values, "scaleAssConf"); + public Criteria andCreateByNotLike(String value) { + addCriterion("create_by not like", value, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfBetween(Long value1, Long value2) { - addCriterion("scale_ass_conf between", value1, value2, "scaleAssConf"); + public Criteria andCreateByIn(List values) { + addCriterion("create_by in", values, "createBy"); return (Criteria) this; } - public Criteria andScaleAssConfNotBetween(Long value1, Long value2) { - addCriterion("scale_ass_conf not between", value1, value2, "scaleAssConf"); + public Criteria andCreateByNotIn(List values) { + addCriterion("create_by not in", values, "createBy"); return (Criteria) this; } - public Criteria andResultIsNull() { - addCriterion("result is null"); + public Criteria andCreateByBetween(String value1, String value2) { + addCriterion("create_by between", value1, value2, "createBy"); return (Criteria) this; } - public Criteria andResultIsNotNull() { - addCriterion("result is not null"); + public Criteria andCreateByNotBetween(String value1, String value2) { + addCriterion("create_by not between", value1, value2, "createBy"); return (Criteria) this; } - public Criteria andResultEqualTo(String value) { - addCriterion("result =", value, "result"); + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); return (Criteria) this; } - public Criteria andResultNotEqualTo(String value) { - addCriterion("result <>", value, "result"); + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); return (Criteria) this; } - public Criteria andResultGreaterThan(String value) { - addCriterion("result >", value, "result"); + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); return (Criteria) this; } - public Criteria andResultGreaterThanOrEqualTo(String value) { - addCriterion("result >=", value, "result"); + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); return (Criteria) this; } - public Criteria andResultLessThan(String value) { - addCriterion("result <", value, "result"); + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); return (Criteria) this; } - public Criteria andResultLessThanOrEqualTo(String value) { - addCriterion("result <=", value, "result"); + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); return (Criteria) this; } - public Criteria andResultLike(String value) { - addCriterion("result like", value, "result"); + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); return (Criteria) this; } - public Criteria andResultNotLike(String value) { - addCriterion("result not like", value, "result"); + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); return (Criteria) this; } - public Criteria andResultIn(List values) { - addCriterion("result in", values, "result"); + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); return (Criteria) this; } - public Criteria andResultNotIn(List values) { - addCriterion("result not in", values, "result"); + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); return (Criteria) this; } - public Criteria andResultBetween(String value1, String value2) { - addCriterion("result between", value1, value2, "result"); + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); return (Criteria) this; } - public Criteria andResultNotBetween(String value1, String value2) { - addCriterion("result not between", value1, value2, "result"); + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); return (Criteria) this; } - public Criteria andNeedPlanIsNull() { - addCriterion("need_plan is null"); + public Criteria andUpdateByIsNull() { + addCriterion("update_by is null"); return (Criteria) this; } - public Criteria andNeedPlanIsNotNull() { - addCriterion("need_plan is not null"); + public Criteria andUpdateByIsNotNull() { + addCriterion("update_by is not null"); return (Criteria) this; } - public Criteria andNeedPlanEqualTo(String value) { - addCriterion("need_plan =", value, "needPlan"); + public Criteria andUpdateByEqualTo(String value) { + addCriterion("update_by =", value, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanNotEqualTo(String value) { - addCriterion("need_plan <>", value, "needPlan"); + public Criteria andUpdateByNotEqualTo(String value) { + addCriterion("update_by <>", value, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanGreaterThan(String value) { - addCriterion("need_plan >", value, "needPlan"); + public Criteria andUpdateByGreaterThan(String value) { + addCriterion("update_by >", value, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanGreaterThanOrEqualTo(String value) { - addCriterion("need_plan >=", value, "needPlan"); + public Criteria andUpdateByGreaterThanOrEqualTo(String value) { + addCriterion("update_by >=", value, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanLessThan(String value) { - addCriterion("need_plan <", value, "needPlan"); + public Criteria andUpdateByLessThan(String value) { + addCriterion("update_by <", value, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanLessThanOrEqualTo(String value) { - addCriterion("need_plan <=", value, "needPlan"); + public Criteria andUpdateByLessThanOrEqualTo(String value) { + addCriterion("update_by <=", value, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanLike(String value) { - addCriterion("need_plan like", value, "needPlan"); + public Criteria andUpdateByLike(String value) { + addCriterion("update_by like", value, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanNotLike(String value) { - addCriterion("need_plan not like", value, "needPlan"); + public Criteria andUpdateByNotLike(String value) { + addCriterion("update_by not like", value, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanIn(List values) { - addCriterion("need_plan in", values, "needPlan"); + public Criteria andUpdateByIn(List values) { + addCriterion("update_by in", values, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanNotIn(List values) { - addCriterion("need_plan not in", values, "needPlan"); + public Criteria andUpdateByNotIn(List values) { + addCriterion("update_by not in", values, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanBetween(String value1, String value2) { - addCriterion("need_plan between", value1, value2, "needPlan"); + public Criteria andUpdateByBetween(String value1, String value2) { + addCriterion("update_by between", value1, value2, "updateBy"); return (Criteria) this; } - public Criteria andNeedPlanNotBetween(String value1, String value2) { - addCriterion("need_plan not between", value1, value2, "needPlan"); + public Criteria andUpdateByNotBetween(String value1, String value2) { + addCriterion("update_by not between", value1, value2, "updateBy"); return (Criteria) this; } - public Criteria andPlanIsNull() { - addCriterion("plan is null"); + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); return (Criteria) this; } - public Criteria andPlanIsNotNull() { - addCriterion("plan is not null"); + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); return (Criteria) this; } - public Criteria andPlanEqualTo(String value) { - addCriterion("plan =", value, "plan"); + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); return (Criteria) this; } - public Criteria andPlanNotEqualTo(String value) { - addCriterion("plan <>", value, "plan"); + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); return (Criteria) this; } - public Criteria andPlanGreaterThan(String value) { - addCriterion("plan >", value, "plan"); + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); return (Criteria) this; } - public Criteria andPlanGreaterThanOrEqualTo(String value) { - addCriterion("plan >=", value, "plan"); + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); return (Criteria) this; } - public Criteria andPlanLessThan(String value) { - addCriterion("plan <", value, "plan"); + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); return (Criteria) this; } - public Criteria andPlanLessThanOrEqualTo(String value) { - addCriterion("plan <=", value, "plan"); + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andDelFlagIsNull() { + addCriterion("del_flag is null"); + return (Criteria) this; + } + + public Criteria andDelFlagIsNotNull() { + addCriterion("del_flag is not null"); + return (Criteria) this; + } + + public Criteria andDelFlagEqualTo(Byte value) { + addCriterion("del_flag =", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotEqualTo(Byte value) { + addCriterion("del_flag <>", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagGreaterThan(Byte value) { + addCriterion("del_flag >", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagGreaterThanOrEqualTo(Byte value) { + addCriterion("del_flag >=", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagLessThan(Byte value) { + addCriterion("del_flag <", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagLessThanOrEqualTo(Byte value) { + addCriterion("del_flag <=", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagIn(List values) { + addCriterion("del_flag in", values, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotIn(List values) { + addCriterion("del_flag not in", values, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagBetween(Byte value1, Byte value2) { + addCriterion("del_flag between", value1, value2, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotBetween(Byte value1, Byte value2) { + addCriterion("del_flag not between", value1, value2, "delFlag"); + return (Criteria) this; + } + + public Criteria andScaleAssConfIsNull() { + addCriterion("scale_ass_conf is null"); + return (Criteria) this; + } + + public Criteria andScaleAssConfIsNotNull() { + addCriterion("scale_ass_conf is not null"); + return (Criteria) this; + } + + public Criteria andScaleAssConfEqualTo(Long value) { + addCriterion("scale_ass_conf =", value, "scaleAssConf"); + return (Criteria) this; + } + + public Criteria andScaleAssConfNotEqualTo(Long value) { + addCriterion("scale_ass_conf <>", value, "scaleAssConf"); + return (Criteria) this; + } + + public Criteria andScaleAssConfGreaterThan(Long value) { + addCriterion("scale_ass_conf >", value, "scaleAssConf"); + return (Criteria) this; + } + + public Criteria andScaleAssConfGreaterThanOrEqualTo(Long value) { + addCriterion("scale_ass_conf >=", value, "scaleAssConf"); + return (Criteria) this; + } + + public Criteria andScaleAssConfLessThan(Long value) { + addCriterion("scale_ass_conf <", value, "scaleAssConf"); + return (Criteria) this; + } + + public Criteria andScaleAssConfLessThanOrEqualTo(Long value) { + addCriterion("scale_ass_conf <=", value, "scaleAssConf"); return (Criteria) this; } - public Criteria andPlanLike(String value) { - addCriterion("plan like", value, "plan"); + public Criteria andScaleAssConfIn(List values) { + addCriterion("scale_ass_conf in", values, "scaleAssConf"); return (Criteria) this; } - public Criteria andPlanNotLike(String value) { - addCriterion("plan not like", value, "plan"); + public Criteria andScaleAssConfNotIn(List values) { + addCriterion("scale_ass_conf not in", values, "scaleAssConf"); return (Criteria) this; } - public Criteria andPlanIn(List values) { - addCriterion("plan in", values, "plan"); + public Criteria andScaleAssConfBetween(Long value1, Long value2) { + addCriterion("scale_ass_conf between", value1, value2, "scaleAssConf"); return (Criteria) this; } - public Criteria andPlanNotIn(List values) { - addCriterion("plan not in", values, "plan"); + public Criteria andScaleAssConfNotBetween(Long value1, Long value2) { + addCriterion("scale_ass_conf not between", value1, value2, "scaleAssConf"); return (Criteria) this; } - public Criteria andPlanBetween(String value1, String value2) { - addCriterion("plan between", value1, value2, "plan"); + public Criteria andResultIsNull() { + addCriterion("result is null"); return (Criteria) this; } - public Criteria andPlanNotBetween(String value1, String value2) { - addCriterion("plan not between", value1, value2, "plan"); + public Criteria andResultIsNotNull() { + addCriterion("result is not null"); return (Criteria) this; } - public Criteria andCreateByIsNull() { - addCriterion("create_by is null"); + public Criteria andResultEqualTo(String value) { + addCriterion("result =", value, "result"); return (Criteria) this; } - public Criteria andCreateByIsNotNull() { - addCriterion("create_by is not null"); + public Criteria andResultNotEqualTo(String value) { + addCriterion("result <>", value, "result"); return (Criteria) this; } - public Criteria andCreateByEqualTo(String value) { - addCriterion("create_by =", value, "createBy"); + public Criteria andResultGreaterThan(String value) { + addCriterion("result >", value, "result"); return (Criteria) this; } - public Criteria andCreateByNotEqualTo(String value) { - addCriterion("create_by <>", value, "createBy"); + public Criteria andResultGreaterThanOrEqualTo(String value) { + addCriterion("result >=", value, "result"); return (Criteria) this; } - public Criteria andCreateByGreaterThan(String value) { - addCriterion("create_by >", value, "createBy"); + public Criteria andResultLessThan(String value) { + addCriterion("result <", value, "result"); return (Criteria) this; } - public Criteria andCreateByGreaterThanOrEqualTo(String value) { - addCriterion("create_by >=", value, "createBy"); + public Criteria andResultLessThanOrEqualTo(String value) { + addCriterion("result <=", value, "result"); return (Criteria) this; } - public Criteria andCreateByLessThan(String value) { - addCriterion("create_by <", value, "createBy"); + public Criteria andResultLike(String value) { + addCriterion("result like", value, "result"); return (Criteria) this; } - public Criteria andCreateByLessThanOrEqualTo(String value) { - addCriterion("create_by <=", value, "createBy"); + public Criteria andResultNotLike(String value) { + addCriterion("result not like", value, "result"); return (Criteria) this; } - public Criteria andCreateByLike(String value) { - addCriterion("create_by like", value, "createBy"); + public Criteria andResultIn(List values) { + addCriterion("result in", values, "result"); return (Criteria) this; } - public Criteria andCreateByNotLike(String value) { - addCriterion("create_by not like", value, "createBy"); + public Criteria andResultNotIn(List values) { + addCriterion("result not in", values, "result"); return (Criteria) this; } - public Criteria andCreateByIn(List values) { - addCriterion("create_by in", values, "createBy"); + public Criteria andResultBetween(String value1, String value2) { + addCriterion("result between", value1, value2, "result"); return (Criteria) this; } - public Criteria andCreateByNotIn(List values) { - addCriterion("create_by not in", values, "createBy"); + public Criteria andResultNotBetween(String value1, String value2) { + addCriterion("result not between", value1, value2, "result"); return (Criteria) this; } - public Criteria andCreateByBetween(String value1, String value2) { - addCriterion("create_by between", value1, value2, "createBy"); + public Criteria andNeedPlanIsNull() { + addCriterion("need_plan is null"); return (Criteria) this; } - public Criteria andCreateByNotBetween(String value1, String value2) { - addCriterion("create_by not between", value1, value2, "createBy"); + public Criteria andNeedPlanIsNotNull() { + addCriterion("need_plan is not null"); return (Criteria) this; } - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); + public Criteria andNeedPlanEqualTo(String value) { + addCriterion("need_plan =", value, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); + public Criteria andNeedPlanNotEqualTo(String value) { + addCriterion("need_plan <>", value, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); + public Criteria andNeedPlanGreaterThan(String value) { + addCriterion("need_plan >", value, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); + public Criteria andNeedPlanGreaterThanOrEqualTo(String value) { + addCriterion("need_plan >=", value, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); + public Criteria andNeedPlanLessThan(String value) { + addCriterion("need_plan <", value, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); + public Criteria andNeedPlanLessThanOrEqualTo(String value) { + addCriterion("need_plan <=", value, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); + public Criteria andNeedPlanLike(String value) { + addCriterion("need_plan like", value, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); + public Criteria andNeedPlanNotLike(String value) { + addCriterion("need_plan not like", value, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); + public Criteria andNeedPlanIn(List values) { + addCriterion("need_plan in", values, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); + public Criteria andNeedPlanNotIn(List values) { + addCriterion("need_plan not in", values, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); + public Criteria andNeedPlanBetween(String value1, String value2) { + addCriterion("need_plan between", value1, value2, "needPlan"); return (Criteria) this; } - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); + public Criteria andNeedPlanNotBetween(String value1, String value2) { + addCriterion("need_plan not between", value1, value2, "needPlan"); return (Criteria) this; } - public Criteria andUpdateByIsNull() { - addCriterion("update_by is null"); + public Criteria andPlanIsNull() { + addCriterion("plan is null"); return (Criteria) this; } - public Criteria andUpdateByIsNotNull() { - addCriterion("update_by is not null"); + public Criteria andPlanIsNotNull() { + addCriterion("plan is not null"); return (Criteria) this; } - public Criteria andUpdateByEqualTo(String value) { - addCriterion("update_by =", value, "updateBy"); + public Criteria andPlanEqualTo(String value) { + addCriterion("plan =", value, "plan"); return (Criteria) this; } - public Criteria andUpdateByNotEqualTo(String value) { - addCriterion("update_by <>", value, "updateBy"); + public Criteria andPlanNotEqualTo(String value) { + addCriterion("plan <>", value, "plan"); return (Criteria) this; } - public Criteria andUpdateByGreaterThan(String value) { - addCriterion("update_by >", value, "updateBy"); + public Criteria andPlanGreaterThan(String value) { + addCriterion("plan >", value, "plan"); return (Criteria) this; } - public Criteria andUpdateByGreaterThanOrEqualTo(String value) { - addCriterion("update_by >=", value, "updateBy"); + public Criteria andPlanGreaterThanOrEqualTo(String value) { + addCriterion("plan >=", value, "plan"); return (Criteria) this; } - public Criteria andUpdateByLessThan(String value) { - addCriterion("update_by <", value, "updateBy"); + public Criteria andPlanLessThan(String value) { + addCriterion("plan <", value, "plan"); return (Criteria) this; } - public Criteria andUpdateByLessThanOrEqualTo(String value) { - addCriterion("update_by <=", value, "updateBy"); + public Criteria andPlanLessThanOrEqualTo(String value) { + addCriterion("plan <=", value, "plan"); return (Criteria) this; } - public Criteria andUpdateByLike(String value) { - addCriterion("update_by like", value, "updateBy"); + public Criteria andPlanLike(String value) { + addCriterion("plan like", value, "plan"); return (Criteria) this; } - public Criteria andUpdateByNotLike(String value) { - addCriterion("update_by not like", value, "updateBy"); + public Criteria andPlanNotLike(String value) { + addCriterion("plan not like", value, "plan"); return (Criteria) this; } - public Criteria andUpdateByIn(List values) { - addCriterion("update_by in", values, "updateBy"); + public Criteria andPlanIn(List values) { + addCriterion("plan in", values, "plan"); return (Criteria) this; } - public Criteria andUpdateByNotIn(List values) { - addCriterion("update_by not in", values, "updateBy"); + public Criteria andPlanNotIn(List values) { + addCriterion("plan not in", values, "plan"); return (Criteria) this; } - public Criteria andUpdateByBetween(String value1, String value2) { - addCriterion("update_by between", value1, value2, "updateBy"); + public Criteria andPlanBetween(String value1, String value2) { + addCriterion("plan between", value1, value2, "plan"); return (Criteria) this; } - public Criteria andUpdateByNotBetween(String value1, String value2) { - addCriterion("update_by not between", value1, value2, "updateBy"); + public Criteria andPlanNotBetween(String value1, String value2) { + addCriterion("plan not between", value1, value2, "plan"); return (Criteria) this; } - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); + public Criteria andSortIsNull() { + addCriterion("sort is null"); return (Criteria) this; } - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); return (Criteria) this; } - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); + public Criteria andSortEqualTo(Integer value) { + addCriterion("sort =", value, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); + public Criteria andSortNotEqualTo(Integer value) { + addCriterion("sort <>", value, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); + public Criteria andSortGreaterThan(Integer value) { + addCriterion("sort >", value, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); + public Criteria andSortGreaterThanOrEqualTo(Integer value) { + addCriterion("sort >=", value, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); + public Criteria andSortLessThan(Integer value) { + addCriterion("sort <", value, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); + public Criteria andSortLessThanOrEqualTo(Integer value) { + addCriterion("sort <=", value, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); + public Criteria andSortBetween(Integer value1, Integer value2) { + addCriterion("sort between", value1, value2, "sort"); return (Criteria) this; } - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); + public Criteria andSortNotBetween(Integer value1, Integer value2) { + addCriterion("sort not between", value1, value2, "sort"); return (Criteria) this; } - public Criteria andDelFlagIsNull() { - addCriterion("del_flag is null"); + public Criteria andIsShowIsNull() { + addCriterion("is_show is null"); return (Criteria) this; } - public Criteria andDelFlagIsNotNull() { - addCriterion("del_flag is not null"); + public Criteria andIsShowIsNotNull() { + addCriterion("is_show is not null"); return (Criteria) this; } - public Criteria andDelFlagEqualTo(Byte value) { - addCriterion("del_flag =", value, "delFlag"); + public Criteria andIsShowEqualTo(Byte value) { + addCriterion("is_show =", value, "isShow"); return (Criteria) this; } - public Criteria andDelFlagNotEqualTo(Byte value) { - addCriterion("del_flag <>", value, "delFlag"); + public Criteria andIsShowNotEqualTo(Byte value) { + addCriterion("is_show <>", value, "isShow"); return (Criteria) this; } - public Criteria andDelFlagGreaterThan(Byte value) { - addCriterion("del_flag >", value, "delFlag"); + public Criteria andIsShowGreaterThan(Byte value) { + addCriterion("is_show >", value, "isShow"); return (Criteria) this; } - public Criteria andDelFlagGreaterThanOrEqualTo(Byte value) { - addCriterion("del_flag >=", value, "delFlag"); + public Criteria andIsShowGreaterThanOrEqualTo(Byte value) { + addCriterion("is_show >=", value, "isShow"); return (Criteria) this; } - public Criteria andDelFlagLessThan(Byte value) { - addCriterion("del_flag <", value, "delFlag"); + public Criteria andIsShowLessThan(Byte value) { + addCriterion("is_show <", value, "isShow"); return (Criteria) this; } - public Criteria andDelFlagLessThanOrEqualTo(Byte value) { - addCriterion("del_flag <=", value, "delFlag"); + public Criteria andIsShowLessThanOrEqualTo(Byte value) { + addCriterion("is_show <=", value, "isShow"); return (Criteria) this; } - public Criteria andDelFlagIn(List values) { - addCriterion("del_flag in", values, "delFlag"); + public Criteria andIsShowIn(List values) { + addCriterion("is_show in", values, "isShow"); return (Criteria) this; } - public Criteria andDelFlagNotIn(List values) { - addCriterion("del_flag not in", values, "delFlag"); + public Criteria andIsShowNotIn(List values) { + addCriterion("is_show not in", values, "isShow"); return (Criteria) this; } - public Criteria andDelFlagBetween(Byte value1, Byte value2) { - addCriterion("del_flag between", value1, value2, "delFlag"); + public Criteria andIsShowBetween(Byte value1, Byte value2) { + addCriterion("is_show between", value1, value2, "isShow"); return (Criteria) this; } - public Criteria andDelFlagNotBetween(Byte value1, Byte value2) { - addCriterion("del_flag not between", value1, value2, "delFlag"); + public Criteria andIsShowNotBetween(Byte value1, Byte value2) { + addCriterion("is_show not between", value1, value2, "isShow"); return (Criteria) this; } } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/AmsVo.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/AmsVo.java index fb725e0..31d2a11 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/AmsVo.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/AmsVo.java @@ -678,10 +678,15 @@ public class AmsVo { private String scaleName; @ApiModelProperty("分数") private BigDecimal score; + + @ApiModelProperty("量表总分") + private BigDecimal totalScore; @ApiModelProperty("总题数") private Integer totalNum; @ApiModelProperty("已完成题数") private Integer completedNum; + + private Integer sort; @ApiModelProperty("各项分数") private List scaleScoreList; @ApiModelProperty("试题详情") diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/HomeDpVo.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/HomeDpVo.java index 02b4eee..b86754d 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/HomeDpVo.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/HomeDpVo.java @@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; + /** * @Author zzc * @Package com.ccsens.system.domain.vo @@ -75,6 +77,7 @@ public class HomeDpVo { public static class Jbph { private String icd_no; private String name; + private String code; private String value; } @@ -153,6 +156,12 @@ public class HomeDpVo { private int total; private int mzNum; private int zyNum; + @ApiModelProperty("单次就诊平均评估次数") + private BigDecimal avgNum; + @ApiModelProperty("单次就诊最高评估次数") + private int maxNum; + @ApiModelProperty("单次就诊最低评估次数") + private int minNum; public int getTotal() { return mzNum + zyNum; @@ -161,6 +170,7 @@ public class HomeDpVo { @Data public static class VersionStatistics { + private Long id; private String version; private Integer num; } @@ -177,6 +187,7 @@ public class HomeDpVo { private String nickName; private String userName; private Integer num; + private Long userId; } @Data diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/PmsPatientVo.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/PmsPatientVo.java index 719b2e6..a0bbf21 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/PmsPatientVo.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/PmsPatientVo.java @@ -795,6 +795,7 @@ public class PmsPatientVo { @Data public static class QueryPatientJz { + private String idcard; private String patientName; private String sex; @@ -835,7 +836,7 @@ public class PmsPatientVo { private String outpatientNo; - private String age; + private Integer age; private String department; @@ -890,6 +891,23 @@ public class PmsPatientVo { private String diagnosisDate; private String hospitalName; + private Integer birthYear; + + @ApiModelProperty("其他病史信息") + private Map>> otherMsg; + + public String getIdcard() { + if(StrUtil.isNotEmpty(idcard)){ + return idcard.substring(0, 2) + "******" + idcard.substring(idcard.length() - 4, idcard.length()); + } + return idcard; + } + public Integer getAge() { + if(birthYear != null){ + return Calendar.getInstance().get(Calendar.YEAR) - birthYear; + } + return age; + } } } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/RmsVo.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/RmsVo.java index 6696d17..ac1f7ab 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/RmsVo.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/RmsVo.java @@ -117,7 +117,7 @@ public class RmsVo { } public String getIdCard() { - if(StrUtil.isNotEmpty(idCard)){ + if (StrUtil.isNotEmpty(idCard)) { return idCard.substring(0, 2) + "******" + idCard.substring(idCard.length() - 4, idCard.length()); } return idCard; @@ -138,6 +138,57 @@ public class RmsVo { // } } + @Data + public static class Report { + private Long id; + @ApiModelProperty("测评ID") + private Long evaluationId; + private String testerName; + + private Long patientId; + + private String patientIdcard; + + private Integer patientAge; + + private Long testerId; + + private String serialNumber; + + private Long checkTime; + + private String remark; + + private String hospital; + + private Byte completeStatus; + + private Byte recording; + + private Long duration; + + private String createBy; + + private Date createTime; + + private String updateBy; + + private Date updateTime; + + private Byte delFlag; + + private Byte status; + + private String version; + + private String visitNo; + private String scaleName; + private Byte needPlan; + + private String deptName; + + } + @Data @ApiModel("PatientReportVoGenerate") public static class Generate { @@ -224,6 +275,10 @@ public class RmsVo { @ApiModelProperty("初步印象") private String initialImpression; private String testerName; + + @ApiModelProperty("出生日期") + private String birthday; + public List toPdfRow() { List rows = getInitRows(); //第四栏 @@ -389,6 +444,8 @@ public class RmsVo { private Integer sort; @ApiModelProperty("认知域code") private String parentCode; + @ApiModelProperty("认知域父级id") + private Long parentId; @ApiModelProperty("报告单检查类型名称") private String name; @ApiModelProperty("量表类型名称") @@ -421,10 +478,15 @@ public class RmsVo { @ApiModelProperty("量表用时") private Long questionDuration; + private BigDecimal levelTotalScale; + @ApiModelProperty("最终结论") private String result; private String needPlan; + @ApiModelProperty("套餐Id") + private Long comboId; + @ApiModelProperty("测评量表排序") private Integer ecrSort; @ApiModelProperty("中医体质辨识结论") @@ -432,6 +494,7 @@ public class RmsVo { @ApiModelProperty("中医体质辨识养生建议") private List reportYsjyList; + public void addSub(ReportScore score) { this.subReport.add(score); } @@ -983,10 +1046,10 @@ public class RmsVo { @ApiModel("病友的答案") @Data public static class Answer { -// @JsonIgnore + // @JsonIgnore @ApiModelProperty("选项id") private Long optionId; -// @JsonIgnore + // @JsonIgnore @ApiModelProperty("选项名") private String optionName; @ApiModelProperty("答案") @@ -1148,23 +1211,111 @@ public class RmsVo { private Integer optionNum; } + @Data + public static class ExportInfo { + @ApiModelProperty("报告单ID") + private Long reporrtId; + @ApiModelProperty("量表CODE") + private String scaleCode; + @ApiModelProperty("量表名称") + private String scaleName; + @ApiModelProperty("得分") + private BigDecimal score; + @ApiModelProperty("初步印象") + private String impression; + @ApiModelProperty("套餐ID") + private Long comboId; + @ApiModelProperty("套餐名称") + private String comboName; + @ApiModelProperty("父级套餐名称") + private String comboParentName; + @ApiModelProperty("量表分值结论配置Id") + private String scaleAssConf; + @ApiModelProperty("当前分值段结论") + private String result; + @ApiModelProperty("需要防治(1需要,0不需要)") + private Integer needPlan; + @ApiModelProperty("防治计划") + private String plan; + @ApiModelProperty("排序") + private Integer sort; + + @ApiModelProperty("中医体质辨识结论") + private List reportResultList; + + @ApiModelProperty("中医体质辨识养生建议") + private List reportYsjyList; + } + + + @ApiModel("统计四列表之报告单-DTO") + @Data + public static class QueryReportList { + @ApiModelProperty("报告单ID") + private Long evaluationId; + @ApiModelProperty("姓名") + private String name; + @ApiModelProperty("性别(0-男 1-女)") + private Integer sex; + @ApiModelProperty("就诊号") + private String outpatientNo; + @ApiModelProperty("就诊科室") + private String department; + @ApiModelProperty("就诊/主治医生") + private String doctor; + @ApiModelProperty("评估版本") + private String versionName; + @ApiModelProperty("评估师") + private String testerName; + @ApiModelProperty("评估量表") + private String scaleNames; + @ApiModelProperty("评估时间") + private String evaluationTime; + @ApiModelProperty("完成状态 0:未完成 1:完成 2:中止") + private Byte completeStatus; + + } + @ApiModel("导出历史报告单(对接)-VO") @Data - public static class ReportPDF{ + public static class ReportPDF { + @ApiModelProperty("报告单ID") + private Long reportId; + @ApiModelProperty("测评ID") + private Long evaluationId; @ApiModelProperty("患者名称") private String patientName; @ApiModelProperty("性别") private Byte sex; @ApiModelProperty("年龄") private int Age; + @ApiModelProperty("出生日期") + private String birthDate; + @ApiModelProperty("身份证号") + private String idCard; + @ApiModelProperty("就诊类型 0门诊 1住院") + private String visitType; @ApiModelProperty("就诊号") private String visitNo; - @ApiModelProperty("评估人") + @ApiModelProperty("部门") + private String department; + @ApiModelProperty("评估医生Id") + private String assessorId; + @ApiModelProperty("评估医生") private String assessor; + @ApiModelProperty("评估医生编号") + private String assessorCode; @ApiModelProperty("评估时间") private String assessTime; @ApiModelProperty("报告单文件路径") private String url; - } + public String getAssessor() { + if (StrUtil.isNotEmpty(assessorCode)) { + return assessor + "(" + assessorCode + ")"; + }else { + return assessor; + } + } + } } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java index d1dc506..c7bbbf1 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java @@ -74,7 +74,9 @@ public interface StatisticsDao { List qualificationStatistics(@Param("dto") StatisticsDto.Query dto); - HomeDpVo.JzStatistics JzStatistics(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.JzStatistics JzStatistics(@Param("param") StatisticsDto.Query dto); + + HomeDpVo.JzStatistics JzStatisticsNum(@Param("dto") StatisticsDto.Query dto); List scaleStatistics(@Param("dto") StatisticsDto.Query dto); diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/mapper/EmsEvaluationScaleCognitiveRelevanceMapper.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/mapper/EmsEvaluationScaleCognitiveRelevanceMapper.java new file mode 100644 index 0000000..e70b106 --- /dev/null +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/mapper/EmsEvaluationScaleCognitiveRelevanceMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.system.persist.mapper; + +import com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance; +import com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface EmsEvaluationScaleCognitiveRelevanceMapper { + long countByExample(EmsEvaluationScaleCognitiveRelevanceExample example); + + int deleteByExample(EmsEvaluationScaleCognitiveRelevanceExample example); + + int deleteByPrimaryKey(Long id); + + int insert(EmsEvaluationScaleCognitiveRelevance record); + + int insertSelective(EmsEvaluationScaleCognitiveRelevance record); + + List selectByExample(EmsEvaluationScaleCognitiveRelevanceExample example); + + EmsEvaluationScaleCognitiveRelevance selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") EmsEvaluationScaleCognitiveRelevance record, @Param("example") EmsEvaluationScaleCognitiveRelevanceExample example); + + int updateByExample(@Param("record") EmsEvaluationScaleCognitiveRelevance record, @Param("example") EmsEvaluationScaleCognitiveRelevanceExample example); + + int updateByPrimaryKeySelective(EmsEvaluationScaleCognitiveRelevance record); + + int updateByPrimaryKey(EmsEvaluationScaleCognitiveRelevance record); +} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java index e8e4cac..efb2973 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java @@ -1,7 +1,7 @@ package com.ccsens.system.service.impl; -import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; import com.ccsens.system.domain.dto.StatisticsDto; import com.ccsens.system.domain.vo.HomeDpVo; import com.ccsens.system.persist.dao.StatisticsDao; @@ -27,8 +27,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -37,8 +37,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -47,8 +47,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public List nnlast(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -57,8 +57,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public HomeDpVo.Nlfb nnage(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -67,8 +67,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public HomeDpVo.Tz nntgb(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -77,8 +77,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public List nnicd(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -87,8 +87,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public List nnmap(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -97,8 +97,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public List nnscale(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -107,8 +107,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public List qualificationStatistics(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -117,18 +117,24 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.JzStatistics(dto); +// HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatisticsNum(dto); +// if (jzStatistics!= null) { + HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatistics(dto); +// jzStatistics.setZyNum(jzStatistics1.getZyNum()); +// jzStatistics.setMzNum(jzStatistics1.getMzNum()); +// } + return ObjectUtil.isNull(jzStatistics) ? new HomeDpVo.JzStatistics() : jzStatistics; } @Override public List scaleStatistics(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -137,8 +143,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public List versionStatistics(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -147,8 +153,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public List userStatistics(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } @@ -157,8 +163,8 @@ public class StatisticsServiceImpl implements StatisticsService { @Override public HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto) { - if (dto.getDateType() != null) { - List dateByType = getDateByType(dto.getDateType(), dto.getBeginTime()); + if (dto.getTimeType() != null) { + List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml index acfb1e1..47ba00e 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml @@ -15,7 +15,7 @@ LEFT JOIN ums_user u ON e.create_by = u.user_name where e.del_flag = 0 and e.complete_status != 0 - AND u.dept_id = #{deptId} + AND u.dept_id = #{dto.deptId} AND e.create_time >= #{dto.beginTime} @@ -31,21 +31,14 @@ SUM(CASE WHEN (pb.weight/(pb.height*pb.height/10000)) >= 18.5 AND (pb.weight/(pb.height*pb.height/10000)) < 24 THEN 1 ELSE 0 END) AS bmi2, SUM(CASE WHEN (pb. weight/(pb.height*pb.height/10000)) >= 24 AND (pb.weight/(pb.height*pb.height/10000)) < 28 THEN 1 ELSE 0 END) AS bmi3, SUM(CASE WHEN (pb.weight/(pb.height*pb.height/10000)) >= 28 AND (pb.weight/(pb.height*pb.height/10000)) < 32 THEN 1 ELSE 0 END) AS bmi4, - SUM(CASE WHEN (pb.weight/(pb.height*pb.height/10000)) >= 32 THEN 1 ELSE 0 END) AS bmi5, - SUM(CASE WHEN pp.smoking_history = 1 AND pp.drink_history = 0 THEN 1 ELSE 0 END) AS onlysmoking, - SUM(CASE WHEN pp.smoking_history = 0 AND pp.drink_history = 1 THEN 1 ELSE 0 END) AS onlydrink, - SUM(CASE WHEN pp.smoking_history = 1 AND pp.drink_history = 1 THEN 1 ELSE 0 END) AS bothyes, - SUM(CASE WHEN pp.smoking_history = 0 AND pp.drink_history = 0 THEN 1 ELSE 0 END) AS bothno + SUM(CASE WHEN (pb.weight/(pb.height*pb.height/10000)) >= 32 THEN 1 ELSE 0 END) AS bmi5 FROM pms_patient p - left JOIN - pms_patient_body pb ON p.id = pb.patient_id - left JOIN - pms_patient_personal pp ON p.id = pp.patient_id + left JOIN pms_patient_body pb ON p.id = pb.patient_id LEFT JOIN ums_user u ON p.create_by = u.user_name - where p.del_flag + where p.del_flag = 0 - AND u.dept_id = #{deptId} + AND u.dept_id = #{dto.deptId} AND p.create_time >= #{dto.beginTime} @@ -69,7 +62,7 @@ where e.del_flag = 0 and e.patient_id != 0 - AND u.dept_id = #{deptId} + AND u.dept_id = #{dto.deptId} AND e.create_time >= #{dto.beginTime} @@ -82,14 +75,14 @@ SELECT b.diagnosis_name AS name, + b.diagnosis_code as code, COUNT(b.id) AS value FROM pms_patient_body b @@ -136,7 +130,7 @@ and diagnosis_name != '' and b.del_flag = 0 - AND u.dept_id = #{deptId} + AND u.dept_id = #{dto.deptId} AND b.create_time >= #{dto.beginTime} @@ -152,25 +146,27 @@ SELECT - SUM(CASE WHEN b.visit_type = 0 THEN 1 ELSE 0 END) AS mzNum, - SUM(CASE WHEN b.visit_type = 1 THEN 1 ELSE 0 END) AS zyNum + SUM(CASE WHEN a.visit_type = 0 THEN 1 ELSE 0 END) AS mzNum, + SUM(CASE WHEN a.visit_type = 1 THEN 1 ELSE 0 END) AS zyNum, + ROUND(AVG(evaluation_count), 2) AS avgNum, + MAX(evaluation_count) AS maxNum, + MIN(evaluation_count) AS minNum FROM - pms_patient_body b - LEFT JOIN ums_user u ON b.create_by = u.user_name AND u.del_flag = 0 - WHERE - b.del_flag = 0 - - AND u.dept_id = #{deptId} - - - AND b.create_time >= #{dto.beginTime} - - - AND b.create_time <= #{dto.endTime} - - AND b.visit_type IN (0, 1) + ( + SELECT + b.visit_type, + count(e.id) as evaluation_count + FROM + pms_patient_body b + left join pms_patient p on b.patient_id = p.id + left join ems_evaluation e on e.visit_no = b.outpatient_no + + + b.del_flag = 0 and p.del_flag = 0 + + and b.diagnosis_date between #{param.beginTime} and #{param.endTime} + + + and p.dept_id = #{param.deptId} + + + + GROUP BY b.id + )a + + + + + + + + + + + + + + + + + + + + + + @@ -349,7 +413,7 @@ WHERE p.del_flag = 0 - AND u.dept_id = #{deptId} + AND u.dept_id = #{dto.deptId} AND p.create_time >= #{dto.beginTime} @@ -380,7 +444,7 @@ p.del_flag = 0 AND pp.del_flag = 0 - AND u.dept_id = #{deptId} + AND u.dept_id = #{dto.deptId} AND p.create_time >= #{dto.beginTime} diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleCognitiveRelevanceMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleCognitiveRelevanceMapper.xml new file mode 100644 index 0000000..d057f43 --- /dev/null +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleCognitiveRelevanceMapper.xml @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, evaluation_id, scale_code, parent_id, cognitive_code, score, total_score, combo_id, + sort, create_by, create_time, update_by, update_time, del_flag + + + + + delete from ems_evaluation_scale_cognitive_relevance + where id = #{id,jdbcType=BIGINT} + + + delete from ems_evaluation_scale_cognitive_relevance + + + + + + insert into ems_evaluation_scale_cognitive_relevance (id, evaluation_id, scale_code, + parent_id, cognitive_code, score, + total_score, combo_id, sort, + create_by, create_time, update_by, + update_time, del_flag) + values (#{id,jdbcType=BIGINT}, #{evaluationId,jdbcType=BIGINT}, #{scaleCode,jdbcType=VARCHAR}, + #{parentId,jdbcType=BIGINT}, #{cognitiveCode,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL}, + #{totalScore,jdbcType=DECIMAL}, #{comboId,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER}, + #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}) + + + insert into ems_evaluation_scale_cognitive_relevance + + + id, + + + evaluation_id, + + + scale_code, + + + parent_id, + + + cognitive_code, + + + score, + + + total_score, + + + combo_id, + + + sort, + + + create_by, + + + create_time, + + + update_by, + + + update_time, + + + del_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{evaluationId,jdbcType=BIGINT}, + + + #{scaleCode,jdbcType=VARCHAR}, + + + #{parentId,jdbcType=BIGINT}, + + + #{cognitiveCode,jdbcType=VARCHAR}, + + + #{score,jdbcType=DECIMAL}, + + + #{totalScore,jdbcType=DECIMAL}, + + + #{comboId,jdbcType=BIGINT}, + + + #{sort,jdbcType=INTEGER}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{delFlag,jdbcType=TINYINT}, + + + + + + update ems_evaluation_scale_cognitive_relevance + + + id = #{record.id,jdbcType=BIGINT}, + + + evaluation_id = #{record.evaluationId,jdbcType=BIGINT}, + + + scale_code = #{record.scaleCode,jdbcType=VARCHAR}, + + + parent_id = #{record.parentId,jdbcType=BIGINT}, + + + cognitive_code = #{record.cognitiveCode,jdbcType=VARCHAR}, + + + score = #{record.score,jdbcType=DECIMAL}, + + + total_score = #{record.totalScore,jdbcType=DECIMAL}, + + + combo_id = #{record.comboId,jdbcType=BIGINT}, + + + sort = #{record.sort,jdbcType=INTEGER}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_by = #{record.updateBy,jdbcType=VARCHAR}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + del_flag = #{record.delFlag,jdbcType=TINYINT}, + + + + + + + + update ems_evaluation_scale_cognitive_relevance + set id = #{record.id,jdbcType=BIGINT}, + evaluation_id = #{record.evaluationId,jdbcType=BIGINT}, + scale_code = #{record.scaleCode,jdbcType=VARCHAR}, + parent_id = #{record.parentId,jdbcType=BIGINT}, + cognitive_code = #{record.cognitiveCode,jdbcType=VARCHAR}, + score = #{record.score,jdbcType=DECIMAL}, + total_score = #{record.totalScore,jdbcType=DECIMAL}, + combo_id = #{record.comboId,jdbcType=BIGINT}, + sort = #{record.sort,jdbcType=INTEGER}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_by = #{record.updateBy,jdbcType=VARCHAR}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + del_flag = #{record.delFlag,jdbcType=TINYINT} + + + + + + update ems_evaluation_scale_cognitive_relevance + + + evaluation_id = #{evaluationId,jdbcType=BIGINT}, + + + scale_code = #{scaleCode,jdbcType=VARCHAR}, + + + parent_id = #{parentId,jdbcType=BIGINT}, + + + cognitive_code = #{cognitiveCode,jdbcType=VARCHAR}, + + + score = #{score,jdbcType=DECIMAL}, + + + total_score = #{totalScore,jdbcType=DECIMAL}, + + + combo_id = #{comboId,jdbcType=BIGINT}, + + + sort = #{sort,jdbcType=INTEGER}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + del_flag = #{delFlag,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update ems_evaluation_scale_cognitive_relevance + set evaluation_id = #{evaluationId,jdbcType=BIGINT}, + scale_code = #{scaleCode,jdbcType=VARCHAR}, + parent_id = #{parentId,jdbcType=BIGINT}, + cognitive_code = #{cognitiveCode,jdbcType=VARCHAR}, + score = #{score,jdbcType=DECIMAL}, + total_score = #{totalScore,jdbcType=DECIMAL}, + combo_id = #{comboId,jdbcType=BIGINT}, + sort = #{sort,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_by = #{updateBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + del_flag = #{delFlag,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleRelevanceMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleRelevanceMapper.xml index eead647..1d91675 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleRelevanceMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleRelevanceMapper.xml @@ -5,6 +5,8 @@ + + @@ -71,8 +73,8 @@ - id, evaluation_id, scale_code, sort, create_by, create_time, update_by, update_time, - del_flag + id, evaluation_id, scale_code, combo_id, score, sort, create_by, create_time, update_by, + update_time, del_flag select @@ -126,20 +128,20 @@ initial_impression, clinical_diagnosis, pasi, patient_age, department, bed_number, report_time, evaluation_code, url, - qr_code_url, sign_url, remark, - show_status, hospital, working_score, - create_by, create_time, update_by, - update_time, del_flag, visit_no - ) + persion_url, positive_url, qr_code_url, + sign_url, remark, show_status, + hospital, working_score, create_by, + create_time, update_by, update_time, + del_flag, visit_no) values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{evaluationId,jdbcType=BIGINT}, #{initialImpression,jdbcType=VARCHAR}, #{clinicalDiagnosis,jdbcType=VARCHAR}, #{pasi,jdbcType=TINYINT}, #{patientAge,jdbcType=INTEGER}, #{department,jdbcType=VARCHAR}, #{bedNumber,jdbcType=VARCHAR}, #{reportTime,jdbcType=BIGINT}, #{evaluationCode,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, - #{qrCodeUrl,jdbcType=VARCHAR}, #{signUrl,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, - #{showStatus,jdbcType=TINYINT}, #{hospital,jdbcType=VARCHAR}, #{workingScore,jdbcType=INTEGER}, - #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, - #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{visitNo,jdbcType=VARCHAR} - ) + #{persionUrl,jdbcType=VARCHAR}, #{positiveUrl,jdbcType=VARCHAR}, #{qrCodeUrl,jdbcType=VARCHAR}, + #{signUrl,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{showStatus,jdbcType=TINYINT}, + #{hospital,jdbcType=VARCHAR}, #{workingScore,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, + #{delFlag,jdbcType=TINYINT}, #{visitNo,jdbcType=VARCHAR}) insert into rms_report @@ -180,6 +182,12 @@ url, + + persion_url, + + + positive_url, + qr_code_url, @@ -254,6 +262,12 @@ #{url,jdbcType=VARCHAR}, + + #{persionUrl,jdbcType=VARCHAR}, + + + #{positiveUrl,jdbcType=VARCHAR}, + #{qrCodeUrl,jdbcType=VARCHAR}, @@ -337,6 +351,12 @@ url = #{record.url,jdbcType=VARCHAR}, + + persion_url = #{record.persionUrl,jdbcType=VARCHAR}, + + + positive_url = #{record.positiveUrl,jdbcType=VARCHAR}, + qr_code_url = #{record.qrCodeUrl,jdbcType=VARCHAR}, @@ -392,6 +412,8 @@ report_time = #{record.reportTime,jdbcType=BIGINT}, evaluation_code = #{record.evaluationCode,jdbcType=VARCHAR}, url = #{record.url,jdbcType=VARCHAR}, + persion_url = #{record.persionUrl,jdbcType=VARCHAR}, + positive_url = #{record.positiveUrl,jdbcType=VARCHAR}, qr_code_url = #{record.qrCodeUrl,jdbcType=VARCHAR}, sign_url = #{record.signUrl,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR}, @@ -444,6 +466,12 @@ url = #{url,jdbcType=VARCHAR}, + + persion_url = #{persionUrl,jdbcType=VARCHAR}, + + + positive_url = #{positiveUrl,jdbcType=VARCHAR}, + qr_code_url = #{qrCodeUrl,jdbcType=VARCHAR}, @@ -496,6 +524,8 @@ report_time = #{reportTime,jdbcType=BIGINT}, evaluation_code = #{evaluationCode,jdbcType=VARCHAR}, url = #{url,jdbcType=VARCHAR}, + persion_url = #{persionUrl,jdbcType=VARCHAR}, + positive_url = #{positiveUrl,jdbcType=VARCHAR}, qr_code_url = #{qrCodeUrl,jdbcType=VARCHAR}, sign_url = #{signUrl,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR}, diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/RmsReportScaleScoreMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/RmsReportScaleScoreMapper.xml index 4312a58..26d187c 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/RmsReportScaleScoreMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/RmsReportScaleScoreMapper.xml @@ -7,16 +7,18 @@ - - - - - + + + + + + + @@ -77,8 +79,8 @@ - id, report_id, scale_code, score, impression, sort, scale_ass_conf, result, need_plan, - plan, create_by, create_time, update_by, update_time, del_flag + id, report_id, scale_code, score, impression, combo_id, create_by, create_time, update_by, + update_time, del_flag, scale_ass_conf, result, need_plan, plan, sort, is_show @@ -245,20 +259,8 @@ impression = #{record.impression,jdbcType=VARCHAR}, - - sort = #{record.sort,jdbcType=INTEGER}, - - - scale_ass_conf = #{record.scaleAssConf,jdbcType=BIGINT}, - - - result = #{record.result,jdbcType=VARCHAR}, - - - need_plan = #{record.needPlan,jdbcType=VARCHAR}, - - - plan = #{record.plan,jdbcType=VARCHAR}, + + combo_id = #{record.comboId,jdbcType=BIGINT}, create_by = #{record.createBy,jdbcType=VARCHAR}, @@ -275,6 +277,24 @@ del_flag = #{record.delFlag,jdbcType=TINYINT}, + + scale_ass_conf = #{record.scaleAssConf,jdbcType=BIGINT}, + + + result = #{record.result,jdbcType=VARCHAR}, + + + need_plan = #{record.needPlan,jdbcType=VARCHAR}, + + + plan = #{record.plan,jdbcType=VARCHAR}, + + + sort = #{record.sort,jdbcType=INTEGER}, + + + is_show = #{record.isShow,jdbcType=TINYINT}, + @@ -287,16 +307,18 @@ scale_code = #{record.scaleCode,jdbcType=VARCHAR}, score = #{record.score,jdbcType=DECIMAL}, impression = #{record.impression,jdbcType=VARCHAR}, - sort = #{record.sort,jdbcType=INTEGER}, - scale_ass_conf = #{record.scaleAssConf,jdbcType=BIGINT}, - result = #{record.result,jdbcType=VARCHAR}, - need_plan = #{record.needPlan,jdbcType=VARCHAR}, - plan = #{record.plan,jdbcType=VARCHAR}, + combo_id = #{record.comboId,jdbcType=BIGINT}, create_by = #{record.createBy,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=TIMESTAMP}, update_by = #{record.updateBy,jdbcType=VARCHAR}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - del_flag = #{record.delFlag,jdbcType=TINYINT} + del_flag = #{record.delFlag,jdbcType=TINYINT}, + scale_ass_conf = #{record.scaleAssConf,jdbcType=BIGINT}, + result = #{record.result,jdbcType=VARCHAR}, + need_plan = #{record.needPlan,jdbcType=VARCHAR}, + plan = #{record.plan,jdbcType=VARCHAR}, + sort = #{record.sort,jdbcType=INTEGER}, + is_show = #{record.isShow,jdbcType=TINYINT} @@ -316,20 +338,8 @@ impression = #{impression,jdbcType=VARCHAR}, - - sort = #{sort,jdbcType=INTEGER}, - - - scale_ass_conf = #{scaleAssConf,jdbcType=BIGINT}, - - - result = #{result,jdbcType=VARCHAR}, - - - need_plan = #{needPlan,jdbcType=VARCHAR}, - - - plan = #{plan,jdbcType=VARCHAR}, + + combo_id = #{comboId,jdbcType=BIGINT}, create_by = #{createBy,jdbcType=VARCHAR}, @@ -346,6 +356,24 @@ del_flag = #{delFlag,jdbcType=TINYINT}, + + scale_ass_conf = #{scaleAssConf,jdbcType=BIGINT}, + + + result = #{result,jdbcType=VARCHAR}, + + + need_plan = #{needPlan,jdbcType=VARCHAR}, + + + plan = #{plan,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + is_show = #{isShow,jdbcType=TINYINT}, + where id = #{id,jdbcType=BIGINT} @@ -355,16 +383,18 @@ scale_code = #{scaleCode,jdbcType=VARCHAR}, score = #{score,jdbcType=DECIMAL}, impression = #{impression,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER}, - scale_ass_conf = #{scaleAssConf,jdbcType=BIGINT}, - result = #{result,jdbcType=VARCHAR}, - need_plan = #{needPlan,jdbcType=VARCHAR}, - plan = #{plan,jdbcType=VARCHAR}, + combo_id = #{comboId,jdbcType=BIGINT}, create_by = #{createBy,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_by = #{updateBy,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}, - del_flag = #{delFlag,jdbcType=TINYINT} + del_flag = #{delFlag,jdbcType=TINYINT}, + scale_ass_conf = #{scaleAssConf,jdbcType=BIGINT}, + result = #{result,jdbcType=VARCHAR}, + need_plan = #{needPlan,jdbcType=VARCHAR}, + plan = #{plan,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + is_show = #{isShow,jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportController.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportController.java new file mode 100644 index 0000000..17f3bb8 --- /dev/null +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportController.java @@ -0,0 +1,55 @@ +package com.ccsens.admin.controller; + +import com.ccsens.admin.service.AmsReportService; +import com.ccsens.common.annotation.Anonymous; +import com.ccsens.common.core.domain.JsonResponse; +import com.ccsens.system.domain.dto.RmsDto; +import com.ccsens.system.domain.vo.AmsReportVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.io.IOException; + +/** + * @Author zzc + * @Package com.ccsens.admin.controller + * @Date 2026/2/12 17:48 + * @description: + */ +@Slf4j +@Api(tags = "量表报告单模板管理") +@RestController +@RequestMapping("/report") +public class ReportController { + + @Resource + private AmsReportService amsReportService; + + @Anonymous + @ApiOperation("导出个人报告") + @PostMapping("/exportGr") + public JsonResponse exportGr(@RequestBody @Validated RmsDto.ExportReport1Dto dto) throws IOException { + return JsonResponse.ok(amsReportService.exportGr(dto)); + } + + @Anonymous + @ApiOperation("导出医生版报告") + @PostMapping("/exportYs") + public JsonResponse exportYs(@RequestBody @Validated RmsDto.ExportReport1Dto dto){ + return JsonResponse.ok(amsReportService.exportYs(dto)); + } + + @Anonymous + @ApiOperation("导出阳性版报告") + @PostMapping("/exportYx") + public JsonResponse exportYx(@RequestBody @Validated RmsDto.ExportReport1Dto dto){ + return JsonResponse.ok(amsReportService.exportYx(dto)); + } +} diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportPdfController.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportPdfController.java index f944859..3bcfb7e 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportPdfController.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportPdfController.java @@ -39,10 +39,19 @@ public class ReportPdfController { @Anonymous @ApiOperation(value = "通过就诊号查询患者的评估报告单",notes = "") @PostMapping(value="/reportPDF") - public JsonResponse> generate(@RequestBody @Validated BaseDto dto){ + public JsonResponse> reportPDF(@RequestBody @Validated BaseDto dto){ log.info("通过就诊号查询患者的评估报告单:{}", dto); startPage(dto); List list = rmsService.viewReportPDF(dto.getParam()); return JsonResponse.ok(new PageInfo<>(list)); } + + @Anonymous + @ApiOperation(value = "通过就诊号查询患者的评估报告单",notes = "") + @PostMapping(value="/queryPdfUrl") + public JsonResponse queryPdfUrl(@RequestBody @Validated BaseDto dto){ + log.info("通过就诊号查询患者的评估报告单:{}", dto); + String url = rmsService.queryPdfUrl(dto.getParam()); + return JsonResponse.ok(url); + } } diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/RmsController.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/RmsController.java index 144485c..cc638e8 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/RmsController.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/RmsController.java @@ -9,9 +9,11 @@ import com.ccsens.common.core.domain.JsonResponse; import com.ccsens.common.core.domain.model.LoginUser; import com.ccsens.common.utils.SecurityUtils; import com.ccsens.system.domain.dto.AmsDto; +import com.ccsens.system.domain.dto.PmsPatientDto; import com.ccsens.system.domain.dto.RmsDto; import com.ccsens.system.domain.vo.AmsVo; import com.ccsens.system.domain.vo.RmsVo; +import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParams; @@ -45,9 +47,9 @@ public class RmsController extends BaseController { @Resource private IRmsService rmsService; - @ApiOperation(value = "查询报告单详情",notes = "根据测评ID查询报告单详情") - @PostMapping(value="/queryReportDetail") - public JsonResponse generate(@RequestBody @ApiParam @Valid RmsDto.QueryDetail dto){ + @ApiOperation(value = "查询报告单详情", notes = "根据测评ID查询报告单详情") + @PostMapping(value = "/queryReportDetail") + public JsonResponse generate(@RequestBody @ApiParam @Valid RmsDto.QueryDetail dto) { log.info("生成报告单请求参数:{}", dto); // if (dto == null || dto.getPatientId() == null || dto.getPatientId() == 0) { // return JsonResponse.ok(ErrorConstant.PARAM_NULL.addMsg()); @@ -59,15 +61,15 @@ public class RmsController extends BaseController { //查询报告单列表 @ApiOperation(value = "查询报告单列表") - @PostMapping(value="/queryReportList") - public JsonResponse> queryReportList(@RequestBody @Validated BaseDto dto){ + @PostMapping(value = "/queryReportList") + public JsonResponse> queryReportList(@RequestBody @Validated BaseDto dto) { log.info("查询报告单列表:{}", dto); //获取用户的权限 LoginUser loginUser = SecurityUtils.getLoginUser(); //当前默认一个用户只有一个角色 String dataScope = "5"; - if(CollUtil.isNotEmpty(loginUser.getUser().getRoles())){ + if (CollUtil.isNotEmpty(loginUser.getUser().getRoles())) { dataScope = loginUser.getUser().getRoles().get(0).getDataScope(); } startPage(dto); @@ -78,17 +80,17 @@ public class RmsController extends BaseController { } //修改报告单基本信息 - @ApiOperation(value = "修改报告单基本信息",notes = "修改报告单基本信息") - @PostMapping(value="/updateReportBasic") - public JsonResponse updateReportBasic(@RequestBody @Valid RmsDto.UpdateReportBasic dto){ + @ApiOperation(value = "修改报告单基本信息", notes = "修改报告单基本信息") + @PostMapping(value = "/updateReportBasic") + public JsonResponse updateReportBasic(@RequestBody @Valid RmsDto.UpdateReportBasic dto) { log.info("修改报告单基本信息:{}", dto); return JsonResponse.ok(rmsService.updateReportBasic(dto)); } //修改量表的初步印象信息 - @ApiOperation(value = "修改量表的初步印象信息",notes = "修改量表的初步印象信息") - @PostMapping(value="/updateScaleInitialImpression") - public JsonResponse updateScaleInitialImpression(@RequestBody @Valid RmsDto.UpdateScaleInitialImpression dto){ + @ApiOperation(value = "修改量表的初步印象信息", notes = "修改量表的初步印象信息") + @PostMapping(value = "/updateScaleInitialImpression") + public JsonResponse updateScaleInitialImpression(@RequestBody @Valid RmsDto.UpdateScaleInitialImpression dto) { log.info("修改量表的初步印象信息:{}", dto); return JsonResponse.ok(rmsService.updateScaleInitialImpression(dto)); } @@ -101,16 +103,16 @@ public class RmsController extends BaseController { // return JsonResponse.ok(rmsService.signReport(dto)); // } - @ApiOperation(value = "查询报告单详细答题信息",notes = "根据报告单id和测评类型,查看报告单的详细信息") + @ApiOperation(value = "查询报告单详细答题信息", notes = "根据报告单id和测评类型,查看报告单的详细信息") @PostMapping("/queryReportAnswer") - public JsonResponse> queryReportAnswer(@RequestBody @ApiParam @Valid RmsDto.QueryReportAnswer dto){ + public JsonResponse> queryReportAnswer(@RequestBody @ApiParam @Valid RmsDto.QueryReportAnswer dto) { log.info("查询报告单详细答题信息:{}", dto); List reportDetailAnswers = rmsService.queryReportAnswer(dto, SecurityUtils.getUserId()); log.info("查询报告单详细答题信息完成"); return JsonResponse.ok(reportDetailAnswers); } - @ApiOperation(value = "导出报告单",notes = "导出报告单") + @ApiOperation(value = "导出报告单", notes = "导出报告单") @PostMapping("/exportReport") public JsonResponse exportReport(@RequestBody @ApiParam @Valid RmsDto.ExportReportDto dto) throws IOException { //查询报告单信息 @@ -122,7 +124,7 @@ public class RmsController extends BaseController { return JsonResponse.ok(export); } - @ApiOperation(value = "导出指定量表",notes = "导出指定量表") + @ApiOperation(value = "导出指定量表", notes = "导出指定量表") @PostMapping("/export") public JsonResponse export(@RequestBody @ApiParam @Valid RmsDto.ExportReportDto dto, HttpServletRequest request) throws IOException { String deptId = request.getHeader("deptId"); @@ -136,9 +138,9 @@ public class RmsController extends BaseController { } - @ApiOperation(value = "管理员查询报告单列表",notes = "管理员查询报告单列表") + @ApiOperation(value = "管理员查询报告单列表", notes = "管理员查询报告单列表") @PostMapping("/queryAllReports") - public JsonResponse> queryAllReports(@RequestBody @ApiParam @Valid BaseDto param){ + public JsonResponse> queryAllReports(@RequestBody @ApiParam @Valid BaseDto param) { //编辑报告单信息 log.info("管理员查询报告单列表请求参数:{}", param); @@ -148,9 +150,9 @@ public class RmsController extends BaseController { return JsonResponse.ok(new PageInfo<>(reportNamePageInfo)); } - @ApiOperation(value = "导出指定id的报告单分析",notes = "导出指定id的报告单分析") + @ApiOperation(value = "导出指定id的报告单分析", notes = "导出指定id的报告单分析") @GetMapping("/exportAnalyse") - public void exportAnalyse(@RequestParam(value = "ids")@ApiParam @Valid List ids, HttpServletResponse response) throws IOException { + public void exportAnalyse(@RequestParam(value = "ids") @ApiParam @Valid List ids, HttpServletResponse response) throws IOException { //查询报告单信息 log.info("导出指定报告单分析:{}", ids); Workbook workbook = rmsService.exportAnalyse(ids); @@ -160,5 +162,19 @@ public class RmsController extends BaseController { workbook.write(response.getOutputStream()); } + @ApiOperation(value = "查询测评列表", notes = "管理员查询测评列表") + @PostMapping("/queryReport") + public JsonResponse> queryReport(@RequestBody @ApiParam @Valid BaseDto param) { + if (param.getPageNum() > 0) { + PageHelper.startPage(param.getPageNum(), param.getPageSize()); + } + return JsonResponse.ok(new PageInfo<>(rmsService.queryReportList(param.getParam(), SecurityUtils.getUserId()))); + } + + @ApiOperation("导出患者测评列表") + @PostMapping("/exportEvaluation") + public void exportEvaluation(HttpServletResponse response, @RequestBody @Validated BaseDto dto) throws IOException { + rmsService.exportEvaluation(dto.getParam(), response); + } } diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/AmsDao.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/AmsDao.java new file mode 100644 index 0000000..d345b0a --- /dev/null +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/AmsDao.java @@ -0,0 +1,42 @@ +package com.ccsens.admin.persist.dao; + +import com.ccsens.system.domain.po.AmsPatientAnswerScore; +import com.ccsens.system.domain.po.QmsScaleAssConf; +import com.ccsens.system.domain.vo.AmsVo; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author:逗 + */ +public interface AmsDao { + List queryEvaluationStep(Long evaluationId); + + List getScaleAchievement(@Param("evaluationId") Long evaluationId, + @Param("scaleCode") String scaleCode, + @Param("sex")Byte sex); + + List getScaleQuestionAchievement(@Param("evaluationId") Long evaluationId, + @Param("scaleCode") String scaleCode, + @Param("sex")Byte sex); + + List queryOption(@Param("questionId")Long questionId, @Param("evaluationId")Long evaluationId); + + BigDecimal getTotalScoreByNPI(@Param("evaluationId")Long evaluationId); + + void delZmsAnswerScores(@Param("list")List amsPatientAnswerScores); + + String queryTemplate(@Param("code")String code); + + String queryScaleTypeName(@Param("code") String code); + + AmsVo.ComboVo queryComboName(@Param("code") String code, @Param("version") String version); + + QmsScaleAssConf queryScaleAssConf(@Param("scaleCode") String scaleCode, @Param("score") BigDecimal score); + + QmsScaleAssConf queryScaleAssConf1(@Param("scaleCode") String scaleCode, @Param("score") BigDecimal score, @Param("needPlan")Byte needPlan); + + List queryYsfaList(@Param("scaleCode") String scaleCode); +} diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/HmsDao.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/HmsDao.java index df8eb22..cca3fc8 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/HmsDao.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/HmsDao.java @@ -23,4 +23,7 @@ public interface HmsDao { List query(@Param("hospitalId") Long hospitalId, @Param("name") String name, @Param("code") String code); + + List queryDoctorName(Long hospitalId); + } diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/RmsDao.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/RmsDao.java index ae85805..24646b5 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/RmsDao.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/RmsDao.java @@ -1,7 +1,9 @@ package com.ccsens.admin.persist.dao; import com.ccsens.system.domain.dto.RmsDto; +import com.ccsens.system.domain.po.AmsPatientQuestionRecordDesc; import com.ccsens.system.domain.po.LdPatientRecord; +import com.ccsens.system.domain.po.QmsScaleAssConf; import com.ccsens.system.domain.vo.*; import org.apache.ibatis.annotations.Param; @@ -75,7 +77,7 @@ public interface RmsDao { @Param("username")String username, @Param("dataScope")String dataScope); - List queryReportListCopyClient(@Param("dto")RmsDto.QueryReportHistory dto, + List queryReportListCopyClient(@Param("dto")RmsDto.QueryReportList dto, @Param("userId")Long userId, @Param("username")String username, @Param("dataScope")String dataScope); @@ -89,6 +91,54 @@ public interface RmsDao { */ List queryRecord(@Param("evaluationId")Long evaluationId, @Param("questionId")Long questionId); + List queryReportScore1(@Param("evaluationId") Long evaluationId, + @Param("scaleCode") String scaleCode, + @Param("sex") Byte sex); + + List queryReportScore3(@Param("evaluationId") Long evaluationId, + @Param("scaleCode") String scaleCode, + @Param("sex") Byte sex); + + /** + * 查询报告单 + * + * @param evaId + * @return + */ + ClientEvaVo.ReportView getTzbsResult(@Param("evaId") Long evaId, + @Param("code") String code); + + QmsScaleAssConf queryScaleAssConf(@Param("scaleCode") String scaleCode, @Param("score") BigDecimal score); + + List getScaleAchievement(@Param("evaluationId") Long evaluationId, + @Param("scaleCode") String scaleCode, + @Param("sex")Byte sex); + + AmsPatientQuestionRecordDesc queryCTTRecordDesc(@Param("evaluationId")Long evaluationId, @Param("cognitiveCode")String cognitiveCode, @Param("showTitle")String showTitle); + /** + * 查询养生建议 + * + * @param constiCode + * @param deptId + * @return + */ + String queryYsjy(@Param("constiCode") String constiCode); + + + /** + * 查询测评分数 + * + * @param evaId + * @return + */ + List countReportResult(@Param("evaId") Long evaId, + @Param("code") String scaleCode); + + List queryReport(@Param("dto") RmsDto.ReportQuery dto); + + List queryEmsScaleScore(@Param("evaId") Long evaId, + @Param("scaleCodeList") List scaleCodeList); + List viewReportPdfByVisitNo(@Param("visitNo")String visitNo); List viewReportPdfByPatientNo(@Param("patientNo")String patientNo); diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/AmsReportService.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/AmsReportService.java new file mode 100644 index 0000000..30f64be --- /dev/null +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/AmsReportService.java @@ -0,0 +1,36 @@ +package com.ccsens.admin.service; + +import com.ccsens.system.domain.dto.RmsDto; +import com.ccsens.system.domain.vo.AmsReportVo; + +import java.io.IOException; + +/** + * 报告单模板 服务层 + * + * @author zzc + */ +public interface AmsReportService { + + /** + * 导出个人报告 + * @param dto + * @return + * @throws IOException + */ + AmsReportVo.Result exportGr(RmsDto.ExportReport1Dto dto) throws IOException; + + /** + * 导出医生报告 + * @param dto + * @return + */ + AmsReportVo.Result exportYs(RmsDto.ExportReport1Dto dto); + + /** + * 导出阳性报告 + * @param dto + * @return + */ + AmsReportVo.Result exportYx(RmsDto.ExportReport1Dto dto); +} diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java index 18eb748..9ff1ecc 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java @@ -64,4 +64,6 @@ public interface IPmsPatientService { String userName); void exportPatientJz(HttpServletResponse response, PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) throws IOException; + + } diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IRmsService.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IRmsService.java index be562d5..7c4d406 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IRmsService.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IRmsService.java @@ -6,6 +6,7 @@ import com.ccsens.admin.domain.vo.LdPatientExportVo; import com.ccsens.system.domain.vo.RmsVo; import org.apache.poi.ss.usermodel.Workbook; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @@ -20,7 +21,7 @@ public interface IRmsService { List queryReportListByTime(RmsDto.QueryReportHistory dto, Long userId, String dataScope); List queryReportList(RmsDto.QueryReportHistory dto, Long userId, String dataScope); - List queryReportListCopyClient(RmsDto.QueryReportHistory dto, Long userId, String dataScope); + List queryReportListCopyClient(RmsDto.QueryReportList dto, Long userId, String dataScope); Integer updateReportBasic(RmsDto.UpdateReportBasic dto); @@ -40,5 +41,9 @@ public interface IRmsService { List viewReportPDF(RmsDto.ReportPDF dto); + List queryReportList(RmsDto.ReportQuery param, Long userId); + String queryPdfUrl(RmsDto.queryPdfUrl param); + + void exportEvaluation(RmsDto.ReportQuery param, HttpServletResponse response) throws IOException; } diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/AmsReportServiceImpl.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/AmsReportServiceImpl.java new file mode 100644 index 0000000..e317eb5 --- /dev/null +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/AmsReportServiceImpl.java @@ -0,0 +1,875 @@ +package com.ccsens.admin.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HtmlUtil; +import com.ccsens.admin.persist.dao.AmsDao; +import com.ccsens.admin.persist.dao.HmsDao; +import com.ccsens.admin.service.AmsReportService; +import com.ccsens.admin.service.IReportInfoService; +import com.ccsens.admin.service.IRmsService; +import com.ccsens.common.constant.CultureEnum; +import com.ccsens.common.constant.JobEnum; +import com.ccsens.common.enums.BaseEnum; +import com.ccsens.common.utils.AsposeUtils; +import com.ccsens.common.utils.SecurityUtils; +import com.ccsens.common.utils.StringUtils; +import com.ccsens.system.domain.dto.RmsDto; +import com.ccsens.system.domain.po.*; +import com.ccsens.system.domain.vo.*; +import com.ccsens.system.persist.mapper.*; +import com.deepoove.poi.XWPFTemplate; +import com.deepoove.poi.data.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.*; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import static com.ccsens.common.utils.PropUtil.path; +import static com.ccsens.common.utils.PropUtil.reportDomain; + +@Slf4j +@Service +public class AmsReportServiceImpl implements AmsReportService { + + @Resource + private IReportInfoService reportInfoService; + @Resource + private AmsDao amsDao; + @Value("${informed.prefixWord}") + private String prefixWord; + + @Value("${file.reportPath}") + private String reportPath; + @Resource + private HmsReportConfigMapper hmsReportConfigMapper; + @Resource + private IRmsService rmsService; + @Resource + private RmsReportMapper rmsReportMapper; + @Resource + private QmsScaleMapper qmsScaleMapper; + @Resource + private QmsScaleTypeMapper qmsScaleTypeMapper; + @Resource + private EmsEvaluationMapper emsEvaluationMapper; + @Resource + private AmsPatientAnswerScoreMapper amsPatientAnswerScoreMapper; + @Resource + private HmsDoctorSignMapper hmsDoctorSignMapper; + @Resource + private HmsDao hmsDoctorDao; + @Resource + private HmsVersionMapper hmsVersionMapper; + @Value("${file.grPath}") + private String grPath; + @Value("${file.ysPath}") + private String ysPath; + + @Override + public AmsReportVo.Result exportGr(RmsDto.ExportReport1Dto dto) throws IOException { + RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); + queryDetail.setEvaluationId(dto.getEvaluationId()); + RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, SecurityUtils.getUserId()); + if (detail == null) { + return null; + } + EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); + List scores = detail.getScores(); + RmsVo.ReportPatient patientInfo = detail.getPatient(); + + HashMap params = new HashMap<>(); + + XWPFTemplate template = XWPFTemplate.compile(grPath); + params.put("h_name", patientInfo.getHospitalName()); +// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create()); + params.put("p_name", patientInfo.getPatientName()); + params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女"); + params.put("p_age", patientInfo.getPatientAge()); + CultureEnum cultureEnum = null; +// BodyContainer bodyContainer = BodyContainerFactory.getBodyContainer(run); + try { + cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue()); + } catch (Exception e) { + //处理educationStatus为null的情况,后台导入的数据educationStatus为null + //默认为初中 + cultureEnum = CultureEnum.YW; + } + if (cultureEnum != null) { + params.put("p_grade", cultureEnum.getDesc()); + } + if (patientInfo.getCareer() != null) { + JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue()); +// params.put("p_no", patientInfo.getSerialNumber()); + if (jobEnum != null) { + params.put("p_Career", jobEnum.getDesc()); + } + } + params.put("p_dept", patientInfo.getDepartment()); + params.put("p_bedno", patientInfo.getBedNumber()); + params.put("p_Patient_number", patientInfo.getHospitalNumber()); + params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis()); + params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd")); +// params.put("score", detail.getScore()); + //AD8 +// if (dto.getSignId() != null) { +// HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorDao.querySign(dto.getSignId()); +// if (emsEvaluationInformedConsent != null) { +// params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); +// } +// } + if (dto.getSignId() != null) { + HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId()); + if (emsEvaluationInformedConsent != null) { + params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); + } + }else { + //签名信息 + Long userId = SecurityUtils.getUserId(); + List querySigns = hmsDoctorDao.querySign(userId); + if (CollUtil.isNotEmpty(querySigns)) { + HmsVo.QuerySign querySign = querySigns.get(0); + if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) { + params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create()); + } + } + } + params.put("report_date", DateUtil.date(patientInfo.getReportTime())); + + //生成表格 + // 创建带有样式的文本 + TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create(); + RowRenderData headerRow = Rows.of(text1, text2, text3).create(); + RowRenderData titleRow = Rows.of("项目名称", "得分", "结论").create(); + Tables.TableBuilder of = Tables.of(headerRow, titleRow); + //肌少套餐结论 + String jsResult = addJs(scores); + Integer jsCount = 0, jshs = 0; + for (int i = 0; i < scores.size(); i++) { + //判断肌少量表数量 + if ("5CZLSY".equals(scores.get(i).getCode()) || "SZGGJ".equals(scores.get(i).getCode()) || "WLCD".equals(scores.get(i).getCode()) || "LMBS".equals(scores.get(i).getCode())) { + jsCount += 1; + } + //查询类型 + AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion()); + String comboName = "", parentName = ""; + String str = ""; + if (comboVo != null) { + if (StrUtil.isNotEmpty(comboVo.getParentName())) { + str = comboVo.getParentName(); + params.put("yjzb", comboVo.getParentName()); + + } + if (StrUtil.isNotBlank(comboVo.getName())) { + if (StrUtil.isNotBlank(str)) { + str += "/" + comboVo.getName(); + } else { + str = comboVo.getName(); + } + params.put("ejzb", comboVo.getName()); + } + + } + + String impression = ""; + Byte needPlan = null; + if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) { + //1、认知检查结果在正常范围。/认知功能受损。 + //依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。 + if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) { + impression = "认知功能受损"; + needPlan = 1; + } else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) { + impression = "认知功能受损"; + needPlan = 1; + } else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) { + impression = "认知功能受损"; + needPlan = 1; + } else { + impression = "认知检查结果在正常范围"; + needPlan = 0; + } + } + //判断是否阳性 查询防治计划 + + QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf1(scores.get(i).getCode(), scores.get(i).getScore(), needPlan); + RowRenderData row1; + if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) { + //需要防治 + TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create(); + TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create(); + TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create(); + row1 = Rows.of( + textName, + textScore, + textImpression + ).create(); + } else { + row1 = Rows.of( + scores.get(i).getName(), + scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "", + StrUtil.isEmpty(impression) ? qmsScaleAssConf == null ? StrUtil.isEmpty(scores.get(i).getImpression()) ? null : scores.get(i).getImpression() : qmsScaleAssConf.getResult() : impression + ).create(); + } + //查询类型 + String typeName = amsDao.queryScaleTypeName(scores.get(i).getCode()); +// RowRenderData row1 = Rows.of( +// scores.get(i).getName(), +// scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "", +// scores.get(i).getImpression() +// ).create(); + if (StrUtil.isNotEmpty(typeName)) { + of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); + } + of.addRow(row1); + //添加肌少套餐结论 + if (StrUtil.isNotEmpty(jsResult) && jsCount == 4) { + //判断结论 + RowRenderData rowRenderData = Rows.of( + "肌少总结论:", + jsResult, + jsResult + ).create(); + jshs = i + 3; + of.addRow(rowRenderData); + jsResult = ""; + } + + //生成问题表格 + TextRenderData text5 = Texts.of("问题描述").bold().fontSize(12).create(); + TextRenderData text6 = Texts.of("问题结果").bold().fontSize(12).create(); + TextRenderData text7 = Texts.of("得 分").bold().fontSize(12).create(); +// TextRenderData text8 = Texts.of("总 分").bold().fontSize(12).create(); + RowRenderData detailHeaderRow = Rows.of(text5, text6, text7).create(); + Tables.TableBuilder of1 = Tables.of(detailHeaderRow); + //遍历问题 + RmsDto.QueryReportAnswer queryReportAnswer = new RmsDto.QueryReportAnswer(); + queryReportAnswer.setEvaluationCode(scores.get(i).getCode()); + queryReportAnswer.setId(dto.getReportId()); + List reportDetailAnswerList = rmsService.queryReportAnswer(queryReportAnswer, SecurityUtils.getUserId()); + MergeCellRule detailMerge = null; + if (CollUtil.isNotEmpty(reportDetailAnswerList)) { + RmsVo.ReportDetailAnswer reportDetailAnswer = reportDetailAnswerList.get(0); + List> collect = reportDetailAnswerList.stream().map(reportDetailAnswer1 -> reportDetailAnswer1.getQuestionList()).collect(Collectors.toList()); + List list = new ArrayList<>(); + for (int j = 0; j < collect.size(); j++) { + list.addAll(collect.get(j)); + } + + for (RmsVo.QuestionInfo questionInfo : list) { + //查询患者答题得分 + BigDecimal score = new BigDecimal("0"); + AmsPatientAnswerScoreExample amsPatientAnswerScoreExample = new AmsPatientAnswerScoreExample(); + amsPatientAnswerScoreExample.createCriteria() +// .andPatientIdEqualTo(patientInfo.getId()) + .andQuestionIdEqualTo(questionInfo.getQuestionId()) + .andEvaluationIdEqualTo(dto.getEvaluationId()); + amsPatientAnswerScoreExample.setOrderByClause("id desc"); + List amsPatientAnswerScores = amsPatientAnswerScoreMapper.selectByExample(amsPatientAnswerScoreExample); + if (CollUtil.isNotEmpty(amsPatientAnswerScores)) { + score = BigDecimal.valueOf(amsPatientAnswerScores.stream().filter(e -> e.getOptionId() != null && e.getOptionId() != 0).map(AmsPatientAnswerScore::getScore).mapToDouble(BigDecimal::doubleValue).sum()); + } + //处理答案 + String answers = ""; + for (RmsVo.Answer answer : questionInfo.getAnswers()) { + if (StrUtil.isNotEmpty(answer.getAnswer())) { + answers += answer.getAnswer() + ","; + } + } + if (StrUtil.isNotEmpty(answers)) { + answers = answers.substring(0, answers.length() - 1); + } + of1.addRow(Rows.of(questionInfo.getQuestionName(), + StrUtil.isEmpty(answers) || "null".equals(answers) ? "" : answers, + score + "").create()); + + //处理指标 + if (comboVo != null) { + if (StrUtil.isNotBlank(comboVo.getName())) { + params.put("yjzb", comboVo.getName()); + } + if (StrUtil.isNotEmpty(comboVo.getParentName())) { + params.put("ejzb", comboVo.getParentName()); + } + } + + + } + TableRenderData tableData = of1 + .create(); + if (CollUtil.isNotEmpty(reportDetailAnswer.getQuestionList()) && reportDetailAnswer.getQuestionList().size() > 1) { + detailMerge = MergeCellRule.builder().map(MergeCellRule.Grid.of(1, 3), MergeCellRule.Grid.of(reportDetailAnswer.getQuestionList().size(), 3)).build(); +// of1.mergeRule(detailMerge); + } + if (qmsScaleAssConf != null) { + params.put("pgjg", qmsScaleAssConf.getResult()); + params.put("fzjy_" + i, qmsScaleAssConf.getPlan()); + if (StrUtil.isNotEmpty(qmsScaleAssConf.getPlan())) { + params.put("fzjyFlag" + i, false); + } + } + + //添加中医体质辨识防治建议 + if ("TZBS_BZ".equals(scores.get(i).getCode()) || "TZBS_LN".equals(scores.get(i).getCode())) { + //查询防治建议 + List list1 = amsDao.queryYsfaList(scores.get(i).getCode()); + if (CollUtil.isNotEmpty(list1)) { + String ysfas = list1.get(0); + for (String ysfa : list1) { + ysfas += HtmlUtil.unescape(ysfa); + } + params.put("fzjy_" + i, ysfas); + params.put("fzjyFlag" + i, false); + } + + } + + params.put("table_" + i, tableData); + params.put("flag" + i, true); + } + + + params.put("title" + i, scores.get(i).getName()); + } + + if (emsEvaluation.getVersion() != null) { + HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion())); + if (hmsVersion != null) { + params.put("type", hmsVersion.getVersion() + "评估报告"); + } + } + MergeCellRule.MergeCellRuleBuilder map = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 2)); + if (jshs > 0) { + map.map(MergeCellRule.Grid.of(jshs, 1), MergeCellRule.Grid.of(jshs, 2)).build(); + } + TableRenderData tableData = of + .mergeRule(map.build()) + .create(); + params.put("table", tableData); + + +// Long hospitalId = SecurityUtils.getDeptId(); + String s = IdUtil.randomUUID(); +// 将表格数据放入参数中 +// params.put("table", tableDataList); + try { + template.render(params); + } catch (Exception e) { + e.printStackTrace(); // 输出详细的异常信息 + } + String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx"; + String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf"; + String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx"; + String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf"; + + try { + template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx"))); + AsposeUtils.doc2pdf(aPath, pPath); + } catch (Exception e) { + e.printStackTrace(); + } + + AmsReportVo.Result result = new AmsReportVo.Result(); + result.setWord(filePath); + result.setPath(pdfPath); + return result; + } + + /** + * 判断是否添加肌少总结论 + * 如果四项测试有一项没做,则跳过 + * + * @param scores + * @return + */ + // + // + private String addJs(List scores) { + List wczl = scores.stream().filter( + score -> score.getCode().equals("5CZLSY") + ).collect(Collectors.toList()); + List szggj = scores.stream().filter( + score -> score.getCode().equals("SZGGJ") + ).collect(Collectors.toList()); + List wlcd = scores.stream().filter( + score -> score.getCode().equals("WLCD") + ).collect(Collectors.toList()); + List lmbs = scores.stream().filter( + score -> score.getCode().equals("LMBS") + ).collect(Collectors.toList()); + if (CollUtil.isEmpty(wczl) || CollUtil.isEmpty(szggj) || CollUtil.isEmpty(wlcd) || CollUtil.isEmpty(lmbs)) { + return null; + } + QmsScaleAssConf wczlConf = amsDao.queryScaleAssConf1(wczl.get(0).getCode(), wczl.get(0).getScore(), null); + QmsScaleAssConf szggjConf = amsDao.queryScaleAssConf1(szggj.get(0).getCode(), szggj.get(0).getScore(), null); + QmsScaleAssConf wlcdConf = amsDao.queryScaleAssConf1(wlcd.get(0).getCode(), wlcd.get(0).getScore(), null); + QmsScaleAssConf lmbsConf = amsDao.queryScaleAssConf1(lmbs.get(0).getCode(), lmbs.get(0).getScore(), null); + if (wczlConf != null && szggjConf != null && wlcdConf != null && lmbsConf != null) { + // *四项测试结果都正常,说明没有肌少症风险 + // *如果四肢骨骼肌身高质量指数(ASMI)正常,肌肉力量或(及)躯体功能下降,则有肌少症风险; + // *如果四项测试值全部低于标准值,则诊断为严重肌少症。 + // *如果四肢骨骼肌身高质量指数(ASMI)低于标准值,肌肉力量或躯体功能其中有一项低于标准值,则诊断为肌少症; + // *否则有肌少症风险 + if (!"1".equals(wczlConf.getNeedPlan()) && !"1".equals(szggjConf.getNeedPlan()) && !"1".equals(wlcdConf.getNeedPlan()) && !"1".equals(lmbsConf.getNeedPlan())) { + //没有肌少症风险 + return "没有肌少症风险"; + } else if (!"1".equals(szggjConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(wczlConf.getNeedPlan())) { + return "有肌少症风险"; + } else if ("1".equals(wczlConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(szggjConf.getNeedPlan())) { + return "严重肌少症"; + } else if ("1".equals(szggjConf.getNeedPlan()) && ("1".equals(wlcdConf.getNeedPlan()) || "1".equals(lmbsConf.getNeedPlan()) || "1".equals(wczlConf.getNeedPlan()))) { + return "肌少症"; + } else { + return "有肌少症风险"; + } + } + return null; + } + + @Override + public AmsReportVo.Result exportYs(RmsDto.ExportReport1Dto dto) { + Long userId = dto.getTesterId(); + try { + userId = SecurityUtils.getUserId(); + }catch (Exception e){ + log.error("获取用户ID失败",e); + } + + RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId()); + if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getUrl())) { + AmsReportVo.Result result = new AmsReportVo.Result(); + result.setPath(report.getUrl()); + return result; + } + + + RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); + queryDetail.setEvaluationId(dto.getEvaluationId()); + RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, userId); + if (detail == null) { + return null; + } + EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); + if (emsEvaluation == null) { + return null; + } + List scores = detail.getScores(); + RmsVo.ReportPatient patientInfo = detail.getPatient(); + + HashMap params = new HashMap<>(); + + XWPFTemplate template = XWPFTemplate.compile(ysPath); + params.put("h_name", patientInfo.getHospitalName()); +// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create()); + params.put("p_name", patientInfo.getPatientName()); + params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女"); + params.put("p_age", patientInfo.getPatientAge()); + CultureEnum cultureEnum = null; +// EmsEvaluationInformedConsentExample emsEvaluationInformedConsentExample = new EmsEvaluationInformedConsentExample(); +// emsEvaluationInformedConsentExample.createCriteria().andEvaluationIdEqualTo(dto.getEvaluationId()); +// emsEvaluationInformedConsentExample.setOrderByClause("id desc"); +// List emsEvaluationInformedConsents = emsEvaluationInformedConsentMapper.selectByExample(emsEvaluationInformedConsentExample); + if (dto.getSignId() != null) { + HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId()); + if (emsEvaluationInformedConsent != null) { + params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); + } + }else { + //签名信息 + + List querySigns = hmsDoctorDao.querySign(userId); + if (CollUtil.isNotEmpty(querySigns)) { + HmsVo.QuerySign querySign = querySigns.get(0); + if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) { + params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create()); + } + } + } + + try { + cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue()); + } catch (Exception e) { + //处理educationStatus为null的情况,后台导入的数据educationStatus为null + //默认为初中 + cultureEnum = CultureEnum.YW; + } + if (cultureEnum != null) { + params.put("p_grade", cultureEnum.getDesc()); + } + if (patientInfo.getCareer() != null) { + JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue()); +// params.put("p_no", patientInfo.getSerialNumber()); + if (jobEnum != null) { + params.put("p_Career", jobEnum.getDesc()); + } + } + params.put("p_dept", patientInfo.getDepartment()); + params.put("p_bedno", patientInfo.getBedNumber()); + params.put("p_Patient_number", patientInfo.getHospitalNumber()); + params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis()); + params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd")); +// params.put("score", detail.getScore()); + //AD8 + +// params.put("cpy_img_url", patientInfo.getName()); + params.put("report_date", DateUtil.date(patientInfo.getReportTime())); + + //生成表格 + // 创建带有样式的文本 + TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text4 = Texts.of("评估结论").bold().fontSize(12).create(); +// TextRenderData text5 = Texts.of("评估结论").bold().fontSize(12).create(); + + RowRenderData headerRow = Rows.of(text1, text2, text3, text4).create(); + + //肌少套餐结论 + String jsResult = addJs(scores); + Integer jsCount = 0, jshs = 0; + String typeName = ""; + RowRenderData titleRow = Rows.of("一级指标/二级指标", "量表名称", "得分", "结论").create(); + Tables.TableBuilder of = Tables.of(headerRow, titleRow); + for (int i = 0; i < scores.size(); i++) { + //判断肌少量表数量 + if ("5CZLSY".equals(scores.get(i).getCode()) || "SZGGJ".equals(scores.get(i).getCode()) || "WLCD".equals(scores.get(i).getCode()) || "LMBS".equals(scores.get(i).getCode())) { + jsCount += 1; + } + //查询类型 + AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion()); + String comboName = "", parentName = ""; + String str = ""; + if (comboVo != null) { + typeName = comboVo.getParentName(); + if (StrUtil.isNotEmpty(comboVo.getParentName())) { + str = comboVo.getParentName(); + params.put("yjzb", comboVo.getParentName()); + + } + if (StrUtil.isNotBlank(comboVo.getName())) { + if (StrUtil.isNotBlank(str)) { + str += "/" + comboVo.getName(); + } else { + str = comboVo.getName(); + } + params.put("ejzb", comboVo.getName()); + } + + } + String impression = ""; + if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) { + //1、认知检查结果在正常范围。/认知功能受损。 + //依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。 + if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) { + impression = "认知功能受损"; + } else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) { + impression = "认知功能受损"; + } else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) { + impression = "认知功能受损"; + } else { + impression = "认知检查结果在正常范围"; + } + } + //判断是否阳性 查询防治计划 + QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf(scores.get(i).getCode(), scores.get(i).getScore()); + if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) { + //需要防治 + TextRenderData textStr = Texts.of(str).bold().color("FF0000").create(); + TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create(); + TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create(); + TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create(); +// TextRenderData textDescription = Texts.of(scores.get(i).getDescription()).bold().color("FF0000").create(); + + //查询一二级套餐 + RowRenderData row1 = Rows.of( + textStr, + textName, + textScore, + textImpression + ).create(); + if (StrUtil.isNotEmpty(comboName + "/" + parentName)) { + of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); + } + of.addRow(row1); + } else { + TextRenderData textStr = Texts.of(str).bold().create(); + TextRenderData textName = Texts.of(scores.get(i).getName()).bold().create(); + TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().create(); + //中医体质辨识添加结论 结论为初步印象 + TextRenderData textImpression = Texts.of(qmsScaleAssConf == null ? "TZBS_LN".equals(scores.get(i).getCode()) || "TZBS_BZ".equals(scores.get(i).getCode()) ? scores.get(i).getImpression() : null : qmsScaleAssConf.getResult()).bold().create(); + //查询一二级套餐 + RowRenderData row1 = Rows.of( + textStr, + textName, + textScore, + textImpression + ).create(); + if (StrUtil.isNotEmpty(comboName + "/" + parentName)) { + of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); + } + of.addRow(row1); + } + //添加肌少套餐结论 + if (StrUtil.isNotEmpty(jsResult) && jsCount == 4) { + //判断结论 + RowRenderData rowRenderData = Rows.of( + "肌少总结论:", + jsResult, + jsResult, + jsResult + ).create(); + jshs = i + 3; + of.addRow(rowRenderData); + jsResult = ""; + } + } + if (emsEvaluation.getVersion() != null) { + HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion())); + if (hmsVersion != null) { + params.put("type", hmsVersion.getVersion() + "评估报告"); + } + } + MergeCellRule.MergeCellRuleBuilder map = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 3)); + if (jshs > 0) { + map.map(MergeCellRule.Grid.of(jshs, 1), MergeCellRule.Grid.of(jshs, 3)); + } + TableRenderData tableData = of + .mergeRule(map.build()) + // 居中对齐 + .create(); + params.put("table", tableData); + + +// Long hospitalId = SecurityUtils.getDeptId(); + String s = IdUtil.randomUUID(); +// 将表格数据放入参数中 +// params.put("table", tableDataList); + try { + template.render(params); + } catch (Exception e) { + e.printStackTrace(); // 输出详细的异常信息 + } + String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx"; + String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf"; + String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx"; + String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf"; + + try { + template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx"))); + AsposeUtils.doc2pdf(aPath, pPath); + } catch (Exception e) { + e.printStackTrace(); + } + + AmsReportVo.Result result = new AmsReportVo.Result(); + result.setWord(filePath); + result.setPath(pdfPath); + //将生成的文件路径保存到报告单内 + if(ObjectUtil.isNotNull(report)){ + report.setUrl(pdfPath); + rmsReportMapper.updateByPrimaryKeySelective(report); + } + return result; + } + + @Override + public AmsReportVo.Result exportYx(RmsDto.ExportReport1Dto dto) { + RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); + queryDetail.setEvaluationId(dto.getEvaluationId()); + RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, SecurityUtils.getUserId()); + if (detail == null) { + return null; + } + EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); + if (emsEvaluation == null) { + return null; + } + List scores = detail.getScores(); + RmsVo.ReportPatient patientInfo = detail.getPatient(); + + HashMap params = new HashMap<>(); + + XWPFTemplate template = XWPFTemplate.compile(ysPath); + params.put("h_name", patientInfo.getHospitalName()); +// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create()); + params.put("p_name", patientInfo.getPatientName()); + params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女"); + params.put("p_age", patientInfo.getPatientAge()); + CultureEnum cultureEnum = null; +// BodyContainer bodyContainer = BodyContainerFactory.getBodyContainer(run); + try { + cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue()); + } catch (Exception e) { + //处理educationStatus为null的情况,后台导入的数据educationStatus为null + //默认为初中 + cultureEnum = CultureEnum.YW; + } + if (cultureEnum != null) { + params.put("p_grade", cultureEnum.getDesc()); + } + if (patientInfo.getCareer() != null) { + JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue()); +// params.put("p_no", patientInfo.getSerialNumber()); + if (jobEnum != null) { + params.put("p_Career", jobEnum.getDesc()); + } + } + params.put("p_dept", patientInfo.getDepartment()); + params.put("p_bedno", patientInfo.getBedNumber()); + params.put("p_Patient_number", patientInfo.getHospitalNumber()); + params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis()); + params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd")); +// params.put("score", detail.getScore()); + + if (dto.getSignId() != null) { + HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId()); + if (emsEvaluationInformedConsent != null) { + params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); + } + }else { + //签名信息 + Long userId = SecurityUtils.getUserId(); + List querySigns = hmsDoctorDao.querySign(userId); + if (CollUtil.isNotEmpty(querySigns)) { + HmsVo.QuerySign querySign = querySigns.get(0); + if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) { + params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create()); + } + } + } +// params.put("cpy_img_url", patientInfo.getName()); + params.put("report_date", DateUtil.date(patientInfo.getReportTime())); + + //生成表格 + // 创建带有样式的文本 + TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text4 = Texts.of("评估结论").bold().fontSize(12).create(); +// TextRenderData text5 = Texts.of("评估结论").bold().fontSize(12).create(); + + RowRenderData headerRow = Rows.of(text1, text2, text3, text4).create(); + String typeName = ""; + RowRenderData titleRow = Rows.of("一级指标/二级指标", "量表名称", "得分", "结论").create(); + Tables.TableBuilder of = Tables.of(headerRow, titleRow); + for (int i = 0; i < scores.size(); i++) { + //查询类型 + AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion()); + String comboName = "", parentName = ""; + String str = ""; + if (comboVo != null) { + if (StrUtil.isNotEmpty(comboVo.getParentName())) { + str = comboVo.getParentName(); + params.put("yjzb", comboVo.getParentName()); + + } + if (StrUtil.isNotBlank(comboVo.getName())) { + if (StrUtil.isNotBlank(str)) { + str += "/" + comboVo.getName(); + } else { + str = comboVo.getName(); + } + params.put("ejzb", comboVo.getName()); + } + } + + String impression = ""; + if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) { + //1、认知检查结果在正常范围。/认知功能受损。 + //依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。 + if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) { + impression = "认知功能受损"; + } else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) { + impression = "认知功能受损"; + } else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) { + impression = "认知功能受损"; + } else { + impression = "认知检查结果在正常范围"; + } + } + + //判断是否阳性 查询防治计划 + QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf(scores.get(i).getCode(), scores.get(i).getScore()); + if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) { + //需要防治 + TextRenderData textStr = Texts.of(str).bold().color("FF0000").create(); + TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create(); + TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create(); + TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create(); +// TextRenderData textDescription = Texts.of(scores.get(i).getDescription()).bold().color("FF0000").create(); + + //查询一二级套餐 + RowRenderData row1 = Rows.of( + textStr, + textName, + textScore, + textImpression + ).create(); + if (StrUtil.isNotEmpty(comboName + "/" + parentName)) { + of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); + } + of.addRow(row1); + } + } + if (emsEvaluation.getVersion() != null) { + HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion())); + if (hmsVersion != null) { + params.put("type", hmsVersion.getVersion() + "评估报告"); + } + } + MergeCellRule mergeRule = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 3)).build(); + TableRenderData tableData = of + .mergeRule(mergeRule) + // 居中对齐 + .create(); + params.put("table", tableData); + + +// Long hospitalId = SecurityUtils.getDeptId(); + String s = IdUtil.randomUUID(); +// 将表格数据放入参数中 +// params.put("table", tableDataList); + try { + template.render(params); + } catch (Exception e) { + e.printStackTrace(); // 输出详细的异常信息 + } + String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx"; + String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf"; + String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx"; + String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf"; + + try { + template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx"))); + AsposeUtils.doc2pdf(aPath, pPath); + } catch (Exception e) { + e.printStackTrace(); + } + + AmsReportVo.Result result = new AmsReportVo.Result(); + result.setWord(filePath); + result.setPath(pdfPath); + return result; + } + + public static boolean isInteger(String str) { + Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); + return pattern.matcher(str).matches(); + } + +} diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java index 5781359..49a6feb 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java @@ -201,155 +201,147 @@ public class PmsPatientServiceImpl implements IPmsPatientService { @Override public Long editPatientOtherMsg(PmsPatientDto.EditOtherMsg param) { - JSONObject jsonObject = null; - Object model = param.getModel(); - - // 处理model参数 - if (model instanceof List) { - // List转JSONArray - com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model); - jsonObject = array.getJSONObject(0); - } else if (model instanceof Map) { - // Map转JSONObject - jsonObject = (JSONObject) JSON.toJSON(model); - } - // JSONObject jsonObject = null; -// if (param.getModel() instanceof JSONArray) { -// JSONArray array = (JSONArray) param.getModel(); +// Object model = param.getModel(); +// +// // 处理model参数 +// if (model instanceof List) { +// // List转JSONArray +// com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model); // jsonObject = array.getJSONObject(0); -// } else if (param.getModel() instanceof JSONObject) { -// jsonObject = (JSONObject) param.getModel(); +// } else if (model instanceof Map) { +// // Map转JSONObject +// jsonObject = (JSONObject) JSON.toJSON(model); +// } +// +// //验证就诊号是否为空 +// String visitNo = jsonObject.getString("outpatientNo"); +// if (StrUtil.isEmpty(visitNo)) { +// visitNo = jsonObject.getString("visitNo"); +// if (StrUtil.isEmpty(visitNo)) { +// throw new ServiceException("就诊号不能为空"); +// } +// } +// //验证患者id是否为空 +// Long patientId = jsonObject.getLong("patientId"); +// if (patientId == null) { +// throw new ServiceException("患者id不能为空"); +// } +// +// +// //如果是就诊信息(PmsPatientBody) +// if ("PmsPatientBody".equals(param.getEditType())) { +// //就诊信息默认是单个信息,直接用jsonObject +// PmsPatientBody pmsPatientBody = JSONObject.parseObject(jsonObject.toJSONString(), PmsPatientBody.class); +// //根据就诊号和患者id查询就诊信息是否存在 +// PmsPatientBodyExample patientBodyExample = new PmsPatientBodyExample(); +// patientBodyExample.createCriteria().andOutpatientNoEqualTo(visitNo).andPatientIdEqualTo(patientId) +// .andDelFlagEqualTo((byte) 0); +// List pmsPatientBodies = pmsPatientBodyMapper.selectByExample(patientBodyExample); +// if (CollUtil.isNotEmpty(pmsPatientBodies)) { +// //存在则修改 +// PmsPatientBody oldPatientBody = pmsPatientBodies.get(0); +// pmsPatientBody.setId(oldPatientBody.getId()); +// pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody); +// } else { +// //不存在则添加 +// pmsPatientBody.setId(IDGenerator.nextSnowflakeId()); +// pmsPatientBodyMapper.insertSelective(pmsPatientBody); +// } +// } else if ("PmsPatientPersonal".equals(param.getEditType())) { +// //烟酒史默认是单个信息,直接用jsonObject +// //烟酒史 +// PmsPatientPersonal pmsPatientPersonal = JSONObject.parseObject(jsonObject.toJSONString(), PmsPatientPersonal.class); +// //根据就诊号和患者id查询就诊信息是否存在 +// PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample(); +// patientPersonalExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId) +// .andDelFlagEqualTo((byte) 0); +// List pmsPatientPersonals = pmsPatientPersonalMapper.selectByExample(patientPersonalExample); +// if (CollUtil.isNotEmpty(pmsPatientPersonals)) { +// //存在则修改 +// PmsPatientPersonal oldPatientPersonal = pmsPatientPersonals.get(0); +// pmsPatientPersonal.setId(oldPatientPersonal.getId()); +// pmsPatientPersonalMapper.updateByPrimaryKeySelective(pmsPatientPersonal); +// } else { +// //不存在则添加 +// pmsPatientPersonal.setId(IDGenerator.nextSnowflakeId()); +// pmsPatientPersonalMapper.insertSelective(pmsPatientPersonal); +// } +// }else if ("PmsPatientParentIllness".equals(param.getEditType())) { +// //根据就诊号和患者id删除旧的用药信息(修改删除状态) +// PmsPatientParentIllnessExample patientParentIllnessExample = new PmsPatientParentIllnessExample(); +// patientParentIllnessExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId) +// .andDelFlagEqualTo((byte) 0); +// PmsPatientParentIllness illness = new PmsPatientParentIllness(); +// illness.setDelFlag((byte) 1); +// pmsPatientParentIllnessMapper.updateByExampleSelective(illness, patientParentIllnessExample); +// //诊断用药为多个 +// com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model); +// for (int i = 0; i < array.size(); i++) { +// PmsPatientParentIllness pmsPatientParentIllness = JSONObject.parseObject(array.getJSONObject(i).toJSONString(), PmsPatientParentIllness.class); +// pmsPatientParentIllness.setId(IDGenerator.nextSnowflakeId()); +// pmsPatientParentIllnessMapper.insertSelective(pmsPatientParentIllness); +// } +// }else if ("PmsPatientDiagnosis".equals(param.getEditType())) { +// //删除旧的诊断信息(修改删除状态) +// PmsPatientDiagnosisExample patientDiagnosisExample = new PmsPatientDiagnosisExample(); +// patientDiagnosisExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId) +// .andDelFlagEqualTo((byte) 0); +// PmsPatientDiagnosis diagnosis = new PmsPatientDiagnosis(); +// diagnosis.setDelFlag((byte) 1); +// pmsPatientDiagnosisMapper.updateByExampleSelective(diagnosis, patientDiagnosisExample); +// //诊断默认是多个信息,用jsonArray +// com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model); +// for (int i = 0; i < array.size(); i++) { +// PmsPatientDiagnosis pmsPatientDiagnosis = JSONObject.parseObject(array.getJSONObject(i).toJSONString(), PmsPatientDiagnosis.class); +// pmsPatientDiagnosis.setId(IDGenerator.nextSnowflakeId()); +// pmsPatientDiagnosisMapper.insertSelective(pmsPatientDiagnosis); +// } // } - //验证就诊号是否为空 - String visitNo = jsonObject.getString("outpatientNo"); - if (StrUtil.isEmpty(visitNo)) { - visitNo = jsonObject.getString("visitNo"); - if (StrUtil.isEmpty(visitNo)) { - throw new ServiceException("就诊号不能为空"); - } - } - //验证患者id是否为空 - Long patientId = jsonObject.getLong("patientId"); - if (patientId == null) { - throw new ServiceException("患者id不能为空"); - } - //如果是就诊信息(PmsPatientBody) - if ("PmsPatientBody".equals(param.getEditType())) { - //就诊信息默认是单个信息,直接用jsonObject - PmsPatientBody pmsPatientBody = JSONObject.parseObject(jsonObject.toJSONString(), PmsPatientBody.class); - //根据就诊号和患者id查询就诊信息是否存在 - PmsPatientBodyExample patientBodyExample = new PmsPatientBodyExample(); - patientBodyExample.createCriteria().andOutpatientNoEqualTo(visitNo).andPatientIdEqualTo(patientId) - .andDelFlagEqualTo((byte) 0); - List pmsPatientBodies = pmsPatientBodyMapper.selectByExample(patientBodyExample); - if (CollUtil.isNotEmpty(pmsPatientBodies)) { - //存在则修改 - PmsPatientBody oldPatientBody = pmsPatientBodies.get(0); - pmsPatientBody.setId(oldPatientBody.getId()); - pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody); - } else { - //不存在则添加 - pmsPatientBody.setId(IDGenerator.nextSnowflakeId()); - pmsPatientBodyMapper.insertSelective(pmsPatientBody); - } - } else if ("PmsPatientPersonal".equals(param.getEditType())) { - //烟酒史默认是单个信息,直接用jsonObject - //烟酒史 - PmsPatientPersonal pmsPatientPersonal = JSONObject.parseObject(jsonObject.toJSONString(), PmsPatientPersonal.class); - //根据就诊号和患者id查询就诊信息是否存在 - PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample(); - patientPersonalExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId) - .andDelFlagEqualTo((byte) 0); - List pmsPatientPersonals = pmsPatientPersonalMapper.selectByExample(patientPersonalExample); - if (CollUtil.isNotEmpty(pmsPatientPersonals)) { - //存在则修改 - PmsPatientPersonal oldPatientPersonal = pmsPatientPersonals.get(0); - pmsPatientPersonal.setId(oldPatientPersonal.getId()); - pmsPatientPersonalMapper.updateByPrimaryKeySelective(pmsPatientPersonal); + try { + String type = param.getEditType(); + JSONObject json = (JSONObject) JSON.toJSON(param.getModel()); + Object bean = SpringContextUtils.getBean(type.substring(0, 1).toLowerCase() + type.substring(1) + "Mapper"); + //有id则修改,无则添加 + String methodName; + String id = "id"; + String createBy = "createBy"; + String updateBy = "updateBy"; + String recorder = "recorder"; + if (json.getLong(id) == null || json.getLong(id) == 0) { + methodName = "insertSelective"; + json.put(id, IDGenerator.nextSnowflakeId()); + json.put(createBy, SecurityUtils.getUsername()); + json.put(recorder, SecurityUtils.getUserId()); } else { - //不存在则添加 - pmsPatientPersonal.setId(IDGenerator.nextSnowflakeId()); - pmsPatientPersonalMapper.insertSelective(pmsPatientPersonal); - } - }else if ("PmsPatientParentIllness".equals(param.getEditType())) { - //根据就诊号和患者id删除旧的用药信息(修改删除状态) - PmsPatientParentIllnessExample patientParentIllnessExample = new PmsPatientParentIllnessExample(); - patientParentIllnessExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId) - .andDelFlagEqualTo((byte) 0); - PmsPatientParentIllness illness = new PmsPatientParentIllness(); - illness.setDelFlag((byte) 1); - pmsPatientParentIllnessMapper.updateByExampleSelective(illness, patientParentIllnessExample); - //诊断用药为多个 - com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model); - for (int i = 0; i < array.size(); i++) { - PmsPatientParentIllness pmsPatientParentIllness = JSONObject.parseObject(array.getJSONObject(i).toJSONString(), PmsPatientParentIllness.class); - pmsPatientParentIllness.setId(IDGenerator.nextSnowflakeId()); - pmsPatientParentIllnessMapper.insertSelective(pmsPatientParentIllness); - } - }else if ("PmsPatientDiagnosis".equals(param.getEditType())) { - //删除旧的诊断信息(修改删除状态) - PmsPatientDiagnosisExample patientDiagnosisExample = new PmsPatientDiagnosisExample(); - patientDiagnosisExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId) - .andDelFlagEqualTo((byte) 0); - PmsPatientDiagnosis diagnosis = new PmsPatientDiagnosis(); - diagnosis.setDelFlag((byte) 1); - pmsPatientDiagnosisMapper.updateByExampleSelective(diagnosis, patientDiagnosisExample); - //诊断默认是多个信息,用jsonArray - com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model); - for (int i = 0; i < array.size(); i++) { - PmsPatientDiagnosis pmsPatientDiagnosis = JSONObject.parseObject(array.getJSONObject(i).toJSONString(), PmsPatientDiagnosis.class); - pmsPatientDiagnosis.setId(IDGenerator.nextSnowflakeId()); - pmsPatientDiagnosisMapper.insertSelective(pmsPatientDiagnosis); + methodName = "updateByPrimaryKeySelective"; + json.put(updateBy, SecurityUtils.getUsername()); } + log.info("{}:{}", methodName, json); + //请求参数 + Class modelClass = Class.forName("com.ccsens.system.domain.po." + type); + Object model = json.toJavaObject(modelClass); + //方法 + Method method = bean.getClass().getMethod(methodName, modelClass); + log.info("method:{}", method); + //方法调用(保存/修改) + method.invoke(bean, model); + return json.getLong("id"); + } catch (ClassNotFoundException e) { + log.error("编辑病人其他信息反射异常", e); + throw new BaseException(ErrorConstant.PARAM_ERROR); + } catch (NoSuchMethodException e) { + log.error("编辑病人其他信息反射异常", e); + throw new BaseException(ErrorConstant.PARAM_ERROR); + } catch (IllegalAccessException e) { + log.error("编辑病人其他信息反射异常", e); + throw new BaseException(ErrorConstant.PARAM_ERROR); + } catch (InvocationTargetException e) { + log.error("编辑病人其他信息反射异常", e); + throw new BaseException(ErrorConstant.PARAM_ERROR); } - - -// try { -// String type = param.getEditType(); -// JSONObject json = param.getModel(); -// Object bean = SpringContextUtils.getBean(type.substring(0, 1).toLowerCase() + type.substring(1) + "Mapper"); -// //有id则修改,无则添加 -// String methodName; -// String id = "id"; -// String createBy = "createBy"; -// String updateBy = "updateBy"; -// String recorder = "recorder"; -// if (json.getLong(id) == null || json.getLong(id) == 0) { -// methodName = "insertSelective"; -// json.put(id, IDGenerator.nextSnowflakeId()); -// json.put(createBy, SecurityUtils.getUsername()); -// json.put(recorder, SecurityUtils.getUserId()); -// } else { -// methodName = "updateByPrimaryKeySelective"; -// json.put(updateBy, SecurityUtils.getUsername()); -// } -// log.info("{}:{}", methodName, json); -// //请求参数 -// Class modelClass = Class.forName("com.ccsens.system.domain.po." + type); -// Object model = json.toJavaObject(modelClass); -// //方法 -// Method method = bean.getClass().getMethod(methodName, modelClass); -// log.info("method:{}", method); -// //方法调用(保存/修改) -// method.invoke(bean, model); -// return json.getLong("id"); -// } catch (ClassNotFoundException e) { -// log.error("编辑病人其他信息反射异常", e); -// throw new BaseException(ErrorConstant.PARAM_ERROR); -// } catch (NoSuchMethodException e) { -// log.error("编辑病人其他信息反射异常", e); -// throw new BaseException(ErrorConstant.PARAM_ERROR); -// } catch (IllegalAccessException e) { -// log.error("编辑病人其他信息反射异常", e); -// throw new BaseException(ErrorConstant.PARAM_ERROR); -// } catch (InvocationTargetException e) { -// log.error("编辑病人其他信息反射异常", e); -// throw new BaseException(ErrorConstant.PARAM_ERROR); -// } - return null; } @Override @@ -2158,7 +2150,57 @@ public class PmsPatientServiceImpl implements IPmsPatientService { @Override public List queryPatientJzList(PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) { - return patientDao.queryPatientJzList(param, dataScope, userId, userName); + List queryPatientJzs = patientDao.queryPatientJzList(param, dataScope, userId, userName); + if (CollUtil.isNotEmpty(queryPatientJzs)) { + for (PmsPatientVo.QueryPatientJz queryPatientJz : queryPatientJzs) { + //查询就诊 + //查询其他疾病史信息 + Map>> patientOtherMsg = new HashMap<>(); + //先查询就诊信息(PmsPatientBody) + //根据就诊号和患者id查询就诊信息是否存在 + String visitNo = queryPatientJz.getOutpatientNo(); + List> pmsPatientBodyReturn = new ArrayList<>(); + pmsPatientBodyReturn.add(JSON.parseObject(JSON.toJSONString(queryPatientJz), Map.class)); + patientOtherMsg.put("pmsPatientBody", pmsPatientBodyReturn); + if (visitNo != null) { + //烟酒史 + PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample(); + patientPersonalExample.createCriteria().andVisitNoEqualTo(visitNo) + .andDelFlagEqualTo((byte) 0); + List pmsPatientPersonals = pmsPatientPersonalMapper.selectByExample(patientPersonalExample); + if (CollUtil.isNotEmpty(pmsPatientPersonals)) { + String jsonStr = JSON.toJSONString(pmsPatientPersonals); + List> allList = JSON.parseObject(jsonStr, List.class); + List> singleItemList = new ArrayList<>(); + if (!allList.isEmpty()) { + singleItemList.add(allList.get(0)); + } + patientOtherMsg.put("pmsPatientPersonal", singleItemList); + } + //用药信息 + PmsPatientParentIllnessExample patientParentIllnessExample = new PmsPatientParentIllnessExample(); + patientParentIllnessExample.createCriteria().andVisitNoEqualTo(visitNo) + .andDelFlagEqualTo((byte) 0); + List pmsPatientParentIllnesses = pmsPatientParentIllnessMapper.selectByExample(patientParentIllnessExample); + if (CollUtil.isNotEmpty(pmsPatientParentIllnesses)) { + String jsonStr = JSON.toJSONString(pmsPatientParentIllnesses); + patientOtherMsg.put("pmsPatientParentIllness", JSON.parseObject(jsonStr, List.class)); + } + + //诊断信息 + PmsPatientDiagnosisExample patientDiagnosisExample = new PmsPatientDiagnosisExample(); + patientDiagnosisExample.createCriteria().andVisitNoEqualTo(visitNo) + .andDelFlagEqualTo((byte) 0); + List pmsPatientDiagnoses = pmsPatientDiagnosisMapper.selectByExample(patientDiagnosisExample); + if (CollUtil.isNotEmpty(pmsPatientDiagnoses)) { + String jsonStr = JSON.toJSONString(pmsPatientDiagnoses); + patientOtherMsg.put("pmsPatientDiagnosis", JSON.parseObject(jsonStr, List.class)); + } + } + queryPatientJz.setOtherMsg(patientOtherMsg); + } + } + return queryPatientJzs; } @Override diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/QmsScaleAssConfServiceImpl.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/QmsScaleAssConfServiceImpl.java index 2750b34..278f46b 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/QmsScaleAssConfServiceImpl.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/QmsScaleAssConfServiceImpl.java @@ -37,6 +37,8 @@ public class QmsScaleAssConfServiceImpl implements QmsScaleAssConfService { qmsScaleAssConf.setId(IdUtil.getSnowflake(1L, 1L).nextId()); qmsScaleAssConf.setCreateBy(SecurityUtils.getUsername()); qmsScaleAssConf.setCreateTime(new Date()); + + qmsScaleAssConf.setNeedPlan("1".equals(dto.getNeedPlan()) ? "1" : "0"); qmsScaleAssConfMapper.insertSelective(qmsScaleAssConf); }else { qmsScaleAssConf.setUpdateBy(SecurityUtils.getUsername()); diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/RmsServiceImpl.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/RmsServiceImpl.java index 4143d14..ff1af34 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/RmsServiceImpl.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/RmsServiceImpl.java @@ -4,33 +4,36 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HtmlUtil; +import cn.hutool.poi.excel.BigExcelWriter; +import com.ccsens.admin.persist.dao.HmsDao; import com.ccsens.admin.persist.dao.RmsDao; +import com.ccsens.admin.service.AmsReportService; import com.ccsens.admin.service.IAmsCanvasService; import com.ccsens.admin.service.IRmsService; import com.ccsens.common.config.AppConfig; import com.ccsens.common.constant.CultureEnum; import com.ccsens.common.constant.ErrorConstant; import com.ccsens.common.constant.GenConstants; -import com.ccsens.common.constant.JobEnum; import com.ccsens.common.core.redis.RedisCache; -import com.ccsens.common.enums.BaseEnum; -import com.ccsens.common.exception.ServiceException; import com.ccsens.common.exception.base.BaseException; import com.ccsens.common.utils.*; import com.ccsens.system.domain.dto.AmsDto; import com.ccsens.system.domain.dto.RmsDto; +import com.ccsens.system.domain.dto.message.MessageDto; import com.ccsens.system.domain.po.*; import com.ccsens.system.domain.vo.AmsReportVo; import com.ccsens.system.domain.vo.AmsVo; -import com.ccsens.admin.domain.vo.LdPatientExportVo; import com.ccsens.system.domain.vo.HmsVo; import com.ccsens.system.domain.vo.RmsVo; +import com.ccsens.system.domain.vo.*; +import com.ccsens.admin.domain.vo.LdPatientExportVo; import com.ccsens.system.persist.mapper.*; -import com.deepoove.poi.XWPFTemplate; -import com.deepoove.poi.data.*; import com.github.pagehelper.util.StringUtil; import com.itextpdf.text.BadElementException; import com.itextpdf.text.Image; @@ -46,16 +49,25 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.NotNull; import java.io.IOException; import java.math.BigDecimal; +import java.math.RoundingMode; import java.nio.file.Files; import java.nio.file.Paths; import java.text.DecimalFormat; +import java.time.Duration; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; -import static com.ccsens.common.constant.GenConstants.Ht.Report.MoCA_B_8; +import static com.ccsens.common.constant.GenConstants.Ht.Report.*; +import static com.ccsens.common.constant.GenConstants.Ht.Report.PSQI_RJGNZA; import static com.ccsens.common.utils.PropUtil.path; import static com.ccsens.common.utils.PropUtil.reportDomain; @@ -89,6 +101,14 @@ public class RmsServiceImpl implements IRmsService { private HmsDoctorSignMapper hmsDoctorSignMapper; @Resource private ScoreService scoreService; + @Resource + private EmsEvaluationQuestionDurationMapper emsEvaluationQuestionDurationMapper; + @Resource + private AmsReportService amsReportService; + @Resource + private QmsScaleMapper qmsScaleMapper; + @Resource + private HmsDao hmsDoctorDao; @Value("${informed.prefixWord}") private String prefixWord; @@ -112,7 +132,9 @@ public class RmsServiceImpl implements IRmsService { reportExample.createCriteria().andEvaluationIdEqualTo(dto.getEvaluationId()).andDelFlagEqualTo((byte) 0); List rmsReports = rmsReportMapper.selectByExample(reportExample); RmsReport report; - List scores; + //查询报告单关联的量表 + List scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList()); + Map reportScaleScoreMap = new HashMap<>(); if (CollUtil.isEmpty(rmsReports)) { //生成报告单 report = new RmsReport(); @@ -134,45 +156,47 @@ public class RmsServiceImpl implements IRmsService { emsEvaluation.setCompleteStatus(dto.getComplateStatus()); } emsEvaluationMapper.updateByPrimaryKeySelective(emsEvaluation); + report.setVisitNo(emsEvaluation.getVisitNo()); } rmsReportMapper.insertSelective(report); //查询报告单分数 - List reportScore = rmsDao.queryReportScore(dto.getEvaluationId(), null); - //重新封装报告单信息 - scores = getReportScores(reportScore, dto.getEvaluationId()); +// List reportScore = rmsDao.queryReportScore1(dto.getEvaluationId(), null, dto.getSex()); +// //重新封装报告单信息 +// scores = getReportScores(reportScore, dto.getEvaluationId()); if (CollUtil.isNotEmpty(scores)) { scores.forEach(score -> { + if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) { +// 添加体质辨识结论 + List reportResultList = score.getReportResultList(); + if (CollUtil.isNotEmpty(reportResultList)) { + reportResultList.forEach(reportResult -> { + reportResult.setReportId(report.getId()); + }); + } + //添加体质辨识养生建议 + List reportYsjyList = score.getReportYsjyList(); + if (CollUtil.isNotEmpty(reportYsjyList)) { + reportYsjyList.forEach(reportResult -> { + reportResult.setReportId(report.getId()); + }); + } + } //添加量表分数统计 RmsReportScaleScore reportScaleScore = new RmsReportScaleScore(); reportScaleScore.setId(IDGenerator.nextSnowflakeId()); reportScaleScore.setReportId(report.getId()); reportScaleScore.setScaleCode(score.getCode()); + reportScaleScore.setImpression(score.getImpression()); reportScaleScore.setScore(score.getScore()); rmsReportScaleScoreMapper.insertSelective(reportScaleScore); - + reportScaleScoreMap.put(score.getCode(), reportScaleScore); }); } } else { report = rmsReports.get(0); -// //查询报告单分数 -// List reportScore = rmsDao.queryReportScore(dto.getEvaluationId(), null); -// long reportId = dto.getEvaluationId(); -// //重新封装报告单信息 -// scores = getReportScores(reportScore, reportId); -// -// if (CollUtil.isNotEmpty(scores)) { -// scores.forEach(score -> { -// //查找初步印象 -// RmsReportScaleScoreExample scoreExample = new RmsReportScaleScoreExample(); -// scoreExample.createCriteria().andReportIdEqualTo(report.getId()).andScaleCodeEqualTo(score.getCode()).andDelFlagEqualTo((byte) 0); -// List rmsReportScaleScores = rmsReportScaleScoreMapper.selectByExample(scoreExample); -// if (CollUtil.isNotEmpty(rmsReportScaleScores)) { -// score.setImpression(rmsReportScaleScores.get(0).getImpression()); -// } -// }); -// } + //查找测评信息 EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); if (ObjectUtil.isNotNull(emsEvaluation)) { //修改测评的状态 @@ -182,24 +206,6 @@ public class RmsServiceImpl implements IRmsService { } } } - //每次查询报告单 都重新生成分数 - //查询报告单分数 - List reportScore = rmsDao.queryReportScore(dto.getEvaluationId(), null); - //重新封装报告单信息 - scores = getReportScores(reportScore, dto.getEvaluationId()); - - if (CollUtil.isNotEmpty(scores)) { - scores.forEach(score -> { - //查找初步印象 - RmsReportScaleScoreExample scoreExample = new RmsReportScaleScoreExample(); - scoreExample.createCriteria().andReportIdEqualTo(report.getId()).andScaleCodeEqualTo(score.getCode()).andDelFlagEqualTo((byte) 0); - List rmsReportScaleScores = rmsReportScaleScoreMapper.selectByExample(scoreExample); - if (CollUtil.isNotEmpty(rmsReportScaleScores)) { - score.setImpression(rmsReportScaleScores.get(0).getImpression()); - } - }); - } - RmsVo.ReportDetail detail = new RmsVo.ReportDetail(); //查询报告单信息和病人信息 RmsVo.ReportPatient reportPatient = rmsDao.queryReportResult(report.getId()); @@ -254,15 +260,63 @@ public class RmsServiceImpl implements IRmsService { String impression = generateImpression(score, pmsPatient.getEducationalStatus()); score.setImpression(impression); } + //查询防治计划 + QmsScaleAssConf qmsScaleAssConf = rmsDao.queryScaleAssConf(score.getCode(), score.getScore()); + if (qmsScaleAssConf != null) { + score.setResult(qmsScaleAssConf.getResult()); + score.setNeedPlan(qmsScaleAssConf.getNeedPlan()); + RmsReportScaleScore rmsReportScaleScore = reportScaleScoreMap.get(score.getCode()); + if (rmsReportScaleScore != null) { + rmsReportScaleScore.setPlan(qmsScaleAssConf.getPlan()); + rmsReportScaleScore.setNeedPlan(qmsScaleAssConf.getNeedPlan()); + rmsReportScaleScore.setResult(qmsScaleAssConf.getResult()); + rmsReportScaleScore.setScaleAssConf(qmsScaleAssConf.getId()); +// rmsReportScaleScore.setSort(); + rmsReportScaleScoreMapper.updateByPrimaryKeySelective(rmsReportScaleScore); + + } + } + //查询排序 + QmsScaleExample qmsScaleExample = new QmsScaleExample(); + qmsScaleExample.createCriteria().andCodeEqualTo(score.getCode()); + List qmsScales = qmsScaleMapper.selectByExample(qmsScaleExample); + if (CollUtil.isNotEmpty(qmsScales)) { + score.setSort(qmsScales.get(0).getSort()); + } } } + //删除延迟回忆 + Object objects = redisUtil.get("message_" + dto.getEvaluationId()); + if (objects != null) { + Set set = (Set) objects; + if (CollectionUtil.isNotEmpty(set)) { + MessageDto.QuestionInform questionInform = new MessageDto.QuestionInform(); + questionInform.setQuestionId(0L); + boolean remove = set.remove(questionInform); + } +// if (set.size() > 0) { + //list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MessageDto.QuestionInform::getQuestionId))), ArrayList::new)); + // redisUtil.set("message_" + score.getPatientReportId(), set, 7200); + redisUtil.deleteObject("message_" + dto.getEvaluationId()); +// } + } +// scores = scores.stream().sorted(Comparator.comparing(RmsVo.ReportScore::getSort)).collect(Collectors.toList()); detail.setPatient(reportPatient); detail.setScores(scores); return detail; } - + public ClientEvaVo.ReportView reportView(Long evaluationId, String code) { + ClientEvaVo.ReportView vo = rmsDao.getTzbsResult(evaluationId, code); + if (vo != null && CollectionUtil.isNotEmpty(vo.getYsfa())) { + for (ClientEvaVo.ReportView.Ysfa ysfa : vo.getYsfa()) { + //html转义 + ysfa.setYsjy(HtmlUtil.unescape(ysfa.getYsjy())); + } + } + return vo; + } private List disposeDistribution(List scoreDistributions) { int lianxian = 1; int lifangti = 2; @@ -501,7 +555,13 @@ public class RmsServiceImpl implements IRmsService { } } } - map.get(score.getParentCode()).addSub(score); + if (StrUtil.isEmpty(score.getParentCode())) { + return; + } + RmsVo.ReportScore reportScore = map.get(score.getParentCode()); + if (reportScore != null) { + reportScore.addSub(score); + } } }); @@ -521,9 +581,711 @@ public class RmsServiceImpl implements IRmsService { score.setScore(score.getScaleScore()); } }); + + + scores.forEach(score -> { + if (score.getCode().equals("CTT")) { + if (CollectionUtil.isNotEmpty(score.getSubReport())) { + score.getSubReport().forEach(sub -> { + String errorNumKey = ""; + if (sub.getCode().equals("ASJCS")) { + errorNumKey = "CTT_A_ERROR_NUMBER"; + } else if (sub.getCode().equals("BSJCS")) { + errorNumKey = "CTT_B_ERROR_NUMBER"; + } + if (StrUtil.isNotEmpty(errorNumKey)) { + //qms_question_record表中没有code字段用以标识record,此处只能先用show_title进行过滤 + AmsPatientQuestionRecordDesc desc = queryCTTRecordDesc(evaluationId, sub.getCode(), "错误数"); + sub.getRecordDescMap().put(errorNumKey, desc != null ? desc.getAnswer() : ""); + } + }); + } + } + }); + scores.forEach(score -> { + if (score.getCode().equals("PSQI")) { + initPSQI(evaluationId, score); + } + }); + + //生成中医体质辨识结果 + scores.forEach(score -> { + if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) { + score.setSubReport(new ArrayList<>()); + zytzbs(evaluationId, score); + ClientEvaVo.ReportView reportView = reportView(evaluationId, score.getCode()); + if (reportView != null) { + score.setImpression(reportView.getResult()); + score.setScore(reportView.getTotalScore()); + } + } + }); return scores; } + private List countReportResult(@NotNull Long evaId, String scaleCode) { + //1.查询体质分数(原始分) + List resultList = rmsDao.countReportResult(evaId, scaleCode); + if (CollectionUtil.isEmpty(resultList)) { + throw new BaseException("未找到体质信息"); + } + + //2.计算level和mainflag + if ("TZBS_BZ".equals(resultList.get(0).getScaleCode())) { + //标准版体质辨识 + countReportResult_TZBS_BZ(resultList); + } else if ("TZBS_LN".equals(resultList.get(0).getScaleCode())) { + //老年版体质辨识 + countReportResult_TZBS_LN(resultList); + } + + return resultList; + } + + private void countReportResult_TZBS_BZ(List resultList) { + //1.根据原始分、题目数量计算转化分 + for (ReportVo.EvaResult evaResult : resultList) { + //转化分 = [(原始分 - 条目数) / (条目数 x 4)] x 100 + evaResult.setZhScore( + NumberUtil.mul( + NumberUtil.div( + NumberUtil.sub(evaResult.getScore(), evaResult.getQuesNum()), + evaResult.getQuesNum() * 4 + ), 100 + ) + ); + } + + //2.计算平和质level + boolean other8LessThan30Flag = true, other8LessThan40Flag = true; + ReportVo.EvaResult constiAResult = null; + for (ReportVo.EvaResult r : resultList) { + if ("TZBS_BZ_A".equals(r.getConstiCode())) { + constiAResult = r; + } else { + if (r.getZhScore().compareTo(BigDecimal.valueOf(30)) >= 0) { + other8LessThan30Flag = false; + } + if (r.getZhScore().compareTo(BigDecimal.valueOf(40)) >= 0) { + other8LessThan40Flag = false; + } + } + } + if (constiAResult == null) { + throw new BaseException("系统错误,未找到平和体质"); + } + + //转化分>=60分,其他体质均<30分,是平和质 + //转化分>=60分,其他体质均<40分,基本是平和质 + //其他情况,不是平和质 + //默认为否 00是,10基本是[平和],11倾向是[偏颇],20否 + constiAResult.setConstiLevel("20"); + if (constiAResult.getZhScore().compareTo(new BigDecimal(60)) >= 0) { + if (other8LessThan30Flag) { + //是 + constiAResult.setConstiLevel("00"); + } else if (other8LessThan40Flag) { + //基本是 + constiAResult.setConstiLevel("10"); + } else { + //否 + constiAResult.setConstiLevel("20"); + } + } + + //3.计算其他体质level + for (ReportVo.EvaResult r : resultList) { + if ("TZBS_BZ_A".equals(r.getConstiCode())) { + continue; + } + if (r.getZhScore().compareTo(new BigDecimal(40)) >= 0) { + //是 + r.setConstiLevel("00"); + } else if (r.getZhScore().compareTo(new BigDecimal(30)) >= 0) { + //倾向是 + r.setConstiLevel("11"); + } else { + //否 + r.setConstiLevel("20"); + } + } + + //4.设置mainflag字段 + //优先选择平和质为主体质 + //选择偏颇体质中最高分为主体质 + //MainFlag: 0 否,1主体质,2兼夹体质 + for (ReportVo.EvaResult result : resultList) { + //先全部设置为0 + result.setMainFlag(0); + } + ReportVo.EvaResult ppResult = null; + for (ReportVo.EvaResult result : resultList) { + if (result.getConstiLevel().equals("20")) { + //设置体质标志置为0 + result.setMainFlag(0); + //跳过所有level为否的体质 + continue; + } + //先判断平和质,平和质只要不是20,总是为主体质 + if ("TZBS_BZ_A".equals(result.getConstiCode())) { + result.setMainFlag(1); + break; + } + //先把非20的所有体质都设置为兼夹体质 + result.setMainFlag(2); + //找出兼夹体质中得分最高的 + if (ppResult == null) { + ppResult = result; + } else { + if (result.getZhScore().compareTo(ppResult.getZhScore()) > 0) { + ppResult = result; + } + } + } + if (ppResult != null) { + //得分最高的兼夹体质为主体质 + ppResult.setMainFlag(1); + } + } + + private void countReportResult_TZBS_LN(List resultList) { + //1.根据原始分、题目数量计算转化分 + for (ReportVo.EvaResult evaResult : resultList) { + //转化分 = 原始分 + evaResult.setZhScore( + evaResult.getScore() + ); + } + + //2.计算平和质level + boolean other8LessThan9Flag = true, other8LessThan11Flag = true; + ReportVo.EvaResult constiAResult = null; + for (ReportVo.EvaResult r : resultList) { + if ("TZBS_LN_A".equals(r.getConstiCode())) { + constiAResult = r; + } else { + if (r.getZhScore().compareTo(BigDecimal.valueOf(9)) >= 0) { + other8LessThan9Flag = false; + } + if (r.getZhScore().compareTo(BigDecimal.valueOf(11)) >= 0) { + other8LessThan11Flag = false; + } + } + } + if (constiAResult == null) { + throw new BaseException("系统错误,未找到平和体质"); + } + + //转化分>=17分,其他体质均<9分,是平和质 + //转化分>=17分,其他体质均<11分,基本是平和质 + //其他情况,不是平和质 + //默认为否 + constiAResult.setConstiLevel("20"); + if (constiAResult.getZhScore().compareTo(new BigDecimal(17)) >= 0) { + if (other8LessThan9Flag) { + //是 + constiAResult.setConstiLevel("00"); + } else if (other8LessThan11Flag) { + //基本是 + constiAResult.setConstiLevel("10"); + } else { + //否 + constiAResult.setConstiLevel("20"); + } + } + + //3.计算其他体质level + for (ReportVo.EvaResult r : resultList) { + if ("TZBS_LN_A".equals(r.getConstiCode())) { + continue; + } + if (r.getZhScore().compareTo(new BigDecimal(11)) >= 0) { + //是 + r.setConstiLevel("00"); + } else if (r.getZhScore().compareTo(new BigDecimal(9)) >= 0) { + //倾向是 + r.setConstiLevel("11"); + } else { + //否 + r.setConstiLevel("20"); + } + } + + //4.设置mainflag字段 + //优先选择平和质为主体质 + //选择偏颇体质中最高分为主体质 + for (ReportVo.EvaResult result : resultList) { + result.setMainFlag(0); + } + ReportVo.EvaResult ppResult = null; + for (ReportVo.EvaResult result : resultList) { + if (StrUtil.isEmpty(result.getConstiLevel()) || result.getConstiLevel().equals("20")) { + //默认所有体质都置为0 + result.setMainFlag(0); + //跳过所有level为否的体质 + continue; + } + //先判断平和质 + if ("TZBS_LN_A".equals(result.getConstiCode())) { + result.setMainFlag(1); + break; + } + //先把非20的所有体质都设置为兼夹体质 + result.setMainFlag(2); + //找出兼夹体质中得分最高的 + if (ppResult == null) { + ppResult = result; + } else { + if (result.getZhScore().compareTo(ppResult.getZhScore()) > 0) { + ppResult = result; + } + } + } + if (ppResult != null) { + //得分最高的兼夹体质为主体质 + ppResult.setMainFlag(1); + } + } + private void zytzbs(Long evaluationId, RmsVo.ReportScore score) { + //3.2 生成报告单辨识结果 + List resultList = countReportResult(evaluationId, score.getCode()); + List reportResultList = CollectionUtil.newArrayList(); + for (ReportVo.EvaResult resultVo : resultList) { + //转换为RmsReportResult对象 + TzbsRmsReportResult reportResult = new TzbsRmsReportResult(); + reportResult.setResultId(IDGenerator.nextSnowflakeId()); + reportResult.setScaleCode(score.getCode()); + reportResult.setConstiCode(resultVo.getConstiCode()); + reportResult.setConstiName(resultVo.getConstiName()); + reportResult.setConstiLevel(resultVo.getConstiLevel()); + reportResult.setConstiScore(resultVo.getZhScore()); + reportResult.setMainFlag(resultVo.getMainFlag()); + reportResult.setCreateBy(SecurityUtils.getUsername()); + reportResultList.add(reportResult); + + RmsVo.ReportScore reportScore = new RmsVo.ReportScore(); + reportScore.setCode(resultVo.getConstiCode()); + reportScore.setName(resultVo.getConstiName()); + reportScore.setScore(reportResult.getConstiScore()); + score.addSub(reportScore); + } + score.setReportResultList(reportResultList); + + //3.3 生成养生建议 + List reportYsjyList = CollectionUtil.newArrayList(); + for (TzbsRmsReportResult result : reportResultList) { + if (StrUtil.isEmpty(result.getConstiLevel()) || result.getConstiLevel().equals("20")) { + continue; + } + TzbsRmsReportYsjy rmsReportYsjy = new TzbsRmsReportYsjy(); + rmsReportYsjy.setYsjyId(IDGenerator.nextSnowflakeId()); + rmsReportYsjy.setReportId(result.getReportId()); + rmsReportYsjy.setConstiCode(result.getConstiCode()); + rmsReportYsjy.setConstiName(result.getConstiName()); + rmsReportYsjy.setScaleCode(score.getCode()); + rmsReportYsjy.setConstiYsjy( + rmsDao.queryYsjy(result.getConstiCode()) + ); + reportYsjyList.add(rmsReportYsjy); + } + score.setReportYsjyList(reportYsjyList); + } + + + public AmsPatientQuestionRecordDesc queryCTTRecordDesc(long evaluationId, String cognitiveCode, String show_title) { + return rmsDao.queryCTTRecordDesc(evaluationId, cognitiveCode, show_title); + } + + private BigDecimal initPSQI(long evaluationId, RmsVo.ReportScore score) { + + //特殊处理PSQI + List r = rmsDao.queryReportAnswer(evaluationId, "PSQI"); + if (CollUtil.isEmpty(r)) { + return null; + } + List scaleAchievementList = rmsDao.getScaleAchievement(evaluationId, "PSQI", null); + if (CollUtil.isEmpty(scaleAchievementList)) { + return null; + } + Map> map = r.stream().collect(Collectors.toMap(RmsVo.ReportDetailAnswer::getParentCode, RmsVo.ReportDetailAnswer::getQuestionList)); + Map> listMap = new HashMap<>(); + List questionInfoList = new ArrayList<>(); + if (CollUtil.isNotEmpty(r)) { + for (RmsVo.ReportDetailAnswer reportDetailAnswer : r) { + questionInfoList.addAll(reportDetailAnswer.getQuestionList()); + } + } + listMap = questionInfoList.stream().collect(Collectors.toMap(RmsVo.QuestionInfo::getQuestionId, RmsVo.QuestionInfo::getAnswers)); + + final BigDecimal[] total = {new BigDecimal(0)}; + AtomicBoolean flag = new AtomicBoolean(false); + Map> finalListMap = listMap; + + if (CollUtil.isNotEmpty(score.getSubReport())) { + for (RmsVo.ReportScore reportScore : score.getSubReport()) { + switch (reportScore.getCode()) { + case PSQI_SMZL: { + flag.set(true); + BigDecimal totalScore = new BigDecimal(0); + //睡眠质量 根据条目6 计分 + List list = map.get("睡眠质量"); + if (CollUtil.isNotEmpty(list)) { + RmsVo.QuestionInfo questionInfo = list.get(0); + if (questionInfo != null) { + List answers = questionInfo.getAnswers(); + if (CollUtil.isNotEmpty(answers)) { + String answer = answers.get(0).getAnswer(); + if (StrUtil.isNotEmpty(answer)) { + switch (answer) { + case "很好(0)": + break; + case "较好(1)": + totalScore = totalScore.add(new BigDecimal(1)); + break; + case "较差(2)": + totalScore = totalScore.add(new BigDecimal(2)); + break; + case "很差(3分)": + totalScore = totalScore.add(new BigDecimal(3)); + break; + default: + reportScore.setScore(totalScore); + break; + } + } + } + } + } + total[0] = total[0].add(totalScore); + break; + } + case PSQI_RSSJ: { + flag.set(true); + //入睡时间 累加条目2和5a的计分 + // 0分(0) 1~2分(1) 3~4分(2) 5~6分(3) + try { + List list = map.get("入睡时间"); + //5a + BigDecimal totalScale = new BigDecimal(0); + RmsVo.QuestionInfo questionInfo = list.get(1); + if (CollUtil.isNotEmpty(questionInfo.getAnswers())) { + List answers = questionInfo.getAnswers(); + String answer = answers.get(0).getAnswer(); + if (StrUtil.isNotEmpty(answer)) { + totalScale = getBigDecimal(totalScale, answer); + } + } + //条目2 + RmsVo.QuestionInfo tm2 = list.get(0); + if (CollUtil.isNotEmpty(tm2.getAnswers())) { + String answer = tm2.getAnswers().get(0).getAnswer(); + if (StrUtil.isNotEmpty(answer)) { + if (StrUtil.isNotEmpty(answer)) { + switch (answer) { + case "≤15分钟(0分)": + totalScale = totalScale; + break; + case "16-30分钟(1分)": + totalScale = totalScale.add(new BigDecimal(1)); + break; + case "31-60分钟(2分)": + totalScale = totalScale.add(new BigDecimal(2)); + break; + case "≧60分钟(3分)": + totalScale = totalScale.add(new BigDecimal(3)); + break; + default: + break; + } + } + } + } + //0分(0) 1~2分(1) 3~4分(2) 5~6分(3) + if (totalScale.compareTo(new BigDecimal(0)) == 0) { + reportScore.setScore(BigDecimal.ZERO); + } else if (totalScale.compareTo(new BigDecimal(1)) == 0 || totalScale.compareTo(new BigDecimal(2)) == 0) { + reportScore.setScore(new BigDecimal(1)); + total[0] = total[0].add(new BigDecimal(1)); + } else if (totalScale.compareTo(new BigDecimal(3)) == 0 || totalScale.compareTo(new BigDecimal(4)) == 0) { + reportScore.setScore(new BigDecimal(2)); + total[0] = total[0].add(new BigDecimal(2)); + } else { + reportScore.setScore(new BigDecimal(3)); + total[0] = total[0].add(new BigDecimal(3)); + } + + } catch (Exception e) { + log.error("PSQI_RSSJ error", e); + } + break; + } + case PSQI_SMSJ: { + flag.set(true); + //睡眠时间 根据条目4计分 + //>7小时(0) 6~7 小时(不含6小时)(1) 5~6小时(含6 小时)(2) <5小时(3) + List questionInfoList1 = map.get("睡眠时间"); + if (CollUtil.isNotEmpty(questionInfoList1) && CollUtil.isNotEmpty(questionInfoList1.get(0).getRecordDescList())) { + List recordDescList = questionInfoList1.get(0).getRecordDescList(); + if (CollUtil.isNotEmpty(recordDescList)) { + RmsVo.RecordDesc rmsAnswer = recordDescList.get(0); + String answer = rmsAnswer.getAnswer(); + if (StrUtil.isNotEmpty(answer)) { + int i = Integer.parseInt(answer); + if (i > 7) { + reportScore.setScore(BigDecimal.ZERO); + } else if (i > 6) { + reportScore.setScore(new BigDecimal(1)); + total[0] = total[0].add(new BigDecimal(1)); + } else if (i > 5) { + reportScore.setScore(new BigDecimal(2)); + total[0] = total[0].add(new BigDecimal(2)); + } else { + reportScore.setScore(new BigDecimal(3)); + total[0] = total[0].add(new BigDecimal(3)); + } + } + } + } + + break; + } + case PSQI_SMXL: { + //睡眠效率 条目4(睡眠时间)/【条目3(起床时间)-条目1(上床时间)】×100% + //>85%(0) 75~84%(不含75%)(1) 65~74%(含75%)(2) <65% (3) + flag.set(true); + String tm1Answer = ""; + String tm3Answer = ""; + String tm4Answer = ""; + List questionInfoList1 = map.get("睡眠时间"); + if (CollUtil.isNotEmpty(questionInfoList1) && CollUtil.isNotEmpty(questionInfoList1.get(0).getRecordDescList())) { + List recordDescList = questionInfoList1.get(0).getRecordDescList(); + if (CollUtil.isNotEmpty(recordDescList)) { + RmsVo.RecordDesc rmsAnswer = recordDescList.get(0); + tm4Answer = rmsAnswer.getAnswer(); + } + } + List questionInfoList2 = map.get("睡眠效率"); + if (CollUtil.isNotEmpty(questionInfoList2)) { + for (RmsVo.QuestionInfo questionInfo : questionInfoList2) { + if (questionInfo.getQuestionId().equals(1930516339936595968L)) { + if (CollUtil.isNotEmpty(questionInfo.getRecordDescList())) { + tm1Answer = questionInfo.getRecordDescList().get(0).getAnswer(); + } + } + if (questionInfo.getQuestionId().equals(1930517188486238208L)) { + if (CollUtil.isNotEmpty(questionInfo.getRecordDescList())) { + tm3Answer = questionInfo.getRecordDescList().get(0).getAnswer(); + } + } + } + } + + if (StrUtil.isNotEmpty(tm1Answer) && StrUtil.isNotEmpty(tm3Answer) && StrUtil.isNotEmpty(tm4Answer)) { + // 定义时间格式解析器(支持单/双位小时) + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("H:mm"); + + // 解析时间字符串 + LocalTime start = LocalTime.parse(tm1Answer, formatter); + LocalTime end = LocalTime.parse(tm3Answer, formatter); + // 处理跨天时间差 + if (end.isBefore(start)) { + end = end.plusHours(24); // 结束时间加24小时(第二天) + } + + // 计算精确时间差 + Duration duration = Duration.between(start, end); + long hours = duration.toHours(); + if (hours == 0) { + continue; + } + BigDecimal divide = new BigDecimal(tm4Answer).divide(new BigDecimal(hours), 2, RoundingMode.HALF_UP); + if (divide.compareTo(new BigDecimal("0.85")) > 0) { + reportScore.setScore(new BigDecimal(0)); + break; + } else if (divide.compareTo(new BigDecimal("0.75")) > 0) { + reportScore.setScore(new BigDecimal(1)); + total[0] = total[0].add(new BigDecimal(1)); + break; + } else if (divide.compareTo(new BigDecimal("0.65")) > 0) { + reportScore.setScore(new BigDecimal(2)); + total[0] = total[0].add(new BigDecimal(2)); + break; + } else { + reportScore.setScore(new BigDecimal(3)); + total[0] = total[0].add(new BigDecimal(3)); + break; + } + } + break; + } + case PSQI_SMZA: { + flag.set(true); + //睡眠障碍:累加条目5b至5j的计分 + //0分(0) 1~9分(1) 10~18分(2) 19~27分(3) + BigDecimal totalScale = new BigDecimal(0); + List answerList5b = finalListMap.get(1930520792404201472L); + List answerList5c = finalListMap.get(1930520885580664832L); + List answerList5d = finalListMap.get(1930520889200349184L); + List answerList5e = finalListMap.get(1930520892358660096L); + List answerList5f = finalListMap.get(1930520895349198848L); + List answerList5g = finalListMap.get(1930520898213908480L); + List answerList5h = finalListMap.get(1930520901363830784L); + List answerList5i = finalListMap.get(1930520904048185344L); + List answerList5j = finalListMap.get(1930520907206496256L); + if (CollUtil.isNotEmpty(answerList5b)) { + totalScale = getBigDecimal(totalScale, answerList5b.get(0).getAnswer()); + } + if (CollUtil.isNotEmpty(answerList5c)) { + totalScale = getBigDecimal(totalScale, answerList5c.get(0).getAnswer()); + } + + if (CollUtil.isNotEmpty(answerList5d)) { + totalScale = getBigDecimal(totalScale, answerList5d.get(0).getAnswer()); + } + + if (CollUtil.isNotEmpty(answerList5e)) { + totalScale = getBigDecimal(totalScale, answerList5e.get(0).getAnswer()); + } + + if (CollUtil.isNotEmpty(answerList5f)) { + totalScale = getBigDecimal(totalScale, answerList5f.get(0).getAnswer()); + } + + if (CollUtil.isNotEmpty(answerList5g)) { + totalScale = getBigDecimal(totalScale, answerList5g.get(0).getAnswer()); + } + + if (CollUtil.isNotEmpty(answerList5h)) { + totalScale = getBigDecimal(totalScale, answerList5h.get(0).getAnswer()); + } + + if (CollUtil.isNotEmpty(answerList5i)) { + totalScale = getBigDecimal(totalScale, answerList5i.get(0).getAnswer()); + } + + if (CollUtil.isNotEmpty(answerList5j)) { + totalScale = getBigDecimal(totalScale, answerList5j.get(0).getAnswer()); + } + //0分(0) 1~9分(1) 10~18分(2) 19~27分(3) + if (totalScale.compareTo(new BigDecimal("19")) >= 0) { + reportScore.setScore(new BigDecimal(3)); + total[0] = total[0].add(new BigDecimal(3)); + } else if (totalScale.compareTo(new BigDecimal("10")) >= 0) { + reportScore.setScore(new BigDecimal(2)); + total[0] = total[0].add(new BigDecimal(2)); + } else if (totalScale.compareTo(new BigDecimal("1")) >= 0) { + reportScore.setScore(new BigDecimal(1)); + total[0] = total[0].add(new BigDecimal(1)); + } else { + reportScore.setScore(new BigDecimal(0)); + } + break; + } + case PSQI_CMYW: { + flag.set(true); + //催眠药物:根据条目7计分 + //无(0分) <1次/周(1分) <1次/周(1~2次/周(2分) ≧3次/周(3分) + BigDecimal totalScale = new BigDecimal(0); + List list = map.get("催眠药物"); + if (CollUtil.isNotEmpty(list) && CollUtil.isNotEmpty(list.get(0).getAnswers())) { + RmsVo.Answer answer = list.get(0).getAnswers().get(0); + BigDecimal bigDecimal = getBigDecimal(totalScale, answer.getAnswer()); + reportScore.setScore(bigDecimal); + total[0] = total[0].add(bigDecimal); + } + break; + } + case PSQI_RJGNZA: { + flag.set(true); + //日间功能障碍:累加条目8和9计分 + //0分(0) 1~2分(1) 3~4分(2) 5~6分(3) + List tm8AnswerList = finalListMap.get(1930524293037428736L); + List tm9AnswerList = finalListMap.get(1930524501783744512L); + BigDecimal totalScale = new BigDecimal(0); + if (CollUtil.isNotEmpty(tm8AnswerList)) { + String answer = tm8AnswerList.get(0).getAnswer(); + if (StrUtil.isNotEmpty(answer)) { + switch (answer) { + case "无(0分)": + break; + case "<1次/周(1分)": + totalScale = totalScale.add(new BigDecimal(1)); + break; + case "<1次/周(1~2次/周(2分)": + totalScale = totalScale.add(new BigDecimal(2)); + break; + case "≧3次/周(3分)": + totalScale = totalScale.add(new BigDecimal(3)); + break; + default: + break; + } + } + } + if (CollUtil.isNotEmpty(tm9AnswerList)) { + String answer = tm9AnswerList.get(0).getAnswer(); + if (StrUtil.isNotEmpty(answer)) { + switch (answer) { + case "没有(0分)": + break; + case "偶尔有(1分)": + totalScale = totalScale.add(new BigDecimal(1)); + break; + case "有时有(2分)": + totalScale = totalScale.add(new BigDecimal(2)); + break; + case "经常有(3分)": + totalScale = totalScale.add(new BigDecimal(3)); + break; + default: + break; + } + } + } + //0分(0) 1~2分(1) 3~4分(2) 5~6分(3) + if (totalScale.compareTo(new BigDecimal("5")) >= 0) { + reportScore.setScore(new BigDecimal(3)); + total[0] = total[0].add(new BigDecimal(3)); + } else if (totalScale.compareTo(new BigDecimal("3")) >= 0) { + reportScore.setScore(new BigDecimal(2)); + total[0] = total[0].add(new BigDecimal(2)); + } else if (totalScale.compareTo(new BigDecimal("1")) >= 0) { + reportScore.setScore(new BigDecimal(1)); + total[0] = total[0].add(new BigDecimal(1)); + } else { + reportScore.setScore(new BigDecimal(0)); + } + break; + } + default: + break; + } + } + } + if (flag.get()) { + score.setScore(total[0]); + } + return total[0]; + } + + private static BigDecimal getBigDecimal(BigDecimal totalScale, String answer) { + if (StrUtil.isNotEmpty(answer)) { + switch (answer) { + case "无(0分)": + return totalScale; + case "<1次/周(1分)": + return totalScale.add(new BigDecimal(1)); + case "<1次/周(1~2次/周(2分)": + return totalScale.add(new BigDecimal(2)); + case "≧3次/周(3分)": + return totalScale.add(new BigDecimal(3)); + default: + return totalScale; + } + } + return totalScale; + } + @Override public List queryReportListByTime(RmsDto.QueryReportHistory dto, Long userId, String dataScope) { return rmsDao.queryReportListByTime(dto.getPatientId(), dto.getSearchValue(), userId, SecurityUtils.getUsername(), dataScope); @@ -535,7 +1297,7 @@ public class RmsServiceImpl implements IRmsService { } @Override - public List queryReportListCopyClient(RmsDto.QueryReportHistory dto, Long userId, String dataScope) { + public List queryReportListCopyClient(RmsDto.QueryReportList dto, Long userId, String dataScope) { return rmsDao.queryReportListCopyClient(dto, userId, SecurityUtils.getUsername(), dataScope); } @@ -938,6 +1700,105 @@ public class RmsServiceImpl implements IRmsService { } } + @Override + public String queryPdfUrl(RmsDto.queryPdfUrl dto) { + RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId()); + if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getUrl())) { + return report.getUrl(); + } + String url = ""; + //根据医生id查找医生的签名id + if(ObjectUtil.isNotNull(dto.getAssessorId())){ + List querySigns = hmsDoctorDao.querySign(dto.getAssessorId()); + if(CollUtil.isNotEmpty(querySigns)){ + //生成文件 + RmsDto.ExportReport1Dto exportReport1Dto = new RmsDto.ExportReport1Dto(); + exportReport1Dto.setReportId(dto.getReportId()); + exportReport1Dto.setEvaluationId(dto.getEvaluationId()); + exportReport1Dto.setSignId(querySigns.get(0).getSignId()); + exportReport1Dto.setTesterId(dto.getAssessorId()); + AmsReportVo.Result result = amsReportService.exportYs(exportReport1Dto); + url = result.getPath(); + } + } + return url; + } + + @Override + public List queryReportList(RmsDto.ReportQuery param, Long userId) { + return rmsDao.queryReport(param); + } + + @Override + public void exportEvaluation(RmsDto.ReportQuery param, HttpServletResponse response) throws IOException { + List reports = queryReportList(param, null); + if (CollUtil.isEmpty(reports)) { + return; + } + BigExcelWriter bigExcelWriter = new BigExcelWriter(); + List header = new ArrayList<>( + Arrays.asList( + "医院名称", + "姓名", + "性别", + "身高", + "体重", + "腰围", + "收缩压", + "舒张压", + "静息心率", + "受试的视觉功能是否正常", + "受试的听觉功能是否正常", + "门诊号/住院号", + "科室", + "医生", + "入院日期", + "入院次数", + "入院途径", + "入院途径其他", + "床位号", + "出院日期", + "离院方式", + "T值", + "体温", + "收缩压", + "舒张压", + "脉搏", + "肌酐", + "血氧饱和度", + "白蛋白", + "总蛋白", + "维生素D3测定", + "凝血酶原时间", + "D-二聚体" + ) + ); + bigExcelWriter.writeHeadRow(header); + int row = 0; + for (int i = 0; i < reports.size(); i++) { + bigExcelWriter.writeCellValue(0, row, reports.get(i).getVisitNo()); + + } + String filename = StrUtil.format("患者就诊记录-{}.xlsx", DateUtil.date().toString("yyyyMMdd")); + + //response为HttpServletResponse对象 + response.setContentType("application/vnd.ms-excel;charset=utf-8"); + //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码 + response.setHeader("Content-Disposition", "attachment;filename=" + filename); + ServletOutputStream out = null; + try { + out = response.getOutputStream(); + bigExcelWriter.flush(out); + } catch (IOException e) { + e.printStackTrace(); + } finally { + // 关闭writer,释放内存 + bigExcelWriter.close(); + //此处记得关闭输出Servlet流 + IoUtil.close(out); + } + } + private void dealMMSEScored(List analyses) { analyses.forEach(analyse -> { List mmseScores = analyse.getMmseScores(); diff --git a/ruisi_java/ruisi-web-admin/src/main/resources/application-dev.yml b/ruisi_java/ruisi-web-admin/src/main/resources/application-dev.yml index 4e26ec1..32e93ff 100644 --- a/ruisi_java/ruisi-web-admin/src/main/resources/application-dev.yml +++ b/ruisi_java/ruisi-web-admin/src/main/resources/application-dev.yml @@ -8,7 +8,7 @@ spring: master: url: jdbc:mysql://localhost:3306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: q7510327 + password: 123456 # url: jdbc:mysql://localhost:3306/htage2023?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # username: root # password: 123456 @@ -112,6 +112,9 @@ file: ldExportDir: D:\\home\\ruisi\\server\\profile\\ldExport ldZQTYDir: D:\\home\\ruisi\\server\\profile\\ldZQTYExport ldZQTYTemplate: D:\\home\\ruisi\\server\\profile\\upload\\2024年河津流调知情同意书模板-V1.docx + grPath: /data/cgav2/server/profile/grReportTemplate.docx + ysPath: /data/cgav2/server/profile/ysReportTemplate.docx + informed: studySign: /home/ruisi/server/profile/studySign.png template: /home/ruisi/server/profile/知情同意模板.docx diff --git a/ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml b/ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml index 2c51e55..ed96263 100644 --- a/ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml +++ b/ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml @@ -102,13 +102,17 @@ file: path: /data/cgav2/profile/ #domain: https://api.ccsens.com/test/ domain: http://116.204.40.58/ruisiClient - imgDomain: https://test.tall.wiki/htageClient/profile - reportPath: /data/cgav2 - ldTemplate: /data/cgav2/profile/upload/dTemplate.xlsx - ldTjbgDir: /data/cgav2/profile/tjbg/ - ldExportDir: /data/cgav2/profile/ldExport - ldZQTYDir: /data/cgav2/profile/ldZQTYExport - ldZQTYTemplate: /data/cgav2/profile/upload/2024年河津流调知情同意书模板-V1.docx + imgDomain: http://116.204.40.58/ruisiClient/profile + reportDomain: /data/cgav2/server/profile + reportPath: /data/cgav2/server/profile + ldTemplate: /data/cgav2/server/profile/upload/dTemplate.xlsx + ldTjbgDir: /data/cgav2/server/profile/tjbg/ + ldExportDir: /data/cgav2/server/profile/ldExport + ldZQTYDir: /data/cgav2/server/profile/ldZQTYExport + ldZQTYTemplate: /data/cgav2/server/profile/upload/2024年河津流调知情同意书模板-V1.docx + grPath: /data/cgav2/server/profile/grReportTemplate.docx + ysPath: /data/cgav2/server/profile/ysReportTemplate.docx + informed: studySign: /data/cgav2/profile/studySign.png template: /data/cgav2/profile/知情同意模板.docx diff --git a/ruisi_java/ruisi-web-admin/src/main/resources/application-stage.yml b/ruisi_java/ruisi-web-admin/src/main/resources/application-stage.yml index 155a08f..83f71a8 100644 --- a/ruisi_java/ruisi-web-admin/src/main/resources/application-stage.yml +++ b/ruisi_java/ruisi-web-admin/src/main/resources/application-stage.yml @@ -98,16 +98,21 @@ ht: patientUrl: https://test.tall.wiki/ruisi/client/# name: 认知功能评测云平台系统 file: - path: /home/cloud/ht/uploads/ - #domain: https://api.ccsens.com/test/ - domain: https://test.tall.wiki/ruisiClient - imgDomain: https://test.tall.wiki/htageClient/profile - reportPath: /home/ruisiCga/server ldTemplate: /home/ruisiCga/server/profile/upload/dTemplate.xlsx ldTjbgDir: /home/ruisiCga/server/profile/tjbg/ ldExportDir: /home/ruisiCga/server/profile/ldExport ldZQTYDir: /home/ruisiCga/server/profile/ldZQTYExport ldZQTYTemplate: /home/ruisiCga/server/profile/upload/2024年河津流调知情同意书模板-V1.docx + path: D:/Projects/ruisi_cga/server/profile/ + webPath: https://test.tall.wiki/ruisi/client/# + #domain: https://api.ccsens.com/test/ + domain: https://test.tall.wiki/ruisiClient + imgDomain: https://test.tall.wiki/ruisiClient/profile + reportDomain: D:/Projects/ruisi_cga/server/profile + reportPath: D:/Projects/ruisi_cga/server/profile + grPath: D:/Projects/ruisi_cga/server/profile/grReportTemplate.docx + ysPath: D:/Projects/ruisi_cga/server/profile/ysReportTemplate.docx + informed: studySign: /home/ruisi/server/profile/studySign.png template: /home/ruisi/server/profile/知情同意模板.docx diff --git a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/AmsDao.xml b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/AmsDao.xml new file mode 100644 index 0000000..e382b9e --- /dev/null +++ b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/AmsDao.xml @@ -0,0 +1,241 @@ + + + + + update + ams_patient_answer_score + set + del_flag = 1 + where id in + + #{score.id} + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/HmsDao.xml b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/HmsDao.xml index a50f544..a85cd08 100644 --- a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/HmsDao.xml +++ b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/HmsDao.xml @@ -21,6 +21,7 @@ FROM ums_dept ud LEFT JOIN hms_hospital_config hc ON ud.dept_id = hc.hospital_id + LEFT JOIN ums_user uu ON uu.dept_id = ud.dept_id WHERE ud.del_flag = 0 and ud.parent_id = 0 @@ -114,4 +115,12 @@ order by c.hospital_id,c.create_time desc + + \ No newline at end of file diff --git a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml index cc970ad..df9dac9 100644 --- a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml +++ b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml @@ -121,6 +121,39 @@ and pp.hospital_id = #{param.hospitalId} + + + and pp.sex = #{param.sex} + + + and pp.hospital_id = #{param.deptId} + + + and pp.educational_status = #{param.educationalStatus} + + + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) < 60 + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 60 AND 69 + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 70 AND 79 + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 80 AND 89 + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) >= 90 + + @@ -233,6 +266,22 @@ left join pms_patient p on b.patient_id = p.id b.del_flag = 0 and p.del_flag = 0 + + and b.visit_type = #{param.visitType} + + + and b.patient_id = #{param.patientId} + + + and b.diagnosis_date between #{param.beginTime} and #{param.endTime} + + + and p.dept_id = #{param.deptId} + + + and b.diagnosis_code like concat('%',#{param.diagnosisCode},'%') + + order by b.id desc \ No newline at end of file diff --git a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml index 3ce2c63..3e32ccc 100644 --- a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml +++ b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml @@ -4,48 +4,43 @@ update rms_report_scale_score set impression = #{initialImpression} - where - report_id = #{reportId} + where report_id = #{reportId} and scale_code = #{scaleCode} SELECT -- rr.id, - ee.id as evaluationId, +ee.id as evaluationId, -- rr.`name`, - pp.id as patientId, - ee.serial_number as serialNumber, +pp.id as patientId, +ee.serial_number as serialNumber, -- rr.report_time as reportTime, - ee.check_time as checkTime, +ee.check_time as checkTime, -- rr.url, -- rr.remark, -- rr.initial_impression as initialImpression, @@ -67,46 +62,40 @@ -- rr.pasi, -- rr.department, -- rr.bed_number as bedNumber, - pp.`name` as patientName, - pp.patient_number as patientNumber, - pp.hospital_number as hospitalNumber, - pp.sex, - pp.educational_status as educationalStatus, - pp.educational_status_unit as educationalStatusUnit, - pp.career, - pp.idcard, +pp.`name` as patientName, +pp.patient_number as patientNumber, +pp.hospital_number as hospitalNumber, +pp.sex, +pp.educational_status as educationalStatus, +pp.educational_status_unit as educationalStatusUnit, +pp.career, +pp.idcard, -- pp.contact, - pp.nation, - pp.mobile as contact, +pp.nation, +pp.mobile as contact, - ee.hospital, - d.dept_name as hospitalName - FROM - ems_evaluation ee +ee.hospital, +d.dept_name as hospitalName + FROM ems_evaluation ee -- LEFT JOIN rms_report rr on ee.id = rr.evaluation_id - LEFT JOIN pms_patient pp on ee.patient_id = pp.id - left join ums_dept d on ee.hospital = d.dept_id - WHERE - ee.id = #{evaluationId} + LEFT JOIN pms_patient pp on ee.patient_id = pp.id + left join ums_dept d on ee.hospital = d.dept_id + WHERE ee.id = #{evaluationId} and ee.del_flag = 0 --- and rr.del_flag = 0 + -- and rr.del_flag = 0 -- and pp.del_flag = 0 @@ -346,121 +330,94 @@ - - - + + + - - - - - - - - - - - + + + + + + + + + + + @@ -572,66 +529,65 @@ a.operateType, a.optionName, t.answer, - epr.path as recordingPath, + epr.path as recordingPath, t.optionId, r.record_value as otherValue - FROM ( - SELECT - qq.id as questionId, + FROM (SELECT qq.id as questionId, qq.scale_code, if(qcd.id is null, qs.`name`, qcd.`name`) as parentCode, - qq.question as questionName, - qq.type as type, - qq.operate_type as operateType - ,qo.`name` as optionName - ,qo.id as optionId - ,qo.sort - ,GROUP_CONCAT(sq.id SEPARATOR ',') as subList - FROM - qms_question qq - LEFT JOIN ( - SELECT - eqv.id as qvId, - Max(vq.version) as maxVersion, - q.id, - q.scale_code - FROM - qms_question q - LEFT JOIN qms_question vq on q.scale_code = vq.scale_code and q.sort = vq.sort and vq.del_flag = 0 - LEFT JOIN ems_evaluation_question_version eqv on eqv.scale_code = q.scale_code and eqv.sort = q.sort and eqv.version = q.version and eqv.evaluation_id = #{evaluationId} - GROUP BY - q.id - )vq on qq.id = vq.id - LEFT JOIN qms_cognitive_domain qcd on qq.cognitive_code = qcd.code and qcd.del_flag = 0 - LEFT JOIN qms_scale qs on qq.cognitive_code = qs.code and qs.del_flag = 0 - LEFT JOIN qms_question_option qo on qq.id = qo.question_id and qo.del_flag = 0 - LEFT JOIN qms_question sq on sq.relation_id = qq.id and sq.del_flag = 0 - WHERE - qq.scale_code = #{evaluationCode} - and qq.del_flag = 0 - and qo.del_flag = 0 - and qq.relation_id = 0 - and ((vq.maxVersion = 1 and vq.qvId is null) or (vq.maxVersion > 1 and vq.qvId is not null)) - GROUP BY qq.id, qo.`name` - ) a + qq.question as questionName, + qq.type as type, + qq.operate_type as operateType + , + qo.`name` as optionName + , + qo.id as optionId + , + qo.sort + , + GROUP_CONCAT(sq.id SEPARATOR ',') as subList + FROM qms_question qq + LEFT JOIN (SELECT eqv.id as qvId, + Max(vq.version) as maxVersion, + q.id, + q.scale_code + FROM qms_question q + LEFT JOIN qms_question vq + on q.scale_code = vq.scale_code and q.sort = vq.sort and vq.del_flag = 0 + LEFT JOIN ems_evaluation_question_version eqv + on eqv.scale_code = q.scale_code and eqv.sort = q.sort and + eqv.version = q.version and eqv.evaluation_id = #{evaluationId} + GROUP BY q.id) vq on qq.id = vq.id + LEFT JOIN qms_cognitive_domain qcd on qq.cognitive_code = qcd.code and qcd.del_flag = 0 + LEFT JOIN qms_scale qs on qq.cognitive_code = qs.code and qs.del_flag = 0 + LEFT JOIN qms_question_option qo on qq.id = qo.question_id and qo.del_flag = 0 + LEFT JOIN qms_question sq on sq.relation_id = qq.id and sq.del_flag = 0 + WHERE qq.scale_code = #{evaluationCode} + and qq.del_flag = 0 + and qo.del_flag = 0 + and qq.relation_id = 0 + and ((vq.maxVersion = 1 and vq.qvId is null) or (vq.maxVersion > 1 and vq.qvId is not null)) + GROUP BY qq.id, qo.`name`) a LEFT JOIN (SELECT * FROM ams_patient_question_record WHERE evaluation_id = #{evaluationId} and del_flag = 0) r on r.question_id = a.questionId LEFT JOIN (SELECT s.id, s.question_id, - o.id as optionId, - o.`name` as optionName, - IF ( o.type = 'hidden', s.score, if(o.type in ('numberScore','numberTime'), CONCAT(o.display,':',s.score), o.display) ) AS answer - FROM - ams_patient_answer_score s - LEFT JOIN qms_question_option o on s.option_id = o.id - WHERE - s.evaluation_id = #{evaluationId} + o.id as optionId, + o.`name` as optionName, + IF(o.type = 'hidden', s.score, + if(o.type in ('numberScore', 'numberTime'), CONCAT(o.display, ':', s.score), + o.display)) AS answer + FROM ams_patient_answer_score s + LEFT JOIN qms_question_option o on s.option_id = o.id + WHERE s.evaluation_id = #{evaluationId} and s.del_flag = 0 - and o.del_flag = 0) t on a.optionName = t.optionName and (a.questionId = t.question_id or FIND_IN_SET(t.question_id, a.subList)) + and o.del_flag = 0) t + on a.optionName = t.optionName and (a.questionId = t.question_id or FIND_IN_SET(t.question_id, a.subList)) - LEFT JOIN ems_patient_recording epr on epr.question_id = a.questionId and epr.evaluation_id =#{evaluationId} + LEFT JOIN ems_patient_recording epr + on epr.question_id = a.questionId and epr.evaluation_id = #{evaluationId} ORDER BY a.questionId, a.sort @@ -648,25 +604,22 @@ - select t1.code,t1.name, t1.description, t1.total_score, t1.remark,t1.type,t1.parent_code, - sum( t3.score ) as score - from - ( - SELECT - qs.code, - qs.name, - qs.description, - qs.total_score, - qs.remark, - 2 as type, - qs.parent_code, - qs.sort - FROM - qms_scale qs - WHERE - qs.`code` = #{code} - UNION - select code,name, description, total_score, remark, type, parent_code, sort from ( - select t1.*, if (find_in_set(t1.parent_code, @pcode) > 0 or t1.code = @pcode, @pcode := concat(@pcode,',',t1.code) ,0 )as ischild - from - (select * from qms_cognitive_domain where is_show = 1 and del_flag = 0 - ORDER BY type, sort) t1 , - (select @pcode:=#{code} ) t2 - ) t where ischild != '0' - ) t1 - left join qms_question q on t1.code = q.scale_code and q.del_flag = 0 - left join ams_patient_answer_score t2 - on q.id = t2.question_id and - ( - (t2.evaluation_id = #{evaluationId} and t2.type in (0,2) and t2.del_flag = 0) or t2.id is null - ) - LEFT JOIN ( - SELECT - pas.score, - qq.cognitive_code - FROM - ams_patient_answer_score pas - LEFT JOIN qms_question qq ON pas.question_id = qq.id - WHERE - pas.evaluation_id = #{evaluationId} - AND pas.type IN ( 0, 2 ) - AND pas.del_flag = 0 - ) t3 ON t1.CODE = t3.cognitive_code + select t1.code, + t1.name, + t1.description, + t1.total_score, + t1.remark, + t1.type, + t1.parent_code, + sum(t3.score) as score + from (SELECT qs.code, + qs.name, + qs.description, + qs.total_score, + qs.remark, + 2 as type, + qs.parent_code, + qs.sort + FROM qms_scale qs + WHERE qs.`code` = #{code} + UNION + select code, + name, + description, + total_score, + remark, + type, + parent_code, + sort + from (select t1.*, + if(find_in_set(t1.parent_code, @pcode) > 0 or t1.code = @pcode, + @pcode := concat(@pcode,',',t1.code), 0) as ischild + from (select * + from qms_cognitive_domain + where is_show = 1 + and del_flag = 0 + ORDER BY type, sort) t1, + (select @pcode:=#{code}) t2) t + where ischild != '0') t1 + left join qms_question q on t1.code = q.scale_code and q.del_flag = 0 + left join ams_patient_answer_score t2 + on q.id = t2.question_id and + ( + (t2.evaluation_id = #{evaluationId} and t2.type in (0, 2) and t2.del_flag = 0) or + t2.id is null + ) + LEFT JOIN (SELECT pas.score, + qq.cognitive_code + FROM ams_patient_answer_score pas + LEFT JOIN qms_question qq ON pas.question_id = qq.id + WHERE pas.evaluation_id = #{evaluationId} + AND pas.type IN (0, 2) + AND pas.del_flag = 0) t3 ON t1.CODE = t3.cognitive_code GROUP BY t1.code - order by t1.type,t1.sort + order by t1.type, t1.sort @@ -789,7 +746,7 @@ LEFT JOIN rms_report rr ON rr.id = rss.report_id LEFT JOIN ems_evaluation ee ON rr.evaluation_id = ee.id WHERE - rss.scale_code = #{code} + rss.scale_code = #{code} AND rss.del_flag = 0 AND ee.patient_id = #{patientId} WINDOW w AS ( @@ -823,8 +780,8 @@ ams_patient_answer_score s where - e.id = r.evaluation_id, - e.patient_id = p.id + e.id = r.evaluation_id, + e.patient_id = p.id AND e.id = s.evaluation_id AND qs.CODE = q.evaluation_code @@ -910,9 +867,10 @@ SELECT - rr.id as reportId, - ee.id as evaluationId, - ee.create_time as evaluationTime, - uu.user_id as testerId, - uu.nick_name as testerName, - ee.doctor_name as doctorName, - pp.id as patientId, - pp.`name`, + rr.id as evaluationId, + pp.name, pp.sex, - ee.patient_age as age, - pp.mobile as phone, - pp.idcard as idCard, - ee.complete_status as completeStatus, - ee.status, - - ee.duration, - a.update_time as aduitTime + pb.outpatient_no as outpatientNo, + pb.department as department, + pb.doctor, + hv.version as versionName, + uu.nick_name as testerName, + FROM_UNIXTIME(rr.report_time / 1000, '%Y-%m-%d') as evaluationTime, + ee.complete_status as completeStatus FROM - ems_evaluation ee - left join ams_patient_answer_score aas on ee.id = aas.evaluation_id - LEFT JOIN rms_report rr on rr.evaluation_id = ee.id - LEFT JOIN pms_patient pp on ee.patient_id = pp.id + rms_report rr + Left Join pms_patient_body pb on rr.visit_no = pb.outpatient_no + LEFT JOIN pms_patient pp on pb.patient_id = pp.id + left join ems_evaluation ee on rr.evaluation_id = ee.id + LEFT JOIN hms_version hv on ee.version = hv.id LEFT JOIN ums_user uu on ee.tester_id = uu.user_id - LEFT JOIN ems_evaluation_aduit a on ee.id = a.evaluation_id and a.del_flag = 0 - WHERE ee.del_flag = 0 - and pp.id is not null - - and aas.del_flag = 0 - and ee.complete_status = #{dto.completeStatus} - - and uu.nick_name = #{dto.testerName} + + AND rr.create_time >= #{dto.beginTime} + + AND rr.create_time <= #{dto.endTime} + + + and ee.tester_id = #{dto.testerId} + + + and ee.version = #{dto.version} + + + and uu.dept_id = #{dto.deptId} + + and ( pp.name like CONCAT('%',#{dto.searchValue},'%') @@ -1131,8 +1055,6 @@ pp.name_initial like CONCAT('%',LOWER(#{dto.searchValue}),'%') or pp.name_full like CONCAT('%',LOWER(#{dto.searchValue}),'%') - or - pp.idcard like CONCAT('%',#{dto.searchValue},'%') ) @@ -1153,8 +1075,8 @@ ) - group by ee.id - order by ee.create_time desc + group by rr.id + order by rr.create_time desc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsController.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsController.java index a1d82e1..8d7fbf4 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsController.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsController.java @@ -143,6 +143,13 @@ public class AmsController extends BaseController { return JsonResponse.ok(scaleAchievement); } + //查询测评下某个量表的完成情况 + @ApiOperation(value = "测评结论", notes = "测评结论 (计算分数)") + @PostMapping("/queryConclusion") + public JsonResponse> queryConclusion(@RequestBody @ApiParam @Valid AmsDto.ScaleAchievement queryDto) { + List scaleAchievement = amsService.queryConclusion(queryDto); + return JsonResponse.ok(scaleAchievement); + } @ApiOperation(value = "删除画图轨迹",notes = "zy:删除画图的轨迹,可以一次删除多条") @RequestMapping(value="/delCanvas", method = RequestMethod.POST) diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsReportTemplateController.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsReportTemplateController.java index 823045f..1b03ad7 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsReportTemplateController.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsReportTemplateController.java @@ -56,11 +56,18 @@ public class AmsReportTemplateController { @Anonymous @ApiOperation("导出医生版报告") - @PostMapping("/exportYs") + @PostMapping("/exportYs1") public JsonResponse exportYs(@RequestBody @Validated RmsDto.ExportReport1Dto dto){ return JsonResponse.ok(amsReportService.exportYs(dto)); } + @Anonymous + @ApiOperation("导出医生版报告") + @PostMapping("/exportYs") + public JsonResponse exportYs1(@RequestBody @Validated RmsDto.ExportReport1Dto dto){ + return JsonResponse.ok(amsReportService.exportYs1(dto)); + } + @Anonymous @ApiOperation("导出阳性版报告") @PostMapping("/exportYx") diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/EmsController.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/EmsController.java index 19967c2..00a766d 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/EmsController.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/EmsController.java @@ -129,4 +129,10 @@ public class EmsController extends BaseController { public JsonResponse delete(@RequestBody @ApiParam @Valid EmsDto.Delete dto){ return JsonResponse.ok(emsService.delete(dto.getIdList())); } + + @ApiOperation(value = "撤回测评") + @PostMapping("/revoke") + public JsonResponse revoke(@RequestBody @ApiParam @Valid EmsDto.Complate dto){ + return JsonResponse.ok(emsService.revoke(dto.getEvaluationId())); + } } diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/RmsController.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/RmsController.java index 9a9e071..c51a0dc 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/RmsController.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/RmsController.java @@ -57,6 +57,15 @@ public class RmsController extends BaseController { return JsonResponse.ok(detail); } + @Anonymous + @ApiOperation(value = "查询报告单详情",notes = "根据测评ID查询报告单详情") + @PostMapping(value="/queryReport") + public JsonResponse queryReport(@RequestBody @ApiParam @Valid RmsDto.QueryDetail dto){ + log.info("生成报告单请求参数:{}", dto); + RmsVo.ReportDetail detail = rmsService.queryReport(dto); + return JsonResponse.ok(detail); + } + //查询报告单列表 @ApiOperation(value = "查询报告单列表(按日期)",notes = "根据测评ID查询报告单列表") @PostMapping(value="/queryReportListByTime") diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java index 0d63ca7..bea9fb1 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java @@ -24,13 +24,13 @@ public class SyncHospitalData { private DockService dockService; @DataSource(value = DataSourceType.SLAVE) - @Scheduled(cron = "0 */1 * * * ?") +// @Scheduled(cron = "0 */1 * * * ?") public void syncHospitalData() { dockService.syncHospitalData(); } @DataSource(value = DataSourceType.SLAVE) - @Scheduled(cron = "0 */1 * * * ?") +// @Scheduled(cron = "0 */1 * * * ?") public void syncDeptData() { try { List sysDepts = dockService.syncUmsDeptSlave(); @@ -48,7 +48,7 @@ public class SyncHospitalData { @DataSource(value = DataSourceType.SLAVE) - @Scheduled(cron = "0 */1 * * * ?") +// @Scheduled(cron = "0 */1 * * * ?") public void syncUserData() { try { List sysUsers = dockService.syncUmsUserSlave(); diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/EmsDao.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/EmsDao.java new file mode 100644 index 0000000..6c54df7 --- /dev/null +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/EmsDao.java @@ -0,0 +1,23 @@ +package com.ccsens.client.persist.dao; + +import com.ccsens.system.domain.vo.RmsVo; + +import java.util.List; + +/** + * @Author zzc + * @Package com.ccsens.client.persist.dao + * @Date 2026/2/28 9:30 + * @description: + */ +public interface EmsDao { + + /** + * 查询报告分数 + * @param reportScores + * @param evaluation + * @return + */ + List queryReportScore(List reportScores, long evaluation); + +} diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/RmsDao.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/RmsDao.java index 4db73a9..959945f 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/RmsDao.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/RmsDao.java @@ -133,4 +133,8 @@ public interface RmsDao { List queryCodeByScCode(@Param("list")List list); + List queryEmsScaleScore(@Param("evaluationId") Long evaluationId, + @Param("scaleCodeList") List scaleCodeList); + + List queryReportExportInfo(@Param("evaluationId") Long evaluationId); } diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/AmsReportService.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/AmsReportService.java index debd5cb..82a829e 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/AmsReportService.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/AmsReportService.java @@ -29,6 +29,7 @@ public interface AmsReportService { */ AmsReportVo.Result exportYs(RmsDto.ExportReport1Dto dto); + AmsReportVo.Result exportYs1(RmsDto.ExportReport1Dto dto); /** * 导出阳性报告 * @param dto diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IAmsService.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IAmsService.java index ca3766b..8556d58 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IAmsService.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IAmsService.java @@ -35,6 +35,7 @@ public interface IAmsService { List getScaleAchievement(AmsDto.ScaleAchievement queryDto); + List queryConclusion(AmsDto.ScaleAchievement queryDto); Integer deleteRedis(Long questionId, Long evaluationId); List queryOptionJson(AmsDto.QueryPatientCanvas queryDto); diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IEmsService.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IEmsService.java index 2e6f4cf..50fc4b0 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IEmsService.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IEmsService.java @@ -38,4 +38,7 @@ public interface IEmsService { Integer complate(Long evaluationId, Byte complateStatus); Integer delete(List idList); + + Integer revoke(Long evaluationId); + } diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IRmsService.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IRmsService.java index 8e78885..80f3f79 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IRmsService.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IRmsService.java @@ -15,6 +15,10 @@ import java.util.List; public interface IRmsService { RmsVo.ReportDetail queryReportDetail(RmsDto.QueryDetail dto); + RmsVo.ReportDetail queryReport(RmsDto.QueryDetail dto); + + List buildReportScoreTree(List allReportScores, Long rootParentId); + /** * 查看报告单 * @param param diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsReportServiceImpl.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsReportServiceImpl.java index 07c0d33..3c9b6b3 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsReportServiceImpl.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsReportServiceImpl.java @@ -10,6 +10,7 @@ import cn.hutool.http.HtmlUtil; import com.ccsens.client.persist.dao.AmsDao; import com.ccsens.client.persist.dao.ClientEvaDao; import com.ccsens.client.persist.dao.HmsDoctorDao; +import com.ccsens.client.persist.dao.RmsDao; import com.ccsens.client.service.AmsReportService; import com.ccsens.client.service.IReportInfoService; import com.ccsens.client.service.IRmsService; @@ -63,6 +64,8 @@ public class AmsReportServiceImpl implements AmsReportService { @Resource private IRmsService rmsService; @Resource + private RmsDao rmsDao; + @Resource private RmsReportMapper rmsReportMapper; @Resource private QmsScaleMapper qmsScaleMapper; @@ -605,9 +608,16 @@ public class AmsReportServiceImpl implements AmsReportService { @Override public AmsReportVo.Result exportGr(RmsDto.ExportReport1Dto dto) throws IOException { + RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId()); + if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getPersionUrl())) { + AmsReportVo.Result result = new AmsReportVo.Result(); + result.setPath(report.getPersionUrl()); + return result; + } + RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); queryDetail.setEvaluationId(dto.getEvaluationId()); - RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail); + RmsVo.ReportDetail detail = rmsService.queryReport(queryDetail); if (detail == null) { return null; } @@ -660,7 +670,7 @@ public class AmsReportServiceImpl implements AmsReportService { if (emsEvaluationInformedConsent != null) { params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); } - }else { + } else { //签名信息 Long userId = SecurityUtils.getUserId(); List querySigns = hmsDoctorDao.querySign(userId); @@ -689,7 +699,7 @@ public class AmsReportServiceImpl implements AmsReportService { if ("5CZLSY".equals(scores.get(i).getCode()) || "SZGGJ".equals(scores.get(i).getCode()) || "WLCD".equals(scores.get(i).getCode()) || "LMBS".equals(scores.get(i).getCode())) { jsCount += 1; } - //查询类型 + //查询类型 // TODO AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion()); String comboName = "", parentName = ""; String str = ""; @@ -907,7 +917,11 @@ public class AmsReportServiceImpl implements AmsReportService { } catch (Exception e) { e.printStackTrace(); } - + //将生成的文件路径保存到报告单内 + if (ObjectUtil.isNotNull(report)) { + report.setPersionUrl(pdfPath); + rmsReportMapper.updateByPrimaryKeySelective(report); + } AmsReportVo.Result result = new AmsReportVo.Result(); result.setWord(filePath); result.setPath(pdfPath); @@ -974,10 +988,15 @@ public class AmsReportServiceImpl implements AmsReportService { return result; } - RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); queryDetail.setEvaluationId(dto.getEvaluationId()); RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail); + //查询测评量表 + List scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList()); + if (CollUtil.isNotEmpty(scores)) { + //组装成父子级关系 + scores = rmsService.buildReportScoreTree(scores, 0L); + } if (detail == null) { return null; } @@ -985,7 +1004,6 @@ public class AmsReportServiceImpl implements AmsReportService { if (emsEvaluation == null) { return null; } - List scores = detail.getScores(); RmsVo.ReportPatient patientInfo = detail.getPatient(); HashMap params = new HashMap<>(); @@ -1006,7 +1024,7 @@ public class AmsReportServiceImpl implements AmsReportService { if (emsEvaluationInformedConsent != null) { params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); } - }else { + } else { //签名信息 Long userId = SecurityUtils.getUserId(); List querySigns = hmsDoctorDao.querySign(userId); @@ -1197,7 +1215,214 @@ public class AmsReportServiceImpl implements AmsReportService { result.setWord(filePath); result.setPath(pdfPath); //将生成的文件路径保存到报告单内 - if(ObjectUtil.isNotNull(report)){ + if (ObjectUtil.isNotNull(report)) { + report.setUrl(pdfPath); + rmsReportMapper.updateByPrimaryKeySelective(report); + } + return result; + } + + @Override + public AmsReportVo.Result exportYs1(RmsDto.ExportReport1Dto dto) { + RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId()); + if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getUrl())) { + AmsReportVo.Result result = new AmsReportVo.Result(); + result.setPath(report.getUrl()); +// return result; + } + + + RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); + queryDetail.setEvaluationId(dto.getEvaluationId()); + RmsVo.ReportDetail detail = rmsService.queryReport(queryDetail); + //查询测评量表 + List scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList()); + if (CollUtil.isNotEmpty(scores)) { + //组装成父子级关系 + scores = rmsService.buildReportScoreTree(scores, 0L); + } + if (detail == null) { + return null; + } + EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); + if (emsEvaluation == null) { + return null; + } + + //查询 + RmsVo.ReportPatient patientInfo = detail.getPatient(); + + HashMap params = new HashMap<>(); + + XWPFTemplate template = XWPFTemplate.compile(ysPath); + params.put("h_name", patientInfo.getHospitalName()); +// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create()); + params.put("p_name", patientInfo.getPatientName()); + params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女"); + params.put("p_age", patientInfo.getPatientAge()); + CultureEnum cultureEnum = null; + if (dto.getSignId() != null) { + HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId()); + if (emsEvaluationInformedConsent != null) { + params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); + } + } else { + //签名信息 + Long userId = SecurityUtils.getUserId(); + List querySigns = hmsDoctorDao.querySign(userId); + if (CollUtil.isNotEmpty(querySigns)) { + HmsVo.QuerySign querySign = querySigns.get(0); + if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) { + params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create()); + } + } + } + + try { + cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue()); + } catch (Exception e) { + //处理educationStatus为null的情况,后台导入的数据educationStatus为null + //默认为初中 + cultureEnum = CultureEnum.YW; + } + if (cultureEnum != null) { + params.put("p_grade", cultureEnum.getDesc()); + } + if (patientInfo.getCareer() != null) { + JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue()); +// params.put("p_no", patientInfo.getSerialNumber()); + if (jobEnum != null) { + params.put("p_Career", jobEnum.getDesc()); + } + } + params.put("p_dept", patientInfo.getDepartment()); + params.put("p_bedno", patientInfo.getBedNumber()); + params.put("p_Patient_number", patientInfo.getHospitalNumber()); + params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis()); + params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd")); +// params.put("score", detail.getScore()); + //AD8 + +// params.put("cpy_img_url", patientInfo.getName()); + params.put("report_date", DateUtil.date(patientInfo.getReportTime())); + + //生成表格 + // 创建带有样式的文本 + TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create(); + TextRenderData text4 = Texts.of("评估结论").bold().fontSize(12).create(); +// TextRenderData text5 = Texts.of("评估结论").bold().fontSize(12).create(); + + RowRenderData headerRow = Rows.of(text1, text2, text3, text4).create(); + + //查询 + List exportInfos = rmsDao.queryReportExportInfo(dto.getEvaluationId()); + if (CollUtil.isEmpty(exportInfos)) { + return null; + } + RowRenderData titleRow = Rows.of("一级指标/二级指标", "量表名称", "得分", "结论").create(); + Tables.TableBuilder of = Tables.of(headerRow, titleRow); + for (int i = 0; i < exportInfos.size(); i++) { + params.put("yjzb", exportInfos.get(i).getComboParentName()); + params.put("ejzb", exportInfos.get(i).getComboName()); + if (exportInfos.get(i).getNeedPlan() != null && exportInfos.get(i).getNeedPlan() == 1) { + TextRenderData textStr = Texts.of(StrUtil.isEmpty(exportInfos.get(i).getComboParentName()) ? "" : exportInfos.get(i).getComboParentName() + "/" + exportInfos.get(i).getComboName()).bold().color("FF0000").create(); + TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create(); + TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create(); + TextRenderData textImpression = Texts.of(StrUtil.isEmpty(exportInfos.get(i).getImpression()) ? exportInfos.get(i).getResult() : exportInfos.get(i).getImpression()).bold().color("FF0000").create(); + + //查询一二级套餐 + RowRenderData row1 = Rows.of( + textStr, + textName, + textScore, + textImpression + ).create(); +// if (StrUtil.isNotEmpty(exportInfos.get(i).getComboName() + "/" + exportInfos.get(i).getComboParentName())) { +// of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); +// } + of.addRow(row1); + } else { + if (!"JI_SHAO".equals(exportInfos.get(i).getScaleCode())) { + TextRenderData textStr = Texts.of(StrUtil.isEmpty(exportInfos.get(i).getComboParentName()) ? "" : exportInfos.get(i).getComboParentName() + "/" + exportInfos.get(i).getComboName()).bold().create(); + TextRenderData textName = Texts.of("JI_SHAO".equals(exportInfos.get(i).getScaleCode()) ? "肌少总结论" : exportInfos.get(i).getScaleName()).bold().create(); + TextRenderData textScore = Texts.of(exportInfos.get(i).getScore() == null ? "" : exportInfos.get(i).getScore() + "").bold().create(); + //中医体质辨识添加结论 结论为初步印象 + TextRenderData textImpression = Texts.of( + StrUtil.isEmpty(exportInfos.get(i).getImpression()) ? exportInfos.get(i).getResult() : exportInfos.get(i).getImpression()).bold().create(); + //查询一二级套餐 + RowRenderData row1 = Rows.of( + textStr, + textName, + textScore, + textImpression + ).create(); + of.addRow(row1); + } else { + TextRenderData textStr = Texts.of(exportInfos.get(i).getImpression().contains("\n") ? "量表结论" + "\n" + "肌少总结论" : "肌少总结论").bold().create(); + TextRenderData textName = Texts.of("").bold().create(); + TextRenderData textScore = Texts.of(exportInfos.get(i).getScore() == null ? "" : exportInfos.get(i).getScore() + "").bold().create(); + //中医体质辨识添加结论 结论为初步印象 + TextRenderData textImpression = Texts.of( + exportInfos.get(i).getImpression() == null ? exportInfos.get(i).getResult() : exportInfos.get(i).getImpression()).bold().create(); + //查询一二级套餐 + RowRenderData row1 = Rows.of( + textStr, + textName, + textImpression, + textScore + ).create(); + if (StrUtil.isNotEmpty(exportInfos.get(i).getComboName() + "/" + exportInfos.get(i).getComboParentName())) { + of.mergeRule( + MergeCellRule.builder().map( + MergeCellRule.Grid.of(i + 2, 0), MergeCellRule.Grid.of(i + 2, 1)) + .map(MergeCellRule.Grid.of(i + 2, 2), MergeCellRule.Grid.of(i + 2, 3) + ).build() + ); + + } + of.addRow(row1); + } + } + } + if (emsEvaluation.getVersion() != null) { + HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion())); + if (hmsVersion != null) { + params.put("type", hmsVersion.getVersion() + "评估报告"); + } + } + + TableRenderData tableData = of + .create(); + params.put("table", tableData); + + String s = IdUtil.randomUUID(); + try { + template.render(params); + } catch ( + Exception e) { + e.printStackTrace(); // 输出详细的异常信息 + } + + String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx"; + String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf"; + String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx"; + String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf"; + + try { + template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx"))); + AsposeUtils.doc2pdf(aPath, pPath); + } catch ( + Exception e) { + e.printStackTrace(); + } + + AmsReportVo.Result result = new AmsReportVo.Result(); + result.setWord(filePath); + result.setPath(pdfPath); + //将生成的文件路径保存到报告单内 + if (ObjectUtil.isNotNull(report)) { report.setUrl(pdfPath); rmsReportMapper.updateByPrimaryKeySelective(report); } @@ -1206,9 +1431,16 @@ public class AmsReportServiceImpl implements AmsReportService { @Override public AmsReportVo.Result exportYx(RmsDto.ExportReport1Dto dto) { + RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId()); + if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getPositiveUrl())) { + AmsReportVo.Result result = new AmsReportVo.Result(); + result.setPath(report.getPositiveUrl()); +// return result; + } + RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); queryDetail.setEvaluationId(dto.getEvaluationId()); - RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail); + RmsVo.ReportDetail detail = rmsService.queryReport(queryDetail); if (detail == null) { return null; } @@ -1258,7 +1490,7 @@ public class AmsReportServiceImpl implements AmsReportService { if (emsEvaluationInformedConsent != null) { params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); } - }else { + } else { //签名信息 Long userId = SecurityUtils.getUserId(); List querySigns = hmsDoctorDao.querySign(userId); @@ -1377,7 +1609,11 @@ public class AmsReportServiceImpl implements AmsReportService { } catch (Exception e) { e.printStackTrace(); } - + //将生成的文件路径保存到报告单内 + if (ObjectUtil.isNotNull(report)) { + report.setPositiveUrl(pdfPath); + rmsReportMapper.updateByPrimaryKeySelective(report); + } AmsReportVo.Result result = new AmsReportVo.Result(); result.setWord(filePath); result.setPath(pdfPath); diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsServiceImpl.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsServiceImpl.java index 280ae14..b963847 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsServiceImpl.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsServiceImpl.java @@ -88,6 +88,8 @@ public class AmsServiceImpl implements IAmsService { private EmsEvaluationQuestionDurationMapper emsEvaluationQuestionDurationMapper; @Resource private IEmsService emsService; + @Resource + private EmsEvaluationScaleCognitiveRelevanceMapper emsEvaluationScaleCognitiveRelevanceMapper; @Autowired private RedisCache redisUtil; @@ -450,11 +452,6 @@ public class AmsServiceImpl implements IAmsService { resultVo.setCodeEnum(ErrorConstant.PARAM_ERROR); return resultVo; } -// if (CollectionUtil.isEmpty(dto.getOptions())) { -// //没有选项 返回报错 修改于 2023-07-27 -// resultVo.setCodeEnum(ErrorConstant.QUESTION_SAVE_ERROR); -// return resultVo; -// if (CollectionUtil.isEmpty(dto.getOptions()) && CollectionUtil.isEmpty(dto.getPaths())) { List scores = new ArrayList<>(); @@ -474,13 +471,13 @@ public class AmsServiceImpl implements IAmsService { //保存现在的答案 // 选项为空,默认0分 - AmsPatientAnswerScore zeroScore = getHtPatientScore(dto, question.getCognitiveCode(), report, BigDecimal.valueOf(0)); + // 2026年3月2日09:51:09修改 CGAV2 不选默认为空 + AmsPatientAnswerScore zeroScore = getHtPatientScore(dto, question.getCognitiveCode(), report, null); scores.add(zeroScore); amsPatientAnswerScoreDao.insertBatch(scores); //没有选项和画图录音等,不进行保存 resultVo.setCodeEnum(ErrorConstant.SUCCESS); } else { -// String parentCode = question.getCognitiveCode().contains("-") ? question.getCognitiveCode().split("-")[0] : question.getCognitiveCode(); String parentCode = question.getCognitiveCode(); //查询报告单 EmsEvaluation report = emsEvaluationMapper.selectByPrimaryKey(dto.getPatientReportId()); @@ -549,21 +546,9 @@ public class AmsServiceImpl implements IAmsService { // 保存答案 saveAnswerRecord(dto, question); - //修改报告单是否完成一次测评 - changeShowStatus(report, question); - -// //保存自动录音文件 -// if (StrUtil.isNotEmpty(dto.getPath())) { -// //自动录音 -// QmsQuestionRecording htQuestionRecording = new QmsQuestionRecording(); -// htQuestionRecording.setQuestionId(question.getId()); -// htQuestionRecording.setReportId(report.getId()); -// htQuestionRecording.setDelFlag(GenConstants.Ht.NO_DEL); -// htQuestionRecording.setId(IDGenerator.nextSnowflakeId()); -// htQuestionRecording.setPath(score.getPath()); -// htQuestionRecording.setPatientId(scores.get(0).getPatientId()); -// questionRecordingMapper.insertSelective(htQuestionRecording); -// } +// //修改报告单是否完成一次测评 +// changeShowStatus(report, question); + } //进入延迟回忆,先删除已存在的倒计时 @@ -596,7 +581,6 @@ public class AmsServiceImpl implements IAmsService { } if (!(dto.getStatus() != null && (dto.getStatus() == 1 || dto.getStatus() == 2))) { - //由MQ变为Redis if (CollectionUtil.isNotEmpty(shows) // && dto.getIsSubmit() == 1 ) { @@ -658,68 +642,6 @@ public class AmsServiceImpl implements IAmsService { resultVo.setRecallQuestion(0); } } - - //最后一题判断量表是否已全部完成 - if (ObjectUtil.isNotEmpty(dto.getLast())) { - if (dto.getLast()) { - switch (question.getScaleCode()) { - case "AD8": - BigDecimal ad8Score = getRealFinish(dto.getPatientReportId(), "AD8"); - resultVo.setRealFinish(ad8Score.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "PJS": - BigDecimal pjsScore = getRealFinish(dto.getPatientReportId(), "PJS"); - resultVo.setRealFinish(pjsScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "MINIC": - BigDecimal minicScore = getMinicScore(dto.getPatientReportId()); - resultVo.setRealFinish(minicScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "NP": - BigDecimal npScore = getRealFinish(dto.getPatientReportId(), "NP"); - resultVo.setRealFinish(npScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "HIS": - BigDecimal hisScore = getRealFinish(dto.getPatientReportId(), "HIS"); - resultVo.setRealFinish(hisScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "GDS": - BigDecimal gdsScore = getRealFinish(dto.getPatientReportId(), "GDS"); - resultVo.setRealFinish(gdsScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "MMSE": - BigDecimal mmseScore = getMmseScore(dto.getPatientReportId(), "MMSE"); - resultVo.setRealFinish(mmseScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "ADL": - BigDecimal adlScore = getRealFinish(dto.getPatientReportId(), "ADL"); - resultVo.setRealFinish(adlScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "CDR": - BigDecimal cdrScore = getRealFinish(dto.getPatientReportId(), "CDR"); - resultVo.setRealFinish(cdrScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "SCD": - BigDecimal scdScore = getRealFinish(dto.getPatientReportId(), "SCD"); - resultVo.setRealFinish(scdScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "WEBSTER": - BigDecimal websterScore = getRealFinish(dto.getPatientReportId(), "WEBSTER"); - resultVo.setRealFinish(websterScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "SE": - BigDecimal seScore = getRealFinish(dto.getPatientReportId(), "SE"); - resultVo.setRealFinish(seScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - case "NMSA": - BigDecimal nmsaScore = getMmseScore(dto.getPatientReportId(), "NMSA"); - resultVo.setRealFinish(nmsaScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1); - break; - default: - resultVo.setRealFinish(1); - } - } - } return resultVo; } @@ -966,26 +888,26 @@ public class AmsServiceImpl implements IAmsService { }); } - /** - * 修改报告单显示状态 - */ - private void changeShowStatus(EmsEvaluation evaluation, QmsQuestion question) { - //根据测评id查找报告单信息 - RmsReportExample rmsReportExample = new RmsReportExample(); - rmsReportExample.createCriteria().andEvaluationIdEqualTo(evaluation.getId()); - List rmsReports = rmsReportMapper.selectByExample(rmsReportExample); - if (CollUtil.isNotEmpty(rmsReports)) { - RmsReport report = rmsReports.get(0); - if (report.getShowStatus() != null && report.getShowStatus() == GenConstants.Ht.Report.SHOW_HISTORY) { - return; - } - Integer maxSort = questionDao.selectMaxSort(question.getScaleCode()); - if (question.getSort() != null && maxSort != null && question.getSort() >= maxSort) { - report.setShowStatus(GenConstants.Ht.Report.SHOW_HISTORY); - rmsReportMapper.updateByPrimaryKeySelective(report); - } - } - } +// /** +// * 修改报告单显示状态 +// */ +// private void changeShowStatus(EmsEvaluation evaluation, QmsQuestion question) { +// //根据测评id查找报告单信息 +// RmsReportExample rmsReportExample = new RmsReportExample(); +// rmsReportExample.createCriteria().andEvaluationIdEqualTo(evaluation.getId()); +// List rmsReports = rmsReportMapper.selectByExample(rmsReportExample); +// if (CollUtil.isNotEmpty(rmsReports)) { +// RmsReport report = rmsReports.get(0); +// if (report.getShowStatus() != null && report.getShowStatus() == GenConstants.Ht.Report.SHOW_HISTORY) { +// return; +// } +// Integer maxSort = questionDao.selectMaxSort(question.getScaleCode()); +// if (question.getSort() != null && maxSort != null && question.getSort() >= maxSort) { +// report.setShowStatus(GenConstants.Ht.Report.SHOW_HISTORY); +// rmsReportMapper.updateByPrimaryKeySelective(report); +// } +// } +// } @Override public BigDecimal getRealFinish(Long reportId, String code) { @@ -1154,46 +1076,120 @@ public class AmsServiceImpl implements IAmsService { public List getScaleAchievement(AmsDto.ScaleAchievement queryDto) { //查询量表信息 List scaleAchievementList = amsDao.getScaleAchievement(queryDto.getEvaluationId(), queryDto.getScaleCode(), queryDto.getSex()); + if (CollUtil.isNotEmpty(scaleAchievementList)) { + scaleAchievementList.forEach(scaleAchievement -> { + //查找量表下每道题的完成情况 + List scaleQuestionAchievementList = amsDao.getScaleQuestionAchievement(queryDto.getEvaluationId(), scaleAchievement.getScaleCode(), queryDto.getSex()); + scaleAchievement.setQuestionDetail(scaleQuestionAchievementList); + }); + } + return scaleAchievementList; + } + + @Override + public List queryConclusion(AmsDto.ScaleAchievement queryDto) { + //查询量表信息 + List scaleAchievementList = amsDao.getScaleAchievement(queryDto.getEvaluationId(), queryDto.getScaleCode(), queryDto.getSex()); if (CollUtil.isNotEmpty(scaleAchievementList)) { + //删除已有分数 + EmsEvaluationScaleCognitiveRelevanceExample emsEvaluationScaleCognitiveRelevanceExample = new EmsEvaluationScaleCognitiveRelevanceExample(); + emsEvaluationScaleCognitiveRelevanceExample.createCriteria().andEvaluationIdEqualTo(queryDto.getEvaluationId()); + EmsEvaluationScaleCognitiveRelevance emsEvaluationScaleCognitiveRelevance2 = new EmsEvaluationScaleCognitiveRelevance(); + emsEvaluationScaleCognitiveRelevance2.setDelFlag(GenConstants.Ht.IS_DEL); + emsEvaluationScaleCognitiveRelevanceMapper.updateByExampleSelective(emsEvaluationScaleCognitiveRelevance2, emsEvaluationScaleCognitiveRelevanceExample); + + int i = 0; scaleAchievementList.forEach(scaleAchievement -> { - //查询报告单分数 + //查询测评量表分数 List reportScore = rmsDao.queryReportScore(queryDto.getEvaluationId(), scaleAchievement.getScaleCode()); //重新封装报告单信息 List reportScores = rmsService.getReportScores(reportScore, queryDto.getEvaluationId()); if (CollUtil.isNotEmpty(reportScores)) { reportScores.forEach(score -> { - if (score.getCode().equals(scaleAchievement.getScaleCode())) { - List scoreScoreList = new ArrayList<>(); + //保存测评量表分数 + EmsEvaluationScaleCognitiveRelevance evaluationScaleCognitiveRelevance = new EmsEvaluationScaleCognitiveRelevance(); + evaluationScaleCognitiveRelevance.setEvaluationId(queryDto.getEvaluationId()); + evaluationScaleCognitiveRelevance.setDelFlag(GenConstants.Ht.NO_DEL); + evaluationScaleCognitiveRelevance.setScaleCode(scaleAchievement.getScaleCode()); + evaluationScaleCognitiveRelevance.setScore(score.getScore()); + evaluationScaleCognitiveRelevance.setParentId(0L); + evaluationScaleCognitiveRelevance.setTotalScore(scaleAchievement.getTotalScore()); + evaluationScaleCognitiveRelevance.setSort(scaleAchievement.getSort()); + evaluationScaleCognitiveRelevance.setCreateTime(new Date()); + evaluationScaleCognitiveRelevance.setId(IdUtil.getSnowflake().nextId()); + evaluationScaleCognitiveRelevance.setComboId(score.getComboId()); + evaluationScaleCognitiveRelevance.setCreateBy(SecurityUtils.getUsername()); + emsEvaluationScaleCognitiveRelevanceMapper.insert(evaluationScaleCognitiveRelevance); + //保存认知域得分 + if (CollectionUtil.isNotEmpty(score.getSubReport())) { + //保存测评量表认知域分数 score.getSubReport().forEach(subReport -> { - AmsVo.ScoreScore scoreScore = new AmsVo.ScoreScore(); - scoreScore.setScore(subReport.getScore()); - scoreScore.setName(subReport.getName()); - scoreScore.setCode(subReport.getCode()); - scoreScoreList.add(scoreScore); + EmsEvaluationScaleCognitiveRelevance emsEvaluationScaleCognitiveRelevance = new EmsEvaluationScaleCognitiveRelevance(); + emsEvaluationScaleCognitiveRelevance.setEvaluationId(queryDto.getEvaluationId()); + emsEvaluationScaleCognitiveRelevance.setScaleCode(scaleAchievement.getScaleCode()); + emsEvaluationScaleCognitiveRelevance.setCognitiveCode(subReport.getCode()); + emsEvaluationScaleCognitiveRelevance.setScore(subReport.getScore()); + emsEvaluationScaleCognitiveRelevance.setParentId(evaluationScaleCognitiveRelevance.getId()); + emsEvaluationScaleCognitiveRelevance.setTotalScore(scaleAchievement.getTotalScore()); + emsEvaluationScaleCognitiveRelevance.setCreateTime(new Date()); + emsEvaluationScaleCognitiveRelevance.setComboId(score.getComboId()); + emsEvaluationScaleCognitiveRelevance.setDelFlag(GenConstants.Ht.NO_DEL); + emsEvaluationScaleCognitiveRelevance.setSort(subReport.getSort()); + emsEvaluationScaleCognitiveRelevance.setTotalScore(new BigDecimal(subReport.getTotalScore())); + emsEvaluationScaleCognitiveRelevance.setId(IdUtil.getSnowflake().nextId()); + emsEvaluationScaleCognitiveRelevance.setCreateBy(SecurityUtils.getUsername()); + emsEvaluationScaleCognitiveRelevanceMapper.insert(emsEvaluationScaleCognitiveRelevance); + if (CollectionUtil.isNotEmpty(subReport.getSubReport())) { + subReport.getSubReport().forEach(subSubReport -> { + EmsEvaluationScaleCognitiveRelevance emsEvaluationScaleCognitiveRelevance1 = new EmsEvaluationScaleCognitiveRelevance(); + emsEvaluationScaleCognitiveRelevance1.setEvaluationId(queryDto.getEvaluationId()); + emsEvaluationScaleCognitiveRelevance1.setScaleCode(scaleAchievement.getScaleCode()); + emsEvaluationScaleCognitiveRelevance1.setCognitiveCode(subSubReport.getCode()); + emsEvaluationScaleCognitiveRelevance1.setScore(subSubReport.getScore()); + emsEvaluationScaleCognitiveRelevance1.setCreateTime(new Date()); + emsEvaluationScaleCognitiveRelevance1.setTotalScore(new BigDecimal(subReport.getTotalScore())); + emsEvaluationScaleCognitiveRelevance1.setParentId(emsEvaluationScaleCognitiveRelevance.getId()); + emsEvaluationScaleCognitiveRelevance1.setId(IdUtil.getSnowflake().nextId()); + emsEvaluationScaleCognitiveRelevance1.setDelFlag(GenConstants.Ht.NO_DEL); + emsEvaluationScaleCognitiveRelevance1.setCreateBy(SecurityUtils.getUsername()); + emsEvaluationScaleCognitiveRelevanceMapper.insert(emsEvaluationScaleCognitiveRelevance1); + + }); + } }); - scaleAchievement.setScore(score.getScore()); - scaleAchievement.setScaleScoreList(scoreScoreList); } }); } - //查找量表下每道题的完成情况 - List scaleQuestionAchievementList = amsDao.getScaleQuestionAchievement(queryDto.getEvaluationId(), scaleAchievement.getScaleCode(), queryDto.getSex()); - scaleAchievement.setQuestionDetail(scaleQuestionAchievementList); - //NPI特殊处理总分 - if ("NPI".equals(scaleAchievement.getScaleCode())) { - scaleAchievement.setScore(amsDao.getTotalScoreByNPI(queryDto.getEvaluationId())); - } - //CTT不返回分数信息 - if ("CTT".equals(scaleAchievement.getScaleCode())) { - scaleAchievement.setScore(null); - } + //CGA内没有NPI和CTT量表 +// //NPI特殊处理总分 +// if ("NPI".equals(scaleAchievement.getScaleCode())) { +// scaleAchievement.setScore(amsDao.getTotalScoreByNPI(queryDto.getEvaluationId())); +// } +// //CTT不返回分数信息 +// if ("CTT".equals(scaleAchievement.getScaleCode())) { +// scaleAchievement.setScore(null); +// } }); } + + + //删除延迟回忆 + Object objects = redisUtil.get("message_" + queryDto.getEvaluationId()); + if (objects != null) { + Set set = (Set) objects; + if (CollectionUtil.isNotEmpty(set)) { + MessageDto.QuestionInform questionInform = new MessageDto.QuestionInform(); + questionInform.setQuestionId(0L); + set.remove(questionInform); + } + redisUtil.deleteObject("message_" + queryDto.getEvaluationId()); + } return scaleAchievementList; } + @Override public Integer deleteRedis(Long questionId, Long evaluationId) { Object objects = redisUtil.get("message_" + evaluationId); diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/IEmsServiceImpl.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/IEmsServiceImpl.java index 422243e..4b251ae 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/IEmsServiceImpl.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/IEmsServiceImpl.java @@ -232,6 +232,17 @@ public class IEmsServiceImpl implements IEmsService { return evaluationMapper.updateByExampleSelective(emsEvaluation, emsEvaluationExample); } + @Override + public Integer revoke(Long evaluationId) { + EmsEvaluation emsEvaluation = evaluationMapper.selectByPrimaryKey(evaluationId); + if (emsEvaluation == null) { + throw new BaseException(ErrorConstant.PATIENT_REPORT_NOT_FOUND); + } + emsEvaluation.setCompleteStatus((byte) 0); + emsEvaluation.setUpdateTime(new Date()); + return evaluationMapper.updateByPrimaryKeySelective(emsEvaluation); + } + @Override public Integer bindPatient(EmsDto.BindPatient dto) { LoginUser loginUser = getLoginUser(); @@ -323,6 +334,7 @@ public class IEmsServiceImpl implements IEmsService { evaluationScaleRelevance.setId(IDGenerator.nextSnowflakeId()); evaluationScaleRelevance.setEvaluationId(dto.getEvaluationId()); evaluationScaleRelevance.setScaleCode(evaluationScale.getScaleCode()); + evaluationScaleRelevance.setComboId(evaluationScale.getComboId()); evaluationScaleRelevance.setSort(sort1++); evaluationScaleRelevance.setCreateBy(loginUser.getUsername()); evaluationScaleRelevanceMapper.insertSelective(evaluationScaleRelevance); diff --git a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/RmsServiceImpl.java b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/RmsServiceImpl.java index 193b79d..675ef09 100644 --- a/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/RmsServiceImpl.java +++ b/ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/RmsServiceImpl.java @@ -50,7 +50,9 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; import java.time.Duration; +import java.time.LocalDate; import java.time.LocalTime; +import java.time.Period; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; @@ -102,129 +104,234 @@ public class RmsServiceImpl implements IRmsService { @Resource private TzbsRmsReportYsjyMapper rmsReportYsjyMapper; + public int getAge(String birthday) { + if (birthday == null || birthday.trim().isEmpty()) { + return 0; + } + try { + LocalDate birthDate = LocalDate.parse(birthday); + return Period.between(birthDate, LocalDate.now()).getYears(); + } catch (Exception e) { + log.error("计算年龄失败", e); + return 0; + } + } + + /** + * 递归组装ReportScore的父子级树形结构 + * + * @param allReportScores 所有未组装的ReportScore列表 + * @param rootParentId 根节点的parentId(比如0或null,根据业务定义) + * @return 组装好的树形结构根节点列表 + */ + @Override + public List buildReportScoreTree(List allReportScores, Long rootParentId) { + // 1. 预处理:将所有节点放入Map,key=scaleId,方便快速查找 + Map scoreMap = new HashMap<>(); + for (RmsVo.ReportScore score : allReportScores) { + scoreMap.put(score.getScaleId(), score); + // 初始化子列表(避免空指针) + if (score.getSubReport() == null) { + score.setSubReport(new ArrayList<>()); + } + } - public int getAge(PmsPatient pmsPatient) { -// if (pmsPatient.getBirthYear() != null) { -// Calendar instance = Calendar.getInstance(); -// return instance.get(Calendar.YEAR) - pmsPatient.getBirthYear(); -// } else - if (pmsPatient.getBirthday() != null) { - Calendar instance = Calendar.getInstance(); - return instance.get(Calendar.YEAR) - DateUtil.parse(pmsPatient.getBirthday(), "yyyy-MM-dd").getYear(); + // 2. 筛选根节点(parentId等于rootParentId的节点) + List rootNodes = new ArrayList<>(); + for (RmsVo.ReportScore score : allReportScores) { + Long parentId = score.getParentId(); + // 判断是否为根节点(适配parentId=null或0的情况) + boolean isRoot = (rootParentId == null && parentId == null) + || (rootParentId != null && rootParentId.equals(parentId)); + if (isRoot) { + rootNodes.add(score); + // 递归组装子节点 + buildChildren(score, scoreMap); + } } - return 0; + + // 3. 按sort/ecrSort排序(可选,根据业务需求) + sortReportScoreTree(rootNodes); + + return rootNodes; + } + + /** + * 递归为单个节点组装子节点 + * + * @param parentNode 父节点 + * @param scoreMap 所有节点的Map(key=scaleId) + */ + private static void buildChildren(RmsVo.ReportScore parentNode, Map scoreMap) { + // 遍历所有节点,找到当前父节点的子节点(子节点的parentId=父节点的scaleId转Long) + for (RmsVo.ReportScore childNode : scoreMap.values()) { + Long childParentId = childNode.getParentId(); + String parentScaleId = parentNode.getScaleId(); + + // 避免空指针,先判断parentScaleId是否能转Long(根据业务,scaleId应为数字字符串) + if (childParentId == null || parentScaleId == null) { + continue; + } + + // 匹配子节点:子节点的parentId = 父节点的scaleId(转Long) + try { + Long parentIdLong = Long.parseLong(parentScaleId); + if (childParentId.equals(parentIdLong)) { + // 加入子列表 + parentNode.getSubReport().add(childNode); + // 递归组装子节点的子节点 + buildChildren(childNode, scoreMap); + } + } catch (NumberFormatException e) { + // 若scaleId非数字,根据业务处理(此处打印日志,跳过) + System.err.println("scaleId转换Long失败:" + parentScaleId + ",原因:" + e.getMessage()); + continue; + } + } + + // 子节点排序(可选) + if (CollectionUtil.isNotEmpty(parentNode.getSubReport())) { + sortReportScoreTree(parentNode.getSubReport()); + } + } + + /** + * 对ReportScore列表按排序字段排序(优先sort,其次ecrSort) + * + * @param reportScores 待排序的列表 + */ + private static void sortReportScoreTree(List reportScores) { + reportScores.sort((o1, o2) -> { + // 先按sort排序 + if (o1.getSort() != null && o2.getSort() != null) { + return o1.getSort().compareTo(o2.getSort()); + } + // sort为空则按ecrSort排序 + if (o1.getEcrSort() != null && o2.getEcrSort() != null) { + return o1.getEcrSort().compareTo(o2.getEcrSort()); + } + // 都为空则按scaleId排序 + return o1.getScaleId().compareTo(o2.getScaleId()); + }); } @Override public RmsVo.ReportDetail queryReportDetail(RmsDto.QueryDetail dto) { + //查找测评信息 + EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); + if(ObjectUtil.isNull(emsEvaluation)){ + throw new RuntimeException("未找到测评信息"); + } + //查找患者信息 + PmsPatient pmsPatient = pmsPatientMapper.selectByPrimaryKey(emsEvaluation.getPatientId()); + if(ObjectUtil.isNull(pmsPatient)){ + throw new RuntimeException("未找到患者信息"); + } + //根据测评id查找报告单 RmsReportExample reportExample = new RmsReportExample(); reportExample.createCriteria().andEvaluationIdEqualTo(dto.getEvaluationId()).andDelFlagEqualTo((byte) 0); List rmsReports = rmsReportMapper.selectByExample(reportExample); - RmsReport report; - List scores; + if (CollUtil.isNotEmpty(rmsReports)) { + RmsReport rmsReport = new RmsReport(); + rmsReport.setDelFlag((byte) 1); + rmsReportMapper.updateByExampleSelective(rmsReport, reportExample); + //删除报告单分数 + RmsReportScaleScore reportScaleScore = new RmsReportScaleScore(); + reportScaleScore.setDelFlag((byte) 1); + RmsReportScaleScoreExample reportScaleScoreExample = new RmsReportScaleScoreExample(); + reportScaleScoreExample.createCriteria().andReportIdEqualTo(dto.getEvaluationId()); + rmsReportScaleScoreMapper.updateByExampleSelective(reportScaleScore, reportScaleScoreExample); + } + //查询测评量表及分数 + List scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList()); + if (CollUtil.isNotEmpty(scores)) { + //组装成父子级关系 + scores = buildReportScoreTree(scores, 0L); + } Map reportScaleScoreMap = new HashMap<>(); - if (CollUtil.isEmpty(rmsReports)) { - //生成报告单 - report = new RmsReport(); - report.setId(IDGenerator.nextSnowflakeId()); - report.setName(GenConstants.Ht.Report.PARENT_NAME + DateUtil.today()); - report.setEvaluationId(dto.getEvaluationId()); - report.setReportTime(System.currentTimeMillis()); - //查找测评信息 - EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); - if (ObjectUtil.isNotNull(emsEvaluation)) { - //查找病人信息 - PmsPatient pmsPatient = pmsPatientMapper.selectByPrimaryKey(emsEvaluation.getPatientId()); - if (ObjectUtil.isNotNull(pmsPatient)) { -// report.setPatientAge(IdcardUtil.getAgeByIdCard(pmsPatient.getIdcard())); - report.setPatientAge(getAge(pmsPatient)); - } - //修改测评的状态 - if (dto.getComplateStatus() != null) { - emsEvaluation.setCompleteStatus(dto.getComplateStatus()); - } - emsEvaluationMapper.updateByPrimaryKeySelective(emsEvaluation); - report.setVisitNo(emsEvaluation.getVisitNo()); - } - rmsReportMapper.insertSelective(report); - - //查询报告单分数 - List reportScore = rmsDao.queryReportScore1(dto.getEvaluationId(), null, dto.getSex()); - //重新封装报告单信息 - scores = getReportScores(reportScore, dto.getEvaluationId()); +// RmsReportScaleScoreExample rmsReportScaleScoreExample = new RmsReportScaleScoreExample(); +// rmsReportScaleScoreExample.createCriteria().andReportIdEqualTo(dto.getEvaluationId()); + + //生成报告单 + RmsReport report = new RmsReport(); + report.setId(IDGenerator.nextSnowflakeId()); + report.setName(GenConstants.Ht.Report.PARENT_NAME + DateUtil.today()); + report.setEvaluationId(dto.getEvaluationId()); + report.setReportTime(System.currentTimeMillis()); + report.setPatientAge(getAge(pmsPatient.getBirthday())); + //修改测评的状态 + if (dto.getComplateStatus() != null) { + emsEvaluation.setCompleteStatus(dto.getComplateStatus()); + } + emsEvaluationMapper.updateByPrimaryKeySelective(emsEvaluation); + report.setVisitNo(emsEvaluation.getVisitNo()); + rmsReportMapper.insertSelective(report); - if (CollUtil.isNotEmpty(scores)) { - scores.forEach(score -> { - if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) { + if (CollUtil.isNotEmpty(scores)) { + scores.forEach(score -> { + if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) { // 添加体质辨识结论 - List reportResultList = score.getReportResultList(); - if (CollUtil.isNotEmpty(reportResultList)) { - reportResultList.forEach(reportResult -> { - reportResult.setReportId(report.getId()); - }); - clientEvaDao.batchInsertReportResult(reportResultList); - } + List reportResultList = score.getReportResultList(); + if (CollUtil.isNotEmpty(reportResultList)) { + reportResultList.forEach(reportResult -> { + reportResult.setReportId(report.getId()); + }); + clientEvaDao.batchInsertReportResult(reportResultList); + } - //添加体质辨识养生建议 - List reportYsjyList = score.getReportYsjyList(); - if (CollUtil.isNotEmpty(reportYsjyList)) { - reportYsjyList.forEach(reportResult -> { - reportResult.setReportId(report.getId()); - rmsReportYsjyMapper.insertSelective(reportResult); - }); - } -// 获取初步印象 - ClientEvaVo.ReportView reportView = reportView(dto.getEvaluationId(), score.getCode()); - if (reportView != null) { - score.setImpression(reportView.getResult()); - score.setScore(reportView.getTotalScore()); - } + //添加体质辨识养生建议 + List reportYsjyList = score.getReportYsjyList(); + if (CollUtil.isNotEmpty(reportYsjyList)) { + reportYsjyList.forEach(reportResult -> { + reportResult.setReportId(report.getId()); + rmsReportYsjyMapper.insertSelective(reportResult); + }); } - //添加量表分数统计 - RmsReportScaleScore reportScaleScore = new RmsReportScaleScore(); - reportScaleScore.setId(IDGenerator.nextSnowflakeId()); - reportScaleScore.setReportId(report.getId()); - reportScaleScore.setScaleCode(score.getCode()); - reportScaleScore.setImpression(score.getImpression()); - reportScaleScore.setScore(score.getScore()); - rmsReportScaleScoreMapper.insertSelective(reportScaleScore); - reportScaleScoreMap.put(score.getCode(), reportScaleScore); - }); - } - } else { - report = rmsReports.get(0); - //查找测评信息 - EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); - if (ObjectUtil.isNotNull(emsEvaluation)) { - //修改测评的状态 - if (dto.getComplateStatus() != null) { - emsEvaluation.setCompleteStatus(dto.getComplateStatus()); - emsEvaluationMapper.updateByPrimaryKeySelective(emsEvaluation); } - } + //添加量表分数统计 + RmsReportScaleScore reportScaleScore = new RmsReportScaleScore(); + reportScaleScore.setId(IDGenerator.nextSnowflakeId()); + reportScaleScore.setReportId(report.getId()); + reportScaleScore.setScaleCode(score.getCode()); + reportScaleScore.setResult(score.getImpression()); + reportScaleScore.setScore(score.getScore()); + reportScaleScore.setIsShow((byte) 1); + reportScaleScore.setComboId(score.getComboId()); + reportScaleScore.setSort(score.getSort()); + rmsReportScaleScoreMapper.insertSelective(reportScaleScore); + reportScaleScoreMap.put(score.getCode(), reportScaleScore); + }); + } + //肌少结论生成 + //处理肌少 + String jishaoResult = addJs(scores); + if (StrUtil.isNotEmpty(jishaoResult)) { + RmsReportScaleScore reportScaleScore = new RmsReportScaleScore(); + reportScaleScore.setId(IDGenerator.nextSnowflakeId()); + reportScaleScore.setReportId(report.getId()); + reportScaleScore.setScaleCode("JI_SHAO"); + reportScaleScore.setImpression(jishaoResult); + reportScaleScore.setSort(scores.size() + 1); + reportScaleScore.setIsShow((byte) 0); + rmsReportScaleScoreMapper.insertSelective(reportScaleScore); } - //每次查询报告单 都重新生成分数 - //查询报告单分数 - List reportScore = rmsDao.queryReportScore3(dto.getEvaluationId(), null, dto.getSex()); - //重新封装报告单信息 - scores = getReportScores(reportScore, dto.getEvaluationId()); - if (CollUtil.isNotEmpty(scores)) { - scores = scores.stream().sorted(Comparator.comparing(RmsVo.ReportScore::getEcrSort)).collect(Collectors.toList()); - scores.forEach(score -> { - //查找初步印象 - RmsReportScaleScoreExample scoreExample = new RmsReportScaleScoreExample(); - scoreExample.createCriteria().andReportIdEqualTo(report.getId()).andScaleCodeEqualTo(score.getCode()).andDelFlagEqualTo((byte) 0); - List rmsReportScaleScores = rmsReportScaleScoreMapper.selectByExample(scoreExample); - if (CollUtil.isNotEmpty(rmsReportScaleScores)) { - score.setImpression(rmsReportScaleScores.get(0).getImpression()); - if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) { - score.setScore(rmsReportScaleScores.get(0).getScore()); - } - reportScaleScoreMap.put(score.getCode(), rmsReportScaleScores.get(0)); - } + RmsVo.ReportDetail detail = new RmsVo.ReportDetail(); + + //查找患者做过的测评的最早和最晚的时间 + RmsVo.PatientEvaluationTime time = new RmsVo.PatientEvaluationTime(); + time = rmsDao.getTimeByPatientId(pmsPatient.getId()); + if (ObjectUtil.isNull(time)) { + time = new RmsVo.PatientEvaluationTime(); + time.setMinTime(new Date()); + time.setMaxTime(new Date()); + } + +// PmsPatient pmsPatient = pmsPatientMapper.selectByPrimaryKey(emsEvaluation.getPatientId()); + if (ObjectUtil.isNotNull(emsEvaluation) && CollUtil.isNotEmpty(scores)) { + for (RmsVo.ReportScore score : scores) { //查询量表试题 QmsQuestionExample qmsQuestionExample = new QmsQuestionExample(); qmsQuestionExample.createCriteria().andScaleCodeEqualTo(score.getCode()).andDelFlagEqualTo((byte) 0); @@ -239,40 +346,6 @@ public class RmsServiceImpl implements IRmsService { score.setQuestionDuration(emsEvaluationQuestionDurations.stream().mapToLong(EmsEvaluationQuestionDuration::getDuration).sum()); } } - }); - } - - RmsVo.ReportDetail detail = new RmsVo.ReportDetail(); - //查询报告单信息和病人信息 - RmsVo.ReportPatient reportPatient = rmsDao.queryReportResult(report.getId()); -// //查询报告单诊断结果信息 -// RmsVo.ReportPatient diagnosis = rmsDao.queryReportDiagnosis(report.getId()); -// //查询报告单的关联信息 -// HtReportRelevanceExample relevanceExample = new HtReportRelevanceExample(); -// relevanceExample.createCriteria().andReportIdEqualTo(queryDetail.getId()).andReportCodeEqualTo(queryDetail.getReport()); -// List reportRelevanceList = reportRelevanceMapper.selectByExample(relevanceExample); -// if(CollectionUtil.isNotEmpty(reportRelevanceList)) { -// reportPatient.setWorkingScore(ObjectUtil.isNull(reportRelevanceList.get(0).getSocre()) ? 0 : reportRelevanceList.get(0).getSocre()); -// reportPatient.setInitialImpression(reportRelevanceList.get(0).getImpression()); -// } - - - //查找患者做过的测评的最早和最晚的时间 - RmsVo.PatientEvaluationTime time = new RmsVo.PatientEvaluationTime(); - if (ObjectUtil.isNotNull(reportPatient)) { - time = rmsDao.getTimeByPatientId(reportPatient.getPatientId()); - if (ObjectUtil.isNull(time)) { - time = new RmsVo.PatientEvaluationTime(); - time.setMinTime(new Date()); - time.setMaxTime(new Date()); - } - } - - - EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); - PmsPatient pmsPatient = pmsPatientMapper.selectByPrimaryKey(emsEvaluation.getPatientId()); - if (ObjectUtil.isNotNull(emsEvaluation) && CollUtil.isNotEmpty(scores)) { - for (RmsVo.ReportScore score : scores) { //查询量表的总分趋势信息 List scoreTrend = rmsDao.getScoreTrend(emsEvaluation.getPatientId(), score.getCode(), time.getMinTime(), time.getMaxTime()); //折线图上只显示近5条记录 @@ -307,9 +380,7 @@ public class RmsServiceImpl implements IRmsService { rmsReportScaleScore.setNeedPlan(qmsScaleAssConf.getNeedPlan()); rmsReportScaleScore.setResult(qmsScaleAssConf.getResult()); rmsReportScaleScore.setScaleAssConf(qmsScaleAssConf.getId()); -// rmsReportScaleScore.setSort(); rmsReportScaleScoreMapper.updateByPrimaryKeySelective(rmsReportScaleScore); - } } //查询排序 @@ -319,35 +390,120 @@ public class RmsServiceImpl implements IRmsService { if (CollUtil.isNotEmpty(qmsScales)) { score.setSort(qmsScales.get(0).getSort()); } - - } + } + //查询报告单信息和病人信息 + RmsVo.ReportPatient reportPatient = rmsDao.queryReportResult(report.getId()); + detail.setPatient(reportPatient); + detail.setScores(scores); + return detail; + } + @Override + public RmsVo.ReportDetail queryReport(RmsDto.QueryDetail dto) { + //根据测评id查找报告单 + RmsReportExample reportExample = new RmsReportExample(); + reportExample.createCriteria().andEvaluationIdEqualTo(dto.getEvaluationId()).andDelFlagEqualTo((byte) 0); + List rmsReports = rmsReportMapper.selectByExample(reportExample); + if (CollUtil.isEmpty(rmsReports)) { + return queryReportDetail(dto); } + RmsReport report = rmsReports.get(0); + RmsVo.ReportDetail detail = new RmsVo.ReportDetail(); + //查询报告单信息和病人信息 + RmsVo.ReportPatient reportPatient = rmsDao.queryReportResult(report.getId()); - //删除延迟回忆 - Object objects = redisUtil.get("message_" + dto.getEvaluationId()); - if (objects != null) { - Set set = (Set) objects; - if (CollectionUtil.isNotEmpty(set)) { - MessageDto.QuestionInform questionInform = new MessageDto.QuestionInform(); - questionInform.setQuestionId(0L); - boolean remove = set.remove(questionInform); + //查找患者做过的测评的最早和最晚的时间 + RmsVo.PatientEvaluationTime time = new RmsVo.PatientEvaluationTime(); + if (ObjectUtil.isNotNull(reportPatient)) { + time = rmsDao.getTimeByPatientId(reportPatient.getPatientId()); + if (ObjectUtil.isNull(time)) { + time = new RmsVo.PatientEvaluationTime(); + time.setMinTime(new Date()); + time.setMaxTime(new Date()); } -// if (set.size() > 0) { - //list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MessageDto.QuestionInform::getQuestionId))), ArrayList::new)); - // redisUtil.set("message_" + score.getPatientReportId(), set, 7200); - redisUtil.deleteObject("message_" + dto.getEvaluationId()); -// } } - -// scores = scores.stream().sorted(Comparator.comparing(RmsVo.ReportScore::getSort)).collect(Collectors.toList()); + //查询测评量表 + List scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList()); + if (CollUtil.isNotEmpty(scores)) { + //组装成父子级关系 + scores = buildReportScoreTree(scores, 0L); + } detail.setPatient(reportPatient); detail.setScores(scores); return detail; } + /** + * 添加肌少套餐结论 + * 判断是否添加肌少总结论 + * 如果四项测试有一项没做,则跳过 + * + * @param scores + * @return + */ + // + // + private String addJs(List scores) { + //指定套餐才会触发,暂定写死套餐id + scores = scores.stream().filter(score -> score.getComboId() != null && score.getComboId() == 1982986055883821056L).collect(Collectors.toList()); + if (CollUtil.isEmpty(scores)) { + return null; + } + + String str = ""; + List sarcCalf = scores.stream().filter( + score -> score.getCode().equals("SARC-Calf") + ).collect(Collectors.toList()); + List wczl = scores.stream().filter( + score -> score.getCode().equals("5CZLSY") + ).collect(Collectors.toList()); + List szggj = scores.stream().filter( + score -> score.getCode().equals("SZGGJ") + ).collect(Collectors.toList()); + List wlcd = scores.stream().filter( + score -> score.getCode().equals("WLCD") + ).collect(Collectors.toList()); + List lmbs = scores.stream().filter( + score -> score.getCode().equals("LMBS") + ).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(sarcCalf)) { + QmsScaleAssConf sarcCalfConf = amsDao.queryScaleAssConf1(sarcCalf.get(0).getCode(), sarcCalf.get(0).getScore(), null); + if (sarcCalfConf != null) { + str = sarcCalfConf.getResult(); + } + } + if (CollUtil.isEmpty(wczl) || CollUtil.isEmpty(szggj) || CollUtil.isEmpty(wlcd) || CollUtil.isEmpty(lmbs)) { + return null; + } + + QmsScaleAssConf wczlConf = amsDao.queryScaleAssConf1(wczl.get(0).getCode(), wczl.get(0).getScore(), null); + QmsScaleAssConf szggjConf = amsDao.queryScaleAssConf1(szggj.get(0).getCode(), szggj.get(0).getScore(), null); + QmsScaleAssConf wlcdConf = amsDao.queryScaleAssConf1(wlcd.get(0).getCode(), wlcd.get(0).getScore(), null); + QmsScaleAssConf lmbsConf = amsDao.queryScaleAssConf1(lmbs.get(0).getCode(), lmbs.get(0).getScore(), null); + if (wczlConf != null && szggjConf != null && wlcdConf != null && lmbsConf != null) { + // *四项测试结果都正常,说明没有肌少症风险 + // *如果四肢骨骼肌身高质量指数(ASMI)正常,肌肉力量或(及)躯体功能下降,则有肌少症风险; + // *如果四项测试值全部低于标准值,则诊断为严重肌少症。 + // *如果四肢骨骼肌身高质量指数(ASMI)低于标准值,肌肉力量或躯体功能其中有一项低于标准值,则诊断为肌少症; + // *否则有肌少症风险 + if (!"1".equals(wczlConf.getNeedPlan()) && !"1".equals(szggjConf.getNeedPlan()) && !"1".equals(wlcdConf.getNeedPlan()) && !"1".equals(lmbsConf.getNeedPlan())) { + //没有肌少症风险 + return StrUtil.isEmpty(str) ? "没有肌少症风险" : str + "\n" + "没有肌少症风险"; + } else if (!"1".equals(szggjConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(wczlConf.getNeedPlan())) { + return StrUtil.isEmpty(str) ? "有肌少症风险" : str + "\n" + "有肌少症风险"; + } else if ("1".equals(wczlConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(szggjConf.getNeedPlan())) { + return StrUtil.isEmpty(str) ? "严重肌少症" : str + "\n" + "严重肌少症"; + } else if ("1".equals(szggjConf.getNeedPlan()) && ("1".equals(wlcdConf.getNeedPlan()) || "1".equals(lmbsConf.getNeedPlan()) || "1".equals(wczlConf.getNeedPlan()))) { + return StrUtil.isEmpty(str) ? "肌少症" : str + "\n" + "肌少症"; + } else { + return StrUtil.isEmpty(str) ? "有肌少症风险" : str + "\n" + "有肌少症风险"; + } + } + return null; + } + @Override public ClientEvaVo.ReportView reportView(Long evaluationId, String code) { ClientEvaVo.ReportView vo = clientEvaDao.getTzbsResult(evaluationId, code); @@ -796,9 +952,9 @@ public class RmsServiceImpl implements IRmsService { // 记忆指数:自由回忆*3+分类提示*2+多选提示*1 范围0-15分 if (sortScoreMap.containsKey(huiyi) || sortScoreMap.containsKey(fenlei) || sortScoreMap.containsKey(duoxuan)) { - jiYi = sortScoreMap.getOrDefault(huiyi, zero).multiply(new BigDecimal(3)) - .add(sortScoreMap.getOrDefault(fenlei, zero).multiply(new BigDecimal(2))) - .add(sortScoreMap.getOrDefault(duoxuan, zero)); + jiYi = getOrDefaultSafe(sortScoreMap,huiyi, zero).multiply(new BigDecimal(3)) + .add(getOrDefaultSafe(sortScoreMap,fenlei, zero).multiply(new BigDecimal(2))) + .add(getOrDefaultSafe(sortScoreMap,duoxuan, zero)); } RmsVo.ScoreDistribution jiYiScore = new RmsVo.ScoreDistribution("jiYi", "记忆指数", ObjectUtil.isNull(jiYi) ? BigDecimal.ZERO : jiYi); cognitiveDomainList.add(jiYiScore); @@ -808,26 +964,26 @@ public class RmsServiceImpl implements IRmsService { || sortScoreMap.containsKey(daobei) || sortScoreMap.containsKey(jingjuexing) || sortScoreMap.containsKey(jianfa) || sortScoreMap.containsKey(dongwu) || sortScoreMap.containsKey(xiangsixing) ) { - zhiXing = sortScoreMap.getOrDefault(lianxian, zero).add(sortScoreMap.getOrDefault(huazhong, zero)) - .add(sortScoreMap.getOrDefault(shunbei, zero)).add(sortScoreMap.getOrDefault(daobei, zero)) - .add(sortScoreMap.getOrDefault(jingjuexing, zero)).add(sortScoreMap.getOrDefault(jianfa, zero)) - .add(sortScoreMap.getOrDefault(dongwu, zero)).add(sortScoreMap.getOrDefault(xiangsixing, zero)); + zhiXing = getOrDefaultSafe(sortScoreMap,lianxian, zero).add(getOrDefaultSafe(sortScoreMap,huazhong, zero)) + .add(getOrDefaultSafe(sortScoreMap,shunbei, zero)).add(getOrDefaultSafe(sortScoreMap,daobei, zero)) + .add(getOrDefaultSafe(sortScoreMap,jingjuexing, zero)).add(getOrDefaultSafe(sortScoreMap,jianfa, zero)) + .add(getOrDefaultSafe(sortScoreMap,dongwu, zero)).add(getOrDefaultSafe(sortScoreMap,xiangsixing, zero)); } RmsVo.ScoreDistribution zhiXingScore = new RmsVo.ScoreDistribution("zhiXing", "执行指数", ObjectUtil.isNull(zhiXing) ? BigDecimal.ZERO : zhiXing); cognitiveDomainList.add(zhiXingScore); // 视空间指数:立方体+画钟+命名 0-7分 if (sortScoreMap.containsKey(lifangti) || sortScoreMap.containsKey(huazhong) || sortScoreMap.containsKey(mingming1) || sortScoreMap.containsKey(mingming2) || sortScoreMap.containsKey(mingming3)) { - kongJian = sortScoreMap.getOrDefault(lifangti, zero).add(sortScoreMap.getOrDefault(huazhong, zero)) - .add(sortScoreMap.getOrDefault(mingming1, zero)).add(sortScoreMap.getOrDefault(mingming2, zero)).add(sortScoreMap.getOrDefault(mingming3, zero)); + kongJian = getOrDefaultSafe(sortScoreMap,lifangti, zero).add(getOrDefaultSafe(sortScoreMap,huazhong, zero)) + .add(getOrDefaultSafe(sortScoreMap,mingming1, zero)).add(getOrDefaultSafe(sortScoreMap,mingming2, zero)).add(getOrDefaultSafe(sortScoreMap,mingming3, zero)); } RmsVo.ScoreDistribution kongJianScore = new RmsVo.ScoreDistribution("kongJian", "视空间指数", ObjectUtil.isNull(kongJian) ? BigDecimal.ZERO : kongJian); cognitiveDomainList.add(kongJianScore); // 语言指数:命名+句子复述+词语流畅性 0-6分 if (sortScoreMap.containsKey(mingming1) || sortScoreMap.containsKey(mingming2) || sortScoreMap.containsKey(mingming3) || sortScoreMap.containsKey(fushu1) || sortScoreMap.containsKey(fushu2) || sortScoreMap.containsKey(dongwu)) { - yuYan = sortScoreMap.getOrDefault(mingming1, zero).add(sortScoreMap.getOrDefault(mingming2, zero)).add(sortScoreMap.getOrDefault(mingming3, zero)) - .add(sortScoreMap.getOrDefault(chongfu1, zero)).add(sortScoreMap.getOrDefault(chongfu2, zero)).add(sortScoreMap.getOrDefault(dongwu, zero)); + yuYan = getOrDefaultSafe(sortScoreMap,mingming1, zero).add(getOrDefaultSafe(sortScoreMap,mingming2, zero)).add(getOrDefaultSafe(sortScoreMap,mingming3, zero)) + .add(getOrDefaultSafe(sortScoreMap,chongfu1, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu2, zero)).add(getOrDefaultSafe(sortScoreMap,dongwu, zero)); } RmsVo.ScoreDistribution yuYanScore = new RmsVo.ScoreDistribution("yuYan", "语言指数", ObjectUtil.isNull(yuYan) ? BigDecimal.ZERO : yuYan); cognitiveDomainList.add(yuYanScore); @@ -835,15 +991,15 @@ public class RmsServiceImpl implements IRmsService { if (sortScoreMap.containsKey(shunbei) || sortScoreMap.containsKey(daobei) || sortScoreMap.containsKey(jingjuexing) || sortScoreMap.containsKey(jianfa) || sortScoreMap.containsKey(chongfu1) || sortScoreMap.containsKey(chongfu2) || sortScoreMap.containsKey(fushu1) || sortScoreMap.containsKey(fushu2)) { - zhuYi = sortScoreMap.getOrDefault(shunbei, zero).add(sortScoreMap.getOrDefault(daobei, zero)).add(sortScoreMap.getOrDefault(jingjuexing, zero)) - .add(sortScoreMap.getOrDefault(jianfa, zero)).add(sortScoreMap.getOrDefault(chongfu1, zero)).add(sortScoreMap.getOrDefault(chongfu2, zero)) - .add(sortScoreMap.getOrDefault(fushu1, zero)).add(sortScoreMap.getOrDefault(fushu2, zero)); + zhuYi = getOrDefaultSafe(sortScoreMap,shunbei, zero).add(getOrDefaultSafe(sortScoreMap,daobei, zero)).add(getOrDefaultSafe(sortScoreMap,jingjuexing, zero)) + .add(getOrDefaultSafe(sortScoreMap,jianfa, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu1, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu2, zero)) + .add(getOrDefaultSafe(sortScoreMap,fushu1, zero)).add(getOrDefaultSafe(sortScoreMap,fushu2, zero)); } RmsVo.ScoreDistribution zhuYiScore = new RmsVo.ScoreDistribution("zhuYi", "注意指数", ObjectUtil.isNull(zhuYi) ? BigDecimal.ZERO : zhuYi); cognitiveDomainList.add(zhuYiScore); // 定向指数:定向 0-6分 if (sortScoreMap.containsKey(shijian) || sortScoreMap.containsKey(didian)) { - dingXiang = sortScoreMap.getOrDefault(shijian, zero).add(sortScoreMap.getOrDefault(didian, zero)); + dingXiang = getOrDefaultSafe(sortScoreMap,shijian, zero).add(getOrDefaultSafe(sortScoreMap,didian, zero)); } RmsVo.ScoreDistribution dingXiangScore = new RmsVo.ScoreDistribution("dingXiang", "定向指数", ObjectUtil.isNull(dingXiang) ? BigDecimal.ZERO : dingXiang); cognitiveDomainList.add(dingXiangScore); @@ -853,6 +1009,10 @@ public class RmsServiceImpl implements IRmsService { return scoreDistributions; } + public static V getOrDefaultSafe(Map map, K key, V defaultValue) { + return map.containsKey(key) && map.get(key) != null ? map.get(key) : defaultValue; + } + /** * @param score * @param educationalStatus 教育程度(1:文盲 2:小学 3:初中 4:高中 5:大学 6:大学以上 7:其他) @@ -1050,6 +1210,11 @@ public class RmsServiceImpl implements IRmsService { if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) { score.setSubReport(new ArrayList<>()); zytzbs(evaluationId, score); + ClientEvaVo.ReportView reportView = reportView(evaluationId, score.getCode()); + if (reportView != null) { + score.setImpression(reportView.getResult()); + score.setScore(reportView.getTotalScore()); + } } }); return scores; @@ -2453,43 +2618,43 @@ public class RmsServiceImpl implements IRmsService { BigDecimal zero = new BigDecimal(0); // 记忆指数:自由回忆*3+分类提示*2+多选提示*1 范围0-15分 if (sortScoreMap.containsKey(huiyi) || sortScoreMap.containsKey(fenlei) || sortScoreMap.containsKey(duoxuan)) { - jiYi = sortScoreMap.getOrDefault(huiyi, zero).multiply(new BigDecimal(3)) - .add(sortScoreMap.getOrDefault(fenlei, zero).multiply(new BigDecimal(2))) - .add(sortScoreMap.getOrDefault(duoxuan, zero)); + jiYi = getOrDefaultSafe(sortScoreMap,huiyi, zero).multiply(new BigDecimal(3)) + .add(getOrDefaultSafe(sortScoreMap,fenlei, zero).multiply(new BigDecimal(2))) + .add(getOrDefaultSafe(sortScoreMap,duoxuan, zero)); } // 执行指数:连线测验+画钟+数字广度顺+数字广度逆+警觉性(听1敲桌子)+连续减7+词语流畅性(1分钟说动物)+抽象(词语相似性) 0-13分   1+3+1+1+1+3+1+2=13 if (sortScoreMap.containsKey(lianxian) || sortScoreMap.containsKey(huazhong) || sortScoreMap.containsKey(shunbei) || sortScoreMap.containsKey(daobei) || sortScoreMap.containsKey(jingjuexing) || sortScoreMap.containsKey(jianfa) || sortScoreMap.containsKey(dongwu) || sortScoreMap.containsKey(xiangsixing) ) { - zhiXing = sortScoreMap.getOrDefault(lianxian, zero).add(sortScoreMap.getOrDefault(huazhong, zero)) - .add(sortScoreMap.getOrDefault(shunbei, zero)).add(sortScoreMap.getOrDefault(daobei, zero)) - .add(sortScoreMap.getOrDefault(jingjuexing, zero)).add(sortScoreMap.getOrDefault(jianfa, zero)) - .add(sortScoreMap.getOrDefault(dongwu, zero)).add(sortScoreMap.getOrDefault(xiangsixing, zero)); + zhiXing = getOrDefaultSafe(sortScoreMap,lianxian, zero).add(getOrDefaultSafe(sortScoreMap,huazhong, zero)) + .add(getOrDefaultSafe(sortScoreMap,shunbei, zero)).add(getOrDefaultSafe(sortScoreMap,daobei, zero)) + .add(getOrDefaultSafe(sortScoreMap,jingjuexing, zero)).add(getOrDefaultSafe(sortScoreMap,jianfa, zero)) + .add(getOrDefaultSafe(sortScoreMap,dongwu, zero)).add(getOrDefaultSafe(sortScoreMap,xiangsixing, zero)); } // 视空间指数:立方体+画钟+命名 0-7分 if (sortScoreMap.containsKey(lifangti) || sortScoreMap.containsKey(huazhong) || sortScoreMap.containsKey(mingming1) || sortScoreMap.containsKey(mingming2) || sortScoreMap.containsKey(mingming3)) { - kongJian = sortScoreMap.getOrDefault(lifangti, zero).add(sortScoreMap.getOrDefault(huazhong, zero)) - .add(sortScoreMap.getOrDefault(mingming1, zero)).add(sortScoreMap.getOrDefault(mingming2, zero)).add(sortScoreMap.getOrDefault(mingming3, zero)); + kongJian = getOrDefaultSafe(sortScoreMap,lifangti, zero).add(getOrDefaultSafe(sortScoreMap,huazhong, zero)) + .add(getOrDefaultSafe(sortScoreMap,mingming1, zero)).add(getOrDefaultSafe(sortScoreMap,mingming2, zero)).add(getOrDefaultSafe(sortScoreMap,mingming3, zero)); } // 语言指数:命名+句子复述+词语流畅性 0-6分 if (sortScoreMap.containsKey(mingming1) || sortScoreMap.containsKey(mingming2) || sortScoreMap.containsKey(mingming3) || sortScoreMap.containsKey(fushu1) || sortScoreMap.containsKey(fushu2) || sortScoreMap.containsKey(dongwu)) { - yuYan = sortScoreMap.getOrDefault(mingming1, zero).add(sortScoreMap.getOrDefault(mingming2, zero)).add(sortScoreMap.getOrDefault(mingming3, zero)) - .add(sortScoreMap.getOrDefault(chongfu1, zero)).add(sortScoreMap.getOrDefault(chongfu2, zero)).add(sortScoreMap.getOrDefault(dongwu, zero)); + yuYan = getOrDefaultSafe(sortScoreMap,mingming1, zero).add(getOrDefaultSafe(sortScoreMap,mingming2, zero)).add(getOrDefaultSafe(sortScoreMap,mingming3, zero)) + .add(getOrDefaultSafe(sortScoreMap,chongfu1, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu2, zero)).add(getOrDefaultSafe(sortScoreMap,dongwu, zero)); } // 注意指数:数字广度顺+数字广度逆+警觉性+连续减7+句子重复+即刻记忆2次  0-18分 if (sortScoreMap.containsKey(shunbei) || sortScoreMap.containsKey(daobei) || sortScoreMap.containsKey(jingjuexing) || sortScoreMap.containsKey(jianfa) || sortScoreMap.containsKey(chongfu1) || sortScoreMap.containsKey(chongfu2) || sortScoreMap.containsKey(fushu1) || sortScoreMap.containsKey(fushu2)) { - zhuYi = sortScoreMap.getOrDefault(shunbei, zero).add(sortScoreMap.getOrDefault(daobei, zero)).add(sortScoreMap.getOrDefault(jingjuexing, zero)) - .add(sortScoreMap.getOrDefault(jianfa, zero)).add(sortScoreMap.getOrDefault(chongfu1, zero)).add(sortScoreMap.getOrDefault(chongfu2, zero)) - .add(sortScoreMap.getOrDefault(fushu1, zero)).add(sortScoreMap.getOrDefault(fushu2, zero)); + zhuYi = getOrDefaultSafe(sortScoreMap,shunbei, zero).add(getOrDefaultSafe(sortScoreMap,daobei, zero)).add(getOrDefaultSafe(sortScoreMap,jingjuexing, zero)) + .add(getOrDefaultSafe(sortScoreMap,jianfa, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu1, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu2, zero)) + .add(getOrDefaultSafe(sortScoreMap,fushu1, zero)).add(getOrDefaultSafe(sortScoreMap,fushu2, zero)); } // 定向指数:定向 0-6分 if (sortScoreMap.containsKey(shijian) || sortScoreMap.containsKey(didian)) { - dingXiang = sortScoreMap.getOrDefault(shijian, zero).add(sortScoreMap.getOrDefault(didian, zero)); + dingXiang = getOrDefaultSafe(sortScoreMap,shijian, zero).add(getOrDefaultSafe(sortScoreMap,didian, zero)); } PdfUtil.Row titleRow = new PdfUtil.Row(); diff --git a/ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml b/ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml index 0a709c6..cfb61de 100644 --- a/ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml +++ b/ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml @@ -11,7 +11,7 @@ spring: # password: po3OynBO[M3579p6L7)o url: jdbc:mysql://127.0.0.1:3306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: 123456 + password: q7510327 # 从库数据源 slave: # 从数据源开关/默认关闭 @@ -126,6 +126,5 @@ informed: clientVersion: v1.8.3.0 # 医院id,不同医院部署的时候需要修改 -hospitalId: 178 -generalPassword: cga123# - +hospitalId: 174 +generalPassword: cga123# \ No newline at end of file diff --git a/ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml b/ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml index 579f7a3..cec7a44 100644 --- a/ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml +++ b/ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml @@ -62,13 +62,13 @@ spring: # redis 配置 redis: # 地址 - host: 172.16.21.24 + host: localhost # 端口,默认为6379 - port: 26379 + port: 6379 # 数据库索引 database: 1 # 密码 - password: redis111^# + password: 123456 # 连接超时时间 timeout: 10s lettuce: diff --git a/ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/AmsDao.xml b/ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/AmsDao.xml index 8d5d108..431fdba 100644 --- a/ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/AmsDao.xml +++ b/ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/AmsDao.xml @@ -27,7 +27,9 @@ SELECT qs.`code` AS scaleCode, qs.`name` AS scaleName, + qs.total_score AS totalScore, sum(q.score) as score, + esr.sort, count( DISTINCT q.questionId ) AS totalNum, count( DISTINCT q.answerQuestionId ) AS completedNum FROM @@ -109,7 +111,8 @@ GROUP BY q.id )qq LEFT JOIN ams_patient_answer_score pas on (pas.question_id = qq.id or FIND_IN_SET(pas.question_id, qq.subList)) - and pas.type IN ( 0, 2 ) and pas.del_flag = 0 and pas.evaluation_id = #{evaluationId} + and pas.type IN ( 0, 2 ) and pas.del_flag = 0 and score is not null and pas.evaluation_id = #{evaluationId} +-- 2026年3月2日09:56:55修改:score为空,不是已做的题目 WHERE qq.scale_code = #{scaleCode} diff --git a/ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/RmsDao.xml b/ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/RmsDao.xml index 236786f..9d50ae6 100644 --- a/ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/RmsDao.xml +++ b/ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/RmsDao.xml @@ -24,10 +24,10 @@ rr.remark, rr.working_score as workingScore, rr.initial_impression as initialImpression, - b.diagnosis_name as clinicalDiagnosis, + IFNULL(rr.clinical_diagnosis, b.diagnosis_name) as clinicalDiagnosis, rr.pasi, -- rr.department, - b.bed_number as bedNumber, + ifnull(rr.bed_number, b.bed_number) as bedNumber, pp.`name` as patientName, pp.patient_number as patientNumber, b.outpatient_no as hospitalNumber, @@ -40,10 +40,11 @@ ee.hospital, d.dept_name as hospitalName, b.outpatient_no as outpatientNo, - b.department, + IFNULL(rr.department, b.department) as department, b.doctor, ee.version, - h.version AS versionName + h.version AS versionName, + pp.birthday FROM ems_evaluation ee LEFT JOIN rms_report rr on ee.id = rr.evaluation_id @@ -86,7 +87,8 @@ group by ee.id qs.remark, qs.type AS type, qs.parent_code, - qs.sort + qs.sort, + ecr.combo_id AS comboId FROM qms_scale qs LEFT JOIN ems_evaluation_scale_relevance ecr ON ecr.scale_code = qs.`code` WHERE ecr.evaluation_id = #{evaluationId} @@ -105,7 +107,8 @@ group by ee.id qcd.remark, qcd.type, qcd.parent_code, - qcd.sort + qcd.sort, + null as comboId FROM t LEFT JOIN qms_cognitive_domain qcd on qcd.parent_code = t.CODE WHERE qcd.is_show = 1 @@ -1743,4 +1746,87 @@ group by ee.id group by code order by sort + + + + \ No newline at end of file diff --git a/web_admin/src/views/his/Evaluation/index.vue b/web_admin/src/views/his/Evaluation/index.vue index bc98a25..e925203 100644 --- a/web_admin/src/views/his/Evaluation/index.vue +++ b/web_admin/src/views/his/Evaluation/index.vue @@ -15,65 +15,73 @@ @keyup.enter.native="handleQuery" /> - -
- -
-
- - + + + + + + - - - + + - + + + + + + - - - 查看测评报告 - - - - 导入 - - 导出 - - 导出(指定量表) - - - - - + - + prop="scaleName" + key="scaleName" + minWidth="150" + > - - - { + this.workloadList = res.data; + }); + }, + + /** 获取科室数据 */ + getDeptTree() { + deptTreeSelect().then((response) => { + this.deptOptions = response.data; + }); + }, // 获取量表列表 getScaleLists() { getScaleList({}).then((res) => { @@ -406,11 +341,9 @@ export default { }, /** 查询列表 */ getList() { - console.log("查询数据"); this.loading = true; this.queryParams.param.patientId = ""; const query = this.$route.query; - console.log("query: ", query); if (query && query.patientId) { this.queryParams.param.patientId = query.patientId; } @@ -418,7 +351,7 @@ export default { this.queryParams.param.beginTime = this.queryParams.param.time[0]; this.queryParams.param.endTime = this.queryParams.param.time[1]; } - queryReportList(this.queryParams).then((res) => { + queryReport(this.queryParams).then((res) => { console.log("res: ", res); this.loading = false; this.evaluationList = [...res.data.list]; @@ -430,14 +363,13 @@ export default { this.resetForm("queryForm"); this.queryParams = { param: { + searchValue: "", + testerId: "", + needPlan: "", beginTime: "", - // departmentsId: null, endTime: "", - // hospitalId: null, - scaleCode: "", - searchValue: "", - testerName: "", - patientId: "", + code: "", + deptId: undefined, }, }; this.handleQuery(); @@ -456,14 +388,14 @@ export default { window.open(apiUrl + proxyUrl + informedUrl); this.$message.success("打开知情同意.pdf文件"); } else { - this.$message.warning("当前测评报告暂无知情同意信息"); + this.$message.warning("当前评估报告暂无知情同意信息"); } }, - // 查看测评报告 + // 查看评估报告 handleReport(row) { this.getQueryReportDetail(row.evaluationId); }, - // 获取测评报告单详情 + // 获取评估报告单详情 getQueryReportDetail(evaluationId) { const param = { evaluationId: evaluationId || this.ids[0], @@ -480,7 +412,7 @@ export default { // this.$message.warning("删除"); // const ids = row.id || this.ids; // this.$modal - // .confirm("是否确认删除当前选择的测评记录?") + // .confirm("是否确认删除当前选择的评估记录?") // .then(function () { // // return delReceivegoods(goodsIds); // return true; @@ -534,10 +466,10 @@ export default { this.queryParams.param; let exportParam = { param: { - beginTime, // 测评开始时间 - endTime, //测评结束时间 + beginTime, // 评估开始时间 + endTime, //评估结束时间 searchValue, //关键字 - testerName, //测评师 + testerName, //评估师 completeStatus, evaluationIds: this.ids, scaleCodes: this.codeForm.scaleCodes, @@ -549,47 +481,19 @@ export default { { ...exportParam, }, - `测评记录.xlsx` + `评估记录.xlsx` ); } }); }, // 导出操作 handleExport() { - // const data = this.chooseData[0]; - // const param = { - // evaluationId: data.evaluationId, - // reportId: data.reportId, - // scaleCode: data.scaleCode, - // signId: null, - // }; - // exportReport(param).then((res) => { - // console.log("res: ", res); - // if (res.data.path) { - // window.open(apiUrl + proxyUrl + res.data.path); - // } else { - // this.$message.error("导出失败"); - // } - // }); - let { beginTime, endTime, searchValue, testerName, completeStatus } = - this.queryParams.param; - - let exportParam = { - param: { - beginTime, // 测评开始时间 - endTime, //测评结束时间 - searchValue, //关键字 - testerName, //测评师 - completeStatus, - }, - }; - this.download1( - "export/exportLdPatient", + "/rms/exportEvaluation", { - ...exportParam, + ...this.queryParams, }, - `测评记录.xlsx` + `测评管理_${new Date().getTime()}.xlsx` ); }, },