Browse Source

[fix]

财务管理 国税发票
修改国税发票列表页面,修改表格字段,添加销售订单号搜索,新增导出方法;
修改人民币、美元发票审核页面,修改发票抬头、类型等单选按钮为可编辑;
修改发票类,添加导出字典注解;
修改发票导出controller方法,实现多选全部导出;
新增根据编号批量查询发票service和mapper方法;
dev
王晓迪 2 months ago
parent
commit
93ac142d80
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java
  2. 10
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java
  3. 4
      ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceMapper.java
  4. 4
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java
  5. 7
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java
  6. 10
      ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml
  7. 6
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRmb.html
  8. 6
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUsd.html
  9. 61
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html

12
ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java

@ -2,12 +2,15 @@ package com.ruoyi.financial.controller;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.financial.domain.FinancialAccountsPayable;
import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial; import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial;
import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService; import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
@ -64,11 +67,18 @@ public class FinancialTaxInvoiceController extends BaseController
@Log(title = "国税发票", businessType = BusinessType.EXPORT) @Log(title = "国税发票", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(FinancialTaxInvoice financialTaxInvoice) public AjaxResult export(FinancialTaxInvoice financialTaxInvoice, String ids)
{ {
if (StringUtils.isEmpty(ids)){
List<FinancialTaxInvoice> list = financialTaxInvoiceService.selectFinancialTaxInvoiceList(financialTaxInvoice); List<FinancialTaxInvoice> list = financialTaxInvoiceService.selectFinancialTaxInvoiceList(financialTaxInvoice);
ExcelUtil<FinancialTaxInvoice> util = new ExcelUtil<FinancialTaxInvoice>(FinancialTaxInvoice.class); ExcelUtil<FinancialTaxInvoice> util = new ExcelUtil<FinancialTaxInvoice>(FinancialTaxInvoice.class);
return util.exportExcel(list, "国税发票数据"); return util.exportExcel(list, "国税发票数据");
}else {
List<FinancialTaxInvoice> list = financialTaxInvoiceService.selectFinancialTaxInvoiceByCodes(Convert.toStrArray(ids));
ExcelUtil<FinancialTaxInvoice> util = new ExcelUtil<FinancialTaxInvoice>(FinancialTaxInvoice.class);
return util.exportExcel(list, ids);
}
} }
/** /**

10
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java

@ -29,7 +29,7 @@ public class FinancialTaxInvoice extends BaseEntity
private String taxInvoiceCode; private String taxInvoiceCode;
/** 发票状态(0待审核、1待开具、2已开具、3审核拒绝) */ /** 发票状态(0待审核、1待开具、2已开具、3审核拒绝) */
@Excel(name = "发票状态(0待审核、1待开具、2已开具、3审核拒绝)") @Excel(name = "发票状态",dictType = "tax_invoice_status")
private String taxInvoiceStatus; private String taxInvoiceStatus;
/** 使用状态(1是、0否、2已作废) */ /** 使用状态(1是、0否、2已作废) */
@ -45,15 +45,15 @@ public class FinancialTaxInvoice extends BaseEntity
private String salesOrderType; private String salesOrderType;
/** 发票类型(0电子发票、1纸制发票) */ /** 发票类型(0电子发票、1纸制发票) */
@Excel(name = "发票类型(0电子发票、1纸制发票)") @Excel(name = "发票类型", dictType = "tax_invoice_type")
private String taxInvoiceType; private String taxInvoiceType;
/** 发票种类(0专票、1普票) */ /** 发票种类(0专票、1普票) */
@Excel(name = "发票种类(0专票、1普票)") @Excel(name = "发票种类", dictType = "tax_invoice_class")
private String taxInvoiceClass; private String taxInvoiceClass;
/** 发票抬头(0企业、1其他) */ /** 发票抬头(0企业、1其他) */
@Excel(name = "发票抬头(0企业、1其他)") @Excel(name = "发票抬头", dictType = "tax_invoice_title")
private String taxInvoiceTitle; private String taxInvoiceTitle;
/** 业务人员 */ /** 业务人员 */
@ -78,7 +78,7 @@ public class FinancialTaxInvoice extends BaseEntity
private String enterpriseAddress; private String enterpriseAddress;
/** 币种(1RMB、2美元) */ /** 币种(1RMB、2美元) */
@Excel(name = "币种(1RMB、2美元)") @Excel(name = "币种", dictType = "sys_common_currency")
private String commonCurrency; private String commonCurrency;
/** 开票公司名称 */ /** 开票公司名称 */

4
ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceMapper.java

@ -79,4 +79,8 @@ public interface FinancialTaxInvoiceMapper
* 通过发票ID查询发票信息和附件信息 * 通过发票ID查询发票信息和附件信息
*/ */
FinancialTaxInvoice selectFinancialTaxInvoiceWithAttachById(Long taxInvoiceId); FinancialTaxInvoice selectFinancialTaxInvoiceWithAttachById(Long taxInvoiceId);
/*
* 根据编号批量查询*/
public List<FinancialTaxInvoice> selectFinancialTaxInvoiceByCodes(String[] codes);
} }

