From 79784b1e2a1311d505afb181d7bc274afbcaec4a Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Thu, 4 Dec 2025 10:59:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/RectFeedbackController.java | 19 +++++++ .../system/domain/RectificationDto.java | 9 ++- .../system/mapper/RectFeedbackMapper.java | 6 ++ .../system/mapper/RectFeedbackMapper.xml | 20 ++++++- .../system/service/RectFeedbackService.java | 5 ++ .../service/impl/RectFeedbackServiceImpl.java | 56 ++++++++++++++++++- 6 files changed, 109 insertions(+), 6 deletions(-) diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RectFeedbackController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RectFeedbackController.java index fbd0f1a..2668865 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/RectFeedbackController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/RectFeedbackController.java @@ -15,6 +15,7 @@ import org.springblade.system.domain.ProjectDto; import org.springblade.system.domain.RectificationDto; import org.springblade.system.service.RectFeedbackService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -65,4 +66,22 @@ public class RectFeedbackController extends BaseController { return new AjaxResult(500, "请求出错了"); } } + @PostMapping("rectify") + @SysLog(title = "整改提交", module = "数据档案移交->整改反馈", businessType = OperaType.INSERT, details = "整改提交", logType = 1) + @RequiresPermissions("rectify:feedback:rectify") + public AjaxResult rectify(@RequestBody @Validated RectificationDto dto) { + return service.rectify(dto); + } + @PostMapping("rectifyPass") + @SysLog(title = "整改通过", module = "数据档案移交->整改反馈", businessType = OperaType.INSERT, details = "整改通过", logType = 1) + @RequiresPermissions("rectify:feedback:rectify") + public AjaxResult rectifyPass(@RequestBody RectificationDto dto) { + return service.rectifyPass(dto); + } + @PostMapping("rectifyRefuse") + @SysLog(title = "整改驳回", module = "数据档案移交->整改反馈", businessType = OperaType.INSERT, details = "整改驳回", logType = 1) + @RequiresPermissions("rectify:feedback:rectify") + public AjaxResult rectifyRefuse(@RequestBody @Validated RectificationDto dto) { + return service.rectifyRefuse(dto); + } } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/domain/RectificationDto.java b/blade-service/blade-system/src/main/java/org/springblade/system/domain/RectificationDto.java index ce2c68c..b4cf3d5 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/domain/RectificationDto.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/domain/RectificationDto.java @@ -5,6 +5,8 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import org.springblade.common.core.page.PageDomain; +import java.util.List; + /** * @Author:liang.chao * @Date:2025/12/2 - 13:41 @@ -12,11 +14,12 @@ import org.springblade.common.core.page.PageDomain; @Data public class RectificationDto extends PageDomain { private String id; + private String name; private String[] ids; private String fileId; private String proId; - @NotBlank(message = "整改描述不能为空") - @Length(max = 64, message = "整改描述不能超过64个字符") + @NotBlank(message = "描述不能为空") + @Length(max = 64, message = "描述不能超过64个字符") private String description; private String proName; private String singleProName; @@ -42,4 +45,6 @@ public class RectificationDto extends PageDomain { // 下发人电话 private String issuerPhone; + private List rectificationDtos; + } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RectFeedbackMapper.java b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RectFeedbackMapper.java index ffdcbf7..c295e75 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RectFeedbackMapper.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RectFeedbackMapper.java @@ -12,4 +12,10 @@ public interface RectFeedbackMapper { List list(RectificationDto projectDto); RectificationDto detail(RectificationDto dto); + + Integer rectify(RectificationDto dto); + + Integer saveRecord(RectificationDto dto); + + List getRecordDetails(RectificationDto detail); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RectFeedbackMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RectFeedbackMapper.xml index 655fae9..069d8f8 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RectFeedbackMapper.xml +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/RectFeedbackMapper.xml @@ -3,6 +3,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + INSERT INTO record_rectification(rectification_id, description,create_user_id,create_time) + VALUES (#{id}, #{description},#{createUserId},NOW()) + + + UPDATE record_rectification_list + SET rectify_status = #{rectifyStatus} + WHERE id = #{id} + + diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/RectFeedbackService.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/RectFeedbackService.java index ff7b8f9..3818324 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/RectFeedbackService.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/RectFeedbackService.java @@ -1,5 +1,6 @@ package org.springblade.system.service; +import org.springblade.common.core.domain.AjaxResult; import org.springblade.system.domain.RectificationDto; import java.util.List; @@ -12,4 +13,8 @@ public interface RectFeedbackService { List list(RectificationDto dto); RectificationDto detail(RectificationDto dto); + + AjaxResult rectify(RectificationDto dto); + AjaxResult rectifyPass(RectificationDto dto); + AjaxResult rectifyRefuse(RectificationDto dto); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RectFeedbackServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RectFeedbackServiceImpl.java index 57aa1cd..effafc9 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RectFeedbackServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RectFeedbackServiceImpl.java @@ -1,11 +1,13 @@ package org.springblade.system.service.impl; import jakarta.annotation.Resource; +import org.springblade.common.core.domain.AjaxResult; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.system.domain.RectificationDto; import org.springblade.system.mapper.RectFeedbackMapper; import org.springblade.system.service.RectFeedbackService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -17,6 +19,7 @@ import java.util.List; public class RectFeedbackServiceImpl implements RectFeedbackService { @Resource private RectFeedbackMapper rectFeedbackMapper; + @Override public List list(RectificationDto dto) { return rectFeedbackMapper.list(dto); @@ -24,6 +27,55 @@ public class RectFeedbackServiceImpl implements RectFeedbackService { @Override public RectificationDto detail(RectificationDto dto) { - return rectFeedbackMapper.detail(dto); + RectificationDto detail = rectFeedbackMapper.detail(dto); + List recordDetails = rectFeedbackMapper.getRecordDetails(detail); + detail.setRectificationDtos(recordDetails); + return detail; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult rectify(RectificationDto dto) { + try { + // 整改完后变成待审核 + dto.setRectifyStatus("3"); + dto.setCreateUserId(AuthUtil.getUserId()); + Integer result = rectFeedbackMapper.rectify(dto); + rectFeedbackMapper.saveRecord(dto); + return result > 0 ? AjaxResult.success("整改成功") : AjaxResult.error("整改失败"); + } catch (Exception e) { + return AjaxResult.error("请求出错了"); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult rectifyPass(RectificationDto dto) { + try { + // 整改完后变成通过 + dto.setRectifyStatus("1"); + dto.setCreateUserId(AuthUtil.getUserId()); + dto.setDescription("通过"); + Integer result = rectFeedbackMapper.rectify(dto); + rectFeedbackMapper.saveRecord(dto); + return result > 0 ? AjaxResult.success("整改通过") : AjaxResult.error("通过失败"); + } catch (Exception e) { + return AjaxResult.error("请求出错了"); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult rectifyRefuse(RectificationDto dto) { + try { + // 整改完后变成驳回 + dto.setRectifyStatus("2"); + dto.setCreateUserId(AuthUtil.getUserId()); + Integer result = rectFeedbackMapper.rectify(dto); + rectFeedbackMapper.saveRecord(dto); + return result > 0 ? AjaxResult.success("整改通过") : AjaxResult.error("通过失败"); + } catch (Exception e) { + return AjaxResult.error("请求出错了"); + } } }