| | |
| | | package com.ruoyi.web.controller.project; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | 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.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.BaseFinancesubject; |
| | | import com.ruoyi.project.service.IBaseFinancesubjectService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 收入费用科目Controller |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | * @date 2022-01-11 |
| | | */ |
| | | @Slf4j |
| | | @Api("收入费用科目") |
| | | @RestController |
| | | @RequestMapping("/project/financesubject") |
| | | public class BaseFinancesubjectController extends BaseController |
| | | { |
| | | public class BaseFinancesubjectController extends BaseController { |
| | | @Autowired |
| | | private IBaseFinancesubjectService baseFinancesubjectService; |
| | | |
| | |
| | | * 查询收入费用科目列表 |
| | | */ |
| | | @ApiOperation("查询收入费用科目列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:financesubject:list')") |
| | | //@PreAuthorize("@ss.hasPermi('project::list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(BaseFinancesubject baseFinancesubject) |
| | | { |
| | | public TableDataInfo list(BaseFinancesubject baseFinancesubject) { |
| | | log.info("查询收入费用科目列表{}:", baseFinancesubject); |
| | | startPage(); |
| | | //List<BaseFinancesubject> list = baseFinancesubjectService.queryList(baseFinancesubject);、 |
| | | List<BaseFinancesubject> list = baseFinancesubjectService.selectBaseFinancesubjectList(baseFinancesubject); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:financesubject:export')") |
| | | @Log(title = "收入费用科目", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(BaseFinancesubject baseFinancesubject) |
| | | { |
| | | public AjaxResult export(BaseFinancesubject baseFinancesubject) { |
| | | log.info("导出收入费用科目列表{}:", baseFinancesubject); |
| | | List<BaseFinancesubject> list = baseFinancesubjectService.queryList(baseFinancesubject); |
| | | ExcelUtil<BaseFinancesubject> util = new ExcelUtil<BaseFinancesubject>(BaseFinancesubject.class); |
| | | return util.exportExcel(list, "收入费用科目数据"); |
| | |
| | | @ApiOperation("获取收入费用科目详细信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:financesubject:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | log.info("获取收入费用科目详细信息{}:", id); |
| | | return AjaxResult.success(baseFinancesubjectService.getById(id)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("新增收入费用科目") |
| | | //@PreAuthorize("@ss.hasPermi('project:financesubject:add')") |
| | | @Log(title = "收入费用科目", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @PostMapping("/add") |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody BaseFinancesubject baseFinancesubject) |
| | | { |
| | | return toAjax(baseFinancesubjectService.save(baseFinancesubject)); |
| | | public AjaxResult add(@RequestBody BaseFinancesubject baseFinancesubject) { |
| | | log.info("新增收入费用科目{}:", baseFinancesubject); |
| | | boolean save = baseFinancesubjectService.save(baseFinancesubject); |
| | | log.info("新增收入费用科目baseFinancesubject的ID为:{}", baseFinancesubject.getId()); |
| | | return AjaxResult.success(baseFinancesubject); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("修改收入费用科目") |
| | | //@PreAuthorize("@ss.hasPermi('project:financesubject:edit')") |
| | | @Log(title = "收入费用科目", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody BaseFinancesubject baseFinancesubject) |
| | | { |
| | | @PostMapping("/edit") |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody BaseFinancesubject baseFinancesubject) { |
| | | log.info("修改收入费用科目{}:", baseFinancesubject); |
| | | return toAjax(baseFinancesubjectService.updateById(baseFinancesubject)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("删除收入费用科目") |
| | | //@PreAuthorize("@ss.hasPermi('project:financesubject:remove')") |
| | | @Log(title = "收入费用科目", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | log.info("删除收入费用科目{}:", ids); |
| | | return toAjax(baseFinancesubjectService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @GetMapping(value = "/getItemName/{ItemType}") |
| | | public AjaxResult getItemName(@PathVariable("ItemType") String ItemType){ |
| | | public AjaxResult getItemName(@PathVariable("ItemType") String ItemType) { |
| | | log.info("/getItemName的入参 {}:", ItemType); |
| | | return AjaxResult.success(baseFinancesubjectService.getItemName(ItemType)); |
| | | } |
| | | |
| | | @ApiOperation("获取捐献成本") |
| | | @Log(title = "获取捐献成本", businessType = BusinessType.OTHER) |
| | | @GetMapping(value = "/getDonationCost/{DonorNo}") |
| | | public AjaxResult getDonationCost(@PathVariable("DonorNo") String DonorNo){ |
| | | public AjaxResult getDonationCost(@PathVariable("DonorNo") String DonorNo) { |
| | | log.info("获取捐献成本{}:", DonorNo); |
| | | return AjaxResult.success(baseFinancesubjectService.getDonationCost(DonorNo)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("根据费用大类获取项目类型") |
| | | @Log(title = "根据费用大类获取项目类型", businessType = BusinessType.OTHER) |
| | | @GetMapping("/getbyexpensetype/{ExpenseType}") |
| | | public AjaxResult getByExpenseType(@PathVariable("ExpenseType") String ExpenseType) |
| | | { |
| | | public AjaxResult getByExpenseType(@PathVariable("ExpenseType") String ExpenseType) { |
| | | log.info("根据费用大类获取项目类型{}:", ExpenseType); |
| | | /*BaseFinancesubject baseFinancesubject=new BaseFinancesubject(); |
| | | baseFinancesubject.setExpensetype(ExpenseType); |
| | | List<BaseFinancesubject> list = baseFinancesubjectService.queryList(baseFinancesubject); |
| | |
| | | @ApiOperation("根据费用大类获取项目明细") |
| | | @Log(title = "根据费用大类获取项目明细", businessType = BusinessType.OTHER) |
| | | @GetMapping("/getDetails/{ExpenseType}") |
| | | public AjaxResult getDetails(@PathVariable("ExpenseType") String ExpenseType) |
| | | { |
| | | public AjaxResult getDetails(@PathVariable("ExpenseType") String ExpenseType) { |
| | | log.info("根据费用大类获取项目明细{}:", ExpenseType); |
| | | return AjaxResult.success(baseFinancesubjectService.getDetails(ExpenseType)); |
| | | } |
| | | |