diff --git a/src/main/java/com/xkrs/service/FirePointService.java b/src/main/java/com/xkrs/service/FirePointService.java index d98bea6..0d8cc53 100644 --- a/src/main/java/com/xkrs/service/FirePointService.java +++ b/src/main/java/com/xkrs/service/FirePointService.java @@ -49,5 +49,6 @@ public interface FirePointService { * @return 符合条件的火点列表 */ List queryFirePoint(String code, String startTime, String endTime, String satelliteType, String landType); + void queryFirePoint(String token,String code, String startTime, String endTime, String satelliteType, String landType); } diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 89be614..d2c15aa 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -14,6 +14,7 @@ import com.xkrs.straw.dao.SysUserDao; import com.xkrs.straw.model.entity.SysUserEntity; import com.xkrs.straw.model.helper.PushHelper; import com.xkrs.straw.model.helper.SMSHelper; +import com.xkrs.straw.utils.FirePointQueryManager; import com.xkrs.utils.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,6 +74,10 @@ public class FirePointServiceImpl implements FirePointService { @Resource private PushHelper pushHelper; + @Resource + private FirePointQueryManager firePointQueryManager; + + /** * 添加火点信息 */ diff --git a/src/main/java/com/xkrs/straw/controller/FirePointController.java b/src/main/java/com/xkrs/straw/controller/FirePointController.java index 79e72da..8179678 100644 --- a/src/main/java/com/xkrs/straw/controller/FirePointController.java +++ b/src/main/java/com/xkrs/straw/controller/FirePointController.java @@ -9,6 +9,7 @@ import com.xkrs.service.StreetService; import com.xkrs.service.impl.FirePointServiceImpl; import com.xkrs.straw.dao.SysUserDao; import com.xkrs.straw.model.entity.SysUserEntity; +import com.xkrs.straw.utils.FirePointQueryManager; import com.xkrs.utils.FirePointQueryHelper; import com.xkrs.utils.TokenUtil; import org.apache.hc.core5.util.TextUtils; @@ -49,6 +50,9 @@ public class FirePointController { @Resource private FirePointQueryHelper firePointQueryHelper; + @Resource + private FirePointQueryManager firePointQueryManager; + // @GetMapping("/queryzzhd") // public String queryzzhd() { // List firePointEntities1 = firePointQueryHelper.queryZZHD("371482", "2022-01-01 00:00:10", "2022-06-26 00:00:10"); @@ -71,7 +75,7 @@ public class FirePointController { // } /** - * 添加火点数据 + * 添加火点数据(Complete) */ @PostMapping("/insertFirePoint") public String insertFirePoint(@RequestBody FirePointQo firePointQo) { @@ -84,11 +88,17 @@ public class FirePointController { } } + /** + * (Complete) + */ @RequestMapping(value = "/download/vipuserfirepoint", method = RequestMethod.GET) public String downloadVipUserFirePoint(HttpServletResponse response, HttpServletRequest request) { return firePointService.downloadVipUserFilePoint(request, response); } + /** + * (Complete) + */ @RequestMapping(value = "/download/firepoint", method = RequestMethod.GET) public String downloadFirePoint(HttpServletResponse response, HttpServletRequest request, @RequestParam(value = "ids") String ids) { return firePointService.downloadFirePoint(request, response, ids); @@ -98,12 +108,13 @@ public class FirePointController { * 动态多条件查询火点列表 */ @GetMapping("/queryFirePoint") - public String queryFirePoint(@RequestParam(value = "code", required = false) String code, + public String queryFirePoint(@RequestHeader(value = "Authorization") String token, + @RequestParam(value = "code", required = false) String code, @RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "endTime", required = false) String endTime, @RequestParam(value = "satelliteType", required = false) String satelliteType, @RequestParam(value = "landType", required = false) String landType) { - List firePointList = firePointService.queryFirePoint(code, startTime, endTime, satelliteType, landType); + List firePointList = firePointService.queryFirePoint(token, code, startTime, endTime, satelliteType, landType); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, firePointList, locale); } diff --git a/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java b/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java index 0d3ea5a..44228fb 100644 --- a/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java +++ b/src/main/java/com/xkrs/straw/utils/FirePointQueryManager.java @@ -6,7 +6,6 @@ import com.xkrs.straw.model.bean.FirePointQueryResultBean; import com.xkrs.straw.model.bean.VipTimeRangeBean; import com.xkrs.straw.model.entity.FirePointOrdinaryEntity; import com.xkrs.straw.model.entity.FirePointPreciseEntity; -import com.xkrs.straw.model.entity.SysUserEntity; import com.xkrs.straw.model.vo.AllFirePointVo; import com.xkrs.utils.DateTimeUtil; import com.xkrs.utils.DateTimeUtils; @@ -37,13 +36,15 @@ public class FirePointQueryManager { @Resource private FirePointPreciseDao firePointPreciseDao; - public FirePointQueryResultBean queryFirePointBelongToUser(SysUserEntity sysUserEntity, String startTime, String endTime, String satelliteType, String landType) { +// public FirePointQueryResultBean queryFirePointBelongToUser(SysUserEntity sysUserEntity, String startTime, String endTime, String satelliteType, String landType) { +// +// } + + public FirePointQueryResultBean queryFirePointBelongToUser(String userCode, String vipTimeRangeJson, String startTime, String endTime, String satelliteType, String landType) { String mNoRedundantUserCode = null; final List mVipTimeRangeItemList = new ArrayList<>(); try { - //获取用户注册的区划编码 - String userCode = sysUserEntity.getCountyCode(); //如果用户注册的区划编码是空,就返回失败 if (TextUtils.isEmpty(userCode)) { return new FirePointQueryResultBean("User CountyCode Error 1, userCode = " + userCode); @@ -55,8 +56,6 @@ public class FirePointQueryManager { return new FirePointQueryResultBean("User CountyCode Error 2, userCode = " + userCode + ", noRedundantUserCode = " + noRedundantUserCode); } - //获取用户的VIP时间范围 - String vipTimeRangeJson = sysUserEntity.getVipTimeRangeJson(); //如果用户的VIP时间范围数据是空,就返回失败 if (TextUtils.isEmpty(vipTimeRangeJson)) { return new FirePointQueryResultBean("User VipTimeRangeJson Error 1, vipTimeRangeJson = " + vipTimeRangeJson);