From 2f09efc660bf2cc94cbc5291ad25ca06fc9bdadf Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 24 一月 2026 22:03:09 +0800
Subject: [PATCH] feat: 增加OCR测试,车辆

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskController.java |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskController.java
index 09db629..56ad818 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskController.java
@@ -184,10 +184,9 @@
     @Log(title = "浠诲姟绠$悊", businessType = BusinessType.INSERT)
     @PostMapping("/admin")
     public AjaxResult adminAdd(@RequestBody TaskCreateVO createVO) {
-        return toAjax(sysTaskService.insertSysTask(createVO));
+        Long taskId = sysTaskService.insertSysTask(createVO);
+        return taskId > 0 ? AjaxResult.success("鏂板鎴愬姛").put("taskId", taskId) : AjaxResult.error("鏂板澶辫触");
     }
-
-
 
     /**
      * 鏂板浠诲姟锛圓PP绔級
@@ -195,7 +194,8 @@
     @Log(title = "浠诲姟鍒涘缓", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult appAdd(@RequestBody TaskCreateVO createVO) {
-        return toAjax(sysTaskService.insertSysTask(createVO));
+        Long taskId = sysTaskService.insertSysTask(createVO);
+        return taskId > 0 ? AjaxResult.success("鏂板鎴愬姛").put("taskId", taskId) : AjaxResult.error("鏂板澶辫触");
     }
     
     /**
@@ -331,17 +331,7 @@
         if (request.getLatitude() != null && request.getLongitude() != null) {
            String address= mapService.reverseGeocoding(request.getLongitude(), request.getLatitude());
            request.setLocationAddress(address);
-            SysTaskLog locationLog = new SysTaskLog();
-            locationLog.setLatitude(request.getLatitude());
-            locationLog.setLongitude(request.getLongitude());
-            locationLog.setLocationAddress(request.getLocationAddress());
-            locationLog.setLocationProvince(request.getLocationProvince());
-            locationLog.setLocationCity(request.getLocationCity());
-            locationLog.setLocationDistrict(request.getLocationDistrict());
-            locationLog.setGpsAccuracy(request.getGpsAccuracy());
-            locationLog.setAltitude(request.getAltitude());
-            locationLog.setSpeed(request.getSpeed());
-            locationLog.setHeading(request.getHeading());
+            SysTaskLog locationLog = getLocationLog(request);
 
             return toAjax(sysTaskService.changeTaskStatusWithLocation(taskId, newStatus, request.getRemark(), locationLog));
         }
@@ -349,6 +339,21 @@
         return toAjax(sysTaskService.changeTaskStatus(taskId, newStatus, request.getRemark()));
     }
 
+    private static SysTaskLog getLocationLog(ChangeStatusRequest request) {
+        SysTaskLog locationLog = new SysTaskLog();
+        locationLog.setLatitude(request.getLatitude());
+        locationLog.setLongitude(request.getLongitude());
+        locationLog.setLocationAddress(request.getLocationAddress());
+        locationLog.setLocationProvince(request.getLocationProvince());
+        locationLog.setLocationCity(request.getLocationCity());
+        locationLog.setLocationDistrict(request.getLocationDistrict());
+        locationLog.setGpsAccuracy(request.getGpsAccuracy());
+        locationLog.setAltitude(request.getAltitude());
+        locationLog.setSpeed(request.getSpeed());
+        locationLog.setHeading(request.getHeading());
+        return locationLog;
+    }
+
     /**
      * 鏌ヨ浠诲姟缁熻淇℃伅锛圓PP绔級
      */

--
Gitblit v1.9.1