| | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.utils.NavigateSolution; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public R add(BasMap basMap) { |
| | | basMapService.save(basMap); |
| | | if (basMap != null && basMap.getLev() != null) { |
| | | NavigateSolution.refreshMapCache(basMap.getLev()); |
| | | basMapService.refreshMapRuntimeCaches(Collections.singletonList(basMap.getLev())); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | } |
| | | BasMap oldBasMap = basMapService.getById(basMap.getId()); |
| | | basMapService.updateById(basMap); |
| | | if (oldBasMap != null && oldBasMap.getLev() != null) { |
| | | NavigateSolution.clearMapCache(oldBasMap.getLev()); |
| | | } |
| | | Integer refreshLev = basMap.getLev() != null |
| | | ? basMap.getLev() |
| | | : oldBasMap == null ? null : oldBasMap.getLev(); |
| | | if (refreshLev != null) { |
| | | NavigateSolution.refreshMapCache(refreshLev); |
| | | List<Integer> refreshLevList = new ArrayList<>(); |
| | | if (oldBasMap != null && oldBasMap.getLev() != null) { |
| | | refreshLevList.add(oldBasMap.getLev()); |
| | | } |
| | | refreshLevList.add(refreshLev); |
| | | basMapService.refreshMapRuntimeCaches(refreshLevList); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | BasMap basMap = basMapService.getById(id); |
| | | basMapService.removeById(id); |
| | | if (basMap != null && basMap.getLev() != null) { |
| | | NavigateSolution.clearMapCache(basMap.getLev()); |
| | | basMapService.refreshMapRuntimeCaches(Collections.singletonList(basMap.getLev())); |
| | | } |
| | | } |
| | | return R.ok(); |