From b14531e3b850fe6d2fa916ba7b88b3e2bd2ff30a Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 11 九月 2024 16:47:48 +0800
Subject: [PATCH] OSD加标签

---
 ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java b/ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java
index 0207ee6..5293a90 100644
--- a/ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java
+++ b/ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java
@@ -5,11 +5,16 @@
 import com.ycl.system.domain.group.Add;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.constraints.NotBlank;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.StringUtils;
 import org.springframework.validation.annotation.Validated;
 import lombok.RequiredArgsConstructor;
 
 import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 import org.springframework.validation.annotation.Validated;
 import jakarta.validation.constraints.NotEmpty;
@@ -96,7 +101,7 @@
 
     @GetMapping("/list")
     @ApiOperation(value = "鍒楄〃", notes = "鍒楄〃")
-    @PreAuthorize("@ss.hasPermi('point:list')")
+//    @PreAuthorize("@ss.hasPermi('point:list')")
     public Result list() {
         return ywPointService.all();
     }
@@ -113,10 +118,27 @@
         ywPointService.export(query, response);
     }
 
-    @PostMapping("/import/{unitId}")
+    @PostMapping("/import")
     @ApiOperation(value = "瀵煎叆鏁版嵁", notes = "瀵煎叆鏁版嵁")
-    public Result importData(MultipartFile file, @PathVariable("unitId") Integer unitId) throws IOException {
-        return ywPointService.importData(file, unitId);
+    public Result importData(MultipartFile file,
+                             Integer unitId,
+                             String startTime,
+                             Boolean needUpdateUnit,
+                             String endTime) throws IOException, ParseException {
+        Date start = null;
+        Date end = null;
+        if (-1 == unitId) {
+            unitId = null;
+        }
+        if (StringUtils.hasText(startTime)) {
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            start = format.parse(startTime);
+        }
+        if (StringUtils.hasText(startTime)) {
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            end = format.parse(endTime);
+        }
+        return ywPointService.importData(file, unitId, start, end, needUpdateUnit);
     }
 
 }

--
Gitblit v1.8.0