4
ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java

@ -107,4 +107,8 @@ public interface IFinancialTaxInvoiceService
* 通过发票ID查询发票信息和附件信息 * 通过发票ID查询发票信息和附件信息
*/ */
FinancialTaxInvoice selectFinancialTaxInvoiceWithAttachById(Long taxInvoiceId); FinancialTaxInvoice selectFinancialTaxInvoiceWithAttachById(Long taxInvoiceId);
/*
* 根据编号批量查询*/
public List<FinancialTaxInvoice> selectFinancialTaxInvoiceByCodes(String[] codes);
} }

7
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java

@ -400,4 +400,11 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
financialTaxInvoice.setSysAttachFiles(attachFileList); financialTaxInvoice.setSysAttachFiles(attachFileList);
return financialTaxInvoice; return financialTaxInvoice;
} }
/*
* 根据编号批量查询*/
@Override
public List<FinancialTaxInvoice> selectFinancialTaxInvoiceByCodes(String[] codes){
return financialTaxInvoiceMapper.selectFinancialTaxInvoiceByCodes(codes);
}
} }

10
ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml

@ -85,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectFinancialTaxInvoiceVo"/> <include refid="selectFinancialTaxInvoiceVo"/>
<where> <where>
<if test="taxInvoiceCode != null and taxInvoiceCode != ''"> and tax_invoice_code = #{taxInvoiceCode}</if> <if test="taxInvoiceCode != null and taxInvoiceCode != ''"> and tax_invoice_code = #{taxInvoiceCode}</if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code = #{salesOrderCode}</if>
<if test="taxInvoiceStatus != null and taxInvoiceStatus != ''"> and tax_invoice_status = #{taxInvoiceStatus}</if> <if test="taxInvoiceStatus != null and taxInvoiceStatus != ''"> and tax_invoice_status = #{taxInvoiceStatus}</if>
<if test="taxInvoiceType != null and taxInvoiceType != ''"> and tax_invoice_type = #{taxInvoiceType}</if> <if test="taxInvoiceType != null and taxInvoiceType != ''"> and tax_invoice_type = #{taxInvoiceType}</if>
<if test="taxInvoiceClass != null and taxInvoiceClass != ''"> and tax_invoice_class = #{taxInvoiceClass}</if> <if test="taxInvoiceClass != null and taxInvoiceClass != ''"> and tax_invoice_class = #{taxInvoiceClass}</if>
@ -96,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="invoicePhone != null and invoicePhone != ''"> and invoice_phone = #{invoicePhone}</if> <if test="invoicePhone != null and invoicePhone != ''"> and invoice_phone = #{invoicePhone}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where> </where>
order by create_time desc
</select> </select>
<select id="selectFinancialTaxInvoiceById" parameterType="Long" resultMap="FinancialTaxInvoiceResult"> <select id="selectFinancialTaxInvoiceById" parameterType="Long" resultMap="FinancialTaxInvoiceResult">
@ -338,4 +340,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update financial_tax_invoice set del_flag = '0' where tax_invoice_id = #{taxInvoiceId} update financial_tax_invoice set del_flag = '0' where tax_invoice_id = #{taxInvoiceId}
</update> </update>
<select id="selectFinancialTaxInvoiceByCodes" parameterType="String" resultMap="FinancialTaxInvoiceResult">
<include refid="selectFinancialTaxInvoiceVo"/>
where tax_invoice_code in
<foreach item="taxInvoiceCode" collection="array" open="(" separator="," close=")">
#{taxInvoiceCode}
</foreach>
</select>
</mapper> </mapper>

