| | |
| | | import com.sandu.common.domain.CommonPage; |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.dto.DeviceStatus; |
| | |
| | | public ResponseVO<Object> bindPole(@PathVariable Long poleId, @RequestBody @Validated PoleBindingParam param) { |
| | | boolean result = poleService.bindPole(poleId, param); |
| | | if (result) { |
| | | //设备类型,0路灯,1nove,2充电桩,3大气监测,4水质监测,5ip音柱,6lcd广告机,7摄像头,8杆体倾测,9一键救助, 10熙讯 |
| | | //设备类型,0路灯,1nove,2充电桩,3大气监测,4水质监测,5ip音柱,6lcd广告机,7摄像头,8杆体倾测,9一键救助, 10熙讯, 11农耕 |
| | | switch (param.getDeviceType()) { |
| | | case 0: |
| | | Pole pole = poleService.getById(poleId); |
| | |
| | | break; |
| | | case 10: |
| | | break; |
| | | case 11: |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | * 灯杆绑定设备 |
| | | */ |
| | | @PostMapping("/unBind/{poleId}") |
| | | public ResponseVO<Object> unBindPole(@PathVariable Long poleId, @RequestBody PoleBindingParam param) { |
| | | public ResponseVO<Object> unBindPole(@PathVariable Long poleId, @RequestBody @Validated PoleBindingParam param) { |
| | | boolean result = poleService.unBindPole(poleId, param.getDeviceCode()); |
| | | if (result) { |
| | | //设备类型,0路灯,1led屏幕,2充电桩,3大气监测,4水质监测,5ip音柱,6lcd广告机,7摄像头,8杆体倾测,9一键救助, 10熙讯 |
| | | //设备类型,0路灯,1led屏幕,2充电桩,3大气监测,4水质监测,5ip音柱,6lcd广告机,7摄像头,8杆体倾测,9一键救助, 10熙讯, 11农耕 |
| | | switch (param.getDeviceType()) { |
| | | case 0: |
| | | //删除灯杆的devicescode |
| | | Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, poleId)); |
| | | if (pole != null) { |
| | | pole.setDeviceCode(null); |
| | | poleService.updateById(pole); |
| | | poleService.updateDeviceCode(pole.getId()); |
| | | } |
| | | break; |
| | | case 1: |
| | |
| | | case 9: |
| | | break; |
| | | case 10: |
| | | break; |
| | | case 11: |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 推送大气设备到诺瓦 |
| | | */ |
| | | @AnonymousAccess |
| | | @GetMapping("/pushAidDataToNova/{poleId}") |
| | | public ResponseVO<Object> pushAirDataToNova(@PathVariable Long poleId) { |
| | | return ResponseUtil.success(poleService.pushAirDataToNova(poleId)); |
| | | } |
| | | |
| | | /** |
| | | * 推送大气设备到熙讯 |
| | | */ |
| | | @AnonymousAccess |
| | | @GetMapping("/pushAirDataToXiXun/{poleId}") |
| | | public ResponseVO<Object> pushAirDataToXiXun(@PathVariable Long poleId) { |
| | | return ResponseUtil.success(poleService.pushAirDataToXiXun(poleId)); |
| | | } |
| | | |
| | | } |