| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | |
| | | return getOne(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getPlayerId, playerId)); |
| | | } |
| | | |
| | | /** |
| | | * 诺瓦设备新增 |
| | | * |
| | | * @param ledPlayerEntity |
| | | * @return |
| | | */ |
| | | public boolean saveLed(LedPlayerEntity ledPlayerEntity) { |
| | | return ledPlayerEntityMapper.saveLed(ledPlayerEntity); |
| | | boolean b = ledPlayerEntityMapper.saveLed(ledPlayerEntity); |
| | | /** |
| | | * 诺瓦设备新增 日志记录开始 |
| | | */ |
| | | List<String> listCode = new ArrayList<>(1); |
| | | listCode.add(ledPlayerEntity.getSn()); |
| | | String content = "{ 设备id:" + ledPlayerEntity.getId() + "设备code:" + ledPlayerEntity.getSn() |
| | | + "诺瓦playId:" + ledPlayerEntity.getPlayerId() |
| | | + "诺瓦设备名称:" + ledPlayerEntity.getName() + |
| | | "}"; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "诺瓦设备新增", content); |
| | | /** |
| | | * 诺瓦设备新增 日志记录结束 |
| | | */ |
| | | return b; |
| | | } |
| | | |
| | | |
| | |
| | | } else { |
| | | list = ledPlayerEntityMapper.ledPlayerEntityList(keyword, SecurityUtils.getUserId()); |
| | | } |
| | | List<List<LedPlayerEntity>> split = CollectionUtil.split(list, 100); |
| | | |
| | | List<LedPlayerEntity> ledPlayerEntities=null; |
| | | for (List<LedPlayerEntity> splist : split) { |
| | | List<LedPlayerEntity> ledPlayerEntitie = SpringContextHolder.getBean(VnnoxService.class).setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(splist)); |
| | | if (ledPlayerEntitie != null) { |
| | | ledPlayerEntities.addAll(ledPlayerEntitie); |
| | | } |
| | | } |
| | | return ledPlayerEntities; |
| | | return SpringContextHolder.getBean(VnnoxService.class).setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); |
| | | } |
| | | |
| | | } |