| | |
| | | import com.iailab.module.model.mdk.predict.PredictModelHandler; |
| | | import com.iailab.module.model.mdk.vo.ItemVO; |
| | | import com.iailab.module.model.mdk.vo.PredictResultVO; |
| | | import com.iailab.module.model.mdk.vo.StAdjustDeviationDTO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | return predictResult; |
| | | } |
| | | |
| | | /** |
| | | * NormalItem预测 |
| | | * |
| | | * @param predictTime |
| | | * @param predictItemDto |
| | | * @return |
| | | * @throws ItemInvokeException |
| | | */ |
| | | @Override |
| | | public PredictResultVO predictAdjust(Date predictTime, ItemVO predictItemDto, List<StAdjustDeviationDTO> deviationList) throws ItemInvokeException,ModelResultErrorException { |
| | | PredictResultVO predictResult = new PredictResultVO(); |
| | | String itemId = predictItemDto.getId(); |
| | | try { |
| | | MmPredictModelEntity predictModel = mmPredictModelService.getActiveModelByItemId(itemId); |
| | | if (predictModel == null) { |
| | | throw new ModelInvokeException(MessageFormat.format("{0},itemId={1}", |
| | | ModelInvokeException.errorGetModelEntity, itemId)); |
| | | } |
| | | predictResult = predictModelHandler.predictByModel(predictTime, predictModel,predictItemDto.getItemName(),predictItemDto.getItemNo(), deviationList); |
| | | predictResult.setPredictId(itemId); |
| | | } catch (ModelResultErrorException ex) { |
| | | throw ex; |
| | | } catch (Exception ex) { |
| | | throw new ItemInvokeException(MessageFormat.format("{0},itemId={1}", |
| | | ItemInvokeException.errorItemFailed, itemId)); |
| | | } |
| | | return predictResult; |
| | | } |
| | | } |