From c9db22f6ccb6a6d66e38dec09807e88b160f29e8 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期三, 15 十一月 2023 11:20:50 +0800 Subject: [PATCH] 销售订单-修改2 --- 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