2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-04-15 f92e7a801cb5e59bd2391641eccad67036513b8a
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedPlayerEntityService.java
@@ -2,10 +2,16 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sandu.common.service.impl.BaseServiceImpl;
import com.sandu.common.util.SpringContextHolder;
import com.sandu.ximon.admin.utils.VnnoxAPIUtil;
import com.sandu.ximon.dao.domain.LedPlayerEntity;
import com.sandu.ximon.dao.mapper.LedPlayerEntityMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @Author liuhaonan
@@ -17,6 +23,7 @@
@AllArgsConstructor
public class LedPlayerEntityService extends BaseServiceImpl<LedPlayerEntityMapper, LedPlayerEntity> {
    private final LedPlayerEntityMapper ledPlayerEntityMapper;
    private VnnoxAPIUtil vnnoxAPIUtil;
    public LedPlayerEntity getBySn(String sn){
        return getOne(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getSn, sn));
@@ -30,8 +37,29 @@
    }
  /*  public void listLed(String keyWord){
    /**
     * 诺瓦硬件设备
     */
    public LedPlayerEntity getBySnAndPlayerSn(String sn){
        LedPlayerEntity one = getOne(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getSn, sn));
        if(one==null){
            throw new RuntimeException("诺瓦设备不存在");
        }
        List list=new ArrayList();
        list.add(one);
        List<LedPlayerEntity> led = vnnoxAPIUtil.syncCurrentInfo(list);
        Map<String, String> screenShotUrl = SpringContextHolder.getBean(VnnoxService.class).getScreenShotUrl(one.getId().intValue());
        if(screenShotUrl.get("code").equals("200")){
            one.setScreenShotUrl(screenShotUrl.get("url"));
        }else {
            one.setScreenShotUrl("缩略图获取失败");
        }
        return one;
    }
        Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::get)
    }*/
}