| | |
| | | * 根据绑定关系查询设备归属 |
| | | */ |
| | | |
| | | Pole getPoleByBinding(Integer type, String Mac); |
| | | Pole getPoleByBinding(String type, String Mac,Long userId); |
| | | |
| | | } |
| | | |
| | |
| | | <select id="getPoleByBinding" resultType="com.sandu.ximon.dao.domain.Pole"> |
| | | SELECT t2.* |
| | | FROM `pole_binding` t1 |
| | | LEFT JOIN pole t2 ON t1.pole_id = t2.id |
| | | LEFT JOIN pole t2 ON t1.pole_id = t2.id |
| | | WHERE t1.device_type = #{type} |
| | | AND t1.device_code = #{Mac} |
| | | AND t1.device_code = #{Mac} |
| | | <if test="userId != null"> |
| | | AND ( |
| | | t2.user_id = #{userId} |
| | | OR t2.client_id = #{userId} |
| | | ) |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | 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.ximon.admin.param.BroadcastTerminalV2Param; |
| | | import com.sandu.ximon.admin.param.ReceiveParam; |
| | |
| | | private IpVolumeService broadcastTerminalV2Service; |
| | | private PermissionConfig permissionConfig; |
| | | |
| | | //TODO |
| | | @PostMapping("/synchTerminal") |
| | | public ResponseVO<Object> synchTerminal() { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_SYNCH.getCode())) { |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | @AnonymousAccess |
| | | @PostMapping("/updateBroadcastTerminalName/{id}") |
| | | public ResponseVO<Object> updateBroadcastTerminalName(@PathVariable Integer id, @RequestBody ReceiveParam param) { |
| | | if (!permissionConfig.check(MenuEnum.IP_BROADCAST_INFO_UPDATE.getCode())) { |
| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.param.InterphoneHostParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.dao.bo.InterphoneHostBo; |
| | | import com.sandu.ximon.dao.domain.InterphoneHost; |
| | | import com.sandu.ximon.dao.domain.InterphoneHostSubPole; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.InterphoneHostMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | if (byId == null) { |
| | | return false; |
| | | } |
| | | |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getHostMac(), PoleBindingEnums.FOR_HELP); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | InterphoneHost interphoneHost = new InterphoneHost(); |
| | | interphoneHost.setHostId(id); |
| | | BeanUtils.copyProperties(interphoneHostParam, interphoneHost); |
| | |
| | | InterphoneHost byId = getById(id); |
| | | |
| | | InterphoneHostSubPole one = interphoneHostSubService.getOne(Wrappers.lambdaQuery(InterphoneHostSubPole.class).eq(InterphoneHostSubPole::getHostId, id)); |
| | | if(one!=null){ |
| | | if (one != null) { |
| | | throw new RuntimeException("该主机存在绑定关系,不能删除"); |
| | | } |
| | | if (byId == null) { |
| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.param.InterphoneSubParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.dao.bo.InterphoneSubBo; |
| | | import com.sandu.ximon.dao.domain.InterphoneHostSubPole; |
| | | import com.sandu.ximon.dao.domain.InterphoneSub; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.InterphoneSubMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | if (byId == null) { |
| | | return false; |
| | | } |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getSubMac(), PoleBindingEnums.FOR_HELP); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | InterphoneSub interphoneSub = new InterphoneSub(); |
| | | BeanUtils.copyProperties(interphoneSubParam, interphoneSub); |
| | | interphoneSub.setSubId(id); |
| | |
| | | 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.param.BroadcastTerminalV2Param; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.TerminalAPIUtils; |
| | |
| | | import com.sandu.ximon.admin.vo.TerminalVO; |
| | | import com.sandu.ximon.dao.bo.BroadcastTerminalV2EntityBo; |
| | | import com.sandu.ximon.dao.domain.BroadcastTerminalV2Entity; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.IPBroadcastMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | } else { |
| | | if (SecurityUtils.getClientId() == null) { |
| | | broadcastTerminalV2EntityBos = broadcastTerminalV2EntityMapper.getBroadcastTerminalList(broadcastTerminalV2Param.getKeyword() |
| | | , null, broadcastTerminalV2Param.getBindingState()); |
| | | broadcastTerminalV2EntityBos = broadcastTerminalV2EntityMapper.getBroadcastTerminalList(broadcastTerminalV2Param.getKeyword(), null, broadcastTerminalV2Param.getBindingState()); |
| | | } else { |
| | | broadcastTerminalV2EntityBos = broadcastTerminalV2EntityMapper.getBroadcastTerminalList(broadcastTerminalV2Param.getKeyword() |
| | | , SecurityUtils.getUserId(), broadcastTerminalV2Param.getBindingState()); |
| | | broadcastTerminalV2EntityBos = broadcastTerminalV2EntityMapper.getBroadcastTerminalList(broadcastTerminalV2Param.getKeyword(), SecurityUtils.getUserId(), broadcastTerminalV2Param.getBindingState()); |
| | | } |
| | | } |
| | | |
| | |
| | | if (byId == null) { |
| | | throw new BusinessException("终端不存在"); |
| | | } |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(String.valueOf(byId.getId()), PoleBindingEnums.IPVOLUME); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | byId.setTerminalName(name); |
| | | return updateById(byId); |
| | | } |
| | |
| | | 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.param.MonitorParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.ListPagingUtils; |
| | |
| | | import com.sandu.ximon.admin.dto.YSY_AccessTokenDto; |
| | | import com.sandu.ximon.admin.dto.YSY_MonitorDto; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.MonitorMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | throw new BusinessException("修改备注参数有误!"); |
| | | } |
| | | Monitor one = getOne(Wrappers.lambdaQuery(Monitor.class).eq(Monitor::getDeviceSerial, deviceSerial)); |
| | | |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(one.getDeviceSerial(), PoleBindingEnums.MONITOR); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | if (one != null) { |
| | | one.setNote(notes); |
| | | return updateById(one); |
| | |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.param.PoleBindingParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.mapper.PoleBindingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } else { |
| | | //修改单灯的绑定关系的时候要额外处理的事务 |
| | | // 删除灯杆的devicescode |
| | | if(param.getDeviceType() == 0){ |
| | | if (param.getDeviceType() == 0) { |
| | | PoleService poleService = SpringContextHolder.getBean(PoleService.class); |
| | | Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, one.getPoleId())); |
| | | if (pole != null) { |
| | |
| | | public PoleBinding getPoleIdByMac(String deviceCode) { |
| | | return getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断设备归属 |
| | | * |
| | | * @param deviceCode 设备编号 |
| | | * @param type 设备类型 |
| | | * @return 已绑定返回true,未绑定返回false |
| | | */ |
| | | public boolean isBelong(String deviceCode, String type) { |
| | | if (type.isEmpty() || deviceCode.isEmpty()) { |
| | | throw new BusinessException("设备编号或类型不能为空"); |
| | | } |
| | | Long userId = SecurityUtils.getClientId(); |
| | | Pole binding = baseMapper.getPoleByBinding(type, deviceCode, userId); |
| | | if (binding != null) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.google.gson.Gson; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.config.RealtimeServerBean; |
| | | import com.sandu.ximon.admin.entity.*; |
| | | import com.sandu.ximon.admin.param.PoleBindingParam; |
| | |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.PoleLightemitEntity; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.PoleLightemitEntityMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | if (byId == null) { |
| | | throw new BusinessException("未找到LED屏"); |
| | | } |
| | | |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getLightemitControlCode(), PoleBindingEnums.XIXUN); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | poleLightemit.setLightemitId(ledId); |
| | | boolean b = this.updateById(poleLightemit); |
| | | // 绑定灯杆 |
| | |
| | | if (pole == null) { |
| | | throw new BusinessException("未找到该灯杆"); |
| | | } |
| | | Long clientId = SecurityUtils.getClientId(); |
| | | //非超管 |
| | | if (clientId != null) { |
| | | if (!Objects.equals(SecurityUtils.getUserId(), pole.getUserId()) && !Objects.equals(SecurityUtils.getUserId(), pole.getClientId())) { |
| | | throw new BusinessException("该灯杆不属于您"); |
| | | } |
| | | } |
| | | Pole update = new Pole(); |
| | | BeanUtils.copyProperties(param, update); |
| | | update.setId(poleId); |
| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.config.VnnoxConstant; |
| | | import com.sandu.ximon.admin.dto.nova.AirDataProgram; |
| | | import com.sandu.ximon.admin.dto.nova.PlayerLayout; |
| | |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.LedPlayerInfoEntity; |
| | | import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | if (byId == null) { |
| | | throw new BusinessException("未找到该设备"); |
| | | } |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getSn(), PoleBindingEnums.VONNOX); |
| | | if (!belong) { |
| | | throw new RuntimeException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | LedPlayerEntity led = new LedPlayerEntity(); |
| | | led.setId(id); |
| | | led.setName(name); |