From b8ecc0872d38c5e2c26ef56c4e6de7a30b12032a Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 25 十二月 2024 11:59:45 +0800 Subject: [PATCH] 调度记录 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordRespVO.java | 4 ++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleRecordService.java | 4 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleRecordController.java | 53 ++++++++++++++++++++++++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleRecordServiceImpl.java | 14 +++++++ 4 files changed, 74 insertions(+), 1 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleRecordController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleRecordController.java new file mode 100644 index 0000000..8995232 --- /dev/null +++ b/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)); + } +} \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleRecordService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleRecordService.java index 294b502..5fe5e6b 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleRecordService.java +++ b/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); } \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleRecordServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleRecordServiceImpl.java index ac33fbc..58479dd 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleRecordServiceImpl.java +++ b/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(); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordRespVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordRespVO.java index 3012f21..7889a5b 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleRecordRespVO.java +++ b/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; } \ No newline at end of file -- Gitblit v1.9.3