From 6a48d04a36bc459ed761d787ee3d537652185d36 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期二, 27 十月 2026 15:06:50 +0800
Subject: [PATCH] refactor(permission): 清理新高电力查询菜单及权限注解
---
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/emergencyplan/MesProEmergencyPlanController.java | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/emergencyplan/MesProEmergencyPlanController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/emergencyplan/MesProEmergencyPlanController.java
index 8dc7394..ac26a72 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/emergencyplan/MesProEmergencyPlanController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/emergencyplan/MesProEmergencyPlanController.java
@@ -4,6 +4,9 @@
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.mes.controller.admin.pro.emergencyplan.vo.MesProEmergencyPlanImportExcelVO;
+import cn.iocoder.yudao.module.mes.controller.admin.pro.emergencyplan.vo.MesProEmergencyPlanImportRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.pro.emergencyplan.vo.MesProEmergencyPlanPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.pro.emergencyplan.vo.MesProEmergencyPlanRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.pro.emergencyplan.vo.MesProEmergencyPlanSaveReqVO;
@@ -11,13 +14,18 @@
import cn.iocoder.yudao.module.mes.service.pro.emergencyplan.MesProEmergencyPlanService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import java.io.IOException;
+import java.util.Collections;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@@ -58,7 +66,6 @@
@GetMapping("/get")
@Operation(summary = "鑾峰緱搴旀�ュ缃妗�")
@Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
- @PreAuthorize("@ss.hasPermission('mes:pro-emergency-plan:query')")
public CommonResult<MesProEmergencyPlanRespVO> getPlan(@RequestParam("id") Long id) {
MesProEmergencyPlanDO plan = planService.getPlan(id);
return success(plan != null ? BeanUtils.toBean(plan, MesProEmergencyPlanRespVO.class) : null);
@@ -66,7 +73,6 @@
@GetMapping("/page")
@Operation(summary = "鑾峰緱搴旀�ュ缃妗堝垎椤�")
- @PreAuthorize("@ss.hasPermission('mes:pro-emergency-plan:query')")
public CommonResult<PageResult<MesProEmergencyPlanRespVO>> getPlanPage(@Valid MesProEmergencyPlanPageReqVO pageReqVO) {
PageResult<MesProEmergencyPlanDO> pageResult = planService.getPlanPage(pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
@@ -84,4 +90,29 @@
return success(true);
}
+ @GetMapping("/get-import-template")
+ @Operation(summary = "鑾峰緱搴旀�ュ缃妗堝鍏ユā鏉�")
+ public void importTemplate(HttpServletResponse response) throws IOException {
+ List<MesProEmergencyPlanImportExcelVO> list = Collections.singletonList(
+ MesProEmergencyPlanImportExcelVO.builder()
+ .name("鍙樼數绔欏仠鐢靛缃妗�").planType(1).content("1. 绔嬪嵆闅旂鏁呴殰...")
+ .orgUnit("杩愮淮閮�").remark("").build()
+ );
+ ExcelUtils.write(response, "搴旀�ュ缃妗堝鍏ユā鏉�.xls", "搴旀�ュ缃妗堝垪琛�", MesProEmergencyPlanImportExcelVO.class, list);
+ }
+
+ @PostMapping("/import")
+ @Operation(summary = "瀵煎叆搴旀�ュ缃妗�")
+ @Parameters({
+ @Parameter(name = "file", description = "Excel 鏂囦欢", required = true),
+ @Parameter(name = "updateSupport", description = "鏄惁鏀寔鏇存柊锛岄粯璁や负 false", example = "true")
+ })
+ @PreAuthorize("@ss.hasPermission('mes:pro-emergency-plan:import')")
+ public CommonResult<MesProEmergencyPlanImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
+ @RequestParam(value = "updateSupport", required = false,
+ defaultValue = "false") Boolean updateSupport) throws Exception {
+ List<MesProEmergencyPlanImportExcelVO> list = ExcelUtils.read(file, MesProEmergencyPlanImportExcelVO.class);
+ return success(planService.importPlanList(list, updateSupport));
+ }
+
}
--
Gitblit v1.9.3