| | |
| | | */ |
| | | package org.springblade.modules.task.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.apache.commons.beanutils.BeanUtils; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.log.logger.BladeLogger; |
| | | 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.jackson.JsonUtil; |
| | | 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.metadata.IPage; |
| | | import org.springblade.modules.task.dto.TaskBailReportingEventDTO; |
| | | import org.springblade.modules.task.entity.TaskBailReportingEventEntity; |
| | | import org.springblade.modules.task.service.ITaskBailReportingEventService; |
| | | import org.springblade.modules.task.vo.TaskBailReportingEventVO; |
| | | import org.springblade.modules.task.wrapper.TaskBailReportingEventWrapper; |
| | | import org.springblade.modules.task.service.ITaskBailReportingEventService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 取保候审任务 控制器 |
| | |
| | | public class TaskBailReportingEventController extends BladeController { |
| | | |
| | | private final ITaskBailReportingEventService taskBailReportingEventService; |
| | | private final BladeLogger bladeLogger; |
| | | |
| | | /** |
| | | * 取保候审任务 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiLog("取保候审任务 详情") |
| | | @ApiOperation(value = "详情", notes = "传入taskBailReportingEvent") |
| | | public R<TaskBailReportingEventVO> detail(TaskBailReportingEventEntity taskBailReportingEvent) { |
| | | bladeLogger.info("取保候审任务 详情", JsonUtil.toJson(taskBailReportingEvent)); |
| | | TaskBailReportingEventEntity detail = taskBailReportingEventService.getOne(Condition.getQueryWrapper(taskBailReportingEvent)); |
| | | return R.data(TaskBailReportingEventWrapper.build().entityVO(detail)); |
| | | TaskBailReportingEventVO copy = BeanUtil.copy(detail, TaskBailReportingEventVO.class); |
| | | return R.data(copy); |
| | | } |
| | | /** |
| | | * 取保候审任务 分页 |
| | |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiLog("取保候审任务 自定义分页") |
| | | @ApiOperation(value = "分页", notes = "传入taskBailReportingEvent") |
| | | public R<IPage<TaskBailReportingEventVO>> page(TaskBailReportingEventVO taskBailReportingEvent, Query query) { |
| | | bladeLogger.info("取保候审任务 自定义分页", JsonUtil.toJson(taskBailReportingEvent)); |
| | | IPage<TaskBailReportingEventVO> pages = taskBailReportingEventService.selectTaskBailReportingEventPage(Condition.getPage(query), taskBailReportingEvent); |
| | | return R.data(pages); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiLog("取保候审任务 新增") |
| | | @ApiOperation(value = "新增", notes = "传入taskBailReportingEvent") |
| | | public R save(@Valid @RequestBody TaskBailReportingEventEntity taskBailReportingEvent) { |
| | | public R save(@Valid @RequestBody TaskBailReportingEventDTO taskBailReportingEvent) { |
| | | bladeLogger.info("取保候审任务 新增", JsonUtil.toJson(taskBailReportingEvent)); |
| | | return R.status(taskBailReportingEventService.saveBailReporting(taskBailReportingEvent)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiLog("取保候审任务 修改") |
| | | @ApiOperation(value = "修改", notes = "传入taskBailReportingEvent") |
| | | public R update(@Valid @RequestBody TaskBailReportingEventEntity taskBailReportingEvent) { |
| | | public R update(@Valid @RequestBody TaskBailReportingEventEntity taskBailReportingEvent) throws Exception { |
| | | bladeLogger.info("取保候审任务 修改", JsonUtil.toJson(taskBailReportingEvent)); |
| | | return R.status(taskBailReportingEventService.updateBailReporting(taskBailReportingEvent)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiLog("取保候审任务 新增或修改") |
| | | @ApiOperation(value = "新增或修改", notes = "传入taskBailReportingEvent") |
| | | public R submit(@Valid @RequestBody TaskBailReportingEventEntity taskBailReportingEvent) { |
| | | bladeLogger.info("取保候审任务 新增或修改", JsonUtil.toJson(taskBailReportingEvent)); |
| | | return R.status(taskBailReportingEventService.saveOrUpdate(taskBailReportingEvent)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiLog("取保候审任务 删除") |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | bladeLogger.info("取保候审任务 删除", JsonUtil.toJson(ids)); |
| | | return R.status(taskBailReportingEventService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |