| | |
| | | package com.sinata.web.controller.backend; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.dto.MwCollectRecordDTO; |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | | import com.sinata.system.domain.vo.MedicalWasteProcessVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.service.MwCollectRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @Api(tags = {"医废管理相关接口"}) |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/backend/mwCollectRecord") |
| | | public class MwCollectRecordController { |
| | | private final MwCollectRecordService collectRecordService; |
| | | |
| | | /** |
| | | * 医废追溯分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("医废追溯分页列表") |
| | | public R<PageDTO<MwCollectRecordVO>> pageList(@Valid @RequestBody MwCollectRecordQuery query) { |
| | | return R.ok(collectRecordService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 医废追溯详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation("医废追溯详情") |
| | | public R<MwCollectRecordVO> detail(@ApiParam(name = "id", value = "医废追溯id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(collectRecordService.detail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperation("编辑") |
| | | public R<?> edit(@Valid @RequestBody MwCollectRecordDTO dto) { |
| | | collectRecordService.edit(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | public R<?> remove(@ApiParam(name = "id", value = "医废追溯id", required = true) @PathVariable("id") Long id) { |
| | | collectRecordService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 流转过程 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/process/{id}") |
| | | @ApiOperation("流转过程") |
| | | public R<MedicalWasteProcessVO> getProcess(@ApiParam(name = "id", value = "医废追溯id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(collectRecordService.getProcess(id)); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | * |
| | | * @param query |
| | | * @param response |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("导出") |
| | | public void export(@RequestBody MwCollectRecordQuery query, HttpServletResponse response) { |
| | | try { |
| | | collectRecordService.export(query, response); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |