| | |
| | | @GetMapping("/basContainer/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | BasContainer basContainer = basContainerService.getById(id); |
| | | // 确保返回的areas按sort字段排序 |
| | | if (basContainer != null) { |
| | | basContainer.sortAreas(); |
| | | } |
| | | return R.ok().add(basContainer); |
| | | } |
| | | |
| | |
| | | basContainer.setCreateTime(new Date()); |
| | | basContainer.setUpdateBy(getLoginUserId()); |
| | | basContainer.setUpdateTime(new Date()); |
| | | |
| | | // 确保areas按sort字段排序 |
| | | basContainer.sortAreas(); |
| | | |
| | | BasContainer container = basContainerService.getOne(new LambdaQueryWrapper<BasContainer>().eq(BasContainer::getContainerType, basContainer.getContainerType())); |
| | | if (null != container) { |
| | | return R.error("该类型已被初始化"); |
| | |
| | | public R update(@RequestBody BasContainer basContainer) { |
| | | basContainer.setUpdateBy(getLoginUserId()); |
| | | basContainer.setUpdateTime(new Date()); |
| | | |
| | | // 确保areas按sort字段排序 |
| | | basContainer.sortAreas(); |
| | | |
| | | if (!basContainerService.updateById(basContainer)) { |
| | | return R.error("Update Fail"); |
| | | } |