| | |
| | | result.setModelResult(modelResult); |
| | | result.setPredictTime(predictTime); |
| | | } catch (ModelResultErrorException ex) { |
| | | ex.printStackTrace(); |
| | | // ex.printStackTrace(); |
| | | log.error("模型结果异常", ex); |
| | | throw ex; |
| | | } catch (Exception ex) { |
| | | // log.error("调用发生异常,异常信息为:{0}", ex.getMessage()); |
| | | ex.printStackTrace(); |
| | | // ex.printStackTrace(); |
| | | log.error("模型运行异常", ex); |
| | | throw new ModelInvokeException(ex.getMessage()); |
| | | } |
| | | return result; |
| | |
| | | List<DataValueVO> predictValue = new ArrayList<>(); |
| | | |
| | | // double类型特殊处理 |
| | | if (outResultType.equals(OutResultType.D)) { |
| | | if (OutResultType.D.equals(outResultType)) { |
| | | // columnItem.getStartTime()就是预测时间 |
| | | String doubleData = mmItemResultJsonService.getDoubleData(outPut.getId(), columnItem.getStartTime()); |
| | | if (StringUtils.isNotBlank(doubleData)) { |
| | |
| | | package com.iailab.module.model.mdk.sample; |
| | | |
| | | import com.iailab.module.model.mdk.common.exceptions.DataAccessException; |
| | | import com.iailab.module.model.mdk.common.exceptions.ModelInvokeException; |
| | | import com.iailab.module.model.mdk.sample.dto.SampleData; |
| | | import com.iailab.module.model.mdk.sample.dto.SampleInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.text.MessageFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | * @Description |
| | | * @createTime 2024年09月03日 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class SampleConstructor { |
| | | |
| | |
| | | return sampleDataConstructor.prepareSampleData(sampleInfo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("获取模型的算法参数异常",e); |
| | | throw new ModelInvokeException(MessageFormat.format("{0},Name:{1}", |
| | | ModelInvokeException.errorGetModelArithParam, itemName)); |
| | | } |
| | |
| | | import com.iailab.module.system.service.permission.MenuService; |
| | | import com.iailab.module.system.service.permission.PermissionService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | public AppDO getAppByTenantId(Long tenantId) { |
| | | //暂时支持一个租户对应一个应用 |
| | | List<AppDO> appDOS = appMapper.selectList(new LambdaQueryWrapper<AppDO>().eq(AppDO::getTenantId, tenantId)); |
| | | if(ObjectUtils.isNotEmpty(appDOS)) { |
| | | if(CollectionUtils.isNotEmpty(appDOS)) { |
| | | return appDOS.get(0); |
| | | } else { |
| | | AppDO appDO = new AppDO(); |
| | |
| | | import com.iailab.module.system.service.tenant.TenantPackageService; |
| | | import com.iailab.module.system.service.tenant.TenantService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | |
| | | //菜单归属租户和应用 |
| | | Long tenantId = getTenantId(); |
| | | AppDO appDO = appService.getAppByTenantId(tenantId); |
| | | if(appDO.getTenantId() != 1) { |
| | | if(ObjectUtils.isNotEmpty(appDO) && appDO.getTenantId() != 1) { |
| | | updateObj.setTenantId(tenantId); |
| | | updateObj.setAppId(appDO.getId()); |
| | | } |