PmsChangeController.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package com.goldenwater.web.controller.pms;
  2. import com.goldenwater.slgc.entity.pms.PmsChange;
  3. import com.goldenwater.slgc.service.pms.IPmsChangeService;
  4. import com.goldenwater.common.core.controller.BaseController;
  5. import com.goldenwater.common.core.domain.AjaxResult;
  6. import com.goldenwater.common.core.page.TableDataInfo;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.*;
  9. import com.goldenwater.common.annotation.Log;
  10. import com.goldenwater.common.enums.BusinessType;
  11. import org.springframework.validation.annotation.Validated;
  12. import io.swagger.v3.oas.annotations.Operation;
  13. import io.swagger.v3.oas.annotations.Parameter;
  14. import io.swagger.v3.oas.annotations.tags.Tag;
  15. import java.util.List;
  16. @Tag(name = "02.06 项目管理-变更", description = "变更管理相关接口")
  17. @RestController
  18. @Validated
  19. @RequestMapping("/pms/change")
  20. public class PmsChangeController extends BaseController {
  21. @Autowired
  22. private IPmsChangeService pmsChangeService;
  23. /**
  24. * 查询变更列表
  25. */
  26. @Operation(summary = "查询变更列表")
  27. @GetMapping("/list")
  28. public TableDataInfo list(@Parameter(description = "变更查询条件") PmsChange change) {
  29. startPage();
  30. List<PmsChange> list = pmsChangeService.selectList(change);
  31. return getDataTable(list);
  32. }
  33. /**
  34. * 获取变更详细信息
  35. */
  36. @Operation(summary = "获取变更详细信息")
  37. @GetMapping("/{id}")
  38. public AjaxResult getInfo(@Parameter(description = "变更ID") @PathVariable Long id) {
  39. return success(pmsChangeService.selectById(id));
  40. }
  41. /**
  42. * 新增变更
  43. */
  44. @Operation(summary = "新增变更")
  45. @Log(title = "变更管理", businessType = BusinessType.INSERT)
  46. @PostMapping
  47. public AjaxResult add(@Parameter(description = "变更信息") @RequestBody PmsChange change) {
  48. return toAjax(pmsChangeService.insert(change));
  49. }
  50. /**
  51. * 修改变更
  52. */
  53. @Operation(summary = "修改变更")
  54. @Log(title = "变更管理", businessType = BusinessType.UPDATE)
  55. @PutMapping
  56. public AjaxResult edit(@Parameter(description = "变更信息") @RequestBody PmsChange change) {
  57. return toAjax(pmsChangeService.update(change));
  58. }
  59. /**
  60. * 删除变更
  61. */
  62. @Operation(summary = "删除变更")
  63. @Log(title = "变更管理", businessType = BusinessType.DELETE)
  64. @DeleteMapping("/{ids}")
  65. public AjaxResult remove(@Parameter(description = "变更ID数组") @PathVariable Long[] ids) {
  66. return toAjax(pmsChangeService.deleteByIds(ids));
  67. }
  68. }