2021与蓝度共同重构项目,服务端
liuhaonan
2022-09-22 75173289ebdf9d710d6c89c3cff82e4b5aac99f2
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedPlayerEntityService.java
@@ -10,6 +10,7 @@
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.bo.LEDNovaGroupListBo;
import com.sandu.ximon.dao.domain.LedPlayerEntity;
import com.sandu.ximon.dao.enums.OrderByEnums;
import com.sandu.ximon.dao.mapper.LedPlayerEntityMapper;
@@ -53,10 +54,7 @@
         */
        List<String> listCode = new ArrayList<>(1);
        listCode.add(ledPlayerEntity.getSn());
        String content = "{ 设备id:" + ledPlayerEntity.getId() + "设备code:" + ledPlayerEntity.getSn()
                + "诺瓦playId:" + ledPlayerEntity.getPlayerId()
                + "诺瓦设备名称:" + ledPlayerEntity.getName() +
                "}";
        String content = "{ 设备id:" + ledPlayerEntity.getId() + "设备code:" + ledPlayerEntity.getSn() + "诺瓦playId:" + ledPlayerEntity.getPlayerId() + "诺瓦设备名称:" + ledPlayerEntity.getName() + "}";
        StoreOperationRecordsUtils.storeOperationData(listCode, null, "诺瓦设备新增", content);
        /**
@@ -91,7 +89,7 @@
     */
    public EquipmentInfomation getBySnAndPlayerSnInfo(String sn) {
        EquipmentInfomation equipmentInfo = new EquipmentInfomation();
        equipmentInfo.setEquipmentType("诺瓦LED");
        equipmentInfo.setEquipmentType("NLED");
        if (sn == null || sn.trim().length() == 0) {
            return equipmentInfo;
        }
@@ -118,6 +116,15 @@
    }
    /**
     * 诺瓦列表
     *
     * @param baseConditionVO
     * @param keyword
     * @param order
     * @param seq
     * @return
     */
    public List<LedPlayerEntity> ledPlayerEntityList(BaseConditionVO baseConditionVO, String keyword, Integer order, Integer seq) {
        //排序字段
        String orderByResult = OrderByEnums.VNNOX_ID.getCode();
@@ -150,7 +157,9 @@
        String orderBy = orderByResult + " " + orderBySeq;
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy);
        if (baseConditionVO != null) {
            PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy);
        }
        List<LedPlayerEntity> list;
        //超管
        if (SecurityUtils.getClientId() == null) {
@@ -161,6 +170,28 @@
        return SpringContextHolder.getBean(VnnoxService.class).setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list));
    }
    /**
     * 诺瓦列表(用于首页数据统计)
     *
     * @return
     */
    public List<LedPlayerEntity> ledPlayerEntityListOnHome() {
        List<LedPlayerEntity> list;
        //超管
        if (SecurityUtils.getClientId() == null) {
            list = ledPlayerEntityMapper.ledPlayerEntityList(null, null);
        } else {
            list = ledPlayerEntityMapper.ledPlayerEntityList(null, SecurityUtils.getUserId());
        }
        return list == null ? new ArrayList<>() : list;
    }
    /**
     * 诺瓦列表(用于绑定)
     *
     * @param keyword
     * @return
     */
    public List<LedPlayerEntity> ledPlayerEntityListOnBinding(String keyword) {
        List<LedPlayerEntity> list;
@@ -173,4 +204,20 @@
        return SpringContextHolder.getBean(VnnoxService.class).setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list));
    }
    /**
     * 获取整组的屏幕
     *
     * @param groupId
     */
    public List<LEDNovaGroupListBo> getListByGroupId(Long groupId) {
        List<LEDNovaGroupListBo> listByGroupId = baseMapper.getListByGroupId(groupId, SecurityUtils.getClientId());
        listByGroupId.forEach(
                bo -> {
                    if (bo.getName() == null || bo.getName().equals("")) {
                        bo.setName(bo.getPlayerName());
                    }
                }
        );
        return listByGroupId;
    }
}