From c721c068f642fda5219dc426fff4e6c2ec2771a2 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Tue, 1 Jun 2021 17:17:19 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=AD=94=E6=A1=88?= =?UTF-8?q?=E6=97=B6=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ht/src/main/java/com/ccsens/ht/service/QuestionService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ht/src/main/java/com/ccsens/ht/service/QuestionService.java b/ht/src/main/java/com/ccsens/ht/service/QuestionService.java index 8df7dbba..c468cab6 100644 --- a/ht/src/main/java/com/ccsens/ht/service/QuestionService.java +++ b/ht/src/main/java/com/ccsens/ht/service/QuestionService.java @@ -304,7 +304,7 @@ public class QuestionService implements IQuestionService { return; } Integer maxSort = htQuestionDao.selectMaxSort(question.getEvaluationCode()); - if (question.getSort() != null && question.getSort().intValue() >= maxSort) { + if (question.getSort() != null && maxSort != null && question.getSort().intValue() >= maxSort) { report.setShowStatus(Constant.Ht.Report.SHOW_HISTORY); htPatientReportMapper.updateByPrimaryKeySelective(report); } From 92700abfe840521919f8f6f8d5a6ca2ea6227271 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Wed, 9 Jun 2021 18:16:55 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=8D=952?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/ht/service/ExportService.java | 23 +++++++++++++------ .../com/ccsens/ht/service/ImportService.java | 2 ++ .../java/com/ccsens/ht/uitl/Constant.java | 8 +++++++ ht/src/main/resources/application.yml | 4 ++-- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/ht/src/main/java/com/ccsens/ht/service/ExportService.java b/ht/src/main/java/com/ccsens/ht/service/ExportService.java index c6003410..382fae46 100644 --- a/ht/src/main/java/com/ccsens/ht/service/ExportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/ExportService.java @@ -89,7 +89,7 @@ public class ExportService implements IExportService { switch (param.getReport()) { case Constant.Ht.Report.PARENT_CODE_2: case Constant.Ht.Report.PARENT_CODE_3: - writeParentCode2(content, detail.getScores()); + writeParentCode2(param.getReport(), content, detail.getScores()); //添加初步印象和受试者合作评分 addScoreAndImpression(detail.getPatient().getInitialImpression(), content); //添加测评员和报告日期 @@ -173,9 +173,9 @@ public class ExportService implements IExportService { List scores = patientReportService.getReportScores(reportScore, param.getId()); //生成写入pdf数据 List content = new ArrayList<>(); - writeParentCode2(content, scores); + writeParentCode2(param.getCode(),content, scores); //添加初步印象和受试者合作评分 - addScoreAndImpression(reportPatient.getInitialImpression(), content); + addScoreAndImpression("", content); //添加测评员和报告日期 initLast(content, 2); //表头 @@ -183,7 +183,8 @@ public class ExportService implements IExportService { String title = String.join(" ", split); //生成pdf并返回路径 - String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, title, Constant.Ht.Report.PARENT_NAME, new PdfUtil.Margin(), reportPatient.toPdfRow(), content); + String subHead = CollectionUtil.isEmpty(scores) ? "" : "认知评估量表("+scores.get(0).getName() + ")报告单"; + String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, title, subHead, new PdfUtil.Margin(), reportPatient.toPdfRow(), content); //TODO 将路径存入报告单关联信息表 // reportRelevance.setPdfUrl(path); // reportRelevanceMapper.updateByPrimaryKeySelective(reportRelevance); @@ -239,7 +240,14 @@ public class ExportService implements IExportService { content.add(impression); } - private void writeParentCode2(List content, List scores) { + private void writeParentCode2(String code, List content, List scores) { + + if (StrUtil.isNotBlank(code) && Constant.Export.PURPOSE_MAP.containsKey(code)) { + PdfUtil.Row purpose = new PdfUtil.Row(); + purpose.addCell(new PdfUtil.Cell(Constant.Export.PURPOSE_MAP.get(code),4,1)); + content.add(purpose); + } + PdfUtil.Row title = new PdfUtil.Row(); title.addCell(new PdfUtil.Cell("项目",2,1)); // title.addCell(new PdfUtil.Cell()); @@ -250,12 +258,13 @@ public class ExportService implements IExportService { title.addCell(r); content.add(title); scores.forEach(reportScore -> { + String name = StrUtil.isEmpty(reportScore.getDescription()) ? reportScore.getName() : reportScore.getDescription(); if (CollectionUtil.isEmpty(reportScore.getSubReport())) { PdfUtil.Row row = new PdfUtil.Row(); PdfUtil.Cell cellName = new PdfUtil.Cell(); cellName.setColSpan(2); - cellName.setContent(reportScore.getName()); + cellName.setContent(name); row.addCell(cellName); PdfUtil.Cell cellScore = new PdfUtil.Cell(); @@ -275,7 +284,7 @@ public class ExportService implements IExportService { if (i == 0) { PdfUtil.Cell cellName = new PdfUtil.Cell(); cellName.setRowSpan(reportScore.getSubReport().size()); - cellName.setContent(reportScore.getName()); + cellName.setContent(name); row.addCell(cellName); } row.addCell(new PdfUtil.Cell(score.getName())); diff --git a/ht/src/main/java/com/ccsens/ht/service/ImportService.java b/ht/src/main/java/com/ccsens/ht/service/ImportService.java index 4a3e2ba2..dfaedd1d 100644 --- a/ht/src/main/java/com/ccsens/ht/service/ImportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/ImportService.java @@ -482,6 +482,7 @@ public class ImportService implements IImportService { * @param questionId 试题ID * @param sort 排序 * @param optionDescList 记录其他补充 + * @param optionIds 要删除的其他记录的选项ID * @return 选项 */ private HtQuestionOption initOption(Object[] objs, Long questionId, int sort, List optionDescList, List optionIds) { @@ -525,6 +526,7 @@ public class ImportService implements IImportService { for (Object obj: descArr) { HtQuestionOptionDesc desc = JSONObject.parseObject(JSON.toJSONString(obj), HtQuestionOptionDesc.class); desc.setId(snowflake.nextId()); + desc.setOptionId(option.getId()); optionDescList.add(desc); } } diff --git a/ht/src/main/java/com/ccsens/ht/uitl/Constant.java b/ht/src/main/java/com/ccsens/ht/uitl/Constant.java index 153445aa..ec64ce25 100644 --- a/ht/src/main/java/com/ccsens/ht/uitl/Constant.java +++ b/ht/src/main/java/com/ccsens/ht/uitl/Constant.java @@ -54,6 +54,14 @@ public class Constant { } public static final String MMSE_PURPOSE = "检查目的:MMSE用于筛查痴呆患者、判断认知损害的严重程度并跟踪记录病情变化情况。涵盖了定向力、记忆力、计算及注意力、语言和视空间能力等认知域。"; public static final String MOCA_PURPOSE = "检查目的:MoCA作为总体认知功能评估的筛查量表,覆盖注意力、执行功能、记忆、语言、视空间结构、抽象思维、计算和定向力等认知域。"; + public final static Map PURPOSE_MAP = new HashMap<>(); + static { + PURPOSE_MAP.put("AVLT","检查目的:临床记忆检测(听觉词语记忆测验)用于各种认知障碍疾病记忆功能评估。包括即刻记忆、短延迟回忆、长延迟回忆、线索回忆和再认。反应学习能力、记忆保持率、辨正能力、概念记忆等。"); + PURPOSE_MAP.put("DST","检查目的:数字广度测验为注意力测试最基本的方法,包括数字广度顺序测验和数字广度倒序测验两项。"); + PURPOSE_MAP.put("TMT","检查目的:空间位置记忆广度测验(连线测验)是最常用的神经心理学测验之一,它反映注意、次序排列、心理灵活性、视觉搜索和运动功能,反映定势转移能力,同时反映手-眼协调能力、空间知觉和注意能力。"); + PURPOSE_MAP.put("BNT","检查目的:图片词汇测验(波士顿命名测验)是目前临床上最常见的检测命名障碍神经心理量表。是一种常见的视觉对偶命名测验。"); + PURPOSE_MAP.put("LFT","检查目的:立方体组合测验(积木测验)用于检测图形识别及构造功能,可评估受试者辨认空间关系能力、视觉结构分析和综合运用能力,以及视觉-运动协调性等。用于阿尔茨海默病及其他认知障碍疾病的认知功能筛查和鉴别诊断。"); + } } public static final class ReportExportTitle{ diff --git a/ht/src/main/resources/application.yml b/ht/src/main/resources/application.yml index b9b264a7..f59084b0 100644 --- a/ht/src/main/resources/application.yml +++ b/ht/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: prod - include: common, util-prod + active: test + include: common, util-test From a9216c0e7875fab83fdaf6887bc1ccfac27a5a15 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Wed, 9 Jun 2021 18:24:04 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E8=B0=83=E6=95=B4pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ht/src/main/java/com/ccsens/ht/service/ExportService.java | 4 +++- util/src/main/java/com/ccsens/util/PdfUtil.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ht/src/main/java/com/ccsens/ht/service/ExportService.java b/ht/src/main/java/com/ccsens/ht/service/ExportService.java index 382fae46..1423d29b 100644 --- a/ht/src/main/java/com/ccsens/ht/service/ExportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/ExportService.java @@ -244,7 +244,9 @@ public class ExportService implements IExportService { if (StrUtil.isNotBlank(code) && Constant.Export.PURPOSE_MAP.containsKey(code)) { PdfUtil.Row purpose = new PdfUtil.Row(); - purpose.addCell(new PdfUtil.Cell(Constant.Export.PURPOSE_MAP.get(code),4,1)); + PdfUtil.Cell cell = new PdfUtil.Cell(Constant.Export.PURPOSE_MAP.get(code), 4, 1); + cell.setBorderRight(1); + purpose.addCell(cell); content.add(purpose); } diff --git a/util/src/main/java/com/ccsens/util/PdfUtil.java b/util/src/main/java/com/ccsens/util/PdfUtil.java index abd72ab4..2034380d 100644 --- a/util/src/main/java/com/ccsens/util/PdfUtil.java +++ b/util/src/main/java/com/ccsens/util/PdfUtil.java @@ -66,7 +66,7 @@ public class PdfUtil { document.add(subheadPar); } // 每行加空白 - fillBlankRow(document, new Font(bfChinese, 8, Font.NORMAL)); + fillBlankRow(document, new Font(bfChinese, 3, Font.NORMAL)); //设置介绍内容 if (CollectionUtil.isNotEmpty(intros)) { fillRow(intros, document); From ba94d289bc73909573292d77d2d2cb09d4b9faf6 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Wed, 9 Jun 2021 18:25:58 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E8=B0=83=E6=95=B4pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ht/src/main/java/com/ccsens/ht/service/ExportService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/ht/src/main/java/com/ccsens/ht/service/ExportService.java b/ht/src/main/java/com/ccsens/ht/service/ExportService.java index 1423d29b..c6cc66de 100644 --- a/ht/src/main/java/com/ccsens/ht/service/ExportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/ExportService.java @@ -246,6 +246,7 @@ public class ExportService implements IExportService { PdfUtil.Row purpose = new PdfUtil.Row(); PdfUtil.Cell cell = new PdfUtil.Cell(Constant.Export.PURPOSE_MAP.get(code), 4, 1); cell.setBorderRight(1); + cell.setCenter(false); purpose.addCell(cell); content.add(purpose); } From 1a50ba9f986855dc585e53f18f5414c4d3497c68 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Wed, 9 Jun 2021 18:41:19 +0800 Subject: [PATCH 05/10] =?UTF-8?q?20210609=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E5=8D=95=E4=BA=8C=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ht/src/main/resources/application.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ht/src/main/resources/application.yml b/ht/src/main/resources/application.yml index f59084b0..b9b264a7 100644 --- a/ht/src/main/resources/application.yml +++ b/ht/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: test - include: common, util-test + active: prod + include: common, util-prod From b27038d615cdea494933dbfb1d3553c8c29f3908 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Fri, 11 Jun 2021 09:31:16 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E8=AF=95=E9=A2=98=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/ht/bean/po/HtQuestionShow.java | 128 +++ .../ht/bean/po/HtQuestionShowExample.java | 821 ++++++++++++++++++ .../com/ccsens/ht/bean/vo/QuestionShowVo.java | 63 ++ .../com/ccsens/ht/bean/vo/QuestionVo.java | 59 +- .../ht/persist/dao/HtQuestionShowDao.java | 17 + .../persist/mapper/HtQuestionShowMapper.java | 30 + .../com/ccsens/ht/service/ImportService.java | 27 +- .../ccsens/ht/service/QuestionService.java | 40 +- .../java/com/ccsens/ht/uitl/Constant.java | 24 + ht/src/main/resources/application.yml | 4 +- .../mapper_dao/HtQuestionShowDao.xml | 13 + .../mapper_raw/HtQuestionShowMapper.xml | 291 +++++++ .../test/java/com/ccsens/util/JsonTest.java | 147 ++++ 13 files changed, 1654 insertions(+), 10 deletions(-) create mode 100644 ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShow.java create mode 100644 ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShowExample.java create mode 100644 ht/src/main/java/com/ccsens/ht/bean/vo/QuestionShowVo.java create mode 100644 ht/src/main/java/com/ccsens/ht/persist/dao/HtQuestionShowDao.java create mode 100644 ht/src/main/java/com/ccsens/ht/persist/mapper/HtQuestionShowMapper.java create mode 100644 ht/src/main/resources/mapper_dao/HtQuestionShowDao.xml create mode 100644 ht/src/main/resources/mapper_raw/HtQuestionShowMapper.xml create mode 100644 util/src/test/java/com/ccsens/util/JsonTest.java diff --git a/ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShow.java b/ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShow.java new file mode 100644 index 00000000..59a397d6 --- /dev/null +++ b/ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShow.java @@ -0,0 +1,128 @@ +package com.ccsens.ht.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class HtQuestionShow implements Serializable { + private Long id; + + private Long questionId; + + private Byte showType; + + private Byte showNode; + + private String param; + + private Byte sort; + + private String remark; + + private Date createTime; + + private Date updateTime; + + private Byte isDel; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getQuestionId() { + return questionId; + } + + public void setQuestionId(Long questionId) { + this.questionId = questionId; + } + + public Byte getShowType() { + return showType; + } + + public void setShowType(Byte showType) { + this.showType = showType; + } + + public Byte getShowNode() { + return showNode; + } + + public void setShowNode(Byte showNode) { + this.showNode = showNode; + } + + public String getParam() { + return param; + } + + public void setParam(String param) { + this.param = param == null ? null : param.trim(); + } + + public Byte getSort() { + return sort; + } + + public void setSort(Byte sort) { + this.sort = sort; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Byte getIsDel() { + return isDel; + } + + public void setIsDel(Byte isDel) { + this.isDel = isDel; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", questionId=").append(questionId); + sb.append(", showType=").append(showType); + sb.append(", showNode=").append(showNode); + sb.append(", param=").append(param); + sb.append(", sort=").append(sort); + sb.append(", remark=").append(remark); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", isDel=").append(isDel); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShowExample.java b/ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShowExample.java new file mode 100644 index 00000000..b2ee9160 --- /dev/null +++ b/ht/src/main/java/com/ccsens/ht/bean/po/HtQuestionShowExample.java @@ -0,0 +1,821 @@ +package com.ccsens.ht.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HtQuestionShowExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public HtQuestionShowExample() { + 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 andQuestionIdIsNull() { + addCriterion("question_id is null"); + return (Criteria) this; + } + + public Criteria andQuestionIdIsNotNull() { + addCriterion("question_id is not null"); + return (Criteria) this; + } + + public Criteria andQuestionIdEqualTo(Long value) { + addCriterion("question_id =", value, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdNotEqualTo(Long value) { + addCriterion("question_id <>", value, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdGreaterThan(Long value) { + addCriterion("question_id >", value, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdGreaterThanOrEqualTo(Long value) { + addCriterion("question_id >=", value, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdLessThan(Long value) { + addCriterion("question_id <", value, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdLessThanOrEqualTo(Long value) { + addCriterion("question_id <=", value, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdIn(List values) { + addCriterion("question_id in", values, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdNotIn(List values) { + addCriterion("question_id not in", values, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdBetween(Long value1, Long value2) { + addCriterion("question_id between", value1, value2, "questionId"); + return (Criteria) this; + } + + public Criteria andQuestionIdNotBetween(Long value1, Long value2) { + addCriterion("question_id not between", value1, value2, "questionId"); + return (Criteria) this; + } + + public Criteria andShowTypeIsNull() { + addCriterion("show_type is null"); + return (Criteria) this; + } + + public Criteria andShowTypeIsNotNull() { + addCriterion("show_type is not null"); + return (Criteria) this; + } + + public Criteria andShowTypeEqualTo(Byte value) { + addCriterion("show_type =", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeNotEqualTo(Byte value) { + addCriterion("show_type <>", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeGreaterThan(Byte value) { + addCriterion("show_type >", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("show_type >=", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeLessThan(Byte value) { + addCriterion("show_type <", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeLessThanOrEqualTo(Byte value) { + addCriterion("show_type <=", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeIn(List values) { + addCriterion("show_type in", values, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeNotIn(List values) { + addCriterion("show_type not in", values, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeBetween(Byte value1, Byte value2) { + addCriterion("show_type between", value1, value2, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeNotBetween(Byte value1, Byte value2) { + addCriterion("show_type not between", value1, value2, "showType"); + return (Criteria) this; + } + + public Criteria andShowNodeIsNull() { + addCriterion("show_node is null"); + return (Criteria) this; + } + + public Criteria andShowNodeIsNotNull() { + addCriterion("show_node is not null"); + return (Criteria) this; + } + + public Criteria andShowNodeEqualTo(Byte value) { + addCriterion("show_node =", value, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeNotEqualTo(Byte value) { + addCriterion("show_node <>", value, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeGreaterThan(Byte value) { + addCriterion("show_node >", value, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeGreaterThanOrEqualTo(Byte value) { + addCriterion("show_node >=", value, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeLessThan(Byte value) { + addCriterion("show_node <", value, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeLessThanOrEqualTo(Byte value) { + addCriterion("show_node <=", value, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeIn(List values) { + addCriterion("show_node in", values, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeNotIn(List values) { + addCriterion("show_node not in", values, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeBetween(Byte value1, Byte value2) { + addCriterion("show_node between", value1, value2, "showNode"); + return (Criteria) this; + } + + public Criteria andShowNodeNotBetween(Byte value1, Byte value2) { + addCriterion("show_node not between", value1, value2, "showNode"); + return (Criteria) this; + } + + public Criteria andParamIsNull() { + addCriterion("param is null"); + return (Criteria) this; + } + + public Criteria andParamIsNotNull() { + addCriterion("param is not null"); + return (Criteria) this; + } + + public Criteria andParamEqualTo(String value) { + addCriterion("param =", value, "param"); + return (Criteria) this; + } + + public Criteria andParamNotEqualTo(String value) { + addCriterion("param <>", value, "param"); + return (Criteria) this; + } + + public Criteria andParamGreaterThan(String value) { + addCriterion("param >", value, "param"); + return (Criteria) this; + } + + public Criteria andParamGreaterThanOrEqualTo(String value) { + addCriterion("param >=", value, "param"); + return (Criteria) this; + } + + public Criteria andParamLessThan(String value) { + addCriterion("param <", value, "param"); + return (Criteria) this; + } + + public Criteria andParamLessThanOrEqualTo(String value) { + addCriterion("param <=", value, "param"); + return (Criteria) this; + } + + public Criteria andParamLike(String value) { + addCriterion("param like", value, "param"); + return (Criteria) this; + } + + public Criteria andParamNotLike(String value) { + addCriterion("param not like", value, "param"); + return (Criteria) this; + } + + public Criteria andParamIn(List values) { + addCriterion("param in", values, "param"); + return (Criteria) this; + } + + public Criteria andParamNotIn(List values) { + addCriterion("param not in", values, "param"); + return (Criteria) this; + } + + public Criteria andParamBetween(String value1, String value2) { + addCriterion("param between", value1, value2, "param"); + return (Criteria) this; + } + + public Criteria andParamNotBetween(String value1, String value2) { + addCriterion("param not between", value1, value2, "param"); + 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(Byte value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(Byte value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(Byte value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(Byte value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(Byte value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(Byte 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(Byte value1, Byte value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(Byte value1, Byte value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List 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 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 andIsDelIsNull() { + addCriterion("is_del is null"); + return (Criteria) this; + } + + public Criteria andIsDelIsNotNull() { + addCriterion("is_del is not null"); + return (Criteria) this; + } + + public Criteria andIsDelEqualTo(Byte value) { + addCriterion("is_del =", value, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelNotEqualTo(Byte value) { + addCriterion("is_del <>", value, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelGreaterThan(Byte value) { + addCriterion("is_del >", value, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelGreaterThanOrEqualTo(Byte value) { + addCriterion("is_del >=", value, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelLessThan(Byte value) { + addCriterion("is_del <", value, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelLessThanOrEqualTo(Byte value) { + addCriterion("is_del <=", value, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelIn(List values) { + addCriterion("is_del in", values, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelNotIn(List values) { + addCriterion("is_del not in", values, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelBetween(Byte value1, Byte value2) { + addCriterion("is_del between", value1, value2, "isDel"); + return (Criteria) this; + } + + public Criteria andIsDelNotBetween(Byte value1, Byte value2) { + addCriterion("is_del not between", value1, value2, "isDel"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/ht/src/main/java/com/ccsens/ht/bean/vo/QuestionShowVo.java b/ht/src/main/java/com/ccsens/ht/bean/vo/QuestionShowVo.java new file mode 100644 index 00000000..4dbc7236 --- /dev/null +++ b/ht/src/main/java/com/ccsens/ht/bean/vo/QuestionShowVo.java @@ -0,0 +1,63 @@ +package com.ccsens.ht.bean.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2021/6/10 16:29 + */ +public class QuestionShowVo { + + @Data + @ApiModel("显示信息") + public static class Show{ + @ApiModelProperty("类型 0:倒计时 1:限制选项数量 2:选中某些指定选项执行操作") + private byte showType; + } + @Data + @ApiModel("选项限制") + public static class OptionLimit extends Show{ + @ApiModelProperty("限制类型 0:限制数量") + private byte type; + @ApiModelProperty("属性") + private String name; + @ApiModelProperty("最大") + private byte max; + @ApiModelProperty("最小") + private byte min; + } + + @Data + @ApiModel("特殊指定-返回") + public static class OptionSpecial extends Show{ + @ApiModelProperty("限制类型 0:选中选项数量达到最大后,内容非指定选项,则显示对应信息") + private byte type; + @ApiModelProperty("选项ID") + private List optionIds = new ArrayList<>(); + @ApiModelProperty("选项序号") + private List optionNums; + @ApiModelProperty("显示类型 0:图片") + private byte show; + @ApiModelProperty("内容") + private String content; + } + + @ApiModel("倒计时配置") + @Data + public static class MesTimer { + @ApiModelProperty("限制类型 0:选中选项数量达到最大后,内容非指定选项,则显示对应信息") + private byte type; + @ApiModelProperty("量表") + private String code; + @ApiModelProperty("序号") + private byte sort; + @ApiModelProperty("时长") + private int time; + } +} diff --git a/ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java b/ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java index c007fecc..919285da 100644 --- a/ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java +++ b/ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java @@ -1,13 +1,16 @@ package com.ccsens.ht.bean.vo; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; import com.ccsens.ht.bean.po.HtPatientQuestionRecord; import com.ccsens.ht.bean.po.HtQuestion; import com.ccsens.ht.bean.po.HtQuestionIntroducer; +import com.ccsens.ht.bean.po.HtQuestionShow; +import com.ccsens.ht.uitl.Constant; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.apache.ibatis.javassist.runtime.Desc; import org.springframework.beans.BeanUtils; import org.springframework.util.CollectionUtils; @@ -46,13 +49,13 @@ public class QuestionVo { super(); } - public Query(Question question, List