|
@@ -15,6 +15,7 @@ import com.gyee.backconfig.util.realtimedate.EdosUtil;
|
|
|
import com.gyee.backconfig.util.realtimedate.MathUtil;
|
|
|
import com.gyee.backconfig.vo.PersisVo;
|
|
|
import com.gyee.backconfig.vo.WindpowerstationAdmVo;
|
|
|
+import com.gyee.backconfig.vo.Windpowerstationvo;
|
|
|
import com.gyee.common.model.PointData;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -22,10 +23,11 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 服务实现类
|
|
|
+ * 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
* @author wang
|
|
@@ -41,30 +43,30 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
private EdosUtil goldenUtil;
|
|
|
|
|
|
@Override
|
|
|
- public IPage<Windpowerstation> getList(String id, String name, String code, String companyid, String regionid,String pageNum, String pageSize) {
|
|
|
+ public IPage<Windpowerstation> getList(String id, String name, String code, String companyid, String regionid, String pageNum, String pageSize) {
|
|
|
|
|
|
QueryWrapper<Windpowerstation> qw = new QueryWrapper<>();
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)){
|
|
|
- qw.like("id",id);
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
+ qw.like("id", id);
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(code)){
|
|
|
- qw.like("code",code);
|
|
|
+ if (StringUtils.isNotEmpty(code)) {
|
|
|
+ qw.like("code", code);
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(name)){
|
|
|
- qw.like("name",name);
|
|
|
+ if (StringUtils.isNotEmpty(name)) {
|
|
|
+ qw.like("name", name);
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(companyid)){
|
|
|
- qw.eq("companyid",companyid);
|
|
|
+ if (StringUtils.isNotEmpty(companyid)) {
|
|
|
+ qw.eq("companyid", companyid);
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(regionid)){
|
|
|
- qw.eq("regionid",regionid);
|
|
|
+ if (StringUtils.isNotEmpty(regionid)) {
|
|
|
+ qw.eq("regionid", regionid);
|
|
|
}
|
|
|
- Page<Windpowerstation> page = new Page<>(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
|
|
|
+ Page<Windpowerstation> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
IPage<Windpowerstation> companysPage = getBaseMapper().selectPage(page, qw);
|
|
|
// List<Windpowerstation> list = companysPage.getRecords();
|
|
|
return companysPage;
|
|
@@ -74,7 +76,7 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
@Override
|
|
|
public Windpowerstation getOne(String id) {
|
|
|
|
|
|
- Windpowerstation windpowerstation = this.getById(id);
|
|
|
+ Windpowerstation windpowerstation = this.getById(id);
|
|
|
|
|
|
return windpowerstation;
|
|
|
}
|
|
@@ -98,34 +100,35 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
public List<Windpowerstation> getList(String regionid) {
|
|
|
QueryWrapper<Windpowerstation> qw = new QueryWrapper<>();
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(regionid)){
|
|
|
- qw.eq("regionid",regionid);
|
|
|
+ if (StringUtils.isNotEmpty(regionid)) {
|
|
|
+ qw.eq("regionid", regionid);
|
|
|
}
|
|
|
|
|
|
List<Windpowerstation> list = baseMapper.selectList(qw);
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
//行政管理区域风电场列表
|
|
|
@Override
|
|
|
- public List<WindpowerstationAdmVo> getList(String id,String regionid, String companyid) throws Exception {
|
|
|
+ public List<WindpowerstationAdmVo> getList(String id, String regionid, String companyid) throws Exception {
|
|
|
|
|
|
- List<WindpowerstationAdmVo> admvos = new ArrayList<>();
|
|
|
+ List<WindpowerstationAdmVo> admvos = new ArrayList<>();
|
|
|
QueryWrapper<Windpowerstation> qw = new QueryWrapper<>();
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)){
|
|
|
- qw.eq("id",id);
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
+ qw.eq("id", id);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(regionid)){
|
|
|
- qw.eq("regionid",regionid);
|
|
|
+ if (StringUtils.isNotEmpty(regionid)) {
|
|
|
+ qw.eq("regionid", regionid);
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(companyid)){
|
|
|
- qw.eq("companyid",companyid);
|
|
|
+ if (StringUtils.isNotEmpty(companyid)) {
|
|
|
+ qw.eq("companyid", companyid);
|
|
|
}
|
|
|
|
|
|
List<Windpowerstation> list = baseMapper.selectList(qw);
|
|
|
|
|
|
- list.stream().forEach(i->{
|
|
|
+ list.stream().forEach(i -> {
|
|
|
List<String> codes = new ArrayList<>();
|
|
|
// RPJFS
|
|
|
// RFDL
|
|
@@ -133,7 +136,7 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
Map<String, Windpowerstationpointnew> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
|
|
|
|
|
|
});
|
|
|
- if(null !=stringMapMap){
|
|
|
+ if (null != stringMapMap) {
|
|
|
codes.add(stringMapMap.get("RPJFS").getCode());//日平局风速
|
|
|
codes.add(stringMapMap.get("RFDL").getCode());//日发电量
|
|
|
}
|
|
@@ -149,7 +152,7 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
vo.setModel(i.getModel());//机型
|
|
|
vo.setSystemmanufact(i.getSystemmanufact());//厂家
|
|
|
vo.setAddress(i.getAddress());//地址
|
|
|
- if(null != pointList && pointList.size()>=2){
|
|
|
+ if (null != pointList && pointList.size() >= 2) {
|
|
|
vo.setRfdl(MathUtil.twoBit(pointList.get(0).getPointValueInDouble()));
|
|
|
vo.setRfdl(MathUtil.twoBit(pointList.get(1).getPointValueInDouble()));
|
|
|
}
|
|
@@ -179,7 +182,7 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
List<PointData> gls = goldenUtil.getHistoryDatasSnap(gl, startdate.getTime(), enddate.getTime(), null, 60000L);
|
|
|
if (!fss.isEmpty() && !gls.isEmpty()) {
|
|
|
|
|
|
- for (int i =0; i <= fss.size()-1; i++) {
|
|
|
+ for (int i = 0; i <= fss.size() - 1; i++) {
|
|
|
PersisVo vo = new PersisVo();
|
|
|
vo.setDatatime(fss.get(i).getPointTime());
|
|
|
vo.setRpjfs(fss.get(i).getPointValueInDouble());
|
|
@@ -192,5 +195,205 @@ public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMap
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> cpls() {
|
|
|
+ QueryWrapper<Windpowerstation> qw = new QueryWrapper<>();
|
|
|
+ List<Windpowerstation> list = baseMapper.selectList(qw);
|
|
|
+ Map<String, Object> jh = new HashMap<>();
|
|
|
+ //产业光伏
|
|
|
+ List<Windpowerstation> sxgf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> sxgfzjrl = new ArrayList<>();
|
|
|
+ List<Windpowerstation> xjgf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> sdgf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> xzgf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> nmgf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> xsgf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> hbgf = new ArrayList<>();
|
|
|
+ //清洁能源公司
|
|
|
+ List<Windpowerstation> sxqjnygf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> xjqjnygf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> sdqjnygf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> xzqjnygf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> nmqjnygf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> xsqjnygf = new ArrayList<>();
|
|
|
+ List<Windpowerstation> hbqjnygf = new ArrayList<>();
|
|
|
+ if (!list.isEmpty()) {
|
|
|
+ for (Windpowerstation w1 : list) {
|
|
|
+ if (StringUtils.notEmp(w1.getRegionid())) {
|
|
|
+ //产业
|
|
|
+ if (w1.getRegionid().endsWith("XJ") & w1.getId().endsWith("GDC")) {
|
|
|
+ Windpowerstation vo = new Windpowerstation();
|
|
|
+ vo.setId(w1.getId());
|
|
|
+ vo.setAname(w1.getAname());
|
|
|
+ vo.setCapacity(w1.getCapacity());
|
|
|
+ vo.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo.setCompanyid(w1.getCompanyid());
|
|
|
+ vo.setRegionid(w1.getRegionid());
|
|
|
+ xjgf.add(vo);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("SX") & w1.getId().endsWith("GDC")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ sxgf.add(vo1); //45条数据
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("XS") & w1.getId().endsWith("GDC")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ xsgf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("NM") & w1.getId().endsWith("GDC")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ nmgf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("HB") & w1.getId().endsWith("GDC")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ hbgf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("SD") & w1.getId().endsWith("GDC")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ sdgf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("XZ") & w1.getId().endsWith("GDC")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ xzgf.add(vo1);
|
|
|
+ }
|
|
|
+
|
|
|
+ //清洁能源公司
|
|
|
+ if (w1.getRegionid().endsWith("XJ") & w1.getId().endsWith("GDC") & w1.getCompanyid().endsWith("QJNY")) {
|
|
|
+ Windpowerstation vo = new Windpowerstation();
|
|
|
+ vo.setId(w1.getId());
|
|
|
+ vo.setAname(w1.getAname());
|
|
|
+ vo.setCapacity(w1.getCapacity());
|
|
|
+ vo.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo.setCompanyid(w1.getCompanyid());
|
|
|
+ vo.setRegionid(w1.getRegionid());
|
|
|
+ xjqjnygf.add(vo);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("SX") & w1.getId().endsWith("GDC") & w1.getCompanyid().endsWith("QJNY")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ sxqjnygf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("XS") & w1.getId().endsWith("GDC") & w1.getCompanyid().endsWith("QJNY")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ xsqjnygf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("NM") & w1.getId().endsWith("GDC") & w1.getCompanyid().endsWith("QJNY")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ nmqjnygf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("HB") & w1.getId().endsWith("GDC") & w1.getCompanyid().endsWith("QJNY")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ hbqjnygf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("SD") & w1.getId().endsWith("GDC") & w1.getCompanyid().endsWith("QJNY")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ sdqjnygf.add(vo1);
|
|
|
+ }
|
|
|
+ if (w1.getRegionid().endsWith("XZ") & w1.getId().endsWith("GDC") & w1.getCompanyid().endsWith("QJNY")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ xzqjnygf.add(vo1);
|
|
|
+ }
|
|
|
+ //装机容量-qjny
|
|
|
+ if (w1.getRegionid().endsWith("XZ") & w1.getId().endsWith("GDC") & w1.getCompanyid().endsWith("QJNY")) {
|
|
|
+ Windpowerstation vo1 = new Windpowerstation();
|
|
|
+ vo1.setId(w1.getId());
|
|
|
+ vo1.setAname(w1.getAname());
|
|
|
+ vo1.setCapacity(w1.getCapacity());
|
|
|
+ vo1.setCapacityunit(w1.getCapacityunit());
|
|
|
+ vo1.setCompanyid(w1.getCompanyid());
|
|
|
+ vo1.setRegionid(w1.getRegionid());
|
|
|
+ xzqjnygf.add(vo1);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
+ jh.put("山西区域光伏场站数量", sxgf.size()); //45
|
|
|
+ jh.put("新疆区域光伏场站数量", xjgf.size()); //3
|
|
|
+ jh.put("陕西区域光伏场站数量", xsgf.size());
|
|
|
+ jh.put("内蒙区域光伏场站数量", nmgf.size());
|
|
|
+ jh.put("河北区域光伏场站数量", hbgf.size());
|
|
|
+ jh.put("西藏区域光伏场站数量", xzgf.size());
|
|
|
+ jh.put("山东区域光伏场站数量", sdgf.size());
|
|
|
+ jh.put("山西区域光伏清洁能源场站数量", sxqjnygf.size());
|
|
|
+ jh.put("新疆区域光伏清洁能源场站数量", xjqjnygf.size());
|
|
|
+ jh.put("陕西区域光伏清洁能源场站数量", xsqjnygf.size());
|
|
|
+ jh.put("内蒙区域光伏清洁能源场站数量", nmqjnygf.size());
|
|
|
+ jh.put("河北区域光伏清洁能源场站数量", hbqjnygf.size());
|
|
|
+ jh.put("西藏区域光伏清洁能源场站数量", xzqjnygf.size());
|
|
|
+ jh.put("山东区域光伏清洁能源场站数量", sdqjnygf.size());
|
|
|
+
|
|
|
+ return jh;
|
|
|
+ }
|
|
|
}
|
|
|
+
|