From b46065a201c09ce69f111806f2bda4a5f476bc4e Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 18 十月 2025 17:20:22 +0800
Subject: [PATCH] fix:用户同步,机构同步

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/SysTaskController.java |  123 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 123 insertions(+), 0 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 25cb9ec..f35b74e 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
@@ -17,6 +17,7 @@
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.system.domain.SysTask;
+import com.ruoyi.system.domain.SysTaskLog;
 import com.ruoyi.system.domain.vo.TaskQueryVO;
 import com.ruoyi.system.domain.vo.TaskCreateVO;
 import com.ruoyi.system.domain.vo.TaskUpdateVO;
@@ -45,6 +46,18 @@
     @PreAuthorize("@ss.hasPermi('task:general:query')")
     @GetMapping("/list")
     public TableDataInfo list(TaskQueryVO queryVO) {
+        // 鍦ㄥ悗绔嚜鍔ㄨ幏鍙栧綋鍓嶇敤鎴蜂俊鎭紝瀹炵幇缁煎悎鏌ヨ
+        // 缁煎悎鏌ヨ锛氬綋鍓嶇敤鎴锋墍鍦ㄦ満鏋勪换鍔� + 褰撳墠鐢ㄦ埛鍒涘缓鐨勪换鍔� + 鍒嗛厤缁欏綋鍓嶇敤鎴风殑浠诲姟
+        Long currentUserId = getUserId();
+        Long currentDeptId = getDeptId();
+        
+        // 濡傛灉鍓嶇娌℃湁浼犻�掕繖浜涘弬鏁帮紝鍒欎娇鐢ㄥ綋鍓嶇櫥褰曠敤鎴蜂俊鎭�
+        if (queryVO.getCreatorId() == null && queryVO.getAssigneeId() == null && queryVO.getDeptId() == null) {
+            queryVO.setDeptId(currentDeptId);
+            queryVO.setCreatorId(currentUserId);
+            queryVO.setAssigneeId(currentUserId);
+        }
+        
         startPage();
         List<SysTask> list = sysTaskService.selectSysTaskList(queryVO);
         return getDataTable(list);
@@ -122,6 +135,24 @@
         if (newStatus == null) {
             return error("鏃犳晥鐨勪换鍔$姸鎬�");
         }
+        
+        // 濡傛灉鍖呭惈GPS浣嶇疆淇℃伅锛屼娇鐢ㄥ甫浣嶇疆鐨勬柟娉�
+        if (request.getLatitude() != null && request.getLongitude() != null) {
+            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 toAjax(sysTaskService.changeTaskStatusWithLocation(taskId, newStatus, request.getRemark(), locationLog));
+        }
+        
         return toAjax(sysTaskService.changeTaskStatus(taskId, newStatus, request.getRemark()));
     }
 
@@ -185,6 +216,18 @@
     public static class ChangeStatusRequest {
         private String taskStatus;
         private String remark;
+        
+        // GPS浣嶇疆淇℃伅瀛楁
+        private Double latitude;
+        private Double longitude;
+        private String locationAddress;
+        private String locationProvince;
+        private String locationCity;
+        private String locationDistrict;
+        private Double gpsAccuracy;
+        private Double altitude;
+        private Double speed;
+        private Double heading;
 
         public String getTaskStatus() {
             return taskStatus;
@@ -201,5 +244,85 @@
         public void setRemark(String remark) {
             this.remark = remark;
         }
+
+        public Double getLatitude() {
+            return latitude;
+        }
+
+        public void setLatitude(Double latitude) {
+            this.latitude = latitude;
+        }
+
+        public Double getLongitude() {
+            return longitude;
+        }
+
+        public void setLongitude(Double longitude) {
+            this.longitude = longitude;
+        }
+
+        public String getLocationAddress() {
+            return locationAddress;
+        }
+
+        public void setLocationAddress(String locationAddress) {
+            this.locationAddress = locationAddress;
+        }
+
+        public String getLocationProvince() {
+            return locationProvince;
+        }
+
+        public void setLocationProvince(String locationProvince) {
+            this.locationProvince = locationProvince;
+        }
+
+        public String getLocationCity() {
+            return locationCity;
+        }
+
+        public void setLocationCity(String locationCity) {
+            this.locationCity = locationCity;
+        }
+
+        public String getLocationDistrict() {
+            return locationDistrict;
+        }
+
+        public void setLocationDistrict(String locationDistrict) {
+            this.locationDistrict = locationDistrict;
+        }
+
+        public Double getGpsAccuracy() {
+            return gpsAccuracy;
+        }
+
+        public void setGpsAccuracy(Double gpsAccuracy) {
+            this.gpsAccuracy = gpsAccuracy;
+        }
+
+        public Double getAltitude() {
+            return altitude;
+        }
+
+        public void setAltitude(Double altitude) {
+            this.altitude = altitude;
+        }
+
+        public Double getSpeed() {
+            return speed;
+        }
+
+        public void setSpeed(Double speed) {
+            this.speed = speed;
+        }
+
+        public Double getHeading() {
+            return heading;
+        }
+
+        public void setHeading(Double heading) {
+            this.heading = heading;
+        }
     }
 }

--
Gitblit v1.9.1