|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
|---|
|  |  |  | import com.core.annotations.ManagerAuth; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.R; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取地图楼层数据 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("/map/lev/list") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R getMapLevList() { | 
|---|
|  |  |  | List<BasMap> basMaps = basMapService.selectList(new EntityWrapper<BasMap>().orderBy("lev", true)); | 
|---|
|  |  |  | ArrayList<Integer> levList = new ArrayList<>(); | 
|---|
|  |  |  | for (BasMap basMap : basMaps) { | 
|---|
|  |  |  | levList.add(basMap.getLev()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok().add(levList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取地图数据 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("/map/{lev}/auth") | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/map/resetMap/{lev}") | 
|---|
|  |  |  | @ManagerAuth(memo = "重置Redis地图") | 
|---|
|  |  |  | public R resetMapToRedisByLev(@PathVariable Integer lev, HttpServletRequest request) { | 
|---|
|  |  |  | // super账号 | 
|---|
|  |  |  | String token = request.getHeader("token"); | 
|---|
|  |  |  | if (token == null) { | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String deToken = Cools.deTokn(token, superPwd); | 
|---|
|  |  |  | if (deToken == null) { | 
|---|
|  |  |  | return R.error("权限不足"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!"super".equals(deToken.substring(13))) { | 
|---|
|  |  |  | return R.error("权限不足"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | redisUtil.del(RedisKeyType.MAP.key + lev); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|