This commit is contained in:
liuchengqian 2023-03-02 14:25:04 +08:00
parent 5f27acc90b
commit 2ab8598f83
4 changed files with 25 additions and 9 deletions

View File

@ -49,5 +49,6 @@ public interface FirePointService {
* @return 符合条件的火点列表 * @return 符合条件的火点列表
*/ */
List<FirePointEntity> queryFirePoint(String code, String startTime, String endTime, String satelliteType, String landType); List<FirePointEntity> 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);
} }

View File

@ -14,6 +14,7 @@ import com.xkrs.straw.dao.SysUserDao;
import com.xkrs.straw.model.entity.SysUserEntity; import com.xkrs.straw.model.entity.SysUserEntity;
import com.xkrs.straw.model.helper.PushHelper; import com.xkrs.straw.model.helper.PushHelper;
import com.xkrs.straw.model.helper.SMSHelper; import com.xkrs.straw.model.helper.SMSHelper;
import com.xkrs.straw.utils.FirePointQueryManager;
import com.xkrs.utils.*; import com.xkrs.utils.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -73,6 +74,10 @@ public class FirePointServiceImpl implements FirePointService {
@Resource @Resource
private PushHelper pushHelper; private PushHelper pushHelper;
@Resource
private FirePointQueryManager firePointQueryManager;
/** /**
* 添加火点信息 * 添加火点信息
*/ */

View File

@ -9,6 +9,7 @@ import com.xkrs.service.StreetService;
import com.xkrs.service.impl.FirePointServiceImpl; import com.xkrs.service.impl.FirePointServiceImpl;
import com.xkrs.straw.dao.SysUserDao; import com.xkrs.straw.dao.SysUserDao;
import com.xkrs.straw.model.entity.SysUserEntity; import com.xkrs.straw.model.entity.SysUserEntity;
import com.xkrs.straw.utils.FirePointQueryManager;
import com.xkrs.utils.FirePointQueryHelper; import com.xkrs.utils.FirePointQueryHelper;
import com.xkrs.utils.TokenUtil; import com.xkrs.utils.TokenUtil;
import org.apache.hc.core5.util.TextUtils; import org.apache.hc.core5.util.TextUtils;
@ -49,6 +50,9 @@ public class FirePointController {
@Resource @Resource
private FirePointQueryHelper firePointQueryHelper; private FirePointQueryHelper firePointQueryHelper;
@Resource
private FirePointQueryManager firePointQueryManager;
// @GetMapping("/queryzzhd") // @GetMapping("/queryzzhd")
// public String queryzzhd() { // public String queryzzhd() {
// List<FirePointEntity> firePointEntities1 = firePointQueryHelper.queryZZHD("371482", "2022-01-01 00:00:10", "2022-06-26 00:00:10"); // List<FirePointEntity> 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") @PostMapping("/insertFirePoint")
public String insertFirePoint(@RequestBody FirePointQo firePointQo) { public String insertFirePoint(@RequestBody FirePointQo firePointQo) {
@ -84,11 +88,17 @@ public class FirePointController {
} }
} }
/**
* Complete
*/
@RequestMapping(value = "/download/vipuserfirepoint", method = RequestMethod.GET) @RequestMapping(value = "/download/vipuserfirepoint", method = RequestMethod.GET)
public String downloadVipUserFirePoint(HttpServletResponse response, HttpServletRequest request) { public String downloadVipUserFirePoint(HttpServletResponse response, HttpServletRequest request) {
return firePointService.downloadVipUserFilePoint(request, response); return firePointService.downloadVipUserFilePoint(request, response);
} }
/**
* Complete
*/
@RequestMapping(value = "/download/firepoint", method = RequestMethod.GET) @RequestMapping(value = "/download/firepoint", method = RequestMethod.GET)
public String downloadFirePoint(HttpServletResponse response, HttpServletRequest request, @RequestParam(value = "ids") String ids) { public String downloadFirePoint(HttpServletResponse response, HttpServletRequest request, @RequestParam(value = "ids") String ids) {
return firePointService.downloadFirePoint(request, response, ids); return firePointService.downloadFirePoint(request, response, ids);
@ -98,12 +108,13 @@ public class FirePointController {
* 动态多条件查询火点列表 * 动态多条件查询火点列表
*/ */
@GetMapping("/queryFirePoint") @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 = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime, @RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "satelliteType", required = false) String satelliteType, @RequestParam(value = "satelliteType", required = false) String satelliteType,
@RequestParam(value = "landType", required = false) String landType) { @RequestParam(value = "landType", required = false) String landType) {
List<FirePointEntity> firePointList = firePointService.queryFirePoint(code, startTime, endTime, satelliteType, landType); List<FirePointEntity> firePointList = firePointService.queryFirePoint(token, code, startTime, endTime, satelliteType, landType);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, firePointList, locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, firePointList, locale);
} }

View File

@ -6,7 +6,6 @@ import com.xkrs.straw.model.bean.FirePointQueryResultBean;
import com.xkrs.straw.model.bean.VipTimeRangeBean; import com.xkrs.straw.model.bean.VipTimeRangeBean;
import com.xkrs.straw.model.entity.FirePointOrdinaryEntity; import com.xkrs.straw.model.entity.FirePointOrdinaryEntity;
import com.xkrs.straw.model.entity.FirePointPreciseEntity; import com.xkrs.straw.model.entity.FirePointPreciseEntity;
import com.xkrs.straw.model.entity.SysUserEntity;
import com.xkrs.straw.model.vo.AllFirePointVo; import com.xkrs.straw.model.vo.AllFirePointVo;
import com.xkrs.utils.DateTimeUtil; import com.xkrs.utils.DateTimeUtil;
import com.xkrs.utils.DateTimeUtils; import com.xkrs.utils.DateTimeUtils;
@ -37,13 +36,15 @@ public class FirePointQueryManager {
@Resource @Resource
private FirePointPreciseDao firePointPreciseDao; 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; String mNoRedundantUserCode = null;
final List<VipTimeRangeBean.VipTimeRangeItemBean> mVipTimeRangeItemList = new ArrayList<>(); final List<VipTimeRangeBean.VipTimeRangeItemBean> mVipTimeRangeItemList = new ArrayList<>();
try { try {
//获取用户注册的区划编码
String userCode = sysUserEntity.getCountyCode();
//如果用户注册的区划编码是空就返回失败 //如果用户注册的区划编码是空就返回失败
if (TextUtils.isEmpty(userCode)) { if (TextUtils.isEmpty(userCode)) {
return new FirePointQueryResultBean("User CountyCode Error 1, userCode = " + 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); return new FirePointQueryResultBean("User CountyCode Error 2, userCode = " + userCode + ", noRedundantUserCode = " + noRedundantUserCode);
} }
//获取用户的VIP时间范围
String vipTimeRangeJson = sysUserEntity.getVipTimeRangeJson();
//如果用户的VIP时间范围数据是空就返回失败 //如果用户的VIP时间范围数据是空就返回失败
if (TextUtils.isEmpty(vipTimeRangeJson)) { if (TextUtils.isEmpty(vipTimeRangeJson)) {
return new FirePointQueryResultBean("User VipTimeRangeJson Error 1, vipTimeRangeJson = " + vipTimeRangeJson); return new FirePointQueryResultBean("User VipTimeRangeJson Error 1, vipTimeRangeJson = " + vipTimeRangeJson);