|
@@ -77,60 +77,5 @@ public class ProBasicPowerstationServiceImpl extends ServiceImpl<ProBasicPowerst
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public List<WindpowerstationAdmVo> getList(String id, String regionId, String companyId) throws Exception {
|
|
|
-
|
|
|
- List<WindpowerstationAdmVo> admvos = new ArrayList<>();
|
|
|
- QueryWrapper<ProBasicPowerstation> qw = new QueryWrapper<>();
|
|
|
-
|
|
|
- if (StringUtils.isNotEmpty(id)){
|
|
|
- qw.eq("id",id);
|
|
|
- }
|
|
|
- if (StringUtils.isNotEmpty(regionId)){
|
|
|
- qw.eq("region_id",regionId);
|
|
|
- }
|
|
|
-
|
|
|
- if (StringUtils.isNotEmpty(companyId)){
|
|
|
- qw.eq("company_id",companyId);
|
|
|
- }
|
|
|
-
|
|
|
- List<ProBasicPowerstation> list = baseMapper.selectList(qw);
|
|
|
-
|
|
|
- list.stream().forEach(i->{
|
|
|
- List<String> codes = new ArrayList<>();
|
|
|
-// RPJFS
|
|
|
-// RFDL
|
|
|
- String wpString = redisService.get(i.getId());
|
|
|
- Map<String, ProBasicPowerstation> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicPowerstation>>() {
|
|
|
-
|
|
|
- });
|
|
|
- if(null !=stringMapMap){
|
|
|
- codes.add(stringMapMap.get("RPJFS").getNemCode());//日平局风速
|
|
|
- codes.add(stringMapMap.get("RFDL").getNemCode());//日发电量
|
|
|
- }
|
|
|
- try {
|
|
|
- List<PointData> pointList = goldenUtil.getRealData(codes);
|
|
|
- WindpowerstationAdmVo vo = new WindpowerstationAdmVo();
|
|
|
- vo.setId(i.getId());
|
|
|
- vo.setCode(i.getNemCode());
|
|
|
- vo.setName(i.getName());
|
|
|
- vo.setCapacity(i.getCapacity());//装机容量
|
|
|
- vo.setCapacityUnit(i.getCapacityUnit());//装机容量单位
|
|
|
- vo.setQuantity(i.getQuantity());//装机台数
|
|
|
- vo.setModel(i.getModel());//机型
|
|
|
- vo.setSystemManufact(i.getSystemManufact());//厂家
|
|
|
- vo.setAddress(i.getAddress());//地址
|
|
|
- if(null != pointList && pointList.size()>=2){
|
|
|
- vo.setRfdl(MathUtil.twoBit(pointList.get(0).getPointValueInDouble()));
|
|
|
- vo.setRfdl(MathUtil.twoBit(pointList.get(1).getPointValueInDouble()));
|
|
|
- }
|
|
|
- admvos.add(vo);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
- return admvos;
|
|
|
- }
|
|
|
+
|
|
|
}
|