|
@@ -0,0 +1,138 @@
|
|
|
+package com.taais.biz.service.impl;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+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.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 jakarta.annotation.Resource;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import com.taais.biz.mapper.AlgorithmDataProcessMapper;
|
|
|
+import com.taais.biz.domain.AlgorithmDataProcess;
|
|
|
+import com.taais.biz.domain.bo.AlgorithmDataProcessBo;
|
|
|
+import com.taais.biz.domain.vo.AlgorithmDataProcessVo;
|
|
|
+import com.taais.biz.service.IAlgorithmDataProcessService;
|
|
|
+import static com.taais.biz.domain.table.AlgorithmDataProcessTableDef.ALGORITHM_DATA_PROCESS;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 算法数据处理Service业务层处理
|
|
|
+ *
|
|
|
+ * @author 0
|
|
|
+ * 2024-06-14
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class AlgorithmDataProcessServiceImpl extends BaseServiceImpl<AlgorithmDataProcessMapper, AlgorithmDataProcess> implements IAlgorithmDataProcessService {
|
|
|
+ @Resource
|
|
|
+ private AlgorithmDataProcessMapper algorithmDataProcessMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public QueryWrapper query() {
|
|
|
+ return super.query().from(ALGORITHM_DATA_PROCESS);
|
|
|
+ }
|
|
|
+
|
|
|
+ private QueryWrapper buildQueryWrapper(AlgorithmDataProcessBo algorithmDataProcessBo) {
|
|
|
+ QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
|
|
|
+ queryWrapper.and(ALGORITHM_DATA_PROCESS.SUB_TASK_ID.eq
|
|
|
+ (algorithmDataProcessBo.getSubTaskId()));
|
|
|
+ queryWrapper.and(ALGORITHM_DATA_PROCESS.NAME.like
|
|
|
+ (algorithmDataProcessBo.getName()));
|
|
|
+ queryWrapper.and(ALGORITHM_DATA_PROCESS.TYPE.eq
|
|
|
+ (algorithmDataProcessBo.getType()));
|
|
|
+ queryWrapper.and(ALGORITHM_DATA_PROCESS.STATUS.eq
|
|
|
+ (algorithmDataProcessBo.getStatus()));
|
|
|
+
|
|
|
+ return queryWrapper;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询算法数据处理
|
|
|
+ *
|
|
|
+ * @param id 算法数据处理主键
|
|
|
+ * @return 算法数据处理
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public AlgorithmDataProcessVo selectById(Long id) {
|
|
|
+ return this.getOneAs(query().where(ALGORITHM_DATA_PROCESS.ID.eq(id)), AlgorithmDataProcessVo.class);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询算法数据处理列表
|
|
|
+ *
|
|
|
+ * @param algorithmDataProcessBo 算法数据处理Bo
|
|
|
+ * @return 算法数据处理集合
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<AlgorithmDataProcessVo> selectList(AlgorithmDataProcessBo algorithmDataProcessBo) {
|
|
|
+ QueryWrapper queryWrapper = buildQueryWrapper(algorithmDataProcessBo);
|
|
|
+ return this.listAs(queryWrapper, AlgorithmDataProcessVo.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询算法数据处理列表
|
|
|
+ *
|
|
|
+ * @param algorithmDataProcessBo 算法数据处理Bo
|
|
|
+ * @return 分页算法数据处理集合
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public PageResult<AlgorithmDataProcessVo> selectPage(AlgorithmDataProcessBo algorithmDataProcessBo) {
|
|
|
+ QueryWrapper queryWrapper = buildQueryWrapper(algorithmDataProcessBo);
|
|
|
+ Page<AlgorithmDataProcessVo> page = this.pageAs(PageQuery.build(), queryWrapper, AlgorithmDataProcessVo.class);
|
|
|
+ return PageResult.build(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增算法数据处理
|
|
|
+ *
|
|
|
+ * @param algorithmDataProcessBo 算法数据处理Bo
|
|
|
+ * @return 结果:true 操作成功,false 操作失败
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean insert(AlgorithmDataProcessBo algorithmDataProcessBo) {
|
|
|
+ AlgorithmDataProcess algorithmDataProcess =MapstructUtils.convert(algorithmDataProcessBo, AlgorithmDataProcess. class);
|
|
|
+
|
|
|
+ return this.save(algorithmDataProcess);//使用全局配置的雪花算法主键生成器生成ID值
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改算法数据处理
|
|
|
+ *
|
|
|
+ * @param algorithmDataProcessBo 算法数据处理Bo
|
|
|
+ * @return 结果:true 更新成功,false 更新失败
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean update(AlgorithmDataProcessBo algorithmDataProcessBo) {
|
|
|
+ AlgorithmDataProcess algorithmDataProcess =MapstructUtils.convert(algorithmDataProcessBo, AlgorithmDataProcess. class);
|
|
|
+ if (ObjectUtil.isNotNull(algorithmDataProcess) && ObjectUtil.isNotNull(algorithmDataProcess.getId())){
|
|
|
+ boolean updated = this.updateById(algorithmDataProcess);
|
|
|
+ return updated;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除算法数据处理
|
|
|
+ *
|
|
|
+ * @param ids 需要删除的算法数据处理主键集合
|
|
|
+ * @return 结果:true 删除成功,false 删除失败
|
|
|
+ */
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public boolean deleteByIds(Long[] ids) {
|
|
|
+ return this.removeByIds(Arrays.asList(ids));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<AlgorithmDataProcessVo> getProcessBySubtaskId(Long id) {
|
|
|
+ // todo Allen
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|