From a2e23ea264d3eaf363cd0561334806550c456f2e Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Fri, 18 Sep 2026 21:12:01 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=BB=84=E7=BB=87=202=E3=80=81=E6=96=B0=E5=A2=9E=E5=8C=97?= =?UTF-8?q?=E6=96=97=E5=AE=9A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transport/pojo/vo/WaybillLocateVO.java | 74 +++++++ .../transport/pojo/vo/WaybillTrackVO.java | 95 +++++++++ .../src/main/resources/application.yml | 6 +- blade-service/blade-transport/pom.xml | 4 + .../controller/WaybillController.java | 19 ++ .../transport/service/IWaybillService.java | 20 ++ .../service/impl/WaybillServiceImpl.java | 200 +++++++++++++++++- .../src/main/resources/application-dev.yml | 7 + blade-third-party-api/blade-lbs-api/pom.xml | 22 ++ .../lbs/config/LbsFeignClientConfig.java | 69 ++++++ .../thirdparty/lbs/config/LbsProperties.java | 54 +++++ .../ThirdPartyLbsAutoConfiguration.java | 39 ++++ .../thirdparty/lbs/constant/LbsConstant.java | 52 +++++ .../thirdparty/lbs/feign/ILbsClient.java | 51 +++++ .../interceptor/LbsRequestInterceptor.java | 115 ++++++++++ .../lbs/pojo/dto/LbsLocateRequest.java | 75 +++++++ .../lbs/pojo/vo/LbsLocateResponse.java | 100 +++++++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../thirdparty/oa/feign/IOAClient.java | 4 +- blade-third-party-api/pom.xml | 1 + doc/nacos/blade-dev.yaml | 9 +- doc/nacos/blade-prod.yaml | 9 +- doc/nacos/third-party-api.yaml | 9 +- pom.xml | 5 + 24 files changed, 1031 insertions(+), 9 deletions(-) create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/WaybillLocateVO.java create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/WaybillTrackVO.java create mode 100644 blade-third-party-api/blade-lbs-api/pom.xml create mode 100644 blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/LbsFeignClientConfig.java create mode 100644 blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/LbsProperties.java create mode 100644 blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/ThirdPartyLbsAutoConfiguration.java create mode 100644 blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/constant/LbsConstant.java create mode 100644 blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/feign/ILbsClient.java create mode 100644 blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/interceptor/LbsRequestInterceptor.java create mode 100644 blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/pojo/dto/LbsLocateRequest.java create mode 100644 blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/pojo/vo/LbsLocateResponse.java create mode 100644 blade-third-party-api/blade-lbs-api/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 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> pointMaps = extractLbsPointMaps(response.getData()); + if (pointMaps.isEmpty()) { + throw new ServiceException("暂无车辆实时定位数据"); + } + return buildLocateVO(id, vehicleNo, pointMaps.get(0)); + } + + @Override + public WaybillTrackVO trackVehicle(Long id, String startDate, String endDate) { + Waybill waybill = requireWaybillWithVehicleNo(id, "无法查询历史轨迹"); + String vehicleNo = waybill.getVehicleNo().trim(); + String normalizedStart = normalizeTrackDate(startDate, "开始日期"); + String normalizedEnd = normalizeTrackDate(endDate, "结束日期"); + if (LocalDate.parse(normalizedStart).isAfter(LocalDate.parse(normalizedEnd))) { + throw new ServiceException("开始日期不能晚于结束日期"); + } + LbsLocateResponse response = invokeLbsLocate(id, vehicleNo, + new LbsLocateRequest(vehicleNo, normalizedStart, normalizedEnd), "历史轨迹"); + List> pointMaps = extractLbsPointMaps(response.getData()); + WaybillTrackVO trackVO = new WaybillTrackVO(); + trackVO.setWaybillId(id); + trackVO.setVehicleNo(vehicleNo); + trackVO.setStartDate(normalizedStart); + trackVO.setEndDate(normalizedEnd); + List points = new ArrayList<>(); + for (Map pointMap : pointMaps) { + WaybillTrackVO.WaybillTrackPointVO point = buildTrackPoint(vehicleNo, pointMap); + if (point.getLongitude() != null && point.getLatitude() != null) { + points.add(point); + } + } + trackVO.setPoints(points); + trackVO.setTotal(points.size()); + return trackVO; + } + + private Waybill requireWaybillWithVehicleNo(Long id, String actionTip) { + if (id == null) { + throw new ServiceException("运单ID不能为空"); + } + Waybill waybill = getById(id); + if (waybill == null || Objects.equals(waybill.getIsDeleted(), 1)) { + throw new ServiceException("运单不存在"); + } + String vehicleNo = Func.toStr(waybill.getVehicleNo(), "").trim(); + if (Func.isEmpty(vehicleNo)) { + throw new ServiceException("运单未绑定车牌号," + actionTip); + } + waybill.setVehicleNo(vehicleNo); + return waybill; + } + + private LbsLocateResponse invokeLbsLocate(Long waybillId, String vehicleNo, LbsLocateRequest request, String scene) { + LbsLocateResponse response; + try { + response = lbsClient.locate(request); + } catch (Exception exception) { + log.error("调用LBS{}失败 waybillId={}, vehicleNo={}", scene, waybillId, vehicleNo, exception); + throw new ServiceException("调用车辆" + scene + "接口失败"); + } + if (response == null || !response.isSuccess()) { + String errorMessage = response == null ? "车辆" + scene + "无返回" : response.errorMessage(); + throw new ServiceException(errorMessage); + } + return response; + } + + private String normalizeTrackDate(String dateText, String fieldName) { + if (Func.isEmpty(dateText)) { + throw new ServiceException(fieldName + "不能为空"); + } + String normalized = dateText.trim(); + try { + return LocalDate.parse(normalized, DateTimeFormatter.ISO_LOCAL_DATE).toString(); + } catch (DateTimeParseException exception) { + throw new ServiceException(fieldName + "格式必须为YYYY-MM-DD"); + } + } + + /** + * 提取 LBS 轨迹点列表,兼容 data 数组 或 data.list 数组 + */ + private List> extractLbsPointMaps(JsonNode dataNode) { + List> pointMaps = new ArrayList<>(); + if (dataNode == null || dataNode.isNull()) { + return pointMaps; + } + JsonNode listNode = dataNode; + if (dataNode.isObject() && dataNode.has("list")) { + listNode = dataNode.get("list"); + } + if (listNode != null && listNode.isArray()) { + for (JsonNode item : listNode) { + if (item != null && item.isObject()) { + pointMaps.add(JsonUtil.toMap(item.toString())); + } + } + return pointMaps; + } + if (dataNode.isObject()) { + pointMaps.add(JsonUtil.toMap(dataNode.toString())); + } + return pointMaps; + } + + /** + * 将 LBS 单点数据归一化为实时定位结果 + */ + private WaybillLocateVO buildLocateVO(Long waybillId, String vehicleNo, Map pointMap) { + WaybillLocateVO locateVO = new WaybillLocateVO(); + locateVO.setWaybillId(waybillId); + locateVO.setVehicleNo(vehicleNo); + locateVO.setRawData(pointMap); + fillPointFields(locateVO, pointMap); + return locateVO; + } + + private WaybillTrackVO.WaybillTrackPointVO buildTrackPoint(String vehicleNo, Map pointMap) { + WaybillTrackVO.WaybillTrackPointVO point = new WaybillTrackVO.WaybillTrackPointVO(); + point.setVehicleNo(vehicleNo); + fillPointFields(point, pointMap); + return point; + } + + private void fillPointFields(WaybillLocateVO target, Map pointMap) { + target.setLongitude(firstDecimal(pointMap, "longitude", "lon", "lng", "x", "jd", "Longitude", "LON", "LNG", "JD", "X")); + target.setLatitude(firstDecimal(pointMap, "latitude", "lat", "y", "wd", "Latitude", "LAT", "WD", "Y")); + target.setAddress(firstText(pointMap, "address", "addr", "adr", "wz", "Address", "ADDR", "ADR")); + target.setLocateTime(firstText(pointMap, "locationTime", "pos_time", "locateTime", "gpsTime", "gpstime", "time", "gpszdsj", "GPSTime", "Time")); + target.setSpeed(firstText(pointMap, "speed", "v", "sd", "Speed", "SD", "V")); + target.setDirection(firstText(pointMap, "direct", "direction", "h", "fx", "Direction", "FX", "course", "H")); + String responseVehicleNo = firstText(pointMap, "cph", "vehicleNo", "plateNo", "CPH"); + if (Func.isNotEmpty(responseVehicleNo)) { + target.setVehicleNo(responseVehicleNo); + } + } + + private void fillPointFields(WaybillTrackVO.WaybillTrackPointVO target, Map pointMap) { + target.setLongitude(firstDecimal(pointMap, "longitude", "lon", "lng", "x", "jd", "Longitude", "LON", "LNG", "JD", "X")); + target.setLatitude(firstDecimal(pointMap, "latitude", "lat", "y", "wd", "Latitude", "LAT", "WD", "Y")); + target.setAddress(firstText(pointMap, "address", "addr", "adr", "wz", "Address", "ADDR", "ADR")); + target.setLocateTime(firstText(pointMap, "locationTime", "pos_time", "locateTime", "gpsTime", "gpstime", "time", "gpszdsj", "GPSTime", "Time")); + target.setSpeed(firstText(pointMap, "speed", "v", "sd", "Speed", "SD", "V")); + target.setDirection(firstText(pointMap, "direct", "direction", "h", "fx", "Direction", "FX", "course", "H")); + String responseVehicleNo = firstText(pointMap, "cph", "vehicleNo", "plateNo", "CPH"); + if (Func.isNotEmpty(responseVehicleNo)) { + target.setVehicleNo(responseVehicleNo); + } + } + + private BigDecimal firstDecimal(Map rawData, String... keys) { + String text = firstText(rawData, keys); + if (Func.isEmpty(text)) { + return null; + } + try { + return new BigDecimal(text.trim()); + } catch (NumberFormatException exception) { + return null; + } + } + + private String firstText(Map rawData, String... keys) { + if (rawData == null || rawData.isEmpty() || keys == null) { + return null; + } + for (String key : keys) { + Object value = rawData.get(key); + if (value == null) { + continue; + } + String text = String.valueOf(value).trim(); + if (Func.isNotEmpty(text) && !"null".equalsIgnoreCase(text)) { + return text; + } + } + return null; + } + @Override public WaybillPunchRecordsVO listPunchRecords(Long waybillId) { WaybillPunchRecordsVO vo = new WaybillPunchRecordsVO(); diff --git a/blade-service/blade-transport/src/main/resources/application-dev.yml b/blade-service/blade-transport/src/main/resources/application-dev.yml index 048e650..29ae464 100644 --- a/blade-service/blade-transport/src/main/resources/application-dev.yml +++ b/blade-service/blade-transport/src/main/resources/application-dev.yml @@ -8,3 +8,10 @@ spring: url: ${blade.datasource.dev.url} username: ${blade.datasource.dev.username} password: ${blade.datasource.dev.password} + +# LBS 车辆实时定位(Authorization 与 OA 人员接口一致) +thirdParty: + lbs: + baseUrl: ${LBS_BASE_URL:http://172.16.204.83:38000} + locateUrl: ${LBS_LOCATE_URL:/gwzh/LBS/LBS_LOCATE} + authorization: ${LBS_AUTHORIZATION:${OA_AUTHORIZATION:${IAM_SSO_AUTHORIZATION:Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=}}} diff --git a/blade-third-party-api/blade-lbs-api/pom.xml b/blade-third-party-api/blade-lbs-api/pom.xml new file mode 100644 index 0000000..fe6d45d --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.springblade + blade-third-party-api + ${revision} + + + blade-lbs-api + ${project.artifactId} + jar + + + + org.springblade + blade-core-tool + + + diff --git a/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/LbsFeignClientConfig.java b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/LbsFeignClientConfig.java new file mode 100644 index 0000000..bd85839 --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/LbsFeignClientConfig.java @@ -0,0 +1,69 @@ +/** + * 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.thirdparty.lbs.config; + +import feign.Logger; +import feign.Request; +import org.springblade.thirdparty.lbs.interceptor.LbsRequestInterceptor; +import org.springframework.cloud.openfeign.clientconfig.FeignClientConfigurer; +import org.springframework.context.annotation.Bean; + +import java.util.concurrent.TimeUnit; + +/** + * LBS Feign 客户端配置。 + *

+ * 关闭父上下文继承,避免全局 BladeFeignRequestInterceptor 透传登录态请求头导致 gwzh 400。 + * + * @author Chill + */ +public class LbsFeignClientConfig { + + @Bean + public FeignClientConfigurer feignClientConfigurer() { + return new FeignClientConfigurer() { + @Override + public boolean inheritParentConfiguration() { + return false; + } + }; + } + + @Bean + public LbsRequestInterceptor requestInterceptor(LbsProperties lbsProperties) { + return new LbsRequestInterceptor(lbsProperties); + } + + @Bean + public Logger.Level feignLoggerLevel() { + return Logger.Level.FULL; + } + + @Bean + public Request.Options options() { + return new Request.Options(10, TimeUnit.SECONDS, 60, TimeUnit.SECONDS, true); + } +} diff --git a/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/LbsProperties.java b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/LbsProperties.java new file mode 100644 index 0000000..0e8b780 --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/LbsProperties.java @@ -0,0 +1,54 @@ +/** + * 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.thirdparty.lbs.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * LBS 配置 + * + * @author Chill + */ +@Data +@ConfigurationProperties(prefix = "third-party.lbs") +public class LbsProperties { + + /** + * LBS 网关基础地址 + */ + private String baseUrl; + + /** + * 车辆实时定位路径 + */ + private String locateUrl = "/gwzh/LBS/LBS_LOCATE"; + + /** + * gwzh 网关 Authorization(Basic),与 OA 人员接口一致 + */ + private String authorization; +} diff --git a/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/ThirdPartyLbsAutoConfiguration.java b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/ThirdPartyLbsAutoConfiguration.java new file mode 100644 index 0000000..8550141 --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/config/ThirdPartyLbsAutoConfiguration.java @@ -0,0 +1,39 @@ +/** + * 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.thirdparty.lbs.config; + +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * 第三方 LBS 自动配置 + * + * @author Chill + */ +@EnableConfigurationProperties(LbsProperties.class) +@Configuration +public class ThirdPartyLbsAutoConfiguration { +} diff --git a/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/constant/LbsConstant.java b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/constant/LbsConstant.java new file mode 100644 index 0000000..8f4a009 --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/constant/LbsConstant.java @@ -0,0 +1,52 @@ +/** + * 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.thirdparty.lbs.constant; + +/** + * LBS 常量 + * + * @author Chill + */ +public final class LbsConstant { + + private LbsConstant() { + } + + /** + * 成功响应码(文档标注) + */ + public static final int SUCCESS_STATUS = 200; + + /** + * 成功响应码(字符串) + */ + public static final String SUCCESS_STATUS_TEXT = "200"; + + /** + * gwzh 常见成功码(与 OA 一致) + */ + public static final String SUCCESS_CODE = "1"; +} diff --git a/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/feign/ILbsClient.java b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/feign/ILbsClient.java new file mode 100644 index 0000000..e19a148 --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/feign/ILbsClient.java @@ -0,0 +1,51 @@ +/** + * 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.thirdparty.lbs.feign; + +import org.springblade.thirdparty.lbs.config.LbsFeignClientConfig; +import org.springblade.thirdparty.lbs.pojo.dto.LbsLocateRequest; +import org.springblade.thirdparty.lbs.pojo.vo.LbsLocateResponse; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * LBS 接口 + * + * @author Chill + */ +@FeignClient(name = "LBS", url = "${thirdParty.lbs.baseUrl}", configuration = LbsFeignClientConfig.class) +public interface ILbsClient { + + /** + * 车辆实时定位 + * + * @param request 请求(cph=车牌号) + * @return 定位结果 + */ + @PostMapping("${thirdParty.lbs.locateUrl:/gwzh/LBS/LBS_LOCATE}") + LbsLocateResponse locate(@RequestBody LbsLocateRequest request); +} diff --git a/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/interceptor/LbsRequestInterceptor.java b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/interceptor/LbsRequestInterceptor.java new file mode 100644 index 0000000..d458cd9 --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/interceptor/LbsRequestInterceptor.java @@ -0,0 +1,115 @@ +/** + * 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.thirdparty.lbs.interceptor; + +import feign.RequestInterceptor; +import feign.RequestTemplate; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.utils.StringUtil; +import org.springblade.thirdparty.lbs.config.LbsProperties; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +/** + * LBS Feign 请求拦截器:仅发送 Authorization + Content-Type,与 OA 人员接口一致。 + * + * @author Chill + */ +@Slf4j +@RequiredArgsConstructor +public class LbsRequestInterceptor implements RequestInterceptor { + + private static final String BASIC_PREFIX = "Basic "; + private static final String BEARER_PREFIX = "Bearer "; + private static final Set KEEP_HEADERS = Set.of( + HttpHeaders.AUTHORIZATION.toLowerCase(Locale.ROOT), + HttpHeaders.CONTENT_TYPE.toLowerCase(Locale.ROOT) + ); + + private final LbsProperties lbsProperties; + + @Override + public void apply(RequestTemplate template) { + stripUnwantedHeaders(template); + template.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); + + String authorization = normalizeAuthorization(lbsProperties.getAuthorization()); + if (StringUtil.isNotBlank(authorization)) { + template.header(HttpHeaders.AUTHORIZATION, authorization); + } else { + log.warn("LBS Feign 未配置 third-party.lbs.authorization,gwzh 网关可能拒绝请求"); + } + + logRequest(template); + } + + private void logRequest(RequestTemplate template) { + String bodyText = ""; + byte[] body = template.body(); + if (body != null && body.length > 0) { + Charset charset = template.requestCharset() == null ? StandardCharsets.UTF_8 : template.requestCharset(); + bodyText = new String(body, charset); + } + log.info("LBS Feign 请求 method={}, url={}{}{}, headers={}, body={}", + template.method(), + template.feignTarget() == null ? "" : template.feignTarget().url(), + template.path(), + template.queryLine() == null ? "" : template.queryLine(), + template.headers(), + bodyText); + } + + private void stripUnwantedHeaders(RequestTemplate template) { + Map> headers = template.headers(); + List headerNames = new ArrayList<>(headers.keySet()); + for (String headerName : headerNames) { + if (!KEEP_HEADERS.contains(headerName.toLowerCase(Locale.ROOT))) { + template.removeHeader(headerName); + } + } + } + + private String normalizeAuthorization(String authorization) { + if (StringUtil.isBlank(authorization)) { + return authorization; + } + if (StringUtil.startsWithIgnoreCase(authorization, BASIC_PREFIX) + || StringUtil.startsWithIgnoreCase(authorization, BEARER_PREFIX)) { + return authorization; + } + return BASIC_PREFIX + authorization; + } +} diff --git a/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/pojo/dto/LbsLocateRequest.java b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/pojo/dto/LbsLocateRequest.java new file mode 100644 index 0000000..4c20460 --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/pojo/dto/LbsLocateRequest.java @@ -0,0 +1,75 @@ +/** + * 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.thirdparty.lbs.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serial; +import java.io.Serializable; + +/** + * LBS 定位/历史轨迹请求 + * + * @author Chill + */ +@Data +@NoArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class LbsLocateRequest implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 车牌号 + */ + private String cph; + + /** + * 开始日期,格式 YYYY-MM-DD(历史轨迹) + */ + @JsonProperty("start_date") + private String startDate; + + /** + * 结束日期,格式 YYYY-MM-DD(历史轨迹) + */ + @JsonProperty("end_date") + private String endDate; + + public LbsLocateRequest(String cph) { + this.cph = cph; + } + + public LbsLocateRequest(String cph, String startDate, String endDate) { + this.cph = cph; + this.startDate = startDate; + this.endDate = endDate; + } +} diff --git a/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/pojo/vo/LbsLocateResponse.java b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/pojo/vo/LbsLocateResponse.java new file mode 100644 index 0000000..6432a2b --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/java/org/springblade/thirdparty/lbs/pojo/vo/LbsLocateResponse.java @@ -0,0 +1,100 @@ +/** + * 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.thirdparty.lbs.pojo.vo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.Data; +import org.springblade.thirdparty.lbs.constant.LbsConstant; + +import java.io.Serial; +import java.io.Serializable; + +/** + * LBS 定位/历史轨迹响应 + * + * @author Chill + */ +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class LbsLocateResponse implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 响应代码,200 为正确 + */ + private Integer status; + + /** + * 兼容 code 字段(网关常返回 "1") + */ + private String code; + + /** + * 提示信息 + */ + private String msg; + + /** + * 提示信息(兼容 message) + */ + private String message; + + /** + * 定位/轨迹数据(数组,或 {list,total}) + */ + private JsonNode data; + + /** + * 是否成功 + */ + public boolean isSuccess() { + if (status != null && (status == LbsConstant.SUCCESS_STATUS || status == 1)) { + return true; + } + if (code == null) { + return false; + } + String normalized = code.trim(); + return LbsConstant.SUCCESS_STATUS_TEXT.equals(normalized) + || LbsConstant.SUCCESS_CODE.equals(normalized); + } + + /** + * 错误信息 + */ + public String errorMessage() { + if (msg != null && !msg.isBlank()) { + return msg; + } + if (message != null && !message.isBlank()) { + return message; + } + return "LBS接口调用失败"; + } +} diff --git a/blade-third-party-api/blade-lbs-api/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/blade-third-party-api/blade-lbs-api/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..85802bf --- /dev/null +++ b/blade-third-party-api/blade-lbs-api/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.springblade.thirdparty.lbs.config.ThirdPartyLbsAutoConfiguration diff --git a/blade-third-party-api/blade-oa-api/src/main/java/org/springblade/thirdparty/oa/feign/IOAClient.java b/blade-third-party-api/blade-oa-api/src/main/java/org/springblade/thirdparty/oa/feign/IOAClient.java index 9b36edd..63233c5 100644 --- a/blade-third-party-api/blade-oa-api/src/main/java/org/springblade/thirdparty/oa/feign/IOAClient.java +++ b/blade-third-party-api/blade-oa-api/src/main/java/org/springblade/thirdparty/oa/feign/IOAClient.java @@ -26,7 +26,7 @@ public interface IOAClient { * @param param * @return */ - @PostMapping("${thirdParty.oa.queryCompanyPageUrl:/api/hrm/resful/getHrmsubcompanyWithPage}") + @PostMapping("${thirdParty.oa.queryCompanyPageUrl:/gwzh/OA/OA_GET_COMPANY_LIST}") OAResponse queryCompanyPage(@RequestBody OASearch param); /** @@ -34,7 +34,7 @@ public interface IOAClient { * @param param * @return */ - @PostMapping("${thirdParty.oa.queryDepartmentPage:/api/hrm/resful/getHrmdepartmentWithPage}") + @PostMapping("${thirdParty.oa.queryDepartmentPageUrl:/gwzh/OA/OA_GET_DEPARTMENT_LIST}") OAResponse queryDepartmentPage(@RequestBody OASearch param); /** diff --git a/blade-third-party-api/pom.xml b/blade-third-party-api/pom.xml index ba27dd9..5e8c455 100644 --- a/blade-third-party-api/pom.xml +++ b/blade-third-party-api/pom.xml @@ -13,6 +13,7 @@ ${project.artifactId} blade-oa-api + blade-lbs-api blade-mk-api blade-wps-api blade-ocr-api diff --git a/doc/nacos/blade-dev.yaml b/doc/nacos/blade-dev.yaml index a2763a4..0ff37d3 100644 --- a/doc/nacos/blade-dev.yaml +++ b/doc/nacos/blade-dev.yaml @@ -86,9 +86,16 @@ thirdParty: baseUrl: http://127.0.0.1:8080 oa: # OA开放接口地址 - baseUrl: http://127.0.0.1:8080 + baseUrl: http://172.16.204.83:38000 + queryCompanyPageUrl: /gwzh/OA/OA_GET_COMPANY_LIST + queryDepartmentPageUrl: /gwzh/OA/OA_GET_DEPARTMENT_LIST queryPersonPageUrl: /gwzh/OA/OA_GET_USER_LIST authorization: ${OA_AUTHORIZATION:${IAM_SSO_AUTHORIZATION:Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=}} + lbs: + # LBS 网关地址(车辆实时定位) + baseUrl: http://172.16.204.83:38000 + locateUrl: /gwzh/LBS/LBS_LOCATE + authorization: ${LBS_AUTHORIZATION:${OA_AUTHORIZATION:${IAM_SSO_AUTHORIZATION:Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=}}} track: # 轨迹开放接口地址 baseUrl: http://127.0.0.1:8080 diff --git a/doc/nacos/blade-prod.yaml b/doc/nacos/blade-prod.yaml index 7279339..cfc872f 100644 --- a/doc/nacos/blade-prod.yaml +++ b/doc/nacos/blade-prod.yaml @@ -58,9 +58,16 @@ thirdParty: baseUrl: http://127.0.0.1:8080 oa: # OA开放接口地址 - baseUrl: http://127.0.0.1:8080 + baseUrl: http://172.16.204.83:38000 + queryCompanyPageUrl: /gwzh/OA/OA_GET_COMPANY_LIST + queryDepartmentPageUrl: /gwzh/OA/OA_GET_DEPARTMENT_LIST queryPersonPageUrl: /gwzh/OA/OA_GET_USER_LIST authorization: ${OA_AUTHORIZATION:${IAM_SSO_AUTHORIZATION:Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=}} + lbs: + # LBS 网关地址(车辆实时定位) + baseUrl: http://172.16.204.83:38000 + locateUrl: /gwzh/LBS/LBS_LOCATE + authorization: ${LBS_AUTHORIZATION:${OA_AUTHORIZATION:${IAM_SSO_AUTHORIZATION:Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=}}} track: # 轨迹开放接口地址 baseUrl: http://127.0.0.1:8080 diff --git a/doc/nacos/third-party-api.yaml b/doc/nacos/third-party-api.yaml index baa53a0..e71be46 100644 --- a/doc/nacos/third-party-api.yaml +++ b/doc/nacos/third-party-api.yaml @@ -10,9 +10,16 @@ thirdParty: baseUrl: ${WPS_BASE_URL:http://127.0.0.1:8080} oa: # OA开放接口地址 - baseUrl: ${OA_BASE_URL:http://127.0.0.1:8080} + 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:}} + lbs: + # LBS 网关地址(车辆实时定位) + baseUrl: ${LBS_BASE_URL:${OA_BASE_URL:http://172.16.204.83:38000}} + locateUrl: ${LBS_LOCATE_URL:/gwzh/LBS/LBS_LOCATE} + authorization: ${LBS_AUTHORIZATION:${OA_AUTHORIZATION:${IAM_SSO_AUTHORIZATION:}}} track: # 轨迹开放接口地址 baseUrl: ${TRACK_BASE_URL:http://127.0.0.1:8080} diff --git a/pom.xml b/pom.xml index ae708e0..c4d7d9b 100644 --- a/pom.xml +++ b/pom.xml @@ -124,6 +124,11 @@ blade-oa-api ${revision} + + org.springblade + blade-lbs-api + ${revision} + org.springblade blade-open-api