From e77f28bc0aae4d35c8ce8e3f0a33ccd060993912 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 24 七月 2026 14:21:25 +0800
Subject: [PATCH] 【惠州】惠州配置
---
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | 124 ++++++++++++++++++++++++++++++++---------
1 files changed, 96 insertions(+), 28 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
index 36f658e..c0682d7 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -45,11 +45,9 @@
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.ZoneId;
+import java.time.*;
import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
@@ -418,9 +416,74 @@
serviceSubtaskRes.setCurrentPreachform(serviceSubtask.getPreachform().split(",")[0]);
}
}
+ PatMedInhosp inhosp = patMedInhospMapper.selectPatMedInhospByInhospid(serviceSubtask.getInhospid());
+ if (ObjectUtils.isNotEmpty(inhosp)) {
+ PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(inhosp.getPatid());
+ if (ObjectUtils.isNotEmpty(patArchive)) {
+ Map<String, String> stringStringMap = calculateAge(patArchive.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now());
+ serviceSubtaskRes.setAge(StringUtils.isNotEmpty(stringStringMap.get("age")) ? Long.valueOf(stringStringMap.get("age")) : null);
+ serviceSubtaskRes.setSex(patArchive.getSex());
+ serviceSubtaskRes.setSexName(patArchive.getSex() != null ? (patArchive.getSex() == 1 ? "鐢�" : "濂�") : null);
+ }
+ serviceSubtaskRes.setHospno(inhosp.getInhospno());
+ serviceSubtaskRes.setPatno(inhosp.getPatno());
+ }
+
serviceSubtaskResList.add(serviceSubtaskRes);
}
return serviceSubtaskResList;
+ }
+
+ public Map<String, String> calculateAge(LocalDate birthdate, LocalDate today) {
+ if (birthdate == null || today.isBefore(birthdate)) {
+ return null;
+ }
+ Map<String, String> ageMap = new HashMap<>();
+
+ Period period = Period.between(birthdate, today);
+ long totalDays = ChronoUnit.DAYS.between(birthdate, today);
+ long totalMonths = ChronoUnit.MONTHS.between(birthdate, today);
+
+ int years = period.getYears();
+ int months = period.getMonths();
+ int days = period.getDays();
+
+ String ageUnit;
+ Integer age;
+ String ageUnit2 = null;
+ Integer age2 = null;
+
+ if (totalDays < 90) {
+ // 灏忎簬 1 涓湀锛屾寜澶╄绠�
+ ageUnit = "澶�";
+ age = (int) totalDays;
+ ageMap.put("age", age != null ? age.toString() : null);
+ ageMap.put("ageUnit", ageUnit);
+ ageMap.put("age2", null);
+ ageMap.put("ageUnit2", null);
+ } else if (totalMonths < 36) {
+ // 灏忎簬 1 骞达紝鎸夋湀 + 澶╄绠�
+ ageUnit = "鏈�";
+ age = (int) totalMonths;
+ ageUnit2 = "澶�";
+ age2 = days;
+ ageMap.put("age", age != null ? age.toString() : null);
+ ageMap.put("ageUnit", ageUnit);
+ ageMap.put("age2", age2 != null ? age2.toString() : null);
+ ageMap.put("ageUnit2", ageUnit2);
+ } else {
+ // 澶т簬 1 骞达紝鎸夊勾 + 鏈堣绠�
+ ageUnit = "宀�";
+ age = years;
+ ageUnit2 = "鏈�";
+ age2 = months;
+ ageMap.put("age", age != null ? age.toString() : null);
+ ageMap.put("ageUnit", ageUnit);
+ ageMap.put("age2", age2 != null ? age2.toString() : null);
+ ageMap.put("ageUnit2", ageUnit2);
+ }
+
+ return ageMap;
}
@Override
@@ -592,9 +655,16 @@
ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(serviceSubtaskTemplateVO.getSubId());
if (serviceSubtask == null || serviceSubtask.getSendstate() != 2L)
throw new BaseException("璇ヤ换鍔″凡鍙戦�佺粰鎮h�咃紝涓嶈兘鍐嶈繘琛屼慨鏀规ā鏉�");
-
+ serviceSubtaskTemplateVO.getSvyTaskTemplateVO().setIntroduce("璇ラ棶鍗锋槸鏇挎崲鍚庣殑闂锛屾浛鎹㈠墠鐨勯棶棰樻槸锛�" + serviceSubtask.getTemplateid());
Integer taskTempid = svyTaskTemplateService.saveOrUpdateTemplate(serviceSubtaskTemplateVO.getSvyTaskTemplateVO());
if (taskTempid == null) return false;
+
+ //姣忔閮芥柊寤轰竴涓篃鍙互锛屼絾鏂板缓涔嬪悗瑕佹妸涔嬪墠鐨勫垹闄�
+ if (serviceSubtask.getType().equals("2")) {
+ svyTaskTemplateService.deleteSvyTaskTemplateBySvyid(serviceSubtask.getTemplateid());
+ } else if (serviceSubtask.getType().equals("1"))
+ ivrTaskTemplateService.deleteIvrTaskTemplateByID(serviceSubtask.getTemplateid());
+
String tempName = svyTaskTemplateService.selectSvyTaskTemplateBySvyid(Long.valueOf(taskTempid)).getSvyname();
serviceSubtask.setTemplateid(taskTempid.longValue());
@@ -1668,19 +1738,19 @@
continue;
}
//2-AI璇嗗埆
- SysConfig configVoiceMatchType = new SysConfig();
- configVoiceMatchType.setOrgid(phoneCallReqYQVO.getOrgid());
- configVoiceMatchType.setConfigKey("sys.voice.match.type");
- SysConfig matchType = sysConfigMapper.selectConfig(configVoiceMatchType);
+// SysConfig configVoiceMatchType = new SysConfig();
+// configVoiceMatchType.setOrgid(phoneCallReqYQVO.getOrgid());
+// configVoiceMatchType.setConfigKey("sys.voice.match.type");
+// SysConfig matchType = sysConfigMapper.selectConfig(configVoiceMatchType);
boolean matchedFlag = false;
- if(ObjectUtils.isNotEmpty(matchType) && StringUtils.isNotEmpty(matchType.getConfigValue()) && matchType.getConfigValue().equals("2")){
- int checkFlag = DeepSeekApi.matchQuestionAnswer(ivrTaskTemplateScriptVO.getScriptContent(),
- phoneCallReqYQVO.getAsrtext(),
- ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue());
- if(checkFlag == 1){
- matchedFlag = true;
- }
- }else {
+// if (ObjectUtils.isNotEmpty(matchType) && StringUtils.isNotEmpty(matchType.getConfigValue()) && matchType.getConfigValue().equals("2")) {
+// int checkFlag = DeepSeekApi.matchQuestionAnswer(ivrTaskTemplateScriptVO.getScriptContent(),
+// phoneCallReqYQVO.getAsrtext(),
+// ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue());
+// if (checkFlag == 1) {
+// matchedFlag = true;
+// }
+// } else {
//鍖呭惈
Matcher matcher = null;
if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex())) {
@@ -1697,7 +1767,7 @@
if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) {
matchedFlag = true;
}
- }
+// }
//璇存槑鍖归厤姝g‘浜�
if(matchedFlag){
//杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉�
@@ -4564,9 +4634,9 @@
}
@Override
- public List<ServiceSubtask> gethelibraryCountHyperlink(HeLibraryCountVO heLibraryCountVO){
+ public List<ServiceSubtask> gethelibraryCountHyperlink(HeLibraryCountVO heLibraryCountVO) {
String hyperLinkInfoType = heLibraryCountVO.getHyperLinkInfoType();
- if(StringUtils.isNotEmpty(hyperLinkInfoType)){
+ if (StringUtils.isNotEmpty(hyperLinkInfoType)) {
heLibraryCountVO.setSendstate(null);
heLibraryCountVO.setIsFinished(null);
switch (hyperLinkInfoType) {
@@ -4789,19 +4859,19 @@
}
}
- public String scanGenerateSubtask(ServiceTask serviceTaskVo){
+ public String scanGenerateSubtask(ServiceTask serviceTaskVo) {
String content = "";
String ip = localIP;
ServiceTask serviceTask = new ServiceTask();
serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceTaskVo.getTaskid());
- if(ObjectUtils.isNotEmpty(serviceTask)){
+ if (ObjectUtils.isNotEmpty(serviceTask)) {
try {
ServiceTaskdept serviceTaskdept = new ServiceTaskdept();
- if(ObjectUtils.isNotEmpty(serviceTaskVo.getDeptcode())){
+ if (ObjectUtils.isNotEmpty(serviceTaskVo.getDeptcode())) {
serviceTaskdept.setDeptType("1");
serviceTaskdept.setDeptCode(serviceTask.getDeptcode());
}
- if(ObjectUtils.isNotEmpty(serviceTaskVo.getLeavehospitaldistrictcode())){
+ if (ObjectUtils.isNotEmpty(serviceTaskVo.getLeavehospitaldistrictcode())) {
serviceTaskdept.setDeptType("2");
serviceTaskdept.setDeptCode(serviceTaskVo.getLeavehospitaldistrictcode());
}
@@ -4812,15 +4882,13 @@
if (!CollectionUtils.isEmpty(serviceTaskdepts)) {
PatArchive patArchive = new PatArchive();
- patArchive.setId(-1L);
+ patArchive.setId(999999999L);
patArchive.setName("铏氭嫙鎮h��");
//灏佽serviceSubtask
ServiceSubtask serviceSubtask = boxedServiceSubtask(serviceTask, patArchive);
int i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
//鏍规嵁鐢熸垚澶栭摼
- if (ObjectUtils.isNotEmpty(serviceSubtask.getTaskid()) &&
- ObjectUtils.isNotEmpty(serviceSubtask.getPatid())
- && ObjectUtils.isNotEmpty(serviceSubtask.getId())) {
+ if (ObjectUtils.isNotEmpty(serviceSubtask.getTaskid()) && ObjectUtils.isNotEmpty(serviceSubtask.getPatid()) && ObjectUtils.isNotEmpty(serviceSubtask.getId())) {
RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
String taskId = rsaPublicKeyExample.encryptedData(serviceSubtask.getTaskid().toString(), pub_key);
String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
--
Gitblit v1.9.3