| | |
| | | LED_LIST("LED屏列表"), |
| | | LED_PROGRAM_LIST("节目列表"), |
| | | PLAYPLAN_LIST("播放计划列表"), |
| | | LED_FILE_LIST("LED屏素材列表"), |
| | | LED_FILE_S_LIST("LED屏素材列表"), |
| | | AIR_EQUIPMENT_LIST("大气设备列表"), |
| | | AIR_DATA_LIST("大气数据列表"), |
| | | AIR_EQUIPMENT_NONG_GENG_LIST("大气设备农耕列表"), |
| | |
| | | ADMIN_INFO_UPDATE("编辑管理员信息"), |
| | | ADMIN_DELETE("删除管理员"), |
| | | AIR_EQUIPMENT_DELETE("删除大气设备"), |
| | | AIR_DATA_UPDATE("手动更新大气数据"), |
| | | BANNER_ADD("添加微信logo"), |
| | | BANNER_UPDATE("编辑微信logo"), |
| | | BANNER_DETAIL("获取微信logo详情"), |
| | |
| | | IP_BROADCAST_SYNCH("同步IP音柱"), |
| | | IP_BROADCAST_INFO_UPDATE("修改IP音柱名称"), |
| | | IP_BROADCAST_CHANGE_VOL("修改IP音柱音量"), |
| | | IP_BROADCAST_FILE_ADD("添加IP音柱文件"), |
| | | IP_BROADCAST_FILE_DELETE("删除IP音柱文件"), |
| | | IP_BROADCAST_FILE_UPLOADING("上传IP音柱文件"), |
| | | IP_BROADCAST_TASK_ADD("添加IP音柱任务"), |
| | | IP_BROADCAST_TASK_UPDATE("编辑IP音柱任务"), |
| | | IP_BROADCAST_TASK_DELETE("删除IP音柱任务"), |
| | | IP_BROADCAST_TASK_DETAIL("获取IP音柱任务详情"), |
| | | IP_BROADCAST_TASK_PLAY("推送IP音柱任务"), |
| | | IP_BROADCAST_TASK_CONTINUE("继续IP音柱任务"), |
| | | IP_BROADCAST_TASK_PAUSE("暂停IP音柱任务"), |
| | | IP_BROADCAST_TASK_STOP("停止IP音柱任务"), |
| | | LED_N_ADD("新增诺瓦节目"), |
| | | LED_N_UPDATE("编辑诺瓦节目"), |
| | | LED_N_DETAIL("获取诺瓦节目详情"), |
| | | LED_N_DELETE("删除诺瓦节目"), |
| | | LED_FILE_N_ADD("新增诺瓦文件"), |
| | | LED_FILE_N_DELETE("删除诺瓦文件"), |
| | | LED_FILE_S_ADD("添加熙汛文件"), |
| | | LED_FILE_S_DELETE("删除熙汛文件"), |
| | | LIGHT_REMARK("添加单灯备注"), |
| | | LIGHT_EXPORT_LIST("导出单灯数据"), |
| | | LIGHT_CONTROL("单灯控制"), |
| | | LIGHT_SET_POWER("设置单灯功率"), |
| | | LIGHT_POLE_HEELING_HEARTBEAT_PACKAGE("灯杆倾斜心跳包"), |
| | | LIGHT_POLE_HEELING_HEARTBEAT_PACKAGE_QUERY_TIME("灯杆倾斜心跳包间隔时间"), |
| | | LIGHT_POLE_HEELING_RESTART("灯杆倾斜软重启"), |
| | | LIGHT_POLE_HEELING_HEARTBEAT_PACKAGE_SET_TIME("设置灯杆倾斜心跳包间隔时间"), |
| | | LIGHT_POLE_HEELING_SET_SENSORSTATE("设置传感器为初始状态"), |
| | | LIGHT_POLE_HEELING_EQUIPMENT_LIST("倾斜设备"), |
| | | LIGHT_POLE_HEELING_PROCESSING("倾斜警告处理"), |
| | | LIGHT_TASK_ADD("添加路灯任务"), |
| | | LIGHT_TASK_DELETE("删除路灯任务"), |
| | | LIGHT_TASK_UPDATE("编辑路灯任务"), |
| | | LIGHT_TASK_DETAIL("路灯任务详情"), |
| | | LIGHT_TASK_ISSUE("下发路灯任务"), |
| | | MONITOR_DELETE("删除摄像头"), |
| | | MONITOR_ADD("添加摄像头"), |
| | | MONITOR_INFO("获取摄像头信息"), |
| | | MONITOR_VIDEO_URL("获取摄像头URL播放地址"), |
| | | MONITOR_NOTES("修改摄像头备注"), |
| | | |
| | | |
| | | WATER_EQUIPMENT_ADD("新增水质设备"); |
| | |
| | | return ResponseUtil.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据灯杆查询大气数据 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @AnonymousAccess |
| | | @GetMapping("/listAirDataByLamp") |
| | | public ResponseVO<Object> listAirDataByLamp(@RequestParam Long lampId) { |
| | | return ResponseUtil.success(airDataService.getDataByPoleid(lampId)); |
| | | } |
| | | |
| | | @PostMapping("/updateAirEquipmentInfo") |
| | | public ResponseVO<Object> updataAirEquipmentInfo(@RequestBody List<String> listMac) { |
| | | if (!permissionConfig.check(MenuEnum.AIR_DATA_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | AirDataReqInnerFrame airDataReqInnerFrame = new AirDataReqInnerFrame(); |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), airDataReqInnerFrame); |
| | | System.out.println(a5Frame + " --------a5Frame"); |
| | |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/getAirEquipment/{mac}") |
| | | public ResponseVO<Object> getAirEquipment(@PathVariable String mac) { |
| | | return ResponseUtil.success(airEquipmentService.getAirEquipment(mac)); |
| | | } |
| | | } |
| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addFile(@RequestBody @Validated IpVolumeFileParam fileParam) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_FILE_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ipVolumeFileService.addFile(fileParam)); |
| | | } |
| | | |
| | | @PostMapping("/delete/{fileId}") |
| | | public ResponseVO<Object> deleteFile(@PathVariable Long fileId) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_FILE_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List<BroadcastV2TaskFile> list = v2TaskFileService.list(Wrappers.lambdaQuery(BroadcastV2TaskFile.class).eq(BroadcastV2TaskFile::getFileId, fileId)); |
| | | if (list.size() != 0) { |
| | | throw new BusinessException("此文件正在被其他任务占用"); |
| | |
| | | } |
| | | LambdaQueryWrapper<IpVolumeFile> wrapper = ipVolumeFileService.listFile(baseConditionVO, keyword); |
| | | |
| | | |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | /* if (null != keyword) { |
| | | wrapper.like(IpVolumeFile::getFileName, keyword); |
| | | }*/ |
| | | |
| | | |
| | | |
| | | return ResponseUtil.success(ipVolumeFileService.list(wrapper)); |
| | | } |
| | | |
| | | @PostMapping("/IpVolumeFileUploading") |
| | | public ResponseVO<Object> uploadingFile(@RequestParam("file") MultipartFile file) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_FILE_UPLOADING.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ipVolumeFileService.upload(file)); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addMission(@RequestBody IpVolumeMissionParam missionParam) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_TASK_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ipVolumeMissionService.addMission(missionParam)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/update/{taskId}") |
| | | public ResponseVO<Object> updateMission(@PathVariable Integer taskId, @RequestBody IpVolumeMissionParam missionParam) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_TASK_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | Integer result = ipVolumeMissionService.updateMission(taskId, missionParam); |
| | | if (result == 0) { |
| | | return ResponseUtil.success("修改成功"); |
| | |
| | | |
| | | @PostMapping("/delete/{taskId}") |
| | | public ResponseVO<Object> deleteMission(@PathVariable Integer taskId) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_TASK_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | // 0:成功 1:任务不处于空闲状态 2:服务器删除失败 |
| | | Integer result = ipVolumeMissionService.deleteMission(taskId); |
| | | if (result == 0) { |
| | |
| | | //获取任务详情 |
| | | @GetMapping("/getByTaskId/{taskId}") |
| | | public ResponseVO<Object> getByTaskId(@PathVariable Integer taskId) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_TASK_DETAIL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ipVolumeMissionService.getByTaskId(taskId)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/playTask/{taskId}") |
| | | public ResponseVO<Object> playTask(@PathVariable Integer taskId) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_TASK_PLAY.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ipVolumeMissionService.playTask(taskId)); |
| | | } |
| | | |
| | | @GetMapping("/continueTask/{taskId}") |
| | | public ResponseVO<Object> continueTask(@PathVariable Integer taskId) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_TASK_CONTINUE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ipVolumeMissionService.continueTask(taskId)); |
| | | } |
| | | |
| | | @GetMapping("/pauseTask/{taskId}") |
| | | public ResponseVO<Object> pauseTask(@PathVariable Integer taskId) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_TASK_PAUSE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ipVolumeMissionService.pauseTask(taskId)); |
| | | } |
| | | |
| | | @GetMapping("/stopTask/{taskId}") |
| | | public ResponseVO<Object> stopTask(@PathVariable Integer taskId) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_TASK_STOP.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ipVolumeMissionService.stopTask(taskId)); |
| | | } |
| | | |
| | |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.LEDProgramParam; |
| | | import com.sandu.ximon.admin.param.ReceiveParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.LEDProgramService; |
| | | import com.sandu.ximon.dao.domain.LEDProgram; |
| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addLEDProgram(@RequestBody @Validated LEDProgramParam ledProgramParam) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledProgramService.addProgram(ledProgramParam)); |
| | | } |
| | | |
| | | @PostMapping("/update/{pid}") |
| | | public ResponseVO<Object> updateLEDProgram(@PathVariable Long pid, @RequestBody @Validated LEDProgramParam ledProgramParam) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledProgramService.updateProgram(pid, ledProgramParam)); |
| | | } |
| | | |
| | | @GetMapping("/getbypid/{pid}") |
| | | public ResponseVO<Object> getByPid(@PathVariable Long pid) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_DETAIL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledProgramService.getByPid(pid)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/delete/{pid}") |
| | | public ResponseVO<Object> deleteLEDProgram(@PathVariable Long pid) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledProgramService.deleteProgram(pid)); |
| | | } |
| | | |
| | |
| | | return ResponseUtil.successPage(ledProgramService.list(wrapper)); |
| | | |
| | | } |
| | | |
| | | // /** |
| | | // * 模糊查询 |
| | | // * |
| | | // * @return |
| | | // */ |
| | | // @GetMapping("/listLike") |
| | | // public ResponseVO<Object> listLikeProgram(@RequestBody ReceiveParam receiveParam) { |
| | | // LambdaQueryWrapper<LEDProgram> wrapper = ledProgramService.listProgram(); |
| | | // if (receiveParam.getKind() != null || receiveParam.getName() != null) { |
| | | // |
| | | // wrapper.like(LEDProgram::getName, receiveParam.getName()) |
| | | // .or( |
| | | // ledProgramLambdaQueryWrapper -> { |
| | | // ledProgramLambdaQueryWrapper.like(LEDProgram::getKind, receiveParam.getKind()); |
| | | // } |
| | | // ); |
| | | // |
| | | // } |
| | | // |
| | | // // List<LEDProgram> list = ledProgramService.list(wrapper); |
| | | // return ResponseUtil.success(ledProgramService.list(wrapper)); |
| | | // |
| | | // } |
| | | |
| | | } |
| | |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.LEDProgramFileParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.LEDProgramFileService; |
| | | import com.sandu.ximon.dao.domain.LEDProgramFile; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addLEDProgram(@RequestBody @Validated LEDProgramFileParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_N_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledProgramFileService.addProgramFile(param)); |
| | | } |
| | | |
| | | @PostMapping("/delete/{fileId}") |
| | | public ResponseVO<Object> deleteLEDProgram(@PathVariable Long fileId) { |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_N_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledProgramFileService.deleteFile(fileId)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> listfile(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_LIST.getCode())) { |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_S_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | |
| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addLEDProgram(@RequestParam("file") MultipartFile file) { |
| | | |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_S_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledProgramFileService.addProgramFile(file)); |
| | | // return ResponseUtil.success(aliOssFileService.uploadFile(file)); |
| | | } |
| | | |
| | | @PostMapping("/delete/{fileId}") |
| | | public ResponseVO<Object> deleteLEDProgram(@PathVariable Long fileId) { |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_S_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledProgramFileService.deleteFile(fileId)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> listfile(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_LIST.getCode())) { |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_S_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | LambdaQueryWrapper<LedSFile> wrapper = ledProgramFileService.listFile(); |
| | |
| | | |
| | | @PostMapping("/remark") |
| | | public ResponseVO<Object> addRemark(@RequestBody @Validated LightRemarkParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_REMARK.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = lightService.addRemark(param); |
| | | if (result) { |
| | | return ResponseUtil.success("添加成功"); |
| | |
| | | */ |
| | | @GetMapping("/report/exportList") |
| | | public ResponseVO<Object> exportList(BaseConditionVO conditionVO, @RequestParam(required = false) String keyword, @RequestParam(required = false) String deviceCode) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_EXPORT_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | String url = lightReportDataService.exportList(conditionVO.getPageNo(), conditionVO.getPageSize(), keyword, deviceCode); |
| | | return ResponseUtil.success(url); |
| | | } |
| | |
| | | // 亮度控制 |
| | | @PostMapping("/control") |
| | | public ResponseVO<Object> controlBrightness(@RequestBody @Validated List<LightControlParam> paramList) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_CONTROL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List<Map<String, Object>> list = lightService.controlBrightness(paramList); |
| | | return ResponseUtil.success(list); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 设置功率 |
| | | */ |
| | | @PostMapping("/setPower") |
| | | public ResponseVO<Object> setPower(@RequestBody LightPowerSettingParam lightPowerSettingParam) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_SET_POWER.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean resule = lightService.setPower(lightPowerSettingParam); |
| | | return ResponseUtil.success(resule); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/LightPoleHeelingHeartbeatPackage") |
| | | public ResponseVO<Object> LightPoleHeelingHeartbeatPackage(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_POLE_HEELING_HEARTBEAT_PACKAGE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(lightPoleHeelingService.LightPoleHeelingHeartbeatPackage(lightPoleHeelingParam.getDeviceName())); |
| | | |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/QueryIntervalTime") |
| | | public ResponseVO<Object> QueryIntervalTime(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_POLE_HEELING_HEARTBEAT_PACKAGE_QUERY_TIME.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(lightPoleHeelingService.QueryIntervalTime(lightPoleHeelingParam.getDeviceName())); |
| | | |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/RestartLightPoleHeeling") |
| | | public ResponseVO<Object> RestartLightPoleHeeling(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_POLE_HEELING_RESTART.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | String result = lightPoleHeelingService.RestartLightPoleHeeling(lightPoleHeelingParam.getDeviceName()); |
| | | if ("操作成功".equals(result)) { |
| | | return ResponseUtil.success(result); |
| | |
| | | */ |
| | | @PostMapping("/SetHeartbeatPacketTime") |
| | | public ResponseVO<Object> SetHeartbeatPacketTime(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_POLE_HEELING_HEARTBEAT_PACKAGE_SET_TIME.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | String result = lightPoleHeelingService.SetHeartbeatPacketTime(lightPoleHeelingParam.getDeviceName(), lightPoleHeelingParam.getTime()); |
| | | if ("操作成功".equals(result)) { |
| | | return ResponseUtil.success(result); |
| | |
| | | */ |
| | | @PostMapping("/SetSensorState") |
| | | public ResponseVO<Object> SetSensorState(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_POLE_HEELING_SET_SENSORSTATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | String result = lightPoleHeelingService.SetSensorState(lightPoleHeelingParam.getDeviceName()); |
| | | if ("操作成功".equals(result)) { |
| | | return ResponseUtil.success(result); |
| | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.LightPoleHeelingEquipmentService; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @RequestMapping("/v1/admin/LightPoleHeelingEquipment") |
| | | public class LightPoleHeelingEquipmentController { |
| | | private LightPoleHeelingEquipmentService lightPoleHeelingEquipmentService; |
| | | private PermissionConfig permissionConfig; |
| | | |
| | | @PostMapping("/list") |
| | | public ResponseVO<Object> LightPoleHeelingEquipmentList(BaseConditionVO baseConditionVO) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_POLE_HEELING_EQUIPMENT_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.successPage(lightPoleHeelingEquipmentService.LightPoleHeelingEquipmentList(baseConditionVO)); |
| | | } |
| | | |
| | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.LightPoleHeelingProcessingParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.LightPoleHeelingProcessingServices; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @RequestMapping("/v1/admin/LightPoleHeelingProcessing") |
| | | public class LightPoleHeelingProcessingController { |
| | | private LightPoleHeelingProcessingServices lightPoleHeelingProcessingServices; |
| | | private PermissionConfig permissionConfig; |
| | | |
| | | /** |
| | | * 灯杆倾斜警告处理 |
| | |
| | | */ |
| | | @PostMapping("/Processing") |
| | | public ResponseVO<Object> ProcessingLightPoleHeeling(@RequestBody @Validated LightPoleHeelingProcessingParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_POLE_HEELING_PROCESSING.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(lightPoleHeelingProcessingServices.ProcessingLightPoleHeeling(param)); |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addLightTask(@RequestBody @Validated LightTaskParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_TASK_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = lightTaskService.addLightTask(param); |
| | | if (result) { |
| | | return ResponseUtil.success("新增成功"); |
| | |
| | | |
| | | @PostMapping("/del") |
| | | public ResponseVO<Object> delLightTask(@RequestBody @Validated LightTaskDelParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_TASK_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = lightTaskService.delLightTask(param.getTaskIdList()); |
| | | if (result) { |
| | | return ResponseUtil.success("删除成功"); |
| | |
| | | |
| | | @PostMapping("/update/{taskId}") |
| | | public ResponseVO<Object> updateLightTask(@PathVariable Long taskId, @RequestBody @Validated LightTaskParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_TASK_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = lightTaskService.updateLightTask(taskId, param); |
| | | if (result) { |
| | | return ResponseUtil.success("编辑成功"); |
| | |
| | | |
| | | @GetMapping("/{taskId}") |
| | | public ResponseVO<Object> detailLightTask(@PathVariable Long taskId) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_TASK_DETAIL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | Map<Object, Object> objectObjectMap = lightTaskService.detailLightTask(taskId); |
| | | return ResponseUtil.success(objectObjectMap); |
| | | } |
| | | |
| | | @PostMapping("/issue") |
| | | public ResponseVO<Object> issueLightTask(@RequestBody @Validated LightTaskIssueParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_TASK_ISSUE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = lightTaskService.issueLightTask(param); |
| | | if (result) { |
| | | return ResponseUtil.success("下发成功"); |
| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.MenuParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.MenuService; |
| | | import com.sandu.ximon.dao.bo.MenuNode; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | @GetMapping("/treeList") |
| | | public ResponseVO<Object> treeList() { |
| | | |
| | | if(!permissionConfig.check(MenuEnum.MENU_LIST.getCode())){ |
| | | if (!permissionConfig.check(MenuEnum.MENU_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List<MenuNode> menuTrees = menuService.treeList(); |
| | |
| | | |
| | | @PostMapping("/update/{menuId}") |
| | | public ResponseVO<Object> update(@PathVariable Long menuId, @Validated @RequestBody MenuParam param) { |
| | | |
| | | boolean result = menuService.updateMenu(menuId,param); |
| | | if (!SecurityUtils.getUserDetails().getAdministratorType().equals(AdministratorEnums.ADMIN.getCode())) { |
| | | throw new BusinessException("非超级管理员无法操作!"); |
| | | } |
| | | boolean result = menuService.updateMenu(menuId, param); |
| | | if (result) { |
| | | return ResponseUtil.success("编辑成功"); |
| | | } else { |
| | |
| | | |
| | | @PostMapping("/del/{menuId}") |
| | | public ResponseVO<Object> delMenu(@PathVariable Long menuId) { |
| | | |
| | | if (!SecurityUtils.getUserDetails().getAdministratorType().equals(AdministratorEnums.ADMIN.getCode())) { |
| | | throw new BusinessException("非超级管理员无法操作!"); |
| | | } |
| | | boolean result = menuService.delMenu(menuId); |
| | | if (result) { |
| | | return ResponseUtil.success("删除成功"); |
| | |
| | | |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addMenu(@Validated @RequestBody MenuParam param) { |
| | | |
| | | if (!SecurityUtils.getUserDetails().getAdministratorType().equals(AdministratorEnums.ADMIN.getCode())) { |
| | | throw new BusinessException("非超级管理员无法操作!"); |
| | | } |
| | | boolean result = menuService.addMenu(param); |
| | | if (result) { |
| | | return ResponseUtil.success("添加成功"); |
| | |
| | | */ |
| | | @PostMapping("/delete/{id}") |
| | | public ResponseVO<Object> deleteMonitor(@PathVariable Long id) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = monitorService.deleteMonitor(id); |
| | | if (result) { |
| | | return ResponseUtil.success(null); |
| | |
| | | */ |
| | | @PostMapping("/addYSYMonitor") |
| | | public ResponseVO<Object> addYSYMonitor(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | if (monitorParam == null || monitorParam.getDeviceSerial() == null) { |
| | | throw new BusinessException("参数不正确!"); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/getYSYMonitorInfo") |
| | | public ResponseVO<Object> getYSYMonitorInfo(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_INFO.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | YSY_MonitorDto getMonitorDto = monitorService.getYSYMonitorInfo(monitorService.getAccessToken(), monitorParam.getDeviceSerial()); |
| | | |
| | | if ("200".equals(getMonitorDto.getCode())) { |
| | |
| | | */ |
| | | @PostMapping("/getMonitorVideoUrl") |
| | | public ResponseVO<Object> getMonitorVideoUrl(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_VIDEO_URL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | String URL = monitorService.getMonitorVideoUrl(monitorService.getAccessToken(), |
| | | monitorParam.getDeviceSerial(), monitorParam.getProtocol(), monitorParam.getExpireTime()); |
| | | |
| | |
| | | */ |
| | | @PostMapping("/updateNotes") |
| | | public ResponseVO<Object> updateNotes(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_NOTES.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean flag = monitorService.updateNotes(monitorParam.getDeviceSerial(), monitorParam.getNotes()); |
| | | if (flag) { |
| | | return ResponseUtil.success("修改备注成功!"); |