| | |
| | | package com.iailab.module.model.mdk.factory; |
| | | |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemTypeEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemOutputService; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemTypeService; |
| | | import com.iailab.module.model.mcs.pre.service.MmPredictItemService; |
| | | import com.iailab.module.model.mdk.vo.ItemVO; |
| | | import com.iailab.module.model.mdk.vo.MergeItemVO; |
| | | import com.iailab.module.model.mdk.vo.MmItemOutputVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | private Map<String, MmItemTypeEntity> itemTypeMap = new HashMap<>(); |
| | | private Map<String, MergeItemVO> mergeItemMap = new HashMap<>(); |
| | | private Map<String, ItemVO> itemNoEntityMap = new HashMap<>(); |
| | | private Map<String, List<MmItemOutputVO>> itemOutPutItemMap = new HashMap<>(); |
| | | private Map<String, MmItemOutputVO> itemOutputMap = new HashMap<>(); |
| | | private Map<String, List<MmItemOutputEntity>> itemOutPutItemMap = new HashMap<>(); |
| | | |
| | | @Autowired |
| | | private MmPredictItemService mmPredictItemService; |
| | |
| | | * @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); |
| | |
| | | * @param itemId |
| | | * @return |
| | | */ |
| | | public List<MmItemOutputVO> getOutPutByItemId(String itemId) { |
| | | List<MmItemOutputVO> list = mmItemOutputService.getOutPutByItemId(itemId); |
| | | public List<com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity> getOutPutByItemId(String itemId) { |
| | | List<com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity> list = mmItemOutputService.getByItemid(itemId); |
| | | if (!itemOutPutItemMap.containsKey(itemId)) { |
| | | if (list != null) { |
| | | itemOutPutItemMap.put(itemId, list); |
| | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 5. |
| | | * |
| | | * @param outputId |
| | | * @return |
| | | */ |
| | | public MmItemOutputVO getItemOutPutById(String outputId) { |
| | | if (!itemOutputMap.containsKey(outputId)) { |
| | | MmItemOutputVO itemOutput = mmItemOutputService.getOutPutById(outputId); |
| | | if (itemOutput != null) { |
| | | itemOutputMap.put(outputId, itemOutput); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | return itemOutputMap.get(outputId); |
| | | } |
| | | |
| | | /** |
| | | * 6.根据预测项ID,获取预测项对应的输出参数的维数 |
| | | * |
| | | * @param itemId |
| | | * @return |
| | | */ |
| | | public Integer getItemOutputCount(String itemId) { |
| | | if (!itemOutPutItemMap.containsKey(itemId)) { |
| | | List<MmItemOutputVO> list = mmItemOutputService.getOutPutByItemId(itemId); |
| | | if (list != null) { |
| | | itemOutPutItemMap.put(itemId, list); |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | return itemOutPutItemMap.get(itemId).size(); |
| | | } |
| | | |
| | | /** |
| | | * 7.根据预测项ID,获取对应的MmItemTypeEntity实体 |
| | | * |
| | | * @param itemId |
| | | * @return |
| | | */ |
| | | public MmItemTypeEntity getMmItemTypeEntity(String itemId) { |
| | | if (!itemTypeMap.containsKey(itemId)) { |
| | | MmItemTypeEntity MmItemTypeEntity = mmItemTypeService.getItemTypeByItemId(itemId); |
| | | if (MmItemTypeEntity != null) { |
| | | itemTypeMap.put(itemId, MmItemTypeEntity); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | return itemTypeMap.get(itemId); |
| | | } |
| | | } |