|
@@ -2,12 +2,14 @@ package com.jiayue.biz.service.impl;
|
|
|
|
|
|
import com.jiayue.biz.domain.InverterInfo;
|
|
|
import com.jiayue.biz.domain.StationInfo;
|
|
|
+import com.jiayue.biz.dto.InverterInfoDto;
|
|
|
import com.jiayue.biz.service.InverterInfoService;
|
|
|
import com.jiayue.biz.service.StationInfoService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.UUID;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -19,6 +21,25 @@ public class InverterInfoServiceImpl implements InverterInfoService {
|
|
|
|
|
|
private StationInfoService stationInfoService;
|
|
|
|
|
|
+
|
|
|
+ //查询逆变器
|
|
|
+ public List<InverterInfoDto> selectInverterInfo(){
|
|
|
+ List<StationInfo> stationInfos = stationInfoService.selectStationInfo();
|
|
|
+ ArrayList<InverterInfoDto> list = new ArrayList<>();
|
|
|
+ for (StationInfo stationInfo : stationInfos) {
|
|
|
+ if(stationInfo.getStationBasicInfo().getStationType().equals("光")){
|
|
|
+ InverterInfoDto inverterInfoDto = new InverterInfoDto();
|
|
|
+ inverterInfoDto.setId(stationInfo.getId());
|
|
|
+ inverterInfoDto.setStationName(stationInfo.getStationBasicInfo().getStationName());
|
|
|
+ inverterInfoDto.setInverterInfo(stationInfo.getInverterInfos());
|
|
|
+ list.add(inverterInfoDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
//新增逆变器
|
|
|
public void addInverterInfo(InverterInfo inverterInfo,String stationId){
|
|
|
inverterInfo.setId(UUID.randomUUID().toString());
|