|
@@ -18,6 +18,7 @@ import com.gyee.power.fitting.model.custom.TableTitle;
|
|
|
import com.gyee.power.fitting.model.custom.TsDoubleData;
|
|
|
import com.gyee.power.fitting.service.ProBasicEquipmentPointService;
|
|
|
import com.gyee.power.fitting.service.ProBasicPowerstationPointService;
|
|
|
+import com.gyee.power.fitting.service.auth.TokenService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.math3.fitting.WeightedObservedPoints;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -25,6 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.File;
|
|
|
import java.math.BigDecimal;
|
|
@@ -61,6 +63,9 @@ public class IvPvCurveFittingService {
|
|
|
@Resource
|
|
|
private ProBasicWeatherStationServiceImpl weatherStationService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private TokenService tokenService;
|
|
|
+
|
|
|
public void getDatas2File(String stationid, long start, long end) {
|
|
|
|
|
|
int daym = 24 * 60 * 60 * 1000;
|
|
@@ -252,10 +257,21 @@ public class IvPvCurveFittingService {
|
|
|
return stringListMap;
|
|
|
}
|
|
|
|
|
|
- public List<Object> str2FileList(List<String> fileList) {
|
|
|
+ public List<Object> str2FileList(List<String> fileList,HttpServletRequest request) {
|
|
|
+
|
|
|
+ List<ProBasicPowerstation> powerstationList = tokenService.getWpls(request);
|
|
|
+ if(powerstationList.size()<=0){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
List<ProEconPowerFittingAnalySis> fileLists = new ArrayList<>();
|
|
|
for (String s : fileList) {
|
|
|
+
|
|
|
String[] split = s.split("-");
|
|
|
+ boolean b = powerstationList.stream().filter(m -> m.getId().equals(split[0])).findAny().isPresent();
|
|
|
+ if(!b){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
ProEconPowerFittingAnalySis fl = new ProEconPowerFittingAnalySis();
|
|
|
/*fl.setPath(s);
|
|
|
fl.setStation(split[0]);
|