diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java new file mode 100644 index 0000000..5b8af42 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java @@ -0,0 +1,133 @@ +package com.ruoyi.pt.controller; + +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.common.utils.SecurityUtils; +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.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 javax.annotation.Resource; +import javax.validation.Valid; + +/** + * 事件控制层 + * @author du + * @since 2024/9/2 10:20 + */ +@Api(tags = "事件") +@RestController +@RequestMapping("/earlyWarningAudit/massEvents") +public class AEventsController extends BaseController { + + @Resource + private AEventsService aEventsService; + + @Resource + private EventsService eventsService; + + /** + * 取最新一条事件(预警钟) + */ + @GetMapping("/limitOneMsg") + @ApiOperation(value = "取最新一条事件(预警钟)", response = Events.class) + public AjaxResult limitOneMsg() { + return success(aEventsService.limitOneMsg()); + } + + /** + * 根据100条最新事件查询对应工单 + */ + @GetMapping("/new100Page") + @ApiOperation(value = "根据100条最新事件查询对应工单", response = ANew100PageResponse.class) + public AjaxResult new100Page() { + return success(aEventsService.new100Page()); + } + + + /** + * 分页条件查询事件数据 + * + * @param page 分页条件 + * @param events 查询条件 + * @return 所有数据 + */ + @GetMapping("/colonyPage") + @ApiOperation(value = "分页条件查询事件数据", response = Events.class) + public AjaxResult colonyPage(Page page, AMassEventsRequest events) { + return success(aEventsService.page(page,events)); + } + + /** + * 根据查询条件查询事件待审核个数 + * + * @param events 查询条件 + * @return 所有数据 + */ + @GetMapping("/eventPageCount") + @ApiOperation(value = "根据查询条件查询事件待审核个数") + public AjaxResult eventPageCount(AMassEventsRequest events) { + return success(aEventsService.eventPageCount(events)); + } + /** + * 修改事件标题 + */ + @ApiOperation(value = "修改事件标题") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody Events events) { + Events byId = aEventsService.getByInnerEventId(events.getInnerEventId()); + events.setTitleBefore(byId.getTitle()); + return toAjax(aEventsService.edit(events)); + } + + /** + * 根据事件的innerEventId查询事件详情 + */ + @GetMapping("/getByInnerEventId/{innerEventId}") + @ApiOperation(value = "根据事件的innerEventId查询事件详情", response = Events.class) + public AjaxResult getByInnerEventId( @PathVariable String innerEventId) { + return success(aEventsService.getByInnerEventId(innerEventId)); + } + + /** + * 根据事件的innerEventId分页查询审核工单列表 + */ + @GetMapping("/auditList/{innerEventId}") + @ApiOperation(value = "根据事件的innerEventId分页查询审核工单列表", response = CasesImport.class) + public AjaxResult auditList(Page page, @PathVariable String innerEventId) { + return success(aEventsService.auditList(page,innerEventId)); + } + + /** + * 查询工单详情 + */ + @ApiOperation(value = "查询工单详情") + @GetMapping(value = "/{caseSerial}") + public AjaxResult getById(@PathVariable("caseSerial") String id) { + return success(aEventsService.getById(id)); + } + + /** + * 事件提级或退回 + */ + @ApiOperation(value = "事件提级或退回") + @PostMapping("/eventChangeIsReport") + public AjaxResult eventChangeIsReport(@RequestBody @Valid AEventChangeIsReport events) { + if(events.getCaseSerial().isEmpty()){ + throw new ServiceException("请选择工单上报!"); + } + aEventsService.eventChangeIsReport(events); + return success(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/ASimilarController.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/ASimilarController.java new file mode 100644 index 0000000..ba00918 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/ASimilarController.java @@ -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 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)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/CasesImport.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/CasesImport.java index 2d82008..cf1dd05 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/CasesImport.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/CasesImport.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.pt.entity.response.CasesEventExtImportResponse; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -39,6 +40,7 @@ public class CasesImport implements Serializable { */ @TableField(value = "CASE_SERIAL") @Alias("innerEventId") + @ApiModelProperty(value = "工单编号") private String caseSerial; /** @@ -46,6 +48,7 @@ public class CasesImport implements Serializable { */ @TableField(value = "CASE_TYPE") @Alias("msgTypeName") + @ApiModelProperty(value = "诉求类型") private String caseType; @TableField(exist = false) @@ -61,6 +64,7 @@ public class CasesImport implements Serializable { */ @TableField(value = "CASE_ACCORD") @Alias("scenceTypeName") + @ApiModelProperty(value = "案件类型") private String caseAccord; /** @@ -68,6 +72,7 @@ public class CasesImport implements Serializable { */ @TableField(value = "CASE_TITLE") @Alias("title") + @ApiModelProperty(value = "工单标题") private String caseTitle; /** @@ -77,6 +82,7 @@ public class CasesImport implements Serializable { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField(value = "CASE_DATE") @Alias("eventTime") + @ApiModelProperty(value = "制单时间") private Date caseDate; /** @@ -84,6 +90,7 @@ public class CasesImport implements Serializable { */ @TableField(value = "CASE_CONTENT") @Alias("content") + @ApiModelProperty(value = "诉求内容") private String caseContent; /** @@ -91,6 +98,7 @@ public class CasesImport implements Serializable { */ @TableField(value = "CASE_LNGLAT") @Alias("eventCoordinate") + @ApiModelProperty(value = "坐标") private String caseLnglat; /** @@ -98,17 +106,20 @@ public class CasesImport implements Serializable { */ @TableField(value = "CASE_ADDRESS") @Alias("eventPlaceName") + @ApiModelProperty(value = "位置描述") private String caseAddress; /** * 是否紧急 */ + @ApiModelProperty(value = "是否紧急") @TableField(value = "IS_URGENT") private Integer isUrgent; /** * 服务对象姓名 */ + @ApiModelProperty(value = "服务对象姓名") @TableField(value = "CREATOR_NAME") @Alias("eventCreator") private String creatorName; @@ -116,19 +127,38 @@ public class CasesImport implements Serializable { /** * 来电号码 */ + @ApiModelProperty(value = "来电号码") @TableField(value = "CREATOR_TEL") @Alias("eventCreatorTel") private String creatorTel; + @TableField(exist = false) private String resourceTypeName; /** * 主键 */ + @ApiModelProperty(value = "主键") @TableField(value = "ID") @Alias("id") @TableId private String id; + + /** + * 1.将其标记 + */ + @ApiModelProperty(value = "1.将其标记") + @TableField(value = "isReport") + private Integer isReport; + + /** + * 审核时间 + */ + @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 = "审核时间") + @TableField(value = "auditTime") + private Date auditTime; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/Events.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/Events.java index 61a8e1b..3c327f5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/Events.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/Events.java @@ -64,7 +64,7 @@ public class Events implements Serializable { */ @ApiModelProperty(value = "案件类型名称") @TableField(value = "scenceTypeName") - private String scenceTypename; + private String scenceTypeName; /** * 第一次预警时间 @@ -73,7 +73,7 @@ public class Events implements Serializable { @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @TableField(value = "firstWarnTime") - private Date firstWarnTimeDate; + private Date firstWarnTime; /** * 事件发生时间 @@ -82,7 +82,7 @@ public class Events implements Serializable { @TableField(value = "eventTime") @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 eventTimeDate; + private Date eventTime; /** * 预警因素 @@ -105,5 +105,43 @@ public class Events implements Serializable { @TableField(value = "state") private Integer state; + + /** + * 数量 + */ + @ApiModelProperty(value = "数量") + @TableField(value = "nums") + private Integer nums; + + /** + * 事件来源 + */ + @ApiModelProperty(value = "事件来源") + @TableField(value = "scenceName") + private String scenceName; + + + /** + * 之前的标题 + */ + @ApiModelProperty(value = "之前的标题") + @TableField(value = "titleBefore") + private String titleBefore; + + /** + * 1.重新上报驾驶舱 2.退回算法重训练 + */ + @ApiModelProperty(value = "1.重新上报驾驶舱 2.退回算法重训练") + @TableField(value = "isReport") + private Integer isReport; + + /** + * 审核时间 + */ + @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 = "审核时间") + @TableField(value = "auditTime") + private Date auditTime; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/Similar.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/Similar.java new file mode 100644 index 0000000..927bd4f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/Similar.java @@ -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; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/AEventChangeIsReport.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/AEventChangeIsReport.java new file mode 100644 index 0000000..55070c3 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/AEventChangeIsReport.java @@ -0,0 +1,43 @@ +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 javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * 事件提级或退回 + * @author du + * @since 2024/9/6 8:58 + */ +@Data +@ApiModel("事件提级或退回") +public class AEventChangeIsReport { + + /** + * 1.重新上报驾驶舱 2.退回算法重训练 + */ + @ApiModelProperty("1.重新上报驾驶舱 2.退回算法重训练") + @NotNull + private Integer isReport; + + /** + * 事件集合编号(主键) + */ + @NotNull + @ApiModelProperty("事件集合编号(主键)") + private String innerEventId; + + /** + * 工单编号数组 + */ + @NotNull + @ApiModelProperty("事件集合编号(主键)") + private List caseSerial; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/AMassEventsRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/AMassEventsRequest.java new file mode 100644 index 0000000..3229551 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/AMassEventsRequest.java @@ -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; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/ASimilarRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/ASimilarRequest.java new file mode 100644 index 0000000..2bac3ca --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/ASimilarRequest.java @@ -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; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/NoAccordWithRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/NoAccordWithRequest.java new file mode 100644 index 0000000..2d34d73 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/NoAccordWithRequest.java @@ -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 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; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/response/AInvokeResponse.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/response/AInvokeResponse.java new file mode 100644 index 0000000..634c012 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/response/AInvokeResponse.java @@ -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; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/response/ANew100PageResponse.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/response/ANew100PageResponse.java new file mode 100644 index 0000000..b5c1a09 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/response/ANew100PageResponse.java @@ -0,0 +1,36 @@ +package com.ruoyi.pt.entity.response; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.ruoyi.pt.entity.CasesImport; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author du + * @since 2024/9/6 15:46 + */ +@Data +@ApiModel("最新100条工单") +public class ANew100PageResponse extends CasesImport { + /** + * 事件集合编号(主键) + */ + @ApiModelProperty(value = "事件集合编号(主键)") + @TableField(value = "innerEventId") + private String innerEventId; + + /** + * 事件类型编码 + */ + @ApiModelProperty(value = "事件类型编码") + @TableField(value = "msgType") + private String msgType; + + + /** + * 数量 + */ + @ApiModelProperty(value = "数量") + private Integer nums; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/mapper/AEventsMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/mapper/AEventsMapper.java new file mode 100644 index 0000000..1903182 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/mapper/AEventsMapper.java @@ -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 page(Page page, @Param("req") AMassEventsRequest events); + + + /** + * 获取单个事件详细信息 + */ + Events getByInnerEventId(@Param("innerEventId") String innerEventId); + + /** + * 分页条件查询审核列表 + */ + Page auditList(Page page,@Param("caseList") List caseList); + + /** + * 查询审核列表 + */ + List auditList(@Param("caseList") List caseList); + + /** + * 查询工单详情 + */ + CasesImport getById(String id); + + /** + * 修改事件标题 + */ + int edit(@Param("req") Events events); + + /** + * 添加数据到审核表 + */ + int addAudit(Events events); + + + /** + * 根据100条最新事件查询对应工单 + */ + List new100Page(@Param("a1") List a1); + + + /** + * 取最新一条事件 + */ + Events limitOneMsg(); + + /** + * casesImport表提级或退回 + */ + int updateCasesImport(@Param("list") List 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); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/mapper/ASimilarMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/mapper/ASimilarMapper.java new file mode 100644 index 0000000..685a277 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/mapper/ASimilarMapper.java @@ -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 page(Page page, @Param("req") ASimilarRequest similarService); + + /** + * 分页条件查询相似事件数据 + * + * @param targetId 查询条件 + * @return 所有数据 + */ + List similarEventsPage(@Param("targetId") String targetId); + + /** + * 标记为不符合 + * + * @return + */ + int noAccordWith(@Param("req") NoAccordWithRequest resultId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/service/AEventsService.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/service/AEventsService.java new file mode 100644 index 0000000..d732c45 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/service/AEventsService.java @@ -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 page(Page page, AMassEventsRequest events); + + + /** + * 分页条件查询审核列表 + */ + Page auditList(Page page, String innerEventId); + + /** + * 查询工单详情 + */ + CasesImport getById(String id); + + /** + * 修改事件标题 + */ + int edit(Events events); + + + + /** + * 事件提级或退回 + * + * @return + */ + void eventChangeIsReport(AEventChangeIsReport events); + + /** + * 根据100条最新事件查询对应工单 + */ + List new100Page(); + + /** + * 查询事件详情 + */ + Events getByInnerEventId(String innerEventId); + + /** + * 取最新一条事件 + */ + Events limitOneMsg(); + + /** + * 根据查询条件查询事件待审核个数 + * + * @param events 查询条件 + * @return 所有数据 + */ + Integer eventPageCount(AMassEventsRequest events); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/service/ASimilarService.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/service/ASimilarService.java new file mode 100644 index 0000000..bbb1eb8 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/service/ASimilarService.java @@ -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 page(Page page, @Param("req") ASimilarRequest similarService); + + /** + * 分页条件查询相似事件数据 + * + * @param targetId 查询条件 + * @return 所有数据 + */ + List similarEventsPage(String targetId); + + /** + * 标记为不符合 + * + * @return + */ + int noAccordWith(NoAccordWithRequest resultId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/service/impl/AEventsServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/service/impl/AEventsServiceImpl.java new file mode 100644 index 0000000..cb45cab --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/service/impl/AEventsServiceImpl.java @@ -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 page(Page page, AMassEventsRequest events) { + return aEventsMapper.page(page, events); + } + + + /** + * 分页条件查询审核列表 + */ + @Override + public Page auditList(Page 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 new100Page() { + //查询最新100条事件 + Page page1 = new Page<>(); + page1.setCurrent(1); + page1.setSize(100); + Page page = aEventsMapper.page(page1, new AMassEventsRequest()); + Map code = new HashMap<>(); + Map numIs = new HashMap<>(); + Map inner = new HashMap<>(); + List 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 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); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/pt/service/impl/ASimilarServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/service/impl/ASimilarServiceImpl.java new file mode 100644 index 0000000..57ba682 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/service/impl/ASimilarServiceImpl.java @@ -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 page(Page page, ASimilarRequest aSimilarRequest) { + return aSimilarMapper.page(page,aSimilarRequest); + } + + /** + * 分页条件查询相似事件数据 + * + * @param targetId 查询条件 + * @return 所有数据 + */ + @Override + public List similarEventsPage( String targetId) { + return aSimilarMapper.similarEventsPage(targetId); + } + + /** + * 标记为不符合 + * + * @return + */ + @Override + public int noAccordWith(NoAccordWithRequest resultId) { + resultId.setAuditTime(DateUtil.date()); + return aSimilarMapper.noAccordWith(resultId); + } +} diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 2765810..c336c4e 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -37,7 +37,6 @@ logging: level: com.ruoyi: debug org.springframework: warn - com.ruoyi.pt.mapper: warn # 用户配置 user: @@ -54,7 +53,7 @@ spring: # 国际化资源文件路径 basename: i18n/messages profiles: - active: prod + active: test # 文件上传 servlet: multipart: @@ -66,7 +65,7 @@ spring: devtools: restart: # 热部署开关 - enabled: true + enabled: false # redis 配置 redis: # 地址 diff --git a/ruoyi-admin/src/main/resources/mapper/pt/AEventsMapper.xml b/ruoyi-admin/src/main/resources/mapper/pt/AEventsMapper.xml new file mode 100644 index 0000000..1e944c1 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/pt/AEventsMapper.xml @@ -0,0 +1,140 @@ + + + + + + + insert into audit + + innerEventId, + title, + msgType, + msgTypeName, + scenceType, + scenceTypeName, + firstWarnTime, + eventTime, + warnFactor, + relationNums, + nums, + scenceName, + state, + titleBefore, + isReport, + auditTime, + + + #{innerEventId}, + #{title}, + #{msgType}, + #{msgTypeName}, + #{scenceType}, + #{scenceTypeName}, + #{firstWarnTime}, + #{eventTime}, + #{warnFactor}, + #{relationNums}, + #{nums}, + #{scenceName}, + #{state}, + #{titleBefore}, + #{isReport}, + #{auditTime}, + + + + + + + + + + + + + + + + update events + + title = #{req.title}, + titleBefore = #{req.titleBefore}, + + where innerEventId = #{req.innerEventId} + + + update cases_import + + isReport = 1, + auditTime = #{time}, + + where CASE_SERIAL in + + #{item} + + + + update events + + isReport = #{isReport}, + auditTime = #{time}, + + where innerEventId = #{innerEventId} + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/pt/ASimilarMapper.xml b/ruoyi-admin/src/main/resources/mapper/pt/ASimilarMapper.xml new file mode 100644 index 0000000..f6b24ac --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/pt/ASimilarMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + update similar + + is_report = 1, + audit_time = #{req.auditTime}, + + where result_id in + + #{item} + + + + \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 2081747..3d13d6f 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -119,6 +119,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // .antMatchers("/pt/**").anonymous() // .antMatchers("/gateway/event/event/eventData/**").anonymous() // .antMatchers("/gateway/event/event/eventData/eventProgress/**").anonymous() + .antMatchers("/earlyWarningAudit/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated() .and()