From 574f63b57552e85406076bc0a2da511a040d263f Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期一, 14 九月 2026 18:03:53 +0800
Subject: [PATCH] 【景宁】记录Url
---
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | 112 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 75 insertions(+), 37 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 ad85650..90236af 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -22,13 +22,11 @@
import com.smartor.common.MtSubmitSmUtil;
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.HeLibraryCountVO;
-import com.smartor.domain.VO.QuestionResultVO;
-import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO;
-import com.smartor.domain.VO.TransferDeptVO;
+import com.smartor.domain.VO.*;
import com.smartor.domain.entity.ServiceSubtaskEntity;
import com.smartor.mapper.*;
import com.smartor.service.*;
@@ -672,10 +670,8 @@
//濡傛灉涓嶅瓨鍦紝鍒欐柊澧�
ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
if (ObjectUtils.isNotEmpty(serviceTask)) {
- serviceSubtask.setDeptcode(serviceTask.getDeptcode());
serviceSubtask.setTaskDesc(serviceTask.getTaskDesc());
serviceSubtask.setTaskName(serviceTask.getTaskName());
- serviceSubtask.setDeptname(serviceTask.getDeptname());
serviceSubtask.setTemplatename(serviceTask.getTemplatename());
}
@@ -2923,12 +2919,10 @@
collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrcode()).orElse("Unknown")));
break;
case "management_doctor_code":
- rawData = rawData.stream()
- .peek(item -> {
- item.setDrname(item.getManagementDoctor());
- item.setDrcode(item.getManagementDoctorCode());
- })
- .collect(Collectors.toList());
+ rawData = rawData.stream().peek(item -> {
+ item.setDrname(item.getManagementDoctor());
+ item.setDrcode(item.getManagementDoctorCode());
+ }).collect(Collectors.toList());
collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getManagementDoctorCode()).orElse("Unknown")));
break;
case "deptcode":
@@ -4088,12 +4082,15 @@
iServiceOutPathService.insertServiceOutPath(serviceOutPath);
//杞垚16杩涘埗
String format = String.format("%03X", serviceOutPath.getId());
+ String url = "";
+ SendMagParam sendMagParam = new SendMagParam();
+ url = localIP + ":" + req_path + "/sf?p=" + format;
+ sendMagParam.setUrl(url);
+ sendMagParam.setContent("銆愭柊鍗庡尰闄€�戞偍濂斤紝閭�璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "濉啓銆傛劅璋㈡偍閰嶅悎锛�");
serviceOutPath.setRadix(format);
serviceOutPath.setUpdateTime(new Date());
+ serviceOutPath.setUrl(url);
iServiceOutPathService.updateServiceOutPath(serviceOutPath);
- SendMagParam sendMagParam = new SendMagParam();
- sendMagParam.setUrl(localIP + ":" + req_path + "/sf?p=" + format);
- sendMagParam.setContent("銆愭柊鍗庡尰闄€�戞偍濂斤紝閭�璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "濉啓銆傛劅璋㈡偍閰嶅悎锛�");
Map<String, String> map = new HashMap<>();
map.put("phone", serviceSubtask.getPhone());
map.put("content", sendMagParam.getContent());
@@ -4979,15 +4976,17 @@
serviceOutPath.setOrgid(serviceSubtask.getOrgid());
iServiceOutPathService.insertServiceOutPath(serviceOutPath);
String format = String.format("%03X", serviceOutPath.getId());
- serviceOutPath.setRadix(format);
- serviceOutPath.setUpdateTime(new Date());
- iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-
+ String url = "";
SendMagParam sendMagParam = new SendMagParam();
sendMagParam.setType("4");
sendMagParam.setPhone(serviceSubtask.getPhone());
- sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format);
+ url = StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format;
+ sendMagParam.setUrl(url);
+ serviceOutPath.setRadix(format);
+ serviceOutPath.setUpdateTime(new Date());
+ serviceOutPath.setUrl(url);
+ iServiceOutPathService.updateServiceOutPath(serviceOutPath);
SysConfig sysConfig = new SysConfig();
sysConfig = sysConfigMapper.checkConfigKeyUnique("wj.sms.template");
@@ -5012,7 +5011,7 @@
}
@Override
- public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd,String valueType) {
+ public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType) {
//鍏堟竻鐞嗕竴涓嬮噸澶嶆暟鎹�
List<Long> repeatIds = serviceSubtaskDetailMapper.selectRepeatDetailIds();
if (!CollectionUtils.isEmpty(repeatIds)) {
@@ -5028,14 +5027,10 @@
// 濡傛灉鏈夊鏉$洰鏍囧�硷紝鎷嗗垎鎴愬琛�
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);
+ 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")) {
//濡傛灉瀛樺湪锛屽垯灏� result 閲岀殑杩欎釜闂鎵�瀵瑰簲鐨� Targetvalue=value 杩欐潯鏁版嵁鏇存柊鎴愬綋鍓嶈繖鏉℃暟鎹�
- if(value.equals(export.getOptionresult())) {
+ if (value.equals(export.getOptionresult())) {
existingExport.setRatio(export.getRatio());
existingExport.setScore(export.getScore());
existingExport.setCount(export.getCount());
@@ -5063,15 +5058,62 @@
return result;
}
+ /*
+ * 鏍规嵁绉戝鎴栫梾鍖虹粺璁¢棶鍗烽�夐」(绉戝銆侀鐩煡璇㈢殑绉戝璇勫垎琛�)
+ */
@Override
- public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd,String valueType) {
+ 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);
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime, String scriptContent, Double scoreStart, Double scoreEnd, String valueType) {
//鍏堟竻鐞嗕竴涓嬮噸澶嶆暟鎹�
List<Long> repeatIds = serviceSubtaskDetailMapper.selectRepeatDetailIds();
if (!CollectionUtils.isEmpty(repeatIds)) {
serviceSubtaskDetailMapper.deleteRepeatDetailByIds(repeatIds);
}
- List<ServiceSubtaskDetailRatioExport> serviceSubtaskDetailRatioExports = serviceSubtaskMapper.statQuestionOptionBySubtaskIds(subtaskIds, startOutHospTime, endOutHospTime, scoreStart, scoreEnd, scriptContent,valueType);
+ List<ServiceSubtaskDetailRatioExport> serviceSubtaskDetailRatioExports = serviceSubtaskMapper.statQuestionOptionBySubtaskIds(subtaskIds, startOutHospTime, endOutHospTime, scoreStart, scoreEnd, scriptContent, valueType);
// 澶勭悊 targetvalue锛氭寜 & 鍒嗗壊鎴愬鏉¤褰�
List<ServiceSubtaskDetailRatioExport> result = new ArrayList<>();
for (ServiceSubtaskDetailRatioExport export : serviceSubtaskDetailRatioExports) {
@@ -5080,14 +5122,10 @@
// 濡傛灉鏈夊鏉$洰鏍囧�硷紝鎷嗗垎鎴愬琛�
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);
+ 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")) {
//濡傛灉瀛樺湪锛屽垯灏� result 閲岀殑杩欎釜闂鎵�瀵瑰簲鐨� Targetvalue=value 杩欐潯鏁版嵁鏇存柊鎴愬綋鍓嶈繖鏉℃暟鎹�
- if(value.equals(export.getOptionresult())) {
+ if (value.equals(export.getOptionresult())) {
existingExport.setRatio(export.getRatio());
existingExport.setScore(export.getScore());
existingExport.setCount(export.getCount());
@@ -5813,11 +5851,11 @@
if (StringUtils.isNotEmpty(questionResultVO.getServiceType()) && questionResultVO.getServiceType().equals("2")) {
//鑾峰彇serviceSubtaskList涓殑鎵�鏈塼askid
List<Long> taskIds = serviceSubtaskRes.stream().map(ServiceSubtaskRes::getTaskid).filter(ObjectUtils::isNotEmpty).distinct().collect(Collectors.toList());
- serviceSubtaskDetailRatioExports = statQuestionOption(taskIds, questionResultVO.getStartOutHospTime(), questionResultVO.getEndOutHospTime(), questionResultVO.getQuestionContent(), questionResultVO.getStartScore(), questionResultVO.getEndScore(),questionResultVO.getValueType());
+ serviceSubtaskDetailRatioExports = statQuestionOption(taskIds, questionResultVO.getStartOutHospTime(), questionResultVO.getEndOutHospTime(), questionResultVO.getQuestionContent(), questionResultVO.getStartScore(), questionResultVO.getEndScore(), questionResultVO.getValueType());
} else if (StringUtils.isNotEmpty(questionResultVO.getServiceType()) && questionResultVO.getServiceType().equals("6")) {
//婊℃剰搴︾粺璁� 锛堥�氳繃 subtask 鐨� id 鍘荤粺璁★級
List<Long> subtaskIds = serviceSubtaskRes.stream().map(ServiceSubtaskRes::getId).collect(Collectors.toList());
- serviceSubtaskDetailRatioExports = statQuestionOptionBySubtaskIds(subtaskIds, questionResultVO.getStartOutHospTime(), questionResultVO.getEndOutHospTime(), questionResultVO.getQuestionContent(), questionResultVO.getStartScore(), questionResultVO.getEndScore(),questionResultVO.getValueType());
+ serviceSubtaskDetailRatioExports = statQuestionOptionBySubtaskIds(subtaskIds, questionResultVO.getStartOutHospTime(), questionResultVO.getEndOutHospTime(), questionResultVO.getQuestionContent(), questionResultVO.getStartScore(), questionResultVO.getEndScore(), questionResultVO.getValueType());
}
return serviceSubtaskDetailRatioExports;
}
--
Gitblit v1.9.3