dengzedong
2 天以前 de1b3b3b3820830f9a6e853e25884ab8085e57e3
mergeItem结果存入output
已修改1个文件
12 ■■■■ 文件已修改
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemMergeHandlerImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemMergeHandlerImpl.java
@@ -19,6 +19,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.sql.Timestamp;
import java.util.*;
@@ -68,7 +69,7 @@
        try {
            String expression = itemEntityFactory.getMergeItem(itemId).getExpression();
            int predictLength = itemEntityFactory.getItemById(itemId).getPredictLength();
            double[][] predictResultMat = new double[predictLength][1];
            double[] predictResultMat = new double[predictLength];
            String[] mathOutPutId = expression.split("[\\+ \\-]");
            ArrayList<Character> operator = new ArrayList<>();
            for (int i = 0; i < expression.length(); i++) {
@@ -111,7 +112,7 @@
                        if (operator.get(j-1)=='-')
                        {sum -= predictValueMap.get(mathOutPutId[j])[i];}
                    }
                    predictResultMat[i][0] = sum;
                    predictResultMat[i] = sum;
                }
            }
            //是否为组合预测项
@@ -137,7 +138,12 @@
//            }
            log.info("计算预测模型结果:" + predictResultMat);
            predictResult.setPredictId(itemId);
            predictResult.setPredictMatrix(predictResultMat);
            List<MmItemOutputEntity> outputServiceByItemid = mmItemOutputService.getByItemid(itemId);
            if (CollectionUtils.isEmpty(outputServiceByItemid)) {
                Map<MmItemOutputEntity, double[]> predictMatrixs = new HashMap<>();
                predictMatrixs.put(outputServiceByItemid.get(0),predictResultMat);
                predictResult.setPredictMatrixs(predictMatrixs);
            }
            predictResult.setPredictTime(predictTime);
            //预测项预测成功的状态
            itemStatus = ItemPredictStatus.SUCCESS;