From 364adbc9a93a396b74e154f910c2a0a72bfb1a0f Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 29 十一月 2025 22:10:41 +0800
Subject: [PATCH] feat: 更新车辆里程统计
---
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java | 327 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 317 insertions(+), 10 deletions(-)
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java
index b939e42..ccff010 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java
@@ -36,7 +36,9 @@
import com.ruoyi.system.domain.VehicleInfo;
import com.ruoyi.system.service.ISysTaskService;
import com.ruoyi.system.service.ILegacySystemSyncService;
+import com.ruoyi.system.service.ISysTaskEmergencyService;
import com.ruoyi.system.service.ITaskAttachmentSyncService;
+import com.ruoyi.system.service.IMapService;
import com.ruoyi.system.event.TaskCreatedEvent;
import com.ruoyi.system.event.TaskAssignedEvent;
import com.ruoyi.system.event.TaskStatusChangedEvent;
@@ -84,6 +86,9 @@
private ILegacySystemSyncService legacySystemSyncService;
@Autowired
+ private ISysTaskEmergencyService sysTaskEmergencyService;
+
+ @Autowired
private ApplicationEventPublisher eventPublisher;
@Autowired
@@ -94,6 +99,9 @@
@Autowired
private SysUserMapper sysUserMapper;
+
+ @Autowired(required = false)
+ private IMapService mapService;
/**
* 鏌ヨ浠诲姟绠$悊
@@ -202,6 +210,44 @@
// 璁剧疆绂忕杞﹀叕閲屾暟
if (createVO.getDistance() != null) {
task.setEstimatedDistance(createVO.getDistance());
+ }
+
+ // 鑷姩鑾峰彇鍑哄彂鍦癎PS鍧愭爣锛堝鏋滅己澶憋級
+ if (task.getDepartureAddress() != null &&
+ (task.getDepartureLongitude() == null || task.getDepartureLatitude() == null) &&
+ mapService != null) {
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ task.getDepartureAddress(),
+ extractCityFromAddress(task.getDepartureAddress())
+ );
+ if (coords != null) {
+ task.setDepartureLongitude(BigDecimal.valueOf(coords.get("lng")));
+ task.setDepartureLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("鍑哄彂鍦癎PS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇鍑哄彂鍦癎PS鍧愭爣澶辫触", e);
+ }
+ }
+
+ // 鑷姩鑾峰彇鐩殑鍦癎PS鍧愭爣锛堝鏋滅己澶憋級
+ if (task.getDestinationAddress() != null &&
+ (task.getDestinationLongitude() == null || task.getDestinationLatitude() == null) &&
+ mapService != null) {
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ task.getDestinationAddress(),
+ extractCityFromAddress(task.getDestinationAddress())
+ );
+ if (coords != null) {
+ task.setDestinationLongitude(BigDecimal.valueOf(coords.get("lng")));
+ task.setDestinationLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("鐩殑鍦癎PS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇鐩殑鍦癎PS鍧愭爣澶辫触", e);
+ }
}
int result = sysTaskMapper.insertSysTask(task);
@@ -379,6 +425,44 @@
task.setEstimatedDistance(createVO.getDistance());
}
+ // 鑷姩鑾峰彇鍑哄彂鍦癎PS鍧愭爣锛堝鏋滅己澶憋級
+ if (task.getDepartureAddress() != null &&
+ (task.getDepartureLongitude() == null || task.getDepartureLatitude() == null) &&
+ mapService != null) {
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ task.getDepartureAddress(),
+ extractCityFromAddress(task.getDepartureAddress())
+ );
+ if (coords != null) {
+ task.setDepartureLongitude(BigDecimal.valueOf(coords.get("lng")));
+ task.setDepartureLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("鍑哄彂鍦癎PS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇鍑哄彂鍦癎PS鍧愭爣澶辫触", e);
+ }
+ }
+
+ // 鑷姩鑾峰彇鐩殑鍦癎PS鍧愭爣锛堝鏋滅己澶憋級
+ if (task.getDestinationAddress() != null &&
+ (task.getDestinationLongitude() == null || task.getDestinationLatitude() == null) &&
+ mapService != null) {
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ task.getDestinationAddress(),
+ extractCityFromAddress(task.getDestinationAddress())
+ );
+ if (coords != null) {
+ task.setDestinationLongitude(BigDecimal.valueOf(coords.get("lng")));
+ task.setDestinationLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("鐩殑鍦癎PS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇鐩殑鍦癎PS鍧愭爣澶辫触", e);
+ }
+ }
+
int result = sysTaskMapper.insertSysTask(task);
// 淇濆瓨杞﹁締鍏宠仈淇℃伅
@@ -394,7 +478,7 @@
taskVehicle.setCreateTime(createTime);
taskVehicle.setUpdateBy(userName);
taskVehicle.setUpdateTime(updateTime);
-
+
sysTaskVehicleMapper.insertSysTaskVehicle(taskVehicle);
}
}
@@ -492,10 +576,51 @@
task.setDeptId(updateVO.getDeptId());
}
+ // 鑷姩鑾峰彇鍑哄彂鍦癎PS鍧愭爣锛堝鏋滄洿鏂颁簡鍦板潃浣嗙己澶卞潗鏍囷級
+ if (updateVO.getDepartureAddress() != null &&
+ (updateVO.getDepartureLongitude() == null || updateVO.getDepartureLatitude() == null) &&
+ mapService != null) {
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ updateVO.getDepartureAddress(),
+ extractCityFromAddress(updateVO.getDepartureAddress())
+ );
+ if (coords != null) {
+ task.setDepartureLongitude(BigDecimal.valueOf(coords.get("lng")));
+ task.setDepartureLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("鍑哄彂鍦癎PS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇鍑哄彂鍦癎PS鍧愭爣澶辫触", e);
+ }
+ }
+
+ // 鑷姩鑾峰彇鐩殑鍦癎PS鍧愭爣锛堝鏋滄洿鏂颁簡鍦板潃浣嗙己澶卞潗鏍囷級
+ if (updateVO.getDestinationAddress() != null &&
+ (updateVO.getDestinationLongitude() == null || updateVO.getDestinationLatitude() == null) &&
+ mapService != null) {
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ updateVO.getDestinationAddress(),
+ extractCityFromAddress(updateVO.getDestinationAddress())
+ );
+ if (coords != null) {
+ task.setDestinationLongitude(BigDecimal.valueOf(coords.get("lng")));
+ task.setDestinationLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("鐩殑鍦癎PS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇鐩殑鍦癎PS鍧愭爣澶辫触", e);
+ }
+ }
+
// 閲嶆柊璁$畻棰勮鍏噷鏁�
calculateEstimatedDistance(task);
int result = sysTaskMapper.updateSysTask(task);
+
+ // 鐢ㄤ簬璺熻釜鏄惁闇�瑕侀噸鏂板悓姝ワ紙杞﹁締銆佷汉鍛樸�佸湴鍧�銆佹垚浜や环鍙樻洿锛�
+ boolean needResync = false;
// 鏇存柊杞﹁締鍏宠仈
if (result > 0 && updateVO.getVehicleIds() != null && !updateVO.getVehicleIds().isEmpty()) {
@@ -525,12 +650,98 @@
taskVehicle.setCreateTime(now);
sysTaskVehicleMapper.insertSysTaskVehicle(taskVehicle);
}
+
+ // 鏍囪闇�瑕侀噸鏂板悓姝ワ紙杞﹁締鍙樻洿锛�
+ needResync = true;
}
}
- // 鏇存柊鎬ユ晳杞繍鎵╁睍淇℃伅
+ // 鏇存柊鎵ц浜哄憳锛堟娴嬩汉鍛樺彉鏇达級
+ if (result > 0 && updateVO.getAssignees() != null) {
+ // 鏌ヨ鐜版湁鐨勬墽琛屼汉鍛�
+ List<SysTaskAssignee> existingAssignees = sysTaskAssigneeMapper.selectSysTaskAssigneeByTaskId(updateVO.getTaskId());
+ List<Long> existingAssigneeIds = existingAssignees.stream()
+ .map(SysTaskAssignee::getUserId)
+ .collect(Collectors.toList());
+
+ List<Long> newAssigneeIds = updateVO.getAssignees().stream()
+ .map(TaskUpdateVO.AssigneeInfo::getUserId)
+ .collect(Collectors.toList());
+
+ // 姣旇緝鏂版棫鎵ц浜哄憳ID鍒楄〃锛屽垽鏂槸鍚︽湁鍙樺寲
+ boolean assigneesChanged = !new HashSet<>(existingAssigneeIds).equals(new HashSet<>(newAssigneeIds));
+
+ // 鍙湁鎵ц浜哄憳鍙戠敓鍙樺寲鏃舵墠鏇存柊
+ if (assigneesChanged) {
+ // 鍒犻櫎鏃х殑鎵ц浜哄憳鍏宠仈
+ sysTaskAssigneeMapper.deleteSysTaskAssigneeByTaskId(updateVO.getTaskId());
+
+ // 娣诲姞鏂扮殑鎵ц浜哄憳鍏宠仈
+ if (!updateVO.getAssignees().isEmpty()) {
+ // 灏� TaskUpdateVO.AssigneeInfo 杞崲涓� TaskCreateVO.AssigneeInfo
+ List<TaskCreateVO.AssigneeInfo> createAssignees = updateVO.getAssignees().stream()
+ .map(assignee -> {
+ TaskCreateVO.AssigneeInfo createAssignee = new TaskCreateVO.AssigneeInfo();
+ createAssignee.setUserId(assignee.getUserId());
+ createAssignee.setUserName(assignee.getUserName());
+ createAssignee.setUserType(assignee.getUserType());
+ return createAssignee;
+ })
+ .collect(Collectors.toList());
+ saveTaskAssignees(updateVO.getTaskId(), createAssignees, SecurityUtils.getUsername());
+ }
+
+ // 鏍囪闇�瑕侀噸鏂板悓姝ワ紙浜哄憳鍙樻洿锛�
+ needResync = true;
+ }
+ }
+
+ // 鏇存柊鎬ユ晳杞繍鎵╁睍淇℃伅锛堟娴嬪湴鍧�鍜屾垚浜や环鍙樻洿锛�
if (result > 0 && "EMERGENCY_TRANSFER".equals(oldTask.getTaskType()) && updateVO.getEmergencyInfo() != null) {
+ // 鑾峰彇鏃х殑鎬ユ晳杞繍淇℃伅
+ SysTaskEmergency oldEmergency = sysTaskEmergencyMapper.selectSysTaskEmergencyByTaskId(updateVO.getTaskId());
+
+ // 妫�娴嬭浆鍑哄尰闄㈠湴鍧�鍙樻洿
+ boolean hospitalOutAddressChanged = false;
+ if (updateVO.getEmergencyInfo().getHospitalOutAddress() != null
+ && oldEmergency != null
+ && !updateVO.getEmergencyInfo().getHospitalOutAddress().equals(oldEmergency.getHospitalOutAddress())) {
+ hospitalOutAddressChanged = true;
+ }
+
+ // 妫�娴嬭浆鍏ュ尰闄㈠湴鍧�鍙樻洿
+ boolean hospitalInAddressChanged = false;
+ if (updateVO.getEmergencyInfo().getHospitalInAddress() != null
+ && oldEmergency != null
+ && !updateVO.getEmergencyInfo().getHospitalInAddress().equals(oldEmergency.getHospitalInAddress())) {
+ hospitalInAddressChanged = true;
+ }
+
+ // 妫�娴嬫垚浜や环鍙樻洿
+ boolean transferPriceChanged = false;
+ if (updateVO.getEmergencyInfo().getTransferPrice() != null
+ && oldEmergency != null
+ && oldEmergency.getTransferPrice() != null
+ && updateVO.getEmergencyInfo().getTransferPrice().compareTo(oldEmergency.getTransferPrice()) != 0) {
+ transferPriceChanged = true;
+ }
+
+ // 鏇存柊鎬ユ晳杞繍淇℃伅
updateEmergencyInfo(updateVO.getTaskId(), updateVO);
+
+ // 濡傛灉鍦板潃鎴栨垚浜や环鍙戠敓鍙樻洿锛屾爣璁伴渶瑕侀噸鏂板悓姝�
+ if (hospitalOutAddressChanged || hospitalInAddressChanged || transferPriceChanged) {
+ needResync = true;
+ }
+ }
+
+ // 濡傛灉鏄�ユ晳杞繍浠诲姟涓旀湁鍙樻洿锛屾爣璁伴渶瑕侀噸鏂板悓姝�
+ if (result > 0 && "EMERGENCY_TRANSFER".equals(oldTask.getTaskType()) && needResync) {
+ try {
+ sysTaskEmergencyService.markNeedResync(updateVO.getTaskId());
+ } catch (Exception e) {
+ // 鏍囪澶辫触涓嶅奖鍝嶄富娴佺▼
+ }
}
// 璁板綍鎿嶄綔鏃ュ織
@@ -741,7 +952,7 @@
recordTaskLog(taskId, "UPDATE", "涓婁紶闄勪欢", null,
"涓婁紶鏂囦欢锛�" + file.getOriginalFilename() + "(鍒嗙被锛�" + categoryDesc + ")",
SecurityUtils.getUserId(), SecurityUtils.getUsername());
-
+
}
@@ -801,7 +1012,7 @@
recordTaskLog(taskId, "UPDATE", "涓婁紶闄勪欢", null,
"閫氳繃寰俊涓婁紶鏂囦欢锛�" + fileName + "(鍒嗙被锛�" + categoryDesc + ")",
SecurityUtils.getUserId(), SecurityUtils.getUsername());
-
+
}
@@ -1150,6 +1361,8 @@
task.setAttachments(attachments);
// 鏌ヨ鎿嶄綔鏃ュ織
task.setOperationLogs(sysTaskLogMapper.selectSysTaskLogByTaskId(taskId));
+ // 鏌ヨ鎵ц浜哄憳鍒楄〃
+ task.setAssignees(sysTaskAssigneeMapper.selectSysTaskAssigneeByTaskId(taskId));
// 鍔犺浇鎬ユ晳杞繍鎵╁睍淇℃伅
if ("EMERGENCY_TRANSFER".equals(task.getTaskType())) {
SysTaskEmergency emergencyInfo = sysTaskEmergencyMapper.selectSysTaskEmergencyByTaskId(taskId);
@@ -1250,6 +1463,30 @@
*/
private String generateTaskCode() {
return taskCodeGenerator.generateTaskCode();
+ }
+
+ /**
+ * 浠庡湴鍧�涓彁鍙栧煄甯傚悕绉帮紙鐢ㄤ簬鍦板浘鍦扮悊缂栫爜锛�
+ *
+ * @param address 鍦板潃
+ * @return 鍩庡競鍚嶇О
+ */
+ private String extractCityFromAddress(String address) {
+ if (address == null || address.trim().isEmpty()) {
+ return null;
+ }
+
+ // 甯歌鍩庡競鍚嶅垪琛�
+ String[] cities = {"骞垮窞", "娣卞湷", "涓滆帪", "浣涘北", "鐝犳捣", "鎯犲窞", "涓北", "姹熼棬", "婀涙睙", "鑲囧簡", "娓呰繙", "闊跺叧", "姊呭窞", "娌虫簮", "娼窞", "鎻槼", "姹曞ご", "姹曞熬", "浜戞诞", "闃虫睙","鍖椾含","涓婃捣","澶╂触"};
+
+
+ for (String city : cities) {
+ if (address.contains(city)) {
+ return city;
+ }
+ }
+
+ return null;
}
/**
@@ -1434,8 +1671,27 @@
emergencyInfo.setHospitalOutDepartmentId(createVO.getHospitalOut().getDepartmentId());
emergencyInfo.setHospitalOutBedNumber(createVO.getHospitalOut().getBedNumber());
emergencyInfo.setHospitalOutAddress(createVO.getHospitalOut().getAddress());
- emergencyInfo.setHospitalOutLongitude(createVO.getHospitalOut().getLongitude());
- emergencyInfo.setHospitalOutLatitude(createVO.getHospitalOut().getLatitude());
+
+ // GPS鍧愭爣锛氫紭鍏堜娇鐢ㄥ墠绔紶鍏ョ殑锛屽惁鍒欏悗绔嚜鍔ㄨ幏鍙�
+ if (createVO.getHospitalOut().getLongitude() != null && createVO.getHospitalOut().getLatitude() != null) {
+ emergencyInfo.setHospitalOutLongitude(createVO.getHospitalOut().getLongitude());
+ emergencyInfo.setHospitalOutLatitude(createVO.getHospitalOut().getLatitude());
+ } else if (mapService != null && createVO.getHospitalOut().getAddress() != null) {
+ // 鍚庣鑷姩鑾峰彇GPS鍧愭爣
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ createVO.getHospitalOut().getAddress(),
+ extractCityFromAddress(createVO.getHospitalOut().getAddress())
+ );
+ if (coords != null) {
+ emergencyInfo.setHospitalOutLongitude(BigDecimal.valueOf(coords.get("lng")));
+ emergencyInfo.setHospitalOutLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("杞嚭鍖婚櫌GPS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇杞嚭鍖婚櫌GPS鍧愭爣澶辫触", e);
+ }
+ }
}
// 璁剧疆杞叆鍖婚櫌淇℃伅
@@ -1446,8 +1702,27 @@
emergencyInfo.setHospitalInDepartmentId(createVO.getHospitalIn().getDepartmentId());
emergencyInfo.setHospitalInBedNumber(createVO.getHospitalIn().getBedNumber());
emergencyInfo.setHospitalInAddress(createVO.getHospitalIn().getAddress());
- emergencyInfo.setHospitalInLongitude(createVO.getHospitalIn().getLongitude());
- emergencyInfo.setHospitalInLatitude(createVO.getHospitalIn().getLatitude());
+
+ // GPS鍧愭爣锛氫紭鍏堜娇鐢ㄥ墠绔紶鍏ョ殑锛屽惁鍒欏悗绔嚜鍔ㄨ幏鍙�
+ if (createVO.getHospitalIn().getLongitude() != null && createVO.getHospitalIn().getLatitude() != null) {
+ emergencyInfo.setHospitalInLongitude(createVO.getHospitalIn().getLongitude());
+ emergencyInfo.setHospitalInLatitude(createVO.getHospitalIn().getLatitude());
+ } else if (mapService != null && createVO.getHospitalIn().getAddress() != null) {
+ // 鍚庣鑷姩鑾峰彇GPS鍧愭爣
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ createVO.getHospitalIn().getAddress(),
+ extractCityFromAddress(createVO.getHospitalIn().getAddress())
+ );
+ if (coords != null) {
+ emergencyInfo.setHospitalInLongitude(BigDecimal.valueOf(coords.get("lng")));
+ emergencyInfo.setHospitalInLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("杞叆鍖婚櫌GPS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇杞叆鍖婚櫌GPS鍧愭爣澶辫触", e);
+ }
+ }
}
// 璁剧疆璐圭敤淇℃伅
@@ -1479,8 +1754,6 @@
emergencyInfo.setDispatchSyncStatus(2);
emergencyInfo.setDispatchSyncTime(new Date());
emergencyInfo.setDispatchSyncErrorMsg("鏃х郴缁熷悓姝ヨ繃鏉�");
-
- // 绯荤粺瀛楁
}
// 绯荤粺瀛楁
emergencyInfo.setCreateTime(DateUtils.getNowDate());
@@ -1548,6 +1821,23 @@
}
if (emergencyInfo.getHospitalOutAddress() != null) {
existingInfo.setHospitalOutAddress(emergencyInfo.getHospitalOutAddress());
+
+ // 濡傛灉鏇存柊浜嗗湴鍧�浣嗘病鏈塆PS鍧愭爣锛屽悗绔嚜鍔ㄨ幏鍙�
+ if (emergencyInfo.getHospitalOutLongitude() == null && emergencyInfo.getHospitalOutLatitude() == null && mapService != null) {
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ emergencyInfo.getHospitalOutAddress(),
+ extractCityFromAddress(emergencyInfo.getHospitalOutAddress())
+ );
+ if (coords != null) {
+ existingInfo.setHospitalOutLongitude(BigDecimal.valueOf(coords.get("lng")));
+ existingInfo.setHospitalOutLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("杞嚭鍖婚櫌GPS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇杞嚭鍖婚櫌GPS鍧愭爣澶辫触", e);
+ }
+ }
}
if (emergencyInfo.getHospitalOutLongitude() != null) {
existingInfo.setHospitalOutLongitude(emergencyInfo.getHospitalOutLongitude());
@@ -1574,6 +1864,23 @@
}
if (emergencyInfo.getHospitalInAddress() != null) {
existingInfo.setHospitalInAddress(emergencyInfo.getHospitalInAddress());
+
+ // 濡傛灉鏇存柊浜嗗湴鍧�浣嗘病鏈塆PS鍧愭爣锛屽悗绔嚜鍔ㄨ幏鍙�
+ if (emergencyInfo.getHospitalInLongitude() == null && emergencyInfo.getHospitalInLatitude() == null && mapService != null) {
+ try {
+ Map<String, Double> coords = mapService.geocoding(
+ emergencyInfo.getHospitalInAddress(),
+ extractCityFromAddress(emergencyInfo.getHospitalInAddress())
+ );
+ if (coords != null) {
+ existingInfo.setHospitalInLongitude(BigDecimal.valueOf(coords.get("lng")));
+ existingInfo.setHospitalInLatitude(BigDecimal.valueOf(coords.get("lat")));
+ log.info("杞叆鍖婚櫌GPS鍧愭爣鑷姩鑾峰彇鎴愬姛: {}, {}", coords.get("lng"), coords.get("lat"));
+ }
+ } catch (Exception e) {
+ log.error("鑷姩鑾峰彇杞叆鍖婚櫌GPS鍧愭爣澶辫触", e);
+ }
+ }
}
if (emergencyInfo.getHospitalInLongitude() != null) {
existingInfo.setHospitalInLongitude(emergencyInfo.getHospitalInLongitude());
--
Gitblit v1.9.1