|
@@ -1,7 +1,9 @@
|
|
package com.jiayue.ipfcst.service;
|
|
package com.jiayue.ipfcst.service;
|
|
|
|
|
|
import com.jiayue.ipfcst.common.core.exception.BusinessException;
|
|
import com.jiayue.ipfcst.common.core.exception.BusinessException;
|
|
|
|
+import com.jiayue.ipfcst.common.data.entity.FanUnitInfo;
|
|
import com.jiayue.ipfcst.common.data.entity.WindSpeedPointInfo;
|
|
import com.jiayue.ipfcst.common.data.entity.WindSpeedPointInfo;
|
|
|
|
+import com.jiayue.ipfcst.common.data.repository.FanUnitInfoRepository;
|
|
import com.jiayue.ipfcst.common.data.repository.WindSpeedPointInfoRepository;
|
|
import com.jiayue.ipfcst.common.data.repository.WindSpeedPointInfoRepository;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
@@ -12,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
import javax.persistence.criteria.Predicate;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
@@ -24,6 +27,8 @@ public class WindSpeedPointInfoService {
|
|
private WindSpeedPointInfoRepository windSpeedPointInfoRepository;
|
|
private WindSpeedPointInfoRepository windSpeedPointInfoRepository;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private FanUnitInfoRepository fanUnitInfoRepository;
|
|
|
|
+ @Autowired
|
|
public WindSpeedPointInfoService(WindSpeedPointInfoRepository windSpeedPointInfoRepository){
|
|
public WindSpeedPointInfoService(WindSpeedPointInfoRepository windSpeedPointInfoRepository){
|
|
this.windSpeedPointInfoRepository = windSpeedPointInfoRepository;
|
|
this.windSpeedPointInfoRepository = windSpeedPointInfoRepository;
|
|
}
|
|
}
|
|
@@ -101,6 +106,27 @@ public class WindSpeedPointInfoService {
|
|
return this.windSpeedPointInfoRepository.findAll();
|
|
return this.windSpeedPointInfoRepository.findAll();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取机组信息
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<Object> getAllData(){
|
|
|
|
+ ArrayList<Object> list = new ArrayList<>();
|
|
|
|
+ List<FanUnitInfo> all = fanUnitInfoRepository.findAll();
|
|
|
|
+ for (FanUnitInfo fanUnitInfo : all) {
|
|
|
|
+ list.add(fanUnitInfo.getFanId());
|
|
|
|
+ }
|
|
|
|
+ List<Object> collect = list.stream().distinct().sorted().collect(Collectors.toList());
|
|
|
|
+ ArrayList<Object> fanIdList = new ArrayList<>();
|
|
|
|
+ for (Object fanId : collect) {
|
|
|
|
+ HashMap<String, Object> fanIdMap = new HashMap<>();
|
|
|
|
+ fanIdMap.put("fanIdStr","机组" + fanId);
|
|
|
|
+ fanIdMap.put("fanId",fanId);
|
|
|
|
+ fanIdList.add(fanIdMap);
|
|
|
|
+ }
|
|
|
|
+ return fanIdList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
public Page<WindSpeedPointInfo> getBySomeConditions(Integer page, Integer size, String fanNumber,String wind,
|
|
public Page<WindSpeedPointInfo> getBySomeConditions(Integer page, Integer size, String fanNumber,String wind,
|
|
String speed, String unitBelongs, String belong){
|
|
String speed, String unitBelongs, String belong){
|