ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
@@ -21,16 +21,15 @@ public static void main(String[] args) { // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); System.out.println("(♥◠‿◠)ノ゙ 智慧服务启动成功 ლ(´ڡ`ლ)゙ \n" + " .-------. ____ __ \n" + " | _ _ \\ \\ \\ / / \n" + " | ( ' ) | \\ _. / ' \n" + " |(_ o _) / _( )_ .' \n" + " | (_,_).' __ ___(_ o _)' \n" + " | |\\ \\ | || |(_,_)' \n" + " | | \\ `' /| `-' / \n" + " | | \\ / \\ / \n" + " ''-' `'-' `-..-' "); System.out.println(" 智慧服务启动成功 \n" + " ██╗ ██╗ ██████╗ ██████╗\n" + " ██║ ██║ ██╔══██╗ ██╔════╝\n" + " ███████║ ██████╔╝ █████╗\n" + " ██╔══██║ ██╔══██╗ ╚════██╗\n" + " ██║ ██║ ██║ ██║ ██████╔╝\n" + " ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝\n" + " 亥 尔 时\n"); // //开启SOCKET // new SocketCommunication().socketCommunication(); } ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskDetailTraceController.java
@@ -65,13 +65,20 @@ public Map<String, Object> tracedeallist(@RequestBody DetailTraceDealVO detailTraceDealVO) { Integer offset = PageUtils.getOffset(detailTraceDealVO.getPageNum(), detailTraceDealVO.getPageSize()); detailTraceDealVO.setPageNum(offset); List<DetailTraceDealDTO> list = serviceSubtaskDetailTraceService.tracedeallist(detailTraceDealVO); Map<String, Object> result = serviceSubtaskDetailTraceService.tracedeallist(detailTraceDealVO); // 查询总数(不分页) detailTraceDealVO.setPageNum(null); detailTraceDealVO.setPageSize(null); List<DetailTraceDealDTO> total = serviceSubtaskDetailTraceService.tracedeallist(detailTraceDealVO); Map<String, Object> totalResult = serviceSubtaskDetailTraceService.tracedeallist(detailTraceDealVO); List<?> totalRows = (List<?>) totalResult.get("rows"); return getDataTable3(CollectionUtils.isNotEmpty(total) ? total.size() : 0, list); //将总数信息添加到结果中 result.put("totalException", totalResult.get("totalException")); result.put("noDealException", totalResult.get("noDealException")); result.put("yesDealException", totalResult.get("yesDealException")); return getDataTable3(CollectionUtils.isNotEmpty(totalRows) ? totalRows.size() : 0, result); } /** smartor/src/main/java/com/smartor/domain/DTO/DetailTraceDealDTO.java
@@ -29,6 +29,22 @@ @Excel(name = "问题内容") private String questiontext; /** * 问题ID */ @ApiModelProperty("问题ID") @Excel(name = "问题ID") private Long scriptid; /** * 模板类型:1.语音 2.问卷 */ @ApiModelProperty("模板类型:1.语音 2.问卷") @Excel(name = "模板类型:1.语音 2.问卷") private Integer templateType; /** * [{ * "deptName": "科室名称", smartor/src/main/java/com/smartor/domain/PatArchive.java
@@ -81,7 +81,7 @@ */ @ApiModelProperty("来源(1:HIS;2:数据平台;3:文件导入)") @Excel(name = " 来源(1:HIS;2:数据平台;3:文件导入) ") private Integer sourcefrom; private Long sourcefrom; /** * his系统的患者id smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
@@ -21,7 +21,7 @@ */ @ApiModel(value = "PatArchiveVO", description = "患者档案对象") @Data public class PatArchiveVO extends BaseEntity { public class PatArchiveVO extends PatArchive { /** * 自增ID smartor/src/main/java/com/smartor/domain/ServiceSLTDInhospReqVO.java
@@ -16,6 +16,12 @@ @ApiModelProperty(value = "院区ID") private Long campusId; @ApiModelProperty(value = "当前页") private Long current; @ApiModelProperty(value = "每页数量") private Long size; @ApiModelProperty(value = "患者姓名 必填一个") private String patientName; smartor/src/main/java/com/smartor/service/IServiceSubtaskDetailTraceService.java
@@ -36,9 +36,9 @@ /** * 异常问题处理情况查询 * @param detailTraceDealVO * @return * @return 包含分页列表及汇总统计(totalException/noDealException/yesDealException)的Map */ public List<DetailTraceDealDTO> tracedeallist(DetailTraceDealVO detailTraceDealVO); public Map<String, Object> tracedeallist(DetailTraceDealVO detailTraceDealVO); /** * 新增随访任务异常记录跟踪 smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -1469,7 +1469,7 @@ patArchive.setPatientno(externalInHospPatientInfo.getJiuZhenKH()); patArchive.setBirthdate(parse); patArchive.setPatidHis(externalInHospPatientInfo.getBingRenID()); patArchive.setSourcefrom(1); patArchive.setSourcefrom(1L); patArchive.setPattype("2"); patArchive.setName(externalInHospPatientInfo.getXingMing()); if (StringUtils.isNotEmpty(externalInHospPatientInfo.getXingBieDM())) smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
@@ -759,7 +759,7 @@ patArchive.setPatientno("" + dto.getPatientId()); patArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim()); patArchive.setName(dto.getPatientName()); patArchive.setSourcefrom(2); patArchive.setSourcefrom(2L); patArchive.setPattype("2"); patArchive.setSex("男".equals(dto.getGender()) ? 1L : 2L); patArchive.setNation(dto.getNation()); smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailTraceServiceImpl.java
@@ -71,47 +71,39 @@ } @Override public List<DetailTraceDealDTO> tracedeallist(DetailTraceDealVO detailTraceDealVO) { // 获取所有需要处理的记录 public Map<String, Object> tracedeallist(DetailTraceDealVO detailTraceDealVO) { // 分页查询 List<ServiceSubtaskDetailTrace> tracedeallist = serviceSubtaskDetailTraceMapper.tracedeallist(detailTraceDealVO); // 按 questiontext 分组 Map<String, List<ServiceSubtaskDetailTrace>> groupByQuestion = tracedeallist.stream() .filter(t -> t.getQuestiontext() != null) .collect(Collectors.groupingBy(ServiceSubtaskDetailTrace::getQuestiontext)); Map<String, List<ServiceSubtaskDetailTrace>> groupByQuestion = tracedeallist.stream().filter(t -> t.getQuestiontext() != null).collect(Collectors.groupingBy(ServiceSubtaskDetailTrace::getQuestiontext)); List<DetailTraceDealDTO> detailTraceDealDTOList = new ArrayList<>(); long totalException = 0L; long noDealException = 0L; long yesDealException = 0L; for (Map.Entry<String, List<ServiceSubtaskDetailTrace>> entry : groupByQuestion.entrySet()) { List<ServiceSubtaskDetailTrace> group = entry.getValue(); DetailTraceDealDTO dto = new DetailTraceDealDTO(); // 问题内容 dto.setQuestiontext(entry.getKey()); if (CollectionUtils.isNotEmpty(group)) { dto.setScriptid(group.get(0).getScriptid()); dto.setTemplateType(group.get(0).getTemplateType()); } // 负责科室(去重) List<Map<String, Object>> responsibleDept = group.stream() .filter(t -> t.getTodeptcode() != null) .collect(Collectors.collectingAndThen( Collectors.toMap( ServiceSubtaskDetailTrace::getTodeptcode, t -> { Map<String, Object> deptMap = new HashMap<>(); deptMap.put("deptName", t.getTodeptname()); deptMap.put("deptCode", t.getTodeptcode()); return deptMap; }, (existing, replacement) -> existing ), map -> new ArrayList<>(map.values()) )); List<Map<String, Object>> responsibleDept = group.stream().filter(t -> t.getTodeptcode() != null).collect(Collectors.collectingAndThen(Collectors.toMap(ServiceSubtaskDetailTrace::getTodeptcode, t -> { Map<String, Object> deptMap = new HashMap<>(); deptMap.put("deptName", t.getTodeptname()); deptMap.put("deptCode", t.getTodeptcode()); return deptMap; }, (existing, replacement) -> existing), map -> new ArrayList<>(map.values()))); dto.setResponsibleDept(responsibleDept); // 有效填写数:通过组内的 scriptid 去 service_subtask_detail 表查询 List<Long> scriptIds = group.stream() .map(ServiceSubtaskDetailTrace::getScriptid) .filter(Objects::nonNull) .distinct() .collect(Collectors.toList()); List<Long> scriptIds = group.stream().map(ServiceSubtaskDetailTrace::getScriptid).filter(Objects::nonNull).distinct().collect(Collectors.toList()); long effectiveFillNum = 0L; if (CollectionUtils.isNotEmpty(scriptIds)) { ServiceSubtaskDetail query = new ServiceSubtaskDetail(); @@ -140,19 +132,26 @@ exceptionQuesNum.put("all", exceptionFillNum); dto.setExceptionQuesNum(exceptionQuesNum); // 汇总统计累加 totalException += exceptionFillNum; noDealException += noDeal; yesDealException += yesDeal; // 最新处理人和处理时间(取 handleTime 最新的一条) group.stream() .filter(t -> t.getHandleTime() != null) .max(Comparator.comparing(ServiceSubtaskDetailTrace::getHandleTime)) .ifPresent(latest -> { dto.setHandleBy(latest.getHandleBy()); dto.setHandleTime(latest.getHandleTime()); }); group.stream().filter(t -> t.getHandleTime() != null).max(Comparator.comparing(ServiceSubtaskDetailTrace::getHandleTime)).ifPresent(latest -> { dto.setHandleBy(latest.getHandleBy()); dto.setHandleTime(latest.getHandleTime()); }); detailTraceDealDTOList.add(dto); } return detailTraceDealDTOList; Map<String, Object> result = new HashMap<>(); result.put("detailTraceDealDTOList", detailTraceDealDTOList); result.put("totalException", totalException); result.put("noDealException", noDealException); result.put("yesDealException", yesDealException); return result; } /** smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -3839,7 +3839,7 @@ if (serviceSubtaskPreachform1.getSort() == spSize.size() && failSendstate.equals("4")) { serviceSubtask.setCurrentPreachform(preachform); serviceSubtask.setSendstate(5L); serviceSubtask.setRemark("setFailPreachForm方法 当前的preachform已经是最后一个了,全失败了"); // serviceSubtask.setRemark("setFailPreachForm方法 当前的preachform已经是最后一个了,全失败了"); serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); return true; } smartor/src/main/java/com/smartor/service/impl/XHGatherPatArchiveServiceImpl.java
@@ -390,7 +390,7 @@ patArchive.setPatientno(thiedInhospInfo.getPatiMediaNo()); patArchive.setIdcardno(thiedInhospInfo.getPatiIdCardNo().trim()); patArchive.setName(thiedInhospInfo.getPatiRecordName()); patArchive.setSourcefrom(2); patArchive.setSourcefrom(2L); patArchive.setPattype("2"); // 性别