| | |
| | | public String getMapFloorList(Long userId) { |
| | | String floorKey = "map-floor-list"; |
| | | Dict dict = dictService.getOne(new LambdaQueryWrapper<Dict>().eq(Dict::getFlag, floorKey)); |
| | | if (null == dict) { |
| | | dict = new Dict(); |
| | | dict.setName(floorKey); |
| | | dict.setFlag(floorKey); |
| | | dict.setType(DictType.JSON.flag); |
| | | dict.setValue("[\n" + |
| | | " {\n" + |
| | | " label: '1F',\n" + |
| | | " value: 1\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " label: '2F',\n" + |
| | | " value: 2\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " label: '3F',\n" + |
| | | " value: 3\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " label: '4F',\n" + |
| | | " value: 4\n" + |
| | | " },\n" + |
| | | " {\n" + |
| | | " label: '5F',\n" + |
| | | " value: 5\n" + |
| | | " },\n" + |
| | | "]"); |
| | | dict.setCreateBy(userId); |
| | | dict.setUpdateBy(userId); |
| | | if (!dictService.save(dict)) { |
| | | throw new CoolException("服务器内部错误"); |
| | | } |
| | | } |
| | | return Optional.ofNullable(dict).map(Dict::getValue).orElse(null); |
| | | } |
| | | |