6
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRmb.html

@ -105,7 +105,7 @@
<label class="col-sm-5 control-label is-required" >发票种类:</label> <label class="col-sm-5 control-label is-required" >发票种类:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_class')}"> <div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_class')}">
<input type="radio" th:id="${'taxInvoiceClass_' + dict.dictCode}" name="taxInvoiceClass" th:value="${dict.dictValue}" th:field="*{taxInvoiceClass}" disabled> <input type="radio" th:id="${'taxInvoiceClass_' + dict.dictCode}" name="taxInvoiceClass" th:value="${dict.dictValue}" th:field="*{taxInvoiceClass}">
<label th:for="${'taxInvoiceClass_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'taxInvoiceClass_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
@ -115,7 +115,7 @@
<label class="col-sm-5 control-label is-required">发票类型:</label> <label class="col-sm-5 control-label is-required">发票类型:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_type')}"> <div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_type')}">
<input type="radio" th:id="${'taxInvoiceType_' + dict.dictCode}" name="taxInvoiceType" th:value="${dict.dictValue}" th:field="*{taxInvoiceType}" disabled> <input type="radio" th:id="${'taxInvoiceType_' + dict.dictCode}" name="taxInvoiceType" th:value="${dict.dictValue}" th:field="*{taxInvoiceType}">
<label th:for="${'taxInvoiceType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'taxInvoiceType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
@ -126,7 +126,7 @@
<label class="col-sm-5 control-label is-required">发票抬头:</label> <label class="col-sm-5 control-label is-required">发票抬头:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_title')}"> <div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_title')}">
<input type="radio" th:id="${'taxInvoiceTitle_' + dict.dictCode}" name="taxInvoiceTitle" th:value="${dict.dictValue}" th:field="*{taxInvoiceTitle}" disabled> <input type="radio" th:id="${'taxInvoiceTitle_' + dict.dictCode}" name="taxInvoiceTitle" th:value="${dict.dictValue}" th:field="*{taxInvoiceTitle}">
<label th:for="${'taxInvoiceTitle_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'taxInvoiceTitle_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>

6
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUsd.html

@ -105,7 +105,7 @@
<label class="col-sm-5 control-label is-required" >发票种类:</label> <label class="col-sm-5 control-label is-required" >发票种类:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_class')}"> <div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_class')}">
<input type="radio" th:id="${'taxInvoiceClass_' + dict.dictCode}" name="taxInvoiceClass" th:value="${dict.dictValue}" th:field="*{taxInvoiceClass}" disabled> <input type="radio" th:id="${'taxInvoiceClass_' + dict.dictCode}" name="taxInvoiceClass" th:value="${dict.dictValue}" th:field="*{taxInvoiceClass}">
<label th:for="${'taxInvoiceClass_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'taxInvoiceClass_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
@ -115,7 +115,7 @@
<label class="col-sm-5 control-label is-required">发票类型:</label> <label class="col-sm-5 control-label is-required">发票类型:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_type')}"> <div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_type')}">
<input type="radio" th:id="${'taxInvoiceType_' + dict.dictCode}" name="taxInvoiceType" th:value="${dict.dictValue}" th:field="*{taxInvoiceType}" disabled> <input type="radio" th:id="${'taxInvoiceType_' + dict.dictCode}" name="taxInvoiceType" th:value="${dict.dictValue}" th:field="*{taxInvoiceType}">
<label th:for="${'taxInvoiceType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'taxInvoiceType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
@ -126,7 +126,7 @@
<label class="col-sm-5 control-label is-required">发票抬头:</label> <label class="col-sm-5 control-label is-required">发票抬头:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_title')}"> <div class="radio-box" th:each="dict : ${@dict.getType('tax_invoice_title')}">
<input type="radio" th:id="${'taxInvoiceTitle_' + dict.dictCode}" name="taxInvoiceTitle" th:value="${dict.dictValue}" th:field="*{taxInvoiceTitle}" disabled> <input type="radio" th:id="${'taxInvoiceTitle_' + dict.dictCode}" name="taxInvoiceTitle" th:value="${dict.dictValue}" th:field="*{taxInvoiceTitle}">
<label th:for="${'taxInvoiceTitle_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'taxInvoiceTitle_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>

