| | |
| | | import com.sandu.ximon.admin.redis.LightKey; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.vo.ControlLightCommandVO; |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.bo.LightBo; |
| | | import com.sandu.ximon.dao.bo.PoleTaskLightPowerBo; |
| | | import com.sandu.ximon.dao.domain.Light; |
| | |
| | | return one; |
| | | } |
| | | |
| | | /** |
| | | * 首页灯杆绑定信息 |
| | | * |
| | | * @param deviceCode |
| | | * @return |
| | | */ |
| | | public EquipmentInfomation getLightInfo(String deviceCode) { |
| | | EquipmentInfomation equipmentInfo = new EquipmentInfomation(); |
| | | equipmentInfo.setEquipmentType("单灯"); |
| | | if (deviceCode == null || deviceCode.trim().length() == 0) { |
| | | return equipmentInfo; |
| | | } |
| | | Light one = getOne(Wrappers.<Light>lambdaQuery().eq(Light::getDeviceCode, deviceCode)); |
| | | if (one != null) { |
| | | equipmentInfo.setEquipmentMac(one.getDeviceCode()); |
| | | equipmentInfo.setEquipmentCreateTime(one.getCreateTime()); |
| | | } |
| | | |
| | | Object o = redisService.get(LightKey.REPORT_MAC.key(deviceCode)); |
| | | if (o != null) { |
| | | equipmentInfo.setEquipmentState("在线"); |
| | | } else { |
| | | equipmentInfo.setEquipmentState("离线"); |
| | | } |
| | | return equipmentInfo; |
| | | } |
| | | |
| | | public boolean addRemark(LightRemarkParam param) { |
| | | Light light = getById(param.getLightId()); |
| | | if (light == null) { |