| | |
| | | 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> |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @PostMapping("/page") |
| | | @ApiOperation("医废追溯分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwCollectRecordVO>> pageList(@Valid @RequestBody MwCollectRecordQuery query) { |
| | | return R.ok(collectRecordService.pageList(query)); |
| | | } |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation("医废追溯详情") |
| | | @GetMapping("/detail/{id}") |
| | | 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("编辑") |
| | | @PostMapping("/edit") |
| | | public R<?> edit(@Valid @RequestBody MwCollectRecordDTO dto) { |
| | | collectRecordService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{id}") |
| | | 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("流转过程") |
| | | @GetMapping("/process/{id}") |
| | | 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 |
| | | */ |
| | | @ApiOperation("导出") |
| | | @PostMapping("/export") |
| | | public void export(@RequestBody MwCollectRecordQuery query, HttpServletResponse response) { |
| | | try { |
| | | collectRecordService.export(query, response); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |