package com.ruoyi.web.controller.project; 
 | 
  
 | 
import java.util.Arrays; 
 | 
import java.util.List; 
 | 
  
 | 
import com.ruoyi.common.annotation.NotRepeatCommit; 
 | 
import io.swagger.annotations.Api; 
 | 
import io.swagger.annotations.ApiOperation; 
 | 
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.annotation.RepeatSubmit; 
 | 
import com.ruoyi.common.core.controller.BaseController; 
 | 
import com.ruoyi.common.core.domain.AjaxResult; 
 | 
import com.ruoyi.common.enums.BusinessType; 
 | 
import com.ruoyi.project.domain.ServiceExpertexpense; 
 | 
import com.ruoyi.project.service.IServiceExpertexpenseService; 
 | 
import com.ruoyi.common.utils.poi.ExcelUtil; 
 | 
import com.ruoyi.common.core.page.TableDataInfo; 
 | 
  
 | 
/** 
 | 
 * 费用申请主Controller 
 | 
 *  
 | 
 * @author ruoyi 
 | 
 * @date 2022-03-01 
 | 
 */ 
 | 
@Api("费用申请主") 
 | 
@RestController 
 | 
@RequestMapping("/system/expertexpense") 
 | 
public class ServiceExpertexpenseController extends BaseController 
 | 
{ 
 | 
    @Autowired 
 | 
    private IServiceExpertexpenseService serviceExpertexpenseService; 
 | 
  
 | 
    /** 
 | 
     * 查询费用申请主列表 
 | 
     */ 
 | 
    @ApiOperation("查询费用申请主列表") 
 | 
    @GetMapping("/list") 
 | 
    public TableDataInfo list(ServiceExpertexpense serviceExpertexpense) 
 | 
    { 
 | 
        startPage(); 
 | 
        List<ServiceExpertexpense> list = serviceExpertexpenseService.queryList(serviceExpertexpense); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出费用申请主列表 
 | 
     */ 
 | 
    @ApiOperation("导出费用申请主列表") 
 | 
    @Log(title = "费用申请主", businessType = BusinessType.EXPORT) 
 | 
    @GetMapping("/export") 
 | 
    public AjaxResult export(ServiceExpertexpense serviceExpertexpense) 
 | 
    { 
 | 
        List<ServiceExpertexpense> list = serviceExpertexpenseService.queryList(serviceExpertexpense); 
 | 
        ExcelUtil<ServiceExpertexpense> util = new ExcelUtil<ServiceExpertexpense>(ServiceExpertexpense.class); 
 | 
        return util.exportExcel(list, "费用申请主数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取费用申请主详细信息 
 | 
     */ 
 | 
    @ApiOperation("获取费用申请主详细信息") 
 | 
    @GetMapping(value = "/{id}") 
 | 
    public AjaxResult getInfo(@PathVariable("id") Long id) 
 | 
    { 
 | 
        return AjaxResult.success(serviceExpertexpenseService.getById(id)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增费用申请主 
 | 
     */ 
 | 
    @ApiOperation("新增费用申请主") 
 | 
    @Log(title = "费用申请主", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("/add") 
 | 
    @NotRepeatCommit(key = "param:arg[1]", value = 30000) 
 | 
    public AjaxResult add(@RequestBody ServiceExpertexpense serviceExpertexpense) 
 | 
    { 
 | 
        boolean save = serviceExpertexpenseService.save(serviceExpertexpense); 
 | 
        return AjaxResult.success(serviceExpertexpense); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改费用申请主 
 | 
     */ 
 | 
    @ApiOperation("修改费用申请主") 
 | 
    @Log(title = "费用申请主", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    @RepeatSubmit     
 | 
    public AjaxResult edit(@RequestBody ServiceExpertexpense serviceExpertexpense) 
 | 
    { 
 | 
        return toAjax(serviceExpertexpenseService.updateById(serviceExpertexpense)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除费用申请主 
 | 
     */ 
 | 
    @ApiOperation("删除费用申请主") 
 | 
    @Log(title = "费用申请主", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{ids}") 
 | 
    public AjaxResult remove(@PathVariable Long[] ids) 
 | 
    { 
 | 
        return toAjax(serviceExpertexpenseService.removeByIds(Arrays.asList(ids))); 
 | 
    } 
 | 
} 
 |