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 符合条件的火点列表
*/
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.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;
/**
* 添加火点信息
*/

View File

@ -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<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")
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<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);
}

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.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<VipTimeRangeBean.VipTimeRangeItemBean> 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);