|
@@ -11,11 +11,15 @@ import com.gyee.backconfig.model.auto.Windpowerstationpointnew;
|
|
|
import com.gyee.backconfig.service.auto.IWindpowerstationService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.gyee.backconfig.service.auto.RedisService;
|
|
|
+import com.gyee.backconfig.util.realtimedate.EdosUtil;
|
|
|
import com.gyee.backconfig.vo.WindpowerstationAdmVo;
|
|
|
+import com.gyee.common.model.PointData;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -34,6 +38,9 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
@Resource
|
|
|
private RedisService redisService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private EdosUtil goldenUtil;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<Windpowerstation> getList(String id, String name, String code, String companyid, String pageNum, String pageSize) {
|
|
|
|
|
@@ -98,7 +105,9 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<WindpowerstationAdmVo> getList(String regionid, String companyid) {
|
|
|
+ public List<WindpowerstationAdmVo> getList(String regionid, String companyid) throws Exception {
|
|
|
+
|
|
|
+ List<WindpowerstationAdmVo> admvos = new ArrayList<>();
|
|
|
QueryWrapper<Windpowerstation> qw = new QueryWrapper<>();
|
|
|
|
|
|
if (StringUtils.isNotEmpty(regionid)){
|
|
@@ -112,17 +121,37 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
List<Windpowerstation> list = baseMapper.selectList(qw);
|
|
|
|
|
|
list.stream().forEach(i->{
|
|
|
+ List<String> codes = new ArrayList<>();
|
|
|
// RPJFS
|
|
|
// RFDL
|
|
|
String wpString = redisService.get(i.getId());
|
|
|
Map<String, Windpowerstationpointnew> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
|
|
|
|
|
|
});
|
|
|
- String rpjfs = stringMapMap.get("RPJFS").getCode();
|
|
|
- String rfdl = stringMapMap.get("RFDL").getCode();
|
|
|
+ codes.add(stringMapMap.get("RPJFS").getCode());//日平局风速
|
|
|
+ codes.add(stringMapMap.get("RFDL").getCode());//日发电量
|
|
|
+ try {
|
|
|
+ List<PointData> pointList = goldenUtil.getRealData(codes);
|
|
|
+ WindpowerstationAdmVo vo = new WindpowerstationAdmVo();
|
|
|
+ vo.setId(i.getId());
|
|
|
+ vo.setCode(i.getCode());
|
|
|
+ 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());//地址
|
|
|
+ vo.setRfdl(pointList.get(0).getPointValueInDouble());
|
|
|
+ vo.setRfdl(pointList.get(1).getPointValueInDouble());
|
|
|
+ admvos.add(vo);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
|
|
|
- return null;
|
|
|
+ return admvos;
|
|
|
|
|
|
}
|
|
|
|