package com.aps.core.controller.basicData;
|
|
import com.aps.common.core.utils.poi.ExcelUtil;
|
import com.aps.common.core.web.controller.BaseController;
|
import com.aps.common.core.web.domain.AjaxResult;
|
import com.aps.common.core.web.page.TableDataInfo;
|
import com.aps.common.log.annotation.Log;
|
import com.aps.common.log.enums.BusinessType;
|
import com.aps.common.security.annotation.RequiresPermissions;
|
import com.aps.core.domain.ApsWorkEvent;
|
import com.aps.core.service.IApsWorkEventService;
|
import jakarta.servlet.http.HttpServletResponse;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
/**
|
* 事件管理Controller
|
*
|
* @author hjy
|
* @date 2025-04-21
|
*/
|
@RestController
|
@RequestMapping("/event")
|
public class ApsWorkEventController extends BaseController
|
{
|
@Autowired
|
private IApsWorkEventService apsWorkEventService;
|
|
/**
|
* 查询事件管理列表
|
*/
|
@RequiresPermissions("basicData:event:list")
|
@GetMapping("/list")
|
public TableDataInfo list(ApsWorkEvent apsWorkEvent)
|
{
|
startPage();
|
List<ApsWorkEvent> list = apsWorkEventService.selectApsWorkEventList(apsWorkEvent);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出事件管理列表
|
*/
|
@RequiresPermissions("basicData:event:export")
|
@Log(title = "事件管理", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, ApsWorkEvent apsWorkEvent)
|
{
|
List<ApsWorkEvent> list = apsWorkEventService.selectApsWorkEventList(apsWorkEvent);
|
ExcelUtil<ApsWorkEvent> util = new ExcelUtil<ApsWorkEvent>(ApsWorkEvent.class);
|
util.exportExcel(response, list, "事件管理数据");
|
}
|
|
/**
|
* 获取事件管理详细信息
|
*/
|
@RequiresPermissions("basicData:event:query")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
{
|
return success(apsWorkEventService.selectApsWorkEventById(id));
|
}
|
|
/**
|
* 新增事件管理
|
*/
|
@RequiresPermissions("basicData:event:add")
|
@Log(title = "事件管理", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody ApsWorkEvent apsWorkEvent)
|
{
|
return toAjax(apsWorkEventService.insertApsWorkEvent(apsWorkEvent));
|
}
|
|
/**
|
* 修改事件管理
|
*/
|
@RequiresPermissions("basicData:event:edit")
|
@Log(title = "事件管理", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody ApsWorkEvent apsWorkEvent)
|
{
|
return toAjax(apsWorkEventService.updateApsWorkEvent(apsWorkEvent));
|
}
|
|
/**
|
* 删除事件管理
|
*/
|
@RequiresPermissions("basicData:event:remove")
|
@Log(title = "事件管理", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable Long[] ids)
|
{
|
return toAjax(apsWorkEventService.deleteApsWorkEventByIds(ids));
|
}
|
}
|