|
|
|
@ -5,29 +5,35 @@ import com.ruoyi.common.constant.Constants;
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.core.domain.model.LoginBody;
|
|
|
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
import com.ruoyi.framework.web.service.SysLoginService;
|
|
|
|
|
import com.ruoyi.pt.entity.CaseInfo;
|
|
|
|
|
import com.ruoyi.pt.entity.CasesImport;
|
|
|
|
|
import com.ruoyi.pt.entity.Events;
|
|
|
|
|
import com.ruoyi.pt.entity.dto.AEventChangeIsReport;
|
|
|
|
|
import com.ruoyi.pt.entity.dto.AMassEventsRequest;
|
|
|
|
|
import com.ruoyi.pt.entity.dto.ASimilarRequest;
|
|
|
|
|
import com.ruoyi.pt.entity.response.ANew100PageResponse;
|
|
|
|
|
import com.ruoyi.pt.entity.response.FiveEventCountResponse;
|
|
|
|
|
import com.ruoyi.pt.service.AEventsService;
|
|
|
|
|
import com.ruoyi.pt.service.EventsService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 事件控制层
|
|
|
|
|
*
|
|
|
|
|
* @author du
|
|
|
|
|
* @since 2024/9/2 10:20
|
|
|
|
|
*/
|
|
|
|
@ -40,10 +46,47 @@ public class AEventsController extends BaseController {
|
|
|
|
|
private AEventsService aEventsService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private EventsService eventsService;
|
|
|
|
|
private RedisCache redisCache;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private SysLoginService sysLoginService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 校验
|
|
|
|
|
*
|
|
|
|
|
* @return 响应类
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/verify")
|
|
|
|
|
@ApiOperation(value = "登录获取token")
|
|
|
|
|
public AjaxResult verificationCode() {
|
|
|
|
|
LocalDate cacheObject = redisCache.getCacheObject("88888888");
|
|
|
|
|
if (cacheObject != null) {
|
|
|
|
|
return AjaxResult.success(true);
|
|
|
|
|
} else {
|
|
|
|
|
return AjaxResult.success(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据校验码校验
|
|
|
|
|
*
|
|
|
|
|
* @param verificationCode 校验码
|
|
|
|
|
* @return 响应类
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/verificationCode")
|
|
|
|
|
@ApiOperation(value = "根据校验码校验")
|
|
|
|
|
public AjaxResult verificationCode(String verificationCode) {
|
|
|
|
|
if (!"88888888".equals(verificationCode)) {
|
|
|
|
|
throw new ServiceException("试用码错误,请重试");
|
|
|
|
|
}
|
|
|
|
|
// 获取当前日期
|
|
|
|
|
LocalDate startDate = LocalDate.now();
|
|
|
|
|
LocalDate endDate = startDate.plusMonths(3);
|
|
|
|
|
long daysBetween = ChronoUnit.DAYS.between(startDate, endDate);
|
|
|
|
|
redisCache.setCacheObject(verificationCode, startDate, Math.toIntExact(daysBetween), TimeUnit.DAYS);
|
|
|
|
|
return AjaxResult.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 登录获取token
|
|
|
|
|
*/
|
|
|
|
@ -94,18 +137,18 @@ public class AEventsController extends BaseController {
|
|
|
|
|
* 获取日志错误信息
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/getErrorMsg")
|
|
|
|
|
@ApiOperation(value = "获取日志错误信息",response = Events.class)
|
|
|
|
|
@ApiOperation(value = "获取日志错误信息", response = Events.class)
|
|
|
|
|
public AjaxResult getErrorMsg(HttpServletRequest request) {
|
|
|
|
|
String header1 = request.getHeader("clientId");
|
|
|
|
|
String header2 = request.getHeader("clientSecret");
|
|
|
|
|
if(header1==null||header2==null){
|
|
|
|
|
return AjaxResult.error(401,"请求访问:/earlyWarningAudit/massEvents/getErrorMsg,认证失败,无法访问系统资源");
|
|
|
|
|
}else {
|
|
|
|
|
if("3YSE6O8fRACPPRVCqAlxgkhzMG+tasXXYgdDsiWPi/U=".equals(header1)
|
|
|
|
|
&& "kdoiIv5Wn2VvPG0sSGNF9Q4SVvu3CoBy+m6e8skq3AY=".equals(header2)){
|
|
|
|
|
if (header1 == null || header2 == null) {
|
|
|
|
|
return AjaxResult.error(401, "请求访问:/earlyWarningAudit/massEvents/getErrorMsg,认证失败,无法访问系统资源");
|
|
|
|
|
} else {
|
|
|
|
|
if ("3YSE6O8fRACPPRVCqAlxgkhzMG+tasXXYgdDsiWPi/U=".equals(header1)
|
|
|
|
|
&& "kdoiIv5Wn2VvPG0sSGNF9Q4SVvu3CoBy+m6e8skq3AY=".equals(header2)) {
|
|
|
|
|
return success(aEventsService.getErrorMsg());
|
|
|
|
|
}else {
|
|
|
|
|
return AjaxResult.error(401,"请求访问:/earlyWarningAudit/massEvents/getErrorMsg,认证失败,无法访问系统资源");
|
|
|
|
|
} else {
|
|
|
|
|
return AjaxResult.error(401, "请求访问:/earlyWarningAudit/massEvents/getErrorMsg,认证失败,无法访问系统资源");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -120,7 +163,7 @@ public class AEventsController extends BaseController {
|
|
|
|
|
@GetMapping("/colonyPage")
|
|
|
|
|
@ApiOperation(value = "分页条件查询事件数据", response = Events.class)
|
|
|
|
|
public AjaxResult colonyPage(Page<Events> page, AMassEventsRequest events) {
|
|
|
|
|
return success(aEventsService.page(page,events));
|
|
|
|
|
return success(aEventsService.page(page, events));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -139,7 +182,7 @@ public class AEventsController extends BaseController {
|
|
|
|
|
* 查询五种事件待审核个数
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/fiveEventCount")
|
|
|
|
|
@ApiOperation(value = "查询五种事件待审核个数",response = FiveEventCountResponse.class)
|
|
|
|
|
@ApiOperation(value = "查询五种事件待审核个数", response = FiveEventCountResponse.class)
|
|
|
|
|
public AjaxResult fiveEventCount() {
|
|
|
|
|
return success(aEventsService.fiveEventCount());
|
|
|
|
|
}
|
|
|
|
@ -160,7 +203,7 @@ public class AEventsController extends BaseController {
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/getByInnerEventId/{innerEventId}")
|
|
|
|
|
@ApiOperation(value = "根据事件的innerEventId查询事件详情", response = Events.class)
|
|
|
|
|
public AjaxResult getByInnerEventId( @PathVariable String innerEventId) {
|
|
|
|
|
public AjaxResult getByInnerEventId(@PathVariable String innerEventId) {
|
|
|
|
|
return success(aEventsService.getByInnerEventId(innerEventId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -170,7 +213,7 @@ public class AEventsController extends BaseController {
|
|
|
|
|
@GetMapping("/auditList/{innerEventId}")
|
|
|
|
|
@ApiOperation(value = "根据事件的innerEventId分页查询审核工单列表", response = CasesImport.class)
|
|
|
|
|
public AjaxResult auditList(Page<CasesImport> page, @PathVariable String innerEventId) {
|
|
|
|
|
return success(aEventsService.auditList(page,innerEventId));
|
|
|
|
|
return success(aEventsService.auditList(page, innerEventId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|