| | |
| | | */ |
| | | package org.sxkj.fw.detection.controller; |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.Ignore; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.sxkj.fw.detection.dto.FwTaskScheduleDTO; |
| | | import org.sxkj.fw.detection.entity.FwEffectEvalEntity; |
| | | import org.sxkj.fw.detection.entity.FwTaskScheduleEntity; |
| | | import org.sxkj.fw.detection.param.FwTaskSchedulePageParam; |
| | | import org.sxkj.fw.detection.vo.FwTaskScheduleVO; |
| | | import org.sxkj.fw.detection.excel.FwTaskScheduleExcel; |
| | | import org.sxkj.fw.detection.wrapper.FwTaskScheduleWrapper; |
| | |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 任务调度记录表 控制器 |
| | | * |
| | | * @author lw |
| | | * @since 2026-01-07 |
| | | * @since 2026-01-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | |
| | | FwTaskScheduleEntity detail = fwTaskScheduleService.getOne(Condition.getQueryWrapper(fwTaskSchedule)); |
| | | return R.data(FwTaskScheduleWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * 任务调度记录表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入fwTaskSchedule") |
| | | public R<IPage<FwTaskScheduleVO>> list(@ApiIgnore @RequestParam Map<String, Object> fwTaskSchedule, Query query) { |
| | | IPage<FwTaskScheduleEntity> pages = fwTaskScheduleService.page(Condition.getPage(query), Condition.getQueryWrapper(fwTaskSchedule, FwTaskScheduleEntity.class)); |
| | | return R.data(FwTaskScheduleWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 任务调度记录表 自定义分页 |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入fwTaskSchedule") |
| | | public R<IPage<FwTaskScheduleVO>> page(FwTaskScheduleVO fwTaskSchedule, Query query) { |
| | | public R<IPage<FwTaskScheduleVO>> page(FwTaskSchedulePageParam fwTaskSchedule, Query query) { |
| | | IPage<FwTaskScheduleVO> pages = fwTaskScheduleService.selectFwTaskSchedulePage(Condition.getPage(query), fwTaskSchedule); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 任务调度记录表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入fwTaskSchedule") |
| | | public R save(@Valid @RequestBody FwTaskScheduleEntity fwTaskSchedule) { |
| | | return R.status(fwTaskScheduleService.save(fwTaskSchedule)); |
| | | } |
| | | |
| | | /** |
| | | * 任务调度记录表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入fwTaskSchedule") |
| | | public R update(@Valid @RequestBody FwTaskScheduleEntity fwTaskSchedule) { |
| | | return R.status(fwTaskScheduleService.updateById(fwTaskSchedule)); |
| | | } |
| | | |
| | | /** |
| | | * 任务调度记录表 新增或修改 |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入fwTaskSchedule") |
| | | public R submit(@Valid @RequestBody FwTaskScheduleEntity fwTaskSchedule) { |
| | | return R.status(fwTaskScheduleService.saveOrUpdate(fwTaskSchedule)); |
| | | public R submit(@Valid @RequestBody FwTaskScheduleDTO fwTaskSchedule) { |
| | | FwTaskScheduleEntity fwTaskScheduleEntity = Objects.requireNonNull(BeanUtil.copy(fwTaskSchedule, FwTaskScheduleEntity.class)); |
| | | return R.status(fwTaskScheduleService.saveOrUpdate(fwTaskScheduleEntity)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/export-fwTaskSchedule") |
| | | @ApiOperationSupport(order = 9) |
| | | @Ignore |
| | | @ApiOperation(value = "导出数据", notes = "传入fwTaskSchedule") |
| | | public void exportFwTaskSchedule(@ApiIgnore @RequestParam Map<String, Object> fwTaskSchedule, BladeUser bladeUser, HttpServletResponse response) { |
| | | QueryWrapper<FwTaskScheduleEntity> queryWrapper = Condition.getQueryWrapper(fwTaskSchedule, FwTaskScheduleEntity.class); |