Commit 3ebc277e authored by zhoumaotao's avatar zhoumaotao

代码调整

parent c7d71b34
package com.gavel.kwell.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSONObject;
import com.gavel.common.base.entity.BaseEntity;
import com.gavel.common.base.service.impl.BaseEditServiceImpl;
......@@ -26,6 +14,16 @@ import com.gavel.kwell.vo.DataPointItem;
import com.gavel.kwell.vo.UpointCondition;
import com.gavel.kwell.vo.UpointVO;
import com.gavel.persistence.sql.RecordSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service("upointService")
......@@ -84,15 +82,14 @@ public class UpointServiceImpl extends BaseEditServiceImpl implements UpointServ
List<Upoint> ponitList = upointDao.queryList(PointTypeEnum.RIGN.getId());
if(ponitList==null || ponitList.size()==0){
logger.error("点位信息未配置,请检查!");
return Collections.EMPTY_LIST;
return new ArrayList<>();
}
List<String> tagList=ponitList.stream().map(Upoint::getCode).collect(Collectors.toList());
Map<String, Object> valueMap = null;
valueMap = redisConnection.multiGet(tagList);
Map<String, Object> valueMap = redisConnection.multiGet(tagList);
if (valueMap == null || valueMap.size()==0 ) {
logger.error("读取采集点信息失败!");
return ponitList.stream().map( p -> new DataPointItem(p.getCode(),p.getName())).collect(Collectors.toList());
return ponitList.stream().map( (Upoint p) -> new DataPointItem(p.getCode(),p.getName())).collect(Collectors.toList());
}
List<DataPointItem> dataPointItems = new ArrayList<DataPointItem>();
......@@ -123,7 +120,7 @@ public class UpointServiceImpl extends BaseEditServiceImpl implements UpointServ
} catch (Exception e) {
logger.error("数据点采集出错!", e);
}
return Collections.EMPTY_LIST;
return new ArrayList<>();
/* List<DataPointItem> dataPointItems = new ArrayList<DataPointItem>();
dataPointItems.add(new DataPointItem("R1",new Date().getTime(),1,"R1",0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment