From c83101eb62f5d4906b9c01ceea6b21a37f9e84d8 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 18 十一月 2025 09:24:53 +0800
Subject: [PATCH] bug修复
---
ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java | 92 ++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 81 insertions(+), 11 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java b/ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java
index 092da5c..56cf329 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/ReportController.java
@@ -1,20 +1,26 @@
package com.ycl.platform.controller;
-import com.ycl.system.domain.group.Update;
-import com.ycl.system.domain.group.Add;
-import org.springframework.validation.annotation.Validated;
-import lombok.RequiredArgsConstructor;
-import java.util.List;
-import org.springframework.validation.annotation.Validated;
-import jakarta.validation.constraints.NotEmpty;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import com.ycl.platform.service.ReportService;
-import com.ycl.system.Result;
+import com.ycl.platform.domain.form.ReportAuditingForm;
import com.ycl.platform.domain.form.ReportForm;
import com.ycl.platform.domain.query.ReportQuery;
+import com.ycl.platform.domain.vo.ReportVO;
+import com.ycl.platform.service.ReportService;
+import com.ycl.system.Result;
+import com.ycl.system.domain.group.Add;
+import com.ycl.system.domain.group.Update;
+import com.ycl.utils.StringUtils;
+import com.ycl.utils.poi.ExcelUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.constraints.NotEmpty;
import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
/**
* 鎶ュ 鍓嶇鎺у埗鍣�
@@ -22,6 +28,7 @@
* @author xp
* @since 2024-03-19
*/
+@Slf4j
@Validated
@RequiredArgsConstructor
@Api(value = "鎶ュ", tags = "鎶ュ绠$悊")
@@ -33,43 +40,106 @@
@PostMapping
@ApiOperation(value = "娣诲姞", notes = "娣诲姞")
+ @PreAuthorize("@ss.hasPermi('system:report:add')")
public Result add(@RequestBody @Validated(Add.class) ReportForm form) {
return reportService.add(form);
}
+ @PostMapping("/import")
+ @ApiOperation(value = "瀵煎叆", notes = "瀵煎叆")
+ @PreAuthorize("@ss.hasPermi('system:report:add')")
+ public Result importData(ReportForm form) {
+ return reportService.importData(form);
+ }
+
+ @GetMapping("/getTogether/{pid}")
+ @ApiOperation(value = "鑾峰彇鍚屼竴鎵规鐨勬姤澶�", notes = "鑾峰彇鍚屼竴鎵规鐨勬姤澶�")
+ public Result getTogether(@PathVariable("pid") String pid) {
+ return reportService.getTogether(pid);
+ }
+
+ @PostMapping("/importTemplate")
+ @ApiOperation(value = "瀵煎叆妯℃澘", notes = "瀵煎叆妯℃澘")
+ @PreAuthorize("@ss.hasPermi('system:report:add')")
+ public void importTemplate(HttpServletResponse response) {
+ reportService.importTemplate(response);
+ }
+
@PutMapping
@ApiOperation(value = "淇敼", notes = "淇敼")
+ @PreAuthorize("@ss.hasPermi('system:report:edit')")
public Result update(@RequestBody @Validated(Update.class) ReportForm form) {
return reportService.update(form);
}
@DeleteMapping("/{id}")
@ApiOperation(value = "ID鍒犻櫎", notes = "ID鍒犻櫎")
+ @PreAuthorize("@ss.hasPermi('system:report:remove')")
public Result removeById(@PathVariable("id") String id) {
return reportService.removeById(id);
}
@DeleteMapping("/batch")
@ApiOperation(value = "鎵归噺鍒犻櫎", notes = "鎵归噺鍒犻櫎")
+ @PreAuthorize("@ss.hasPermi('system:report:remove')")
public Result remove(@RequestBody @NotEmpty(message = "璇烽�夋嫨鏁版嵁") List<String> ids) {
return reportService.remove(ids);
}
@PostMapping("/page")
@ApiOperation(value = "鍒嗛〉", notes = "鍒嗛〉")
+ @PreAuthorize("@ss.hasPermi('system:report:page')")
public Result page(@RequestBody ReportQuery query) {
return reportService.page(query);
}
@GetMapping("/{id}")
@ApiOperation(value = "璇︽儏", notes = "璇︽儏")
+ @PreAuthorize("@ss.hasPermi('system:report:query')")
public Result detail(@PathVariable("id") String id) {
return reportService.detail(id);
}
@GetMapping("/list")
@ApiOperation(value = "鍒楄〃", notes = "鍒楄〃")
+ @PreAuthorize("@ss.hasPermi('system:report:list')")
public Result list() {
return reportService.all();
}
+
+ @GetMapping("/auditing/record/{id}")
+ @ApiOperation(value = "瀹℃牳璁板綍", notes = "瀹℃牳璁板綍")
+ @PreAuthorize("@ss.hasPermi('system:report:record')")
+ public Result auditingRecord(@PathVariable("id") Integer id) {
+ return reportService.auditingRecord(id);
+ }
+
+ @PostMapping("/auditing")
+ @ApiOperation(value = "瀹℃牳", notes = "瀹℃牳")
+ @PreAuthorize("@ss.hasPermi('system:report:auditing')")
+ public Result auditing(@RequestBody @Validated ReportAuditingForm form) {
+ return reportService.auditing(form);
+ }
+
+ @PostMapping("/export")
+ @ApiOperation(value = "瀵煎嚭", notes = "瀵煎嚭")
+ @PreAuthorize("@ss.hasPermi('system:report:export')")
+ public void export(HttpServletResponse response, ReportQuery query)
+ {
+ List<ReportVO> list = reportService.export(query);
+ for (ReportVO reportVO : list){
+ if(StringUtils.isBlank(reportVO.getReportContent()) ||"null".equals(reportVO.getReportContent()) ){
+ reportVO.setReportContent("鏆傛棤");
+ }
+ }
+ ExcelUtil<ReportVO> util = new ExcelUtil<>(ReportVO.class);
+ util.exportExcel(response, list, "杩愮淮鍗曚綅");
+ }
+
+ @GetMapping("/list/{gb}")
+ @ApiOperation(value = "鏍规嵁鍥芥爣鐮佹煡鎶ュ", notes = "鏍规嵁鍥芥爣鐮佹煡鎶ュ")
+ public Result getListByGb(@PathVariable("gb") String gb)
+ {
+ return reportService.getListByGb(gb);
+ }
}
--
Gitblit v1.8.0