Browse Source

定位次数允许删除

master
caojianbin 2 months ago
parent
commit
6e0dccfbbb
  1. 8
      ecell-internationalize/ecell-internationalize-app/src/main/java/com/ecell/internationalize/app/controller/LatestLocationAppController.java
  2. 32
      ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/LocationLimitInfoController.java

8
ecell-internationalize/ecell-internationalize-app/src/main/java/com/ecell/internationalize/app/controller/LatestLocationAppController.java

@ -63,11 +63,9 @@ public class LatestLocationAppController {
if (CommonConstant.AUDIT_STATUS_ONE.equals(onlineStatus)){ if (CommonConstant.AUDIT_STATUS_ONE.equals(onlineStatus)){
String deviceModelId = deviceInfo.getDeviceModelId(); String deviceModelId = deviceInfo.getDeviceModelId();
String hasKey="local:limitCount"+":"+deviceModelId; String hasKey="local:limitCount"+":"+deviceModelId;
int limitCount=500; // int limitCount=5;
if (redisService.hasKey(hasKey)){ if (redisService.hasKey(hasKey)){
limitCount=redisService.getCacheObject(hasKey); int limitCount=redisService.getCacheObject(hasKey);
}
Long count =(Long) redisService.redisTemplate.execute(localLimitScript, Arrays.asList(imei),limitCount,getStartTimeStamp()); Long count =(Long) redisService.redisTemplate.execute(localLimitScript, Arrays.asList(imei),limitCount,getStartTimeStamp());
System.out.println("定位次数===:"+count); System.out.println("定位次数===:"+count);
if (count<=0){ if (count<=0){
@ -76,6 +74,8 @@ public class LatestLocationAppController {
} }
} }
}
return AjaxResult.success(latestLocationAppService.getLastLocationInstructions(imei,onlineStatus)); return AjaxResult.success(latestLocationAppService.getLastLocationInstructions(imei,onlineStatus));
} }
@ApiOperation(value ="获取设备最新位置信息") @ApiOperation(value ="获取设备最新位置信息")

32
ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/LocationLimitInfoController.java

@ -171,6 +171,38 @@ public class LocationLimitInfoController {
return i>0? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); return i>0? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR));
} }
// /**
// *
// * @param id
// * @param type
// * @return
// */
// @GetMapping("/enabled/{id}/{type}")
// public AjaxResult enabled(@PathVariable("id") String id,@PathVariable("type") String type) {
// LocationLimitInfo locationLimitInfo=null;
// if (StringUtils.isNotEmpty(id)){
// QueryWrapper<LocationLimitInfo>wrapper =new QueryWrapper<>();
// wrapper.eq("id",id);
// locationLimitInfo= locationLimitInfoService.getBaseMapper().selectOne(wrapper);
// if (StringUtils.isNull(locationLimitInfo)){
// return AjaxResult.error(LocaleUtil.getMessage(FieldConstant.LOCATIONINFO_MESSAGES_ERROR));
// }
// }
// int i = locationLimitInfoService.getBaseMapper().deleteById(id);
// if (i>0){
// String hashKey="local:limitCount"+":"+locationLimitInfo.getModelId();
// if (redisService.hasKey(hashKey)){
// redisService.deleteObject(hashKey);
// }
//
// }
//
//
//
// return i>0? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR));
// }
//

Loading…
Cancel
Save