Compare commits
No commits in common. "7ee22a55da9daaf4974c8e86e2daee70991b0565" and "67788c9ffede6e3a89632f15d7e82b724f273bca" have entirely different histories.
7ee22a55da
...
67788c9ffe
|
|
@ -1,7 +1,6 @@
|
||||||
package com.whdc.component;
|
package com.whdc.component;
|
||||||
|
|
||||||
import com.whdc.mapper.AutoCallConfigMapper;
|
import com.whdc.mapper.AutoCallConfigMapper;
|
||||||
import com.whdc.mapper.AutoCallPersonMapper;
|
|
||||||
import com.whdc.model.entity.AutoCallPerson;
|
import com.whdc.model.entity.AutoCallPerson;
|
||||||
import com.whdc.service.AutoCallTaskService2;
|
import com.whdc.service.AutoCallTaskService2;
|
||||||
import com.whdc.utils.AutoCallHelper;
|
import com.whdc.utils.AutoCallHelper;
|
||||||
|
|
@ -15,6 +14,7 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -30,8 +30,6 @@ public class AutoCallTaskScheduled {
|
||||||
@Autowired
|
@Autowired
|
||||||
private AutoCallTaskService2 autoCallTaskService;
|
private AutoCallTaskService2 autoCallTaskService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AutoCallPersonMapper personMapper;
|
|
||||||
@Autowired
|
|
||||||
private AutoCallConfigMapper configMapper;
|
private AutoCallConfigMapper configMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AutoCallHelper autoCallHelper;
|
private AutoCallHelper autoCallHelper;
|
||||||
|
|
@ -73,7 +71,15 @@ public class AutoCallTaskScheduled {
|
||||||
autoCallTaskService.cancelPerson(person);
|
autoCallTaskService.cancelPerson(person);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int pendingDuration = 60 * 1000 * 2;
|
// else if (person.getUploadedTimes() == 1) {
|
||||||
|
// autoCallTaskService.resetPerson(person);
|
||||||
|
// autoCallTaskService.step3UploadAICCTask(person);
|
||||||
|
// } else {
|
||||||
|
// autoCallTaskService.cancelPerson(person);
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
int pendingDuration = 60 * 1000 * 3;
|
||||||
int loopGap = 1000;
|
int loopGap = 1000;
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
while (pendingDuration > 0) {
|
while (pendingDuration > 0) {
|
||||||
|
|
@ -90,10 +96,7 @@ public class AutoCallTaskScheduled {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
person.setUploadedTimes(personMapper.selectById(person.getId()).getUploadedTimes());
|
autoCallTaskService.markPersonDetailQueryTimeout(person);
|
||||||
if (person.getUploadedTimes() == 2) {
|
|
||||||
autoCallTaskService.markPersonDetailQueryTimeout(person);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.whdc.mapper.WarningResponderMapper;
|
import com.whdc.mapper.WarningResponderMapper;
|
||||||
import com.whdc.model.dto.AutoCallDto;
|
import com.whdc.model.dto.AutoCallDto;
|
||||||
import com.whdc.model.dto.CallPutDto;
|
import com.whdc.model.dto.CallPutDto;
|
||||||
import com.whdc.model.dto.FindPageDto;
|
|
||||||
import com.whdc.model.entity.AutoCallPerson;
|
import com.whdc.model.entity.AutoCallPerson;
|
||||||
import com.whdc.model.entity.AutoCallTask;
|
import com.whdc.model.entity.AutoCallTask;
|
||||||
import com.whdc.model.entity.WarnCallMap;
|
import com.whdc.model.entity.WarnCallMap;
|
||||||
|
|
@ -178,72 +177,24 @@ public class AutoCallController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getPdf")
|
@Autowired
|
||||||
//{"etm":"2025-08-07","stm":"2025-07-31","page":{"pageNumber":1,"pageSize":20}}
|
private WarningResponderMapper wrm;
|
||||||
public void getPdf(@RequestParam("stm")String stm, @RequestParam("etm")String etm, HttpServletResponse response,
|
@Autowired
|
||||||
HttpServletRequest request) {
|
private SmsHelper smsHelper;
|
||||||
AutoCallDto dto = new AutoCallDto();
|
@GetMapping("/temp")
|
||||||
dto.setStm(stm);
|
public ResultJson temp() {
|
||||||
dto.setEtm(etm);
|
String content = "领导您好!省防汛抗旱指挥部办公室将于8月7日启用预警叫应智能外呼系统。收到橙色以上气象预警后,系统将自动根据预警级别叫应相关责任人,来电显示“省防办值班室”,电话接通后,系统将播报AI预警信息并询问“如您已知晓上述信息,请按#号键”。请领导在收到预警叫应后,收听完整预警信息并根据语音提示按“#”号键进行确认。若未完成操作,系统将在1分钟内重拨,两次失败后将呼叫上一级责任人。特此报告。\n" +
|
||||||
dto.setPage(new FindPageDto());
|
"\n" +
|
||||||
Page<AutoCallTask> autoCallTaskPage = autoCallApiService.pageForPdf(dto);
|
"湖北省防汛抗旱指挥部办公室\n" +
|
||||||
List<AutoCallTask> records = autoCallTaskPage.getRecords();
|
"2025年8月6日";
|
||||||
ByteArrayInputStream pdfStream = autoCallApiService.exportPDF(records, response, dto.getStm(), dto.getEtm());
|
List<WarningResponder> wrs = wrm.selectList(new QueryWrapper<WarningResponder>()
|
||||||
// 3. 设置响应头
|
.ge("level", 0));
|
||||||
try {
|
List<String> ret = new ArrayList<>();
|
||||||
// 设置响应头
|
wrs.forEach(wr -> {
|
||||||
response.setContentType("application/pdf");
|
wr.decryptPhone();
|
||||||
String fileName = "智能呼叫记录_" + dto.getStm().toString().replace(":", "-") + "_to_"
|
String s = smsHelper.send(Collections.singletonList(wr.getPhone()), content);
|
||||||
+ dto.getEtm().toString().replace(":", "-") + ".pdf";
|
ret.add(wr.getPhone() + "-" + s);
|
||||||
|
});
|
||||||
// 获取User-Agent判断浏览器类型
|
return ResultJson.ok(wrs);
|
||||||
String userAgent = request.getHeader("User-Agent");
|
|
||||||
|
|
||||||
// 针对不同浏览器设置不同的Content-Disposition
|
|
||||||
if (userAgent != null && userAgent.toLowerCase().contains("firefox")) {
|
|
||||||
// Firefox浏览器
|
|
||||||
response.setHeader("Content-Disposition",
|
|
||||||
"attachment; filename*=UTF-8''" + URLEncoder.encode(fileName, "UTF-8"));
|
|
||||||
} else {
|
|
||||||
// 其他浏览器(Chrome, Edge, Safari等)
|
|
||||||
response.setHeader("Content-Disposition",
|
|
||||||
"attachment; filename=\"" + new String(fileName.getBytes("GBK"), "ISO-8859-1") + "\"");
|
|
||||||
}
|
|
||||||
IOUtils.copy(pdfStream,response.getOutputStream());
|
|
||||||
response.flushBuffer();
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/newPerson")
|
|
||||||
public ResultJson newPerson(@RequestParam("taskId")Integer taskId) {
|
|
||||||
AutoCallTask task = autoCallTaskService2.getTaskMapper().selectById(taskId);
|
|
||||||
return ResultJson.ok(autoCallTaskService2.newPerson(task));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/getUploadedPerson")
|
|
||||||
public ResultJson getUploadedPerson() {
|
|
||||||
return ResultJson.ok(autoCallTaskService2.step2GetOneUnUploadedPerson());
|
|
||||||
}
|
|
||||||
// @Autowired
|
|
||||||
// private WarningResponderMapper wrm;
|
|
||||||
// @Autowired
|
|
||||||
// private SmsHelper smsHelper;
|
|
||||||
// @GetMapping("/temp")
|
|
||||||
// public ResultJson temp() {
|
|
||||||
// String content = "领导您好!省防汛抗旱指挥部办公室将于8月7日启用预警叫应智能外呼系统。收到橙色以上气象预警后,系统将自动根据预警级别叫应相关责任人,来电显示“省防办值班室”,电话接通后,系统将播报AI预警信息并询问“如您已知晓上述信息,请按#号键”。请领导在收到预警叫应后,收听完整预警信息并根据语音提示按“#”号键进行确认。若未完成操作,系统将在1分钟内重拨,两次失败后将呼叫上一级责任人。特此报告。\n" +
|
|
||||||
// "\n" +
|
|
||||||
// "湖北省防汛抗旱指挥部办公室\n" +
|
|
||||||
// "2025年8月6日";
|
|
||||||
// List<WarningResponder> wrs = wrm.selectList(new QueryWrapper<WarningResponder>()
|
|
||||||
// .ge("level", 0));
|
|
||||||
// List<String> ret = new ArrayList<>();
|
|
||||||
// wrs.forEach(wr -> {
|
|
||||||
// wr.decryptPhone();
|
|
||||||
// String s = smsHelper.send(Collections.singletonList(wr.getPhone()), content);
|
|
||||||
// ret.add(wr.getPhone() + "-" + s);
|
|
||||||
// });
|
|
||||||
// return ResultJson.ok(wrs);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ public interface AutoCallPersonMapper extends BaseMapper<AutoCallPerson> {
|
||||||
long failCnt = selectCount(
|
long failCnt = selectCount(
|
||||||
new QueryWrapper<AutoCallPerson>()
|
new QueryWrapper<AutoCallPerson>()
|
||||||
.eq("task_id", taskId)
|
.eq("task_id", taskId)
|
||||||
.eq("uploaded_times", 2)
|
|
||||||
.in("status", AutoCallPerson.STATUS_CALLED, AutoCallPerson.STATUS_CANCELLED,AutoCallPerson.STATUS_PUT)
|
.in("status", AutoCallPerson.STATUS_CALLED, AutoCallPerson.STATUS_CANCELLED,AutoCallPerson.STATUS_PUT)
|
||||||
//__tag == null or __tag != "已知晓"
|
//__tag == null or __tag != "已知晓"
|
||||||
.and(wrapper -> wrapper.isNull("__tag").or().ne("__tag", "已知晓"))
|
.and(wrapper -> wrapper.isNull("__tag").or().ne("__tag", "已知晓"))
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,6 @@ public class AutoCallPerson {
|
||||||
private Integer manualClose; //default 0
|
private Integer manualClose; //default 0
|
||||||
@TableField(value = "position")
|
@TableField(value = "position")
|
||||||
private String position;
|
private String position;
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
|
||||||
@TableField(value = "manual_close_tm")
|
|
||||||
private Date manualCloseTm;
|
|
||||||
|
|
||||||
@TableField(value = "__request_id")
|
@TableField(value = "__request_id")
|
||||||
private String uploadRequestId; //任务名,同时作为参数的taskName,用custId
|
private String uploadRequestId; //任务名,同时作为参数的taskName,用custId
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ public class WarningResponder extends Model<WarningResponder> implements Seriali
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
WarningResponder a = new WarningResponder();
|
WarningResponder a = new WarningResponder();
|
||||||
a.setPhone("18872619396");
|
a.setPhone("13933930962");
|
||||||
a.encryptPhone();
|
a.encryptPhone();
|
||||||
System.out.println(a.salt);
|
System.out.println(a.salt);
|
||||||
System.out.println(a.phone);
|
System.out.println(a.phone);
|
||||||
|
|
|
||||||
|
|
@ -380,14 +380,14 @@ public class AutoCallApiService {
|
||||||
// 定义表格列宽(适配横向A4,新增字段列)
|
// 定义表格列宽(适配横向A4,新增字段列)
|
||||||
float[] columnWidths = {
|
float[] columnWidths = {
|
||||||
30, // 序号
|
30, // 序号
|
||||||
150+28+28, // 预警名称
|
150, // 预警名称
|
||||||
100, // 县(市、区)
|
100, // 县(市、区)
|
||||||
// 120, // 智能呼叫时间
|
120, // 智能呼叫时间
|
||||||
160+28+28+28, // 呼叫对象及职务
|
160, // 呼叫对象及职务
|
||||||
130, // 叫应情况
|
130, // 状态
|
||||||
// 80, // 通话时长(秒)
|
80, // 通话时长(秒)
|
||||||
130+28, // 智能呼叫时间
|
130, // 拨打时间
|
||||||
130+28 // 人工处置时间
|
130 // 结束时间
|
||||||
};
|
};
|
||||||
Table table = new Table(columnWidths);
|
Table table = new Table(columnWidths);
|
||||||
table.setKeepTogether(true);
|
table.setKeepTogether(true);
|
||||||
|
|
@ -402,25 +402,16 @@ public class AutoCallApiService {
|
||||||
|
|
||||||
// 更新表头(添加新字段)
|
// 更新表头(添加新字段)
|
||||||
private void addTableHeader(Table table) {
|
private void addTableHeader(Table table) {
|
||||||
// String[] headers = {
|
|
||||||
// "序号",
|
|
||||||
// "预警名称",
|
|
||||||
// "县(市、区)",
|
|
||||||
// "智能呼叫时间",
|
|
||||||
// "呼叫对象及职务",
|
|
||||||
// "状态",
|
|
||||||
// "通话时长",
|
|
||||||
// "拨打时间",
|
|
||||||
// "结束时间"
|
|
||||||
// };
|
|
||||||
String[] headers = {
|
String[] headers = {
|
||||||
"序号",
|
"序号",
|
||||||
"预警名称",
|
"预警名称",
|
||||||
"县(市、区)",
|
"县(市、区)",
|
||||||
"呼叫对象及职务",
|
|
||||||
"叫应情况",
|
|
||||||
"智能呼叫时间",
|
"智能呼叫时间",
|
||||||
"人工处置时间"
|
"呼叫对象及职务",
|
||||||
|
"状态",
|
||||||
|
"通话时长",
|
||||||
|
"拨打时间",
|
||||||
|
"结束时间"
|
||||||
};
|
};
|
||||||
for (String header : headers) {
|
for (String header : headers) {
|
||||||
table.addHeaderCell(new Cell()
|
table.addHeaderCell(new Cell()
|
||||||
|
|
@ -442,66 +433,44 @@ private void addTableHeader(Table table) {
|
||||||
String name = item.getUploadCustName() != null ? item.getUploadCustName() : "未知对象";
|
String name = item.getUploadCustName() != null ? item.getUploadCustName() : "未知对象";
|
||||||
String position = item.getPosition() != null ? item.getPosition() : "无职务";
|
String position = item.getPosition() != null ? item.getPosition() : "无职务";
|
||||||
callInfo.append(name).append("(").append(position).append(")\n");
|
callInfo.append(name).append("(").append(position).append(")\n");
|
||||||
// if (item.getStatus() == AutoCallPerson.STATUS_MANUAL_CLOSE) {
|
|
||||||
// callInfo.append("(人工处置)");
|
|
||||||
// }
|
|
||||||
// callInfo.append("\n");
|
|
||||||
}
|
}
|
||||||
//处理通话时长
|
//处理通话时长
|
||||||
// StringBuilder callTime = new StringBuilder();
|
StringBuilder callTime = new StringBuilder();
|
||||||
// for (AutoCallPerson item : record.getCallList()) {
|
for (AutoCallPerson item : record.getCallList()) {
|
||||||
// String time = item.getDetailTalkTimes() != null? item.getDetailTalkTimes() + "秒" : "未知";
|
String time = item.getDetailTalkTimes() != null? item.getDetailTalkTimes() + "秒" : "未知";
|
||||||
// callTime.append(time).append("\n");
|
callTime.append(time).append("\n");
|
||||||
// }
|
}
|
||||||
//叫应情况
|
//处理状态
|
||||||
StringBuilder status = new StringBuilder();
|
StringBuilder status = new StringBuilder();
|
||||||
for (AutoCallPerson item : record.getCallList()) {
|
for (AutoCallPerson item : record.getCallList()) {
|
||||||
// String s = item.getDetailRemark() != null? item.getDetailRemark() : "未知";
|
String s = item.getDetailRemark() != null? item.getDetailRemark() : "未知";
|
||||||
// status.append(s).append("\n");
|
status.append(s).append("\n");
|
||||||
if (item.getStatus() == AutoCallPerson.STATUS_MANUAL_CLOSE) {
|
|
||||||
status.append("人工处置");
|
|
||||||
} else {
|
|
||||||
status.append("智能叫应");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//人工处置时间
|
//处理拨打时间
|
||||||
StringBuilder startTime = new StringBuilder();
|
StringBuilder startTime = new StringBuilder();
|
||||||
for (AutoCallPerson item : record.getCallList()) {
|
for (AutoCallPerson item : record.getCallList()) {
|
||||||
String s = formatTime(item.getDetailStartedAt());
|
String s = formatTime(item.getDetailStartedAt());
|
||||||
startTime.append(s).append("\n");
|
startTime.append(s).append("\n");
|
||||||
}
|
}
|
||||||
//处理结束拨打时间
|
//处理结束拨打时间
|
||||||
// StringBuilder endTime = new StringBuilder();
|
StringBuilder endTime = new StringBuilder();
|
||||||
// for (AutoCallPerson item : record.getCallList()) {
|
|
||||||
// String s = formatTime(item.getDetailDisconnectedAt());
|
|
||||||
// endTime.append(s).append("\n");
|
|
||||||
// }
|
|
||||||
//人工处置时间
|
|
||||||
StringBuilder manualCloseTime = new StringBuilder();
|
|
||||||
for (AutoCallPerson item : record.getCallList()) {
|
for (AutoCallPerson item : record.getCallList()) {
|
||||||
String s = formatTime(item.getManualCloseTm());
|
String s = formatTime(item.getDetailDisconnectedAt());
|
||||||
manualCloseTime.append(s).append("\n");
|
endTime.append(s).append("\n");
|
||||||
}
|
}
|
||||||
// 格式化时间
|
// 格式化时间
|
||||||
// String formattedCreateTime = formatTime(record.getCreateTm());
|
String formattedCreateTime = formatTime(record.getCreateTm());
|
||||||
|
|
||||||
// 添加行数据
|
// 添加行数据
|
||||||
//序号
|
|
||||||
table.addCell(new Cell().add(new Paragraph(String.valueOf(serialNumber++)).setFontSize(10)).setKeepTogether(true));
|
table.addCell(new Cell().add(new Paragraph(String.valueOf(serialNumber++)).setFontSize(10)).setKeepTogether(true));
|
||||||
//预警名称
|
|
||||||
table.addCell(new Cell().add(new Paragraph(record.getWarnName() != null ? record.getWarnName() : "").setFontSize(10)).setKeepTogether(true));
|
table.addCell(new Cell().add(new Paragraph(record.getWarnName() != null ? record.getWarnName() : "").setFontSize(10)).setKeepTogether(true));
|
||||||
//县(市、区)
|
|
||||||
table.addCell(new Cell().add(new Paragraph(region).setFontSize(10)).setKeepTogether(true));
|
table.addCell(new Cell().add(new Paragraph(region).setFontSize(10)).setKeepTogether(true));
|
||||||
// table.addCell(new Cell().add(new Paragraph(formattedCreateTime).setFontSize(10)).setKeepTogether(true));
|
table.addCell(new Cell().add(new Paragraph(formattedCreateTime).setFontSize(10)).setKeepTogether(true));
|
||||||
//呼叫对象及职务
|
|
||||||
table.addCell(new Cell().add(new Paragraph(callInfo.toString()).setFontSize(10)).setKeepTogether(true));
|
table.addCell(new Cell().add(new Paragraph(callInfo.toString()).setFontSize(10)).setKeepTogether(true));
|
||||||
//叫应情况
|
|
||||||
table.addCell(new Cell().add(new Paragraph(status.toString()).setFontSize(10)).setKeepTogether(true));
|
table.addCell(new Cell().add(new Paragraph(status.toString()).setFontSize(10)).setKeepTogether(true));
|
||||||
// table.addCell(new Cell().add(new Paragraph(callTime.toString()).setFontSize(10)).setKeepTogether(true));
|
table.addCell(new Cell().add(new Paragraph(callTime.toString()).setFontSize(10)).setKeepTogether(true));
|
||||||
//智能呼叫时间
|
|
||||||
table.addCell(new Cell().add(new Paragraph(startTime.toString()).setFontSize(10)).setKeepTogether(true));
|
table.addCell(new Cell().add(new Paragraph(startTime.toString()).setFontSize(10)).setKeepTogether(true));
|
||||||
//人工处置时间
|
table.addCell(new Cell().add(new Paragraph(endTime.toString()).setFontSize(10)).setKeepTogether(true));
|
||||||
table.addCell(new Cell().add(new Paragraph(manualCloseTime.toString()).setFontSize(10)).setKeepTogether(true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import com.whdc.model.entity.autocall.AICCCallRespWrapper;
|
||||||
import com.whdc.model.entity.autocall.AICCUploadTask;
|
import com.whdc.model.entity.autocall.AICCUploadTask;
|
||||||
import com.whdc.utils.AICCHelper;
|
import com.whdc.utils.AICCHelper;
|
||||||
import com.whdc.utils.SmsHelper;
|
import com.whdc.utils.SmsHelper;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -37,7 +36,6 @@ import java.util.stream.Collectors;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AutoCallTaskService2 {
|
public class AutoCallTaskService2 {
|
||||||
@Autowired
|
@Autowired
|
||||||
@Getter
|
|
||||||
private AutoCallTaskMapper taskMapper;
|
private AutoCallTaskMapper taskMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AutoCallPersonMapper personMapper;
|
private AutoCallPersonMapper personMapper;
|
||||||
|
|
@ -57,11 +55,15 @@ public class AutoCallTaskService2 {
|
||||||
public void generateFakeCall() {
|
public void generateFakeCall() {
|
||||||
QXWarning warn = qxWarningMapper.selectOne(
|
QXWarning warn = qxWarningMapper.selectOne(
|
||||||
new QueryWrapper<QXWarning>()
|
new QueryWrapper<QXWarning>()
|
||||||
|
// .like("CNNM", "洪湖")
|
||||||
.orderByDesc("WARNID")
|
.orderByDesc("WARNID")
|
||||||
.last("limit 1")
|
.last("limit 1")
|
||||||
);
|
);
|
||||||
|
// warn.setCtnm("恩施州");
|
||||||
|
// warn.setCnnm("咸丰 ");
|
||||||
warn.setCtnm("荆州市");
|
warn.setCtnm("荆州市");
|
||||||
warn.setCnnm("洪湖 ");
|
warn.setCnnm("洪湖 ");
|
||||||
|
|
||||||
List<AutoCallTask> taskList = newTask(warn);
|
List<AutoCallTask> taskList = newTask(warn);
|
||||||
AutoCallTask task = taskList.get(0);
|
AutoCallTask task = taskList.get(0);
|
||||||
task.setStatus(0);
|
task.setStatus(0);
|
||||||
|
|
@ -69,36 +71,6 @@ public class AutoCallTaskService2 {
|
||||||
task.setWarnCnnm("洪湖 ");
|
task.setWarnCnnm("洪湖 ");
|
||||||
taskMapper.insert(task);
|
taskMapper.insert(task);
|
||||||
generatePerson(task);
|
generatePerson(task);
|
||||||
|
|
||||||
warn = qxWarningMapper.selectOne(
|
|
||||||
new QueryWrapper<QXWarning>()
|
|
||||||
.orderByDesc("WARNID")
|
|
||||||
.last("limit 1")
|
|
||||||
);
|
|
||||||
warn.setCtnm("荆州市");
|
|
||||||
warn.setCnnm("秭归 ");
|
|
||||||
taskList = newTask(warn);
|
|
||||||
task = taskList.get(0);
|
|
||||||
task.setStatus(0);
|
|
||||||
task.setCreateTm(new Date());
|
|
||||||
task.setWarnCnnm("秭归 ");
|
|
||||||
taskMapper.insert(task);
|
|
||||||
generatePerson(task);
|
|
||||||
|
|
||||||
warn = qxWarningMapper.selectOne(
|
|
||||||
new QueryWrapper<QXWarning>()
|
|
||||||
.orderByDesc("WARNID")
|
|
||||||
.last("limit 1")
|
|
||||||
);
|
|
||||||
warn.setCtnm("荆州市");
|
|
||||||
warn.setCnnm("竹溪 ");
|
|
||||||
taskList = newTask(warn);
|
|
||||||
task = taskList.get(0);
|
|
||||||
task.setStatus(0);
|
|
||||||
task.setCreateTm(new Date());
|
|
||||||
task.setWarnCnnm("竹溪 ");
|
|
||||||
taskMapper.insert(task);
|
|
||||||
generatePerson(task);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AutoCallPerson> doCallTest() {
|
public List<AutoCallPerson> doCallTest() {
|
||||||
|
|
@ -289,7 +261,7 @@ public class AutoCallTaskService2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AutoCallPerson> newPerson(AutoCallTask task) {
|
private List<AutoCallPerson> newPerson(AutoCallTask task) {
|
||||||
String cnnm = task.getWarnCnnm();
|
String cnnm = task.getWarnCnnm();
|
||||||
long millis = task.getCreateTm().getTime();
|
long millis = task.getCreateTm().getTime();
|
||||||
List<Integer> warnLevels = mapWarnSignalLevel(task.getWarnLevel());
|
List<Integer> warnLevels = mapWarnSignalLevel(task.getWarnLevel());
|
||||||
|
|
@ -396,13 +368,11 @@ public class AutoCallTaskService2 {
|
||||||
} catch (GeneralSecurityException | UnsupportedEncodingException e) {
|
} catch (GeneralSecurityException | UnsupportedEncodingException e) {
|
||||||
person.setStatus(AutoCallPerson.STATUS_CANCELLED);
|
person.setStatus(AutoCallPerson.STATUS_CANCELLED);
|
||||||
person.setErrorCode(AutoCallPerson.ERRCODE_ENCODE);
|
person.setErrorCode(AutoCallPerson.ERRCODE_ENCODE);
|
||||||
person.setDetailRemark("平台异常");
|
|
||||||
personMapper.updateById(person);
|
personMapper.updateById(person);
|
||||||
log.error("外呼任务编码异常", e);
|
log.error("外呼任务编码异常", e);
|
||||||
}
|
}
|
||||||
if (AICCCallRespWrapper == null) {
|
if (AICCCallRespWrapper == null) {
|
||||||
person.setStatus(AutoCallPerson.STATUS_CANCELLED);
|
person.setStatus(AutoCallPerson.STATUS_CANCELLED);
|
||||||
person.setDetailRemark("提交外呼失败");
|
|
||||||
person.setErrorCode(AutoCallPerson.ERRCODE_UPLOAD_FAIL);
|
person.setErrorCode(AutoCallPerson.ERRCODE_UPLOAD_FAIL);
|
||||||
personMapper.updateById(person);
|
personMapper.updateById(person);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -452,21 +422,17 @@ public class AutoCallTaskService2 {
|
||||||
person.setTag(tag);
|
person.setTag(tag);
|
||||||
}
|
}
|
||||||
//再判断状态
|
//再判断状态
|
||||||
// if ("接通".equals(dialRemark)) {
|
if ("接通".equals(dialRemark)) {
|
||||||
// person.setStatus(AutoCallPerson.STATUS_PUT);
|
person.setStatus(AutoCallPerson.STATUS_PUT);
|
||||||
// } else {
|
} else {
|
||||||
if (person.getUploadedTimes() < 2) {
|
if (person.getUploadedTimes() < 2) {
|
||||||
person.setStatus(AutoCallPerson.STATUS_CALLED);
|
person.setStatus(AutoCallPerson.STATUS_CALLED);
|
||||||
} else {
|
} else {
|
||||||
person.setStatus(AutoCallPerson.STATUS_CANCELLED);
|
person.setStatus(AutoCallPerson.STATUS_CANCELLED);
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
personMapper.updateById(person);
|
personMapper.updateById(person);
|
||||||
if ("已知晓".equals(tag)) {
|
if ("已知晓".equals(tag)) {
|
||||||
if ("接通".equals(dialRemark)) {
|
|
||||||
person.setStatus(AutoCallPerson.STATUS_PUT);
|
|
||||||
personMapper.updateById(person);
|
|
||||||
}
|
|
||||||
markRemnantPersonStatus(taskId);
|
markRemnantPersonStatus(taskId);
|
||||||
taskMapper.setTag(taskId, tag);
|
taskMapper.setTag(taskId, tag);
|
||||||
taskMapper.setStatus(taskId, AutoCallTask.STATUS_ANY_SUCCESS);
|
taskMapper.setStatus(taskId, AutoCallTask.STATUS_ANY_SUCCESS);
|
||||||
|
|
@ -525,8 +491,6 @@ public class AutoCallTaskService2 {
|
||||||
|
|
||||||
person.setStatus(AutoCallPerson.STATUS_MANUAL_CLOSE);
|
person.setStatus(AutoCallPerson.STATUS_MANUAL_CLOSE);
|
||||||
person.setTag("已知晓");
|
person.setTag("已知晓");
|
||||||
person.setManualClose(1);
|
|
||||||
person.setManualCloseTm(new Date());
|
|
||||||
personMapper.updateById(person);
|
personMapper.updateById(person);
|
||||||
task.setTag("已知晓");
|
task.setTag("已知晓");
|
||||||
task.setStatus(AutoCallTask.STATUS_MANUAL_CLOSE);
|
task.setStatus(AutoCallTask.STATUS_MANUAL_CLOSE);
|
||||||
|
|
@ -615,13 +579,8 @@ public class AutoCallTaskService2 {
|
||||||
|
|
||||||
|
|
||||||
public void cancelPerson(AutoCallPerson person) {
|
public void cancelPerson(AutoCallPerson person) {
|
||||||
Integer taskId = person.getTaskId();
|
|
||||||
person.setStatus(AutoCallPerson.STATUS_CANCELLED);
|
person.setStatus(AutoCallPerson.STATUS_CANCELLED);
|
||||||
personMapper.updateById(person);
|
personMapper.updateById(person);
|
||||||
boolean allFail = personMapper.isAllFail(taskId);
|
|
||||||
if (allFail) {
|
|
||||||
taskMapper.setStatus(taskId, AutoCallTask.STATUS_ALL_FAIL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void markRemnantPersonStatus(Integer taskId) {
|
private void markRemnantPersonStatus(Integer taskId) {
|
||||||
|
|
@ -635,16 +594,16 @@ public class AutoCallTaskService2 {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// private boolean markTaskStatus(Integer taskId) {
|
private boolean markTaskStatus(Integer taskId) {
|
||||||
// boolean anySuccess = personMapper.isAnySuccess(taskId);
|
boolean anySuccess = personMapper.isAnySuccess(taskId);
|
||||||
// if (anySuccess) {
|
if (anySuccess) {
|
||||||
// taskMapper.setStatus(taskId, AutoCallTask.STATUS_ANY_SUCCESS);
|
taskMapper.setStatus(taskId, AutoCallTask.STATUS_ANY_SUCCESS);
|
||||||
// return true;
|
return true;
|
||||||
// }
|
}
|
||||||
// boolean allFail = personMapper.isAllFail(taskId);
|
boolean allFail = personMapper.isAllFail(taskId);
|
||||||
// if (allFail) {
|
if (allFail) {
|
||||||
// taskMapper.setStatus(taskId, AutoCallTask.STATUS_ALL_FAIL);
|
taskMapper.setStatus(taskId, AutoCallTask.STATUS_ALL_FAIL);
|
||||||
// }
|
}
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,6 @@ public class AICCHelper {
|
||||||
log.error("apiUploadCallData first time: {}", resp);
|
log.error("apiUploadCallData first time: {}", resp);
|
||||||
log.error("error: ", ex);
|
log.error("error: ", ex);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.info("apiUploadCallData first time: {}", resp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AICCCallRespWrapper == null || !AICCCallRespWrapper.isSuccess()) {
|
if (AICCCallRespWrapper == null || !AICCCallRespWrapper.isSuccess()) {
|
||||||
|
|
@ -139,8 +137,6 @@ public class AICCHelper {
|
||||||
log.error("apiUploadCallData second time: {}", resp);
|
log.error("apiUploadCallData second time: {}", resp);
|
||||||
log.error("error: ", ex);
|
log.error("error: ", ex);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.info("apiUploadCallData second time: {}", resp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -173,7 +169,6 @@ public class AICCHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AICCCallRespWrapper == null || !AICCCallRespWrapper.isSuccess()) {
|
if (AICCCallRespWrapper == null || !AICCCallRespWrapper.isSuccess()) {
|
||||||
log.info("获取任务详情失败:{}", resp);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return AICCCallRespWrapper;
|
return AICCCallRespWrapper;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue