From 5394ccc40a7eb9fbc726da7ad969709346412f83 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Wed, 8 Mar 2023 13:59:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/service/FirePointService.java | 19 ++++++------ .../service/impl/FirePointServiceImpl.java | 31 ++++++++++++++----- .../DispatchFirePointController.java | 18 +++-------- .../straw/controller/FirePointController.java | 12 ++++++- .../service/DispatchFirePointService.java | 6 ---- .../impl/DispatchFirePointServiceImpl.java | 30 +++--------------- 6 files changed, 54 insertions(+), 62 deletions(-) diff --git a/src/main/java/com/xkrs/service/FirePointService.java b/src/main/java/com/xkrs/service/FirePointService.java index f339e43..53d4b93 100644 --- a/src/main/java/com/xkrs/service/FirePointService.java +++ b/src/main/java/com/xkrs/service/FirePointService.java @@ -1,29 +1,30 @@ package com.xkrs.service; -/** - * @author XinYi Song - */ public interface FirePointService { -// /** -// * download vip user's fire point -// */ // String downloadVipUserFilePoint(HttpServletRequest request, HttpServletResponse response); // String downloadFirePoint(HttpServletRequest request, HttpServletResponse response, String ids); /** - * (Complete) + * 查询火点播报(无token) + * + * @param limit 最大数量 + */ + String queryFirePointBroadcast(Integer limit); + + /** + * 动态多条件查询 */ String queryFirePoint(String token, String code, String startTime, String endTime, String satelliteType, String landType); /** - * 查询今天的火点信息 (Complete) + * 查询今天的火点信息 */ String selectTodayFirePoint(String token, String countyCode); /** - * 根据火点编码查询火点信息 (Complete) + * 根据火点编码查询火点信息 */ String selectFirePointByCode(String fireCode); } diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 87a04a8..04b66af 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -1,20 +1,20 @@ package com.xkrs.service.impl; import com.xkrs.common.encapsulation.PromptMessageEnum; -import com.xkrs.straw.dao.CountyCodeWeiXinDao; -import com.xkrs.straw.dao.StreetDao; import com.xkrs.service.FirePointService; -import com.xkrs.straw.service.StreetService; +import com.xkrs.straw.dao.CountyCodeWeiXinDao; import com.xkrs.straw.dao.FirePointOrdinaryDao; +import com.xkrs.straw.dao.StreetDao; import com.xkrs.straw.dao.SysUserDao; +import com.xkrs.straw.helper.FirePointQueryManager; import com.xkrs.straw.model.bean.FirePointQueryResultBean; import com.xkrs.straw.model.entity.FirePointOrdinaryEntity; import com.xkrs.straw.model.entity.SysUserEntity; import com.xkrs.straw.model.helper.PushHelper; import com.xkrs.straw.model.vo.AllFirePointVo; -import com.xkrs.straw.utilsnew.FirePointConvertUtils; -import com.xkrs.straw.helper.FirePointQueryManager; +import com.xkrs.straw.service.StreetService; import com.xkrs.straw.utilsnew.DateTimeUtils; +import com.xkrs.straw.utilsnew.FirePointConvertUtils; import com.xkrs.straw.utilsnew.TokenUtil; import org.apache.hc.core5.util.TextUtils; import org.slf4j.Logger; @@ -131,7 +131,22 @@ public class FirePointServiceImpl implements FirePointService { // } /** - * Complete + * 查询火点播报(无token) + * + * @param limit 最大数量 + */ + @Override + public String queryFirePointBroadcast(Integer limit) { + FirePointQueryResultBean firePointQueryResult = firePointQueryManager.queryFirePointBroadcast(limit); + if (firePointQueryResult.isSuccess()) { + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, firePointQueryResult.getList(), locale); + } else { + return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, firePointQueryResult.getErrorMessage(), locale); + } + } + + /** + * 动态多条件查询 */ @Override public String queryFirePoint(String token, String code, String startTime, String endTime, String satelliteType, String landType) { @@ -154,7 +169,7 @@ public class FirePointServiceImpl implements FirePointService { } /** - * Complete + * 查询今天的火点信息 */ // @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Override @@ -187,7 +202,7 @@ public class FirePointServiceImpl implements FirePointService { } /** - * 根据火点编码查询火点信息 (Complete) + * 根据火点编码查询火点信息 */ @Override public String selectFirePointByCode(String fireCode) { diff --git a/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java b/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java index 1b11247..4eb0fa3 100644 --- a/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java +++ b/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java @@ -2,12 +2,15 @@ package com.xkrs.straw.controller; import com.xkrs.service.impl.FirePointServiceImpl; import com.xkrs.straw.dao.SysUserDao; +import com.xkrs.straw.helper.FirePointSubscribeManager; import com.xkrs.straw.model.qo.AllFirePointQo; import com.xkrs.straw.service.DispatchFirePointService; -import com.xkrs.straw.helper.FirePointSubscribeManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; @@ -70,15 +73,4 @@ public class DispatchFirePointController { return firePointService.insertFirePointChannelPrecise(firePointQo); } - /** - * 查询火点播报(无token) - * - * @param limit 最大数量 - */ - @GetMapping("/queryFirePointBroadcast") - public String queryFirePointBroadcast(@RequestParam("limit") Integer limit) { - return firePointService.queryFirePointBroadcast(limit); - } - - } diff --git a/src/main/java/com/xkrs/straw/controller/FirePointController.java b/src/main/java/com/xkrs/straw/controller/FirePointController.java index 53d26fb..9a466fb 100644 --- a/src/main/java/com/xkrs/straw/controller/FirePointController.java +++ b/src/main/java/com/xkrs/straw/controller/FirePointController.java @@ -2,10 +2,10 @@ package com.xkrs.straw.controller; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.service.FirePointService; -import com.xkrs.straw.service.StreetService; import com.xkrs.service.impl.FirePointServiceImpl; import com.xkrs.straw.dao.SysUserDao; import com.xkrs.straw.helper.FirePointQueryManager; +import com.xkrs.straw.service.StreetService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.i18n.LocaleContextHolder; @@ -75,6 +75,16 @@ public class FirePointController { // return firePointService.downloadFirePoint(request, response, ids); // } + /** + * 查询火点播报(无token) + * + * @param limit 最大数量 + */ + @GetMapping("/queryFirePointBroadcast") + public String queryFirePointBroadcast(@RequestParam("limit") Integer limit) { + return firePointService.queryFirePointBroadcast(limit); + } + /** * 动态多条件查询火点列表(Complete) */ diff --git a/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java b/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java index 35d9bd4..363be23 100644 --- a/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java +++ b/src/main/java/com/xkrs/straw/service/DispatchFirePointService.java @@ -14,10 +14,4 @@ public interface DispatchFirePointService { */ String insertFirePointChannelPrecise(AllFirePointQo firePointQo); - /** - * 查询火点播报(无token) - * - * @param limit 最大数量 - */ - String queryFirePointBroadcast(Integer limit); } 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 7033305..8b5bc68 100644 --- a/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java +++ b/src/main/java/com/xkrs/straw/service/impl/DispatchFirePointServiceImpl.java @@ -1,25 +1,20 @@ package com.xkrs.straw.service.impl; import com.xkrs.common.encapsulation.PromptMessageEnum; -import com.xkrs.straw.dao.StreetDao; -import com.xkrs.straw.model.entity.StreetEntity; -import com.xkrs.straw.dao.FirePointChannelConfigDao; -import com.xkrs.straw.dao.FirePointOrdinaryDao; -import com.xkrs.straw.dao.FirePointPreciseDao; -import com.xkrs.straw.dao.SysUserDao; +import com.xkrs.straw.dao.*; +import com.xkrs.straw.helper.FirePointPushManager; +import com.xkrs.straw.helper.FirePointQueryManager; import com.xkrs.straw.helper.GeoCodeHelper; import com.xkrs.straw.model.bean.DataWrapper2; -import com.xkrs.straw.model.bean.FirePointQueryResultBean; import com.xkrs.straw.model.entity.FirePointChannelConfigEntity; import com.xkrs.straw.model.entity.FirePointOrdinaryEntity; import com.xkrs.straw.model.entity.FirePointPreciseEntity; +import com.xkrs.straw.model.entity.StreetEntity; import com.xkrs.straw.model.qo.AllFirePointQo; import com.xkrs.straw.service.DispatchFirePointService; +import com.xkrs.straw.utilsnew.DateTimeUtils; import com.xkrs.straw.utilsnew.FirePointDispatchUtils; import com.xkrs.straw.utilsnew.FirePointFilterUtils; -import com.xkrs.straw.helper.FirePointPushManager; -import com.xkrs.straw.helper.FirePointQueryManager; -import com.xkrs.straw.utilsnew.DateTimeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.i18n.LocaleContextHolder; @@ -302,19 +297,4 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService { } } - /** - * 查询火点播报(无token) - * - * @param limit 最大数量 - */ - @Override - public String queryFirePointBroadcast(Integer limit) { - FirePointQueryResultBean firePointQueryResult = firePointQueryManager.queryFirePointBroadcast(limit); - if (firePointQueryResult.isSuccess()) { - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, firePointQueryResult.getList(), locale); - } else { - return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, firePointQueryResult.getErrorMessage(), locale); - } - } - }