package com.ruoyi.app.patrolplan.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpointRecord; import com.ruoyi.app.patrolplan.service.IArdAppPatrolpointRecordService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * app巡检计划记录Controller * * @author ard * @date 2023-08-02 */ @RestController @RequestMapping("/app/patrolpointRecord") public class ArdAppPatrolpointRecordController extends BaseController { @Autowired private IArdAppPatrolpointRecordService ardAppPatrolpointRecordService; /** * 查询app巡检计划记录列表 */ @PreAuthorize("@ss.hasPermi('app:patrolpointRecord:list')") @GetMapping("/list") public TableDataInfo list(ArdAppPatrolpointRecord ardAppPatrolpointRecord) { startPage(); List list = ardAppPatrolpointRecordService.selectArdAppPatrolpointRecordList(ardAppPatrolpointRecord); return getDataTable(list); } /** * 导出app巡检计划记录列表 */ @PreAuthorize("@ss.hasPermi('app:patrolpointRecord:export')") @Log(title = "app巡检计划记录", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ArdAppPatrolpointRecord ardAppPatrolpointRecord) { List list = ardAppPatrolpointRecordService.selectArdAppPatrolpointRecordList(ardAppPatrolpointRecord); ExcelUtil util = new ExcelUtil(ArdAppPatrolpointRecord.class); util.exportExcel(response, list, "app巡检计划记录数据"); } /** * 获取app巡检计划记录详细信息 */ @PreAuthorize("@ss.hasPermi('app:patrolpointRecord:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(ardAppPatrolpointRecordService.selectArdAppPatrolpointRecordById(id)); } /** * 新增app巡检计划记录 */ @PreAuthorize("@ss.hasPermi('app:patrolpointRecord:add')") @Log(title = "app巡检计划记录", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ArdAppPatrolpointRecord ardAppPatrolpointRecord) { return toAjax(ardAppPatrolpointRecordService.insertArdAppPatrolpointRecord(ardAppPatrolpointRecord)); } /** * 修改app巡检计划记录 */ @PreAuthorize("@ss.hasPermi('app:patrolpointRecord:edit')") @Log(title = "app巡检计划记录", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ArdAppPatrolpointRecord ardAppPatrolpointRecord) { return toAjax(ardAppPatrolpointRecordService.updateArdAppPatrolpointRecord(ardAppPatrolpointRecord)); } /** * 删除app巡检计划记录 */ @PreAuthorize("@ss.hasPermi('app:patrolpointRecord:remove')") @Log(title = "app巡检计划记录", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(ardAppPatrolpointRecordService.deleteArdAppPatrolpointRecordByIds(ids)); } }