PropertyRepairController.java 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. @Autowired
  25. private IPropertyRepairService propertyRepairService;
  26. /**
  27. * 查询物业报修列表
  28. */
  29. @PreAuthorize("@ss.hasPermi('wuYe:repair:list')")
  30. @GetMapping("/list")
  31. public TableDataInfo list(PropertyRepair propertyRepair) {
  32. startPage();
  33. List<PropertyRepair> list = propertyRepairService.selectPropertyRepairList(propertyRepair);
  34. return getDataTable(list);
  35. }
  36. /**
  37. * 查询我的物业报修列表
  38. */
  39. @PreAuthorize("@ss.hasPermi('wuYe:repair:myList')")
  40. @GetMapping("/myList")
  41. public TableDataInfo myList(PropertyRepair propertyRepair) {
  42. propertyRepair.setStaffId(getUserId());
  43. startPage();
  44. List<PropertyRepair> list = propertyRepairService.selectPropertyRepairList(propertyRepair);
  45. return getDataTable(list);
  46. }
  47. /**
  48. * 导出物业报修列表
  49. */
  50. @PreAuthorize("@ss.hasPermi('wuYe:repair:export')")
  51. @Log(title = "物业报修", businessType = BusinessType.EXPORT)
  52. @PostMapping("/export")
  53. public void export(HttpServletResponse response, PropertyRepair propertyRepair) {
  54. List<PropertyRepair> list = propertyRepairService.selectPropertyRepairList(propertyRepair);
  55. ExcelUtil<PropertyRepair> util = new ExcelUtil<PropertyRepair>(PropertyRepair.class);
  56. util.exportExcel(response, list, "物业报修数据");
  57. }
  58. /**
  59. * 获取物业报修详细信息
  60. */
  61. @PreAuthorize("@ss.hasPermi('wuYe:repair:query')")
  62. @GetMapping(value = "/{repairId}")
  63. public AjaxResult getInfo(@PathVariable("repairId") Long repairId) {
  64. return success(propertyRepairService.selectPropertyRepairByRepairId(repairId));
  65. }
  66. /**
  67. * 新增物业报修
  68. */
  69. @PreAuthorize("@ss.hasPermi('wuYe:repair:add')")
  70. @Log(title = "物业报修", businessType = BusinessType.INSERT)
  71. @PostMapping
  72. public AjaxResult add(@RequestBody PropertyRepair propertyRepair) {
  73. return toAjax(propertyRepairService.insertPropertyRepair(propertyRepair));
  74. }
  75. /**
  76. * 修改物业报修
  77. */
  78. @PreAuthorize("@ss.hasPermi('wuYe:repair:edit')")
  79. @Log(title = "物业报修", businessType = BusinessType.UPDATE)
  80. @PostMapping("/put")
  81. public AjaxResult edit(@RequestBody PropertyRepair propertyRepair) {
  82. return toAjax(propertyRepairService.updatePropertyRepair(propertyRepair));
  83. }
  84. /**
  85. * 删除物业报修
  86. */
  87. @PreAuthorize("@ss.hasPermi('wuYe:repair:remove')")
  88. @Log(title = "物业报修", businessType = BusinessType.DELETE)
  89. @GetMapping("/delete/{repairIds}")
  90. public AjaxResult remove(@PathVariable Long[] repairIds) {
  91. return toAjax(propertyRepairService.deletePropertyRepairByRepairIds(repairIds));
  92. }
  93. /**
  94. * 指派物业报修人员
  95. */
  96. @PreAuthorize("@ss.hasPermi('wuYe:repair:assign')")
  97. @PostMapping("/assign")
  98. public AjaxResult assign(@RequestBody PropertyRepair propertyRepair) {
  99. return propertyRepairService.assign(propertyRepair);
  100. }
  101. /**
  102. * 物业保修一周统计(当前时间往前推7天)
  103. */
  104. @PreAuthorize("@ss.hasPermi('wuYe:repair:statistics:qx')")
  105. @GetMapping("/statistics/qx")
  106. public AjaxResult statisticsQx() {
  107. return propertyRepairService.statisticsQx();
  108. }
  109. }