Commit b9c0e8d9 authored by 李苏's avatar 李苏 💬

Merge branch 'master' of gitlab.gavelinfo.com:gavelinfo/kwell-mes

parents 8a8bed88 3ebc277e
...@@ -1841,20 +1841,20 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao { ...@@ -1841,20 +1841,20 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
@Override @Override
public GpfkVO queryDailyFkInfoUpgrade(GpfkCondition condition) { public GpfkVO queryDailyFkInfoUpgrade(GpfkCondition condition) {
SqlMap sqlMap = new SqlMap(); SqlMap sqlMap = new SqlMap();
sqlMap.append(" select sum(gpfkjg_fksl) from gpfkjg "); sqlMap.append(" select sum(gpfkjg_fksl) as GPFK_FKSL, sum(GPFKJG_BHGSL) as GPFK_BHGSL, sum(GPFKJG_HGSL) as GPFK_HGSL from gpfkjg ");
sqlMap.append(" left join bzgx on bzgx_id = gpfkjg_bzgxid "); sqlMap.append(" left join bzgx on bzgx_id = gpfkjg_bzgxid ");
sqlMap.append(" where 1 = 1"); sqlMap.append(" where 1 = 1");
sqlMap.append(" and bzgx_gxlx ='ZP' "); sqlMap.append(" and bzgx_gxlx ='ZP' ");
if (StringUtils.isNotEmpty(condition.getBxid())){ if (StringUtils.isNotEmpty(condition.getBxid())){
sqlMap.append(" and c.GPFKJG_FKBX = :pBXID "); sqlMap.append(" and GPFKJG_FKBX = :pBXID ");
sqlMap.setParamValue("pBXID",condition.getBxid()); sqlMap.setParamValue("pBXID",condition.getBxid());
} }
if (StringUtils.isNotEmpty(condition.getFkrid())){ if (StringUtils.isNotEmpty(condition.getFkrid())){
sqlMap.append(" and c.GPFKJG_FKRID = :pFKRID "); sqlMap.append(" and GPFKJG_FKRID = :pFKRID ");
sqlMap.setParamValue("pFKRID",condition.getFkrid()); sqlMap.setParamValue("pFKRID",condition.getFkrid());
} }
if (condition.getYwrq() != null) { if (condition.getYwrq() != null) {
sqlMap.append(" and c.GPFKJG_YWRQ >= :pYWRQ "); sqlMap.append(" and GPFKJG_YWRQ >= :pYWRQ ");
sqlMap.setParamValue("pYWRQ", condition.getYwrq()); sqlMap.setParamValue("pYWRQ", condition.getYwrq());
} }
return sqlMap.queryEntity(GpfkVO.class); return sqlMap.queryEntity(GpfkVO.class);
......
package com.gavel.kwell.service.impl; 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.alibaba.fastjson.JSONObject;
import com.gavel.common.base.entity.BaseEntity; import com.gavel.common.base.entity.BaseEntity;
import com.gavel.common.base.service.impl.BaseEditServiceImpl; import com.gavel.common.base.service.impl.BaseEditServiceImpl;
...@@ -26,6 +14,16 @@ import com.gavel.kwell.vo.DataPointItem; ...@@ -26,6 +14,16 @@ import com.gavel.kwell.vo.DataPointItem;
import com.gavel.kwell.vo.UpointCondition; import com.gavel.kwell.vo.UpointCondition;
import com.gavel.kwell.vo.UpointVO; import com.gavel.kwell.vo.UpointVO;
import com.gavel.persistence.sql.RecordSet; 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") @Service("upointService")
...@@ -84,15 +82,14 @@ public class UpointServiceImpl extends BaseEditServiceImpl implements UpointServ ...@@ -84,15 +82,14 @@ public class UpointServiceImpl extends BaseEditServiceImpl implements UpointServ
List<Upoint> ponitList = upointDao.queryList(PointTypeEnum.RIGN.getId()); List<Upoint> ponitList = upointDao.queryList(PointTypeEnum.RIGN.getId());
if(ponitList==null || ponitList.size()==0){ if(ponitList==null || ponitList.size()==0){
logger.error("点位信息未配置,请检查!"); logger.error("点位信息未配置,请检查!");
return Collections.EMPTY_LIST; return new ArrayList<>();
} }
List<String> tagList=ponitList.stream().map(Upoint::getCode).collect(Collectors.toList()); List<String> tagList=ponitList.stream().map(Upoint::getCode).collect(Collectors.toList());
Map<String, Object> valueMap = null; Map<String, Object> valueMap = redisConnection.multiGet(tagList);
valueMap = redisConnection.multiGet(tagList);
if (valueMap == null || valueMap.size()==0 ) { if (valueMap == null || valueMap.size()==0 ) {
logger.error("读取采集点信息失败!"); 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>(); List<DataPointItem> dataPointItems = new ArrayList<DataPointItem>();
...@@ -123,7 +120,7 @@ public class UpointServiceImpl extends BaseEditServiceImpl implements UpointServ ...@@ -123,7 +120,7 @@ public class UpointServiceImpl extends BaseEditServiceImpl implements UpointServ
} catch (Exception e) { } catch (Exception e) {
logger.error("数据点采集出错!", e); logger.error("数据点采集出错!", e);
} }
return Collections.EMPTY_LIST; return new ArrayList<>();
/* List<DataPointItem> dataPointItems = new ArrayList<DataPointItem>(); /* List<DataPointItem> dataPointItems = new ArrayList<DataPointItem>();
dataPointItems.add(new DataPointItem("R1",new Date().getTime(),1,"R1",0)); 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