BusJcebQmjcjlController.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package com.railway.business.catenary.controller;
  2. import com.railway.business.catenary.domain.BusJcebQmjcjl;
  3. import com.railway.business.catenary.domain.vo.JcebQueryVo;
  4. import com.railway.business.catenary.service.IBusJcebQmjcjlService;
  5. import com.railway.common.core.controller.BaseController;
  6. import com.railway.common.core.domain.AjaxResult;
  7. import com.railway.common.core.page.TableDataInfo;
  8. import com.railway.system.service.ISysFileService;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.springframework.validation.annotation.Validated;
  12. import org.springframework.web.bind.annotation.*;
  13. import javax.validation.Valid;
  14. import java.util.List;
  15. /**
  16. * @author fenghao
  17. */
  18. @Api(value = "rest/catenary/bus/jceb/qmjcjl", tags = "检测表 - 全面检查记录")
  19. @RestController
  20. @Validated
  21. @RequestMapping(value = "business/catenary/bus/jceb/qmjcjl")
  22. public class BusJcebQmjcjlController extends BaseController {
  23. private final IBusJcebQmjcjlService busJcbQmjcjlService;
  24. private final ISysFileService sysFileService;
  25. public BusJcebQmjcjlController(IBusJcebQmjcjlService busJcbQmjcjlService,
  26. ISysFileService sysFileService) {
  27. this.busJcbQmjcjlService = busJcbQmjcjlService;
  28. this.sysFileService = sysFileService;
  29. }
  30. @ApiOperation(value = "新增")
  31. @PostMapping("/add")
  32. public AjaxResult add(@Validated @RequestBody BusJcebQmjcjl busJcebQmjcjl) {
  33. return toAjax(busJcbQmjcjlService.create(busJcebQmjcjl));
  34. }
  35. @ApiOperation(value = "删除")
  36. @DeleteMapping("/{ids}")
  37. public AjaxResult delete(@PathVariable(value = "ids") Long[] ids) {
  38. return toAjax(busJcbQmjcjlService.delete(ids));
  39. }
  40. @ApiOperation(value = "更新")
  41. @PutMapping("/update")
  42. public AjaxResult update(@RequestBody @Valid BusJcebQmjcjl busJcebQmjcjl) {
  43. return toAjax(busJcbQmjcjlService.update(busJcebQmjcjl));
  44. }
  45. @ApiOperation(value = "单个")
  46. @GetMapping(value = {"/", "/{id}"})
  47. public AjaxResult getInfo(@PathVariable(value = "id") Long id) {
  48. BusJcebQmjcjl info = busJcbQmjcjlService.getInfo(id);
  49. AjaxResult ajax = AjaxResult.success();
  50. ajax.put("info", info);
  51. return ajax;
  52. }
  53. @ApiOperation(value = "列表")
  54. @GetMapping(value = "list")
  55. public TableDataInfo getList(BusJcebQmjcjl busJcebQmjcjl) {
  56. startPage();
  57. List<BusJcebQmjcjl> list = busJcbQmjcjlService.getList(busJcebQmjcjl);
  58. return getDataTable(list);
  59. }
  60. @ApiOperation(value = "导出excel")
  61. @GetMapping(value = "exportExcel")
  62. public AjaxResult exportExcel(JcebQueryVo query) {
  63. String localFilePath = busJcbQmjcjlService.exportExcel(query);
  64. return sysFileService.uploadFile(localFilePath);
  65. }
  66. @ApiOperation(value = "提交")
  67. @PutMapping("/submit")
  68. public AjaxResult submit(@RequestBody BusJcebQmjcjl busJcebQmjcjl) {
  69. return toAjax(busJcbQmjcjlService.submit(busJcebQmjcjl));
  70. }
  71. @ApiOperation(value = "退回")
  72. @PutMapping("/reject")
  73. public AjaxResult reject(@RequestBody BusJcebQmjcjl busJcebQmjcjl) {
  74. return toAjax(busJcbQmjcjlService.reject(busJcebQmjcjl));
  75. }
  76. @ApiOperation(value = "确认")
  77. @PutMapping("/confirm")
  78. public AjaxResult confirm(@RequestBody BusJcebQmjcjl busJcebQmjcjl) {
  79. return toAjax(busJcbQmjcjlService.confirm(busJcebQmjcjl));
  80. }
  81. }