package com.ruoyi.web.controller.project; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.RepeatSubmit; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.project.domain.ServiceFundShared; import com.ruoyi.project.service.IServiceFundSharedService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.Arrays; import java.util.List; /** * 费用申请主Controller * * @author ruoyi * @date 2023-03-27 */ @Api("费用申请主") @RestController @RequestMapping("/system/shared") public class ServiceFundSharedController extends BaseController { @Autowired private IServiceFundSharedService serviceFundSharedService; /** * 查询费用申请主列表 */ @ApiOperation("查询费用申请主列表") // @PreAuthorize("@ss.hasPermi('system:shared:list')") @GetMapping("/list") public TableDataInfo list(ServiceFundShared serviceFundShared) { startPage(); List list = serviceFundSharedService.queryList(serviceFundShared); return getDataTable(list); } /** * 导出费用申请主列表 */ @ApiOperation("导出费用申请主列表") // @PreAuthorize("@ss.hasPermi('system:shared:export')") @Log(title = "费用申请主", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(ServiceFundShared serviceFundShared) { List list = serviceFundSharedService.queryList(serviceFundShared); ExcelUtil util = new ExcelUtil(ServiceFundShared.class); return util.exportExcel(list, "费用申请主数据"); } /** * 获取费用申请主详细信息 */ @ApiOperation("获取费用申请主详细信息") // @PreAuthorize("@ss.hasPermi('system:shared:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(serviceFundSharedService.getById(id)); } /** * 新增费用申请主 */ @ApiOperation("新增费用申请主") // @PreAuthorize("@ss.hasPermi('system:shared:add')") @Log(title = "费用申请主", businessType = BusinessType.INSERT) @PostMapping("/add") @RepeatSubmit public AjaxResult add(@RequestBody ServiceFundShared serviceFundShared) { boolean save = serviceFundSharedService.save(serviceFundShared); return AjaxResult.success(serviceFundShared); } /** * 修改费用申请主 */ @ApiOperation("修改费用申请主") // @PreAuthorize("@ss.hasPermi('system:shared:edit')") @Log(title = "费用申请主", businessType = BusinessType.UPDATE) @PutMapping @RepeatSubmit public AjaxResult edit(@RequestBody ServiceFundShared serviceFundShared) { return toAjax(serviceFundSharedService.updateById(serviceFundShared)); } /** * 删除费用申请主 */ @ApiOperation("删除费用申请主") // @PreAuthorize("@ss.hasPermi('system:shared:remove')") @Log(title = "费用申请主", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceFundSharedService.removeByIds(Arrays.asList(ids))); } }