From 3059430a0db3f75426e435c06090358646fc3792 Mon Sep 17 00:00:00 2001 From: Fixiaobai <fixiaobai@163.com> Date: 星期四, 09 十一月 2023 09:11:17 +0800 Subject: [PATCH] Changes11 --- mes-technology/src/main/java/com/chinaztt/mes/technology/controller/StructureController.java | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/mes-technology/src/main/java/com/chinaztt/mes/technology/controller/StructureController.java b/mes-technology/src/main/java/com/chinaztt/mes/technology/controller/StructureController.java index 1cb0c7a..cace20d 100644 --- a/mes-technology/src/main/java/com/chinaztt/mes/technology/controller/StructureController.java +++ b/mes-technology/src/main/java/com/chinaztt/mes/technology/controller/StructureController.java @@ -32,9 +32,11 @@ import com.chinaztt.ztt.admin.api.feign.RemoteDictService; import com.chinaztt.ztt.common.core.util.R; import com.chinaztt.ztt.common.log.annotation.SysLog; +import com.chinaztt.ztt.common.security.util.SecurityUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -60,6 +62,8 @@ private final StructureService structureService; private final DictUtils dictUtils; + private RedisTemplate redisTemplate; + /** * 妯潃瀵煎叆鐨勫鍏ユ柟寮� * @@ -68,6 +72,10 @@ */ @PostMapping("/uploadExt") public R uploadExt(@RequestParam("file") MultipartFile file) { + String key = "syncStructure_lock" + SecurityUtils.getUser().getId(); + if (redisTemplate.hasKey(key)) { + throw new RuntimeException("鏈夊鍏ヤ换鍔℃鍦ㄥ鐞�"); + } ExcelReader excelReader = null; try { excelReader = EasyExcel.read(file.getInputStream(), StructureData.class, new StructureUploadListener(structureService)).build(); -- Gitblit v1.9.3