|
@@ -0,0 +1,105 @@
|
|
|
+package cn.ezhizao.project.business.invoice.controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import cn.ezhizao.project.business.invoice.domain.BizInvoice;
|
|
|
+import cn.ezhizao.project.business.invoice.service.IBizInvoiceService;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+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 cn.ezhizao.framework.aspectj.lang.annotation.Log;
|
|
|
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
|
|
|
+import cn.ezhizao.framework.web.controller.BaseController;
|
|
|
+import cn.ezhizao.framework.web.domain.AjaxResult;
|
|
|
+import cn.ezhizao.common.utils.poi.ExcelUtil;
|
|
|
+import cn.ezhizao.framework.web.page.TableDataInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 开票管理Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2024-08-23
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/business/invoice")
|
|
|
+public class BizInvoiceController extends BaseController
|
|
|
+{
|
|
|
+ @Resource
|
|
|
+ private IBizInvoiceService bizInvoiceService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询开票管理列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:invoice:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(BizInvoice bizInvoice) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<BizInvoice> list = bizInvoiceService.getList(bizInvoice);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出开票管理列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:invoice:export')")
|
|
|
+ @Log(title = "开票管理", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, BizInvoice bizInvoice) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ List<BizInvoice> list = bizInvoiceService.getList(bizInvoice);
|
|
|
+ ExcelUtil<BizInvoice> util = new ExcelUtil<BizInvoice>(BizInvoice.class);
|
|
|
+ util.exportExcel(response, list, "开票管理数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取开票管理详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:invoice:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
+ {
|
|
|
+ return success(bizInvoiceService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增开票管理
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:invoice:add')")
|
|
|
+ @Log(title = "开票管理", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody BizInvoice bizInvoice) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ return toAjax(bizInvoiceService.save(bizInvoice));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改开票管理
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:invoice:edit')")
|
|
|
+ @Log(title = "开票管理", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody BizInvoice bizInvoice) throws NoSuchFieldException, IllegalAccessException
|
|
|
+ {
|
|
|
+ return toAjax(bizInvoiceService.updateById(bizInvoice));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除开票管理
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('business:invoice:remove')")
|
|
|
+ @Log(title = "开票管理", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable List<Long> ids)
|
|
|
+ {
|
|
|
+ return toAjax(bizInvoiceService.removeBatchByIds(ids));
|
|
|
+ }
|
|
|
+}
|