|
@@ -6,12 +6,21 @@ import java.util.List;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.mybatisflex.core.paginate.Page;
|
|
|
import com.mybatisflex.core.query.QueryWrapper;
|
|
|
+import com.taais.biz.domain.AlgorithmConfigTrack;
|
|
|
+import com.taais.biz.domain.vo.AlgorithmConfigTrackVo;
|
|
|
+import com.taais.biz.mapper.AlgorithmConfigTrackMapper;
|
|
|
+import com.taais.common.core.config.TaaisConfig;
|
|
|
+import com.taais.common.core.constant.Constants;
|
|
|
import com.taais.common.core.utils.MapstructUtils;
|
|
|
import com.taais.common.core.utils.StringUtils;
|
|
|
import com.taais.common.orm.core.page.PageQuery;
|
|
|
import com.taais.common.core.core.page.PageResult;
|
|
|
import com.taais.common.orm.core.service.impl.BaseServiceImpl;
|
|
|
+import com.taais.system.domain.SysOss;
|
|
|
+import com.taais.system.domain.vo.SysOssVo;
|
|
|
+import com.taais.system.service.ISysOssService;
|
|
|
import jakarta.annotation.Resource;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import com.taais.biz.mapper.AlgorithmModelTrackMapper;
|
|
@@ -19,6 +28,7 @@ import com.taais.biz.domain.AlgorithmModelTrack;
|
|
|
import com.taais.biz.domain.bo.AlgorithmModelTrackBo;
|
|
|
import com.taais.biz.domain.vo.AlgorithmModelTrackVo;
|
|
|
import com.taais.biz.service.IAlgorithmModelTrackService;
|
|
|
+
|
|
|
import static com.taais.biz.domain.table.AlgorithmModelTrackTableDef.ALGORITHM_MODEL_TRACK;
|
|
|
|
|
|
/**
|
|
@@ -29,6 +39,12 @@ import static com.taais.biz.domain.table.AlgorithmModelTrackTableDef.ALGORITHM_M
|
|
|
*/
|
|
|
@Service
|
|
|
public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmModelTrackMapper, AlgorithmModelTrack> implements IAlgorithmModelTrackService {
|
|
|
+ @Autowired
|
|
|
+ private ISysOssService ossService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AlgorithmConfigTrackServiceImpl algorithmConfigTrackService;
|
|
|
+
|
|
|
@Resource
|
|
|
private AlgorithmModelTrackMapper algorithmModelTrackMapper;
|
|
|
|
|
@@ -40,19 +56,21 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
|
|
|
private QueryWrapper buildQueryWrapper(AlgorithmModelTrackBo algorithmModelTrackBo) {
|
|
|
QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
|
|
|
queryWrapper.and(ALGORITHM_MODEL_TRACK.ALGORITHM_ID.eq
|
|
|
- (algorithmModelTrackBo.getAlgorithmId()));
|
|
|
+ (algorithmModelTrackBo.getAlgorithmId()));
|
|
|
queryWrapper.and(ALGORITHM_MODEL_TRACK.MODEL_NAME.like
|
|
|
- (algorithmModelTrackBo.getModelName()));
|
|
|
+ (algorithmModelTrackBo.getModelName()));
|
|
|
queryWrapper.and(ALGORITHM_MODEL_TRACK.MODEL_ADDRESS.eq
|
|
|
- (algorithmModelTrackBo.getModelAddress()));
|
|
|
+ (algorithmModelTrackBo.getModelAddress()));
|
|
|
queryWrapper.and(ALGORITHM_MODEL_TRACK.SAMPLE_NUMBER.eq
|
|
|
- (algorithmModelTrackBo.getSampleNumber()));
|
|
|
+ (algorithmModelTrackBo.getSampleNumber()));
|
|
|
queryWrapper.and(ALGORITHM_MODEL_TRACK.CYCLE_EPOCH.eq
|
|
|
- (algorithmModelTrackBo.getCycleEpoch()));
|
|
|
+ (algorithmModelTrackBo.getCycleEpoch()));
|
|
|
queryWrapper.and(ALGORITHM_MODEL_TRACK.REMARKS.eq
|
|
|
- (algorithmModelTrackBo.getRemarks()));
|
|
|
+ (algorithmModelTrackBo.getRemarks()));
|
|
|
queryWrapper.and(ALGORITHM_MODEL_TRACK.SYSTEM.eq
|
|
|
- (algorithmModelTrackBo.getSystem()));
|
|
|
+ (algorithmModelTrackBo.getSystem()));
|
|
|
+ queryWrapper.and(ALGORITHM_MODEL_TRACK.ALGORITHM_TYPE.eq
|
|
|
+ (algorithmModelTrackBo.getAlgorithmType()));
|
|
|
|
|
|
return queryWrapper;
|
|
|
}
|
|
@@ -65,7 +83,7 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
|
|
|
*/
|
|
|
@Override
|
|
|
public AlgorithmModelTrackVo selectById(Long id) {
|
|
|
- return this.getOneAs(query().where(ALGORITHM_MODEL_TRACK.ID.eq(id)), AlgorithmModelTrackVo.class);
|
|
|
+ return this.getOneAs(query().where(ALGORITHM_MODEL_TRACK.ID.eq(id)), AlgorithmModelTrackVo.class);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -78,7 +96,7 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
|
|
|
@Override
|
|
|
public List<AlgorithmModelTrackVo> selectList(AlgorithmModelTrackBo algorithmModelTrackBo) {
|
|
|
QueryWrapper queryWrapper = buildQueryWrapper(algorithmModelTrackBo);
|
|
|
- return this.listAs(queryWrapper, AlgorithmModelTrackVo.class);
|
|
|
+ return this.listAs(queryWrapper, AlgorithmModelTrackVo.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -90,7 +108,7 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
|
|
|
@Override
|
|
|
public PageResult<AlgorithmModelTrackVo> selectPage(AlgorithmModelTrackBo algorithmModelTrackBo) {
|
|
|
QueryWrapper queryWrapper = buildQueryWrapper(algorithmModelTrackBo);
|
|
|
- Page<AlgorithmModelTrackVo> page = this.pageAs(PageQuery.build(), queryWrapper, AlgorithmModelTrackVo.class);
|
|
|
+ Page<AlgorithmModelTrackVo> page = this.pageAs(PageQuery.build(), queryWrapper, AlgorithmModelTrackVo.class);
|
|
|
return PageResult.build(page);
|
|
|
}
|
|
|
|
|
@@ -102,9 +120,22 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean insert(AlgorithmModelTrackBo algorithmModelTrackBo) {
|
|
|
- AlgorithmModelTrack algorithmModelTrack =MapstructUtils.convert(algorithmModelTrackBo, AlgorithmModelTrack. class);
|
|
|
+ AlgorithmModelTrack algorithmModelTrack = MapstructUtils.convert(algorithmModelTrackBo, AlgorithmModelTrack.class);
|
|
|
+
|
|
|
+ SysOssVo inputOssEntity = ossService.getById(algorithmModelTrackBo.getModelInputOssId());
|
|
|
+
|
|
|
+ String filePath = inputOssEntity.getFileName();
|
|
|
+ String localPath = TaaisConfig.getProfile();
|
|
|
+ String resourcePath = localPath + StringUtils.substringAfter(filePath, Constants.RESOURCE_PREFIX);
|
|
|
+
|
|
|
+ algorithmModelTrack.setModelAddress(resourcePath);
|
|
|
+
|
|
|
+ algorithmModelTrack.setAlgorithmId(algorithmModelTrackBo.getAlgorithmId_());
|
|
|
+
|
|
|
+ AlgorithmConfigTrackVo algorithmConfigTrackVo = algorithmConfigTrackService.selectById(algorithmModelTrackBo.getAlgorithmId_());
|
|
|
+ algorithmModelTrack.setAlgorithmType(algorithmConfigTrackVo.getAlgorithmName());
|
|
|
|
|
|
- return this.save(algorithmModelTrack);//使用全局配置的雪花算法主键生成器生成ID值
|
|
|
+ return this.save(algorithmModelTrack); // 使用全局配置的雪花算法主键生成器生成ID值
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -115,10 +146,10 @@ public class AlgorithmModelTrackServiceImpl extends BaseServiceImpl<AlgorithmMod
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean update(AlgorithmModelTrackBo algorithmModelTrackBo) {
|
|
|
- AlgorithmModelTrack algorithmModelTrack =MapstructUtils.convert(algorithmModelTrackBo, AlgorithmModelTrack. class);
|
|
|
- if (ObjectUtil.isNotNull(algorithmModelTrack) && ObjectUtil.isNotNull(algorithmModelTrack.getId())){
|
|
|
+ AlgorithmModelTrack algorithmModelTrack = MapstructUtils.convert(algorithmModelTrackBo, AlgorithmModelTrack.class);
|
|
|
+ if (ObjectUtil.isNotNull(algorithmModelTrack) && ObjectUtil.isNotNull(algorithmModelTrack.getId())) {
|
|
|
boolean updated = this.updateById(algorithmModelTrack);
|
|
|
- return updated;
|
|
|
+ return updated;
|
|
|
}
|
|
|
return false;
|
|
|
}
|