潘志宝
2024-12-25 b8ecc0872d38c5e2c26ef56c4e6de7a30b12032a
调度记录
已添加1个文件
已修改3个文件
75 ■■■■■ 文件已修改
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleRecordController.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleRecordService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleRecordServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordRespVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleRecordController.java
对比新文件
@@ -0,0 +1,53 @@
package com.iailab.module.model.mcs.sche.controller.admin;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.model.mcs.sche.entity.StScheduleRecordEntity;
import com.iailab.module.model.mcs.sche.vo.StScheduleRecordPageReqVO;
import com.iailab.module.model.mcs.sche.vo.StScheduleRecordRespVO;
import com.iailab.module.model.mcs.sche.service.StScheduleRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年12月25日
 */
@Tag(name = "模型服务 - 调度记录")
@RestController
@RequestMapping("/model/sche/record")
public class StScheduleRecordController {
    @Autowired
    private StScheduleRecordService stScheduleRecordService;
    @GetMapping("/get")
    @Operation(summary = "获得调度记录")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('sche:record:query')")
    public CommonResult<StScheduleRecordRespVO> getInfo(@RequestParam("id") String id) {
        StScheduleRecordRespVO respVO = stScheduleRecordService.getInfo(id);
        return success(respVO);
    }
    @GetMapping("/page")
    @Operation(summary = "获得调度记录分页")
    @PreAuthorize("@ss.hasPermission('sche:record:query')")
    public CommonResult<PageResult<StScheduleRecordRespVO>> getTenantPage(@Valid StScheduleRecordPageReqVO pageVO) {
        PageResult<StScheduleRecordEntity> pageResult = stScheduleRecordService.page(pageVO);
        return success(BeanUtils.toBean(pageResult, StScheduleRecordRespVO.class));
    }
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleRecordService.java
@@ -4,7 +4,7 @@
import com.iailab.framework.common.service.BaseService;
import com.iailab.module.model.mcs.sche.entity.StScheduleRecordEntity;
import com.iailab.module.model.mcs.sche.vo.StScheduleRecordPageReqVO;
import com.iailab.module.model.mcs.sche.vo.StScheduleRecordSaveReqVO;
import com.iailab.module.model.mcs.sche.vo.StScheduleRecordRespVO;
import com.iailab.module.model.mdk.vo.ScheduleResultVO;
/**
@@ -16,5 +16,7 @@
    PageResult<StScheduleRecordEntity> page(StScheduleRecordPageReqVO reqVO);
    StScheduleRecordRespVO getInfo(String id);
    void create(ScheduleResultVO resultVO);
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleRecordServiceImpl.java
@@ -3,16 +3,21 @@
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.service.impl.BaseServiceImpl;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.model.mcs.sche.dao.StScheduleRecordDao;
import com.iailab.module.model.mcs.sche.entity.StScheduleRecordDetailEntity;
import com.iailab.module.model.mcs.sche.entity.StScheduleRecordEntity;
import com.iailab.module.model.mcs.sche.service.StScheduleRecordDetailService;
import com.iailab.module.model.mcs.sche.service.StScheduleRecordService;
import com.iailab.module.model.mcs.sche.vo.StScheduleRecordDetailRespVO;
import com.iailab.module.model.mcs.sche.vo.StScheduleRecordPageReqVO;
import com.iailab.module.model.mcs.sche.vo.StScheduleRecordRespVO;
import com.iailab.module.model.mdk.vo.ScheduleResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
@@ -33,6 +38,15 @@
    }
    @Override
    public StScheduleRecordRespVO getInfo(String id) {
        StScheduleRecordEntity entity = baseDao.selectById(id);
        StScheduleRecordRespVO respVO = ConvertUtils.sourceToTarget(entity, StScheduleRecordRespVO.class);
        List<StScheduleRecordDetailEntity> list = stScheduleRecordDetailService.getByRecordId(id);
        respVO.setDetailList(ConvertUtils.sourceToTarget(list, StScheduleRecordDetailRespVO.class));
        return respVO;
    }
    @Override
    @DSTransactional(rollbackFor = Exception.class)
    public void create(ScheduleResultVO resultVO) {
        StScheduleRecordEntity entity = new StScheduleRecordEntity();
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordRespVO.java
@@ -5,6 +5,7 @@
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * @author PanZhibao
@@ -33,4 +34,7 @@
    @Schema(description = "创建时间")
    private Date createTime;
    @Schema(description = "详情")
    private List<StScheduleRecordDetailRespVO> detailList;
}