From f6ae2afd3242fdfacba5b7c684ba0077d29edf00 Mon Sep 17 00:00:00 2001 From: du <1725534722@qq.com> Date: Wed, 25 Sep 2024 17:23:39 +0800 Subject: [PATCH] bugfix --- .../pt/controller/AEventsController.java | 26 ++++++++--------- .../pt/entity/dto/AEventChangeIsReport.java | 28 ++++++++++++++++--- .../pt/entity/dto/AMassEventsRequest.java | 2 +- .../com/ruoyi/pt/mapper/AEventsMapper.java | 5 ++-- .../pt/service/impl/AEventsServiceImpl.java | 9 ++++-- .../resources/mapper/pt/AEventsMapper.xml | 9 ++++-- 6 files changed, 52 insertions(+), 27 deletions(-) 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 index f42a399..70f81b7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/controller/AEventsController.java @@ -101,16 +101,16 @@ public class AEventsController extends BaseController { return success(aEventsService.fiveEventCount()); } - /** - * 修改事件标题 - */ - @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)); - } +// /** +// * 修改事件标题 +// */ +// @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查询事件详情 @@ -145,9 +145,9 @@ public class AEventsController extends BaseController { @ApiOperation(value = "事件提级或退回") @PostMapping("/eventChangeIsReport") public AjaxResult eventChangeIsReport(@RequestBody @Valid AEventChangeIsReport events) { - if(events.getCaseSerial().isEmpty()){ - throw new ServiceException("请选择工单上报!"); - } +// if(events.getCaseSerial().isEmpty()){ +// throw new ServiceException("请选择工单上报!"); +// } aEventsService.eventChangeIsReport(events); return success(); } 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 index 55070c3..d36abca 100644 --- 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 @@ -1,5 +1,6 @@ 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; @@ -20,9 +21,9 @@ import java.util.List; public class AEventChangeIsReport { /** - * 1.重新上报驾驶舱 2.退回算法重训练 + * 1.重新上报驾驶舱 2.退回算法重训练 3.审核通过 */ - @ApiModelProperty("1.重新上报驾驶舱 2.退回算法重训练") + @ApiModelProperty("1.重新上报驾驶舱 2.退回算法重训练 3.审核通过") @NotNull private Integer isReport; @@ -36,8 +37,27 @@ public class AEventChangeIsReport { /** * 工单编号数组 */ - @NotNull - @ApiModelProperty("事件集合编号(主键)") + @ApiModelProperty("工单编号数组") private List caseSerial; + + /** + * 新的事件标题 + */ + @ApiModelProperty("新的事件标题") + private String newTitle; + + /** + * 旧的事件标题 + */ + @ApiModelProperty("旧的事件标题") + private String oldTitle; + + /** + * 审核时间 + */ + @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/AMassEventsRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/pt/entity/dto/AMassEventsRequest.java index fc06818..0db673d 100644 --- 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 @@ -56,6 +56,6 @@ public class AMassEventsRequest implements Serializable { /** * 1.重新上报驾驶舱 2.退回算法重训练 */ - @ApiModelProperty(value = "1.重新上报驾驶舱 2.退回算法重训练 4.待审核 5.已审核") + @ApiModelProperty(value = "1.重新上报驾驶舱 2.退回算法重训练 3.审核通过 4.待审核 5.已审核") private Integer isReport; } 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 index 6ac9c43..3854972 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/pt/mapper/AEventsMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/pt/mapper/AEventsMapper.java @@ -3,6 +3,7 @@ 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.AEventChangeIsReport; import com.ruoyi.pt.entity.dto.AMassEventsRequest; import com.ruoyi.pt.entity.response.ANew100PageResponse; import com.ruoyi.pt.entity.response.FiveEventCountResponse; @@ -74,9 +75,7 @@ public interface AEventsMapper { /** * event表提级或退回 */ - int updateEvent(@Param("innerEventId") String innerEventId, - @Param("isReport") Integer isReport, - @Param("time") String now); + int updateEvent(@Param("req") AEventChangeIsReport a); /** * 根据查询条件查询事件待审核个数 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 index bc6215c..4324c20 100644 --- 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 @@ -88,9 +88,12 @@ public class AEventsServiceImpl implements AEventsService { @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); + events.setAuditTime(DateUtil.date()); + //如果工单编号数组不为0,则将其所有工单进行标记 + if(events.getCaseSerial() != null && !events.getCaseSerial().isEmpty()){ + aEventsMapper.updateCasesImport(events.getCaseSerial(), DateUtil.now()); + } + aEventsMapper.updateEvent(events); if (events.getIsReport() == 1) { Events a1 = aEventsMapper.getByInnerEventId(events.getInnerEventId()); StringBuilder sb = new StringBuilder().append("["); diff --git a/ruoyi-admin/src/main/resources/mapper/pt/AEventsMapper.xml b/ruoyi-admin/src/main/resources/mapper/pt/AEventsMapper.xml index 6fd3dc2..f828a60 100644 --- a/ruoyi-admin/src/main/resources/mapper/pt/AEventsMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/pt/AEventsMapper.xml @@ -14,6 +14,7 @@ and a.isReport is not null and a.isReport = #{req.isReport} and a.isReport = #{req.isReport} + and a.isReport = #{req.isReport} order by a.eventTime desc @@ -131,9 +132,11 @@ update events - isReport = #{isReport}, - auditTime = #{time}, + isReport = #{req.isReport}, + auditTime = #{req.auditTime}, + title = #{req.newTitle}, + titleBefore = #{req.oldTitle}, - where innerEventId = #{innerEventId} + where innerEventId = #{req.innerEventId} \ No newline at end of file