| | |
| | | import com.sandu.ximon.admin.param.MonitorParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.MonitorService; |
| | | import com.sandu.ximon.dao.bo.MonitorBo; |
| | | import com.sandu.ximon.dao.domain.Monitor; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 摄像头 |
| | |
| | | */ |
| | | @PostMapping("/updateNotes") |
| | | public ResponseVO<Object> updateNotes(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_NOTES.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | // if (!permissionConfig.check(MenuEnum.MONITOR_NOTES.getCode())) { |
| | | // return ResponseUtil.fail("缺少对应用户权限"); |
| | | // } |
| | | boolean flag = monitorService.updateNotes(monitorParam.getDeviceSerial(), monitorParam.getNotes()); |
| | | if (flag) { |
| | | return ResponseUtil.success("修改备注成功!"); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | |
| | | |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getHostMac(), PoleBindingEnums.FOR_HELP); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | InterphoneHost interphoneHost = new InterphoneHost(); |
| | | interphoneHost.setHostId(id); |
| | |
| | | |
| | | InterphoneHostSubPole one = interphoneHostSubService.getOne(Wrappers.lambdaQuery(InterphoneHostSubPole.class).eq(InterphoneHostSubPole::getHostId, id)); |
| | | if (one != null) { |
| | | throw new RuntimeException("该主机存在绑定关系,不能删除"); |
| | | throw new BusinessException("该主机存在绑定关系,不能删除"); |
| | | } |
| | | if (byId == null) { |
| | | return false; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | |
| | | } |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getSubMac(), PoleBindingEnums.FOR_HELP); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | InterphoneSub interphoneSub = new InterphoneSub(); |
| | | BeanUtils.copyProperties(interphoneSubParam, interphoneSub); |
| | |
| | | InterphoneSub byId = getById(id); |
| | | InterphoneHostSubPole one = interphoneHostSubService.getOne(Wrappers.lambdaQuery(InterphoneHostSubPole.class).eq(InterphoneHostSubPole::getSubId, id)); |
| | | if (one != null) { |
| | | throw new RuntimeException("该子设备存在绑定关系,不能删除"); |
| | | throw new BusinessException("该子设备存在绑定关系,不能删除"); |
| | | } |
| | | if (byId == null) { |
| | | return false; |
| | |
| | | } |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(String.valueOf(byId.getId()), PoleBindingEnums.IPVOLUME); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | byId.setTerminalName(name); |
| | | return updateById(byId); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.mapper.LedPlayerEntityMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public LedPlayerEntity getBySnAndPlayerSn(String sn) { |
| | | LedPlayerEntity one = getOne(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getSn, sn)); |
| | | if (one == null) { |
| | | throw new RuntimeException("诺瓦设备不存在"); |
| | | throw new BusinessException("诺瓦设备不存在"); |
| | | } |
| | | List list = new ArrayList(); |
| | | list.add(one); |
| | |
| | | |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(one.getDeviceSerial(), PoleBindingEnums.MONITOR); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | if (one != null) { |
| | | one.setNote(notes); |
| | |
| | | |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getLightemitControlCode(), PoleBindingEnums.XIXUN); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | poleLightemit.setLightemitId(ledId); |
| | | boolean b = this.updateById(poleLightemit); |
| | |
| | | } |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getSn(), PoleBindingEnums.VONNOX); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | LedPlayerEntity led = new LedPlayerEntity(); |
| | | led.setId(id); |