61
ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html

@ -11,8 +11,8 @@
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <li>
<label>国税发票单号:</label> <label>销售订单号:</label>
<input type="text" name="taxInvoiceCode"/> <input type="text" name="salesOrderCode"/>
</li> </li>
<li> <li>
<label>发票状态:</label> <label>发票状态:</label>
@ -87,7 +87,7 @@
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="financial:taxInvoice:remove">--> <!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="financial:taxInvoice:remove">-->
<!-- <i class="fa fa-remove"></i> 删除--> <!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>--> <!-- </a>-->
<a class="btn btn-success" onclick="$.table.exportExcel()" shiro:hasPermission="financial:taxInvoice:export"> <a class="btn btn-success" onclick="exportExcel()" shiro:hasPermission="financial:taxInvoice:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
</div> </div>
@ -117,6 +117,10 @@
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
modalName: "国税发票", modalName: "国税发票",
fixedColumns: true, // 是否启用冻结列(左侧)
fixedNumber: 1, // 列冻结的个数(左侧)
rightFixedColumns: true, // 是否启用冻结列(右侧)
fixedRightNumber: 1,
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
@ -128,6 +132,11 @@
{ {
title: '国税发票单号', title: '国税发票单号',
field: 'taxInvoiceCode', field: 'taxInvoiceCode',
visible: false,
},
{
title: '销售订单号',
field: 'salesOrderCode',
}, },
{ {
title: '发票状态', title: '发票状态',
@ -136,27 +145,6 @@
return $.table.selectDictLabel(taxInvoiceStatusDatas, value); return $.table.selectDictLabel(taxInvoiceStatusDatas, value);
} }
}, },
{
title: '发票类型',
field: 'taxInvoiceType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(taxInvoiceTypeDatas, value);
}
},
{
title: '发票种类',
field: 'taxInvoiceClass',
formatter: function(value, row, index) {
return $.table.selectDictLabel(taxInvoiceClassDatas, value);
}
},
{
title: '发票抬头',
field: 'taxInvoiceTitle',
formatter: function(value, row, index) {
return $.table.selectDictLabel(taxInvoiceTitleDatas, value);
}
},
{ {
title: '申请人', title: '申请人',
field: 'applyUser', field: 'applyUser',
@ -200,10 +188,6 @@
title: '含税总价(美元)', title: '含税总价(美元)',
field: 'usdTaxSum', field: 'usdTaxSum',
}, },
{
title: '邮箱',
field: 'invoiceEmail',
},
{ {
title: '开票额度比例', title: '开票额度比例',
field: 'invoiceQuotaRatio', field: 'invoiceQuotaRatio',
@ -450,6 +434,27 @@
$.modal.openOptions(options); $.modal.openOptions(options);
} }
function exportExcel() {
var ids = $.table.selectColumns("taxInvoiceCode");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有国税发票数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出选中的 ${ids.length} 条数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.confirm(tipMsg, function () {
$.modal.loading("正在导出数据,请稍后...");
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "&delete=" + true;
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save