修改需求

master
吴顺杰 3 days ago
parent 0c88cb8ee4
commit cd34f92725

@ -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));
}
/**

@ -3,6 +3,7 @@ package com.ruoyi.pt.controller;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.pt.entity.dto.NoPassEventListDTO;
import com.ruoyi.pt.service.CasesImportService;
import com.ruoyi.pt.service.RemoteCallsService;
import io.swagger.annotations.Api;
@ -123,16 +124,16 @@ public class RemoteCallsController extends BaseController {
*/
@ApiOperation(value = "过滤审核不通过的事件列表")
@GetMapping("/noPassEventList")
public AjaxResult noPassEventList() {
// 获取当前时间
LocalDateTime now = LocalDateTime.now();
// 获取当前时间的上一个小时
LocalDateTime lastHour = now.minusHours(1);
public AjaxResult noPassEventList(NoPassEventListDTO dto) {
// // 获取当前时间
// LocalDateTime now = LocalDateTime.now();
// // 获取当前时间的上一个小时
// LocalDateTime lastHour = now.minusHours(1);
// 获取上个小时
LocalDateTime lastHourWholeHour = lastHour.withMinute(0).withSecond(0);
LocalDateTime lastHourWholeHour = dto.getStartTime().withMinute(0).withSecond(0);
String lastHourStr = lastHourWholeHour.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
// 获取当前时间
LocalDateTime wholeHour = now.withMinute(0).withSecond(0);
LocalDateTime wholeHour = dto.getEndTime().withMinute(0).withSecond(0);
String localDateStr = wholeHour.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
remoteCallsService.noPassEventList(lastHourStr, localDateStr);
return success();

@ -0,0 +1,25 @@
package com.ruoyi.pt.entity.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author wu
* @since 2024/11/12 09:19
*/
@Data
public class NoPassEventListDTO implements Serializable {
private static final long serialVersionUID = 8846337468970694737L;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
}

@ -1,7 +1,6 @@
package com.ruoyi.pt.quartz;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.unit.DataUnit;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.pt.entity.RemoteLog;
import com.ruoyi.pt.service.RemoteCallsService;
@ -60,9 +59,9 @@ public class PushQuartz {
// 过滤审核不通过的事件列表
log.info("==============过滤审核不通过的事件列表" + "============");
remoteCallsService.noPassEventList(lastHourStr, localDateStr);
// 过滤已办结的事件列表
log.info("==============过滤已办结的事件列表" + "============");
remoteCallsService.completionEventList(lastHourStr, localDateStr);
// todo 暂时注销 过滤已办结的事件列表
// log.info("==============过滤已办结的事件列表" + "============");
// remoteCallsService.completionEventList(lastHourStr, localDateStr);
// 拉取社会治理中心增量事件保存到events_import表
int total = remoteCallsService.getEventDate();
remoteLog.setHqTotal(total);

@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -28,7 +27,11 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*

@ -439,7 +439,9 @@ public class RemoteCallsServiceImpl implements RemoteCallsService {
log.info("IfInstruct=2的数据条数=====================" + notPassed.size() + "=========================");
if (CollectionUtil.isNotEmpty(notPassed)) {
QueryWrapper<Events> wrapper = new QueryWrapper<>();
wrapper.in("innerEventId", notPassed);
wrapper.in("innerEventId", notPassed)
// todo 暂修改为只要第一次的数据
.isNull("state");
// 设置1
events.setState(state);
eventsService.update(events, wrapper);
@ -448,14 +450,18 @@ public class RemoteCallsServiceImpl implements RemoteCallsService {
log.info("IfInstruct=4的数据条数=====================" + disuse.size() + "=========================");
if (CollectionUtil.isNotEmpty(disuse)) {
QueryWrapper<Events> wrapper = new QueryWrapper<>();
wrapper.in("innerEventId", disuse);
wrapper.in("innerEventId", disuse)
// todo 暂修改为只要第一次的数据
.isNull("state");
events.setState(3);
eventsService.update(events, wrapper);
}
} else {
List<String> innerEventIdList = list.stream().map(PassEventRequest::getInnerEventId).collect(Collectors.toList());
QueryWrapper<Events> wrapper = new QueryWrapper<>();
wrapper.in("innerEventId", innerEventIdList);
wrapper.in("innerEventId", innerEventIdList)
// todo 暂修改为只要第一次的数据
.isNull("state");
// 设置2
events.setState(state);
eventsService.update(events, wrapper);

@ -25,7 +25,8 @@
<select id="page" resultMap="EventResult">
select a.* from events a
<where>
where
a.state = 1
<if test="req.title != null and req.title != ''">and a.title like concat('%',#{req.title},'%')</if>
<if test="req.msgType != null and req.msgType != ''">and a.msgType = #{req.msgType}</if>
<if test="req.startTime != null">and a.eventTime >= #{req.startTime}</if>
@ -35,15 +36,14 @@
<if test="req.isReport == 1">and a.isReport = #{req.isReport}</if>
<if test="req.isReport == 2">and a.isReport = #{req.isReport}</if>
<if test="req.isReport == 3">and a.isReport = #{req.isReport}</if>
</where>
order by a.eventTime desc
</select>
<select id="eventPageCount" resultType="java.lang.Integer">
select count(*) from events a
<where>
a.isReport is null
<if test="req.msgType != null and req.msgType != ''">and a.msgType = #{req.msgType}</if>
</where>
where
a.state = 1 and
a.isReport is null
<if test="req.msgType != null and req.msgType != ''">and a.msgType = #{req.msgType}</if>
</select>
<insert id="addAudit" parameterType="Events" >
insert into audit
@ -120,15 +120,19 @@
</select>
<select id="fiveEventCount" resultType="com.ruoyi.pt.entity.response.FiveEventCountResponse">
select msgType,COUNT(*) as count from events
select msgType, COUNT(*) as count
from events
where isReport is null
and state = 1
group by msgType
</select>
<select id="limitOneMsg" resultMap="EventResult">
select * from events
select *
from events
where eventTime >= NOW() - INTERVAL 1 HOUR
and state = 1
order by eventTime
limit 1
limit 1
</select>

Loading…
Cancel
Save