|
@@ -16,8 +16,10 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
import javax.persistence.criteria.Predicate;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Comparator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 逆变器业务层
|
|
* 逆变器业务层
|
|
@@ -263,4 +265,21 @@ public class InverterInfoService extends BaseService {
|
|
inverterInfoRepository.saveAll(beans);
|
|
inverterInfoRepository.saveAll(beans);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据场站编号查询逆变器
|
|
|
|
+ *
|
|
|
|
+ * @param stationCode 场站编号
|
|
|
|
+ * @return
|
|
|
|
+ * @throws BusinessException 业务异常
|
|
|
|
+ */
|
|
|
|
+ @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
|
|
|
|
+ public List<InverterInfo> getByStationCode(String stationCode) {
|
|
|
|
+ List<InverterInfo> resultList = new ArrayList<>();
|
|
|
|
+ resultList = this.inverterInfoRepository.findAll();
|
|
|
|
+ if (!"ALL".equals(stationCode)){
|
|
|
|
+ resultList = resultList.stream().filter(s->s.getStationCode().equals(stationCode)).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ return resultList.stream().sorted(Comparator.comparing(InverterInfo::getStationCode)).collect(Collectors.toList());
|
|
|
|
+ }
|
|
}
|
|
}
|