导入取消手机位数校验,外呼加入校验
This commit is contained in:
parent
d82eff7f29
commit
540b4f89a3
@ -1,7 +1,6 @@
|
|||||||
package com.xinelu.manage.service.patientinfo.impl;
|
package com.xinelu.manage.service.patientinfo.impl;
|
||||||
|
|
||||||
import com.xinelu.common.annotation.DataScope;
|
import com.xinelu.common.annotation.DataScope;
|
||||||
import com.xinelu.common.constant.HttpStatus;
|
|
||||||
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
|
import com.xinelu.common.constant.SignRecordServiceStatusConstants;
|
||||||
import com.xinelu.common.constant.VisitMethodConstants;
|
import com.xinelu.common.constant.VisitMethodConstants;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
@ -44,7 +43,6 @@ import com.xinelu.system.mapper.SysUserMapper;
|
|||||||
import com.xinelu.system.service.ISysConfigService;
|
import com.xinelu.system.service.ISysConfigService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -370,19 +368,19 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
if (CollectionUtils.isEmpty(list) || list.size() == 0) {
|
if (CollectionUtils.isEmpty(list) || list.size() == 0) {
|
||||||
return AjaxResult.error("导入数据列表不能为空!");
|
return AjaxResult.error("导入数据列表不能为空!");
|
||||||
}
|
}
|
||||||
//如果存在 患者姓名或手机号或科室或就诊日期为空的情况,直接返回;
|
//如果存在 患者姓名或手机号或科室或就诊日期为空的情况,直接返回;(暂时去除时间判断)
|
||||||
List<PatientInfoImport> collect = list.stream().filter(Objects::nonNull).filter(item -> StringUtils.isEmpty(item.getPatientName()) || StringUtils.isEmpty(item.getPatientPhone()) || StringUtils.isEmpty(item.getDeptAlias()) || Objects.isNull(item.getVisitDate())).collect(Collectors.toList());
|
List<PatientInfoImport> collect = list.stream().filter(Objects::nonNull).filter(item -> StringUtils.isEmpty(item.getPatientName()) || StringUtils.isEmpty(item.getDeptAlias()) || Objects.isNull(item.getVisitDate())).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(collect)) {
|
if (CollectionUtils.isNotEmpty(collect)) {
|
||||||
return AjaxResult.error("用户信息不完整,科室名称、就诊时间、姓名、联系电话均不允许为空,请完善后重试;");
|
return AjaxResult.error("用户信息不完整,科室名称、就诊时间、姓名均不允许为空,请完善后重试;");
|
||||||
}
|
}
|
||||||
//存在手机号格式不正确的情况,直接返回
|
//存在手机号格式不正确的情况,直接返回
|
||||||
List<PatientInfoImport> regexPhoneList = list.stream().filter(item -> StringUtils.isNotBlank(item.getPatientPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPatientPhone()))).collect(Collectors.toList());
|
// List<PatientInfoImport> regexPhoneList = list.stream().filter(item -> StringUtils.isNotBlank(item.getPatientPhone())).filter(item -> BooleanUtils.isFalse(regexUtil.regexPhone(item.getPatientPhone()))).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(regexPhoneList)) {
|
// if (CollectionUtils.isNotEmpty(regexPhoneList)) {
|
||||||
return AjaxResult.error(HttpStatus.ERROR_TWO, "部分手机号格式不正确,请修改后重试;", regexPhoneList);
|
// return AjaxResult.error(HttpStatus.ERROR_TWO, "部分手机号格式不正确,请修改后重试;", regexPhoneList);
|
||||||
}
|
// }
|
||||||
//导入重复过滤,列表内患者信息自去重;
|
//导入重复过滤,列表内患者信息自去重;
|
||||||
List<PatientInfoImport> distinctCollect = list.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
List<PatientInfoImport> distinctCollect = list.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||||
//与数据库重复
|
//与数据库重复(当天数据)
|
||||||
List<PatientInfo> patientInfos_CurrentDay = new ArrayList<>();
|
List<PatientInfo> patientInfos_CurrentDay = new ArrayList<>();
|
||||||
List<ResidentInfo> residentInfos = residentInfoMapper.selectResidentInfoByPhoneList(list);
|
List<ResidentInfo> residentInfos = residentInfoMapper.selectResidentInfoByPhoneList(list);
|
||||||
//如果要求自动去重(同数据库中 当日已导入患者列表 比对,如果患者姓名和手机号相同,视为重复)
|
//如果要求自动去重(同数据库中 当日已导入患者列表 比对,如果患者姓名和手机号相同,视为重复)
|
||||||
@ -425,8 +423,8 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// 如果当日已有导入,则不再重复导入
|
// 如果当日已有导入,则不再重复导入(导入数据存在手机号为空)
|
||||||
if (CollectionUtils.isNotEmpty(patientInfos_CurrentDay) && (Objects.isNull(isDistinct) || isDistinct == 1)) {
|
if (CollectionUtils.isNotEmpty(patientInfos_CurrentDay) && (Objects.isNull(isDistinct) || isDistinct == 1) && org.apache.commons.lang3.StringUtils.isNotBlank(patientInfoImport.getPatientPhone())) {
|
||||||
List<PatientInfo> collect1 = patientInfos_CurrentDay.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientName().equals(item.getPatientName()) && patientInfoImport.getPatientPhone().equals(item.getPatientPhone())).collect(Collectors.toList());
|
List<PatientInfo> collect1 = patientInfos_CurrentDay.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientName().equals(item.getPatientName()) && patientInfoImport.getPatientPhone().equals(item.getPatientPhone())).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) {
|
if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) {
|
||||||
continue;
|
continue;
|
||||||
@ -446,7 +444,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
patientInfoImport.setDepartmentId(equalsDepartment.getId());
|
patientInfoImport.setDepartmentId(equalsDepartment.getId());
|
||||||
patientInfoImport.setDepartmentName(equalsDepartment.getDepartmentName());
|
patientInfoImport.setDepartmentName(equalsDepartment.getDepartmentName());
|
||||||
//同一手机号每月可最多拔打xx次
|
//同一手机号每月可最多拔打xx次
|
||||||
if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount)) {
|
if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount) && org.apache.commons.lang3.StringUtils.isNotBlank(patientInfoImport.getPatientPhone())) {
|
||||||
List<PatientInfo> collect1 = patientInfoList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientPhone().equals(item.getPatientPhone()) && patientInfoImport.getDepartmentId().equals(item.getDepartmentId()) && item.getCountPhone() >= Long.parseLong(aiobMaxCount)).collect(Collectors.toList());
|
List<PatientInfo> collect1 = patientInfoList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientPhone().equals(item.getPatientPhone()) && patientInfoImport.getDepartmentId().equals(item.getDepartmentId()) && item.getCountPhone() >= Long.parseLong(aiobMaxCount)).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) {
|
if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) {
|
||||||
continue;
|
continue;
|
||||||
@ -464,7 +462,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
patientInfoImport.setDepartmentId(containsDepartment.getId());
|
patientInfoImport.setDepartmentId(containsDepartment.getId());
|
||||||
patientInfoImport.setDepartmentName(containsDepartment.getDepartmentName());
|
patientInfoImport.setDepartmentName(containsDepartment.getDepartmentName());
|
||||||
//同一手机号每月可最多拔打xx次
|
//同一手机号每月可最多拔打xx次
|
||||||
if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount)) {
|
if (CollectionUtils.isNotEmpty(patientInfoList) && StringUtils.isNotBlank(aiobMaxCount) && org.apache.commons.lang3.StringUtils.isNotBlank(patientInfoImport.getPatientPhone())) {
|
||||||
List<PatientInfo> collect1 = patientInfoList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientPhone().equals(item.getPatientPhone()) && patientInfoImport.getDepartmentId().equals(item.getDepartmentId()) && item.getCountPhone() >= Long.parseLong(aiobMaxCount)).collect(Collectors.toList());
|
List<PatientInfo> collect1 = patientInfoList.stream().filter(Objects::nonNull).filter(item -> patientInfoImport.getPatientPhone().equals(item.getPatientPhone()) && patientInfoImport.getDepartmentId().equals(item.getDepartmentId()) && item.getCountPhone() >= Long.parseLong(aiobMaxCount)).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) {
|
if (CollectionUtils.isNotEmpty(collect1) || collect1.size() != 0) {
|
||||||
continue;
|
continue;
|
||||||
@ -520,11 +518,12 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
if (CollectionUtils.isNotEmpty(deptAliasVOS)) {
|
if (CollectionUtils.isNotEmpty(deptAliasVOS)) {
|
||||||
return AjaxResult.error("科室名称不存在", patientInfoImportVO);
|
return AjaxResult.error("科室名称不存在", patientInfoImportVO);
|
||||||
}
|
}
|
||||||
//region 新增居民表
|
//region 新增居民表
|
||||||
patientInfoImportList.forEach(item ->
|
patientInfoImportList.forEach(item ->
|
||||||
{
|
{
|
||||||
//设置导入记录ID
|
//设置导入记录ID
|
||||||
item.setPatientInfoImportId(item.getId());
|
item.setPatientInfoImportId(item.getId());
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(item.getPatientPhone())) {
|
||||||
//居民信息去重
|
//居民信息去重
|
||||||
if (residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(item.getPatientName())
|
if (residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(item.getPatientName())
|
||||||
&& residentInfo.getPatientPhone().equals(item.getPatientPhone())).collect(Collectors.toSet()).size() == 0) {
|
&& residentInfo.getPatientPhone().equals(item.getPatientPhone())).collect(Collectors.toSet()).size() == 0) {
|
||||||
@ -536,23 +535,26 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
item.setResidentId(residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(item.getPatientName())
|
item.setResidentId(residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(item.getPatientName())
|
||||||
&& residentInfo.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new ResidentInfo()).getId());
|
&& residentInfo.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new ResidentInfo()).getId());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
patientInfoImportList_forResident.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (patientInfoImportList_forResident.size() > 0) {
|
||||||
|
int residentCount = residentInfoMapper.insertResidentInfoList(patientInfoImportList_forResident);
|
||||||
|
if (residentCount <= 0) {
|
||||||
|
log.info("居民表新增失败!");
|
||||||
|
return AjaxResult.error("居民信息新增失败;");
|
||||||
|
}
|
||||||
|
patientInfoImportList_forResident.forEach(item ->
|
||||||
|
{
|
||||||
|
patientInfoImportList.stream().filter(item2 -> item2.getPatientName().equals(item.getPatientName())
|
||||||
|
&& (item2.getPatientPhone() == null ? ' ' : item2.getPatientPhone()).equals((item.getPatientPhone() == null ? ' ' : item.getPatientPhone()))).findFirst().orElse(new PatientInfoImport())
|
||||||
|
.setResidentId(item.getId());
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (patientInfoImportList_forResident.size() > 0) {
|
}
|
||||||
int residentCount = residentInfoMapper.insertResidentInfoList(patientInfoImportList_forResident);
|
//endregion
|
||||||
if (residentCount <= 0) {
|
|
||||||
log.info("居民表新增失败!");
|
|
||||||
return AjaxResult.error("居民信息新增失败;");
|
|
||||||
}
|
|
||||||
patientInfoImportList_forResident.forEach(item ->
|
|
||||||
{
|
|
||||||
patientInfoImportList.stream().filter(item2 -> item2.getPatientName().equals(item.getPatientName())
|
|
||||||
&& item2.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new PatientInfoImport())
|
|
||||||
.setResidentId(item.getId());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
//endregion
|
|
||||||
|
|
||||||
//设置为门诊患者
|
//设置为门诊患者
|
||||||
patientInfoImportList.forEach(item ->
|
patientInfoImportList.forEach(item ->
|
||||||
@ -653,12 +655,16 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
patientInfoImport.setDepartmentName(equalsDepartment.getDepartmentName());
|
patientInfoImport.setDepartmentName(equalsDepartment.getDepartmentName());
|
||||||
//居民信息去重
|
//居民信息去重
|
||||||
patientInfoImport.setPatientInfoImportId(patientInfoImport.getId());
|
patientInfoImport.setPatientInfoImportId(patientInfoImport.getId());
|
||||||
List<ResidentInfo> collect = residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(patientInfoImport.getPatientName()) && residentInfo.getPatientPhone().equals(patientInfoImport.getPatientPhone())).collect(Collectors.toList());
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(patientInfoImport.getPatientPhone())) {
|
||||||
if (CollectionUtils.isEmpty(collect) || collect.size() == 0) {
|
List<ResidentInfo> collect = residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(patientInfoImport.getPatientName()) && residentInfo.getPatientPhone().equals(patientInfoImport.getPatientPhone())).collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isEmpty(collect) || collect.size() == 0) {
|
||||||
|
insertResidentInfo.add(patientInfoImport);
|
||||||
|
} else { //如果已存在 设置居民ID
|
||||||
|
patientInfoImport.setResidentId(residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(patientInfoImport.getPatientName())
|
||||||
|
&& residentInfo.getPatientPhone().equals(patientInfoImport.getPatientPhone())).findFirst().orElse(new ResidentInfo()).getId());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
insertResidentInfo.add(patientInfoImport);
|
insertResidentInfo.add(patientInfoImport);
|
||||||
} else { //如果已存在 设置居民ID
|
|
||||||
patientInfoImport.setResidentId(residentInfos.stream().filter(residentInfo -> residentInfo.getPatientName().equals(patientInfoImport.getPatientName())
|
|
||||||
&& residentInfo.getPatientPhone().equals(patientInfoImport.getPatientPhone())).findFirst().orElse(new ResidentInfo()).getId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -690,13 +696,14 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//新增居民表
|
//新增居民表
|
||||||
if (CollectionUtils.isNotEmpty(insertResidentInfo) || insertResidentInfo.size() != 0){
|
if (CollectionUtils.isNotEmpty(insertResidentInfo) || insertResidentInfo.size() != 0) {
|
||||||
int residentCount = residentInfoMapper.insertResidentInfoList(insertResidentInfo);
|
int residentCount = residentInfoMapper.insertResidentInfoList(insertResidentInfo);
|
||||||
if (residentCount <= 0) {
|
if (residentCount <= 0) {
|
||||||
return AjaxResult.error("已完成数据导入!导入成功0条记录;失败" + patientInfoImportVO.getCount() + "条记录。");
|
return AjaxResult.error("已完成数据导入!导入成功0条记录;失败" + patientInfoImportVO.getCount() + "条记录。");
|
||||||
}
|
}
|
||||||
insertResidentInfo.forEach(item -> { patientInfoImports.stream().filter(patientInfoImport -> patientInfoImport.getPatientName().equals(item.getPatientName())
|
insertResidentInfo.forEach(item -> {
|
||||||
&& patientInfoImport.getPatientPhone().equals(item.getPatientPhone())).findFirst().orElse(new PatientInfoImport()).setResidentId(item.getId());
|
patientInfoImports.stream().filter(patientInfoImport -> patientInfoImport.getPatientName().equals(item.getPatientName())
|
||||||
|
&& (patientInfoImport.getPatientPhone() == null ? ' ' : patientInfoImport.getPatientPhone()).equals((item.getPatientPhone() == null ? ' ' : item.getPatientPhone()))).findFirst().orElse(new PatientInfoImport()).setResidentId(item.getId());
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|||||||
import com.xinelu.common.constant.AiobTaskTypeContant;
|
import com.xinelu.common.constant.AiobTaskTypeContant;
|
||||||
import com.xinelu.common.enums.*;
|
import com.xinelu.common.enums.*;
|
||||||
import com.xinelu.common.utils.StringUtils;
|
import com.xinelu.common.utils.StringUtils;
|
||||||
|
import com.xinelu.common.utils.regex.RegexUtil;
|
||||||
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
||||||
import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord;
|
import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord;
|
||||||
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
|
||||||
@ -74,6 +75,8 @@ public class UploadRobotPublishTask {
|
|||||||
private PatientInfoMapper patientInfoMapper;
|
private PatientInfoMapper patientInfoMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private LabelFieldContentMapper labelFieldContentMapper;
|
private LabelFieldContentMapper labelFieldContentMapper;
|
||||||
|
@Resource
|
||||||
|
private RegexUtil regexUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 创建百度智能外呼任务并导入客户名单
|
* @description 创建百度智能外呼任务并导入客户名单
|
||||||
@ -183,10 +186,7 @@ public class UploadRobotPublishTask {
|
|||||||
scriptInfoTaskInfo.setAiobTaskType(AiobTaskTypeContant.BATCHTASK);
|
scriptInfoTaskInfo.setAiobTaskType(AiobTaskTypeContant.BATCHTASK);
|
||||||
//进入拔打记录表(用于后续重拨处理等判断)----有时间再优化为批量插入
|
//进入拔打记录表(用于后续重拨处理等判断)----有时间再优化为批量插入
|
||||||
scriptInfoTaskInfoMapper.insertScriptInfoTaskInfo(scriptInfoTaskInfo);
|
scriptInfoTaskInfoMapper.insertScriptInfoTaskInfo(scriptInfoTaskInfo);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//3、开始组装本任务下的客户变量
|
//3、开始组装本任务下的客户变量
|
||||||
// 客户名单list
|
// 客户名单list
|
||||||
List<CustomerInfoDto> customerInfoList = new ArrayList<>();
|
List<CustomerInfoDto> customerInfoList = new ArrayList<>();
|
||||||
@ -196,21 +196,25 @@ public class UploadRobotPublishTask {
|
|||||||
customerInfoDto.setExtJson(node.getId() + "");
|
customerInfoDto.setExtJson(node.getId() + "");
|
||||||
SignPatientManageRoute signPatientManageRoute = signPatientManageRouteMapper.selectSignPatientManageRouteById(node.getManageRouteId());
|
SignPatientManageRoute signPatientManageRoute = signPatientManageRouteMapper.selectSignPatientManageRouteById(node.getManageRouteId());
|
||||||
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(signPatientManageRoute.getPatientId());
|
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(signPatientManageRoute.getPatientId());
|
||||||
customerInfoDto.setMobile(patientInfo.getPatientPhone());
|
//校验手机号
|
||||||
// 查询患者画像信息
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(patientInfo.getPatientPhone())) {
|
||||||
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(patientInfo.getId());
|
if (regexUtil.regexPhone(patientInfo.getPatientPhone())) {
|
||||||
// 处理变量
|
customerInfoDto.setMobile(patientInfo.getPatientPhone());
|
||||||
JSONObject jsonObject = new JSONObject();
|
// 查询患者画像信息
|
||||||
if (StringUtils.isNotBlank(scriptInfo.getVariables())) {
|
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(patientInfo.getId());
|
||||||
List<String> variables = Arrays.asList(scriptInfo.getVariables().split("\\|"));
|
// 处理变量
|
||||||
variables.forEach(variable -> {
|
JSONObject jsonObject = new JSONObject();
|
||||||
LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), variable.replaceAll("_", "").toUpperCase())).findFirst().orElse(null);
|
if (StringUtils.isNotBlank(scriptInfo.getVariables())) {
|
||||||
jsonObject.fluentPut(variable, ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue());
|
List<String> variables = Arrays.asList(scriptInfo.getVariables().split("\\|"));
|
||||||
});
|
variables.forEach(variable -> {
|
||||||
|
LabelFieldInfoContentVo labelFieldContent = labelFieldContentList.stream().filter(s -> Objects.equals(s.getFieldCode(), variable.replaceAll("_", "").toUpperCase())).findFirst().orElse(null);
|
||||||
|
jsonObject.fluentPut(variable, ObjectUtils.isEmpty(labelFieldContent) ? "" : labelFieldContent.getFieldValue());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
customerInfoDto.setVar(jsonObject);
|
||||||
|
customerInfoList.add(customerInfoDto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
customerInfoDto.setVar(jsonObject);
|
|
||||||
customerInfoList.add(customerInfoDto);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
// 上传名单
|
// 上传名单
|
||||||
log.info("任务导入客户名单......");
|
log.info("任务导入客户名单......");
|
||||||
@ -235,16 +239,12 @@ public class UploadRobotPublishTask {
|
|||||||
if (importTaskVo.getStatus()) {
|
if (importTaskVo.getStatus()) {
|
||||||
signPatientManageRouteNode.setTaskIdExt(finalTaskId);
|
signPatientManageRouteNode.setTaskIdExt(finalTaskId);
|
||||||
signPatientManageRouteNode.setId(Long.valueOf(importTaskVo.getExtJson()));
|
signPatientManageRouteNode.setId(Long.valueOf(importTaskVo.getExtJson()));
|
||||||
|
|
||||||
signPatientManageRouteNodeMapper.updateSignPatientManageRouteNode(signPatientManageRouteNode);
|
signPatientManageRouteNodeMapper.updateSignPatientManageRouteNode(signPatientManageRouteNode);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
// 根据机器人id查询智能外呼系统的任务id
|
// 根据机器人id查询智能外呼系统的任务id
|
||||||
log.info("百度智能外呼创建任务定时任务执行完成......");
|
log.info("百度智能外呼创建任务定时任务执行完成......");
|
||||||
@ -315,7 +315,7 @@ public class UploadRobotPublishTask {
|
|||||||
SignPatientManageRoute signPatientManageRoute = signPatientManageRouteMapper.selectSignPatientManageRouteById(node.getManageRouteId());
|
SignPatientManageRoute signPatientManageRoute = signPatientManageRouteMapper.selectSignPatientManageRouteById(node.getManageRouteId());
|
||||||
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(signPatientManageRoute.getPatientId());
|
PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(signPatientManageRoute.getPatientId());
|
||||||
// 没有任务则创建任务
|
// 没有任务则创建任务
|
||||||
if (ObjectUtils.isNotEmpty(scriptInfo)) {
|
if (ObjectUtils.isNotEmpty(scriptInfo) && org.apache.commons.lang3.StringUtils.isNotBlank(patientInfo.getPatientPhone()) && regexUtil.regexPhone(patientInfo.getPatientPhone())) {
|
||||||
log.info("创建任务......");
|
log.info("创建任务......");
|
||||||
ActualTimeTaskDto actualTimeTaskDto = new ActualTimeTaskDto();
|
ActualTimeTaskDto actualTimeTaskDto = new ActualTimeTaskDto();
|
||||||
actualTimeTaskDto.setRobotId(scriptInfo.getRobotPublishId());
|
actualTimeTaskDto.setRobotId(scriptInfo.getRobotPublishId());
|
||||||
@ -345,9 +345,6 @@ public class UploadRobotPublishTask {
|
|||||||
signPatientManageRouteNode_DialStatus.setId(node.getId());
|
signPatientManageRouteNode_DialStatus.setId(node.getId());
|
||||||
signPatientManageRouteNode_DialStatus.setDialStatus(DialStatusEnum.DIALED.getInfo());
|
signPatientManageRouteNode_DialStatus.setDialStatus(DialStatusEnum.DIALED.getInfo());
|
||||||
signPatientManageRouteNodeMapper.updateDialStatusByNodeId(signPatientManageRouteNode_DialStatus);
|
signPatientManageRouteNodeMapper.updateDialStatusByNodeId(signPatientManageRouteNode_DialStatus);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user