From a7f74616b1afba98485b8ffe1bfbd08f108e2942 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Thu, 11 Mar 2021 09:38:11 +0800 Subject: [PATCH] =?UTF-8?q?ht=20=E6=90=9C=E7=B4=A2=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ht/api/PatientReportController.java | 3 +- .../ht/api/PatientReportSearchController.java | 63 +++++++++++++++++++ .../ht/bean/dto/PatientReportSearchDto.java | 38 +++++++++++ .../ht/bean/vo/PatientReportSearchVo.java | 33 ++++++++++ .../ht/persist/dao/HtPatientReportDao.java | 9 +++ .../ccsens/ht/persist/dao/HtReportDao.java | 9 +++ .../ht/service/IPatientReportService.java | 15 +++++ .../ht/service/PatientReportService.java | 34 +++++++++- ht/src/main/resources/application.yml | 4 +- .../mapper_dao/HtPatientReportDao.xml | 32 ++++++++++ .../main/resources/mapper_dao/HtReportDao.xml | 31 +++++++++ .../question/bean/vo/PatientReportVo.java | 4 +- .../service/PatientReportService.java | 2 +- .../src/main/resources/application-dev.yml | 4 +- 14 files changed, 271 insertions(+), 10 deletions(-) create mode 100644 ht/src/main/java/com/ccsens/ht/api/PatientReportSearchController.java create mode 100644 ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportSearchDto.java create mode 100644 ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportSearchVo.java diff --git a/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java b/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java index f695b4d1..55edf517 100644 --- a/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java +++ b/ht/src/main/java/com/ccsens/ht/api/PatientReportController.java @@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import javax.validation.Valid; import java.io.IOException; import java.util.List; @@ -35,7 +36,7 @@ import java.util.List; @RestController public class PatientReportController { - @Autowired + @Resource private IPatientReportService patientReportService; @MustLogin diff --git a/ht/src/main/java/com/ccsens/ht/api/PatientReportSearchController.java b/ht/src/main/java/com/ccsens/ht/api/PatientReportSearchController.java new file mode 100644 index 00000000..d0652c32 --- /dev/null +++ b/ht/src/main/java/com/ccsens/ht/api/PatientReportSearchController.java @@ -0,0 +1,63 @@ +package com.ccsens.ht.api; + +import com.ccsens.cloudutil.annotation.MustLogin; +import com.ccsens.ht.annotation.DoctorAudit; +import com.ccsens.ht.bean.dto.PatientReportDto; +import com.ccsens.ht.bean.dto.PatientReportSearchDto; +import com.ccsens.ht.bean.vo.PatientReportSearchVo; +import com.ccsens.ht.bean.vo.PatientReportVo; +import com.ccsens.ht.service.IPatientReportService; +import com.ccsens.util.JsonResponse; +import com.ccsens.util.bean.dto.QueryDto; +import io.swagger.annotations.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2021/3/10 15:03 + */ +@Slf4j +@Api(tags = "报告单搜索",value = "报告单搜索条件,搜索") +@RestController +@RequestMapping("/patientReport") +public class PatientReportSearchController { + @Resource + private IPatientReportService patientReportService; + + @MustLogin + @DoctorAudit + @ApiOperation(value = "查询搜索条件",notes = "whj 查询搜索条件") + @ApiImplicitParams({ + @ApiImplicitParam(name = "json", value = "查询搜索条件", required = true) + }) + @RequestMapping(value="/searchParam", method = RequestMethod.POST) + public JsonResponse searchParam(@RequestBody @ApiParam @Valid QueryDto dto){ + log.info("查询搜索条件:{}", dto); + List params = patientReportService.searchParam(dto.getParam()); + log.info("查询搜索条件已完成"); + return JsonResponse.newInstance().ok(params); + } + + @MustLogin + @DoctorAudit + @ApiOperation(value = "根据条件搜索报告单",notes = "whj 搜索报告单") + @ApiImplicitParams({ + @ApiImplicitParam(name = "json", value = "查询搜索条件", required = true) + }) + @RequestMapping(value="/search", method = RequestMethod.POST) + public JsonResponse search(@RequestBody @ApiParam @Valid QueryDto dto){ + log.info("搜索报告单:{}", dto); + List params = patientReportService.search(dto.getParam()); + log.info("搜索报告单已完成"); + return JsonResponse.newInstance().ok(params); + } +} diff --git a/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportSearchDto.java b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportSearchDto.java new file mode 100644 index 00000000..74f8a004 --- /dev/null +++ b/ht/src/main/java/com/ccsens/ht/bean/dto/PatientReportSearchDto.java @@ -0,0 +1,38 @@ +package com.ccsens.ht.bean.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2021/3/10 16:21 + */ +public class PatientReportSearchDto { + @Data + @ApiModel("搜索条件-请求参数") + public static class SearchParam{ + @ApiModelProperty("查询类型") + @NotEmpty(message = "请输入查询报告单类型") + private String parentCode; + } + + @Data + @ApiModel("搜索报告单参数列表-请求") + public static class SearchList { + private List codes; + } + + @Data + @ApiModel("搜索报告单参数-请求") + public static class Search { + @NotEmpty(message="请选择查询类型") + private String code; + private Integer start; + private Integer end; + } +} diff --git a/ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportSearchVo.java b/ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportSearchVo.java new file mode 100644 index 00000000..f707d158 --- /dev/null +++ b/ht/src/main/java/com/ccsens/ht/bean/vo/PatientReportSearchVo.java @@ -0,0 +1,33 @@ +package com.ccsens.ht.bean.vo; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @description: + * @author: whj + * @time: 2021/3/10 16:06 + */ +public class PatientReportSearchVo { + + @Data + @ApiModel("搜索条件-响应") + public static class SearchParam { + private Long id; + private String code; + private String name; + private byte optionStatus; + private String parentCode; + private List children = new ArrayList<>(); + } + + @Data + @ApiModel("搜索-响应") + public static class Search { + private Long id; + private String name; + } +} diff --git a/ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java b/ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java index 86aece6b..c6c9c691 100644 --- a/ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java +++ b/ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java @@ -1,6 +1,8 @@ package com.ccsens.ht.persist.dao; import com.ccsens.ht.bean.dto.PatientReportDto; +import com.ccsens.ht.bean.dto.PatientReportSearchDto; +import com.ccsens.ht.bean.vo.PatientReportSearchVo; import com.ccsens.ht.bean.vo.PatientReportVo; import com.ccsens.ht.persist.mapper.HtPatientReportMapper; import org.apache.ibatis.annotations.Param; @@ -95,4 +97,11 @@ public interface HtPatientReportDao extends HtPatientReportMapper { * @return */ List queryReportAnswer(@Param("id")Long id, @Param("evaluationCode")String evaluationCode); + + /** + * 根据分数搜索报告单 + * @param codes 分数 + * @return 报告单 + */ + List search(@Param("codes") List codes); } diff --git a/ht/src/main/java/com/ccsens/ht/persist/dao/HtReportDao.java b/ht/src/main/java/com/ccsens/ht/persist/dao/HtReportDao.java index d4a75a54..2d7399cf 100644 --- a/ht/src/main/java/com/ccsens/ht/persist/dao/HtReportDao.java +++ b/ht/src/main/java/com/ccsens/ht/persist/dao/HtReportDao.java @@ -1,7 +1,9 @@ package com.ccsens.ht.persist.dao; import com.ccsens.ht.bean.po.HtReport; +import com.ccsens.ht.bean.vo.PatientReportSearchVo; import com.ccsens.ht.persist.mapper.HtReportMapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -28,4 +30,11 @@ public interface HtReportDao extends HtReportMapper { *@date: 2019/11/19 10:10 */ List queryReportShow(); + + /** + * 查询所有下级菜单和是否有试题 + * @param parentCode 父code + * @return 搜索条件 + */ + List queryParam(@Param("parentCode") String parentCode); } diff --git a/ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java b/ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java index 47bdc37c..c2cd78d1 100644 --- a/ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java @@ -1,7 +1,9 @@ package com.ccsens.ht.service; import com.ccsens.ht.bean.dto.PatientReportDto; +import com.ccsens.ht.bean.dto.PatientReportSearchDto; import com.ccsens.ht.bean.po.HtDoctor; +import com.ccsens.ht.bean.vo.PatientReportSearchVo; import com.ccsens.ht.bean.vo.PatientReportVo; import com.ccsens.util.CodeEnum; import com.ccsens.util.JsonResponse; @@ -142,4 +144,17 @@ public interface IPatientReportService { List queryReportAnswer(PatientReportDto.QueryReportAnswer param, Long userId); + /** + * 查询报告单的搜索条件 + * @param param 父code + * @return 搜索条件 + */ + List searchParam(PatientReportSearchDto.SearchParam param); + + /** + * 搜索报告单 + * @param param 搜索列表 + * @return 报告单 + */ + List search(PatientReportSearchDto.SearchList param); } diff --git a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java b/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java index 0743a34c..59c7f6c0 100644 --- a/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/PatientReportService.java @@ -7,11 +7,14 @@ import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.ccsens.ht.bean.dto.PatientReportDto; +import com.ccsens.ht.bean.dto.PatientReportSearchDto; import com.ccsens.ht.bean.po.*; +import com.ccsens.ht.bean.vo.PatientReportSearchVo; import com.ccsens.ht.bean.vo.PatientReportVo; import com.ccsens.ht.persist.dao.HtDoctorDao; import com.ccsens.ht.persist.dao.HtPatientReportDao; import com.ccsens.ht.persist.dao.HtPositionDao; +import com.ccsens.ht.persist.dao.HtReportDao; import com.ccsens.ht.persist.mapper.HtPatientFollowUpMapper; import com.ccsens.ht.persist.mapper.HtPatientMapper; import com.ccsens.ht.persist.mapper.HtPatientReportRecordMapper; @@ -22,7 +25,6 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.github.pagehelper.StringUtil; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -46,7 +48,7 @@ import java.util.concurrent.atomic.AtomicReference; @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public class PatientReportService implements IPatientReportService { - @Autowired + @Resource private Snowflake snowflake; @Resource private HtDoctorDao htDoctorDao; @@ -60,6 +62,8 @@ public class PatientReportService implements IPatientReportService { private HtPatientReportRecordMapper htPatientReportRecordMapper; @Resource private HtPatientFollowUpMapper htPatientFollowUpMapper; + @Resource + private HtReportDao htReportDao; @Override public JsonResponse generatePatientReport(PatientReportDto.Generate generate, Long userId) { @@ -577,5 +581,31 @@ public class PatientReportService implements IPatientReportService { return htPatientReportDao.queryReportAnswer(param.getId(),param.getEvaluationCode()); } + @Override + public List searchParam(PatientReportSearchDto.SearchParam param) { + List list = htReportDao.queryParam(param.getParentCode()); + if (CollectionUtil.isEmpty(list)) { + return list; + } + Map map = new HashMap<>(); + List nodes = new ArrayList<>(); + list.forEach(searchParam -> { + if (param.getParentCode().equals(searchParam.getParentCode())) { + nodes.add(searchParam); + } else { + PatientReportSearchVo.SearchParam parent = map.get(searchParam.getParentCode()); + parent.getChildren().add(searchParam); + } + map.put(searchParam.getCode(), searchParam); + }); + return nodes; + } + + @Override + public List search(PatientReportSearchDto.SearchList param) { + List list = htPatientReportDao.search(param.getCodes()); + return list; + } + } diff --git a/ht/src/main/resources/application.yml b/ht/src/main/resources/application.yml index d082c0ea..5c2cd5c4 100644 --- a/ht/src/main/resources/application.yml +++ b/ht/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: prod - include: common, util-prod \ No newline at end of file + active: dev + include: common, util-dev \ No newline at end of file diff --git a/ht/src/main/resources/mapper_dao/HtPatientReportDao.xml b/ht/src/main/resources/mapper_dao/HtPatientReportDao.xml index 4582b170..afb9de04 100644 --- a/ht/src/main/resources/mapper_dao/HtPatientReportDao.xml +++ b/ht/src/main/resources/mapper_dao/HtPatientReportDao.xml @@ -224,6 +224,38 @@ and a.questionId = t.question_id ORDER BY a.questionId ,a.sort + \ No newline at end of file diff --git a/ht/src/main/resources/mapper_dao/HtReportDao.xml b/ht/src/main/resources/mapper_dao/HtReportDao.xml index 6f67f6a3..5fb147b6 100644 --- a/ht/src/main/resources/mapper_dao/HtReportDao.xml +++ b/ht/src/main/resources/mapper_dao/HtReportDao.xml @@ -35,5 +35,36 @@ + \ No newline at end of file diff --git a/question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java b/question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java index 950a7a7a..4d6675a3 100644 --- a/question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java +++ b/question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java @@ -273,7 +273,7 @@ public class PatientReportVo { cell.setContent(this.code + (StrUtil.isBlank(this.remark) ? "" : "("+this.remark+")")); cell.setRowSpan(2); cell.setColSpan(npi.equalsIgnoreCase(this.code) ? headNum : 1); - cell.setBorderTop(mmse.equalsIgnoreCase(this.code) ? 1 : 0); +// cell.setBorderTop(mmse.equalsIgnoreCase(this.code) ? 1 : 0); row1.addCell(cell); //被合并cell PdfUtil.Row row2 = new PdfUtil.Row(); @@ -328,7 +328,7 @@ public class PatientReportVo { PdfUtil.Row row5 = new PdfUtil.Row(); //延迟回忆特殊处理 String ychy = "YCHY"; - int size = this.subReport.size() - 1; + int size = this.subReport.size(); for (int i = firstIndex; i < size; i++) { ReportScore reportScore = this.subReport.get(i); //设置名字 diff --git a/question/src/main/java/com/ccsens/question/service/PatientReportService.java b/question/src/main/java/com/ccsens/question/service/PatientReportService.java index f4b96125..b73e0fca 100644 --- a/question/src/main/java/com/ccsens/question/service/PatientReportService.java +++ b/question/src/main/java/com/ccsens/question/service/PatientReportService.java @@ -402,7 +402,7 @@ public class PatientReportService implements IPatientReportService { dateCell.setBorderBottom(null); dateCell.setBorderLeft(null); content.add(row2); - + log.info("导出列表:{}", content); String path = PropUtil.imgDomain + "/" + PdfUtil.credatePdf(PropUtil.path, detail.getPatient().getHospital(), Constant.Ht.Report.PARENT_NAME, detail.getPatient().toPdfRow(), content, new PdfUtil.Margin()); report.setUrl(path); htPatientReportDao.updateByPrimaryKeySelective(report); diff --git a/question/src/main/resources/application-dev.yml b/question/src/main/resources/application-dev.yml index b8320dfc..e7aef7a1 100644 --- a/question/src/main/resources/application-dev.yml +++ b/question/src/main/resources/application-dev.yml @@ -30,8 +30,8 @@ swagger: file: path: /home/cloud/question/uploads/ #domain: https://api.ccsens.com/test/ - domain: http://localhost:7040/ - imgDomain: http://localhost:7040/uploads + domain: http://localhost:7160/ + imgDomain: http://localhost:7160/uploads ht: project: patientUrl: https://www.baidu.com/