| ruoyi-admin/src/main/resources/application-druid.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| ruoyi-admin/src/main/resources/application-ls.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| ruoyi-admin/src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/domain/VO/QuestionCountKsOrBqVO.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/mapper/Icd10Mapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ruoyi-admin/src/main/resources/application-druid.yml
@@ -157,8 +157,11 @@ pathMapping: /dev-api #钉钉的密钥 dingAppid: dingn8iip5ubj7clrrsv dingAppSecret: qlEK8D3oOVwGPOTiBQIBYTqQVlAfy9S_qQizEQFjJdSScwemWFryg4gbneu-NqWD #dingAppid: dingn8iip5ubj7clrrsv #dingAppSecret: qlEK8D3oOVwGPOTiBQIBYTqQVlAfy9S_qQizEQFjJdSScwemWFryg4gbneu-NqWD dingAppid: dingdejymnw491xsibnf dingAppSecret: Q6Vhr7TAH2kPsOQPMwCqMv-unIUP6ytQjtZ6YyaYBeDJ6c68oqJBJxOcwjLTpJrC dingAppAgentId: 4992829038 # websocket超时时间 ruoyi-admin/src/main/resources/application-ls.yml
@@ -135,8 +135,11 @@ #钉钉的密钥 dingAppid: dingn8iip5ubj7clrrsv dingAppSecret: qlEK8D3oOVwGPOTiBQIBYTqQVlAfy9S_qQizEQFjJdSScwemWFryg4gbneu-NqWD #dingAppid: dingn8iip5ubj7clrrsv #dingAppSecret: qlEK8D3oOVwGPOTiBQIBYTqQVlAfy9S_qQizEQFjJdSScwemWFryg4gbneu-NqWD dingAppid: dingdejymnw491xsibnf dingAppSecret: Q6Vhr7TAH2kPsOQPMwCqMv-unIUP6ytQjtZ6YyaYBeDJ6c68oqJBJxOcwjLTpJrC dingAppAgentId: 4992829038 # websocket超时时间 server: ruoyi-admin/src/main/resources/application.yml
@@ -75,7 +75,7 @@ # 国际化资源文件路径 basename: i18n/messages profiles: active: druid active: ls # 文件上传 servlet: smartor/src/main/java/com/smartor/domain/VO/QuestionCountKsOrBqVO.java
@@ -57,7 +57,7 @@ @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @ApiModelProperty(value = "开始完成日期") private Date startFinisTime; private Date startFinishTime; /** * 结束出院日期 smartor/src/main/java/com/smartor/mapper/Icd10Mapper.java
@@ -31,6 +31,14 @@ public List<Icd10> selectIcd10List(Icd10 icd10); /** * 查询疾病列表 * * @param icd10 疾病 * @return 疾病集合 */ public List<Icd10> exactQueryIcd10List(Icd10 icd10); /** * 新增疾病 * * @param icd10 疾病 smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -647,6 +647,21 @@ }).collect(Collectors.toList()); patMedInhosp1.setLeaveicd10code(hospPatientDiagnoseInfos2.get(0).getIcd10()); patMedInhosp1.setLeavediagname(hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); //只有诊断名称没有诊断码的数据 if(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) && !StringUtils.isNotEmpty(patMedInhosp1.getLeaveicd10code())){ Icd10 icd10 = new Icd10(); icd10.setIcdname(patMedInhosp1.getLeavediagname()); icd10.setDelFlag("0"); icd10.setOrgid(ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGID")) ? BingRenXX.get("ZuZhiJGID").toString() : null); //丽水无院区,默认值是 1 icd10.setCampusid("1"); //通过icdCode查询一下,是否存在 List<Icd10> icd10s = icd10Mapper.exactQueryIcd10List(icd10); if(CollectionUtils.isEmpty(icd10s)){ patMedInhosp1.setLeaveicd10code(icd10s.get(0).getIcdcode()); } } //patMedInhosp1.setDiagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); patMedInhosp1.setDiagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); } @@ -812,16 +827,31 @@ }).collect(Collectors.toList()); patMedInhosp1.setLeaveicd10code(hospPatientDiagnoseInfos2.get(0).getIcd10()); patMedInhosp1.setLeavediagname(hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); //只有诊断名称没有诊断码的数据 if(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) && !StringUtils.isNotEmpty(patMedInhosp1.getLeaveicd10code())){ Icd10 icd10 = new Icd10(); icd10.setIcdname(patMedInhosp1.getLeavediagname()); icd10.setDelFlag("0"); icd10.setOrgid(ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGID")) ? BingRenXX.get("ZuZhiJGID").toString() : null); //丽水无院区,默认值是 1 icd10.setCampusid("1"); //通过icdCode查询一下,是否存在 List<Icd10> icd10s = icd10Mapper.exactQueryIcd10List(icd10); if(CollectionUtils.isEmpty(icd10s)){ patMedInhosp1.setLeaveicd10code(icd10s.get(0).getIcdcode()); } } //patMedInhosp1.setDiagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); patMedInhosp1.setDiagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); } String orgid = ObjectUtils.isNotEmpty(BingRenXX) && ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGID")) ? BingRenXX.get("ZuZhiJGID").toString() : null; if(StringUtils.isNotEmpty(orgid) && orgid.equals("47246103233112211A1001")){ //缙云二院 住院记录不更新状态 }else { patMedInhosp1.setInhospstate("1"); } // if(StringUtils.isNotEmpty(orgid) && orgid.equals("47246103233112211A1001")){ // //缙云二院 住院记录不更新状态 // }else { // patMedInhosp1.setInhospstate("1"); // } if (CollectionUtils.isNotEmpty(patMedInhospList)) { patMedInhosp1.setUpdateTime(new Date()); @@ -1031,6 +1061,21 @@ }).collect(Collectors.toList()); patMedInhosp1.setLeaveicd10code(hospPatientDiagnoseInfos2.get(0).getIcd10()); patMedInhosp1.setLeavediagname(hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); //只有诊断名称没有诊断码的数据 if(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) && !StringUtils.isNotEmpty(patMedInhosp1.getLeaveicd10code())){ Icd10 icd10 = new Icd10(); icd10.setIcdname(patMedInhosp1.getLeavediagname()); icd10.setDelFlag("0"); icd10.setOrgid(ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGID")) ? BingRenXX.get("ZuZhiJGID").toString() : null); //丽水无院区,默认值是 1 icd10.setCampusid("1"); //通过icdCode查询一下,是否存在 List<Icd10> icd10s = icd10Mapper.exactQueryIcd10List(icd10); if(CollectionUtils.isEmpty(icd10s)){ patMedInhosp1.setLeaveicd10code(icd10s.get(0).getIcdcode()); } } //patMedInhosp1.setDiagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); patMedInhosp1.setDiagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC()); } smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -12,7 +12,6 @@ import com.ruoyi.common.dx.MessageSend; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.*; import com.ruoyi.common.core.service.IConfigService; import com.ruoyi.common.utils.http.HttpUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.domain.SysConfig; @@ -23,7 +22,6 @@ import com.smartor.common.ScheduleSubtaskBuilder; import com.smartor.config.PhoneUtils; import com.smartor.domain.DTO.QuestionCountKsOrBqDTO; import com.smartor.domain.DTO.QuestionResultDTO; import com.smartor.domain.DTO.ServiceSubtaskDetailDTO; import com.smartor.domain.*; import com.smartor.domain.VO.*; @@ -34,9 +32,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.ObjectUtils; import org.checkerframework.checker.nullness.qual.NonNull; import org.junit.Test; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.annotation.Cacheable; @@ -44,10 +40,8 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; @@ -207,12 +201,11 @@ @Value("${spring.profiles.active}") private String active; @Autowired private PatMedOperationMapper patMedOperationMapper; @Autowired private PatMedOperationItemMapper patMedOperationItemMapper; @Autowired private ServiceOutPathMapper serviceOutPathMapper; private static final String KEY_SEP = "\u0001"; /** * 查询单一任务(随访) @@ -5062,48 +5055,78 @@ * 根据科室或病区统计问卷选项(科室、题目查询的科室评分表) */ @Override public List<QuestionCountKsOrBqDTO> statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO questionCountKsOrBqVO) { List<QuestionCountKsOrBqDTO> questionCountKsOrBqDTOS = serviceSubtaskMapper.statQuestionOptionByKsOrBq(questionCountKsOrBqVO); // 处理 targetvalue:按 & 分割成多条记录 List<QuestionCountKsOrBqDTO> result = new ArrayList<>(); for (QuestionCountKsOrBqDTO questionCountKsOrBqDTO : questionCountKsOrBqDTOS) { if (StringUtils.isNotEmpty(questionCountKsOrBqDTO.getTargetvalue()) && questionCountKsOrBqDTO.getTargetvalue().contains("&")) { String[] values = questionCountKsOrBqDTO.getTargetvalue().split("&"); // 如果有多条目标值,拆分成多行 for (String value : values) { //先去 result 中查一下,有没有这个 questiontext 和对应的 targetvalue QuestionCountKsOrBqDTO existingExport = result.stream().filter(e -> e.getQeustionText().equals(questionCountKsOrBqDTO.getQeustionText()) && value.trim().equals(e.getTargetvalue())).findFirst().orElse(null); if (existingExport != null && existingExport.getAnswerCount().equals("0") && existingExport.getSingleScore().equals("0")) { //如果存在,则将 result 里的这个问题所对应的 Targetvalue=value 这条数据更新成当前这条数据 if (value.equals(questionCountKsOrBqDTO.getAsrtext())) { existingExport.setAsrtext(questionCountKsOrBqDTO.getAsrtext()); existingExport.setAnswerCount(questionCountKsOrBqDTO.getAnswerCount()); existingExport.setSingleScore(questionCountKsOrBqDTO.getSingleScore()); existingExport.setAvgScore(questionCountKsOrBqDTO.getAvgScore()); } } else if (existingExport != null && !existingExport.getAnswerCount().equals("0")) { continue; } else { QuestionCountKsOrBqDTO qcDto = DtoConversionUtils.sourceToTarget(questionCountKsOrBqDTO, QuestionCountKsOrBqDTO.class); qcDto.setTargetvalue(value.trim()); // targetvalue 显示单个选项 if (!value.equals(qcDto.getAsrtext())) { existingExport.setAsrtext(null); existingExport.setAnswerCount("0"); existingExport.setSingleScore("0"); existingExport.setAvgScore("0"); } result.add(qcDto); } } } else { // targetvalue 不包含 &,直接添加到结果 result.add(questionCountKsOrBqDTO); } public List<QuestionCountKsOrBqDTO> statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO vo) { List<QuestionCountKsOrBqDTO> sourceList = serviceSubtaskMapper.statQuestionOptionByKsOrBq(vo); if (CollectionUtils.isEmpty(sourceList)) { return Collections.emptyList(); } return result; boolean byDept = vo.getLeaveldeptcodes() != null; boolean byDistrict = !byDept && vo.getLeavehospitaldistrictcodes() != null; if (!byDept && !byDistrict) { return Collections.emptyList(); } Map<String, QuestionCountKsOrBqDTO> map = new LinkedHashMap<>(); for (QuestionCountKsOrBqDTO dto : sourceList) { if (StringUtils.isEmpty(dto.getTargetvalue())) { continue; } String groupName = byDept ? dto.getDeptname() : dto.getLeavehospitaldistrictname(); if (StringUtils.isEmpty(groupName)) { continue; } // 关键:两边都用 trimAll,兼容全角空格 String asrtext = trimAll(dto.getAsrtext()); String questionKey = dto.getTaskid() + "\u0001" + trimAll(dto.getQeustionText()); for (String raw : dto.getTargetvalue().split("&")) { String option = trimAll(raw); // ← 修复点:用 trimAll 而不是 trim if (option.isEmpty()) { continue; } String key = buildKey(groupName, option, questionKey); QuestionCountKsOrBqDTO item = map.get(key); if (item == null) { item = DtoConversionUtils.sourceToTarget(dto, QuestionCountKsOrBqDTO.class); item.setTargetvalue(option); // 输出的 targetvalue 就是当前选项 item.setAsrtext(option); item.setAnswerCount("0"); map.put(key, item); } if (option.equals(asrtext)) { item.setAnswerCount(String.valueOf(parseCount(item.getAnswerCount()) + 1)); item.setSingleScore(String.valueOf(new BigDecimal(item.getSingleScore()).add(new BigDecimal(dto.getSingleScore())))); } } } ArrayList<QuestionCountKsOrBqDTO> questionCountKsOrBqDTOS = new ArrayList<>(map.values()); for (QuestionCountKsOrBqDTO questionCountKsOrBqDTO : questionCountKsOrBqDTOS) { String singleScore = questionCountKsOrBqDTO.getSingleScore(); String answerCount = questionCountKsOrBqDTO.getAnswerCount(); BigDecimal avg; if (StringUtils.isEmpty(answerCount) || BigDecimal.ZERO.compareTo(new BigDecimal(answerCount.trim())) == 0) { // 除数为 0,避免 / by zero avg = BigDecimal.ZERO; } else { avg = new BigDecimal(singleScore) .divide(new BigDecimal(answerCount.trim()), 2, RoundingMode.HALF_UP); } questionCountKsOrBqDTO.setAvgScore(avg.toPlainString()); } return questionCountKsOrBqDTOS; } @Override public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType) { @@ -5122,8 +5145,17 @@ // 如果有多条目标值,拆分成多行 for (String value : values) { //先去 result 中查一下,有没有这个 questiontext 和对应的 targetvalue ServiceSubtaskDetailRatioExport existingExport = result.stream().filter(e -> e.getQuestiontext().equals(export.getQuestiontext()) && value.trim().equals(e.getTargetvalue())).findFirst().orElse(null); if (existingExport != null && existingExport.getRatio().equals("0") && existingExport.getCount().equals("0")) { ServiceSubtaskDetailRatioExport existingExport = result.stream().filter(e -> { if (e == null || export == null) { return false; } String q1 = e.getQuestiontext() != null ? e.getQuestiontext() : ""; String q2 = export.getQuestiontext() != null ? export.getQuestiontext() : ""; String t1 = value.trim(); String t2 = e.getTargetvalue() != null ? e.getTargetvalue() : ""; return q1.equals(q2) && t1.equals(t2); }).findFirst().orElse(null); if (existingExport != null && "0".equals(existingExport.getRatio()) && "0".equals(existingExport.getCount())) { //如果存在,则将 result 里的这个问题所对应的 Targetvalue=value 这条数据更新成当前这条数据 if (value.equals(export.getOptionresult())) { existingExport.setRatio(export.getRatio()); @@ -5131,7 +5163,7 @@ existingExport.setCount(export.getCount()); existingExport.setOptionresult(export.getOptionresult()); } } else if (existingExport != null && !existingExport.getRatio().equals("0")) { } else if (existingExport != null && !"0".equals(existingExport.getRatio())) { continue; } else { ServiceSubtaskDetailRatioExport newExport = DtoConversionUtils.sourceToTarget(export, ServiceSubtaskDetailRatioExport.class); @@ -5842,7 +5874,7 @@ /** * 问题结果占比 * * @param serviceSubtaskEntity * @param questionResultVO * @param serviceSubtaskRes * @return */ @@ -5899,4 +5931,44 @@ } log.info("ai匹配成功,匹配结果是:" + matchedText); } private static String trimAll(String s) { if (s == null) { return ""; } int start = 0; int end = s.length(); while (start < end && isBlankChar(s.charAt(start))) { start++; } while (end > start && isBlankChar(s.charAt(end - 1))) { end--; } return s.substring(start, end); } private static Boolean isBlankChar(char c) { return c == '\u3000' // 全角空格 || c == ' ' // 半角空格 || c == '\t' || c == '\n' || c == '\r' || c == '\f' || Character.isWhitespace(c); } private String buildKey(String groupName, String option, String questionKey) { return questionKey + KEY_SEP + groupName + KEY_SEP + option; } private static int parseCount(String s) { if (StringUtils.isEmpty(s)) { return 0; } try { return Integer.parseInt(s.trim()); } catch (NumberFormatException e) { return 0; } } } smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml
@@ -67,6 +67,30 @@ </if> </select> <select id="exactQueryIcd10List" parameterType="com.smartor.domain.Icd10" resultMap="Icd10Result"> <include refid="selectIcd10Vo"/> where 1=1 and del_flag = 0 <if test="icdcode != null and icdcode != ''">and icdcode = #{icdcode}</if> <if test="lastflag != null and lastflag != ''">and lastflag = #{lastflag}</if> <if test="chimedflag != null and chimedflag != ''">and chimedflag = #{chimedflag}</if> <if test="icdname != null and icdname != ''">and icdname = #{icdname} </if> <if test="icdpym != null and icdpym != ''">and icdpym = #{icdpym}</if> <if test="icdwbm != null and icdwbm != ''">and icdwbm = #{icdwbm}</if> <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> <if test="pid != null ">and pid = #{pid}</if> <if test="guid != null and guid != ''">and guid = #{guid}</if> <if test="hisIcdid != null and hisIcdid != ''">and his_icdid = #{hisIcdid}</if> <if test="icdcodes != null and icdcodes.size() > 0"> AND icdcode IN <foreach collection="icdcodes" item="icdcodeItem" open="(" separator="," close=")"> #{icdcodeItem} </foreach> </if> </select> <select id="selectIcd10ByIcdid" parameterType="Long" resultMap="Icd10Result"> <include refid="selectIcd10Vo"/> where icdid = #{icdid} smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -3212,21 +3212,22 @@ SELECT questiontext, d.taskid, s.deptname, d.create_time as createTime, s.leavehospitaldistrictname, d.targetvalue, d.asrtext, COUNT(d.asrtext) AS answercount, SUM(d.score) AS singleScore d.score AS singleScore FROM service_subtask_detail d, service_task s WHERE d.taskid = s.taskid AND deptname IS NOT NULL AND leavehospitaldistrictname IS NOT NULL <if test="endFinishTime != null"> AND create_time < #{endFinishTime} AND d.create_time < #{endFinishTime} </if> <if test="startFinishTime != null"> AND create_time >= #{startFinishTime} AND d.create_time >= #{startFinishTime} </if> <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> AND leavehospitaldistrictcode IN @@ -3245,6 +3246,11 @@ </if> GROUP BY d.questiontext, d.taskid, d.score, s.deptname, d.targetvalue, d.create_time, s.leavehospitaldistrictname, d.asrtext ORDER BY d.taskid </select>