dengzedong
6 天以前 b82ba2a29aa9ee181c707677157d8057fff68450
预测项数据图表查询bug,不能从缓存中查item,要最新的运行时间
已修改8个文件
45 ■■■■■ 文件已修改
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/factory/ItemEntityFactory.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleInfoConstructor.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
@@ -134,7 +134,7 @@
        Date predictTime = reqVO.getPredictTime();
        if (predictTime == null) {
            MmItemOutputEntity output = mmItemOutputService.getOutPutById(reqVO.getOutIds().get(0));
            ItemVO predictItem = mmPredictItemService.getItemById(output.getItemid());
            ItemVO predictItem = mmPredictItemService.getItemByIdFromCache(output.getItemid());
            if (predictItem.getLastTime() != null) {
                predictTime = predictItem.getLastTime();
            } else {
@@ -235,7 +235,7 @@
    @Override
    public PreDataItemChartRespVO getPreDataItemChart(PreDataItemChartReqVO reqVO) {
        PreDataItemChartRespVO result = new PreDataItemChartRespVO();
        ItemVO predictItem = mmPredictItemService.getItemById(reqVO.getItemId());
        ItemVO predictItem = mmPredictItemService.getItemByIdFromCache(reqVO.getItemId());
        if (predictItem == null) {
            return result;
        }
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java
@@ -8,7 +8,6 @@
import com.iailab.module.model.mdk.vo.ItemVO;
import com.iailab.module.model.mdk.vo.MergeItemVO;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -28,6 +27,7 @@
    ItemVO getItemByItemNo(String itemNo);
    ItemVO getItemByIdFromCache(String itemId);
    ItemVO getItemById(String itemId);
    ItemVO getItemByOutPutId(String outPutId);
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java
@@ -258,7 +258,7 @@
    }
    @Override
    public ItemVO getItemById(String itemId) {
    public ItemVO getItemByIdFromCache(String itemId) {
        if (StringUtils.isBlank(itemId)) {
            return null;
        }
@@ -275,6 +275,17 @@
    }
    @Override
    public ItemVO getItemById(String itemId) {
        Map<String, Object> params = new HashMap<>(1);
        params.put("ITEMID", itemId);
        List<ItemVO> list = mmPredictItemDao.getItem(params);
        if (CollectionUtils.isEmpty(list)) {
            return null;
        }
        return list.get(0);
    }
    @Override
    public ItemVO getItemByOutPutId(String outPutId) {
        if (StringUtils.isBlank(outPutId)) {
            return null;
@@ -284,7 +295,7 @@
            return null;
        }
        String itemId = outPutById.getItemid();
        return getItemById(itemId);
        return getItemByIdFromCache(itemId);
    }
    @Override
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/factory/ItemEntityFactory.java
@@ -77,7 +77,7 @@
     * @return
     */
    public ItemVO getItemById(String itemId) {
        ItemVO ItemVO = mmPredictItemService.getItemById(itemId);
        ItemVO ItemVO = mmPredictItemService.getItemByIdFromCache(itemId);
        if (!ItemVOHashMap.containsKey(itemId)) {
            if (ItemVO != null) {
                ItemVOHashMap.put(itemId, ItemVO);
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java
@@ -40,7 +40,6 @@
    public PredictResultVO predict(Date predictTime, ItemVO predictItemDto) throws ItemInvokeException {
        PredictResultVO predictResult = new PredictResultVO();
        String itemId = predictItemDto.getId();
        predictResult.setPredictId(itemId);
        try {
            MmPredictModelEntity predictModel = mmPredictModelService.getActiveModelByItemId(itemId);
            if (predictModel == null) {
@@ -48,6 +47,7 @@
                        ModelInvokeException.errorGetModelEntity, itemId));
            }
            predictResult = predictModelHandler.predictByModel(predictTime, predictModel);
            predictResult.setPredictId(itemId);
        } catch (Exception ex) {
            throw new ItemInvokeException(MessageFormat.format("{0},itemId={1}",
                    ItemInvokeException.errorItemFailed, itemId));
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java
@@ -86,13 +86,13 @@
            param2Values[portLength] = newModelBean.getDataMap().get("models");
            param2Values[portLength + 1] = settings;
            log.info("#######################预测模型 " + predictModel.getItemid() + " ##########################");
            JSONObject jsonObjNewModelBean = new JSONObject();
            jsonObjNewModelBean.put("newModelBean", newModelBean);
            log.info(String.valueOf(jsonObjNewModelBean));
            JSONObject jsonObjParam2Values = new JSONObject();
            jsonObjParam2Values.put("param2Values", param2Values);
            log.info(String.valueOf(jsonObjParam2Values));
            log.info("####################### 预测模型 "+ "【itemId:" + predictModel.getItemid() + ",modelName" + predictModel.getMethodname() + "】 ##########################");
//            JSONObject jsonObjNewModelBean = new JSONObject();
//            jsonObjNewModelBean.put("newModelBean", newModelBean);
//            log.info(String.valueOf(jsonObjNewModelBean));
//            JSONObject jsonObjParam2Values = new JSONObject();
//            jsonObjParam2Values.put("param2Values", param2Values);
//            log.info(String.valueOf(jsonObjParam2Values));
            //IAILMDK.run
            HashMap<String, Object> modelResult = DllUtils.run(newModelBean, param2Values, predictModel.getMpkprojectid());
@@ -102,7 +102,7 @@
            }
            modelResult = (HashMap<String, Object>) modelResult.get(CommonConstant.MDK_RESULT);
            //打印结果
            log.info("预测模型计算完成:modelId=" + modelId + modelResult);
            log.info("预测模型计算完成:modelId=" + modelId + ",modelName" + predictModel.getMethodname());
            JSONObject jsonObjResult = new JSONObject();
            jsonObjResult.put("result", modelResult);
            log.info(String.valueOf(jsonObjResult));
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/PredictSampleInfoConstructor.java
@@ -105,7 +105,7 @@
     */
    @Override
    protected Integer getSampleCycle(String modelId) {
        return mmPredictItemService.getItemById(mmPredictModelService.getInfoFromCatch(modelId).getItemid()).getGranularity();
        return mmPredictItemService.getItemByIdFromCache(mmPredictModelService.getInfoFromCatch(modelId).getItemid()).getGranularity();
    }
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/sample/SampleInfoConstructor.java
@@ -179,7 +179,7 @@
                granularity = mmPredictItemService.getItemByOutPutId(columnItem.getParamId()).getGranularity();
                break;
            case MERGEITEM:
                granularity = mmPredictItemService.getItemById(columnItem.getParamId()).getGranularity();
                granularity = mmPredictItemService.getItemByIdFromCache(columnItem.getParamId()).getGranularity();
                break;
            case IND:
                ApiIndItemDTO indItemDTO = indItemApi.getInfoById(columnItem.getParamId());