From b890afe0d93b9856bcfe6829ec51a69e232ce0d7 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期六, 31 八月 2024 18:01:27 +0800
Subject: [PATCH] 图像安全资源管理整合,车辆抓拍数据完整和准确计算公式修改

---
 ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 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 1260ea4..238f2f6 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
@@ -3,10 +3,18 @@
 import com.ycl.platform.domain.form.BatchEditPointForm;
 import com.ycl.system.domain.group.Update;
 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;
@@ -18,6 +26,7 @@
 import com.ycl.platform.domain.query.YwPointQuery;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 杩愮淮鐐逛綅 鍓嶇鎺у埗鍣�
@@ -102,4 +111,33 @@
     public Result select(@NotBlank(message = "璇疯緭鍏ョ偣浣�") String keyword) {
         return ywPointService.select(keyword);
     }
+
+    @GetMapping("/export")
+    @ApiOperation(value = "瀵煎嚭鏁版嵁", notes = "瀵煎嚭鏁版嵁")
+    public void export(YwPointQuery query, HttpServletResponse response) throws IOException {
+        ywPointService.export(query, response);
+    }
+
+    @PostMapping("/import")
+    @ApiOperation(value = "瀵煎叆鏁版嵁", notes = "瀵煎叆鏁版嵁")
+    public Result importData(MultipartFile file,
+                             Integer unitId,
+                             String startTime,
+                             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);
+    }
+
 }

--
Gitblit v1.8.0