| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.TInvoiceType; |
| | | import com.ruoyi.other.query.InvoiceTypePageList; |
| | | import com.ruoyi.other.service.TInvoiceTypeService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-invoice-type") |
| | | public class TInvoiceTypeController { |
| | | |
| | | |
| | | @Resource |
| | | private TInvoiceTypeService invoiceTypeService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/pageList") |
| | | @ApiOperation(value = "获取发票类型列表", tags = {"管理后台-发票类型管理"}) |
| | | public AjaxResult<PageInfo<TInvoiceType>> pageList(InvoiceTypePageList pageList){ |
| | | PageInfo<TInvoiceType> pageInfo = invoiceTypeService.pageList(pageList); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/addInvoiceType") |
| | | @ApiOperation(value = "添加发票类型", tags = {"管理后台-发票类型管理"}) |
| | | public AjaxResult addInvoiceType(@RequestBody TInvoiceType invoiceType){ |
| | | invoiceTypeService.save(invoiceType); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getInvoiceTypeInfo/{id}") |
| | | @ApiOperation(value = "获取发票类型详情", tags = {"管理后台-发票类型管理"}) |
| | | public AjaxResult<TInvoiceType> getInvoiceTypeInfo(@PathVariable Integer id){ |
| | | TInvoiceType invoiceType = invoiceTypeService.getById(id); |
| | | return AjaxResult.success(invoiceType); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editInvoiceType") |
| | | @ApiOperation(value = "编辑发票类型", tags = {"管理后台-发票类型管理"}) |
| | | public AjaxResult editInvoiceType(@RequestBody TInvoiceType invoiceType){ |
| | | invoiceTypeService.updateById(invoiceType); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delInvoiceType/{id}") |
| | | @ApiOperation(value = "删除发票类型", tags = {"管理后台-发票类型管理"}) |
| | | public AjaxResult<TInvoiceType> delInvoiceType(@PathVariable Integer[] id){ |
| | | List<TInvoiceType> tInvoiceTypes = invoiceTypeService.listByIds(Arrays.asList(id)); |
| | | for (TInvoiceType invoiceType : tInvoiceTypes) { |
| | | invoiceType.setDelFlag(true); |
| | | invoiceTypeService.updateById(invoiceType); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | | |