From bd5bfe97c92d049587d926260ac3fbca8d0f4e91 Mon Sep 17 00:00:00 2001
From: 戈灵虎 <50576256@qq.com>
Date: Sun, 28 Dec 2025 23:16:55 +0800
Subject: [PATCH] feat: AI 工单
---
urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/api/ProblemsApiController.java | 184 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------
urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapConfiguration.java | 28 ++++++++++++++--------------
urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapProperties.java | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------
urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/GeoCodeService.java | 40 ++++++++++++++++++++--------------------
urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/impl/AmapGeoCodeServiceImpl.java | 400 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java | 4 ++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapConfiguration.java | 14 ++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapProperties.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/EventInfoController.java | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoPageReqVO.java | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoRespVO.java | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoSaveReqVO.java | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventOrderInfoSaveReqVO.java | 41 +++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/EventMappingInfoController.java | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoPageReqVO.java | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoRespVO.java | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoSaveReqVO.java | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/AppEventInfoController.java | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/vo/OrderEventApiSaveReqVO.java | 47 +++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventinfo/EventInfoDO.java | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventmappinginfo/EventMappingInfoDO.java | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventinfo/EventInfoMapper.java | 40 ++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventmappinginfo/EventMappingInfoMapper.java | 43 +++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java | 4 ++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/EventStatusEnum.java | 32 ++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/SysMappingEnum.java | 43 +++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoService.java | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoServiceImpl.java | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoService.java | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoServiceImpl.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/GeoCodeService.java | 20 ++++++++++++++++++++
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/impl/AmapGeoCodeServiceImpl.java | 199 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32 files changed, 2230 insertions(+), 377 deletions(-)
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapConfiguration.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapProperties.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/EventInfoController.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoPageReqVO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoRespVO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoSaveReqVO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventOrderInfoSaveReqVO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/EventMappingInfoController.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoPageReqVO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoRespVO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoSaveReqVO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/AppEventInfoController.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/vo/OrderEventApiSaveReqVO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventinfo/EventInfoDO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventmappinginfo/EventMappingInfoDO.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventinfo/EventInfoMapper.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventmappinginfo/EventMappingInfoMapper.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/EventStatusEnum.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/SysMappingEnum.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoService.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoServiceImpl.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoService.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoServiceImpl.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/GeoCodeService.java
create mode 100644 urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/impl/AmapGeoCodeServiceImpl.java
diff --git a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/api/ProblemsApiController.java b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/api/ProblemsApiController.java
index ed2870c..ea3b366 100644
--- a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/api/ProblemsApiController.java
+++ b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/api/ProblemsApiController.java
@@ -1,92 +1,92 @@
-package com.zteits.urbanops.module.gloabl.api;
-
-import com.zteits.urbanops.framework.common.pojo.CommonResult;
-import com.zteits.urbanops.framework.common.util.object.BeanUtils;
-import com.zteits.urbanops.module.gloabl.constants.SysMappingEnum;
-import com.zteits.urbanops.module.gloabl.controller.admin.problems.vo.ProblemsApiSaveReqVO;
-import com.zteits.urbanops.module.gloabl.controller.admin.problems.vo.ProblemsSaveReqVO;
-import com.zteits.urbanops.module.gloabl.service.geocode.GeoCodeService;
-import com.zteits.urbanops.module.gloabl.service.problems.ProblemsService;
-import io.swagger.v3.oas.annotations.Operation;
-import jakarta.annotation.Resource;
-import jakarta.annotation.security.PermitAll;
-import jakarta.validation.Valid;
-import lombok.RequiredArgsConstructor;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.time.LocalDateTime;
-
-import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
-
-
-/**
- * Description:
- *
- * Author: gelinghu
- * Date: 2025年6月15 11:56
- */
-@RestController
-@RequestMapping({"/gloabl/problems","/problems"})
-@RequiredArgsConstructor
-public class ProblemsApiController {
-
- @Resource
- private ProblemsService problemsService;
-
- @Resource
- private GeoCodeService geoCodeService;
-
- /**
- * {
- * "problemName": "问题名称",
- * "userConfrimRemark": "问题描述",
- * "userConfrimImgs": [], //问题照片
- * "userConfrimLat": "经度",
- * "userConfrimLon": "维度",
- * "companyCode": "", //业务系统编码,和统一认证保持一致,智慧园林:sls,智慧市政:sms
- * }
- * @param createReqVO
- * @return
- */
- @PostMapping("")
- @Operation(summary = "创建事件表--问题单")
- @PermitAll
- public CommonResult createProblems(@Valid @RequestBody ProblemsApiSaveReqVO createReqVO) {
- createReqVO.setProblemSourceId(6);
- String companyCode = createReqVO.getCompanyCode();
- if (!StringUtils.hasText(companyCode)) {
- return CommonResult.error(BAD_REQUEST, "子系统编码不能为空");
- }
-
- SysMappingEnum sys = SysMappingEnum.getBySysCode(companyCode);
- createReqVO.setCompanyCode(sys.name().toLowerCase());
- createReqVO.setCompanyName(sys.getDescription());
- createReqVO.setCreateBy("ai");
- createReqVO.setCreateTime(LocalDateTime.now());
- createReqVO.setUpdateBy("ai");
- createReqVO.setUpdateTime(LocalDateTime.now());
-
- ProblemsSaveReqVO vo = new ProblemsSaveReqVO();
- BeanUtils.copyProperties(createReqVO, vo);
- vo.setCompanyNo(createReqVO.getCompanyCode());
- // 调用高德API根据经纬度查询地址
- if (createReqVO.getUserConfrimLat() != null && createReqVO.getUserConfrimLon() != null) {
- try {
- String address = geoCodeService.getAddressByLocation(createReqVO.getUserConfrimLat(), createReqVO.getUserConfrimLon());
- if (StringUtils.hasText(address)) {
- vo.setUserConfrimAddr(address);
- }
- } catch (Exception e) {
- // 地址查询失败时不影响主流程,记录日志即可
- // log.warn("根据经纬度查询地址失败: lat={}, lon={}", createReqVO.getUserConfrimLat(), createReqVO.getUserConfrimLon(), e);
- }
- }
- return CommonResult.success(problemsService.createProblemsWithProblemNo(vo));
- }
-}
-
-
+//package com.zteits.urbanops.module.gloabl.api;
+//
+//import com.zteits.urbanops.framework.common.pojo.CommonResult;
+//import com.zteits.urbanops.framework.common.util.object.BeanUtils;
+//import com.zteits.urbanops.module.gloabl.constants.SysMappingEnum;
+//import com.zteits.urbanops.module.gloabl.controller.admin.problems.vo.ProblemsApiSaveReqVO;
+//import com.zteits.urbanops.module.gloabl.controller.admin.problems.vo.ProblemsSaveReqVO;
+//import com.zteits.urbanops.module.gloabl.service.geocode.GeoCodeService;
+//import com.zteits.urbanops.module.gloabl.service.problems.ProblemsService;
+//import io.swagger.v3.oas.annotations.Operation;
+//import jakarta.annotation.Resource;
+//import jakarta.annotation.security.PermitAll;
+//import jakarta.validation.Valid;
+//import lombok.RequiredArgsConstructor;
+//import org.springframework.util.StringUtils;
+//import org.springframework.web.bind.annotation.PostMapping;
+//import org.springframework.web.bind.annotation.RequestBody;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.time.LocalDateTime;
+//
+//import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
+//
+//
+///**
+// * Description:
+// *
+// * Author: gelinghu
+// * Date: 2025年6月15 11:56
+// */
+//@RestController
+//@RequestMapping({"/gloabl/problems","/problems"})
+//@RequiredArgsConstructor
+//public class ProblemsApiController {
+//
+// @Resource
+// private ProblemsService problemsService;
+//
+// @Resource
+// private GeoCodeService geoCodeService;
+//
+// /**
+// * {
+// * "problemName": "问题名称",
+// * "userConfrimRemark": "问题描述",
+// * "userConfrimImgs": [], //问题照片
+// * "userConfrimLat": "经度",
+// * "userConfrimLon": "维度",
+// * "companyCode": "", //业务系统编码,和统一认证保持一致,智慧园林:sls,智慧市政:sms
+// * }
+// * @param createReqVO
+// * @return
+// */
+// @PostMapping("")
+// @Operation(summary = "创建事件表--问题单")
+// @PermitAll
+// public CommonResult createProblems(@Valid @RequestBody ProblemsApiSaveReqVO createReqVO) {
+// createReqVO.setProblemSourceId(6);
+// String companyCode = createReqVO.getCompanyCode();
+// if (!StringUtils.hasText(companyCode)) {
+// return CommonResult.error(BAD_REQUEST, "子系统编码不能为空");
+// }
+//
+// SysMappingEnum sys = SysMappingEnum.getBySysCode(companyCode);
+// createReqVO.setCompanyCode(sys.name().toLowerCase());
+// createReqVO.setCompanyName(sys.getDescription());
+// createReqVO.setCreateBy("ai");
+// createReqVO.setCreateTime(LocalDateTime.now());
+// createReqVO.setUpdateBy("ai");
+// createReqVO.setUpdateTime(LocalDateTime.now());
+//
+// ProblemsSaveReqVO vo = new ProblemsSaveReqVO();
+// BeanUtils.copyProperties(createReqVO, vo);
+// vo.setCompanyNo(createReqVO.getCompanyCode());
+// // 调用高德API根据经纬度查询地址
+// if (createReqVO.getUserConfrimLat() != null && createReqVO.getUserConfrimLon() != null) {
+// try {
+// String address = geoCodeService.getAddressByLocation(createReqVO.getUserConfrimLat(), createReqVO.getUserConfrimLon());
+// if (StringUtils.hasText(address)) {
+// vo.setUserConfrimAddr(address);
+// }
+// } catch (Exception e) {
+// // 地址查询失败时不影响主流程,记录日志即可
+// // log.warn("根据经纬度查询地址失败: lat={}, lon={}", createReqVO.getUserConfrimLat(), createReqVO.getUserConfrimLon(), e);
+// }
+// }
+// return CommonResult.success(problemsService.createProblemsWithProblemNo(vo));
+// }
+//}
+//
+//
diff --git a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapConfiguration.java b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapConfiguration.java
index 33a171a..f15f7f1 100644
--- a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapConfiguration.java
+++ b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapConfiguration.java
@@ -1,14 +1,14 @@
-package com.zteits.urbanops.module.gloabl.config;
-
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * 高德地图配置类
- *
- * @author gelinghu
- */
-@Configuration
-@EnableConfigurationProperties({AmapProperties.class})
-public class AmapConfiguration {
-}
+//package com.zteits.urbanops.module.gloabl.config;
+//
+//import org.springframework.boot.context.properties.EnableConfigurationProperties;
+//import org.springframework.context.annotation.Configuration;
+//
+///**
+// * 高德地图配置类
+// *
+// * @author gelinghu
+// */
+//@Configuration
+//@EnableConfigurationProperties({AmapProperties.class})
+//public class AmapConfiguration {
+//}
diff --git a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapProperties.java b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapProperties.java
index 4ff449f..3db7894 100644
--- a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapProperties.java
+++ b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/config/AmapProperties.java
@@ -1,51 +1,51 @@
-package com.zteits.urbanops.module.gloabl.config;
-
-import jakarta.validation.constraints.NotBlank;
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.validation.annotation.Validated;
-
-
-/**
- * 高德地图 API 配置属性
- *
- * @author gelinghu
- */
-@Data
-@Validated
-@ConfigurationProperties(prefix = "amap")
-public class AmapProperties {
-
- /**
- * 高德地图 Web 服务 API Key
- */
- @NotBlank(message = "高德地图 API Key 不能为空")
- private String apiKey;
-
- /**
- * 私钥(用于数字签名,可选)
- * 注意:这不是必需的,高德API默认只需要Key
- * 只有在需要使用数字签名时才配置此参数
- */
- private String privateKey;
-
- /**
- * 是否启用数字签名
- */
- private Boolean enableSignature = false;
-
- /**
- * 地理编码 API 地址
- */
- private String geocodeUrl = "https://restapi.amap.com/v3/geocode/regeo";
-
- /**
- * 超时时间(毫秒)
- */
- private Integer timeout = 5000;
-
- /**
- * 是否启用
- */
- private Boolean enabled = true;
-}
+//package com.zteits.urbanops.module.gloabl.config;
+//
+//import jakarta.validation.constraints.NotBlank;
+//import lombok.Data;
+//import org.springframework.boot.context.properties.ConfigurationProperties;
+//import org.springframework.validation.annotation.Validated;
+//
+//
+///**
+// * 高德地图 API 配置属性
+// *
+// * @author gelinghu
+// */
+//@Data
+//@Validated
+//@ConfigurationProperties(prefix = "amap")
+//public class AmapProperties {
+//
+// /**
+// * 高德地图 Web 服务 API Key
+// */
+// @NotBlank(message = "高德地图 API Key 不能为空")
+// private String apiKey;
+//
+// /**
+// * 私钥(用于数字签名,可选)
+// * 注意:这不是必需的,高德API默认只需要Key
+// * 只有在需要使用数字签名时才配置此参数
+// */
+// private String privateKey;
+//
+// /**
+// * 是否启用数字签名
+// */
+// private Boolean enableSignature = false;
+//
+// /**
+// * 地理编码 API 地址
+// */
+// private String geocodeUrl = "https://restapi.amap.com/v3/geocode/regeo";
+//
+// /**
+// * 超时时间(毫秒)
+// */
+// private Integer timeout = 5000;
+//
+// /**
+// * 是否启用
+// */
+// private Boolean enabled = true;
+//}
diff --git a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/GeoCodeService.java b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/GeoCodeService.java
index 85ba83e..54023f3 100644
--- a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/GeoCodeService.java
+++ b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/GeoCodeService.java
@@ -1,20 +1,20 @@
-package com.zteits.urbanops.module.gloabl.service.geocode;
-
-import java.math.BigDecimal;
-
-/**
- * 地理编码服务接口
- *
- * @author gelinghu
- */
-public interface GeoCodeService {
-
- /**
- * 根据经纬度获取详细地址
- *
- * @param latitude 纬度
- * @param longitude 经度
- * @return 详细地址,如果获取失败返回 null
- */
- String getAddressByLocation(BigDecimal latitude, BigDecimal longitude);
-}
+//package com.zteits.urbanops.module.gloabl.service.geocode;
+//
+//import java.math.BigDecimal;
+//
+///**
+// * 地理编码服务接口
+// *
+// * @author gelinghu
+// */
+//public interface GeoCodeService {
+//
+// /**
+// * 根据经纬度获取详细地址
+// *
+// * @param latitude 纬度
+// * @param longitude 经度
+// * @return 详细地址,如果获取失败返回 null
+// */
+// String getAddressByLocation(BigDecimal latitude, BigDecimal longitude);
+//}
diff --git a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/impl/AmapGeoCodeServiceImpl.java b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/impl/AmapGeoCodeServiceImpl.java
index ac99ac3..87702b2 100644
--- a/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/impl/AmapGeoCodeServiceImpl.java
+++ b/urbanops-module-gloabl/src/main/java/com/zteits/urbanops/module/gloabl/service/geocode/impl/AmapGeoCodeServiceImpl.java
@@ -1,200 +1,200 @@
-package com.zteits.urbanops.module.gloabl.service.geocode.impl;
-
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.crypto.digest.MD5;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-
-import com.zteits.urbanops.framework.common.util.http.HttpUtils;
-import com.zteits.urbanops.module.gloabl.config.AmapProperties;
-import com.zteits.urbanops.module.gloabl.service.geocode.GeoCodeService;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.stereotype.Service;
-
-import java.math.BigDecimal;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * 高德地理编码服务实现
- *
- * @author gelinghu
- */
-@Slf4j
-@Service
-@RequiredArgsConstructor
-@ConditionalOnProperty(prefix = "amap", name = "enabled", havingValue = "true", matchIfMissing = true)
-public class AmapGeoCodeServiceImpl implements GeoCodeService {
-
- private final AmapProperties amapProperties;
-
- @Override
- public String getAddressByLocation(BigDecimal latitude, BigDecimal longitude) {
- if (latitude == null || longitude == null) {
- log.warn("[getAddressByLocation] 经纬度不能为空: lat={}, lon={}", latitude, longitude);
- return null;
- }
-
- try {
- // 将 BigDecimal 转换为 Double
- Double lat = latitude.doubleValue();
- Double lon = longitude.doubleValue();
-
- // 1. 构建请求参数
- Map params = buildRequestParams(lon, lat);
-
- // 2. 构建完整的请求 URL
- String url = buildRequestUrl(params);
-
- // 3. 发起 HTTP 请求
- String responseBody = HttpUtils.get(url);
- if (StrUtil.isBlank(responseBody)) {
- log.warn("[getAddressByLocation] 高德API响应为空: lat={}, lon={}", latitude, longitude);
- return null;
- }
-
- // 4. 解析响应结果
- return parseResponse(responseBody, latitude, longitude);
-
- } catch (Exception e) {
- log.error("[getAddressByLocation] 调用高德地理编码API异常: lat={}, lon={}", latitude, longitude, e);
- return null;
- }
- }
-
- /**
- * 构建请求参数
- */
- private Map buildRequestParams(Double longitude, Double latitude) {
- Map params = new HashMap<>();
- params.put("key", amapProperties.getApiKey());
- params.put("location", longitude + "," + latitude);
- params.put("poitype", ""); // 返回附近POI类型
- params.put("radius", "1000"); // 搜索半径,单位:米
- params.put("extensions", "base"); // 返回结果控制,base:返回基本地址信息;all:返回地址信息及附近POI、道路、交叉口等信息
- params.put("batch", "false"); // 批量查询控制
- params.put("roadlevel", "0"); // 道路等级
-
- // 如果启用了数字签名,则添加签名参数
- if (Boolean.TRUE.equals(amapProperties.getEnableSignature()) &&
- StrUtil.isNotBlank(amapProperties.getPrivateKey())) {
- String signature = generateSignature(params, amapProperties.getPrivateKey());
- params.put("sig", signature);
- }
-
- return params;
- }
-
- /**
- * 构建完整的请求 URL
- */
- private String buildRequestUrl(Map params) {
- StringBuilder url = new StringBuilder(amapProperties.getGeocodeUrl());
- url.append("?");
-
- boolean first = true;
- for (Map.Entry entry : params.entrySet()) {
- if (!first) {
- url.append("&");
- }
- try {
- url.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString()));
- } catch (Exception e) {
- url.append(entry.getKey()).append("=").append(entry.getValue());
- }
- first = false;
- }
-
- return url.toString();
- }
-
- /**
- * 生成数字签名
- * 高德API数字签名算法:
- * 1. 将请求参数按ASCII码升序排列
- * 2. 使用URL键值对的格式拼接
- * 3. 在字符串最后拼接上私钥
- * 4. 对整个字符串进行MD5加密
- *
- * @param params 请求参数
- * @param privateKey 私钥
- * @return 签名字符串
- */
- private String generateSignature(Map params, String privateKey) {
- try {
- // 使用TreeMap自动按key排序
- TreeMap sortedParams = new TreeMap<>(params);
-
- // 构建签名字符串
- StringBuilder signStr = new StringBuilder();
- boolean first = true;
-
- for (Map.Entry entry : sortedParams.entrySet()) {
- if (!first) {
- signStr.append("&");
- }
- signStr.append(entry.getKey()).append("=").append(entry.getValue());
- first = false;
- }
-
- // 在最后拼接私钥
- signStr.append(privateKey);
-
- // 对整个字符串进行MD5加密
- String signature = MD5.create().digestHex(signStr.toString());
-
- log.debug("[generateSignature] 签名字符串: {}, 签名结果: {}", signStr.toString(), signature);
-
- return signature;
-
- } catch (Exception e) {
- log.error("[generateSignature] 生成数字签名异常", e);
- return "";
- }
- }
-
- /**
- * 解析响应结果
- */
- private String parseResponse(String responseBody, BigDecimal latitude, BigDecimal longitude) {
- try {
- JSONObject response = JSONUtil.parseObj(responseBody);
-
- // 检查状态码
- String status = response.getStr("status");
- if (!"1".equals(status)) {
- String info = response.getStr("info");
- log.warn("[getAddressByLocation] 高德API返回错误: status={}, info={}, lat={}, lon={}",
- status, info, latitude, longitude);
- return null;
- }
-
- // 解析地址信息
- JSONObject regeocode = response.getJSONObject("regeocode");
- if (regeocode == null) {
- log.warn("[getAddressByLocation] 高德API未返回地址信息: lat={}, lon={}", latitude, longitude);
- return null;
- }
-
- String formattedAddress = regeocode.getStr("formatted_address");
- if (StrUtil.isNotBlank(formattedAddress)) {
- log.info("[getAddressByLocation] 成功获取地址: lat={}, lon={}, address={}",
- latitude, longitude, formattedAddress);
- return formattedAddress;
- }
-
- log.warn("[getAddressByLocation] 高德API返回的地址为空: lat={}, lon={}", latitude, longitude);
- return null;
-
- } catch (Exception e) {
- log.error("[getAddressByLocation] 解析高德API响应异常: lat={}, lon={}, response={}",
- latitude, longitude, responseBody, e);
- return null;
- }
- }
-}
+//package com.zteits.urbanops.module.gloabl.service.geocode.impl;
+//
+//import cn.hutool.core.util.StrUtil;
+//import cn.hutool.crypto.digest.MD5;
+//import cn.hutool.json.JSONObject;
+//import cn.hutool.json.JSONUtil;
+//
+//import com.zteits.urbanops.framework.common.util.http.HttpUtils;
+//import com.zteits.urbanops.module.gloabl.config.AmapProperties;
+//import com.zteits.urbanops.module.gloabl.service.geocode.GeoCodeService;
+//import lombok.RequiredArgsConstructor;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+//import org.springframework.stereotype.Service;
+//
+//import java.math.BigDecimal;
+//import java.net.URLEncoder;
+//import java.nio.charset.StandardCharsets;
+//import java.util.HashMap;
+//import java.util.Map;
+//import java.util.TreeMap;
+//
+///**
+// * 高德地理编码服务实现
+// *
+// * @author gelinghu
+// */
+//@Slf4j
+//@Service
+//@RequiredArgsConstructor
+//@ConditionalOnProperty(prefix = "amap", name = "enabled", havingValue = "true", matchIfMissing = true)
+//public class AmapGeoCodeServiceImpl implements GeoCodeService {
+//
+// private final AmapProperties amapProperties;
+//
+// @Override
+// public String getAddressByLocation(BigDecimal latitude, BigDecimal longitude) {
+// if (latitude == null || longitude == null) {
+// log.warn("[getAddressByLocation] 经纬度不能为空: lat={}, lon={}", latitude, longitude);
+// return null;
+// }
+//
+// try {
+// // 将 BigDecimal 转换为 Double
+// Double lat = latitude.doubleValue();
+// Double lon = longitude.doubleValue();
+//
+// // 1. 构建请求参数
+// Map params = buildRequestParams(lon, lat);
+//
+// // 2. 构建完整的请求 URL
+// String url = buildRequestUrl(params);
+//
+// // 3. 发起 HTTP 请求
+// String responseBody = HttpUtils.get(url);
+// if (StrUtil.isBlank(responseBody)) {
+// log.warn("[getAddressByLocation] 高德API响应为空: lat={}, lon={}", latitude, longitude);
+// return null;
+// }
+//
+// // 4. 解析响应结果
+// return parseResponse(responseBody, latitude, longitude);
+//
+// } catch (Exception e) {
+// log.error("[getAddressByLocation] 调用高德地理编码API异常: lat={}, lon={}", latitude, longitude, e);
+// return null;
+// }
+// }
+//
+// /**
+// * 构建请求参数
+// */
+// private Map buildRequestParams(Double longitude, Double latitude) {
+// Map params = new HashMap<>();
+// params.put("key", amapProperties.getApiKey());
+// params.put("location", longitude + "," + latitude);
+// params.put("poitype", ""); // 返回附近POI类型
+// params.put("radius", "1000"); // 搜索半径,单位:米
+// params.put("extensions", "base"); // 返回结果控制,base:返回基本地址信息;all:返回地址信息及附近POI、道路、交叉口等信息
+// params.put("batch", "false"); // 批量查询控制
+// params.put("roadlevel", "0"); // 道路等级
+//
+// // 如果启用了数字签名,则添加签名参数
+// if (Boolean.TRUE.equals(amapProperties.getEnableSignature()) &&
+// StrUtil.isNotBlank(amapProperties.getPrivateKey())) {
+// String signature = generateSignature(params, amapProperties.getPrivateKey());
+// params.put("sig", signature);
+// }
+//
+// return params;
+// }
+//
+// /**
+// * 构建完整的请求 URL
+// */
+// private String buildRequestUrl(Map params) {
+// StringBuilder url = new StringBuilder(amapProperties.getGeocodeUrl());
+// url.append("?");
+//
+// boolean first = true;
+// for (Map.Entry entry : params.entrySet()) {
+// if (!first) {
+// url.append("&");
+// }
+// try {
+// url.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString()));
+// } catch (Exception e) {
+// url.append(entry.getKey()).append("=").append(entry.getValue());
+// }
+// first = false;
+// }
+//
+// return url.toString();
+// }
+//
+// /**
+// * 生成数字签名
+// * 高德API数字签名算法:
+// * 1. 将请求参数按ASCII码升序排列
+// * 2. 使用URL键值对的格式拼接
+// * 3. 在字符串最后拼接上私钥
+// * 4. 对整个字符串进行MD5加密
+// *
+// * @param params 请求参数
+// * @param privateKey 私钥
+// * @return 签名字符串
+// */
+// private String generateSignature(Map params, String privateKey) {
+// try {
+// // 使用TreeMap自动按key排序
+// TreeMap sortedParams = new TreeMap<>(params);
+//
+// // 构建签名字符串
+// StringBuilder signStr = new StringBuilder();
+// boolean first = true;
+//
+// for (Map.Entry entry : sortedParams.entrySet()) {
+// if (!first) {
+// signStr.append("&");
+// }
+// signStr.append(entry.getKey()).append("=").append(entry.getValue());
+// first = false;
+// }
+//
+// // 在最后拼接私钥
+// signStr.append(privateKey);
+//
+// // 对整个字符串进行MD5加密
+// String signature = MD5.create().digestHex(signStr.toString());
+//
+// log.debug("[generateSignature] 签名字符串: {}, 签名结果: {}", signStr.toString(), signature);
+//
+// return signature;
+//
+// } catch (Exception e) {
+// log.error("[generateSignature] 生成数字签名异常", e);
+// return "";
+// }
+// }
+//
+// /**
+// * 解析响应结果
+// */
+// private String parseResponse(String responseBody, BigDecimal latitude, BigDecimal longitude) {
+// try {
+// JSONObject response = JSONUtil.parseObj(responseBody);
+//
+// // 检查状态码
+// String status = response.getStr("status");
+// if (!"1".equals(status)) {
+// String info = response.getStr("info");
+// log.warn("[getAddressByLocation] 高德API返回错误: status={}, info={}, lat={}, lon={}",
+// status, info, latitude, longitude);
+// return null;
+// }
+//
+// // 解析地址信息
+// JSONObject regeocode = response.getJSONObject("regeocode");
+// if (regeocode == null) {
+// log.warn("[getAddressByLocation] 高德API未返回地址信息: lat={}, lon={}", latitude, longitude);
+// return null;
+// }
+//
+// String formattedAddress = regeocode.getStr("formatted_address");
+// if (StrUtil.isNotBlank(formattedAddress)) {
+// log.info("[getAddressByLocation] 成功获取地址: lat={}, lon={}, address={}",
+// latitude, longitude, formattedAddress);
+// return formattedAddress;
+// }
+//
+// log.warn("[getAddressByLocation] 高德API返回的地址为空: lat={}, lon={}", latitude, longitude);
+// return null;
+//
+// } catch (Exception e) {
+// log.error("[getAddressByLocation] 解析高德API响应异常: lat={}, lon={}, response={}",
+// latitude, longitude, responseBody, e);
+// return null;
+// }
+// }
+//}
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
index 49404b6..2553e1e 100644
--- a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
@@ -119,6 +119,10 @@ public class BpmCommonConstant {
* 全域工单流程前缀
*/
public static final String WORK_ORDER_PREFFIX_UNIVERSE = "UWO";
+ /**
+ * 全域工单事件前缀
+ */
+ public static final String EVENT_INFO_PREFFIX_UNIVERSE = "PRB";
/**
* 全域大区经理工单编号前缀
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapConfiguration.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapConfiguration.java
new file mode 100644
index 0000000..7b9c1ef
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapConfiguration.java
@@ -0,0 +1,14 @@
+package com.zteits.urbanops.module.workorder.config;
+
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 高德地图配置类
+ *
+ * @author gelinghu
+ */
+@Configuration
+@EnableConfigurationProperties({AmapProperties.class})
+public class AmapConfiguration {
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapProperties.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapProperties.java
new file mode 100644
index 0000000..0b8d55b
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/AmapProperties.java
@@ -0,0 +1,51 @@
+package com.zteits.urbanops.module.workorder.config;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.validation.annotation.Validated;
+
+
+/**
+ * 高德地图 API 配置属性
+ *
+ * @author gelinghu
+ */
+@Data
+@Validated
+@ConfigurationProperties(prefix = "amap")
+public class AmapProperties {
+
+ /**
+ * 高德地图 Web 服务 API Key
+ */
+ @NotBlank(message = "高德地图 API Key 不能为空")
+ private String apiKey;
+
+ /**
+ * 私钥(用于数字签名,可选)
+ * 注意:这不是必需的,高德API默认只需要Key
+ * 只有在需要使用数字签名时才配置此参数
+ */
+ private String privateKey;
+
+ /**
+ * 是否启用数字签名
+ */
+ private Boolean enableSignature = false;
+
+ /**
+ * 地理编码 API 地址
+ */
+ private String geocodeUrl = "https://restapi.amap.com/v3/geocode/regeo";
+
+ /**
+ * 超时时间(毫秒)
+ */
+ private Integer timeout = 5000;
+
+ /**
+ * 是否启用
+ */
+ private Boolean enabled = true;
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/EventInfoController.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/EventInfoController.java
new file mode 100644
index 0000000..e84bc77
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/EventInfoController.java
@@ -0,0 +1,133 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventinfo;
+
+import com.zteits.urbanops.module.garden.api.road.RoadApi;
+import com.zteits.urbanops.module.garden.dto.road.RoadReqDTO;
+import com.zteits.urbanops.module.garden.dto.road.RoadRespDTO;
+import org.springframework.web.bind.annotation.*;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import jakarta.validation.constraints.*;
+import jakarta.validation.*;
+import jakarta.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import com.zteits.urbanops.framework.common.pojo.PageParam;
+import com.zteits.urbanops.framework.common.pojo.PageResult;
+import com.zteits.urbanops.framework.common.pojo.CommonResult;
+import com.zteits.urbanops.framework.common.util.object.BeanUtils;
+import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
+
+import com.zteits.urbanops.framework.excel.core.util.ExcelUtils;
+
+import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog;
+import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.*;
+import com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo.EventInfoDO;
+import com.zteits.urbanops.module.workorder.service.eventinfo.EventInfoService;
+
+@Tag(name = "管理后台 - 工单事件")
+@RestController
+@RequestMapping("/workorder/event-info")
+@Validated
+public class EventInfoController {
+
+ @Resource
+ private EventInfoService eventInfoService;
+
+ @Resource
+ private RoadApi roadApi;
+
+ @GetMapping("/listRoadInfo")
+ //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:query')")
+ @Operation(summary = "app-获取道路信息")
+ public CommonResult> getRoadInfoBy(@Valid RoadReqDTO reqDTO) {
+ return success(roadApi.getRoadInfoBy(reqDTO));
+ }
+
+ @PostMapping("/create")
+ @Operation(summary = "创建工单事件")
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:create')")
+ public CommonResult createEventInfo(@Valid @RequestBody EventInfoSaveReqVO createReqVO) {
+ return success(eventInfoService.createEventInfo(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新工单事件")
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:update')")
+ public CommonResult updateEventInfo(@Valid @RequestBody EventInfoSaveReqVO updateReqVO) {
+ eventInfoService.updateEventInfo(updateReqVO);
+ return success(true);
+ }
+
+ @PutMapping("/end")
+ @Operation(summary = "结束工单事件")
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:end')")
+ public CommonResult endEventInfo(@Valid @RequestParam("id") Long id) {
+ eventInfoService.endEventInfo(id);
+ return success(true);
+ }
+
+ @PostMapping("/order")
+ @Operation(summary = "创建事件对应工单")
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:order')")
+ public CommonResult createEventOrderInfo(@Valid @RequestBody EventOrderInfoSaveReqVO createReqVO) {
+ eventInfoService.createEventOrderInfo(createReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除工单事件")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:delete')")
+ public CommonResult deleteEventInfo(@RequestParam("id") Long id) {
+ eventInfoService.deleteEventInfo(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除工单事件")
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:delete')")
+ public CommonResult deleteEventInfoList(@RequestParam("ids") List ids) {
+ eventInfoService.deleteEventInfoListByIds(ids);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得工单事件")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:query')")
+ public CommonResult getEventInfo(@RequestParam("id") Long id) {
+ EventInfoDO eventInfo = eventInfoService.getEventInfo(id);
+ return success(BeanUtils.toBean(eventInfo, EventInfoRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得工单事件分页")
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:query')")
+ public CommonResult> getEventInfoPage(@Valid EventInfoPageReqVO pageReqVO) {
+ PageResult pageResult = eventInfoService.getEventInfoPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, EventInfoRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出工单事件 Excel")
+ @PreAuthorize("@ss.hasPermission('workorder:event-info:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportEventInfoExcel(@Valid EventInfoPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = eventInfoService.getEventInfoPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "工单事件.xls", "数据", EventInfoRespVO.class,
+ BeanUtils.toBean(list, EventInfoRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoPageReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoPageReqVO.java
new file mode 100644
index 0000000..d804736
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoPageReqVO.java
@@ -0,0 +1,65 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import com.zteits.urbanops.framework.common.pojo.PageParam;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 工单事件分页 Request VO")
+@Data
+public class EventInfoPageReqVO extends PageParam {
+
+ @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ")
+ private String busiLine;
+
+ @Schema(description = "事件编号")
+ private String eventNo;
+
+ @Schema(description = "事件名称", example = "王五")
+ private String evetName;
+
+ @Schema(description = "事件设备", example = "王五")
+ private String eventDevice;
+
+ @Schema(description = "事件设备编码", example = "王五")
+ private String eventDeviceCode;
+
+ @Schema(description = "提交时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] commitDate;
+
+ @Schema(description = "完成时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] finishDate;
+
+ @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "1")
+ private Integer latLonType;
+
+ @Schema(description = "经度")
+ private BigDecimal lat;
+
+ @Schema(description = "维度")
+ private BigDecimal lon;
+
+ @Schema(description = "经纬度地址")
+ private String lonLatAddress;
+
+ @Schema(description = "用户提交照片")
+ private String confrimImgs;
+
+ @Schema(description = "事件状态", example = "1")
+ private Integer eventStatus;
+
+ @Schema(description = "事件描述", example = "你说的对")
+ private String remark;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoRespVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoRespVO.java
new file mode 100644
index 0000000..fd7a676
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoRespVO.java
@@ -0,0 +1,86 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import cn.idev.excel.annotation.*;
+
+@Schema(description = "管理后台 - 工单事件 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class EventInfoRespVO {
+
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24349")
+ @ExcelProperty("ID")
+ private Long id;
+
+ @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("业务线:yl 园林,wy 物业,sz 市政 ")
+ private String busiLine;
+
+ @Schema(description = "事件编号", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("事件编号")
+ private String eventNo;
+
+ @Schema(description = "事件名称", example = "王五")
+ @ExcelProperty("事件名称")
+ private String evetName;
+
+ @Schema(description = "事件设备", example = "王五")
+ @ExcelProperty("事件设备")
+ private String eventDevice;
+
+ @Schema(description = "事件设备编码", example = "王五")
+ @ExcelProperty("事件设备编码")
+ private String eventDeviceCode;
+
+ @Schema(description = "提交时间")
+ @ExcelProperty("提交时间")
+ private LocalDateTime commitDate;
+
+ @Schema(description = "完成时间")
+ @ExcelProperty("完成时间")
+ private LocalDateTime finishDate;
+
+ @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "1")
+ @ExcelProperty("经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯")
+ private Integer latLonType;
+
+ @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("经度")
+ private BigDecimal lat;
+
+ @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("维度")
+ private BigDecimal lon;
+
+ @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("经纬度地址")
+ private String lonLatAddress;
+
+ @Schema(description = "用户提交照片", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("用户提交照片")
+ private String confrimImgs;
+
+ @Schema(description = "事件状态", example = "1")
+ @ExcelProperty("事件状态")
+ private Integer eventStatus;
+
+ @Schema(description = "事件描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
+ @ExcelProperty("事件描述")
+ private String remark;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+ @Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("创建人")
+ private String creator;
+
+
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoSaveReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoSaveReqVO.java
new file mode 100644
index 0000000..ac9d4e9
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoSaveReqVO.java
@@ -0,0 +1,69 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import jakarta.validation.constraints.*;
+import java.math.BigDecimal;
+
+import org.apache.ibatis.type.JdbcType;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 工单事件新增/修改 Request VO")
+@Data
+public class EventInfoSaveReqVO {
+
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24349")
+ private Long id;
+
+ @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "业务线:yl 园林,wy 物业,sz 市政 不能为空")
+ private String busiLine;
+
+ @Schema(description = "事件编号", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "事件编号不能为空")
+ private String eventNo;
+
+ @Schema(description = "事件名称", example = "王五")
+ private String evetName;
+
+ @Schema(description = "提交时间")
+ private LocalDateTime commitDate;
+
+ @Schema(description = "完成时间")
+ private LocalDateTime finishDate;
+
+ @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "1")
+ private Integer latLonType;
+
+ @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "经度不能为空")
+ private BigDecimal lat;
+
+ @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "维度不能为空")
+ private BigDecimal lon;
+
+ @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "经纬度地址不能为空")
+ private String lonLatAddress;
+
+ @Schema(description = "用户提交照片", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "用户提交照片不能为空")
+ private String[] confrimImgs;
+
+ @Schema(description = "事件状态", example = "1")
+ private Integer eventStatus;
+
+ @Schema(description = "事件描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
+ @NotEmpty(message = "事件描述不能为空")
+ private String remark;
+
+ private LocalDateTime createTime;
+
+ private String creator;
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventOrderInfoSaveReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventOrderInfoSaveReqVO.java
new file mode 100644
index 0000000..fdf0eae
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventOrderInfoSaveReqVO.java
@@ -0,0 +1,41 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo;
+
+import cn.idev.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 事件工单创建 Request VO")
+@Data
+public class EventOrderInfoSaveReqVO {
+
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24349")
+ private Long id;
+
+ @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "工单处理方不能为空")
+ private String busiLine;
+
+ @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25903")
+ @NotEmpty(message = "道路名称不能为空")
+ private String roadId;
+
+ @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+ @ExcelProperty("道路名称")
+ private String roadName;
+
+ @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "紧急程度不能为空")
+ private Integer pressingType;
+
+ @Schema(description = "希望完成时间")
+ private LocalDateTime expectedFinishDate;
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/EventMappingInfoController.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/EventMappingInfoController.java
new file mode 100644
index 0000000..21f07f9
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/EventMappingInfoController.java
@@ -0,0 +1,104 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventmappinginfo;
+
+import org.springframework.web.bind.annotation.*;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import jakarta.validation.constraints.*;
+import jakarta.validation.*;
+import jakarta.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import com.zteits.urbanops.framework.common.pojo.PageParam;
+import com.zteits.urbanops.framework.common.pojo.PageResult;
+import com.zteits.urbanops.framework.common.pojo.CommonResult;
+import com.zteits.urbanops.framework.common.util.object.BeanUtils;
+import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
+
+import com.zteits.urbanops.framework.excel.core.util.ExcelUtils;
+
+import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog;
+import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import com.zteits.urbanops.module.workorder.controller.admin.eventmappinginfo.vo.*;
+import com.zteits.urbanops.module.workorder.dal.dataobject.eventmappinginfo.EventMappingInfoDO;
+import com.zteits.urbanops.module.workorder.service.eventmappinginfo.EventMappingInfoService;
+
+@Tag(name = "管理后台 - 工单事件映射")
+@RestController
+@RequestMapping("/workorder/event-mapping-info")
+@Validated
+public class EventMappingInfoController {
+
+ @Resource
+ private EventMappingInfoService eventMappingInfoService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建工单事件映射")
+ @PreAuthorize("@ss.hasPermission('workorder:event-mapping-info:create')")
+ public CommonResult createEventMappingInfo(@Valid @RequestBody EventMappingInfoSaveReqVO createReqVO) {
+ return success(eventMappingInfoService.createEventMappingInfo(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新工单事件映射")
+ @PreAuthorize("@ss.hasPermission('workorder:event-mapping-info:update')")
+ public CommonResult updateEventMappingInfo(@Valid @RequestBody EventMappingInfoSaveReqVO updateReqVO) {
+ eventMappingInfoService.updateEventMappingInfo(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除工单事件映射")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('workorder:event-mapping-info:delete')")
+ public CommonResult deleteEventMappingInfo(@RequestParam("id") Long id) {
+ eventMappingInfoService.deleteEventMappingInfo(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除工单事件映射")
+ @PreAuthorize("@ss.hasPermission('workorder:event-mapping-info:delete')")
+ public CommonResult deleteEventMappingInfoList(@RequestParam("ids") List ids) {
+ eventMappingInfoService.deleteEventMappingInfoListByIds(ids);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得工单事件映射")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('workorder:event-mapping-info:query')")
+ public CommonResult getEventMappingInfo(@RequestParam("id") Long id) {
+ EventMappingInfoDO eventMappingInfo = eventMappingInfoService.getEventMappingInfo(id);
+ return success(BeanUtils.toBean(eventMappingInfo, EventMappingInfoRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得工单事件映射分页")
+ @PreAuthorize("@ss.hasPermission('workorder:event-mapping-info:query')")
+ public CommonResult> getEventMappingInfoPage(@Valid EventMappingInfoPageReqVO pageReqVO) {
+ PageResult pageResult = eventMappingInfoService.getEventMappingInfoPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, EventMappingInfoRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出工单事件映射 Excel")
+ @PreAuthorize("@ss.hasPermission('workorder:event-mapping-info:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportEventMappingInfoExcel(@Valid EventMappingInfoPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = eventMappingInfoService.getEventMappingInfoPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "工单事件映射.xls", "数据", EventMappingInfoRespVO.class,
+ BeanUtils.toBean(list, EventMappingInfoRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoPageReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoPageReqVO.java
new file mode 100644
index 0000000..92bf0e0
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoPageReqVO.java
@@ -0,0 +1,74 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventmappinginfo.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import com.zteits.urbanops.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 工单事件映射分页 Request VO")
+@Data
+public class EventMappingInfoPageReqVO extends PageParam {
+
+ @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ")
+ private String busiLine;
+
+ @Schema(description = "事件编号")
+ private String eventNo;
+
+ @Schema(description = "工单号")
+ private String orderNo;
+
+ @Schema(description = "道路ID", example = "25903")
+ private Long roadId;
+
+ @Schema(description = "道路名称", example = "张三")
+ private String roadName;
+
+ @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", example = "1")
+ private Integer pressingType;
+
+ @Schema(description = "养护级别ID", example = "12350")
+ private Integer curingLevelId;
+
+ @Schema(description = "养护级别", example = "赵六")
+ private String curingLevelName;
+
+ @Schema(description = "提交时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] commitDate;
+
+ @Schema(description = "希望完成时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] expectedFinishDate;
+
+ @Schema(description = "完成时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] finishDate;
+
+ @Schema(description = "提交用户ID", example = "25064")
+ private Long userId;
+
+ @Schema(description = "提交用户名称", example = "李四")
+ private String userName;
+
+ @Schema(description = "提交用户的company_id", example = "26902")
+ private Long companyId;
+
+ @Schema(description = "部门id", example = "12715")
+ private Long deptId;
+
+ @Schema(description = "审批状态", example = "1")
+ private Integer status;
+
+ @Schema(description = "备注", example = "你猜")
+ private String remark;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoRespVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoRespVO.java
new file mode 100644
index 0000000..db8add4
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoRespVO.java
@@ -0,0 +1,91 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventmappinginfo.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import cn.idev.excel.annotation.*;
+
+@Schema(description = "管理后台 - 工单事件映射 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class EventMappingInfoRespVO {
+
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5347")
+ @ExcelProperty("ID")
+ private Long id;
+
+ @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("业务线:yl 园林,wy 物业,sz 市政 ")
+ private String busiLine;
+
+ @Schema(description = "事件编号", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("事件编号")
+ private String eventNo;
+
+ @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("工单号")
+ private String orderNo;
+
+ @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25903")
+ @ExcelProperty("道路ID")
+ private Long roadId;
+
+ @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+ @ExcelProperty("道路名称")
+ private String roadName;
+
+ @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @ExcelProperty("紧急程度:1:特急;2:紧急;3:一般")
+ private Integer pressingType;
+
+ @Schema(description = "养护级别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12350")
+ @ExcelProperty("养护级别ID")
+ private Integer curingLevelId;
+
+ @Schema(description = "养护级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
+ @ExcelProperty("养护级别")
+ private String curingLevelName;
+
+ @Schema(description = "提交时间")
+ @ExcelProperty("提交时间")
+ private LocalDateTime commitDate;
+
+ @Schema(description = "希望完成时间")
+ @ExcelProperty("希望完成时间")
+ private LocalDateTime expectedFinishDate;
+
+ @Schema(description = "完成时间")
+ @ExcelProperty("完成时间")
+ private LocalDateTime finishDate;
+
+ @Schema(description = "提交用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25064")
+ @ExcelProperty("提交用户ID")
+ private Long userId;
+
+ @Schema(description = "提交用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+ @ExcelProperty("提交用户名称")
+ private String userName;
+
+ @Schema(description = "提交用户的company_id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26902")
+ @ExcelProperty("提交用户的company_id")
+ private Long companyId;
+
+ @Schema(description = "部门id", example = "12715")
+ @ExcelProperty("部门id")
+ private Long deptId;
+
+ @Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @ExcelProperty("审批状态")
+ private Integer status;
+
+ @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
+ @ExcelProperty("备注")
+ private String remark;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoSaveReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoSaveReqVO.java
new file mode 100644
index 0000000..adbd14f
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventmappinginfo/vo/EventMappingInfoSaveReqVO.java
@@ -0,0 +1,81 @@
+package com.zteits.urbanops.module.workorder.controller.admin.eventmappinginfo.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import jakarta.validation.constraints.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 工单事件映射新增/修改 Request VO")
+@Data
+public class EventMappingInfoSaveReqVO {
+
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5347")
+ private Long id;
+
+ @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "业务线:yl 园林,wy 物业,sz 市政 不能为空")
+ private String busiLine;
+
+ @Schema(description = "事件编号", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "事件编号不能为空")
+ private String eventNo;
+
+ @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "工单号不能为空")
+ private String orderNo;
+
+ @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25903")
+ @NotNull(message = "道路ID不能为空")
+ private Long roadId;
+
+ @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+ @NotEmpty(message = "道路名称不能为空")
+ private String roadName;
+
+ @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般不能为空")
+ private Integer pressingType;
+
+ @Schema(description = "养护级别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12350")
+ @NotNull(message = "养护级别ID不能为空")
+ private Integer curingLevelId;
+
+ @Schema(description = "养护级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
+ @NotEmpty(message = "养护级别不能为空")
+ private String curingLevelName;
+
+ @Schema(description = "提交时间")
+ private LocalDateTime commitDate;
+
+ @Schema(description = "希望完成时间")
+ private LocalDateTime expectedFinishDate;
+
+ @Schema(description = "完成时间")
+ private LocalDateTime finishDate;
+
+ @Schema(description = "提交用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25064")
+ @NotNull(message = "提交用户ID不能为空")
+ private Long userId;
+
+ @Schema(description = "提交用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+ @NotEmpty(message = "提交用户名称不能为空")
+ private String userName;
+
+ @Schema(description = "提交用户的company_id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26902")
+ @NotNull(message = "提交用户的company_id不能为空")
+ private Long companyId;
+
+ @Schema(description = "部门id", example = "12715")
+ private Long deptId;
+
+ @Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "审批状态不能为空")
+ private Integer status;
+
+ @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
+ @NotEmpty(message = "备注不能为空")
+ private String remark;
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/AppEventInfoController.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/AppEventInfoController.java
new file mode 100644
index 0000000..4381a0e
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/AppEventInfoController.java
@@ -0,0 +1,95 @@
+package com.zteits.urbanops.module.workorder.controller.app.eventinfo;
+
+import com.zteits.urbanops.framework.common.pojo.CommonResult;
+import com.zteits.urbanops.framework.common.util.object.BeanUtils;
+import com.zteits.urbanops.module.garden.api.road.RoadApi;
+import com.zteits.urbanops.module.workorder.api.WorkOrderApi;
+import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.EventInfoSaveReqVO;
+import com.zteits.urbanops.module.workorder.controller.app.eventinfo.vo.OrderEventApiSaveReqVO;
+import com.zteits.urbanops.module.workorder.enums.EventStatusEnum;
+import com.zteits.urbanops.module.workorder.enums.SysMappingEnum;
+import com.zteits.urbanops.module.workorder.service.eventinfo.EventInfoService;
+import com.zteits.urbanops.module.workorder.service.geocode.GeoCodeService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.annotation.security.PermitAll;
+import jakarta.validation.Valid;
+import org.springframework.util.StringUtils;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDateTime;
+
+import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
+import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
+import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.EVENT_INFO_PREFFIX_UNIVERSE;
+
+@Tag(name = "管理后台 - 工单事件")
+@RestController
+@RequestMapping("/workorder/event-info")
+@Validated
+public class AppEventInfoController {
+
+ @Resource
+ private EventInfoService eventInfoService;
+
+ @Resource
+ private WorkOrderApi workOrderApi;
+
+ @Resource
+ private GeoCodeService geoCodeService;
+
+ /**
+ * {
+ * "problemName": "问题名称",
+ * "userConfrimRemark": "问题描述",
+ * "userConfrimImgs": [], //问题照片
+ * "userConfrimLat": "经度",
+ * "userConfrimLon": "维度",
+ * "companyCode": "", //业务系统编码,和统一认证保持一致,智慧园林:sls,智慧市政:sms
+ * }
+ * @param createReqVO
+ * @return
+ */
+ @PostMapping("")
+ @Operation(summary = "工单事件创建")
+ @PermitAll
+ public CommonResult createProblems(@Valid @RequestBody OrderEventApiSaveReqVO createReqVO) {
+ String companyCode = createReqVO.getCompanyCode();
+ if (!StringUtils.hasText(companyCode)) {
+ return CommonResult.error(BAD_REQUEST, "子系统编码不能为空");
+ }
+
+ SysMappingEnum sys = SysMappingEnum.getBySysCode(companyCode);
+
+ EventInfoSaveReqVO vo = new EventInfoSaveReqVO();
+ String eventNo = workOrderApi.generateWONum(EVENT_INFO_PREFFIX_UNIVERSE);
+ vo.setEventNo(eventNo);
+ vo.setEventStatus(EventStatusEnum.PENDING.getCode());
+ vo.setBusiLine(sys.name().toLowerCase());
+ vo.setLon(createReqVO.getUserConfrimLon());
+ vo.setLat(createReqVO.getUserConfrimLat());
+ vo.setConfrimImgs(createReqVO.getUserConfrimImgs());
+ vo.setCommitDate(LocalDateTime.now());
+ vo.setEvetName(createReqVO.getProblemName());
+ vo.setLatLonType(3);
+ vo.setCreator("设备");
+ vo.setRemark(createReqVO.getUserConfrimRemark());
+ // 调用高德API根据经纬度查询地址
+ if (createReqVO.getUserConfrimLat() != null && createReqVO.getUserConfrimLon() != null) {
+ try {
+ String address = geoCodeService.getAddressByLocation(createReqVO.getUserConfrimLat(), createReqVO.getUserConfrimLon());
+ if (StringUtils.hasText(address)) {
+ vo.setLonLatAddress(address);
+ }
+ } catch (Exception e) {
+ // 地址查询失败时不影响主流程,记录日志即可
+ // log.warn("根据经纬度查询地址失败: lat={}, lon={}", createReqVO.getUserConfrimLat(), createReqVO.getUserConfrimLon(), e);
+ }
+ }
+ eventInfoService.createEventInfo(vo);
+ return success(eventNo);
+ }
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/vo/OrderEventApiSaveReqVO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/vo/OrderEventApiSaveReqVO.java
new file mode 100644
index 0000000..853fc1a
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/vo/OrderEventApiSaveReqVO.java
@@ -0,0 +1,47 @@
+package com.zteits.urbanops.module.workorder.controller.app.eventinfo.vo;
+
+import com.alibaba.fastjson.JSONArray;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 事件表--问题单新增/修改 Request VO")
+@Data
+public class OrderEventApiSaveReqVO {
+
+ @Schema(description = "问题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+ @NotEmpty(message = "问题名称不能为空")
+ private String problemName;
+
+ @Schema(description = "设备编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "123")
+ private String deviceCode;
+
+ @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+ private String device;
+
+ @Schema(description = "用户提交问题描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
+ @NotEmpty(message = "用户提交问题描述不能为空")
+ private String userConfrimRemark;
+
+ @Schema(description = "用户提交时间")
+ private LocalDateTime userConfrimTime;
+
+ @Schema(description = "用户提交照片", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "用户提交照片不能为空")
+ private String[] userConfrimImgs;
+
+ @Schema(description = "用户提交经度", requiredMode = Schema.RequiredMode.REQUIRED)
+ //@NotNull(message = "用户提交经度不能为空")
+ private BigDecimal userConfrimLat;
+
+ @Schema(description = "用户提交维度", requiredMode = Schema.RequiredMode.REQUIRED)
+ //@NotNull(message = "用户提交维度不能为空")
+ private BigDecimal userConfrimLon;
+
+ @Schema(description = "子系统编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String companyCode;
+
+}
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventinfo/EventInfoDO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventinfo/EventInfoDO.java
new file mode 100644
index 0000000..90ff3c5
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventinfo/EventInfoDO.java
@@ -0,0 +1,94 @@
+package com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 工单事件 DO
+ *
+ * @author 超级管理员
+ */
+@TableName("workorder_event_info")
+@KeySequence("workorder_event_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class EventInfoDO extends BaseDO {
+
+ /**
+ * ID
+ */
+ @TableId
+ private Long id;
+ /**
+ * 业务线:yl 园林,wy 物业,sz 市政
+ */
+ private String busiLine;
+ /**
+ * 事件编号
+ */
+ private String eventNo;
+ /**
+ * 事件名称
+ */
+ private String evetName;
+
+ /**
+ * 事件设备
+ */
+ private String eventDevice;
+
+ /**
+ * 事件设备编码
+ */
+ private String eventDeviceCode;
+ /**
+ * 提交时间
+ */
+ private LocalDateTime commitDate;
+ /**
+ * 完成时间
+ */
+ private LocalDateTime finishDate;
+ /**
+ * 经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯
+ */
+ private Integer latLonType;
+ /**
+ * 经度
+ */
+ private BigDecimal lat;
+ /**
+ * 维度
+ */
+ private BigDecimal lon;
+ /**
+ * 经纬度地址
+ */
+ private String lonLatAddress;
+ /**
+ * 用户提交照片
+ */
+ private String confrimImgs;
+ /**
+ * 事件状态
+ */
+ private Integer eventStatus;
+ /**
+ * 事件描述
+ */
+ private String remark;
+
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventmappinginfo/EventMappingInfoDO.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventmappinginfo/EventMappingInfoDO.java
new file mode 100644
index 0000000..b6799e2
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventmappinginfo/EventMappingInfoDO.java
@@ -0,0 +1,103 @@
+package com.zteits.urbanops.module.workorder.dal.dataobject.eventmappinginfo;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 工单事件映射 DO
+ *
+ * @author 超级管理员
+ */
+@TableName("workorder_event_mapping_info")
+@KeySequence("workorder_event_mapping_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class EventMappingInfoDO extends BaseDO {
+
+ /**
+ * ID
+ */
+ @TableId
+ private Long id;
+ /**
+ * 业务线:yl 园林,wy 物业,sz 市政
+ */
+ private String busiLine;
+ /**
+ * 事件编号
+ */
+ private String eventNo;
+ /**
+ * 工单号
+ */
+ private String orderNo;
+ /**
+ * 道路ID
+ */
+ private String roadId;
+ /**
+ * 道路名称
+ */
+ private String roadName;
+ /**
+ * 紧急程度:1:特急;2:紧急;3:一般
+ */
+ private Integer pressingType;
+ /**
+ * 养护级别ID
+ */
+ private Integer curingLevelId;
+ /**
+ * 养护级别
+ */
+ private String curingLevelName;
+ /**
+ * 提交时间
+ */
+ private LocalDateTime commitDate;
+ /**
+ * 希望完成时间
+ */
+ private LocalDateTime expectedFinishDate;
+ /**
+ * 完成时间
+ */
+ private LocalDateTime finishDate;
+ /**
+ * 提交用户ID
+ */
+ private Long userId;
+ /**
+ * 提交用户名称
+ */
+ private String userName;
+ /**
+ * 提交用户的company_id
+ */
+ private Long companyId;
+ /**
+ * 部门id
+ */
+ private Long deptId;
+ /**
+ * 审批状态
+ */
+ private Integer status;
+ /**
+ * 备注
+ */
+ private String remark;
+
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventinfo/EventInfoMapper.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventinfo/EventInfoMapper.java
new file mode 100644
index 0000000..9d3b079
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventinfo/EventInfoMapper.java
@@ -0,0 +1,40 @@
+package com.zteits.urbanops.module.workorder.dal.mysql.eventinfo;
+
+import java.util.*;
+
+import com.zteits.urbanops.framework.common.pojo.PageResult;
+import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX;
+import com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo.EventInfoDO;
+import org.apache.ibatis.annotations.Mapper;
+import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.*;
+
+/**
+ * 工单事件 Mapper
+ *
+ * @author 超级管理员
+ */
+@Mapper
+public interface EventInfoMapper extends BaseMapperX {
+
+ default PageResult selectPage(EventInfoPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(EventInfoDO::getBusiLine, reqVO.getBusiLine())
+ .eqIfPresent(EventInfoDO::getEventNo, reqVO.getEventNo())
+ .likeIfPresent(EventInfoDO::getEvetName, reqVO.getEvetName())
+ .eqIfPresent(EventInfoDO::getEventDevice, reqVO.getEventDevice())
+ .eqIfPresent(EventInfoDO::getEventDeviceCode, reqVO.getEventDeviceCode())
+ .betweenIfPresent(EventInfoDO::getCommitDate, reqVO.getCommitDate())
+ .betweenIfPresent(EventInfoDO::getFinishDate, reqVO.getFinishDate())
+ .eqIfPresent(EventInfoDO::getLatLonType, reqVO.getLatLonType())
+ .eqIfPresent(EventInfoDO::getLat, reqVO.getLat())
+ .eqIfPresent(EventInfoDO::getLon, reqVO.getLon())
+ .eqIfPresent(EventInfoDO::getLonLatAddress, reqVO.getLonLatAddress())
+ .eqIfPresent(EventInfoDO::getConfrimImgs, reqVO.getConfrimImgs())
+ .eqIfPresent(EventInfoDO::getEventStatus, reqVO.getEventStatus())
+ .eqIfPresent(EventInfoDO::getRemark, reqVO.getRemark())
+ .betweenIfPresent(EventInfoDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(EventInfoDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventmappinginfo/EventMappingInfoMapper.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventmappinginfo/EventMappingInfoMapper.java
new file mode 100644
index 0000000..b3553fd
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventmappinginfo/EventMappingInfoMapper.java
@@ -0,0 +1,43 @@
+package com.zteits.urbanops.module.workorder.dal.mysql.eventmappinginfo;
+
+import java.util.*;
+
+import com.zteits.urbanops.framework.common.pojo.PageResult;
+import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX;
+import com.zteits.urbanops.module.workorder.dal.dataobject.eventmappinginfo.EventMappingInfoDO;
+import org.apache.ibatis.annotations.Mapper;
+import com.zteits.urbanops.module.workorder.controller.admin.eventmappinginfo.vo.*;
+
+/**
+ * 工单事件映射 Mapper
+ *
+ * @author 超级管理员
+ */
+@Mapper
+public interface EventMappingInfoMapper extends BaseMapperX {
+
+ default PageResult selectPage(EventMappingInfoPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(EventMappingInfoDO::getBusiLine, reqVO.getBusiLine())
+ .eqIfPresent(EventMappingInfoDO::getEventNo, reqVO.getEventNo())
+ .eqIfPresent(EventMappingInfoDO::getOrderNo, reqVO.getOrderNo())
+ .eqIfPresent(EventMappingInfoDO::getRoadId, reqVO.getRoadId())
+ .likeIfPresent(EventMappingInfoDO::getRoadName, reqVO.getRoadName())
+ .eqIfPresent(EventMappingInfoDO::getPressingType, reqVO.getPressingType())
+ .eqIfPresent(EventMappingInfoDO::getCuringLevelId, reqVO.getCuringLevelId())
+ .likeIfPresent(EventMappingInfoDO::getCuringLevelName, reqVO.getCuringLevelName())
+ .betweenIfPresent(EventMappingInfoDO::getCommitDate, reqVO.getCommitDate())
+ .betweenIfPresent(EventMappingInfoDO::getExpectedFinishDate, reqVO.getExpectedFinishDate())
+ .betweenIfPresent(EventMappingInfoDO::getFinishDate, reqVO.getFinishDate())
+ .eqIfPresent(EventMappingInfoDO::getUserId, reqVO.getUserId())
+ .likeIfPresent(EventMappingInfoDO::getUserName, reqVO.getUserName())
+ .eqIfPresent(EventMappingInfoDO::getCompanyId, reqVO.getCompanyId())
+ .eqIfPresent(EventMappingInfoDO::getDeptId, reqVO.getDeptId())
+ .eqIfPresent(EventMappingInfoDO::getStatus, reqVO.getStatus())
+ .eqIfPresent(EventMappingInfoDO::getRemark, reqVO.getRemark())
+ .betweenIfPresent(EventMappingInfoDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(EventMappingInfoDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
index e39ac75..a4da1f2 100644
--- a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
@@ -38,4 +38,8 @@ public interface ErrorCodeConstants {
ErrorCode APP_WORK_ORADER_ROLE_ILLEGLE = new ErrorCode(1-900-002-004, "该登录人即是 大区经理 角色,又是 全域督察员,无法处理流程!");
ErrorCode APP_WORK_ORADER_ROLE_NOT_EXSITS = new ErrorCode(1-900-002-005, "该登录人即不是 大区经理 角色,又不是 全域督察员,无法处理流程!");
+
+ ErrorCode EVENT_INFO_NOT_EXISTS = new ErrorCode(1-900-003-001, "工单事件不存在");
+
+ ErrorCode EVENT_MAPPING_INFO_NOT_EXISTS = new ErrorCode(1-900-004-001, "工单事件映射不存在");
}
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/EventStatusEnum.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/EventStatusEnum.java
new file mode 100644
index 0000000..70d1ed4
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/EventStatusEnum.java
@@ -0,0 +1,32 @@
+package com.zteits.urbanops.module.workorder.enums;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+
+import java.util.Arrays;
+
+@Schema(description = "工单事件状态枚举")
+@Getter
+public enum EventStatusEnum {
+ PENDING(0, "待处理"),
+ ORDER(1, "已转工单"),
+ FINISHED(2, "已结束");
+
+ @JsonValue // 序列化时返回code(前端接收数字)
+ private final Integer code;
+ private final String desc;
+
+ EventStatusEnum(Integer code, String desc) {
+ this.code = code;
+ this.desc = desc;
+ }
+
+ // 根据code获取枚举(业务层转换用)
+ public static EventStatusEnum getByCode(Integer code) {
+ return Arrays.stream(values())
+ .filter(e -> e.getCode().equals(code))
+ .findFirst()
+ .orElseThrow(() -> new IllegalArgumentException("无效的同意类型:" + code));
+ }
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/SysMappingEnum.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/SysMappingEnum.java
new file mode 100644
index 0000000..2b7f0a5
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/SysMappingEnum.java
@@ -0,0 +1,43 @@
+package com.zteits.urbanops.module.workorder.enums;
+
+import lombok.Getter;
+
+/**
+ * 系统映射枚举
+ */
+public enum SysMappingEnum {
+
+ //智慧园林:sls,智慧市政:sms,智慧物业:smp"
+ YL("sls", "智慧园林"),
+ SZ("sms", "智慧市政"),
+ WY("smp", "智慧物业");
+
+ @Getter
+ private String sysCode;
+ @Getter
+ private String description;
+
+
+ SysMappingEnum(String sysCode, String description) {
+ this.sysCode = sysCode;
+ this.description = description;
+ }
+
+ public static SysMappingEnum getByName(String name) {
+ for (SysMappingEnum node : values()) {
+ if (node.name().equalsIgnoreCase(name) ) {
+ return node;
+ }
+ }
+ throw new IllegalArgumentException("未知的系统: " + name);
+ }
+
+ public static SysMappingEnum getBySysCode(String sysCode) {
+ for (SysMappingEnum node : values()) {
+ if (node.getSysCode().equals(sysCode) ) {
+ return node;
+ }
+ }
+ throw new IllegalArgumentException("未知的系统: " + sysCode);
+ }
+}
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoService.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoService.java
new file mode 100644
index 0000000..48d7453
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoService.java
@@ -0,0 +1,71 @@
+package com.zteits.urbanops.module.workorder.service.eventinfo;
+
+import java.util.*;
+import jakarta.validation.*;
+import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.*;
+import com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo.EventInfoDO;
+import com.zteits.urbanops.framework.common.pojo.PageResult;
+import com.zteits.urbanops.framework.common.pojo.PageParam;
+
+/**
+ * 工单事件 Service 接口
+ *
+ * @author 超级管理员
+ */
+public interface EventInfoService {
+
+ /**
+ * 创建工单事件
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ Long createEventInfo(@Valid EventInfoSaveReqVO createReqVO);
+
+ /**
+ * 更新工单事件
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateEventInfo(@Valid EventInfoSaveReqVO updateReqVO);
+
+ /**
+ * 删除工单事件
+ *
+ * @param id 编号
+ */
+ void deleteEventInfo(Long id);
+
+ /**
+ * 批量删除工单事件
+ *
+ * @param ids 编号
+ */
+ void deleteEventInfoListByIds(List ids);
+
+ /**
+ * 获得工单事件
+ *
+ * @param id 编号
+ * @return 工单事件
+ */
+ EventInfoDO getEventInfo(Long id);
+
+ /**
+ * 获得工单事件分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 工单事件分页
+ */
+ PageResult getEventInfoPage(EventInfoPageReqVO pageReqVO);
+
+ /**
+ * 结束工单事件
+ *
+ * @param id 工单事件编号
+ */
+ void endEventInfo(@Valid Long id);
+
+ void createEventOrderInfo(@Valid EventOrderInfoSaveReqVO createReqVO);
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoServiceImpl.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoServiceImpl.java
new file mode 100644
index 0000000..217dcdb
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoServiceImpl.java
@@ -0,0 +1,102 @@
+package com.zteits.urbanops.module.workorder.service.eventinfo;
+
+import cn.hutool.core.collection.CollUtil;
+import com.zteits.urbanops.module.workorder.enums.EventStatusEnum;
+import org.springframework.stereotype.Service;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.*;
+import com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo.EventInfoDO;
+import com.zteits.urbanops.framework.common.pojo.PageResult;
+import com.zteits.urbanops.framework.common.pojo.PageParam;
+import com.zteits.urbanops.framework.common.util.object.BeanUtils;
+
+import com.zteits.urbanops.module.workorder.dal.mysql.eventinfo.EventInfoMapper;
+
+import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList;
+import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList;
+import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*;
+
+/**
+ * 工单事件 Service 实现类
+ *
+ * @author 超级管理员
+ */
+@Service
+@Validated
+public class EventInfoServiceImpl implements EventInfoService {
+
+ @Resource
+ private EventInfoMapper eventInfoMapper;
+
+ @Override
+ public Long createEventInfo(EventInfoSaveReqVO createReqVO) {
+ // 插入
+ EventInfoDO eventInfo = BeanUtils.toBean(createReqVO, EventInfoDO.class);
+ eventInfoMapper.insert(eventInfo);
+
+ // 返回
+ return eventInfo.getId();
+ }
+
+ @Override
+ public void updateEventInfo(EventInfoSaveReqVO updateReqVO) {
+ // 校验存在
+ validateEventInfoExists(updateReqVO.getId());
+ // 更新
+ EventInfoDO updateObj = BeanUtils.toBean(updateReqVO, EventInfoDO.class);
+ eventInfoMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteEventInfo(Long id) {
+ // 校验存在
+ validateEventInfoExists(id);
+ // 删除
+ eventInfoMapper.deleteById(id);
+ }
+
+ @Override
+ public void deleteEventInfoListByIds(List ids) {
+ // 删除
+ eventInfoMapper.deleteByIds(ids);
+ }
+
+
+ private void validateEventInfoExists(Long id) {
+ if (eventInfoMapper.selectById(id) == null) {
+ throw exception(EVENT_INFO_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public EventInfoDO getEventInfo(Long id) {
+ return eventInfoMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getEventInfoPage(EventInfoPageReqVO pageReqVO) {
+ return eventInfoMapper.selectPage(pageReqVO);
+ }
+
+ @Override
+ public void endEventInfo(Long id) {
+ // 校验存在
+ validateEventInfoExists(id);
+ // 更新
+ EventInfoDO updateObj = new EventInfoDO();
+ updateObj.setId(id);
+ updateObj.setEventStatus(EventStatusEnum.FINISHED.getCode());
+ eventInfoMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void createEventOrderInfo(EventOrderInfoSaveReqVO createReqVO) {
+ //TODO @lesan:工单事件工单创建
+ }
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoService.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoService.java
new file mode 100644
index 0000000..b21813b
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoService.java
@@ -0,0 +1,62 @@
+package com.zteits.urbanops.module.workorder.service.eventmappinginfo;
+
+import java.util.*;
+import jakarta.validation.*;
+import com.zteits.urbanops.module.workorder.controller.admin.eventmappinginfo.vo.*;
+import com.zteits.urbanops.module.workorder.dal.dataobject.eventmappinginfo.EventMappingInfoDO;
+import com.zteits.urbanops.framework.common.pojo.PageResult;
+import com.zteits.urbanops.framework.common.pojo.PageParam;
+
+/**
+ * 工单事件映射 Service 接口
+ *
+ * @author 超级管理员
+ */
+public interface EventMappingInfoService {
+
+ /**
+ * 创建工单事件映射
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ Long createEventMappingInfo(@Valid EventMappingInfoSaveReqVO createReqVO);
+
+ /**
+ * 更新工单事件映射
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateEventMappingInfo(@Valid EventMappingInfoSaveReqVO updateReqVO);
+
+ /**
+ * 删除工单事件映射
+ *
+ * @param id 编号
+ */
+ void deleteEventMappingInfo(Long id);
+
+ /**
+ * 批量删除工单事件映射
+ *
+ * @param ids 编号
+ */
+ void deleteEventMappingInfoListByIds(List ids);
+
+ /**
+ * 获得工单事件映射
+ *
+ * @param id 编号
+ * @return 工单事件映射
+ */
+ EventMappingInfoDO getEventMappingInfo(Long id);
+
+ /**
+ * 获得工单事件映射分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 工单事件映射分页
+ */
+ PageResult getEventMappingInfoPage(EventMappingInfoPageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoServiceImpl.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoServiceImpl.java
new file mode 100644
index 0000000..7a1009b
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventmappinginfo/EventMappingInfoServiceImpl.java
@@ -0,0 +1,85 @@
+package com.zteits.urbanops.module.workorder.service.eventmappinginfo;
+
+import cn.hutool.core.collection.CollUtil;
+import org.springframework.stereotype.Service;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import com.zteits.urbanops.module.workorder.controller.admin.eventmappinginfo.vo.*;
+import com.zteits.urbanops.module.workorder.dal.dataobject.eventmappinginfo.EventMappingInfoDO;
+import com.zteits.urbanops.framework.common.pojo.PageResult;
+import com.zteits.urbanops.framework.common.pojo.PageParam;
+import com.zteits.urbanops.framework.common.util.object.BeanUtils;
+
+import com.zteits.urbanops.module.workorder.dal.mysql.eventmappinginfo.EventMappingInfoMapper;
+
+import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList;
+import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList;
+import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*;
+
+/**
+ * 工单事件映射 Service 实现类
+ *
+ * @author 超级管理员
+ */
+@Service
+@Validated
+public class EventMappingInfoServiceImpl implements EventMappingInfoService {
+
+ @Resource
+ private EventMappingInfoMapper eventMappingInfoMapper;
+
+ @Override
+ public Long createEventMappingInfo(EventMappingInfoSaveReqVO createReqVO) {
+ // 插入
+ EventMappingInfoDO eventMappingInfo = BeanUtils.toBean(createReqVO, EventMappingInfoDO.class);
+ eventMappingInfoMapper.insert(eventMappingInfo);
+
+ // 返回
+ return eventMappingInfo.getId();
+ }
+
+ @Override
+ public void updateEventMappingInfo(EventMappingInfoSaveReqVO updateReqVO) {
+ // 校验存在
+ validateEventMappingInfoExists(updateReqVO.getId());
+ // 更新
+ EventMappingInfoDO updateObj = BeanUtils.toBean(updateReqVO, EventMappingInfoDO.class);
+ eventMappingInfoMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteEventMappingInfo(Long id) {
+ // 校验存在
+ validateEventMappingInfoExists(id);
+ // 删除
+ eventMappingInfoMapper.deleteById(id);
+ }
+
+ @Override
+ public void deleteEventMappingInfoListByIds(List ids) {
+ // 删除
+ eventMappingInfoMapper.deleteByIds(ids);
+ }
+
+
+ private void validateEventMappingInfoExists(Long id) {
+ if (eventMappingInfoMapper.selectById(id) == null) {
+ throw exception(EVENT_MAPPING_INFO_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public EventMappingInfoDO getEventMappingInfo(Long id) {
+ return eventMappingInfoMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getEventMappingInfoPage(EventMappingInfoPageReqVO pageReqVO) {
+ return eventMappingInfoMapper.selectPage(pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/GeoCodeService.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/GeoCodeService.java
new file mode 100644
index 0000000..673299f
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/GeoCodeService.java
@@ -0,0 +1,20 @@
+package com.zteits.urbanops.module.workorder.service.geocode;
+
+import java.math.BigDecimal;
+
+/**
+ * 地理编码服务接口
+ *
+ * @author gelinghu
+ */
+public interface GeoCodeService {
+
+ /**
+ * 根据经纬度获取详细地址
+ *
+ * @param latitude 纬度
+ * @param longitude 经度
+ * @return 详细地址,如果获取失败返回 null
+ */
+ String getAddressByLocation(BigDecimal latitude, BigDecimal longitude);
+}
\ No newline at end of file
diff --git a/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/impl/AmapGeoCodeServiceImpl.java b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/impl/AmapGeoCodeServiceImpl.java
new file mode 100644
index 0000000..52c8993
--- /dev/null
+++ b/urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/geocode/impl/AmapGeoCodeServiceImpl.java
@@ -0,0 +1,199 @@
+package com.zteits.urbanops.module.workorder.service.geocode.impl;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.crypto.digest.MD5;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.zteits.urbanops.framework.common.util.http.HttpUtils;
+import com.zteits.urbanops.module.workorder.config.AmapProperties;
+import com.zteits.urbanops.module.workorder.service.geocode.GeoCodeService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * 高德地理编码服务实现
+ *
+ * @author gelinghu
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+@ConditionalOnProperty(prefix = "amap", name = "enabled", havingValue = "true", matchIfMissing = true)
+public class AmapGeoCodeServiceImpl implements GeoCodeService {
+
+ private final AmapProperties amapProperties;
+
+ @Override
+ public String getAddressByLocation(BigDecimal latitude, BigDecimal longitude) {
+ if (latitude == null || longitude == null) {
+ log.warn("[getAddressByLocation] 经纬度不能为空: lat={}, lon={}", latitude, longitude);
+ return null;
+ }
+
+ try {
+ // 将 BigDecimal 转换为 Double
+ Double lat = latitude.doubleValue();
+ Double lon = longitude.doubleValue();
+
+ // 1. 构建请求参数
+ Map params = buildRequestParams(lon, lat);
+
+ // 2. 构建完整的请求 URL
+ String url = buildRequestUrl(params);
+
+ // 3. 发起 HTTP 请求
+ String responseBody = HttpUtils.get(url);
+ if (StrUtil.isBlank(responseBody)) {
+ log.warn("[getAddressByLocation] 高德API响应为空: lat={}, lon={}", latitude, longitude);
+ return null;
+ }
+
+ // 4. 解析响应结果
+ return parseResponse(responseBody, latitude, longitude);
+
+ } catch (Exception e) {
+ log.error("[getAddressByLocation] 调用高德地理编码API异常: lat={}, lon={}", latitude, longitude, e);
+ return null;
+ }
+ }
+
+ /**
+ * 构建请求参数
+ */
+ private Map buildRequestParams(Double longitude, Double latitude) {
+ Map params = new HashMap<>();
+ params.put("key", amapProperties.getApiKey());
+ params.put("location", longitude + "," + latitude);
+ params.put("poitype", ""); // 返回附近POI类型
+ params.put("radius", "1000"); // 搜索半径,单位:米
+ params.put("extensions", "base"); // 返回结果控制,base:返回基本地址信息;all:返回地址信息及附近POI、道路、交叉口等信息
+ params.put("batch", "false"); // 批量查询控制
+ params.put("roadlevel", "0"); // 道路等级
+
+ // 如果启用了数字签名,则添加签名参数
+ if (Boolean.TRUE.equals(amapProperties.getEnableSignature()) &&
+ StrUtil.isNotBlank(amapProperties.getPrivateKey())) {
+ String signature = generateSignature(params, amapProperties.getPrivateKey());
+ params.put("sig", signature);
+ }
+
+ return params;
+ }
+
+ /**
+ * 构建完整的请求 URL
+ */
+ private String buildRequestUrl(Map params) {
+ StringBuilder url = new StringBuilder(amapProperties.getGeocodeUrl());
+ url.append("?");
+
+ boolean first = true;
+ for (Map.Entry entry : params.entrySet()) {
+ if (!first) {
+ url.append("&");
+ }
+ try {
+ url.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString()));
+ } catch (Exception e) {
+ url.append(entry.getKey()).append("=").append(entry.getValue());
+ }
+ first = false;
+ }
+
+ return url.toString();
+ }
+
+ /**
+ * 生成数字签名
+ * 高德API数字签名算法:
+ * 1. 将请求参数按ASCII码升序排列
+ * 2. 使用URL键值对的格式拼接
+ * 3. 在字符串最后拼接上私钥
+ * 4. 对整个字符串进行MD5加密
+ *
+ * @param params 请求参数
+ * @param privateKey 私钥
+ * @return 签名字符串
+ */
+ private String generateSignature(Map params, String privateKey) {
+ try {
+ // 使用TreeMap自动按key排序
+ TreeMap sortedParams = new TreeMap<>(params);
+
+ // 构建签名字符串
+ StringBuilder signStr = new StringBuilder();
+ boolean first = true;
+
+ for (Map.Entry entry : sortedParams.entrySet()) {
+ if (!first) {
+ signStr.append("&");
+ }
+ signStr.append(entry.getKey()).append("=").append(entry.getValue());
+ first = false;
+ }
+
+ // 在最后拼接私钥
+ signStr.append(privateKey);
+
+ // 对整个字符串进行MD5加密
+ String signature = MD5.create().digestHex(signStr.toString());
+
+ log.debug("[generateSignature] 签名字符串: {}, 签名结果: {}", signStr.toString(), signature);
+
+ return signature;
+
+ } catch (Exception e) {
+ log.error("[generateSignature] 生成数字签名异常", e);
+ return "";
+ }
+ }
+
+ /**
+ * 解析响应结果
+ */
+ private String parseResponse(String responseBody, BigDecimal latitude, BigDecimal longitude) {
+ try {
+ JSONObject response = JSONUtil.parseObj(responseBody);
+
+ // 检查状态码
+ String status = response.getStr("status");
+ if (!"1".equals(status)) {
+ String info = response.getStr("info");
+ log.warn("[getAddressByLocation] 高德API返回错误: status={}, info={}, lat={}, lon={}",
+ status, info, latitude, longitude);
+ return null;
+ }
+
+ // 解析地址信息
+ JSONObject regeocode = response.getJSONObject("regeocode");
+ if (regeocode == null) {
+ log.warn("[getAddressByLocation] 高德API未返回地址信息: lat={}, lon={}", latitude, longitude);
+ return null;
+ }
+
+ String formattedAddress = regeocode.getStr("formatted_address");
+ if (StrUtil.isNotBlank(formattedAddress)) {
+ log.info("[getAddressByLocation] 成功获取地址: lat={}, lon={}, address={}",
+ latitude, longitude, formattedAddress);
+ return formattedAddress;
+ }
+
+ log.warn("[getAddressByLocation] 高德API返回的地址为空: lat={}, lon={}", latitude, longitude);
+ return null;
+
+ } catch (Exception e) {
+ log.error("[getAddressByLocation] 解析高德API响应异常: lat={}, lon={}, response={}",
+ latitude, longitude, responseBody, e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
--
libgit2 0.21.4