新增预警的批量关闭、新增查询接口(查出所有未拨通电话的报警信息)
parent
98e069ac7e
commit
93aa8cd577
|
|
@ -6,6 +6,7 @@ import com.itextpdf.io.font.PdfEncodings;
|
|||
import com.itextpdf.kernel.font.PdfFont;
|
||||
import com.itextpdf.kernel.font.PdfFontFactory;
|
||||
import com.whdc.model.dto.AutoCallDto;
|
||||
import com.whdc.model.dto.CallPutDto;
|
||||
import com.whdc.model.entity.AutoCallPerson;
|
||||
import com.whdc.model.entity.AutoCallTask;
|
||||
import com.whdc.model.entity.WarnCallMap;
|
||||
|
|
@ -72,6 +73,24 @@ public class AutoCallController {
|
|||
return ResultJson.ok(autoCallApiService.page(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有未接通的数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listCallIsNotPass")
|
||||
public ResultJson<List<AutoCallTask>> listCallIsNotPass() {
|
||||
return ResultJson.ok(autoCallApiService.listCallIsNotPass());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询所有未接通的数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listCallIsNotPassPage")
|
||||
public ResultJson<Page<AutoCallTask>> listCallIsNotPassPage(@RequestBody AutoCallDto dto) {
|
||||
return ResultJson.ok(autoCallApiService.listCallIsNotPassPage(dto));
|
||||
}
|
||||
|
||||
@PostMapping("/page2")
|
||||
public ResultJson<Page<AutoCallTask>> page2(@RequestBody AutoCallDto dto) {
|
||||
return ResultJson.ok(autoCallApiService.page2(dto));
|
||||
|
|
@ -93,12 +112,28 @@ public class AutoCallController {
|
|||
return ResultJson.ok(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID关闭预警
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/setCallIsPut")
|
||||
public ResultJson<Boolean> setCallIsPut(@RequestParam("taskId") Integer taskId) {
|
||||
autoCallTaskService.setCallIsPut(taskId);
|
||||
return ResultJson.ok(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预警的批量关闭
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/setCallIsPutList")
|
||||
public ResultJson<Boolean> setCallIsPutList(@RequestBody CallPutDto dto) {
|
||||
autoCallTaskService.setCallIsPutList(dto);
|
||||
return ResultJson.ok(true);
|
||||
}
|
||||
|
||||
@PostMapping("/exportPdf")
|
||||
public void exportPDF(@RequestBody AutoCallDto dto,
|
||||
HttpServletResponse response,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.whdc.model.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CallPutDto {
|
||||
List<String> taskIds;
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ public class WarnCallMap {
|
|||
@TableField(value = "cust_name")
|
||||
private String custName; //联系人
|
||||
@TableField(value = "call_is_put")
|
||||
private Integer callIsPut; //0:接通,1:已接通, default 0
|
||||
private Integer callIsPut; //0:未接通,1:已接通, default 0
|
||||
@TableField(value = "called")
|
||||
private Integer called; //0:未拨打,1:已拨打, default 0
|
||||
@TableField(value = "err_step")
|
||||
|
|
|
|||
|
|
@ -19,12 +19,14 @@ import com.itextpdf.layout.properties.TextAlignment;
|
|||
import com.itextpdf.layout.properties.UnitValue;
|
||||
import com.whdc.mapper.*;
|
||||
import com.whdc.model.dto.AutoCallDto;
|
||||
import com.whdc.model.dto.FindPageDto;
|
||||
import com.whdc.model.entity.AutoCall;
|
||||
import com.whdc.model.entity.AutoCallPerson;
|
||||
import com.whdc.model.entity.AutoCallTask;
|
||||
import com.whdc.model.entity.WarnCallMap;
|
||||
import com.whdc.utils.DateUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -406,4 +408,48 @@ private void addTableHeader(Table table) {
|
|||
// 无法识别的类型直接返回字符串
|
||||
return timeObj.toString();
|
||||
}
|
||||
|
||||
public List<AutoCallTask> listCallIsNotPass() {
|
||||
QueryWrapper<AutoCallTask> query = new QueryWrapper<AutoCallTask>()
|
||||
.orderByDesc("id");
|
||||
query.in("status",
|
||||
AutoCallTask.STATUS_ALL_FAIL,
|
||||
AutoCallTask.STATUS_SHOULD_GENERATE,
|
||||
AutoCallTask.STATUS_CANCELLED,
|
||||
AutoCallTask.STATUS_GENERATED
|
||||
);
|
||||
List<AutoCallTask> autoCallTasks = taskMapper.selectList(query);
|
||||
for (AutoCallTask task : autoCallTasks) {
|
||||
Integer taskId = task.getId();
|
||||
List<AutoCallPerson> autoCallPeople = personMapper.selectList(
|
||||
new QueryWrapper<AutoCallPerson>().eq("task_id",taskId)
|
||||
);
|
||||
task.setCallList(autoCallPeople);
|
||||
}
|
||||
return autoCallTasks;
|
||||
}
|
||||
|
||||
public Page<AutoCallTask> listCallIsNotPassPage(AutoCallDto dto) {
|
||||
QueryWrapper<AutoCallTask> query = new QueryWrapper<AutoCallTask>()
|
||||
.orderByDesc("id");
|
||||
query.in("status",
|
||||
AutoCallTask.STATUS_ALL_FAIL,
|
||||
AutoCallTask.STATUS_SHOULD_GENERATE,
|
||||
AutoCallTask.STATUS_CANCELLED,
|
||||
AutoCallTask.STATUS_GENERATED
|
||||
);
|
||||
Page pageParam = dto.getPage().getPage();
|
||||
Page<AutoCallTask> page = taskMapper.selectPage(pageParam, query);
|
||||
List<AutoCallTask> records = page.getRecords();
|
||||
if(records.size() > 0){
|
||||
for (AutoCallTask task : records) {
|
||||
Integer taskId = task.getId();
|
||||
List<AutoCallPerson> autoCallPeople = personMapper.selectList(
|
||||
new QueryWrapper<AutoCallPerson>().eq("task_id",taskId)
|
||||
);
|
||||
task.setCallList(autoCallPeople);
|
||||
}
|
||||
}
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.whdc.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.whdc.mapper.*;
|
||||
import com.whdc.model.dto.CallPutDto;
|
||||
import com.whdc.model.entity.*;
|
||||
import com.whdc.model.entity.autocall.AICCCallRespDetail;
|
||||
import com.whdc.model.entity.autocall.AICCCallRespWrapper;
|
||||
|
|
@ -491,4 +493,16 @@ public class AutoCallTaskService {
|
|||
private List<WarningResponder> listWarningResponderByCnnmAndLevelOrderByLevelAsc(String cnnm, List<Integer> levels) {
|
||||
return warningResponderMapper.listByCnnmAndLevelOrderByLevelAsc(cnnm, levels);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void setCallIsPutList(CallPutDto dto) {
|
||||
LambdaQueryWrapper<WarnCallMap> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(WarnCallMap::getId,dto.getTaskIds());
|
||||
List<WarnCallMap> warnCallMaps = warnCallMapMapper.selectList(queryWrapper);
|
||||
for (WarnCallMap warnCallMap : warnCallMaps) {
|
||||
warnCallMap.setCalled(1);//设置为已接通
|
||||
warnCallMap.setCallIsPut(1);
|
||||
warnCallMapMapper.updateById(warnCallMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue