|
@@ -1,7 +1,9 @@
|
|
|
package com.jiayue.ipfcst.service;
|
|
|
|
|
|
import com.jiayue.ipfcst.common.core.exception.BusinessException;
|
|
|
+import com.jiayue.ipfcst.common.data.entity.FanUnitInfo;
|
|
|
import com.jiayue.ipfcst.common.data.entity.WindTurbinePowerCurve;
|
|
|
+import com.jiayue.ipfcst.common.data.repository.FanUnitInfoRepository;
|
|
|
import com.jiayue.ipfcst.common.data.repository.WindTurbinePowerCurveRepository;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@@ -11,8 +13,10 @@ import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
+import java.security.Key;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author shd
|
|
@@ -21,6 +25,10 @@ import java.util.*;
|
|
|
@Service
|
|
|
public class WindTurbinePowerCurveService {
|
|
|
private WindTurbinePowerCurveRepository windTurbinePowerCurveRepository;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FanUnitInfoRepository fanUnitInfoRepository;
|
|
|
+
|
|
|
@Autowired
|
|
|
public WindTurbinePowerCurveService(WindTurbinePowerCurveRepository windTurbinePowerCurveRepository){
|
|
|
this.windTurbinePowerCurveRepository = windTurbinePowerCurveRepository;
|
|
@@ -66,6 +74,31 @@ public class WindTurbinePowerCurveService {
|
|
|
return windTurbinePowerCurveRepository.findAll();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取风机编号
|
|
|
+ */
|
|
|
+ public List<Object> getDataFanId(){
|
|
|
+ ArrayList<Integer> list = new ArrayList<>();
|
|
|
+ List<FanUnitInfo> all = fanUnitInfoRepository.findAll();
|
|
|
+ //循环获取所有机组编号
|
|
|
+ for (FanUnitInfo fanUnitInfo : all) {
|
|
|
+ list.add(fanUnitInfo.getFanId());
|
|
|
+ }
|
|
|
+ //过滤重复数据
|
|
|
+ List<Integer> collect = list.stream().distinct().sorted().collect(Collectors.toList());
|
|
|
+
|
|
|
+ ArrayList<Object> fanIdList = new ArrayList<>();
|
|
|
+ //给机组编号起名
|
|
|
+ for (Integer integer : collect) {
|
|
|
+ HashMap<String,Object> fanIdMap = new HashMap<>();
|
|
|
+ //拼接字符串
|
|
|
+ String fanId = "机组" + integer.toString();
|
|
|
+ fanIdMap.put("fanIdStr",fanId);
|
|
|
+ fanIdMap.put("fanId",integer);
|
|
|
+ fanIdList.add(fanIdMap);
|
|
|
+ }
|
|
|
+ return fanIdList;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* (分页)
|