PropertyRepairController.java 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.ruoyi.web.controller.propertyRepair;
  2. import com.ruoyi.common.annotation.Log;
  3. import com.ruoyi.common.core.controller.BaseController;
  4. import com.ruoyi.common.core.domain.AjaxResult;
  5. import com.ruoyi.common.core.page.TableDataInfo;
  6. import com.ruoyi.common.enums.BusinessType;
  7. import com.ruoyi.common.utils.poi.ExcelUtil;
  8. import com.ruoyi.system.domain.propertyRepair.PropertyRepair;
  9. import com.ruoyi.system.service.IPropertyRepairService;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.security.access.prepost.PreAuthorize;
  12. import org.springframework.web.bind.annotation.*;
  13. import javax.servlet.http.HttpServletResponse;
  14. import java.util.List;
  15. /**
  16. * 物业报修Controller
  17. *
  18. * @author boman
  19. * @date 2025-02-14
  20. */
  21. @RestController
  22. @RequestMapping("/wuYe/repair")
  23. public class PropertyRepairController extends BaseController
  24. {
  25. @Autowired
  26. private IPropertyRepairService propertyRepairService;
  27. /**
  28. * 查询物业报修列表
  29. */
  30. @PreAuthorize("@ss.hasPermi('wuYe:repair:list')")
  31. @GetMapping("/list")
  32. public TableDataInfo list(PropertyRepair propertyRepair)
  33. {
  34. startPage();
  35. List<PropertyRepair> list = propertyRepairService.selectPropertyRepairList(propertyRepair);
  36. return getDataTable(list);
  37. }
  38. /**
  39. * 导出物业报修列表
  40. */
  41. @PreAuthorize("@ss.hasPermi('wuYe:repair:export')")
  42. @Log(title = "物业报修", businessType = BusinessType.EXPORT)
  43. @PostMapping("/export")
  44. public void export(HttpServletResponse response, PropertyRepair propertyRepair)
  45. {
  46. List<PropertyRepair> list = propertyRepairService.selectPropertyRepairList(propertyRepair);
  47. ExcelUtil<PropertyRepair> util = new ExcelUtil<PropertyRepair>(PropertyRepair.class);
  48. util.exportExcel(response, list, "物业报修数据");
  49. }
  50. /**
  51. * 获取物业报修详细信息
  52. */
  53. @PreAuthorize("@ss.hasPermi('wuYe:repair:query')")
  54. @GetMapping(value = "/{repairId}")
  55. public AjaxResult getInfo(@PathVariable("repairId") Long repairId)
  56. {
  57. return success(propertyRepairService.selectPropertyRepairByRepairId(repairId));
  58. }
  59. /**
  60. * 新增物业报修
  61. */
  62. @PreAuthorize("@ss.hasPermi('wuYe:repair:add')")
  63. @Log(title = "物业报修", businessType = BusinessType.INSERT)
  64. @PostMapping
  65. public AjaxResult add(@RequestBody PropertyRepair propertyRepair)
  66. {
  67. return toAjax(propertyRepairService.insertPropertyRepair(propertyRepair));
  68. }
  69. /**
  70. * 修改物业报修
  71. */
  72. @PreAuthorize("@ss.hasPermi('wuYe:repair:edit')")
  73. @Log(title = "物业报修", businessType = BusinessType.UPDATE)
  74. @PostMapping("/put")
  75. public AjaxResult edit(@RequestBody PropertyRepair propertyRepair)
  76. {
  77. return toAjax(propertyRepairService.updatePropertyRepair(propertyRepair));
  78. }
  79. /**
  80. * 删除物业报修
  81. */
  82. @PreAuthorize("@ss.hasPermi('wuYe:repair:remove')")
  83. @Log(title = "物业报修", businessType = BusinessType.DELETE)
  84. @GetMapping("/delete/{repairIds}")
  85. public AjaxResult remove(@PathVariable Long[] repairIds)
  86. {
  87. return toAjax(propertyRepairService.deletePropertyRepairByRepairIds(repairIds));
  88. }
  89. }