diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/WaybillLocateVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/WaybillLocateVO.java
new file mode 100644
index 0000000..c3ce796
--- /dev/null
+++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/WaybillLocateVO.java
@@ -0,0 +1,74 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ *
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.transport.pojo.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Map;
+
+/**
+ * 运单车辆实时定位结果
+ *
+ * @author Chill
+ */
+@Data
+@Schema(description = "运单车辆实时定位结果")
+public class WaybillLocateVO implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 1L;
+
+ @Schema(description = "运单ID")
+ private Long waybillId;
+
+ @Schema(description = "车牌号")
+ private String vehicleNo;
+
+ @Schema(description = "经度")
+ private BigDecimal longitude;
+
+ @Schema(description = "纬度")
+ private BigDecimal latitude;
+
+ @Schema(description = "地址")
+ private String address;
+
+ @Schema(description = "定位时间")
+ private String locateTime;
+
+ @Schema(description = "速度")
+ private String speed;
+
+ @Schema(description = "方向")
+ private String direction;
+
+ @Schema(description = "LBS原始数据")
+ private Map rawData;
+}
diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/WaybillTrackVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/WaybillTrackVO.java
new file mode 100644
index 0000000..44a9e1b
--- /dev/null
+++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/WaybillTrackVO.java
@@ -0,0 +1,95 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ *
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ *
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ *
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ *
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ *
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ *
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.transport.pojo.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 运单历史轨迹结果
+ *
+ * @author Chill
+ */
+@Data
+@Schema(description = "运单历史轨迹结果")
+public class WaybillTrackVO implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 1L;
+
+ @Schema(description = "运单ID")
+ private Long waybillId;
+
+ @Schema(description = "车牌号")
+ private String vehicleNo;
+
+ @Schema(description = "开始日期")
+ private String startDate;
+
+ @Schema(description = "结束日期")
+ private String endDate;
+
+ @Schema(description = "轨迹点数量")
+ private Integer total;
+
+ @Schema(description = "轨迹点列表")
+ private List points = new ArrayList<>();
+
+ @Data
+ @Schema(description = "轨迹点")
+ public static class WaybillTrackPointVO implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 1L;
+
+ @Schema(description = "车牌号")
+ private String vehicleNo;
+
+ @Schema(description = "经度")
+ private BigDecimal longitude;
+
+ @Schema(description = "纬度")
+ private BigDecimal latitude;
+
+ @Schema(description = "定位时间")
+ private String locateTime;
+
+ @Schema(description = "速度")
+ private String speed;
+
+ @Schema(description = "方向")
+ private String direction;
+
+ @Schema(description = "地址")
+ private String address;
+ }
+}
diff --git a/blade-service/blade-system/src/main/resources/application.yml b/blade-service/blade-system/src/main/resources/application.yml
index 2d04e41..1447a57 100644
--- a/blade-service/blade-system/src/main/resources/application.yml
+++ b/blade-service/blade-system/src/main/resources/application.yml
@@ -33,7 +33,11 @@ iam:
profile-authorization: ${IAM_SSO_PROFILE_AUTHORIZATION:YjNlZmU0ODEwMzJiNGJhZTpkYzQ5NDY1NmQ4MzE0NThjODI5MzlmNzA2ZjliNDY3MQ==}
page-size: ${IAM_SSO_ACCOUNT_PAGE_SIZE:50}
-# OA人员同步走同一 gwzh 网关,仅需 Authorization(与可用 curl 一致)
+# OA组织/人员同步走同一 gwzh 网关,仅需 Authorization(与可用 curl 一致)
thirdParty:
oa:
+ baseUrl: ${OA_BASE_URL:http://172.16.204.83:38000}
+ queryCompanyPageUrl: ${OA_QUERY_COMPANY_PAGE_URL:/gwzh/OA/OA_GET_COMPANY_LIST}
+ queryDepartmentPageUrl: ${OA_QUERY_DEPARTMENT_PAGE_URL:/gwzh/OA/OA_GET_DEPARTMENT_LIST}
+ queryPersonPageUrl: ${OA_QUERY_PERSON_PAGE_URL:/gwzh/OA/OA_GET_USER_LIST}
authorization: ${OA_AUTHORIZATION:${IAM_SSO_AUTHORIZATION:Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=}}
diff --git a/blade-service/blade-transport/pom.xml b/blade-service/blade-transport/pom.xml
index 852de9a..b012436 100644
--- a/blade-service/blade-transport/pom.xml
+++ b/blade-service/blade-transport/pom.xml
@@ -31,6 +31,10 @@
org.springblade
blade-transport-api
+
+ org.springblade
+ blade-lbs-api
+
org.springblade
blade-user-api
diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/WaybillController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/WaybillController.java
index 8479ad4..ba2c241 100644
--- a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/WaybillController.java
+++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/WaybillController.java
@@ -53,6 +53,8 @@ import org.springblade.transport.pojo.dto.WaybillImportBatchRequest;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.LoadingManageVO;
import org.springblade.transport.pojo.vo.WaybillImportBatchVO;
+import org.springblade.transport.pojo.vo.WaybillLocateVO;
+import org.springblade.transport.pojo.vo.WaybillTrackVO;
import org.springblade.transport.pojo.vo.WaybillPunchRecordsVO;
import org.springblade.transport.pojo.vo.WaybillVO;
import org.springblade.transport.pojo.dto.WaybillMileageRequest;
@@ -109,6 +111,23 @@ public class WaybillController extends BladeController {
return R.data(waybillService.listPunchRecords(waybillId));
}
+ @PostMapping("/locate")
+ @ApiOperationSupport(order = 1)
+ @Operation(summary = "车辆实时定位", description = "按运单绑定车牌调用 LBS_LOCATE")
+ public R locate(@Parameter(description = "运单ID", required = true) @RequestParam Long id) {
+ return R.data(waybillService.locateVehicle(id));
+ }
+
+ @PostMapping("/track")
+ @ApiOperationSupport(order = 1)
+ @Operation(summary = "车辆历史轨迹", description = "按运单绑定车牌 + 日期区间调用 LBS_LOCATE")
+ public R track(
+ @Parameter(description = "运单ID", required = true) @RequestParam Long id,
+ @Parameter(description = "开始日期 YYYY-MM-DD", required = true) @RequestParam String startDate,
+ @Parameter(description = "结束日期 YYYY-MM-DD", required = true) @RequestParam String endDate) {
+ return R.data(waybillService.trackVehicle(id, startDate, endDate));
+ }
+
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@Operation(summary = "分页", description = "传入waybill")
diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IWaybillService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IWaybillService.java
index bf3dccf..3536790 100644
--- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IWaybillService.java
+++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IWaybillService.java
@@ -28,6 +28,8 @@ import org.springblade.transport.excel.WaybillExcel;
import org.springblade.transport.pojo.entity.Waybill;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.LoadingManageVO;
+import org.springblade.transport.pojo.vo.WaybillLocateVO;
+import org.springblade.transport.pojo.vo.WaybillTrackVO;
import org.springblade.transport.pojo.vo.WaybillPunchRecordsVO;
import org.springblade.transport.pojo.vo.WaybillVO;
import org.springblade.transport.pojo.dto.WaybillMileageRequest;
@@ -49,6 +51,24 @@ public interface IWaybillService extends BaseService {
*/
WaybillPunchRecordsVO listPunchRecords(Long waybillId);
+ /**
+ * 运单车辆实时定位(按运单绑定车牌调用 LBS)
+ *
+ * @param id 运单ID
+ * @return 定位结果
+ */
+ WaybillLocateVO locateVehicle(Long id);
+
+ /**
+ * 运单历史轨迹回放(按运单绑定车牌 + 日期区间调用 LBS)
+ *
+ * @param id 运单ID
+ * @param startDate 开始日期 YYYY-MM-DD
+ * @param endDate 结束日期 YYYY-MM-DD
+ * @return 轨迹结果
+ */
+ WaybillTrackVO trackVehicle(Long id, String startDate, String endDate);
+
Waybill syncDriverAcceptState(Waybill waybill);
boolean submit(Waybill waybill);
boolean saveDraft(Waybill waybill);
diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/WaybillServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/WaybillServiceImpl.java
index b837dd8..b22ce13 100644
--- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/WaybillServiceImpl.java
+++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/WaybillServiceImpl.java
@@ -25,6 +25,7 @@ package org.springblade.transport.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fasterxml.jackson.databind.JsonNode;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.jackson.JsonUtil;
@@ -32,10 +33,10 @@ import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.UserCache;
import org.springblade.system.pojo.entity.Dept;
+import org.springblade.thirdparty.lbs.feign.ILbsClient;
+import org.springblade.thirdparty.lbs.pojo.dto.LbsLocateRequest;
+import org.springblade.thirdparty.lbs.pojo.vo.LbsLocateResponse;
import org.springblade.transport.excel.WaybillExcel;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
-import java.util.Arrays;
import org.springblade.transport.mapper.WaybillEnroutePunchMapper;
import org.springblade.transport.mapper.WaybillMapper;
import org.springblade.transport.mapper.WaybillNodePunchMapper;
@@ -49,6 +50,8 @@ import org.springblade.transport.pojo.entity.WaybillNodePunch;
import org.springblade.transport.pojo.dto.WaybillMileageRequest;
import org.springblade.transport.pojo.vo.BusinessRemoveResultVO;
import org.springblade.transport.pojo.vo.LoadingManageVO;
+import org.springblade.transport.pojo.vo.WaybillLocateVO;
+import org.springblade.transport.pojo.vo.WaybillTrackVO;
import org.springblade.transport.pojo.vo.WaybillPunchPhotoVO;
import org.springblade.transport.pojo.vo.WaybillPunchRecordItemVO;
import org.springblade.transport.pojo.vo.WaybillPunchRecordsVO;
@@ -67,7 +70,11 @@ import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.LinkedHashMap;
@@ -111,6 +118,9 @@ public class WaybillServiceImpl extends BaseServiceImpl
@jakarta.annotation.Resource
private WaybillEnroutePunchMapper waybillEnroutePunchMapper;
+ @jakarta.annotation.Resource
+ private ILbsClient lbsClient;
+
@Override
public IPage selectWaybillPage(IPage page, WaybillVO waybill) {
IPage entityPage = page(page, buildQuery(waybill));
@@ -128,6 +138,190 @@ public class WaybillServiceImpl extends BaseServiceImpl
return result;
}
+ @Override
+ public WaybillLocateVO locateVehicle(Long id) {
+ Waybill waybill = requireWaybillWithVehicleNo(id, "无法实时定位");
+ String vehicleNo = waybill.getVehicleNo().trim();
+ LbsLocateResponse response = invokeLbsLocate(id, vehicleNo, new LbsLocateRequest(vehicleNo), "实时定位");
+ List
+
+ org.springblade
+ blade-lbs-api
+ ${revision}
+
org.springblade
blade-open-api