PatrolCheckEntryController.java 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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.PatrolCheckEntry;
  5. import com.bizmatics.service.PatrolCheckEntryService;
  6. import com.bizmatics.service.aop.BusinessType;
  7. import com.bizmatics.service.aop.Log;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.*;
  10. import java.util.List;
  11. /**
  12. * 巡检管理-检查条目
  13. *
  14. * @author ya
  15. * @since 2021-10-15
  16. */
  17. @RestController
  18. @RequestMapping("/patrolCheckEntry")
  19. public class PatrolCheckEntryController {
  20. @Autowired
  21. private PatrolCheckEntryService patrolCheckEntryService;
  22. /**
  23. * 巡检管理-检查条目-检查项-新增
  24. *
  25. * @param patrolCheckEntry
  26. * @return
  27. */
  28. @Log(title = "巡检管理-检查条目-检查项", businessType = BusinessType.INSERT)
  29. @PostMapping("patrolCheckEntryAdd")
  30. public ApiResult<Void> patrolCheckEntryAdd(@RequestBody PatrolCheckEntry patrolCheckEntry
  31. ) {
  32. patrolCheckEntryService.patrolCheckEntryAdd(patrolCheckEntry);
  33. return ApiResult.success();
  34. }
  35. /**
  36. * 巡检管理-检查条目-检查项-修改
  37. *
  38. * @param patrolCheckEntry
  39. * @return
  40. */
  41. @Log(title = "巡检管理-检查条目-检查项", businessType = BusinessType.UPDATE)
  42. @PostMapping("patrolCheckEntryUpdate")
  43. public ApiResult<Void> patrolCheckEntryUpdate(@RequestBody PatrolCheckEntry patrolCheckEntry
  44. ) {
  45. patrolCheckEntryService.patrolCheckEntryUpdate(patrolCheckEntry);
  46. return ApiResult.success();
  47. }
  48. /**
  49. * 巡检管理-检查条目-检查项-注销
  50. *
  51. * @param id 检查条目检查项id
  52. * @return
  53. */
  54. @Log(title = "巡检管理-检查条目-检查项", businessType = BusinessType.DELETE)
  55. @GetMapping("patrolCheckEntryDel")
  56. public ApiResult<Void> patrolCheckEntryDel(@RequestParam Integer id
  57. ) {
  58. patrolCheckEntryService.patrolCheckEntryDel(id);
  59. return ApiResult.success();
  60. }
  61. /**
  62. * 巡检管理-检查条目-检查项-检查项列表查询
  63. *
  64. * @param checkEntryName 检查项名称
  65. * @param deviceTypeId 设备类型id
  66. * @param size 页数
  67. * @param current 条数
  68. * @return
  69. */
  70. @GetMapping("patrolCheckEntryList")
  71. public ApiResult<CommonPage<PatrolCheckEntry>> patrolCheckEntryList(@RequestParam(required = false) String checkEntryName,
  72. @RequestParam Integer deviceTypeId,
  73. @RequestParam(value = "size", required = false, defaultValue = "1") Integer size,
  74. @RequestParam(value = "current", required = false, defaultValue = "10") Integer current,
  75. @RequestParam(value = "id", required = false, defaultValue = "0") Integer id
  76. ) {
  77. return ApiResult.success(patrolCheckEntryService.patrolCheckEntryList(checkEntryName, deviceTypeId, size, current, id));
  78. }
  79. /**
  80. * 巡检管理-检查条目-检查项-下拉框
  81. *
  82. * @param deviceTypeId
  83. * @return
  84. */
  85. @GetMapping("patrolCheckEntrydDroplist")
  86. public ApiResult<List<PatrolCheckEntry>> patrolCheckEntrydDroplist(@RequestParam Integer deviceTypeId
  87. ) {
  88. return ApiResult.success(patrolCheckEntryService.patrolCheckEntrydDroplist(deviceTypeId));
  89. }
  90. }