Переглянути джерело

【CHG】增加导出报废工具接口

ZhaoMn 3 роки тому
батько
коміт
b2ecbe9e77

+ 11 - 2
railway-admin/src/main/java/com/railway/web/controller/business/safetool/BaseSafetyToolController.java

@@ -14,7 +14,6 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import java.util.List;
 import javax.validation.Valid;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -113,7 +112,6 @@ public class BaseSafetyToolController extends BaseController {
 
   @ApiOperation(value = "导出安全工具台账")
   @Log(title = "安全工具台账", businessType = BusinessType.EXPORT)
-  @PreAuthorize("@ss.hasPermi('system:dict:export')")
   @GetMapping("/export")
   public AjaxResult export(BaseSafetyTool safetyTool) {
     List<BaseSafetyTool> list = baseSafetyToolService.getList(safetyTool);
@@ -122,4 +120,15 @@ public class BaseSafetyToolController extends BaseController {
     return sysFileService.uploadFile(localFilePath);
   }
 
+  @ApiOperation(value = "导出报废安全工具台账")
+  @Log(title = "导出报废安全工具台账", businessType = BusinessType.EXPORT)
+  @GetMapping("/exportScrap")
+  public AjaxResult exportScrap(BaseSafetyTool safetyTool) {
+    safetyTool.setState(ToolStateEnum.SCRAP.getCode());
+    List<BaseSafetyTool> list = baseSafetyToolService.getList(safetyTool);
+    ExcelUtil<BaseSafetyTool> util = new ExcelUtil<>(BaseSafetyTool.class);
+    String localFilePath = util.exportExcel(list, "安全工具台账");
+    return sysFileService.uploadFile(localFilePath);
+  }
+
 }