92 lines
3.0 KiB
Java
92 lines
3.0 KiB
Java
|
|
package com.whdc.controller;
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
|
|
import com.whdc.model.dto.AutoCallDto;
|
||
|
|
import com.whdc.model.entity.AutoCallPerson;
|
||
|
|
import com.whdc.model.entity.AutoCallTask;
|
||
|
|
import com.whdc.model.entity.WarnCallMap;
|
||
|
|
import com.whdc.service.AutoCallApiService;
|
||
|
|
import com.whdc.service.AutoCallTaskService;
|
||
|
|
import com.whdc.service.AutoCallTaskService2;
|
||
|
|
import com.whdc.utils.ResultJson;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import java.text.ParseException;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author lyf
|
||
|
|
* @since 2025-06-17
|
||
|
|
*/
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/autocall")
|
||
|
|
public class AutoCallController {
|
||
|
|
@Autowired
|
||
|
|
private AutoCallApiService autoCallApiService;
|
||
|
|
@Autowired
|
||
|
|
private AutoCallTaskService autoCallTaskService;
|
||
|
|
@Autowired
|
||
|
|
private AutoCallTaskService2 autoCallTaskService2;
|
||
|
|
|
||
|
|
@GetMapping("/doCallTest")
|
||
|
|
public ResultJson<String> doCallTest() throws ParseException {
|
||
|
|
autoCallTaskService.generateFakeCall();
|
||
|
|
return ResultJson.ok("resp");
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/doGenerateTest2")
|
||
|
|
public ResultJson<String> doGenerateTest2() throws ParseException {
|
||
|
|
autoCallTaskService2.generateFakeCall();
|
||
|
|
return ResultJson.ok("resp");
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/doCallTest2")
|
||
|
|
public ResultJson<List<AutoCallPerson>> doCallTest2() throws ParseException {
|
||
|
|
List<AutoCallPerson> personList = autoCallTaskService2.doCallTest();
|
||
|
|
return ResultJson.ok(personList);
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/getToken")
|
||
|
|
public ResultJson<String> getToken() {
|
||
|
|
return ResultJson.ok(autoCallTaskService.getToken());
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/queryTaskResult")
|
||
|
|
public ResultJson<String> queryTaskResult(@RequestParam("requestId") String requestId, @RequestParam("custId") String custId) {
|
||
|
|
return ResultJson.ok(autoCallTaskService.queryTaskResult(requestId, custId));
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/page")
|
||
|
|
public ResultJson<Page<WarnCallMap>> newList(@RequestBody AutoCallDto dto) {
|
||
|
|
return ResultJson.ok(autoCallApiService.page(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/page2")
|
||
|
|
public ResultJson<Page<AutoCallTask>> page2(@RequestBody AutoCallDto dto) {
|
||
|
|
return ResultJson.ok(autoCallApiService.page2(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/listCallIsNotPut")
|
||
|
|
public ResultJson<List<WarnCallMap>> listCallIsNotPut() {
|
||
|
|
return ResultJson.ok(autoCallApiService.listCallIsNotPut());
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/isEnable")
|
||
|
|
public ResultJson<Boolean> isEnable() {
|
||
|
|
return ResultJson.ok(autoCallTaskService.isEnable());
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/setEnable")
|
||
|
|
public ResultJson<Boolean> setEnable(@RequestParam("enable") Boolean enable) {
|
||
|
|
autoCallTaskService.setEnable(enable);
|
||
|
|
return ResultJson.ok(true);
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/setCallIsPut")
|
||
|
|
public ResultJson<Boolean> setCallIsPut(@RequestParam("taskId") Integer taskId) {
|
||
|
|
autoCallTaskService.setCallIsPut(taskId);
|
||
|
|
return ResultJson.ok(true);
|
||
|
|
}
|
||
|
|
}
|