PatrolInspectionSchemeController.java 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. package com.bizmatics.controller.web;
  2. import com.bizmatics.common.core.bean.ApiResult;
  3. import com.bizmatics.common.core.bean.CommonPage;
  4. import com.bizmatics.model.PatrolInspectionContent;
  5. import com.bizmatics.model.PatrolInspectionScheme;
  6. import com.bizmatics.model.vo.PatrolCheckEntryVo;
  7. import com.bizmatics.model.vo.PatrolInspectionSchemeListVo;
  8. import com.bizmatics.model.vo.PatrolInspectionSchemeOneVo;
  9. import com.bizmatics.model.vo.PatrolInspectionSchemeVo;
  10. import com.bizmatics.service.PatrolInspectionSchemeService;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.*;
  13. import java.util.List;
  14. /**
  15. * 巡检管理-巡检计划
  16. *
  17. * @author ya
  18. * @since 2021-10-18
  19. */
  20. @RestController
  21. @RequestMapping("/patrolInspectionScheme")
  22. public class PatrolInspectionSchemeController {
  23. @Autowired
  24. private PatrolInspectionSchemeService patrolInspectionSchemeService;
  25. /**
  26. * 巡检管理-巡检计划-计划新增
  27. *
  28. * @param patrolInspectionSchemeVo
  29. * @return
  30. */
  31. @PostMapping("patrolInspectionSchemeAdd")
  32. public ApiResult<Void> patrolInspectionSchemeAdd(@RequestBody PatrolInspectionSchemeVo patrolInspectionSchemeVo
  33. ) {
  34. patrolInspectionSchemeService.patrolInspectionSchemeAdd(patrolInspectionSchemeVo);
  35. return ApiResult.success();
  36. }
  37. /**
  38. * 巡检管理-巡检计划-计划修改
  39. *
  40. * @param patrolInspectionSchemeVo
  41. * @return
  42. */
  43. @PostMapping("patrolInspectionSchemeUpdate")
  44. public ApiResult<Void> patrolInspectionSchemeUpdate(@RequestBody PatrolInspectionSchemeVo patrolInspectionSchemeVo
  45. ) {
  46. patrolInspectionSchemeService.patrolInspectionSchemeUpdate(patrolInspectionSchemeVo);
  47. return ApiResult.success();
  48. }
  49. /**
  50. * 巡检管理-巡检计划-计划暂停
  51. *
  52. * @param id
  53. * @return
  54. */
  55. @GetMapping("patrolInspectionSchemeDel")
  56. public ApiResult<Void> patrolInspectionSchemeDel(@RequestParam Integer id
  57. ) {
  58. patrolInspectionSchemeService.patrolInspectionSchemeDel(id);
  59. return ApiResult.success();
  60. }
  61. /**
  62. * 巡检管理-巡检计划-计划列表查询
  63. *
  64. * @param status 0 暂停 1 启用 2 完成
  65. * @param inspectionSchemeName 巡检名称
  66. * @param size 页数默认 1
  67. * @param current 条数默认15
  68. * @return
  69. */
  70. @GetMapping("patrolInspectionSchemeList")
  71. public ApiResult<CommonPage<PatrolInspectionScheme>> patrolInspectionSchemeList(@RequestParam(value = "status",required = false, defaultValue = "3") Integer status,
  72. @RequestParam(required = false) String inspectionSchemeName,
  73. @RequestParam(value = "size", required = false, defaultValue = "1") Integer size,
  74. @RequestParam(value = "current", required = false, defaultValue = "15") Integer current
  75. ) {
  76. return ApiResult.success(patrolInspectionSchemeService.patrolInspectionSchemeList(inspectionSchemeName, status, size, current));
  77. }
  78. /**
  79. * 巡检管理-巡检计划-修改回显/查看详情
  80. *
  81. * @param id 计划ID
  82. * @return
  83. */
  84. @GetMapping("PatrolInspectionScheme")
  85. public ApiResult<List<PatrolInspectionSchemeOneVo>> PatrolInspectionScheme(@RequestParam Integer id
  86. ) {
  87. return ApiResult.success(patrolInspectionSchemeService.PatrolInspectionScheme(id));
  88. }
  89. /**
  90. * 巡检管理-巡检计划-检查项查看
  91. *
  92. * @param inspectionContentId 巡检内容ID
  93. * @return
  94. */
  95. @GetMapping("checkItemList")
  96. public ApiResult<List<PatrolCheckEntryVo>> checkItemList(@RequestParam Integer inspectionContentId
  97. ) {
  98. return ApiResult.success(patrolInspectionSchemeService.checkItemList(inspectionContentId));
  99. }
  100. /**
  101. * 巡检管理-巡检计划-巡检内容下拉框
  102. *
  103. * @param siteId 站点ID
  104. * @return
  105. */
  106. @GetMapping("patrolInspectionContentDroplist")
  107. public ApiResult<List<PatrolInspectionContent>> patrolInspectionContentDroplist(@RequestParam Integer siteId
  108. ) {
  109. return ApiResult.success(patrolInspectionSchemeService.patrolInspectionContentDroplist(siteId));
  110. }
  111. /**
  112. * 巡检管理-巡检计划-线路注销
  113. *
  114. * @param id 巡检线路ID
  115. * @return
  116. */
  117. @GetMapping("patrolInspectionRouteDel")
  118. public ApiResult<Void> patrolInspectionRouteDel(@RequestParam Integer id
  119. ) {
  120. patrolInspectionSchemeService.patrolInspectionRouteDel(id);
  121. return ApiResult.success();
  122. }
  123. /**
  124. * 巡检管理-巡检计划-计划日历/站点巡检日历数据查询
  125. *
  126. * @param id 计划ID
  127. * @return
  128. */
  129. @GetMapping("patrolInspectionSchemeCalendar")
  130. public ApiResult<List<PatrolInspectionSchemeListVo>> patrolInspectionSchemeCalendar(@RequestParam(value = "id", required = false, defaultValue = "0") Integer id
  131. ) {
  132. return ApiResult.success(patrolInspectionSchemeService.patrolInspectionSchemeCalendar(id));
  133. }
  134. }