From 3e9a6da99aae968123ee7bca352fc08becd7f1f2 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 29 八月 2024 17:29:21 +0800
Subject: [PATCH] 工单过程图接口更换

---
 ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 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 b85ddb5..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
@@ -7,10 +7,13 @@
 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;
@@ -115,15 +118,26 @@
         ywPointService.export(query, response);
     }
 
-    @PostMapping("/import/{unitId}")
+    @PostMapping("/import")
     @ApiOperation(value = "瀵煎叆鏁版嵁", notes = "瀵煎叆鏁版嵁")
     public Result importData(MultipartFile file,
-                             @PathVariable("unitId") Integer unitId,
-                             @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
-                             @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,
-                             Boolean provinceTag,
-                             Boolean importantCommandImageTag) throws IOException {
-        return ywPointService.importData(file, unitId, startTime, endTime, provinceTag, importantCommandImageTag);
+                             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