| | |
| | | import com.sandu.ximon.admin.param.PoleBindingParam; |
| | | import com.sandu.ximon.admin.param.PoleParam; |
| | | import com.sandu.ximon.admin.param.PoleStatesParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.AirEquipmentService; |
| | | import com.sandu.ximon.admin.service.IpVolumeService; |
| | | import com.sandu.ximon.admin.service.MonitorService; |
| | | import com.sandu.ximon.admin.service.PoleService; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private MonitorService monitorService; |
| | | private IpVolumeService broadcastTerminalV2Service; |
| | | private AirEquipmentService airEquipmentService; |
| | | private final PermissionConfig permissionConfig; |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addPole(@RequestBody @Validated PoleParam param) { |
| | |
| | | |
| | | @PostMapping("/list") |
| | | public ResponseVO<Object> listPole(BaseConditionVO baseConditionVO, @RequestBody PoleStatesParam param) { |
| | | if (!permissionConfig.check(MenuEnum.POLE_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | List<Pole> results = poleService.queryAllStatesAndList(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(),param); |
| | | List<Pole> results = poleService.queryAllStatesAndList(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), param); |
| | | CommonPage commonPage = CommonPage.restPage(results); |
| | | int size = results.size(); |
| | | commonPage.setTotal((long) size); |
| | |
| | | commonPage.setTotalPage(size / baseConditionVO.getPageSize()); |
| | | } |
| | | return ResponseUtil.success(commonPage); |
| | | // return ResponseUtil.success(poles); |
| | | // return ResponseUtil.success(poles); |
| | | } |
| | | |
| | | @GetMapping("/listPoleAndState") |
| | | public ResponseVO<Object> listPoleAndState(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "groupid", required = false) Long groupid) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | List<Pole> poles = poleService.queryStatesAndList(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(),keyword,groupid); |
| | | List<Pole> poles = poleService.queryStatesAndList(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), keyword, groupid); |
| | | return ResponseUtil.successPage(poles); |
| | | } |
| | | |
| | | /** |
| | | * 在线数量 |
| | | */ |
| | | @GetMapping("/online") |
| | | public ResponseVO<Object> online() { |
| | | return ResponseUtil.success(poleService.poleCount()); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查找自己拥有的灯杆 |
| | | */ |
| | | @PostMapping("/getOwnerPole/{cilentId}") |
| | | public ResponseVO<Object> getOwnerPole(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword |
| | | , @PathVariable Long cilentId) { |
| | | List<Pole> results = poleService.getOwnerPole(baseConditionVO, keyword, cilentId); |
| | | // CommonPage commonPage = CommonPage.restPage(results); |
| | | // int size = results.size(); |
| | | // commonPage.setTotal((long) size); |
| | | // commonPage.setTotalPage(size / baseConditionVO.getPageSize() + 1); |
| | | // if (size % baseConditionVO.getPageSize() == 0) { |
| | | // commonPage.setTotalPage(size / baseConditionVO.getPageSize()); |
| | | // } |
| | | // return ResponseUtil.success(commonPage); |
| | | return ResponseUtil.success(results); |
| | | } |
| | | |
| | | /** |
| | | * 查看灯杆绑定的设备 |
| | | */ |
| | | @PostMapping("/getPoleBindDevice/{poleId}") |
| | | public ResponseVO<Object> getPoleBindDevice(@PathVariable Long poleId) { |
| | | return ResponseUtil.success(poleService.getBindByPoleId(poleId)); |
| | | } |
| | | |
| | | |
| | | } |