|
@@ -1,13 +1,12 @@
|
|
|
package com.energy.manage.service.service.analysis.impl;
|
|
|
|
|
|
-import com.energy.manage.common.po.analysis.AnalysisOptionRecordsPo;
|
|
|
+import com.energy.manage.common.po.analysis.AnalysisOptionRecords;
|
|
|
import com.energy.manage.common.reponse.ConstVar;
|
|
|
import com.energy.manage.common.reponse.ResultResp;
|
|
|
import com.energy.manage.common.util.HttpUtils;
|
|
|
import com.energy.manage.service.constant.analysis.AnalysisConstants;
|
|
|
import com.energy.manage.service.domain.dto.analysis.AnalysisDto;
|
|
|
import com.energy.manage.service.domain.dto.analysis.AnalysisResultDto;
|
|
|
-import com.energy.manage.service.domain.dto.windfieldbatch.WindFieldBatchDto;
|
|
|
import com.energy.manage.service.domain.vo.analysis.*;
|
|
|
import com.energy.manage.service.domain.vo.windenginegroup.WindEngineGroupVo;
|
|
|
import com.energy.manage.service.domain.vo.windfieldbatch.WindFieldBatchVo;
|
|
@@ -362,21 +361,23 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
* @param newValue 新值
|
|
|
*/
|
|
|
private void updateNodesByPropertyName(JsonNode parentNode, String propertyName, Object newValue,String scada) {
|
|
|
- if (parentNode.isObject()) {
|
|
|
- parentNode.fields().forEachRemaining(entry -> {
|
|
|
- // 匹配到属性名称,进行值的修改
|
|
|
- if (entry.getKey().equalsIgnoreCase(propertyName)) {
|
|
|
- //判断当前节点有没有子节点
|
|
|
- if(!entry.getValue().fields().hasNext() && !propertyName.equalsIgnoreCase(AlgorithmProperties.configAnalysisProperties)){
|
|
|
- ((ObjectNode) parentNode).put(propertyName, newValue.toString());
|
|
|
- }else{
|
|
|
- assignmentByPropertyName(entry.getValue(), propertyName, newValue,scada);
|
|
|
- }
|
|
|
+ //遍历当前节点
|
|
|
+ for (Iterator<Map.Entry<String, JsonNode>> it = parentNode.fields(); it.hasNext(); ) {
|
|
|
+ Map.Entry<String, JsonNode> entry = it.next();
|
|
|
+ // 匹配到属性名称,进行值的修改
|
|
|
+ if (entry.getKey().equalsIgnoreCase(propertyName)) {
|
|
|
+ //判断当前节点有没有子节点
|
|
|
+ if(!entry.getValue().fields().hasNext() && !propertyName.equalsIgnoreCase(AlgorithmProperties.configAnalysisProperties)){
|
|
|
+ ((ObjectNode) parentNode).put(propertyName, newValue.toString());
|
|
|
+ }else{
|
|
|
+ assignmentByPropertyName(entry.getValue(), propertyName, newValue,scada);
|
|
|
}
|
|
|
- // 递归搜索子节点
|
|
|
- updateNodesByPropertyName(entry.getValue(), propertyName, newValue,scada);
|
|
|
- });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 递归搜索子节点
|
|
|
+ updateNodesByPropertyName(entry.getValue(), propertyName, newValue,scada);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -423,6 +424,7 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
*/
|
|
|
private void dealConfigAnalysis(JsonNode subNode, Object newValue,String scada){
|
|
|
try{
|
|
|
+// if(newValue == null){ return; }
|
|
|
ArrayNode arrayNode = (ArrayNode) subNode;
|
|
|
List<String> analysisTypes = (List) newValue;
|
|
|
for(int i = 0 ; i < analysisTypes.size() ; i++){
|
|
@@ -455,7 +457,7 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
WindFieldBatchVo windFieldBatchVo = windFieldBatchMapper.selectByBatchCode(batchCode);
|
|
|
fieldCode = windFieldBatchVo.getFieldCode();
|
|
|
}
|
|
|
- AnalysisOptionRecordsPo optionRecordsPo = new AnalysisOptionRecordsPo();
|
|
|
+ AnalysisOptionRecords optionRecordsPo = new AnalysisOptionRecords();
|
|
|
LoginUser user = LoginUserContextHolder.get();
|
|
|
optionRecordsPo.setOptionBy(user.getUserId());
|
|
|
optionRecordsPo.setOptionByName(user.getUserName());
|