ly 1 год назад
Родитель
Сommit
ca14b0b09d

+ 105 - 0
src/main/java/cn/ezhizao/project/business/invoice/controller/BizInvoiceController.java

@@ -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));
+    }
+}

+ 108 - 0
src/main/java/cn/ezhizao/project/business/invoice/domain/BizInvoice.java

@@ -0,0 +1,108 @@
+package cn.ezhizao.project.business.invoice.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableName;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+
+/**
+ * 企业租户对象 biz_invoice
+ *
+ * @author ruoyi
+ * @date 2024-08-23
+ */
+@Data
+@TableName(value = "biz_invoice")
+public class BizInvoice extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 发票类型 */
+    @Excel(name = "发票类型")
+    @ApiModelProperty(value = "发票类型")
+    private Integer invoiceType;
+
+    /** 合同id */
+    @ApiModelProperty(value = "发票类型")
+    private Long contractId;
+
+    /** 申请开票金额 */
+    @Excel(name = "申请开票金额")
+    @ApiModelProperty(value = "申请开票金额")
+    private BigDecimal allowInvoiceAmount;
+
+    /** 发票信息 */
+    @Excel(name = "发票信息")
+    @ApiModelProperty(value = "发票信息")
+    private Integer invoiceContent;
+
+    /** 开票方 */
+    @Excel(name = "开票方")
+    @ApiModelProperty(value = "开票方")
+    private String invoiceMy;
+
+    /** 社会信用代码 */
+    @Excel(name = "社会信用代码")
+    @ApiModelProperty(value = "社会信用代码")
+    private String myCreditSocietyCode;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    @ApiModelProperty(value = "地址")
+    private String myAddress;
+
+    /** 账号 */
+    @Excel(name = "账号")
+    @ApiModelProperty(value = "账号")
+    private String myAccount;
+
+    /** 收票方 */
+    @Excel(name = "收票方")
+    @ApiModelProperty(value = "收票方")
+    private String invoiceOther;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String otherCreditSocietyCode;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    @ApiModelProperty(value = "${comment}")
+    private String otherAddress;
+
+    /** 申请人 */
+    @ApiModelProperty(value = "${comment}")
+    private Long applierId;
+
+    /** 申请时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "申请时间")
+    private Date applierTime;
+
+    /** 0-未提交 1-待开票 2-已拒绝  3-已开票 */
+    @Excel(name = "0-未提交 1-待开票 2-已拒绝  3-已开票")
+    @ApiModelProperty(value = "0-未提交 1-待开票 2-已拒绝  3-已开票")
+    private Integer status;
+
+    /** 开票人 */
+    @ApiModelProperty(value = "0-未提交 1-待开票 2-已拒绝  3-已开票")
+    private Long invoiceId;
+
+    /** 开票时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开票时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "开票时间")
+    private Date invoiceTime;
+
+    /** 开票备注 */
+    @Excel(name = "开票备注")
+    @ApiModelProperty(value = "开票备注")
+    private String invoiceRemark;
+
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/invoice/mapper/BizInvoiceMapper.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.invoice.mapper;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.invoice.domain.BizInvoice;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 企业租户Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-08-23
+ */
+public interface BizInvoiceMapper extends BaseMapper<BizInvoice>
+{
+    /**
+     * 查询企业租户列表
+     *
+     * @param bizInvoice 企业租户
+     * @return 企业租户集合
+     */
+    public List<BizInvoice> getList(BizInvoice bizInvoice);
+
+    /**
+     * 物理删除
+     * @param bizInvoice
+     * @return 删除结果
+    */
+    public int physicalDelete(BizInvoice bizInvoice);
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/invoice/service/IBizInvoiceService.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.invoice.service;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.invoice.domain.BizInvoice;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 企业租户Service接口
+ *
+ * @author ruoyi
+ * @date 2024-08-23
+ */
+public interface IBizInvoiceService extends IService<BizInvoice>
+{
+    /**
+     * 查询企业租户列表
+     *
+     * @param bizInvoice 企业租户
+     * @return 企业租户集合
+     */
+    public List<BizInvoice> getList(BizInvoice bizInvoice);
+
+    /**
+     * 物理删除
+     * @param bizInvoice
+     * @return 删除结果
+     */
+    public int physicalDelete(BizInvoice bizInvoice);
+
+}

+ 44 - 0
src/main/java/cn/ezhizao/project/business/invoice/service/impl/BizInvoiceServiceImpl.java

@@ -0,0 +1,44 @@
+package cn.ezhizao.project.business.invoice.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+
+import cn.ezhizao.project.business.invoice.domain.BizInvoice;
+import cn.ezhizao.project.business.invoice.mapper.BizInvoiceMapper;
+import cn.ezhizao.project.business.invoice.service.IBizInvoiceService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 企业租户Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-08-23
+ */
+@Service
+public class BizInvoiceServiceImpl  extends ServiceImpl<BizInvoiceMapper, BizInvoice> implements IBizInvoiceService
+{
+    @Resource
+    private BizInvoiceMapper bizInvoiceMapper;
+
+    /**
+     * 查询企业租户列表
+     *
+     * @param bizInvoice 企业租户
+     * @return 企业租户
+     */
+    @Override
+    public List<BizInvoice> getList(BizInvoice bizInvoice)
+    {
+        return bizInvoiceMapper.getList(bizInvoice);
+    }
+
+    /**
+     * 物理删除
+     * @param bizInvoice
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizInvoice bizInvoice){ return bizInvoiceMapper.physicalDelete(bizInvoice); };
+
+}

+ 42 - 0
src/main/resources/mybatis/business/BizInvoiceMapper.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.ezhizao.project.business.invoice.mapper.BizInvoiceMapper">
+
+    <resultMap type="cn.ezhizao.project.business.invoice.domain.BizInvoice" id="BizInvoiceResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizInvoice" resultMap="BizInvoiceResult">
+        SELECT * FROM biz_invoice
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="invoiceType != null "> AND invoice_type = #{invoiceType}</if>
+            <if test="allowInvoiceAmount != null "> AND allow_invoice_amount = #{allowInvoiceAmount}</if>
+            <if test="invoiceContent != null "> AND invoice_content = #{invoiceContent}</if>
+            <if test="invoiceMy != null  and invoiceMy != ''"> AND invoice_my = #{invoiceMy}</if>
+            <if test="myCreditSocietyCode != null  and myCreditSocietyCode != ''"> AND my_credit_society_code = #{myCreditSocietyCode}</if>
+            <if test="myAddress != null  and myAddress != ''"> AND my_address = #{myAddress}</if>
+            <if test="myAccount != null  and myAccount != ''"> AND my_account = #{myAccount}</if>
+            <if test="invoiceOther != null  and invoiceOther != ''"> AND invoice_other = #{invoiceOther}</if>
+            <if test="otherCreditSocietyCode != null  and otherCreditSocietyCode != ''"> AND other_credit_society_code = #{otherCreditSocietyCode}</if>
+            <if test="otherAddress != null  and otherAddress != ''"> AND other_address = #{otherAddress}</if>
+            <if test="applierTime != null "> AND applier_time = #{applierTime}</if>
+            <if test="status != null "> AND status = #{status}</if>
+            <if test="invoiceTime != null "> AND invoice_time = #{invoiceTime}</if>
+            <if test="invoiceRemark != null  and invoiceRemark != ''"> AND invoice_remark = #{invoiceRemark}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_invoice
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>