BusJcebGjsfxController.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. package com.railway.business.catenary.controller;
  2. import com.railway.business.catenary.domain.BusJcebGjsfx;
  3. import com.railway.business.catenary.domain.vo.JcebQueryVo;
  4. import com.railway.business.catenary.service.IBusJcebGjsfxService;
  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 java.util.List;
  12. import javax.validation.Valid;
  13. import org.springframework.validation.annotation.Validated;
  14. import org.springframework.web.bind.annotation.DeleteMapping;
  15. import org.springframework.web.bind.annotation.GetMapping;
  16. import org.springframework.web.bind.annotation.PathVariable;
  17. import org.springframework.web.bind.annotation.PostMapping;
  18. import org.springframework.web.bind.annotation.PutMapping;
  19. import org.springframework.web.bind.annotation.RequestBody;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.web.bind.annotation.RestController;
  22. /**
  23. * @author wuhonghao
  24. */
  25. @Api(value = "rest/catenary/bus/jceb/gjsfx", tags = "检测表 - 关节式分相 ")
  26. @RestController
  27. @Validated
  28. @RequestMapping(value = "business/catenary/bus/jceb/gjsfx")
  29. public class BusJcebGjsfxController extends BaseController {
  30. private final IBusJcebGjsfxService busJcebGjsfxService;
  31. private final ISysFileService sysFileService;
  32. public BusJcebGjsfxController(IBusJcebGjsfxService busJcebGjsfxService,
  33. ISysFileService sysFileService) {
  34. this.busJcebGjsfxService = busJcebGjsfxService;
  35. this.sysFileService = sysFileService;
  36. }
  37. @ApiOperation(value = "新增")
  38. @PostMapping("/add")
  39. public AjaxResult add(@Validated @RequestBody BusJcebGjsfx busJcebGjsfx) {
  40. return toAjax(busJcebGjsfxService.create(busJcebGjsfx));
  41. }
  42. @ApiOperation(value = "删除")
  43. @DeleteMapping("/{ids}")
  44. public AjaxResult delete(@PathVariable(value = "ids") Long[] ids) {
  45. return toAjax(busJcebGjsfxService.delete(ids));
  46. }
  47. @ApiOperation(value = "更新")
  48. @PutMapping("/update")
  49. public AjaxResult update(@RequestBody @Valid BusJcebGjsfx busJcebGjsfx) {
  50. return toAjax(busJcebGjsfxService.update(busJcebGjsfx));
  51. }
  52. @ApiOperation(value = "单个")
  53. @GetMapping(value = {"/", "/{id}"})
  54. public AjaxResult getInfo(Long id) {
  55. BusJcebGjsfx info = busJcebGjsfxService.getInfo(id);
  56. AjaxResult ajax = AjaxResult.success();
  57. ajax.put("info", info);
  58. return ajax;
  59. }
  60. @ApiOperation(value = "列表")
  61. @GetMapping(value = "list")
  62. public TableDataInfo getList(BusJcebGjsfx busJcebGjsfx) {
  63. startPage();
  64. List<BusJcebGjsfx> list = busJcebGjsfxService.getList(busJcebGjsfx);
  65. return getDataTable(list);
  66. }
  67. @ApiOperation(value = "提交")
  68. @PutMapping("/submit")
  69. public AjaxResult submit(@RequestBody BusJcebGjsfx busJcebGjsfx) {
  70. return toAjax(busJcebGjsfxService.submit(busJcebGjsfx));
  71. }
  72. @ApiOperation(value = "退回")
  73. @PutMapping("/reject")
  74. public AjaxResult reject(@RequestBody BusJcebGjsfx busJcebGjsfx) {
  75. return toAjax(busJcebGjsfxService.reject(busJcebGjsfx));
  76. }
  77. @ApiOperation(value = "确认")
  78. @PutMapping("/confirm")
  79. public AjaxResult confirm(@RequestBody BusJcebGjsfx busJcebGjsfx) {
  80. return toAjax(busJcebGjsfxService.confirm(busJcebGjsfx));
  81. }
  82. @ApiOperation(value = "导出excel")
  83. @GetMapping(value = "exportExcel")
  84. public AjaxResult exportExcel(JcebQueryVo query) {
  85. String localFilePath = busJcebGjsfxService.exportExcel(query);
  86. return sysFileService.uploadFile(localFilePath);
  87. }
  88. }