| | |
| | | import com.zy.asrs.service.BasStationService; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | | import com.zy.asrs.utils.MapExcelUtils; |
| | | import com.zy.common.utils.NavigateSolution; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.SlaveType; |
| | |
| | | |
| | | private static final String FREE_EDITOR_MODE = "free-v1"; |
| | | private static final Set<String> RUNTIME_TYPES = new HashSet<>(Arrays.asList( |
| | | "shelf", "crn", "dualCrn", "devp", "rgv" |
| | | "shelf", "crn", "dualCrn", "devp", "rgv", "annulus" |
| | | )); |
| | | private static final int DEFAULT_ROW_HEIGHT = 200; |
| | | private static final int DEFAULT_COL_WIDTH = 1000; |
| | |
| | | persistFloorMap(lev, storedData, toFreeEditorDoc(lev, storedData)); |
| | | } |
| | | rebuildDeviceAndStationSync(); |
| | | clearMapCaches(); |
| | | clearMapCaches(levList); |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<List<HashMap<String, Object>>> storedData = compileToStoredMapData(normalizedDoc); |
| | | persistFloorMap(normalizedDoc.getLev(), storedData, normalizedDoc); |
| | | rebuildDeviceAndStationSync(); |
| | | clearMapCaches(); |
| | | clearMapCaches(Collections.singletonList(normalizedDoc.getLev())); |
| | | } |
| | | |
| | | private void persistFloorMap(Integer lev, |
| | |
| | | element.setWidth(width); |
| | | element.setHeight(height); |
| | | element.setValue(stringifyValue(source == null ? null : source.getValue())); |
| | | // 添加环穿轨道等信息 |
| | | if (source != null && !Cools.isEmpty(source.getShape())) { |
| | | element.setShape(String.valueOf(source.getShape()).trim()); |
| | | } |
| | | if (source != null && source.getPathList() != null && !source.getPathList().isEmpty()) { |
| | | List<Map<String, Object>> copy = new ArrayList<>(); |
| | | for (Map<String, Object> seg : source.getPathList()) { |
| | | if (seg == null || seg.isEmpty()) { |
| | | continue; |
| | | } |
| | | copy.add(new LinkedHashMap<>(seg)); |
| | | } |
| | | element.setPathList(copy); |
| | | } |
| | | if (source != null && source.getTurningPoint() != null && !source.getTurningPoint().isEmpty()) { |
| | | element.setTurningPoint(new LinkedHashMap<>(source.getTurningPoint())); |
| | | } |
| | | if (source != null && source.getAnnulusBandInset() != null) { |
| | | element.setAnnulusBandInset(source.getAnnulusBandInset()); |
| | | } |
| | | if ("devp".equals(element.getType())) { |
| | | validateDevpValue(element.getValue(), index); |
| | | } |
| | |
| | | return JSON.toJSONString(list, SerializerFeature.DisableCircularReferenceDetect); |
| | | } |
| | | |
| | | private void clearMapCaches() { |
| | | private void clearMapCaches(List<Integer> levList) { |
| | | redisUtil.del(RedisKeyType.LOC_MAP_BASE.key); |
| | | redisUtil.del(RedisKeyType.LOC_MAST_MAP_LIST.key); |
| | | if (levList == null || levList.isEmpty()) { |
| | | return; |
| | | } |
| | | LinkedHashSet<Integer> distinctLevSet = new LinkedHashSet<>(levList); |
| | | for (Integer lev : distinctLevSet) { |
| | | if (lev == null) { |
| | | continue; |
| | | } |
| | | NavigateSolution.refreshMapCache(lev); |
| | | } |
| | | } |
| | | |
| | | private String normalizeType(String type) { |