From fd58eac9c45b19300135d84b1d22013466807a96 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期日, 20 九月 2026 13:52:51 +0800
Subject: [PATCH] feat(inspect): 完善检验报告功能与数据处理 - 添加重新生成报告的功能接口 - 优化管理员权限判断逻辑,允许管理员查看全部待复核任务 - 改进Excel数据解析逻辑,支持合并单元格的坐标计算 - 完善直绑模板订单的检验结果处理机制 - 优化报告下载接口,支持按报告类型选择 - 提升附件上传大小限制至200MB
---
inspect-server/src/main/java/com/ruoyi/inspect/controller/InsReportController.java | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsReportController.java b/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsReportController.java
index 8ea68ab..06a045e 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsReportController.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/controller/InsReportController.java
@@ -4,13 +4,18 @@
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto;
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.annotation.PersonalScope;
import com.ruoyi.common.core.domain.Result;
import com.ruoyi.framework.exception.ErrorException;
import com.ruoyi.inspect.dto.ReportPageDto;
+import com.ruoyi.inspect.service.InsOrderPlanService;
import com.ruoyi.inspect.service.InsReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -34,11 +39,16 @@
@Resource
private InsReportService insReportService;
+ @Resource
+ private InsOrderPlanService insOrderPlanService;
+
@Value("${wordUrl}")
private String wordUrl;
@ApiOperation(value = "鏌ヨ妫�楠屾姤鍛婃暟鎹�")
@GetMapping("/pageInsReport")
+ @PreAuthorize("@ss.hasPermi('business:reportPreparation')")
+ @PersonalScope(permsName = "business:reportPreparation", objectName = ReportPageDto.class, paramName = "createOrderUser")
public Result pageInsReport(Page page, ReportPageDto reportPageDto){
return Result.success(insReportService.pageInsReport(page, reportPageDto));
}
@@ -108,6 +118,7 @@
return Result.success(insReportService.ratifyReport(id, isRatify, ratifyTell));
}
+ @Anonymous
@RequestMapping("/onlyOffice/save")
public void saveFile(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
PrintWriter writer = null;
@@ -143,6 +154,23 @@
return Result.success(insReportService.downAll(ids));
}
+ @ApiOperation(value = "鎶ュ憡涓嬭浇锛坮eportType锛�0妫�娴嬫姤鍛婏紝1妫�楠屾姤鍛婏級")
+ @GetMapping("/download")
+ @PreAuthorize("@ss.hasPermi('business:reportPreparation')")
+ @PersonalScope(permsName = "business:reportPreparation", objectName = ReportPageDto.class, paramName = "createOrderUser")
+ public void download(Integer id, Integer reportType, ReportPageDto reportPageDto, HttpServletResponse response) {
+ insReportService.download(id, reportType, reportPageDto.getCreateOrderUser(), response);
+ }
+
+ @ApiOperation(value = "閲嶆柊鐢熸垚鎶ュ憡")
+ @PostMapping("/regenerate")
+// @PreAuthorize("@ss.hasPermi('business:reportPreparation')")
+ @PersonalScope(permsName = "business:reportPreparation", objectName = ReportPageDto.class, paramName = "createOrderUser")
+ public Result regenerate(@RequestBody ReportPageDto reportPageDto) {
+ insOrderPlanService.regenerateReport(reportPageDto.getId(), reportPageDto.getCreateOrderUser());
+ return Result.success();
+ }
+
@ApiOperation(value = "鎶ュ憡鎵归噺涓婁紶")
@PostMapping("/upAll")
public Result upAll(MultipartFile file) throws IOException {
@@ -160,4 +188,18 @@
Integer id = (Integer) param.get("id");
return Result.success(insReportService.sendBackTask(id));
}
+
+ /**
+ * 鎶ュ憡瀵煎嚭
+ * @param dto
+ * @param response
+ * @throws Exception
+ */
+ @ApiOperation(value = "鎶ュ憡瀵煎嚭")
+ @GetMapping("/reportAllExport")
+ @PreAuthorize("@ss.hasPermi('business:reportPreparation')")
+ @PersonalScope(permsName = "business:reportPreparation", objectName = ReportPageDto.class, paramName = "createOrderUser")
+ public void reportAllExport(ReportPageDto dto, HttpServletResponse response) throws Exception {
+ insReportService.reportAllExport(dto,response);
+ }
}
--
Gitblit v1.9.3