parent
66b0aaf6e9
commit
a2175951b7
@ -0,0 +1,71 @@
|
|||||||
|
package com.ruoyi.pt.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import com.ruoyi.pt.entity.Events;
|
||||||
|
import com.ruoyi.pt.entity.Similar;
|
||||||
|
import com.ruoyi.pt.entity.dto.ASimilarRequest;
|
||||||
|
import com.ruoyi.pt.entity.dto.NoAccordWithRequest;
|
||||||
|
import com.ruoyi.pt.entity.response.AInvokeResponse;
|
||||||
|
import com.ruoyi.pt.service.ASimilarService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相似同类事件调用记录控制层
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/3 15:28
|
||||||
|
*/
|
||||||
|
@Api(tags = "相似事件调用记录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/earlyWarningAudit/similar")
|
||||||
|
public class ASimilarController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ASimilarService aSimilarService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询相似事件调用记录数据
|
||||||
|
*
|
||||||
|
* @param page 分页条件
|
||||||
|
* @param similarService 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/colonyPage")
|
||||||
|
@ApiOperation(value = "分页条件查询相似事件调用记录数据", response = AInvokeResponse.class)
|
||||||
|
public AjaxResult page(Page<AInvokeResponse> page, ASimilarRequest similarService) {
|
||||||
|
return success(aSimilarService.page(page,similarService));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询相似事件数据
|
||||||
|
*
|
||||||
|
* @param targetId 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/similarEventsPage/{targetId}")
|
||||||
|
@ApiOperation(value = "查询相似事件数据", response = Similar.class)
|
||||||
|
public AjaxResult similarEventsPage(@PathVariable String targetId) {
|
||||||
|
return success(aSimilarService.similarEventsPage(targetId));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 相似事件提交重训练
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "相似事件提交重训练")
|
||||||
|
@PostMapping ("/noAccordWith")
|
||||||
|
public AjaxResult noAccordWith(@RequestBody @Valid NoAccordWithRequest resultId) {
|
||||||
|
if(resultId.getResultId().isEmpty()){
|
||||||
|
throw new ServiceException("请选择工单!");
|
||||||
|
}
|
||||||
|
return toAjax(aSimilarService.noAccordWith(resultId));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.ruoyi.pt.entity;
|
||||||
|
|
||||||
|
import cn.hutool.core.annotation.Alias;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相似同类事件调用记录(similar)表实体类
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/3 15:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("相似同类事件调用记录实体类")
|
||||||
|
public class Similar implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private String targetId;
|
||||||
|
|
||||||
|
|
||||||
|
private String resultId;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private String place;
|
||||||
|
|
||||||
|
private String similarity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1退回算法重训练
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "1退回算法重训练")
|
||||||
|
private Integer isReport;
|
||||||
|
|
||||||
|
@ApiModelProperty("上报时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date sbsj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "审核时间")
|
||||||
|
private Date auditTime;
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package com.ruoyi.pt.entity.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驾驶舱群体事件请求体
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/2 11:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("驾驶舱群体事件请求体")
|
||||||
|
public class AMassEventsRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件消息标题
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "事件消息标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警时间开始时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预警时间开始时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警时间结束时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预警时间结束时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件类型编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "事件类型编码【群体事件】1" +
|
||||||
|
"【同人同诉】2" +
|
||||||
|
"【紧急事件】3" +
|
||||||
|
"【重点人员】4" +
|
||||||
|
"【一人多诉】5")
|
||||||
|
@TableField(value = "msgType")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1.重新上报驾驶舱 2.退回算法重训练
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "1.重新上报驾驶舱 2.退回算法重训练")
|
||||||
|
private Integer isReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0待审核
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "0待审核")
|
||||||
|
private Integer toBeReviewed;
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.pt.entity.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相似事件调用记录请求体
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/4 16:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("驾驶舱群体事件请求体")
|
||||||
|
public class ASimilarRequest {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件消息标题
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "事件消息标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警时间开始时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预警时间开始时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警时间结束时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预警时间结束时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1.退回算法重训练
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "1.退回算法重训练")
|
||||||
|
private Integer isReport;
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.pt.entity.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/13 15:15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class NoAccordWithRequest {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* resultId集合
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
@ApiModelProperty("resultId集合")
|
||||||
|
private List<String> resultId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "审核时间")
|
||||||
|
private Date auditTime;
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package com.ruoyi.pt.entity.response;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用记录返回体
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/5 14:24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("调用记录返回体")
|
||||||
|
public class AInvokeResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联事件数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "关联事件数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件标题
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "事件消息标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调用时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "调用时间")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* targetId
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "targetId")
|
||||||
|
private String targetId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2.退回算法重训练
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "2.退回算法重训练")
|
||||||
|
private Integer isReport;
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.ruoyi.pt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.pt.entity.CasesImport;
|
||||||
|
import com.ruoyi.pt.entity.Events;
|
||||||
|
import com.ruoyi.pt.entity.dto.AMassEventsRequest;
|
||||||
|
import com.ruoyi.pt.entity.response.ANew100PageResponse;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件接⼊Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-12-06
|
||||||
|
*/
|
||||||
|
public interface AEventsMapper {
|
||||||
|
/**
|
||||||
|
* 分页条件查询事件表
|
||||||
|
*/
|
||||||
|
Page<Events> page(Page<Events> page, @Param("req") AMassEventsRequest events);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单个事件详细信息
|
||||||
|
*/
|
||||||
|
Events getByInnerEventId(@Param("innerEventId") String innerEventId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询审核列表
|
||||||
|
*/
|
||||||
|
Page<CasesImport> auditList(Page<CasesImport> page,@Param("caseList") List<String> caseList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询审核列表
|
||||||
|
*/
|
||||||
|
List<CasesImport> auditList(@Param("caseList") List<String> caseList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单详情
|
||||||
|
*/
|
||||||
|
CasesImport getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改事件标题
|
||||||
|
*/
|
||||||
|
int edit(@Param("req") Events events);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加数据到审核表
|
||||||
|
*/
|
||||||
|
int addAudit(Events events);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据100条最新事件查询对应工单
|
||||||
|
*/
|
||||||
|
List<ANew100PageResponse> new100Page(@Param("a1") List<String> a1);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取最新一条事件
|
||||||
|
*/
|
||||||
|
Events limitOneMsg();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* casesImport表提级或退回
|
||||||
|
*/
|
||||||
|
int updateCasesImport(@Param("list") List<String> list,
|
||||||
|
@Param("time") String time);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* event表提级或退回
|
||||||
|
*/
|
||||||
|
int updateEvent(@Param("innerEventId") String innerEventId,
|
||||||
|
@Param("isReport") Integer isReport,
|
||||||
|
@Param("time") String now);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据查询条件查询事件待审核个数
|
||||||
|
*
|
||||||
|
* @param events 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
Integer eventPageCount(@Param("req") AMassEventsRequest events);
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.ruoyi.pt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.pt.entity.Events;
|
||||||
|
import com.ruoyi.pt.entity.Similar;
|
||||||
|
import com.ruoyi.pt.entity.dto.ASimilarRequest;
|
||||||
|
import com.ruoyi.pt.entity.dto.NoAccordWithRequest;
|
||||||
|
import com.ruoyi.pt.entity.response.AInvokeResponse;
|
||||||
|
import com.ruoyi.pt.service.ASimilarService;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相似同类事件调用记录数据层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-12-06
|
||||||
|
*/
|
||||||
|
public interface ASimilarMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询相似事件调用记录数据
|
||||||
|
*
|
||||||
|
* @param similarService 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
Page<AInvokeResponse> page(Page<AInvokeResponse> page, @Param("req") ASimilarRequest similarService);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询相似事件数据
|
||||||
|
*
|
||||||
|
* @param targetId 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
List<Similar> similarEventsPage(@Param("targetId") String targetId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标记为不符合
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int noAccordWith(@Param("req") NoAccordWithRequest resultId);
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
package com.ruoyi.pt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.response.ANew100PageResponse;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件业务层
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/2 10:24
|
||||||
|
*/
|
||||||
|
public interface AEventsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询事件表
|
||||||
|
*/
|
||||||
|
Page<Events> page(Page<Events> page, AMassEventsRequest events);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询审核列表
|
||||||
|
*/
|
||||||
|
Page<CasesImport> auditList(Page<CasesImport> page, String innerEventId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单详情
|
||||||
|
*/
|
||||||
|
CasesImport getById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改事件标题
|
||||||
|
*/
|
||||||
|
int edit(Events events);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件提级或退回
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void eventChangeIsReport(AEventChangeIsReport events);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据100条最新事件查询对应工单
|
||||||
|
*/
|
||||||
|
List<ANew100PageResponse> new100Page();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询事件详情
|
||||||
|
*/
|
||||||
|
Events getByInnerEventId(String innerEventId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取最新一条事件
|
||||||
|
*/
|
||||||
|
Events limitOneMsg();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据查询条件查询事件待审核个数
|
||||||
|
*
|
||||||
|
* @param events 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
Integer eventPageCount(AMassEventsRequest events);
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.ruoyi.pt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.pt.entity.Similar;
|
||||||
|
import com.ruoyi.pt.entity.dto.ASimilarRequest;
|
||||||
|
import com.ruoyi.pt.entity.dto.NoAccordWithRequest;
|
||||||
|
import com.ruoyi.pt.entity.response.AInvokeResponse;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相似同类事件调用记录业务层
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/2 10:24
|
||||||
|
*/
|
||||||
|
public interface ASimilarService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询相似事件调用记录数据
|
||||||
|
*
|
||||||
|
* @param page 分页条件
|
||||||
|
* @param similarService 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
Page<AInvokeResponse> page(Page<AInvokeResponse> page, @Param("req") ASimilarRequest similarService);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询相似事件数据
|
||||||
|
*
|
||||||
|
* @param targetId 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
List<Similar> similarEventsPage(String targetId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标记为不符合
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int noAccordWith(NoAccordWithRequest resultId);
|
||||||
|
}
|
@ -0,0 +1,157 @@
|
|||||||
|
package com.ruoyi.pt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
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.response.ANew100PageResponse;
|
||||||
|
import com.ruoyi.pt.mapper.AEventsMapper;
|
||||||
|
import com.ruoyi.pt.service.AEventsService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群体事件业务处理层
|
||||||
|
*
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/2 10:24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AEventsServiceImpl implements AEventsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AEventsMapper aEventsMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询事件表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<Events> page(Page<Events> page, AMassEventsRequest events) {
|
||||||
|
return aEventsMapper.page(page, events);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询审核列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<CasesImport> auditList(Page<CasesImport> page, String innerEventId) {
|
||||||
|
//获取该事件详细信息
|
||||||
|
Events ev = aEventsMapper.getByInnerEventId(innerEventId);
|
||||||
|
String str = ev.getRelationNums().replaceAll("[\\[\\]']", "");
|
||||||
|
return aEventsMapper.auditList(page, Arrays.asList(str.split(",\\s*")));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工单详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CasesImport getById(String id) {
|
||||||
|
return aEventsMapper.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改事件标题
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int edit(Events events) {
|
||||||
|
return aEventsMapper.edit(events);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件提级或退回
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void eventChangeIsReport(AEventChangeIsReport events) {
|
||||||
|
String now = DateUtil.now();
|
||||||
|
aEventsMapper.updateCasesImport(events.getCaseSerial(),now);
|
||||||
|
aEventsMapper.updateEvent(events.getInnerEventId(), events.getIsReport(), now);
|
||||||
|
if (events.getIsReport() == 1) {
|
||||||
|
Events a1 = aEventsMapper.getByInnerEventId(events.getInnerEventId());
|
||||||
|
StringBuilder sb = new StringBuilder().append("[");
|
||||||
|
int count = 1;
|
||||||
|
for (String x : events.getCaseSerial()) {
|
||||||
|
sb.append("'");
|
||||||
|
sb.append(x);
|
||||||
|
sb.append("'");
|
||||||
|
if (count != events.getCaseSerial().size()) {
|
||||||
|
sb.append(",");
|
||||||
|
}
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
sb.append("]");
|
||||||
|
a1.setRelationNums(sb.toString());
|
||||||
|
String substring = a1.getInnerEventId().substring(0, 6);
|
||||||
|
a1.setInnerEventId(substring+IdUtil.randomUUID());
|
||||||
|
aEventsMapper.addAudit(a1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据100条最新事件查询对应工单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ANew100PageResponse> new100Page() {
|
||||||
|
//查询最新100条事件
|
||||||
|
Page<Events> page1 = new Page<>();
|
||||||
|
page1.setCurrent(1);
|
||||||
|
page1.setSize(100);
|
||||||
|
Page<Events> page = aEventsMapper.page(page1, new AMassEventsRequest());
|
||||||
|
Map<String, String> code = new HashMap<>();
|
||||||
|
Map<String, Integer> numIs = new HashMap<>();
|
||||||
|
Map<String, String> inner = new HashMap<>();
|
||||||
|
List<String> a1 = new ArrayList<>();
|
||||||
|
page.getRecords().forEach(x -> {
|
||||||
|
String[] split = x.getRelationNums().replaceAll("[\\[\\]']", "").split(",\\s*");
|
||||||
|
a1.add(split[0]);
|
||||||
|
code.put(split[0], x.getMsgType());
|
||||||
|
numIs.put(split[0], x.getNums());
|
||||||
|
inner.put(split[0], x.getInnerEventId());
|
||||||
|
});
|
||||||
|
List<ANew100PageResponse> new100PageList = aEventsMapper.new100Page(a1);
|
||||||
|
for (ANew100PageResponse items : new100PageList) {
|
||||||
|
items.setNums(numIs.get(items.getCaseSerial()));
|
||||||
|
items.setMsgType(code.get(items.getCaseSerial()));
|
||||||
|
items.setInnerEventId(inner.get(items.getCaseSerial()));
|
||||||
|
}
|
||||||
|
return new100PageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询事件详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Events getByInnerEventId(String innerEventId) {
|
||||||
|
return aEventsMapper.getByInnerEventId(innerEventId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取最新一条事件
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Events limitOneMsg() {
|
||||||
|
return aEventsMapper.limitOneMsg();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据查询条件查询事件待审核个数
|
||||||
|
*
|
||||||
|
* @param events 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer eventPageCount(AMassEventsRequest events) {
|
||||||
|
return aEventsMapper.eventPageCount(events);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.pt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.pt.entity.Similar;
|
||||||
|
import com.ruoyi.pt.entity.dto.ASimilarRequest;
|
||||||
|
import com.ruoyi.pt.entity.dto.NoAccordWithRequest;
|
||||||
|
import com.ruoyi.pt.entity.response.AInvokeResponse;
|
||||||
|
import com.ruoyi.pt.mapper.AEventsMapper;
|
||||||
|
import com.ruoyi.pt.mapper.ASimilarMapper;
|
||||||
|
import com.ruoyi.pt.service.ASimilarService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相似同类事件调用记录业务处理层
|
||||||
|
* @author du
|
||||||
|
* @since 2024/9/2 10:24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ASimilarServiceImpl implements ASimilarService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ASimilarMapper aSimilarMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AEventsMapper aEventsMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询相似事件调用记录数据
|
||||||
|
*
|
||||||
|
* @param page 分页条件
|
||||||
|
* @param aSimilarRequest 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<AInvokeResponse> page(Page<AInvokeResponse> page, ASimilarRequest aSimilarRequest) {
|
||||||
|
return aSimilarMapper.page(page,aSimilarRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页条件查询相似事件数据
|
||||||
|
*
|
||||||
|
* @param targetId 查询条件
|
||||||
|
* @return 所有数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Similar> similarEventsPage( String targetId) {
|
||||||
|
return aSimilarMapper.similarEventsPage(targetId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标记为不符合
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int noAccordWith(NoAccordWithRequest resultId) {
|
||||||
|
resultId.setAuditTime(DateUtil.date());
|
||||||
|
return aSimilarMapper.noAccordWith(resultId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,140 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.pt.mapper.AEventsMapper">
|
||||||
|
<select id="page" resultType="com.ruoyi.pt.entity.Events">
|
||||||
|
select a.* from events a
|
||||||
|
<where>
|
||||||
|
<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>
|
||||||
|
<if test="req.endTime != null">and a.eventTime <= #{req.endTime}</if>
|
||||||
|
<if test="req.toBeReviewed != null">and a.isReport is null</if>
|
||||||
|
<if test="req.isReport != null">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>
|
||||||
|
</select>
|
||||||
|
<insert id="addAudit" parameterType="Events" >
|
||||||
|
insert into audit
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="innerEventId != null">innerEventId,</if>
|
||||||
|
<if test="title != null">title,</if>
|
||||||
|
<if test="msgType != null">msgType,</if>
|
||||||
|
<if test="msgTypeName != null">msgTypeName,</if>
|
||||||
|
<if test="scenceType != null">scenceType,</if>
|
||||||
|
<if test="scenceTypeName != null">scenceTypeName,</if>
|
||||||
|
<if test="firstWarnTime != null">firstWarnTime,</if>
|
||||||
|
<if test="eventTime != null">eventTime,</if>
|
||||||
|
<if test="warnFactor != null">warnFactor,</if>
|
||||||
|
<if test="relationNums != null">relationNums,</if>
|
||||||
|
<if test="nums != null">nums,</if>
|
||||||
|
<if test="scenceName != null">scenceName,</if>
|
||||||
|
<if test="state != null">state,</if>
|
||||||
|
<if test="titleBefore != null">titleBefore,</if>
|
||||||
|
<if test="isReport != null">isReport,</if>
|
||||||
|
<if test="auditTime != null">auditTime,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="innerEventId != null">#{innerEventId},</if>
|
||||||
|
<if test="title != null">#{title},</if>
|
||||||
|
<if test="msgType != null">#{msgType},</if>
|
||||||
|
<if test="msgTypeName != null">#{msgTypeName},</if>
|
||||||
|
<if test="scenceType != null">#{scenceType},</if>
|
||||||
|
<if test="scenceTypeName != null">#{scenceTypeName},</if>
|
||||||
|
<if test="firstWarnTime != null">#{firstWarnTime},</if>
|
||||||
|
<if test="eventTime != null">#{eventTime},</if>
|
||||||
|
<if test="warnFactor != null">#{warnFactor},</if>
|
||||||
|
<if test="relationNums != null">#{relationNums},</if>
|
||||||
|
<if test="nums != null">#{nums},</if>
|
||||||
|
<if test="scenceName != null">#{scenceName},</if>
|
||||||
|
<if test="state != null">#{state},</if>
|
||||||
|
<if test="titleBefore != null">#{titleBefore},</if>
|
||||||
|
<if test="isReport != null">#{isReport},</if>
|
||||||
|
<if test="auditTime != null">#{auditTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="new100Page" resultType="com.ruoyi.pt.entity.response.ANew100PageResponse">
|
||||||
|
select innerEventId,
|
||||||
|
CASE_SERIAL as caseSerial,
|
||||||
|
CASE_TYPE as caseType,
|
||||||
|
CASE_ACCORD as caseAccord,
|
||||||
|
CASE_TITLE as caseTitle,
|
||||||
|
CASE_DATE as caseDate,
|
||||||
|
CASE_CONTENT as caseContent,
|
||||||
|
IF(CASE_LNGLAT is null || CASE_LNGLAT = '' || CASE_LNGLAT = '无法获取','118.801528,31.930902',CASE_LNGLAT) as caseLnglat,
|
||||||
|
CASE_ADDRESS as caseAddress,
|
||||||
|
IS_URGENT as isUrgent,CREATOR_NAME as creatorName,CREATOR_TEL as creatorTel,id,
|
||||||
|
scenceName as scenceName,isReport as isReport
|
||||||
|
from cases_import
|
||||||
|
where CASE_SERIAL in
|
||||||
|
<foreach collection="a1" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
order by CASE_DATE desc
|
||||||
|
limit 100
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="auditList" resultType="com.ruoyi.pt.entity.CasesImport">
|
||||||
|
select *
|
||||||
|
from cases_import
|
||||||
|
where CASE_SERIAL in
|
||||||
|
<foreach collection="caseList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
order by CASE_DATE desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getByInnerEventId" resultType="com.ruoyi.pt.entity.Events">
|
||||||
|
select * from events
|
||||||
|
where innerEventId = #{innerEventId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getById" resultType="com.ruoyi.pt.entity.CasesImport">
|
||||||
|
select * from cases_import
|
||||||
|
where CASE_SERIAL = #{id}
|
||||||
|
</select>
|
||||||
|
<select id="limitOneMsg" resultType="com.ruoyi.pt.entity.Events">
|
||||||
|
select * from events
|
||||||
|
order by eventTime
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<update id="edit" parameterType="Events">
|
||||||
|
update events
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="req.title != null">title = #{req.title},</if>
|
||||||
|
<if test="req.titleBefore != null">titleBefore = #{req.titleBefore},</if>
|
||||||
|
</trim>
|
||||||
|
where innerEventId = #{req.innerEventId}
|
||||||
|
</update>
|
||||||
|
<update id="updateCasesImport">
|
||||||
|
update cases_import
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
isReport = 1,
|
||||||
|
<if test="time != null">auditTime = #{time},</if>
|
||||||
|
</trim>
|
||||||
|
where CASE_SERIAL in
|
||||||
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
<update id="updateEvent">
|
||||||
|
update events
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="isReport != null">isReport = #{isReport},</if>
|
||||||
|
<if test="time != null">auditTime = #{time},</if>
|
||||||
|
</trim>
|
||||||
|
where innerEventId = #{innerEventId}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.pt.mapper.ASimilarMapper">
|
||||||
|
|
||||||
|
<select id="page" resultType="com.ruoyi.pt.entity.response.AInvokeResponse">
|
||||||
|
SELECT
|
||||||
|
a.target_id,
|
||||||
|
a.create_time,
|
||||||
|
a.count,
|
||||||
|
b.CASE_TITLE AS title,
|
||||||
|
a.is_report
|
||||||
|
FROM
|
||||||
|
( SELECT target_id, create_time, count(*) AS count, max( is_report ) AS is_report
|
||||||
|
FROM similar GROUP BY target_id, create_time ) a
|
||||||
|
LEFT JOIN cases_import b ON a.target_id = b.CASE_SERIAL
|
||||||
|
<where>
|
||||||
|
<if test="req.title != null and req.title != ''">and b.CASE_TITLE like concat('%',#{req.title},'%')</if>
|
||||||
|
<if test="req.startTime != null">and a.create_time >= #{req.startTime}</if>
|
||||||
|
<if test="req.endTime != null">and a.create_time <= #{req.endTime}</if>
|
||||||
|
<if test="req.isReport == null">and a.is_report is null</if>
|
||||||
|
<if test="req.isReport != null">and a.is_report = #{req.isReport}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="similarEventsPage" resultType="com.ruoyi.pt.entity.Similar">
|
||||||
|
select
|
||||||
|
a.target_id,
|
||||||
|
a.result_id,
|
||||||
|
a.title,
|
||||||
|
a.content,
|
||||||
|
a.create_time,
|
||||||
|
a.place,
|
||||||
|
a.is_report,
|
||||||
|
a.audit_time,
|
||||||
|
ROUND(a.similarity*100,2) as similarity,
|
||||||
|
b.case_date as sbsj
|
||||||
|
from similar a
|
||||||
|
LEFT JOIN cases_import b ON a.result_id = b.CASE_SERIAL
|
||||||
|
<where>
|
||||||
|
<if test="targetId != null and targetId != ''">a.target_id = #{targetId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="noAccordWith" parameterType="String">
|
||||||
|
update similar
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
is_report = 1,
|
||||||
|
<if test="req.auditTime != null">audit_time = #{req.auditTime},</if>
|
||||||
|
</trim>
|
||||||
|
where result_id in
|
||||||
|
<foreach collection="req.resultId" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in new issue