|  |  |  | 
|---|
|  |  |  | import com.zy.common.utils.NavigateMapData; | 
|---|
|  |  |  | import com.zy.common.utils.RedisUtil; | 
|---|
|  |  |  | import com.zy.core.enums.RedisKeyType; | 
|---|
|  |  |  | import com.zy.core.properties.SlaveProperties; | 
|---|
|  |  |  | import com.zy.core.properties.SystemProperties; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Value; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | 
|---|
|  |  |  | public class ConsoleController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SlaveProperties slaveProperties; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private BasMapService basMapService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private RedisUtil redisUtil; | 
|---|
|  |  |  | @Value("${super.pwd}") | 
|---|
|  |  |  | private String superPwd; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private NavigateMapData navigateMapData; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BasMap basMap = JSON.parseObject(data.toString(), BasMap.class); | 
|---|
|  |  |  | //解析json地图数据 | 
|---|
|  |  |  | ArrayList arrayList = JSON.parseObject(basMap.getData(), ArrayList.class); | 
|---|
|  |  |  | List<List<MapNode>> lists = navigateMapData.filterMap(NavigationMapType.NONE.id, arrayList, lev, null, null);//过滤地图数据 | 
|---|
|  |  |  | List<List<MapNode>> arrayList = (List<List<MapNode>>) data; | 
|---|
|  |  |  | List<List<MapNode>> lists = navigateMapData.filterMap(NavigationMapType.getMapTypes(NavigationMapType.NONE, NavigationMapType.PATH_LOCK), arrayList, lev, null, null);//过滤地图数据 | 
|---|
|  |  |  | return R.ok().add(lists); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取库位地图数据 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping("/locMap/{lev}/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R getLocMap(@PathVariable Integer lev) { | 
|---|
|  |  |  | Object data = redisUtil.get(RedisKeyType.MAP.key + lev); | 
|---|
|  |  |  | if (data == null) { | 
|---|
|  |  |  | return R.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<List<MapNode>> arrayList = (List<List<MapNode>>) data; | 
|---|
|  |  |  | List<List<MapNode>> lists = navigateMapData.filterMap(NavigationMapType.getMapTypes(NavigationMapType.NONE), arrayList, lev, null, null);//过滤地图数据 | 
|---|
|  |  |  | return R.ok().add(lists); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/map/resetMap/auth") | 
|---|
|  |  |  | @ManagerAuth | 
|---|
|  |  |  | public R resetMapToRedis() { | 
|---|
|  |  |  | for (int i = 1; i <= 10; i++) {//总共10层楼 | 
|---|
|  |  |  | redisUtil.del(RedisKeyType.MAP.key + i); | 
|---|
|  |  |  | List<BasMap> basMaps = basMapService.selectList(new EntityWrapper<BasMap>().orderBy("lev", true)); | 
|---|
|  |  |  | for (BasMap basMap : basMaps) { | 
|---|
|  |  |  | Integer lev = basMap.getLev(); | 
|---|
|  |  |  | redisUtil.del(RedisKeyType.MAP.key + lev); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|