From bde50770ca605a8a4a2d16de300589af4384cc2e Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Fri, 3 Feb 2023 15:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DispatchFirePointController.java | 6 +++++ .../service/DispatchFirePointService.java | 6 +++++ .../impl/DispatchFirePointServiceImpl.java | 22 +++++++++++++++++++ .../straw/utils/DispatchFirePointUtils.java | 6 +++++ 4 files changed, 40 insertions(+) diff --git a/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java b/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java index 4166c34..0c4abf0 100644 --- a/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java +++ b/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java @@ -27,11 +27,17 @@ public class DispatchFirePointController { return firePointService.debug(); } + /** + * 普通渠道推送火点到秸秆系统 + */ @PostMapping("/insertFirePointChannelOrdinary") public String insertFirePointChannelOrdinary(@RequestBody AllFirePointQo firePointQo) { return firePointService.insertFirePointChannelOrdinary(firePointQo); } + /** + * 精准渠道推送火点到秸秆系统 + */ @PostMapping("/insertFirePointChannelPrecise") public String insertFirePointChannelPrecise(@RequestBody AllFirePointQo firePointQo) { return firePointService.insertFirePointChannelPrecise(firePointQo); diff --git a/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java b/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java index 3ac0e55..194664a 100644 --- a/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java +++ b/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java @@ -6,8 +6,14 @@ public interface DispatchFirePointService { String debug(); + /** + * 普通渠道推送火点到秸秆系统 + */ String insertFirePointChannelOrdinary(AllFirePointQo firePointQo); + /** + * 精准渠道推送火点到秸秆系统 + */ String insertFirePointChannelPrecise(AllFirePointQo firePointQo); } diff --git a/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java b/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java index 07bbff6..7e505fe 100644 --- a/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java +++ b/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java @@ -71,6 +71,9 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService { return "null"; } + /** + * 普通渠道推送火点到秸秆系统 + */ @Override public String insertFirePointChannelOrdinary(AllFirePointQo firePointQo) { @@ -134,6 +137,9 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功", locale); } + /** + * 精准渠道推送火点到秸秆系统 + */ @Override public String insertFirePointChannelPrecise(AllFirePointQo firePointQo) { @@ -179,6 +185,14 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功", locale); } + /** + * 绑定火点位置 + * 如果能接收到TownCode(山东省内),会判断CountyCode、CountyName、TownCode, + * 如果不能接收到TownCode(其他省份),会判断CountyCode、CountyName, + *

+ * 如果根据经纬度反算出来的变量都一致,就更新TownCode、TownName、FirePointAddress,无备注。 + * 如果不一致,就只更新FirePointAddress,备注存储差异信息 + */ private void bindFirePointAddress(FirePointPreciseEntity firePointPreciseEntity) { String countyCode = firePointPreciseEntity.getCountyCode(); String countyName = firePointPreciseEntity.getCountyName(); @@ -198,6 +212,14 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService { } } + /** + * 绑定火点位置 + * 如果能接收到TownCode(山东省内),会判断CountyCode、CountyName、TownCode, + * 如果不能接收到TownCode(其他省份),会判断CountyCode、CountyName, + *

+ * 如果根据经纬度反算出来的变量都一致,就更新TownCode、TownName、FirePointAddress,无备注。 + * 如果不一致,就只更新FirePointAddress,备注存储差异信息 + */ private void bindFirePointAddress(FirePointOrdinaryEntity firePointOrdinaryEntity) { String countyCode = firePointOrdinaryEntity.getCountyCode(); String countyName = firePointOrdinaryEntity.getCountyName(); diff --git a/src/main/java/com/xkrs/straw/utils/DispatchFirePointUtils.java b/src/main/java/com/xkrs/straw/utils/DispatchFirePointUtils.java index 22afefa..f72b8af 100644 --- a/src/main/java/com/xkrs/straw/utils/DispatchFirePointUtils.java +++ b/src/main/java/com/xkrs/straw/utils/DispatchFirePointUtils.java @@ -19,6 +19,9 @@ public class DispatchFirePointUtils { private DispatchFirePointUtils() { } + /** + * 检查火点卫星时间是否在精准渠道配置时间范围内 + */ public static boolean checkIfInPreciseTimeRange(String fireCode, LocalDateTime satelliteLocalDateTime, List firePointChannelConfigEntityList) { if (firePointChannelConfigEntityList == null || firePointChannelConfigEntityList.size() == 0) { int resValue1 = 0; @@ -107,6 +110,9 @@ public class DispatchFirePointUtils { } /** + * 将formattedTime转化为LocalDateTime格式,并将年字段设置为targetYear + * 转化失败返回null + * * @param formattedTime 2022-01-01 00:00:00 */ private static LocalDateTime obtainLocalDateTimeSameYear(int targetYear, String formattedTime) {