| | |
| | | import com.zy.acs.manager.manager.controller.param.MapDataParam; |
| | | import com.zy.acs.manager.manager.controller.param.MapParam; |
| | | import com.zy.acs.manager.manager.controller.result.MapAgvVo; |
| | | import com.zy.acs.manager.manager.controller.result.MapAreaResult; |
| | | import com.zy.acs.manager.manager.controller.result.MapPointVo; |
| | | import com.zy.acs.manager.manager.controller.result.MapRouteVo; |
| | | import com.zy.acs.manager.manager.entity.*; |
| | |
| | | public synchronized R startupOrShutdown() { |
| | | Boolean taskAssignMode = configService.getVal("TaskAssignMode", Boolean.class); |
| | | return configService.setVal("TaskAssignMode", !taskAssignMode) ? R.ok() : R.error(); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:list')") |
| | | @PostMapping("/config/preferences") |
| | | public R configPreferences(@RequestParam(required = false) Long zoneId, @RequestParam(required = false) Integer floor) { |
| | | Integer dashboardAgvAngleOffsetVal = configService.getVal("dashboardAgvAngleOffsetVal", Integer.class); |
| | | Boolean dashMapMirror = configService.getVal("dashMapMirror", Boolean.class); |
| | | return R.ok().add(Cools |
| | | .add("agvAngleOffsetVal", Optional.ofNullable(dashboardAgvAngleOffsetVal).orElse(0)) |
| | | .add("mapMirror", Optional.ofNullable(dashMapMirror).orElse(Boolean.FALSE)) |
| | | ); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:list')") |
| | |
| | | |
| | | // area operate ------------------------- |
| | | |
| | | @PreAuthorize("hasAuthority('map:save')") |
| | | @PostMapping("/area/save") |
| | | @Transactional |
| | | public R save(@RequestBody MapAreaParam param) { |
| | | Date now = new Date(); |
| | | @PreAuthorize("hasAuthority('manager:loc:list')") |
| | | @PostMapping("/area/list") |
| | | public R areaFetch(@RequestParam(required = false) Long zoneId, @RequestParam(required = false) Integer floor) { |
| | | List<Area> areaList = areaService.list(new LambdaQueryWrapper<Area>().eq(Area::getStatus, StatusType.ENABLE.val)); |
| | | List<MapAreaResult> list = new ArrayList<>(); |
| | | for (Area area : areaList) { |
| | | MapAreaResult result = new MapAreaResult(); |
| | | list.add(result.sync(area)); |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:list')") |
| | | @GetMapping("/area/get") |
| | | public R areaGet(@RequestParam Long areaId) { |
| | | Area area = areaService.getById(areaId); |
| | | return R.ok().add(new MapAreaResult().sync(area)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:update')") |
| | | @PostMapping("/area/save") |
| | | public R areaSave(@RequestBody MapAreaParam param) { |
| | | return R.ok().add(areaService.saveMapArea(param, getLoginUserId())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:update')") |
| | | @PostMapping("/area/update") |
| | | public R areaUpdate(@RequestBody MapAreaParam param) { |
| | | return R.ok().add(areaService.modifyMapArea(param, getLoginUserId())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:remove')") |
| | | @PostMapping("/area/remove") |
| | | public R areaRemove(@RequestBody MapAreaParam param) { |
| | | areaService.removeMapArea(param.getId(), getLoginUserId()); |
| | | return R.ok(); |
| | | } |
| | | |