From 6f1e752bf00b584c8a17569578fa8e54cdb71b60 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 27 十月 2025 13:34:59 +0800
Subject: [PATCH] 处理选项不显示的问题
---
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | 1115 +++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 756 insertions(+), 359 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 28d8cde..76af007 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -8,7 +8,6 @@
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.*;
import com.smartor.common.FtpService;
-import com.smartor.common.SendService;
import com.smartor.config.PhoneUtils;
import com.smartor.domain.*;
import com.smartor.mapper.*;
@@ -16,7 +15,6 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.ListOperations;
@@ -24,8 +22,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
+import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDate;
@@ -49,6 +47,9 @@
public class ServiceSubtaskServiceImpl implements IServiceSubtaskService {
@Autowired
private ServiceSubtaskMapper serviceSubtaskMapper;
+
+ @Autowired
+ private ServiceSubtaskPreachformMapper serviceSubtaskPreachformMapper;
@Autowired
private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper;
@@ -92,6 +93,12 @@
@Autowired
private FtpService ftpService;
+ @Autowired
+ private PatMedInhospMapper patMedInhospMapper;
+
+ @Autowired
+ private PatArchiveMapper patArchiveMapper;
+
@Value("${pri_key}")
private String pri_key;
@@ -103,9 +110,6 @@
@Autowired
private RedisTemplate redisTemplate;
-
- @Autowired
- private SendService sendService;
@Value("${hangup}")
private String hangup;
@@ -155,6 +159,10 @@
return serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO);
}
+ public List<ServiceSubtask> selectServiceSubtaskListAgain(ServiceSubtaskVO serviceSubtaskVO) {
+ return serviceSubtaskMapper.selectServiceSubtaskListAgain(serviceSubtaskVO);
+ }
+
@Override
public ServiceTaskVO queryTaskByCondition(ServiceSubtask serviceSubtask) {
//瀹氫箟鎮h�呬笌鍗曚竴浠诲姟鍏宠仈琛ㄩ泦鍚�
@@ -164,9 +172,20 @@
ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
if (CollectionUtils.isEmpty(list) || list.size() == 0) {
- return DtoConversionUtils.sourceToTarget(serviceTask, ServiceTaskVO.class);
- }
+ ServiceTaskVO serviceTaskVO = DtoConversionUtils.sourceToTarget(serviceTask, ServiceTaskVO.class);
+ ObjectMapper objectMapper = new ObjectMapper();
+ try {
+ List<Map<String, Object>> mapList = objectMapper.readValue(serviceTask.getPreachformDesc(), List.class);
+ serviceTaskVO.setPreachformList(mapList);
+//
+// String result = mapList.stream().map(mapList1 -> mapList1.get("preachform")).map(String::valueOf).collect(Collectors.joining(","));
+// serviceTaskVO.setPreachform(result);
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ }
+ return serviceTaskVO;
+ }
//灏嗘煡鍑烘潵鐨勬暟鎹�掑叆ServiceSubtaskVO涓�
ServiceTaskVO serviceTaskVO = DtoConversionUtils.sourceToTarget(serviceTask, ServiceTaskVO.class);
@@ -247,6 +266,23 @@
patTaskRelevance.setNurseName(serviceSubtask1.getNurseName());
patTaskRelevances.add(patTaskRelevance);
}
+
+ //鑾峰彇璇ユ偅鑰呮墍鏈夌殑鎵ц鐘舵��
+ ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform();
+ serviceSubtaskPreachform.setTaskid(serviceTask.getTaskid());
+ serviceSubtaskPreachform.setSubid(serviceSubtask1.getId());
+ List<ServiceSubtaskPreachform> serviceSubtaskPreachformList = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform);
+ List<Map<String, Object>> resultList = serviceSubtaskPreachformList.stream().map(item -> {
+ Map<String, Object> map = new HashMap<>();
+ map.put("sort", item.getSort());
+ map.put("preachform", item.getPreachform());
+ map.put("compensateTime", item.getCompensateTime());
+ return map;
+ }).collect(Collectors.toList());
+ serviceTaskVO.setPreachformList(resultList);
+
+// String result = resultList.stream().map(mapList1 -> mapList1.get("preachform")).map(String::valueOf).collect(Collectors.joining(","));
+// serviceTaskVO.setPreachform(result);
}
serviceTaskVO.setPatTaskRelevances(patTaskRelevances);
@@ -256,14 +292,7 @@
@Override
public List<ServiceSubtask> patItem(ServiceSubtaskVO serviceSubtaskVO) {
List<ServiceSubtask> selectServiceSubtaskList = this.selectServiceSubtaskList(serviceSubtaskVO);
- //鏍规嵁鍑洪櫌 鏃堕棿鍊掑簭
- List<ServiceSubtask> sortedServiceSubtaskList = null;
- if (serviceSubtaskVO.getSort() == null || serviceSubtaskVO.getSort() == 0)
- sortedServiceSubtaskList = selectServiceSubtaskList.stream().sorted(Comparator.comparing(ServiceSubtask::getEndtime, Comparator.nullsLast(Comparator.naturalOrder())).reversed()).collect(Collectors.toList());
- if (serviceSubtaskVO.getSort() != null && serviceSubtaskVO.getSort() == 1)
- sortedServiceSubtaskList = selectServiceSubtaskList.stream().sorted(Comparator.comparing(ServiceSubtask::getLongSendTime, Comparator.nullsLast(Comparator.naturalOrder())).reversed()).collect(Collectors.toList());
-
- return sortedServiceSubtaskList;
+ return selectServiceSubtaskList;
}
@Override
@@ -290,13 +319,16 @@
Integer fssb = 0;
Integer yfs = 0;
Integer blq = 0;
+ Integer dsf = 0;
for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
if (serviceSubtask.getSendstate() == 4L) wzx = wzx + 1;
- else if (serviceSubtask.getSendstate() != 4L) ysf = ysf + 1;
+ else if (serviceSubtask.getSendstate() != 4L && serviceSubtask.getSendstate() != 2L) ysf = ysf + 1;
if (serviceSubtask.getSendstate() == 5L) fssb = fssb + 1;
- if (serviceSubtask.getSendstate() == 3L) yfs = yfs + 1;
+ if (serviceSubtask.getSendstate() >= 3L || serviceSubtask.getSendstate() == 1L) yfs = yfs + 1;
+ if (serviceSubtask.getSendstate() == 2L) dsf = dsf + 1;
if (serviceSubtask.getSendstate() == 1L) blq = blq + 1;
- if (serviceSubtask.getExcep().equals("1")) yc = yc + 1;
+ if (StringUtils.isNotEmpty(serviceSubtask.getExcep()) && !serviceSubtask.getExcep().equals("0"))
+ yc = yc + 1;
}
map.put("wzx", wzx);
map.put("ysf", ysf);
@@ -304,6 +336,7 @@
map.put("fssb", fssb);
map.put("yfs", yfs);
map.put("blq", blq);
+ map.put("dsf", dsf);
return map;
}
@@ -318,6 +351,57 @@
public int insertServiceSubtask(ServiceSubtask serviceSubtask) {
serviceSubtask.setCreateTime(DateUtils.getNowDate());
return serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
+ }
+
+ /**
+ * 鍐嶆鏂板鍗曚竴浠诲姟锛堥殢璁匡級
+ *
+ * @param serviceSubtask 鍐嶆鏂板鍗曚竴浠诲姟锛堥殢璁匡級
+ * @return 缁撴灉
+ */
+ @Override
+ public String addSubTaskAgain(ServiceSubtask serviceSubtask) {
+ ServiceSubtask serviceSubtask1 = selectServiceSubtaskById(serviceSubtask.getId());
+ PatMedInhosp patMedInhosp = new PatMedInhosp();
+ patMedInhosp.setPatid(serviceSubtask1.getPatid());
+ patMedInhosp.setInhospstate("0");
+ List<PatMedInhosp> patMedInhospList = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
+ PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(serviceSubtask1.getPatid());
+
+ if (patMedInhospList.size() > 0) {
+ serviceSubtask1.setIsVisitAgain(2);
+ serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
+ return "鏃犻渶鍐嶆闅忚锛屾偅鑰呭啀鍏ラ櫌浜�";
+ } else if (serviceSubtask1.getSendstate() == 4L) {
+ serviceSubtask1.setIsVisitAgain(2);
+ serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
+ return "鏃犻渶鍐嶆闅忚锛屼换鍔¤鏍囪涓嶅湪鎵ц";
+ } else if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) {
+ serviceSubtask1.setIsVisitAgain(2);
+ serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
+ return "鏃犻渶鍐嶆闅忚锛屾偅鑰呰鏍囪涓嶉渶瑕佽鏈嶅姟";
+ } else if (ObjectUtils.isNotEmpty(serviceSubtask1.getIsVisitAgain()) && serviceSubtask1.getIsVisitAgain() == 2) {
+ return "鏃犻渶鍐嶆闅忚锛岃浠诲姟宸茬粡鍐嶆闅忚杩囦簡";
+ }
+ //鏂板鍐嶆闅忚浠诲姟
+ ServiceSubtask serviceSubtask2 = DtoConversionUtils.sourceToTarget(serviceSubtask, ServiceSubtask.class);
+ serviceSubtask2.setId(null);
+ serviceSubtask2.setUpid(serviceSubtask1.getId().intValue());
+ serviceSubtask2.setVisitCount(serviceSubtask1.getVisitCount() + 1);
+ serviceSubtask2.setSendstate(2L);
+ serviceSubtask2.setCreateTime(new Date());
+ serviceSubtask2.setUpdateTime(new Date());
+ serviceSubtask2.setVisitType(serviceSubtask.getVisitType());
+ serviceSubtask2.setVisitDeptCode(serviceSubtask.getVisitDeptCode());
+ serviceSubtask2.setVisitDeptName(serviceSubtask.getVisitDeptName());
+ int i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask2);
+ if (i == 1) {
+ //鏂板鎴愬姛鍚庯紝闇�瑕佸皢涔嬪墠鐨勪换鍔¤缃负涓嶈鍐嶉殢璁匡紙闃叉閲嶅鐐癸紝鐒跺悗閲嶅鐢熸垚锛�
+ serviceSubtask1.setIsVisitAgain(2);
+ serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
+ return "鍐嶆闅忚浠诲姟鍒涘缓鎴愬姛";
+ }
+ return "鍐嶆闅忚浠诲姟鍒涘缓澶辫触锛屽啀璇锋閲嶈瘯";
}
/**
@@ -361,6 +445,16 @@
throw new BaseException("浠诲姟鍏ュ弬涓虹┖锛岃妫�鏌ュ叆鍙�");
}
ServiceTask serviceTask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceTask.class);
+ if (CollectionUtils.isEmpty(serviceTaskVO.getPreachformList())) throw new BaseException("浠诲姟鐨勫彂閫佹柟寮忎负绌�");
+ //灏唒reachfromList鏀惧埌serviceTask涓殑preachfrom涓�
+ ObjectMapper mapper = new ObjectMapper();
+ try {
+ String preachformList = mapper.writeValueAsString(serviceTaskVO.getPreachformList());
+ serviceTask.setPreachformDesc(preachformList);
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ }
+
serviceTask.setTextParam(JSON.toJSONString(serviceTaskVO.getTextParam()));
if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 1) {
//鏂板妯℃澘淇℃伅
@@ -381,31 +475,40 @@
if (serviceTask.getSendState() == null) {
serviceTask.setSendState(1L);
serviceTaskVO.setSendState(1L);
+ } else {
+ serviceTask.setSendState(serviceTaskVO.getSendState());
}
if (StringUtils.isNotEmpty(serviceTaskVO.getLibtemplateid())) {
serviceTask.setLibtemplateid(serviceTaskVO.getLibtemplateid());
serviceTask.setLibtemplatename(serviceTaskVO.getLibtemplatename());
}
- serviceTask.setTemplateid(tempid);
- serviceTask.setTemplatename(tempName);
+ if (serviceTaskVO.getTemplateid() != null) {
+ serviceTask.setTemplateid(serviceTaskVO.getTemplateid());
+ serviceTask.setTemplatename(serviceTaskVO.getTemplatename());
+ } else {
+ serviceTask.setTemplateid(tempid);
+ serviceTask.setTemplatename(tempName);
+ }
serviceTask.setLeaveldeptcodes(serviceTaskVO.getLeaveldeptcodes());
serviceTask.setLeavehospitaldistrictcode(serviceTask.getLeavehospitaldistrictcode());
- serviceTask.setSendState(2L);
+ if (serviceTaskVO.getLongTask() == 1) serviceTask.setSendState(2L);
+ serviceTask.setCreateTime(new Date());
+ serviceTask.setUpdateTime(new Date());
serviceTaskService.insertServiceTask(serviceTask);
- log.error("----serviceTaskVO.getAppltype()鐨勫�间负锛歿}", serviceTaskVO.getAppltype());
+ log.info("----serviceTaskVO.getAppltype()鐨勫�间负锛歿}", serviceTaskVO.getAppltype());
if (StringUtils.isNotEmpty(serviceTaskVO.getAppltype())) {
if (serviceTaskVO.getAppltype().equals("3")) {
ServiceTaskdiag serviceTaskdiag = new ServiceTaskdiag();
serviceTaskdiag.setTaskId(serviceTask.getTaskid());
serviceTaskdiag.setTaskName(serviceTask.getTaskName());
- serviceTaskdiag.setLongtask(0L);
+ serviceTaskdiag.setLongtask(Long.valueOf(serviceTask.getLongTask()));
if (serviceTaskVO.getLongTask() == 1) serviceTaskdiag.setLongtask(1L);
serviceTaskdiag.setIcd10code(serviceTaskVO.getIcd10code());
serviceTaskdiag.setIcd10name(serviceTaskVO.getIcd10name());
serviceTaskdiag.setGuid(serviceTask.getGuid());
serviceTaskdiag.setOrgid(serviceTask.getOrgid());
serviceTaskdiag.setCreateTime(new Date());
- log.error("----serviceTaskdiag鐨勫�间负锛歿}", serviceTaskdiag);
+ log.info("----serviceTaskdiag鐨勫�间负锛歿}", serviceTaskdiag);
if (StringUtils.isNotEmpty(serviceTaskVO.getIcd10code())) {
String[] Icd10codes = serviceTaskVO.getIcd10code().split(",");
for (String icd10code : Icd10codes) {
@@ -419,16 +522,15 @@
serviceTaskoper.setOpdesc(serviceTaskVO.getOpdesc());
serviceTaskoper.setTaskId(serviceTask.getTaskid());
serviceTaskoper.setTaskName(serviceTask.getTaskName());
- serviceTaskoper.setLongtask(0L);
+ serviceTaskoper.setLongtask(Long.valueOf(serviceTask.getLongTask()));
serviceTaskoper.setGuid(serviceTask.getGuid());
serviceTaskoper.setOrgid(serviceTask.getOrgid());
serviceTaskoper.setCreateTime(new Date());
- if (serviceTaskVO.getLongTask() == 1) serviceTaskoper.setLongtask(1L);
if (StringUtils.isNotEmpty(serviceTaskVO.getOpcode())) {
String[] opcodes = serviceTaskVO.getOpcode().split(",");
for (String opcode : opcodes) {
serviceTaskoper.setOpcode(opcode);
- log.error("----serviceTaskoper鐨勫�间负锛歿}", serviceTaskoper);
+ log.info("----serviceTaskoper鐨勫�间负锛歿}", serviceTaskoper);
serviceTaskoperService.insertServiceTaskoper(serviceTaskoper);
}
}
@@ -437,8 +539,8 @@
ServiceTaskdept serviceTaskdept = new ServiceTaskdept();
serviceTaskdept.setTaskId(serviceTask.getTaskid());
serviceTaskdept.setTaskName(serviceTask.getTaskName());
- serviceTaskdept.setLongtask(0L);
- if (serviceTaskVO.getLongTask() == 1) serviceTaskdept.setLongtask(1L);
+ serviceTaskdept.setOrgid(serviceTask.getOrgid());
+ serviceTaskdept.setLongtask(Long.valueOf(serviceTaskVO.getLongTask()));
if (StringUtils.isNotEmpty(serviceTaskVO.getDeptcode())) {
String[] deptcodes = serviceTaskVO.getDeptcode().split(",");
for (String deptCode : deptcodes) {
@@ -459,11 +561,12 @@
}
}
}
- if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1 && serviceTaskVO.getPatCycle() == 0L) {
- Map<String, Integer> map = new HashMap<>();
- map.put("taskId", serviceTask.getTaskid().intValue());
- return map;
- }
+//闀挎湡浠诲姟锛屼篃鍏佽鍔犱汉浜�
+// if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1 && serviceTaskVO.getPatCycle() == 0L) {
+// Map<String, Integer> map = new HashMap<>();
+// map.put("taskId", serviceTask.getTaskid().intValue());
+// return map;
+// }
//灏嗕换鍔′俊鎭斁鍒版湇鍔¤〃涓�
ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceSubtask.class);
@@ -489,21 +592,42 @@
serviceSubtask.setDeptname(patTaskRelevance.getDeptName());
serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode());
serviceSubtask.setLeavehospitaldistrictname(patTaskRelevance.getLeavehospitaldistrictname());
- serviceSubtask.setType(serviceTaskVO.getHospType());
+ serviceSubtask.setType(serviceTaskVO.getType());
serviceSubtask.setHospType(patTaskRelevance.getHospType());
serviceSubtask.setOpenid(patTaskRelevance.getOpenid());
serviceSubtask.setDrname(patTaskRelevance.getDrname());
serviceSubtask.setDrcode(patTaskRelevance.getDrcode());
serviceSubtask.setInhosptime(patTaskRelevance.getInhosptime());
+ serviceSubtask.setLeaveicd10code(patTaskRelevance.getLeaveicd10code());
+ serviceSubtask.setLeavediagname(patTaskRelevance.getLeavediagname());
serviceSubtask.setEndtime(patTaskRelevance.getEndtime());
serviceSubtask.setNurseId(patTaskRelevance.getNurseId());
serviceSubtask.setNurseName(patTaskRelevance.getNurseName());
serviceSubtask.setCreateBy(serviceTask.getCreateBy());
serviceSubtask.setUpdateBy(serviceTask.getCreateBy());
+ serviceSubtask.setVisitTime(patTaskRelevance.getVisittime());
if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1)
serviceSubtask.setLongSendTime(patTaskRelevance.getLongSendTime());
serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
serviceSubtask.getId().intValue();
+
+ //闇�瑕佹寜service_task閲岀殑preachform鐨勯『搴忓皢鍙戦�佹柟寮忎繚瀛樺埌service_subtask_preachform琛ㄤ腑
+ if (StringUtils.isNotEmpty(serviceTaskVO.getPreachformList())) {
+ List<Map<String, Object>> pfList = serviceTaskVO.getPreachformList();
+ for (Map<String, Object> map : pfList) {
+ ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform();
+ serviceSubtaskPreachform.setSort(ObjectUtils.isEmpty(map.get("sort")) ? 0 : Long.valueOf(map.get("sort").toString()));
+ serviceSubtaskPreachform.setPreachform(ObjectUtils.isEmpty(map.get("preachform")) ? "" : map.get("preachform").toString());
+ serviceSubtaskPreachform.setCompensateTime(ObjectUtils.isEmpty(map.get("compensateTime")) ? "" : map.get("compensateTime").toString());
+ serviceSubtaskPreachform.setTaskid(serviceTask.getTaskid());
+ serviceSubtaskPreachform.setSubid(serviceSubtask.getId());
+ //杩欎釜sendstate闇�瑕佸湪鏁版嵁搴撹缃竴涓粯璁ゅ�间负鈥�1鈥�
+ serviceSubtaskPreachform.setSendstate("1");
+ serviceSubtaskPreachform.setOrgid(serviceTask.getOrgid());
+ serviceSubtaskPreachform.setCreateTime(new Date());
+ serviceSubtaskPreachformMapper.insertServiceSubtaskPreachform(serviceSubtaskPreachform);
+ }
+ }
}
}
@@ -513,23 +637,34 @@
serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot()));
//淇敼鎿嶄綔锛岄渶瑕佸皢stopState鐘舵��+1
ServiceTask serviceTask1 = serviceTaskService.selectServiceTaskByTaskid(serviceTask.getTaskid());
- long l = serviceTask1.getStopState() + 1;
- serviceTask.setStopState(l);
+ //鑾峰彇鍒拌浠诲姟鎵�鏈夌殑鏈嶅姟锛屽苟浠庨槦鍒楅噷鍒犻櫎
+ ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
+ serviceSubtaskVO.setTaskid(serviceTask1.getTaskid());
+ serviceSubtaskVO.setSendstate(2L);
+ List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO);
+ serviceSubtaskVO.setSendstate(1L);
+ List<ServiceSubtask> serviceSubtaskList1 = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO);
+ if (CollectionUtils.isNotEmpty(serviceSubtaskList)) {
+ if (CollectionUtils.isNotEmpty(serviceSubtaskList1)) serviceSubtaskList.addAll(serviceSubtaskList1);
+ } else {
+ if (CollectionUtils.isNotEmpty(serviceSubtaskList1)) serviceSubtaskList = serviceSubtaskList1;
+ }
+
if (serviceTaskVO.getLibtemplateid() != null)
serviceTask.setLibtemplateid(serviceTaskVO.getLibtemplateid().toString());
serviceTask.setTemplateid(serviceTaskVO.getTemplateid());
serviceTask.setLongTask(serviceTaskVO.getLongTask());
+ serviceTask.setUpdateTime(new Date());
serviceTaskService.updateServiceTask(serviceTask);
if (serviceTaskVO.getAppltype().equals("1") || serviceTaskVO.getAppltype().equals("2")) {
- ServiceTaskdept serviceTaskdept = new ServiceTaskdept();
- serviceTaskdept.setTaskId(serviceTask.getTaskid());
- serviceTaskdept.setTaskName(serviceTask.getTaskName());
- serviceTaskdept.setLongtask(0L);
- serviceTaskdept.setOrgid(serviceTaskVO.getOrgid());
- if (serviceTaskVO.getLongTask() == 1) serviceTaskdept.setLongtask(1L);
if (StringUtils.isNotEmpty(serviceTaskVO.getDeptcode())) {
String[] deptcodes = serviceTaskVO.getDeptcode().split(",");
for (String deptCode : deptcodes) {
+ ServiceTaskdept serviceTaskdept = new ServiceTaskdept();
+ serviceTaskdept.setTaskId(serviceTask.getTaskid());
+ serviceTaskdept.setTaskName(serviceTask.getTaskName());
+ serviceTaskdept.setLongtask(Long.valueOf(serviceTask.getLongTask()));
+ serviceTaskdept.setOrgid(serviceTaskVO.getOrgid());
serviceTaskdept.setDeptCode(deptCode);
serviceTaskdept.setDeptType("1");
serviceTaskdept.setServiceType(serviceTaskVO.getServiceType());
@@ -547,6 +682,11 @@
if (StringUtils.isNotEmpty(serviceTaskVO.getLeavehospitaldistrictcode())) {
String[] leavehospitaldistrictcodes = serviceTaskVO.getLeavehospitaldistrictcode().split(",");
for (String districtcode : leavehospitaldistrictcodes) {
+ ServiceTaskdept serviceTaskdept = new ServiceTaskdept();
+ serviceTaskdept.setTaskId(serviceTask.getTaskid());
+ serviceTaskdept.setTaskName(serviceTask.getTaskName());
+ serviceTaskdept.setLongtask(Long.valueOf(serviceTask.getLongTask()));
+ serviceTaskdept.setOrgid(serviceTaskVO.getOrgid());
serviceTaskdept.setDeptCode(districtcode);
serviceTaskdept.setDeptType("2");
serviceTaskdept.setServiceType(serviceTaskVO.getServiceType());
@@ -569,9 +709,7 @@
if (StringUtils.isEmpty(serviceTaskVO.getIcd10code())) {
throw new BaseException("鐤剧梾缂栫爜涓虹┖");
}
-// serviceTaskdiag.setIcd10code(serviceTaskVO.getIcd10code());
-
- serviceTaskdiag.setLongtask(1L);
+ serviceTaskdiag.setLongtask(Long.valueOf(serviceTask.getLongTask()));
serviceTaskdiag.setIcd10name(serviceTaskVO.getIcd10name());
serviceTaskdiag.setGuid(serviceTask.getGuid());
serviceTaskdiag.setOrgid(serviceTask.getOrgid());
@@ -585,7 +723,7 @@
serviceTaskdiag2.setIcd10code(icdcode);
List<ServiceTaskdiag> serviceTaskdiags = serviceTaskdiagService.selectServiceTaskdiagList(serviceTaskdiag2);
serviceTaskdiag.setIcd10code(icdcode);
- log.error("----serviceTaskdiag鏇存柊鐨勫�间负锛歿}", serviceTaskdiag);
+ log.info("----serviceTaskdiag鏇存柊鐨勫�间负锛歿}", serviceTaskdiag);
if (CollectionUtils.isNotEmpty(serviceTaskdiags)) {
serviceTaskdiag.setId(serviceTaskdiags.get(0).getId());
serviceTaskdiagService.updateServiceTaskdiag(serviceTaskdiag);
@@ -594,7 +732,6 @@
}
}
}
-
} else if (serviceTaskVO.getAppltype().equals("4")) {
ServiceTaskoper serviceTaskoper = new ServiceTaskoper();
@@ -605,7 +742,7 @@
serviceTaskoper.setOpdesc(serviceTaskVO.getOpdesc());
serviceTaskoper.setTaskId(serviceTask.getTaskid());
serviceTaskoper.setTaskName(serviceTask.getTaskName());
- serviceTaskoper.setLongtask(1L);
+ serviceTaskoper.setLongtask(Long.valueOf(serviceTask.getLongTask()));
serviceTaskoper.setGuid(serviceTask.getGuid());
serviceTaskoper.setOrgid(serviceTask.getOrgid());
serviceTaskoper.setCreateTime(new Date());
@@ -619,7 +756,7 @@
List<ServiceTaskoper> serviceTaskopers = serviceTaskoperService.selectServiceTaskoperList(serviceTaskoper2);
serviceTaskoper.setOpcode(opcode);
- log.error("----serviceTaskoper鐨勫�间负锛歿}", serviceTaskoper);
+ log.info("----serviceTaskoper鐨勫�间负锛歿}", serviceTaskoper);
if (CollectionUtils.isNotEmpty(serviceTaskopers)) {
serviceTaskoper.setId(serviceTaskopers.get(0).getId());
serviceTaskoperService.updateServiceTaskoper(serviceTaskoper);
@@ -628,7 +765,6 @@
}
}
}
-
}
if (ObjectUtils.isNotEmpty(serviceTaskVO.getIvrTaskTemplateVO())) {
IvrTaskTemplate ivrTaskTemplate = new IvrTaskTemplate();
@@ -662,7 +798,7 @@
serviceSubtask.setLeavehospitaldistrictname(patTaskRelevance.getLeavehospitaldistrictname());
serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode());
serviceSubtask.setDeptname(patTaskRelevance.getDeptName());
- serviceSubtask.setType(serviceTaskVO.getHospType());
+ serviceSubtask.setType(serviceTaskVO.getType());
serviceSubtask.setCreateTime(DateUtils.getNowDate());
serviceSubtask.setDrname(patTaskRelevance.getDrname());
serviceSubtask.setDrcode(patTaskRelevance.getDrcode());
@@ -671,12 +807,17 @@
serviceSubtask.setEndtime(patTaskRelevance.getEndtime());
serviceSubtask.setNurseId(patTaskRelevance.getNurseId());
serviceSubtask.setNurseName(patTaskRelevance.getNurseName());
+ serviceSubtask.setVisitTime(patTaskRelevance.getVisittime());
serviceSubtask.setTextParam(new Gson().toJson(serviceTaskVO.getTextParam()));
if (patTaskRelevance.getIsoperation() != null) {
- if (patTaskRelevance.getIsoperation() == 2)
+ if (patTaskRelevance.getIsoperation() == 2) {
+ serviceSubtask.setUpdateBy(serviceTask.getUpdateBy());
serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask);
+ }
if (patTaskRelevance.getIsoperation() == 1) {
serviceSubtask.setSendstate(1L);
+ serviceSubtask.setUpdateBy(serviceTask.getUpdateBy());
+ serviceSubtask.setCreateBy(serviceTask.getUpdateBy());
serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
}
if (patTaskRelevance.getIsoperation() == 3)
@@ -684,6 +825,36 @@
serviceSubtaskMapper.deleteServiceSubtaskByCondition(serviceTaskVO.getTaskid(), patTaskRelevance.getPatid());
}
serviceSubtask.getTaskid().intValue();
+ }
+ }
+ // 鏈夊彲鑳戒細鎶婂彂閫侀『搴忎篃淇敼浜嗭紙闇�瑕佹牴鎹畉askId灏嗘墍鏈夌殑sendstate锛�=4,5,6鐨剆ubTask鎷夊嚭鏉ワ紝杩涜淇敼涓�涓嬶級
+ ServiceSubtaskVO ssVo = new ServiceSubtaskVO();
+ ssVo.setTaskid(serviceTaskVO.getTaskid());
+ ssVo.setDelFlag("0");
+ List<Long> ssList = new ArrayList<>();
+ ssList.add(1l);
+ ssList.add(2L);
+ ssList.add(3L);
+ ssVo.setSendstates(ssList);
+ List<ServiceSubtask> ssTaskList = serviceSubtaskMapper.selectServiceSubtaskBySendstate(ssVo);
+ for (int i = 0; i < ssTaskList.size(); i++) {
+ ServiceSubtask serviceSubtask = ssTaskList.get(i);
+ serviceSubtaskPreachformMapper.deleteServiceSubtaskPreachformBySubid(serviceSubtask.getId());
+ if (StringUtils.isNotEmpty(serviceTaskVO.getPreachformList())) {
+ List<Map<String, Object>> pfList = serviceTaskVO.getPreachformList();
+ for (Map<String, Object> map : pfList) {
+ ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform();
+ serviceSubtaskPreachform.setSort(ObjectUtils.isEmpty(map.get("sort")) ? 0 : Long.valueOf(map.get("sort").toString()));
+ serviceSubtaskPreachform.setPreachform(ObjectUtils.isEmpty(map.get("preachform")) ? "" : map.get("preachform").toString());
+ serviceSubtaskPreachform.setCompensateTime(ObjectUtils.isEmpty(map.get("compensateTime")) ? "" : map.get("compensateTime").toString());
+ serviceSubtaskPreachform.setTaskid(serviceTask.getTaskid());
+ serviceSubtaskPreachform.setSubid(serviceSubtask.getId());
+ //杩欎釜sendstate闇�瑕佸湪鏁版嵁搴撹缃竴涓粯璁ゅ�间负鈥�1鈥�
+ serviceSubtaskPreachform.setSendstate("1");
+ serviceSubtaskPreachform.setOrgid(serviceTask.getOrgid());
+// serviceSubtaskPreachform.setSort(Long.valueOf(i));
+ serviceSubtaskPreachformMapper.insertServiceSubtaskPreachform(serviceSubtaskPreachform);
+ }
}
}
}
@@ -750,7 +921,7 @@
//鏈変笅涓�棰�
redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(IvrTaskTemplateScriptVOs, nowQuestion);
- // 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙�
+ // 闂锛� 鍘昏皟鐢�"tts鍚堟垚鍜屾挱鏀�"鎺ュ彛
String date = simpleDateFormat1.format(new Date());
log.info("鍘昏皟鐢╰ts鍚堟垚鍜屾挱鏀炬帴鍙�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
phoneUtils.ttsPlayback(nowQuestion.getIvrtext(), phoneCallBackVO.getUuid());
@@ -759,7 +930,7 @@
redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES);
//璋冪敤ivrLibaTemplateScriptVO涓殑slienceText(闈欓粯璇濇湳)
String slienceText = nowQuestion.getSlienceText();
- //闈欓粯璇濇湳 + 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙�
+ //闈欓粯璇濇湳 + 闂锛� 鍘昏皟鐢�"tts鍚堟垚鍜屾挱鏀�"鎺ュ彛
String date = simpleDateFormat1.format(new Date());
log.info("闈欓粯璇濇湳 + 闂,鍘昏皟鐢╰ts鍚堟垚鍜屾挱鏀炬帴鍙�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
phoneUtils.ttsPlayback(slienceText + nowQuestion.getIvrtext(), phoneCallBackVO.getUuid());
@@ -924,9 +1095,9 @@
redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES);
}
- //璋冪敤鈥�15銆乼ts鍚堟垚鍜屾挱鏀撅紝 tts_playback鈥濆皢缁撴灉浼犲洖
+ //璋冪敤"15銆乼ts鍚堟垚鍜屾挱鏀撅紝 tts_playback"灏嗙粨鏋滀紶鍥�
String date = simpleDateFormat1.format(new Date());
- log.info("璋冪敤鈥�15銆乼ts鍚堟垚鍜屾挱鏀�------: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
+ log.info("璋冪敤tts鍚堟垚鍜屾挱鏀�------: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid());
phoneUtils.ttsPlayback(nowQuestion.getIvrtext() + ivrTaskTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid());
}
break;
@@ -951,15 +1122,17 @@
//鍒ゆ柇鏄惁鎸傛満
String hangupState = redisCache.getCacheObject(phoneCallReqYQVO.getUuid() + "- hangup");
Object cacheObject1 = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid() + "recordAccept-hungup");
- if (StringUtils.isNotEmpty(hangupState) && hangup.equals("1") || ObjectUtils.isNotEmpty(cacheObject1) && String.valueOf(cacheObject1).equals("1")) {
+ if (StringUtils.isNotEmpty(hangupState) && hangupState.equals("1") || ObjectUtils.isNotEmpty(cacheObject1) && String.valueOf(cacheObject1).equals("1")) {
return new PhoneCallBackYQVO();
}
if ("AsrCallback".equals(phoneCallReqYQVO.getOperate()) && phoneCallReqYQVO.getEnd_time() != null && phoneCallReqYQVO.getEnd_time() != -1) {
//澶勭悊鎸傛柇
if (phoneCallReqYQVO.getAsrtext().contains("鎷ㄥ彨鐨勭敤鎴锋蹇�")) {
- //鍒ゆ柇 recordAccept-hungup 鏄惁鏈夊�硷紝濡傛灉鏈夛紝鍒欒鏄庝笉鐢ㄥ鐞嗕簡锛屼箣鍓嶅凡缁忓鐞嗚繃浜嗭紙recordAccept-hungup杩欎釜涓昏鏄粰鈥滈�氳瘽璁板綍鐢ㄧ殑锛屸�濓級
+ //鍒ゆ柇 recordAccept-hungup 鏄惁鏈夊�硷紝濡傛灉鏈夛紝鍒欒鏄庝笉鐢ㄥ鐞嗕簡锛屼箣鍓嶅凡缁忓鐞嗚繃浜嗭紙recordAccept-hungup杩欎釜涓昏鏄粰"閫氳瘽璁板綍鐢ㄧ殑锛�"锛�
Object cacheObject = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid() + "recordAccept-hungup");
if (ObjectUtils.isNotEmpty(cacheObject) && String.valueOf(cacheObject).equals("1")) {
+ ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallReqYQVO.getTaskid()));
+ setFailPreachForm(serviceSubtask, "3", "鎷ㄥ彨鐨勭敤鎴锋蹇�", "4");
return new PhoneCallBackYQVO();
}
//濡傛灉鍙戦�佺姸鎬佷负6锛屽氨璇存槑宸茬粡鎵撳畬浜嗭紝涔熸病鏈夊繀瑕佺户缁線涓嬭蛋浜�
@@ -981,8 +1154,12 @@
//鍏堟妸榛樿鐨剅ecordAccept-hungup鍒犻櫎锛屽啀鏇存柊
redisCache.deleteObject(phoneCallReqYQVO.getTaskid() + "recordAccept-hungup");
redisCache.setCacheObject(phoneCallReqYQVO.getTaskid() + "recordAccept-hungup", "1", 10, TimeUnit.MINUTES);
+
+ //璁板綍鐢佃瘽鍙戦�佺姸鎬�
+ setFailPreachForm(serviceSubtask2, "3", "鐢佃瘽鍙戦�佹垚鍔燂紙鎮h�呮寕鏂級", "4");
+
//杩欎釜鏃跺�欏氨闇�瑕佽蛋琛ュ伩鏈哄埗浜嗭紝鍏堟殏瀹氳蛋鐭俊
- getSmsCompensate(Long.valueOf(phoneCallReqYQVO.getTaskid()));
+// getSmsCompensate(Long.valueOf(phoneCallReqYQVO.getTaskid()));
return new PhoneCallBackYQVO();
}
}
@@ -1011,6 +1188,9 @@
req.put("caller", phoneCallReqYQVO.getPhone());
// HttpUtils.sendPost(hangup, new Gson().toJson(req));
HttpUtil.postJsonRequest(hangup, new Gson().toJson(req));
+ ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallReqYQVO.getTaskid()));
+ //璁板綍鐢佃瘽鍙戦�佺姸鎬�
+ setFailPreachForm(serviceSubtask, "3", "閫氳瘽姝e父缁撴潫", "9");
//鍒犻櫎缁撴潫璇殑鎮e瓨
redisCache.deleteObject(phoneCallReqYQVO.getUuid() + "- jsy");
} else {
@@ -1018,6 +1198,7 @@
log.error("-------PlayEventCallbackPlaystop鐨勫�间负锛歿}", true);
}
}
+
return phoneCallBackYQVO;
}
//鑾峰彇鏀鹃煶鏄惁缁撴潫
@@ -1094,6 +1275,9 @@
serviceSubtask.setUpdateTime(new Date());
log.error("鍏堟洿鏂颁竴涓嬪垎鏁�,鐢佃瘽鐨剆erviceSubtask鐨勫�间负锛歿}", serviceSubtask);
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+ //璁板綍鐘舵��
+ setFailPreachForm(serviceSubtask, "3", "闈欓粯娆℃暟杈惧埌" + num + "娆�", "4");
+
Map<String, String> map = delRedisValue(null, id.toString());
if (ObjectUtils.isNotEmpty(map)) redisCache.setCacheObject(map.get("cacheName"), map.get("val"));
redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
@@ -1139,6 +1323,7 @@
}
break;
}
+ log.info("鏄惁闇�瑕佹寕鏈猴細{}", les);
if (ObjectUtils.isNotEmpty(les)) {
//瀵瑰尮閰嶇殑缁撴灉澶勭悊涓�涓�(鐪嬬湅鏄笉鏄渶瑕佹寕鏈�)
if (les.getIsEnd() != null && les.getIsEnd() == 1) {
@@ -1147,6 +1332,8 @@
ss.setSendstate(6L);
ss.setRemark("鐢佃瘽鎷ㄦ墦宸插畬鎴�");
serviceSubtaskMapper.updateServiceSubtask(ss);
+ //璁板綍鐘舵��
+ setFailPreachForm(serviceSubtask, "3", "鐢佃瘽鎷ㄦ墦宸插畬鎴�", "9");
//鍙互鎸傛満浜�
redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
redisCache.deleteObject(phoneCallReqYQVO.getUuid() + "SCORE");
@@ -1197,6 +1384,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()) {
//璇存槑鍖归厤姝g‘浜�
//杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉�
+ log.info("鍖归厤姝g‘浜嗗悧--------------");
ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(1);
serviceTaskScriptTargetoptionMapper.updateIvrTaskTemplateTargetoption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j));
@@ -1230,6 +1418,8 @@
redisCache.setCacheObject(phoneCallReqYQVO.getUuid() + "- jsy", serviceTask.getJsy(), 120, TimeUnit.MINUTES);
phoneCallBackYQVO.setType("text");
phoneCallBackYQVO.setValue(phoneCallBackYQVO.getCommonValue() + serviceTask.getJsy());
+ //璁板綍鐘舵��
+ setFailPreachForm(serviceSubtask, "3", "鐢佃瘽鎷ㄦ墦宸插畬鎴�", "9");
return phoneCallBackYQVO;
}
@@ -1261,6 +1451,9 @@
ss.setSendstate(6L);
ss.setRemark("鐢佃瘽鎷ㄦ墦宸插畬鎴�");
serviceSubtaskMapper.updateServiceSubtask(ss);
+ //璁板綍鐘舵��
+ setFailPreachForm(serviceSubtask, "3", "鐢佃瘽鎷ㄦ墦宸插畬鎴�", "9");
+
redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
redisCache.deleteObject(phoneCallReqYQVO.getUuid() + "SCORE");
redisCache.deleteObject(phoneCallReqYQVO.getUuid() + "PlayEventCallbackPlaystop");
@@ -1285,8 +1478,9 @@
if (script.getSort() == nextQuestion.intValue()) {
phoneCallBackYQVO.setType("text");
phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
- String scriptContent = script.getIvrtext();
+ String scriptContent = StringUtils.isNotEmpty(script.getIvrtext()) ? script.getIvrtext() : script.getScriptContent();
log.error("涓嬩竴棰橀棶棰橈細{}", scriptContent);
+ log.error("涓嬩竴棰樼殑瀛愪换鍔℃槸锛歿}", serviceSubtask);
phoneCallBackYQVO.setValue(phoneCallBackYQVO.getCommonValue() + getObject(serviceSubtask, scriptContent));
//灏嗚鎮h�呯殑Redis涓殑棰樼洰ID锛岃繘琛屼慨鏀�
redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "-" + phoneCallReqYQVO.getPhone().trim(), script.getId().toString(), 120, TimeUnit.MINUTES);
@@ -1307,6 +1501,8 @@
serviceSubtask.setSendstate(6L);
serviceSubtask.setRemark("鐢佃瘽鎷ㄦ墦宸插畬鎴�");
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+ //璁板綍鐘舵��
+ setFailPreachForm(serviceSubtask, "3", "鐢佃瘽鎷ㄦ墦宸插畬鎴�", "9");
//璁剧疆缁撴潫璇�
phoneCallBackYQVO.setValue(phoneCallBackYQVO.getCommonValue() + serviceTask1.getJsy());
Long id = serviceSubtask.getId();
@@ -1325,6 +1521,7 @@
}
} else {
+ log.info("娌℃湁鍖归厤涓�----------------------------");
//flag=0,璇存槑娌� 鍖归厤涓婏紝涔熻鎶婃偅鑰呰鐨勮瘽璁板綍涓嬫潵
if (j == ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().size() - 1 && flag == 0) {
ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq();
@@ -1352,6 +1549,7 @@
}
//閮芥病鏈夊尮閰嶅埌
if (StringUtils.isEmpty(phoneCallBackYQVO.getValue())) {
+ log.info("閮芥病鏈夊尮閰嶅埌-------------------------");
Integer count = null;
Object countObj = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid());
if (ObjectUtils.isNotEmpty(countObj)) count = (Integer) countObj;
@@ -1375,16 +1573,19 @@
serviceSubtask.setSendstate(6L);
serviceSubtask.setRemark("鐢佃瘽鎷ㄦ墦宸插畬鎴�");
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
-
+ //璁板綍鐘舵��
+ setFailPreachForm(serviceSubtask, "3", "鐢佃瘽鎷ㄦ墦宸插畬鎴�", "9");
//鍦╮edis涓繚瀛樹竴涓嬬粨鏉熻锛屽湪璋冪敤鎸傜數璇濈殑鏂规硶鏃跺垹闄�
ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
redisCache.setCacheObject(phoneCallReqYQVO.getUuid() + "- jsy", serviceTask.getJsy(), 120, TimeUnit.MINUTES);
//鍘籸edis涓紝鎶婅瀛愪换鍔D鍒犻櫎
Long id = serviceSubtask.getId();
Map<String, String> map = delRedisValue(null, id.toString());
- redisCache.setCacheObject(map.get("cacheName"), map.get("val"));
- redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
- redisCache.deleteObject(phoneCallReqYQVO.getUuid() + "SCORE");
+ if (ObjectUtils.isNotEmpty(map)) {
+ redisCache.setCacheObject(map.get("cacheName"), map.get("val"));
+ redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
+ redisCache.deleteObject(phoneCallReqYQVO.getUuid() + "SCORE");
+ }
// return phoneCallBackYQVO;
} else {
//鏍规嵁ivrTaskTemplateScriptVO.getNextScriptno()鑾峰彇涓嬩竴棰樿繘琛屾彁闂�
@@ -1392,7 +1593,7 @@
if (script.getSort() == ivrTaskTemplateScriptVO.getNextScriptno().intValue()) {
phoneCallBackYQVO.setType("text");
phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
- String scriptContent = script.getIvrtext();
+ String scriptContent = StringUtils.isNotEmpty(script.getIvrtext()) ? script.getIvrtext() : script.getScriptContent();
phoneCallBackYQVO.setValue(phoneCallBackYQVO.getCommonValue() + getObject(serviceSubtask, scriptContent));
//灏嗚鎮h�呯殑Redis涓殑棰樼洰ID锛岃繘琛屼慨鏀�
redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "-" + phoneCallReqYQVO.getPhone().trim(), script.getId().toString(), 120, TimeUnit.MINUTES);
@@ -1446,7 +1647,8 @@
if (ivrTaskTemplateScriptVO.getNextScriptno().intValue() == ivrTaskTemplateScript1.getSort()) {
phoneCallBackYQVO.setType("text");
phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
- String scriptContent = ivrTaskTemplateScript1.getIvrtext();
+ String scriptContent = StringUtils.isNotEmpty(ivrTaskTemplateScript1.getIvrtext()) ? ivrTaskTemplateScript1.getIvrtext() : ivrTaskTemplateScript1.getScriptContent();
+
phoneCallBackYQVO.setValue(phoneCallBackYQVO.getCommonValue() + getObject(serviceSubtask, scriptContent));
redisCache.deleteObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid());
redisCache.setCacheObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone(), ivrTaskTemplateScript1.getId().toString());
@@ -1476,7 +1678,8 @@
serviceSubtask.setRemark("鐢佃瘽鎷ㄦ墦宸插畬鎴�");
serviceSubtask.setSendstate(6L);
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
-
+ //璁板綍鐘舵��
+ setFailPreachForm(serviceSubtask, "3", "鐢佃瘽鎷ㄦ墦宸插畬鎴�", "9");
//鍘籸edis涓紝鎶婅瀛愪换鍔D鍒犻櫎
Long id = serviceSubtask.getId();
Map<String, String> map = delRedisValue(null, id.toString());
@@ -1499,6 +1702,9 @@
for (String key : map.keySet()) {
scriptContent = scriptContent.replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : "");
}
+ }
+ if (StringUtils.isEmpty(scriptContent)) {
+ return scriptContent;
}
scriptContent = scriptContent.replace("${name}", StringUtils.isNotEmpty(serviceSubtask.getSendname()) ? serviceSubtask.getSendname() : "");
scriptContent = scriptContent.replace("${dzz}", StringUtils.isNotEmpty(serviceSubtask.getAddr()) ? serviceSubtask.getAddr() : "");
@@ -1572,10 +1778,9 @@
//蹇呴』绛塧che-exist鍏ㄩ儴鎵撳畬鎵嶈兘鎷夊彇涓嬩竴鎵癸紙涓昏鏄�曟墍鏈夌殑鏁版嵁閮藉爢鍦ㄧ數璇濈殑缂撳瓨閲岋紝鍦ㄨ瀹氱殑鏃堕棿鎵撲笉瀹岋級
long existSize = listOps.size("cache-exist");
if (existSize > 0) return pullTaskVOList;
-
+ int count = 0;
long size = listOps.size("cache-0");
log.error("---------鎵撶數璇濅箣鍓嶇紦瀛樹腑鐨勬暟鎹噺锛歿}", size);
- int count = 0;
if (size > 0) {
//phoneCount() 閫氳繃缁欏嚭鐨勬瘡涓皬鏃堕渶瑕佹墦鍑虹殑鐢佃瘽閲忥紝绠楀嚭鍒版櫄涓�8鐐逛竴鐐硅兘鎵撳嚭澶氬皯涓數璇濓紝鑾峰彇鍒版�婚噺
//濡傛灉闇�瑕佺珛鍗虫墽琛岀殑鏁版嵁閲忓ぇ浜庝竴澶╄鎵ц鐨勪笂闄愶紝鍒欏彧鍙栦笂闄愮殑鏁伴噺锛屽叾瀹冪殑鍒欐斁鍥瀝edis涓�
@@ -1584,6 +1789,7 @@
cacheList = listOps.range("cache-0", 0, count - 1);
}
}
+
log.error("浠诲姟鎷夊彇cache-0鐨勫�兼槸澶氬皯锛歿}", cacheList);
// cache-0涓虹珛鍗冲彂璧风殑,鍏跺畠鐨勫厛鎺ㄨ繜
@@ -1595,17 +1801,21 @@
} else {
for (int i = 1; i < 6; i++) {
//鍙栧嚭浠巆ache-1 鍒� cache-5鐨勭涓�涓瓙浠诲姟淇℃伅
- Long size1 = listOps.size("cache-" + i);
- if (size1 == null || size1 == 0) continue;
- int count1 = Math.min(phoneCount(), size1.intValue());
- List<String> value = listOps.range("cache-0" + i, 0, count1 - 1);
+ try {
+ Long size1 = listOps.size("cache-" + i);
+ if (size1 == null || size1 == 0) continue;
+ int count1 = Math.min(phoneCount(), size1.intValue());
+ List<String> value = listOps.range("cache-0" + i, 0, count1 - 1);
- List<PullTaskVO> pullTaskVOList2 = getPullTaskList(value, "cache-" + i);
- if (CollectionUtils.isNotEmpty(pullTaskVOList2) && pullTaskVOList2.size() > 0) {
- pullTaskVOList.addAll(pullTaskVOList2);
+ List<PullTaskVO> pullTaskVOList2 = getPullTaskList(value, "cache-" + i);
+ if (CollectionUtils.isNotEmpty(pullTaskVOList2) && pullTaskVOList2.size() > 0) {
+ pullTaskVOList.addAll(pullTaskVOList2);
+ }
+ //灏嗗鐞嗚繃鐨勬暟鎹垹闄�
+ listOps.trim("cache-0" + i, count1, -1);
+ } catch (Exception e) {
+// log.error("鐪嬬潃鐑�");
}
- //灏嗗鐞嗚繃鐨勬暟鎹垹闄�
- listOps.trim("cache-0" + i, count1, -1);
}
}
//existList鐢ㄦ潵璁板綍鎺ヤ笅鏉ラ渶瑕佹墽琛岀殑瀛愪换鍔D
@@ -1645,7 +1855,7 @@
serviceSubtask.setRemark("鎵嬫満鍙蜂负绌�");
serviceSubtask.setSendstate(4L);
serviceSubtask.setResult("error");
- serviceSubtask.setFinishtime(new Date());
+// serviceSubtask.setFinishtime(new Date());
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
continue;
}
@@ -1694,241 +1904,6 @@
}
- //涓嬮潰鐨勪唬鐮佷笉鑳藉垹闄わ紝涓婇潰鐨勬柟娉曞彧鏄厤鍚堢數璇濈鑱旇皟鐢ㄧ殑锛�
-// @Override
-// public PhoneCallBackVO phoneCallBack(PhoneCallBackVO phoneCallBackVO) {
-// log.error("phoneCallBackVO鐨勫叆鍙傦細{},{},{},{},{},{},{}", phoneCallBackVO.getResultType(), phoneCallBackVO.getUuid(), phoneCallBackVO.getErrResult(), phoneCallBackVO.getTextResult(), phoneCallBackVO.getHangUpResult(), phoneCallBackVO.getEnumState(), phoneCallBackVO.getUint8());
-// //鑾峰彇鏁版嵁
-// Boolean aBoolean = redisCache.hasKey(phoneCallBackVO.getUuid());
-// if (!aBoolean) {
-// throw new BaseException("璇uid涓嶅瓨鍦�");
-// }
-// Integer hangupValue = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "hangup");
-// if (hangupValue != null && hangupValue == 1) {
-// //hangupValue == 1 闅忚缁撴潫锛岀洿鎺ュ彲浠ユ寕鐢佃瘽
-// PhoneUtils phoneUtils = new PhoneUtils();
-// phoneUtils.hangup(phoneCallBackVO.getUuid(), null, null, null, null, null, null, null);
-//
-// }
-//
-// Map<String, Object> map = redisCache.getCacheObject(phoneCallBackVO.getUuid());
-//// ObjectMapper objectMapper = new ObjectMapper();
-//// Map<String, Object> map = null;
-//// try {
-//// map = objectMapper.readValue(cacheObject, Map.class);
-//// } catch (JsonProcessingException e) {
-//// e.printStackTrace();
-//// }
-//
-// ServiceSubtask ServiceSubtask = (ServiceSubtask) map.get("ServiceSubtask");
-// List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOs = (List<IvrLibaTemplateScriptVO>) map.get("ivrLibaTemplateScriptVO");
-// //灏唘uid鏇存柊鍒版暟鎹簱涓�
-// ServiceSubtask.setSenduuid(phoneCallBackVO.getUuid());
-// ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask);
-//
-// //鑾峰彇妯℃澘淇℃伅
-// IvrLibaTemplateVO ivrLibaTemplateVO = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "ivrLibaTemplateVO");
-//
-//
-// //棣栧厛鍒ゆ柇resultType
-// if (phoneCallBackVO.getResultType() == 1) {
-// //鍛煎彨缁撴灉鎺ュ彛: 1
-// if (phoneCallBackVO.getUint8() == 1) {
-// //鍛煎彨澶辫触锛屽幓redis涓褰曚竴涓嬪け璐ユ鏁帮紝杩涜鍐嶆鍛煎彨
-// Integer integer = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "uint8");
-// if (integer != null) {
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "uint8", integer + 1, 120, TimeUnit.MINUTES);
-// } else {
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "uint8", 1, 120, TimeUnit.MINUTES);
-// }
-//
-// if (integer != null && integer == ServiceSubtask.getRecallcount().intValue()) {
-// log.info("鏃犱汉鎺ュ惉锛歿}, {}", phoneCallBackVO.getErrResult(), phoneCallBackVO.getUuid());
-// //杩炵画鎵撹瀹氭锛屽鏋滆娌′汉鎺ワ紝閭e氨缁撴潫
-// ServiceSubtask.setResult(phoneCallBackVO.getErrResult());
-// ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask);
-// redisCache.deleteObject(phoneCallBackVO.getUuid() + "uint8");
-// } else if (integer != null && integer < ServiceSubtask.getRecallcount().intValue()) {
-// //杩涜閲嶆嫧
-// PhoneUtils phoneUtils = new PhoneUtils();
-// phoneUtils.ob(null, null, null, null, null, null, null, ServiceSubtask.getPhone(), phoneCallBackVO.getUuid(), true);
-// }
-// }
-//
-// } else if (phoneCallBackVO.getResultType() == 2) {
-// //閫氳瘽鐘舵�佹洿鏂版帴鍙�: 2
-// if (phoneCallBackVO.getEnumState() == 0) {
-// // 0-鎸搩
-// Integer integer = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "enumState");
-//
-// if (integer != null && integer < ServiceSubtask.getRecallcount().intValue()) {
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "enumState", integer + 1, 120, TimeUnit.MINUTES);
-// } else if (integer == null) {
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "enumState", 1, 120, TimeUnit.MINUTES);
-// } else if (integer != null && integer == ServiceSubtask.getRecallcount().intValue()) {
-// ServiceSubtask.setResult("鏃犱汉鎺ュ惉");
-// ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask);
-// redisCache.deleteObject(phoneCallBackVO.getUuid() + "enumState");
-// }
-// } else if (phoneCallBackVO.getEnumState() == 2) {
-// //鎮h�呮寕鏂數璇�
-// log.info("鎮h�呮寕鏂數璇濓細{}", phoneCallBackVO.getUuid());
-// ServiceSubtask.setResult(phoneCallBackVO.getHangUpResult());
-// ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask);
-// redisCache.deleteObject(phoneCallBackVO.getUuid() + "enumState");
-// }
-//
-//
-// } else if (phoneCallBackVO.getResultType() == 3) {
-// //璇煶璇嗗埆缁撴灉涓婃姤鎺ュ彛: 3
-// Integer noVoice = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "noVoice");
-// QuestionMessage returnQues = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues");
-// IvrLibaTemplateScriptVO nowQuestion = returnQues.getNowQuestion();
-// PhoneUtils phoneUtils = new PhoneUtils();
-//
-// if (StringUtils.isEmpty(phoneCallBackVO.getTextResult())) {
-// //鏃犲洖璇�
-// //鍒ゆ柇noVoice鏄惁宸茬粡鍒颁簡鏈�澶у��
-// if (noVoice == ivrLibaTemplateVO.getNoVoiceNum().intValue()) {
-// //宸茬粡闂簡瀵瑰簲鐨勯亶鏁帮紝灏卞垽鏂槸鍚﹁繕鏈変笅涓�棰�
-// if (nowQuestion.getTargetid() == ivrLibaTemplateScriptVOs.size()) {
-// //娌℃湁涓嬩竴棰樹簡锛屽氨鎸傛柇鐢佃瘽锛屾挱鏀剧粨鏉熻
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES);
-// phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid());
-// } else {
-// //鏈変笅涓�棰�
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
-// IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion);
-// // 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙�
-// phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
-// }
-// } else {
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES);
-// //璋冪敤ivrLibaTemplateScriptVO涓殑slienceText(闈欓粯璇濇湳)
-// String slienceText = nowQuestion.getSlienceText();
-// //闈欓粯璇濇湳 + 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙�
-// phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
-// return new PhoneCallBackVO();
-// }
-//
-// } else {
-// //鏈夊洖璇濓紝瀵瑰洖绛旂殑闂,杩涜姝e垯鍖归厤锛堣繖閲屽彧閽堝閫夋嫨棰橈紝鍏跺畠棰樺瀷涓嶈锛�
-// for (int j = 0; j < nowQuestion.getIvrLibaScriptTargetoptionList().size(); j++) {
-// //鍖呭惈
-// Matcher matcher = null;
-// if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex())) {
-// Pattern pattern = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex());
-// matcher = pattern.matcher(phoneCallBackVO.getTextResult());
-// }
-// //涓嶅寘鍚�
-// Matcher matcher2 = null;
-// if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2())) {
-// Pattern pattern2 = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2());
-// matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult());
-// }
-// log.info("phoneCallBack--Targetregex鐨勫�间负锛歿}, phoneCallBack--Targetregex2鐨勫�间负锛歿}", nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex(), nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2());
-// if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) {
-// //璇存槑鍖归厤姝g‘浜�
-// //杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉�
-// nowQuestion.getIvrLibaScriptTargetoptionList().get(j).setIsUserOperation(true);
-// ivrLibaScriptTargetoptionMapper.updateIvrLibaTemplateTargetoption(nowQuestion.getIvrLibaScriptTargetoptionList().get(j));
-//
-//
-// //灏嗛潤榛樼疆涓�0
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES);
-// //鑾峰彇涓嬩竴棰�
-// Integer nextQuestion = nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getNextQuestion();
-// for (IvrLibaTemplateScriptVO script : ivrLibaTemplateScriptVOs) {
-// if (script.getTargetid() == nextQuestion) {
-// QuestionMessage questionMessage = new QuestionMessage();
-// questionMessage.setNowQuestion(script);
-// questionMessage.setQuestionList(ivrLibaTemplateScriptVOs);
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
-// break;
-// }
-// }
-// break;
-// } else {
-// //娌℃湁鍖归厤鍒�
-// Integer mateNum = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "mateNum");
-// //鏃犲尮閰嶆鏁板幓鍒ゆ柇鏄惁鍒版渶澶ц闂鏁帮紝骞朵笖鎵�鏈夌殑閫夐」閮藉尮閰嶅畬浜�
-// if (mateNum == ivrLibaTemplateVO.getMateNum().intValue() && j == nowQuestion.getIvrLibaScriptTargetoptionList().size() - 1) {
-// //濡傛灉涓嬩竴棰樹负绌�.鍒欐柊鐨勬暟鎹繑鍥�,骞跺姞涓婃劅璋㈣
-// if (nowQuestion.getTargetid() < ivrLibaTemplateScriptVOs.size()) {
-// QuestionMessage questionMessage = new QuestionMessage();
-// IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion);
-// questionMessage.setQuestionList(ivrLibaTemplateScriptVOs);
-// questionMessage.setNowQuestion(nextQuestion);
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES);
-// } else {
-// //灏卞彲浠ユ寕鏂數璇濅簡
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES);
-// phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid());
-// break;
-// }
-// } else if (mateNum < ivrLibaTemplateVO.getMateNum().intValue() && j == nowQuestion.getIvrLibaScriptTargetoptionList().size() - 1) {
-// //娌℃湁闂埌瑙勫畾娆℃暟
-// mateNum = mateNum + 1;
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", mateNum, 120, TimeUnit.MINUTES);
-// }
-// }
-//
-// }
-// //閫夐」鍖归厤瀹屾垚鍚庯紝闇�瑕佸啀鍘婚�氳繃搴撳啀杩涜鍖归厤涓�娆�
-// String extemplateID = ivrLibaTemplateVO.getSubmoduleID();
-// String[] split = extemplateID.split(",");
-// List<String> list = Arrays.asList(split);
-// List<Long> list1 = new ArrayList<>();
-// if (StringUtils.isNotEmpty(extemplateID)) {
-// for (String str : list) {
-// list1.add(Long.valueOf(str));
-// }
-// List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1);
-// for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) {
-// Matcher matcher = null;
-// if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) {
-// Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex());
-// matcher = pattern.matcher(returnQues.getContent());
-// }
-//
-// Matcher matcher2 = null;
-// if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) {
-// Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2());
-// matcher2 = pattern2.matcher(returnQues.getContent());
-// }
-// log.info("++++++++++++++++++++++++++閫氱敤搴撴槸鍚︿负绌猴細selfRegex : {} , selfRegex2 : {}", ivrLibaExtemplatescript.getSelfRegex(), ivrLibaExtemplatescript.getSelfRegex2());
-// if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) {
-// QuestionMessage questionMessage = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues");
-// IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO = returnQues.getNowQuestion();
-// ivrLibaTemplateScriptVO.setSubmoduleText(ivrLibaExtemplatescript.getSwitchText());
-// ivrLibaTemplateScriptVO.setSubmoduleVoice(ivrLibaExtemplatescript.getSwitchWav());
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
-// if (ivrLibaExtemplatescript.getIsEnd() == 1) {
-// //灏嗛棶棰樼疆绌�
-// IvrLibaTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion();
-// nowQuestion1.setQuestionText(null);
-// nowQuestion1.setQuestionVoice(null);
-// questionMessage.setNowQuestion(nowQuestion1);
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
-//
-// redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES);
-// }
-//
-// //璋冪敤鈥�15銆乼ts鍚堟垚鍜屾挱鏀撅紝 tts_playback鈥濆皢缁撴灉浼犲洖
-//
-//
-// }
-// break;
-// }
-// }
-//
-// }
-// }
-// return phoneCallBackVO;
-// }
-
@Override
public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
int i = 0;
@@ -1947,7 +1922,7 @@
//闅忚
for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) {
serviceSubtaskDetail.setSubId(selectServiceSubtaskList.get(0).getId());
- serviceSubtaskDetail.setId(UUID.randomUUID().toString());
+// serviceSubtaskDetail.setId(UUID.randomUUID().toString());
serviceSubtaskDetail.setCreateTime(new Date());
serviceSubtaskDetail.setGuid(selectServiceSubtaskList.get(0).getGuid());
serviceSubtaskDetail.setOrgid(serviceSubTaskDetailReq.getOrgid());
@@ -1964,7 +1939,7 @@
ServiceSubtaskDetail ssd = new ServiceSubtaskDetail();
ssd.setSubId(serviceSubtaskDetail.getSubId());
ssd.setTaskid(serviceSubtaskDetail.getTaskid());
- ssd.setTemplatequestionnum(serviceSubtaskDetail.getTemplatequestionnum());
+ ssd.setScriptid(serviceSubtaskDetail.getScriptid());
if (serviceSubtaskDetail.getSubId() != null) {
ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(serviceSubtaskDetail.getSubId());
ssd.setGuid(serviceSubtask.getGuid());
@@ -1993,7 +1968,11 @@
Object cacheObject = redisCache.getCacheObject(phoneCallRecordVO.getTaskid() + "recordAccept-hungup");
if (phoneCallRecordVO.getHangup_cause().equals("NO_USER_RESPONSE") || ObjectUtils.isNotEmpty(cacheObject) && String.valueOf(cacheObject).equals("1")) {
//鏃犱汉鎺ュ惉
- getSmsCompensate(Long.valueOf(phoneCallRecordVO.getTaskid()));
+ //璁板綍鐢佃瘽鍙戦�佺姸鎬�
+ ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallRecordVO.getTaskid()));
+ setFailPreachForm(serviceSubtask, "3", "鏃犱汉鎺ュ惉", "4");
+ //杩涜鐭俊琛ュ伩
+// getSmsCompensate(Long.valueOf(phoneCallRecordVO.getTaskid()));
redisCache.deleteObject(phoneCallRecordVO.getTaskid() + "recordAccept-hungup");
redisCache.removeElementFromList("cache-exist", phoneCallRecordVO.getTaskid());
} else if (ObjectUtils.isNotEmpty(cacheObject) && String.valueOf(cacheObject).equals("2")) {
@@ -2011,6 +1990,7 @@
serviceSubtask.setUpdateTime(new Date());
log.error("鐢佃瘽鎷ㄦ墦宸插畬鎴恠erviceSubtask鐨勫�间负:{}", serviceSubtask);
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+ setFailPreachForm(serviceSubtask, StringUtils.isNotEmpty(serviceSubtask.getCurrentPreachform()) ? serviceSubtask.getCurrentPreachform() : "3", "鐢佃瘽鎷ㄦ墦宸插畬鎴�", "9");
//涓嬭浇鏂囦欢
ftpService.downloadFolder("/" + LocalDate.now().toString(), profile + "/upload/vadio/voice/" + LocalDate.now().toString());
redisCache.deleteObject(phoneCallRecordVO.getTaskid() + "recordAccept-hungup");
@@ -2024,12 +2004,14 @@
serviceSubtask.setSendstate(6L);
serviceSubtask.setFinishtime(new Date());
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
- int startIndex = phoneCallRecordVO.getRecord_path().indexOf("voice") + "voice".length() + 1; // 鍔�1鏄烦杩�/绗﹀彿
- int endIndex = phoneCallRecordVO.getRecord_path().lastIndexOf("/");
- String result = phoneCallRecordVO.getRecord_path().substring(startIndex, endIndex);
+// int startIndex = phoneCallRecordVO.getRecord_path().indexOf("voice") + "voice".length() + 1; // 鍔�1鏄烦杩�/绗﹀彿
+// int endIndex = phoneCallRecordVO.getRecord_path().lastIndexOf("/");
+// String result = phoneCallRecordVO.getRecord_path().substring(startIndex, endIndex);
//涓嬭浇鏂囦欢
- ftpService.downloadFolder("/" + LocalDate.now().toString(), profile + "/upload/vadio/voice/" + LocalDate.now().toString());
+// ftpService.downloadFolder("/" + LocalDate.now().toString(), profile + "/upload/vadio/voice/" + LocalDate.now().toString());
redisCache.deleteObject(phoneCallRecordVO.getTaskid() + "recordAccept-hungup");
+ ServiceSubtask ss = serviceSubtaskMapper.selectServiceSubtaskById(serviceSubtask.getId());
+ setFailPreachForm(ss, StringUtils.isNotEmpty(ss.getCurrentPreachform()) ? ss.getCurrentPreachform() : "3", "鐢佃瘽鎺ラ�氭垚鍔燂紝鎮h�呮嫆缁濋殢璁�", "5");
}
return 1;
@@ -2068,6 +2050,37 @@
}
/**
+ * 鏈嶅姟缁熻鏌ヨ - 鎸夋椂闂寸淮搴︾粺璁″嚭闄�/闂ㄨ瘖闅忚鏁版嵁
+ *
+ * @param request 缁熻璇锋眰鍙傛暟
+ * @return 缁熻缁撴灉鍒楄〃
+ */
+ @Override
+ public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest request) {
+ log.info("getServiceStatistics鐨勫叆鍙備负锛歿}", request);
+
+ // 鍙傛暟鏍¢獙
+ if (request.getStartDate() == null || request.getEndDate() == null) {
+ throw new IllegalArgumentException("寮�濮嬫棩鏈熷拰缁撴潫鏃ユ湡涓嶈兘涓虹┖");
+ }
+
+ if (request.getStartDate().after(request.getEndDate())) {
+ throw new IllegalArgumentException("寮�濮嬫棩鏈熶笉鑳芥櫄浜庣粨鏉熸棩鏈�");
+ }
+
+ // 濡傛灉timeType涓虹┖锛岄粯璁ゆ寜澶╃粺璁�
+ if (StringUtils.isEmpty(request.getTimeType())) {
+ request.setTimeType("day");
+ }
+
+ List<ServiceStatisticsResponse> result = serviceSubtaskMapper.getServiceStatistics(request);
+
+
+ log.info("getServiceStatistics杩斿洖缁撴灉鏁伴噺锛歿}", result.size());
+ return result;
+ }
+
+ /**
* 鑾峰彇闅忚缁熻姣斾緥
*
* @param serviceSubtaskCountReq
@@ -2077,12 +2090,122 @@
public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq) {
log.error("getSfStatistics鐨勫叆鍙備负锛歿}", serviceSubtaskCountReq);
List<ServiceSubtaskStatistic> serviceSubtaskStatistics = new ArrayList<>();
- Map<String, List<ServiceSubtask>> collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeavehospitaldistrictname()).orElse("Unknown")));
+// List<ServiceSubtask> rawData = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq);
+
+ // 鏍规嵁鏉′欢杩涜鍒嗙粍
+ Map<String, List<ServiceSubtask>> collect = new HashMap<>();
+
+ if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes() != null && serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() > 0) {
+ if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
+ collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown")));
+ } else {
+ collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeavehospitaldistrictname()).orElse("Unknown")));
+ }
+ } else if (serviceSubtaskCountReq.getDeptcodes() != null && serviceSubtaskCountReq.getDeptcodes().size() > 0) {
+ if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
+ collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown")));
+ } else {
+ collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDeptname()).orElse("Unknown")));
+ }
+ }
+
for (List<ServiceSubtask> serviceSubtaskList : collect.values()) {
if (CollectionUtils.isEmpty(serviceSubtaskList)) {
continue;
}
ServiceSubtaskStatistic statistic = getStatistic(serviceSubtaskList);
+
+ //鍙婃椂鐜�
+ ServiceSubtask ss = new ServiceSubtask();
+ ss.setOrgid(serviceSubtaskList.get(0).getOrgid());
+
+ // 濡傛灉鏈夊尰鐢熺紪鐮侊紝璁剧疆鍖荤敓缂栫爜鐢ㄤ簬鍙婃椂鐜囨煡璇�
+ if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
+ ss.setDrcode(serviceSubtaskList.get(0).getDrcode());
+ } else {
+ if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())) {
+ ss.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode());
+ } else if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getDeptcodes())) {
+ ss.setDeptcode(serviceSubtaskList.get(0).getDeptcode());
+ }
+ }
+
+ ss.setStarttime(serviceSubtaskCountReq.getStartTime());
+ ss.setEndtime(serviceSubtaskCountReq.getEndTime());
+ if (serviceSubtaskCountReq.getEndTime() != null && new Date().before(serviceSubtaskCountReq.getEndTime())) {
+ ss.setEndtime(new Date());
+ }
+ Double jsRate = serviceSubtaskMapper.selectTimelyRate(ss);
+ statistic.setRate(jsRate);
+
+ if (ObjectUtils.isNotEmpty(statistic)) {
+ serviceSubtaskStatistics.add(statistic);
+ }
+ }
+ return serviceSubtaskStatistics;
+ }
+
+ /**
+ * 鑾峰彇闅忚缁熻姣斾緥
+ *
+ * @param serviceSubtaskCountReq
+ * @return
+ */
+ @Override
+ public List<ServiceSubtaskStatistic> getSfStatisticsJoy(ServiceSubtaskCountReq serviceSubtaskCountReq) {
+ log.error("getSfStatistics鐨勫叆鍙備负锛歿}", serviceSubtaskCountReq);
+ List<ServiceSubtaskStatistic> serviceSubtaskStatistics = new ArrayList<>();
+
+ // 鏍规嵁鏉′欢杩涜鍒嗙粍
+ Map<String, List<ServiceSubtask>> collect = new HashMap<>();
+
+ if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes() != null && serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() > 0) {
+ if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
+ collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown")));
+
+ } else {
+ collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeavehospitaldistrictname()).orElse("Unknown")));
+ }
+ } else if (serviceSubtaskCountReq.getDeptcodes() != null && serviceSubtaskCountReq.getDeptcodes().size() > 0) {
+ if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
+ collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown")));
+ } else {
+ collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDeptname()).orElse("Unknown")));
+ }
+ }
+ List<ServiceSubtaskCount> joySubCount = serviceSubtaskMapper.getSfStatisticsJoy(serviceSubtaskCountReq);
+ for (List<ServiceSubtask> serviceSubtaskList : collect.values()) {
+ if (CollectionUtils.isEmpty(serviceSubtaskList)) {
+ continue;
+ }
+ ServiceSubtaskStatistic statistic = getStatisticJoy(serviceSubtaskList, joySubCount);
+ if (statistic.getJoyCount() != 0 && statistic.getJoyAllCount() != 0) {
+ Double joyTotal = Double.parseDouble(statistic.getJoyCount() + "") / Double.parseDouble(statistic.getJoyAllCount() + "") * 100;
+ statistic.setJoyTotal(String.format("%.2f", joyTotal) + "%");
+ }
+ //鍙婃椂鐜�
+ ServiceSubtask ss = new ServiceSubtask();
+ ss.setOrgid(serviceSubtaskList.get(0).getOrgid());
+
+ // 濡傛灉鏈夊尰鐢熺紪鐮侊紝璁剧疆鍖荤敓缂栫爜鐢ㄤ簬鍙婃椂鐜囨煡璇�
+ if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
+ ss.setDrcode(serviceSubtaskList.get(0).getDrcode());
+ } else {
+ if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())) {
+ ss.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode());
+ } else if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getDeptcodes())) {
+ ss.setDeptcode(serviceSubtaskList.get(0).getDeptcode());
+ }
+ }
+
+ ss.setStarttime(serviceSubtaskCountReq.getStartTime());
+ ss.setEndtime(serviceSubtaskCountReq.getEndTime());
+ if (serviceSubtaskCountReq.getEndTime() != null && new Date().before(serviceSubtaskCountReq.getEndTime())) {
+ ss.setEndtime(new Date());
+ }
+ Double jsRate = serviceSubtaskMapper.selectTimelyRate(ss);
+ statistic.setRate(jsRate);
+
if (ObjectUtils.isNotEmpty(statistic)) {
serviceSubtaskStatistics.add(statistic);
}
@@ -2092,50 +2215,217 @@
private ServiceSubtaskStatistic getStatistic(List<ServiceSubtask> serviceSubtaskList) {
ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic();
+ //鏍煎紡鍖栦负涓や綅灏忔暟鐨勭櫨鍒嗘瘮
+ DecimalFormat percentFormat = new DecimalFormat("##.##%");
+ serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname());
+ serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode());
serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname());
serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode());
- serviceSubtaskStatistic.setServiceCount(serviceSubtaskList.size());
+ serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode());
+ serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname());
+ //鍑洪櫌浜烘
+ serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size());
for (ServiceSubtask serviceSubtask : serviceSubtaskList) {
- //涓嶉殢璁挎暟閲�
+ //鏃犻渶闅忚浜烘
if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) {
- serviceSubtaskStatistic.setBzxCount(serviceSubtaskStatistic.getBzxCount() + 1L);
+ serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L);
}
- //搴旈殢璁挎暟閲�
+ //搴旈殢璁夸汉娆�
if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
- serviceSubtaskStatistic.setYsfCount(serviceSubtaskStatistic.getYsfCount() + 1L);
- }
- //鍙戦�佸け璐ユ暟閲�
- if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) {
- serviceSubtaskStatistic.setFssbCount(serviceSubtaskStatistic.getFssbCount() + 1L);
- }
- //寰呭彂閫佹暟閲�
- if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) {
- serviceSubtaskStatistic.setDfsCount(serviceSubtaskStatistic.getDfsCount() + 1L);
- }
- //宸插彂閫佹暟閲�
- if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 3) {
- serviceSubtaskStatistic.setYfsCount(serviceSubtaskStatistic.getYfsCount() + 1L);
- }
- //宸插畬鎴愭暟閲�
- if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 6) {
- //宸插彂閫侊紝鍖呭惈宸插畬鎴�
- serviceSubtaskStatistic.setYfsCount(serviceSubtaskStatistic.getYfsCount() + 1L);
- serviceSubtaskStatistic.setYwcCount(serviceSubtaskStatistic.getYwcCount() + 1L);
+ serviceSubtaskStatistic.setFollowUpNeeded(serviceSubtaskStatistic.getFollowUpNeeded() + 1L);
}
- if (StringUtils.isNotEmpty(serviceSubtask.getExcep()) && serviceSubtask.getExcep().equals("1")) {
- //寮傚父鏍囪瘑
- serviceSubtaskStatistic.setYczs(serviceSubtaskStatistic.getYczs() + 1L);
+ //棣栨鍑洪櫌闅忚
+ if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 1) {
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
+ serviceSubtaskStatistic.setNeedFollowUp(serviceSubtaskStatistic.getNeedFollowUp() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) {
+ serviceSubtaskStatistic.setPendingFollowUp(serviceSubtaskStatistic.getPendingFollowUp() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 6)) {
+ serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) {
+ serviceSubtaskStatistic.setFollowUpFail(serviceSubtaskStatistic.getFollowUpFail() + 1L);
+ }
+ if (serviceSubtaskStatistic.getNeedFollowUp() > 0) {
+ double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccess() + serviceSubtaskStatistic.getFollowUpFail()) / serviceSubtaskStatistic.getNeedFollowUp();
+ serviceSubtaskStatistic.setFollowUpRate(percentFormat.format(rate));
+ } else {
+ serviceSubtaskStatistic.setFollowUpRate("0.00%");
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) {
+ serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) {
+ serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) {
+ serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) {
+ serviceSubtaskStatistic.setAbnormal(serviceSubtaskStatistic.getAbnormal() + 1L);
+ }
+ }//浜屾鍑洪櫌闅忚
+ else if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) {
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
+ serviceSubtaskStatistic.setNeedFollowUpAgain(serviceSubtaskStatistic.getNeedFollowUpAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) {
+ serviceSubtaskStatistic.setPendingFollowUpAgain(serviceSubtaskStatistic.getPendingFollowUpAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 1 || serviceSubtask.getSendstate() == 3 || serviceSubtask.getSendstate() == 6)) {
+ serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) {
+ serviceSubtaskStatistic.setFollowUpFailAgain(serviceSubtaskStatistic.getFollowUpFailAgain() + 1L);
+ }
+ if (serviceSubtaskStatistic.getNeedFollowUp() > 0) {
+ double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccessAgain() + serviceSubtaskStatistic.getFollowUpFailAgain()) / serviceSubtaskStatistic.getNeedFollowUpAgain();
+ serviceSubtaskStatistic.setFollowUpRateAgain(percentFormat.format(rate));
+ } else {
+ serviceSubtaskStatistic.setFollowUpRateAgain("0.00%");
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) {
+ serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) {
+ serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) {
+ serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) {
+ serviceSubtaskStatistic.setAbnormalAgain(serviceSubtaskStatistic.getAbnormalAgain() + 1L);
+ }
+ }
+ //闅忚鎯呭喌
+ if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 1) {
+ serviceSubtaskStatistic.setTaskSituation1(serviceSubtaskStatistic.getTaskSituation1() + 1);
+ }
+ if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 2) {
+ serviceSubtaskStatistic.setTaskSituation2(serviceSubtaskStatistic.getTaskSituation2() + 1);
+ }
+ if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 3) {
+ serviceSubtaskStatistic.setTaskSituation3(serviceSubtaskStatistic.getTaskSituation3() + 1);
+ }
+ if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 4) {
+ serviceSubtaskStatistic.setTaskSituation4(serviceSubtaskStatistic.getTaskSituation4() + 1);
+ }
+ if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 5) {
+ serviceSubtaskStatistic.setTaskSituation5(serviceSubtaskStatistic.getTaskSituation5() + 1);
+ }
+ if (serviceSubtask.getTaskSituation() != null && serviceSubtask.getTaskSituation() == 6) {
+ serviceSubtaskStatistic.setTaskSituation6(serviceSubtaskStatistic.getTaskSituation6() + 1);
}
}
- //闅忚瀹屾垚鐜�=宸插畬鎴�/搴旈殢璁块噺
- if (serviceSubtaskStatistic.getYwcCount() == 0 || CollectionUtils.isEmpty(serviceSubtaskList)) {
- serviceSubtaskStatistic.setSfwcl("0");
- } else {
-// BigDecimal multiply = BigDecimal.valueOf(serviceSubtaskStatistic.getYfsCount()).divide(BigDecimal.valueOf(serviceSubtaskList.size()), 2, BigDecimal.ROUND_HALF_UP);
- BigDecimal multiply = new BigDecimal(serviceSubtaskStatistic.getYwcCount().toString()).divide(new BigDecimal(serviceSubtaskStatistic.getYsfCount().toString()), 2, BigDecimal.ROUND_HALF_UP);
- serviceSubtaskStatistic.setSfwcl(multiply.toString());
+
+
+ return serviceSubtaskStatistic;
+ }
+
+ private ServiceSubtaskStatistic getStatisticJoy(List<ServiceSubtask> serviceSubtaskList, List<ServiceSubtaskCount> joySubCount) {
+ ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic();
+ //鏍煎紡鍖栦负涓や綅灏忔暟鐨勭櫨鍒嗘瘮
+ DecimalFormat percentFormat = new DecimalFormat("##.##%");
+ serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname());
+ serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode());
+ serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname());
+ serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode());
+ serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode());
+ serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname());
+ //鍑洪櫌浜烘
+ serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size());
+ serviceSubtaskStatistic.setJoyCount(0);
+ serviceSubtaskStatistic.setJoyAllCount(0);
+ for (ServiceSubtask serviceSubtask : serviceSubtaskList) {
+ //婊℃剰搴�
+ List<ServiceSubtaskCount> joyCountTemp = joySubCount.stream().filter(r -> r.getSubTaskId().equals(serviceSubtask.getId())).collect(Collectors.toList());
+ if (joyCountTemp != null && joyCountTemp.size() > 0) {
+ if (ObjectUtils.isNotEmpty(joyCountTemp.get(0).getJoyCount()))
+ serviceSubtaskStatistic.setJoyCount(serviceSubtaskStatistic.getJoyCount() + joyCountTemp.get(0).getJoyCount());
+ if (ObjectUtils.isNotEmpty(joyCountTemp.get(0).getJoyAllCount()))
+ serviceSubtaskStatistic.setJoyAllCount(serviceSubtaskStatistic.getJoyAllCount() + joyCountTemp.get(0).getJoyAllCount());
+ }
+ //鏃犻渶闅忚浜烘
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 4) {
+ serviceSubtaskStatistic.setNonFollowUp(serviceSubtaskStatistic.getNonFollowUp() + 1L);
+ }
+ //搴旈殢璁夸汉娆�
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
+ serviceSubtaskStatistic.setFollowUpNeeded(serviceSubtaskStatistic.getFollowUpNeeded() + 1L);
+ }
+
+ //棣栨鍑洪櫌闅忚
+ if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 1) {
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
+ serviceSubtaskStatistic.setNeedFollowUp(serviceSubtaskStatistic.getNeedFollowUp() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) {
+ serviceSubtaskStatistic.setPendingFollowUp(serviceSubtaskStatistic.getPendingFollowUp() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 6)) {
+ serviceSubtaskStatistic.setFollowUpSuccess(serviceSubtaskStatistic.getFollowUpSuccess() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) {
+ serviceSubtaskStatistic.setFollowUpFail(serviceSubtaskStatistic.getFollowUpFail() + 1L);
+ }
+ if (serviceSubtaskStatistic.getNeedFollowUp() > 0) {
+ double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccess() + serviceSubtaskStatistic.getFollowUpFail()) / serviceSubtaskStatistic.getNeedFollowUp();
+ serviceSubtaskStatistic.setFollowUpRate(percentFormat.format(rate));
+ } else {
+ serviceSubtaskStatistic.setFollowUpRate("0.00%");
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) {
+ serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) {
+ serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) {
+ serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) {
+ serviceSubtaskStatistic.setAbnormal(serviceSubtaskStatistic.getAbnormal() + 1L);
+ }
+ }//浜屾鍑洪櫌闅忚
+ else if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) {
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
+ serviceSubtaskStatistic.setNeedFollowUpAgain(serviceSubtaskStatistic.getNeedFollowUpAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 2) {
+ serviceSubtaskStatistic.setPendingFollowUpAgain(serviceSubtaskStatistic.getPendingFollowUpAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && (serviceSubtask.getSendstate() == 1 || serviceSubtask.getSendstate() == 3 || serviceSubtask.getSendstate() == 6)) {
+ serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 5) {
+ serviceSubtaskStatistic.setFollowUpFailAgain(serviceSubtaskStatistic.getFollowUpFailAgain() + 1L);
+ }
+ if (serviceSubtaskStatistic.getNeedFollowUp() > 0) {
+ double rate = (double) (serviceSubtaskStatistic.getFollowUpSuccessAgain() + serviceSubtaskStatistic.getFollowUpFailAgain()) / serviceSubtaskStatistic.getNeedFollowUpAgain();
+ serviceSubtaskStatistic.setFollowUpRateAgain(percentFormat.format(rate));
+ } else {
+ serviceSubtaskStatistic.setFollowUpRateAgain("0.00%");
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) {
+ serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) {
+ serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) {
+ serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L);
+ }
+ if (serviceSubtask.getSendstate() != null && serviceSubtask.getExcep().equals("1")) {
+ serviceSubtaskStatistic.setAbnormalAgain(serviceSubtaskStatistic.getAbnormalAgain() + 1L);
+ }
+ }
+
+
}
+
return serviceSubtaskStatistic;
}
@@ -2152,6 +2442,8 @@
}
private ServiceSubtaskDetail getServiceSubtaskDetail(PhoneCallReqYQVO phoneCallReqYQVO, IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, ServiceSubtask serviceSubtask, IvrTaskTemplate ivrTaskTemplate) {
+ log.info("-----------------phoneCallReqYQVO鐨勫�间负锛歿}", phoneCallReqYQVO);
+
ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail();
serviceSubtaskDetail.setSubId(Long.valueOf(phoneCallReqYQVO.getTaskid()));
ServiceSubtask serviceSubtask1 = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallReqYQVO.getTaskid()));
@@ -2159,6 +2451,7 @@
serviceSubtaskDetail.setTaskid(serviceSubtask1.getTaskid());
serviceSubtaskDetail.setPatid(serviceSubtask1.getPatid());
}
+ serviceSubtaskDetail.setTargetid(ivrTaskTemplateScriptVO.getTargetid() != null ? ivrTaskTemplateScriptVO.getTargetid().intValue() : null);
serviceSubtaskDetail.setUuid(phoneCallReqYQVO.getUuid());
serviceSubtaskDetail.setPhone(phoneCallReqYQVO.getPhone());
serviceSubtaskDetail.setOperate(serviceSubtask.getCreateBy());
@@ -2173,12 +2466,13 @@
serviceSubtaskDetail.setEndTime(System.currentTimeMillis());
serviceSubtaskDetail.setSentEnd(1L);
serviceSubtaskDetail.setTemplateid(ivrTaskTemplate.getId().toString());
- serviceSubtaskDetail.setTemplatequestionnum(ivrTaskTemplateScriptVO.getId());
- serviceSubtaskDetail.setQuestiontext(ivrTaskTemplateScriptVO.getIvrtext());
+ serviceSubtaskDetail.setTemplatequestionnum(ivrTaskTemplateScriptVO.getScriptno());
+ serviceSubtaskDetail.setQuestiontext(StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrtext()) ? ivrTaskTemplateScriptVO.getIvrtext() : ivrTaskTemplateScriptVO.getScriptContent());
serviceSubtaskDetail.setQuestionvoice(phoneCallReqYQVO.getRecordpath());
serviceSubtaskDetail.setCategoryname(ivrTaskTemplateScriptVO.getScriptType());
serviceSubtaskDetail.setTargetoptions(ivrTaskTemplateScriptVO.getTargetOptions());
serviceSubtaskDetail.setExtemplateText(ivrTaskTemplateScriptVO.getExtemplateText());
+ serviceSubtaskDetail.setScriptid(ivrTaskTemplateScriptVO.getId());
int i = 1;
for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) {
@@ -2196,6 +2490,11 @@
return serviceSubtaskDetail;
}
+ /**
+ * 鐢佃瘽鐨勮ˉ鍋挎柟娉曪紙鑰侊級
+ *
+ * @param subTaskId
+ */
private void getSmsCompensate(Long subTaskId) {
ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(subTaskId);
RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
@@ -2226,6 +2525,34 @@
serviceSubtask.setSendstate(3L);
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+ //闇�瑕佸湪servicePreachform閲岃褰曚竴涓嬬煭淇$姸鎬�
+ ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform();
+ serviceSubtaskPreachform.setPreachform("4");
+ serviceSubtaskPreachform.setSubid(subTaskId);
+ serviceSubtaskPreachform.setTaskid(serviceSubtask.getTaskid());
+ serviceSubtaskPreachform.setOrgid(serviceSubtask.getOrgid());
+ List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform);
+ if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) {
+ ServiceSubtaskPreachform serviceSubtaskPreachform1 = serviceSubtaskPreachforms.get(0);
+ serviceSubtaskPreachform1.setSendstate("9");
+ serviceSubtaskPreachformMapper.updateServiceSubtaskPreachform(serviceSubtaskPreachform1);
+ } else if (CollectionUtils.isEmpty(serviceSubtaskPreachforms)) {
+ //濡傛灉涓虹┖鐨勮瘽锛岃鏄庣敤鎴锋病鏈夐�夌煭淇″彂閫佹柟寮忥紝杩欎釜鏃跺�欓渶瑕佸己鍒舵柊澧炰竴鏉�
+ //鑾峰彇sort鐨勬渶澶у��
+ ServiceSubtaskPreachform ssp = new ServiceSubtaskPreachform();
+ ssp.setSubid(subTaskId);
+ ssp.setTaskid(serviceSubtask.getTaskid());
+ ssp.setOrgid(serviceSubtask.getOrgid());
+ List<ServiceSubtaskPreachform> sspf2 = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(ssp);
+
+ serviceSubtaskPreachform.setSort(0L);
+ if (CollectionUtils.isNotEmpty(sspf2)) {
+ serviceSubtaskPreachform.setSort(Long.valueOf(sspf2.size()));
+ }
+ serviceSubtaskPreachform.setSendstate("2");
+ serviceSubtaskPreachformMapper.insertServiceSubtaskPreachform(serviceSubtaskPreachform);
+ }
+
}
//閫氳繃褰撳墠鏃堕棿锛屾媺鍙栫數璇濇�绘暟
@@ -2248,4 +2575,74 @@
int remainingCalls = (int) (remainingHours * phoneUpEveryHour);
return remainingCalls;
}
+
+ public List<ServiceSubtaskCount> getSfStatisticsJoydetails(ServiceSubtaskCountReq serviceSubtaskCountReq) {
+ return serviceSubtaskMapper.getSfStatisticsJoydetails(serviceSubtaskCountReq);
+ }
+
+
+ /**
+ * @param serviceSubtask
+ * @param preachform
+ * @param remark
+ * @param failSendstate
+ * @return
+ */
+ public Boolean setFailPreachForm(ServiceSubtask serviceSubtask, String preachform, String remark, String failSendstate) {
+ //灏嗙姸鎬佽缃负澶辫触
+ ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform();
+ serviceSubtaskPreachform.setSubid(serviceSubtask.getId());
+ serviceSubtaskPreachform.setTaskid(serviceSubtask.getTaskid());
+ serviceSubtaskPreachform.setOrgid(serviceSubtask.getOrgid());
+ //鑾峰彇璇ユ偅鑰呯殑鍙戦�佹柟寮忔�绘暟
+ List<ServiceSubtaskPreachform> spSize = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform);
+
+ serviceSubtaskPreachform.setPreachform(preachform);
+ //1:鏈彂閫佺姸鎬�
+ serviceSubtaskPreachform.setSendstate("1");
+ if (preachform.equals("3")) {
+ //鐢佃瘽杩涘叆闃熷垪鍚庯紝鐘舵�佷細鍙樻垚2
+ serviceSubtaskPreachform.setSendstate("2");
+ }
+ List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform);
+ if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) {
+ ServiceSubtaskPreachform serviceSubtaskPreachform1 = serviceSubtaskPreachforms.get(0);
+ serviceSubtaskPreachform1.setSendstate(failSendstate);
+ serviceSubtaskPreachform1.setRemark(remark);
+ serviceSubtaskPreachformMapper.updateServiceSubtaskPreachform(serviceSubtaskPreachform1);
+
+ //濡傛灉褰撳墠鐨刾reachform宸茬粡鏄渶鍚庝竴涓簡锛岄偅鐩存帴灏唖erviceSubtask鐨剆endstate鐘舵�佹敼鎴�5灏辫浜�(鍏ㄥけ璐ヤ簡)
+ if (serviceSubtaskPreachform1.getSort() == spSize.size() && failSendstate.equals("4")) {
+ serviceSubtask.setCurrentPreachform(preachform);
+ serviceSubtask.setSendstate(5L);
+ serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+ return true;
+ }
+ }
+
+ serviceSubtask.setCurrentPreachform(preachform);
+ serviceSubtask.setSendstate(3L);
+ //濡傛灉绛変簬9锛屽垯璇存槑鐢佃瘽姝e父缁撴潫浜�
+ if (failSendstate.equals("9")) serviceSubtask.setSendstate(6L);
+ serviceSubtask.setVisitTime(getNextVisitTime(serviceSubtask.getId(), serviceSubtask.getTaskid(), serviceSubtask.getVisitTime()));
+ serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
+ return true;
+ }
+
+ private Date getNextVisitTime(Long subid, Long taskid, Date visitTime) {
+ ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform();
+ serviceSubtaskPreachform.setSubid(subid);
+ serviceSubtaskPreachform.setTaskid(taskid);
+ List<ServiceSubtaskPreachform> serviceSubtaskPreachforms = serviceSubtaskPreachformMapper.selectServiceSubtaskPreachformList(serviceSubtaskPreachform);
+ if (CollectionUtils.isNotEmpty(serviceSubtaskPreachforms)) {
+ String compensateTime = serviceSubtaskPreachforms.get(0).getCompensateTime();
+ int hoursToAdd = Integer.valueOf(compensateTime) * 24;
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(visitTime);
+ calendar.add(Calendar.HOUR_OF_DAY, hoursToAdd);
+ Date newDate = calendar.getTime();
+ return newDate;
+ }
+ return visitTime;
+ }
}
--
Gitblit v1.9.3