Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
王晓迪 3 months ago
parent
commit
4d16f666b9
  1. 57
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java
  2. 8
      ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceMaterialMapper.java
  3. 7
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceMaterialService.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java
  5. 13
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceMaterialServiceImpl.java
  6. 16
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java
  7. 5
      ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMaterialMapper.xml
  8. 350
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html
  9. 53
      ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html

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

@ -1,15 +1,14 @@
package com.ruoyi.financial.controller;
import java.util.List;
import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial;
import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.financial.domain.FinancialTaxInvoice;
@ -34,6 +33,10 @@ public class FinancialTaxInvoiceController extends BaseController
@Autowired
private IFinancialTaxInvoiceService financialTaxInvoiceService;
@Autowired
private IFinancialTaxInvoiceMaterialService taxInvoiceMaterialService;
@RequiresPermissions("financial:taxInvoice:view")
@GetMapping()
public String taxInvoice()
@ -89,6 +92,50 @@ public class FinancialTaxInvoiceController extends BaseController
return toAjax(financialTaxInvoiceService.insertFinancialTaxInvoice(financialTaxInvoice));
}
/**
* 审核国税发票弹窗页面
*/
@GetMapping("/auditInvoice/{taxInvoiceId}")
public String auditInvoice(@PathVariable("taxInvoiceId") Long taxInvoiceId, ModelMap mmap)
{
FinancialTaxInvoice taxInvoice = financialTaxInvoiceService.selectFinancialTaxInvoiceById(taxInvoiceId);
String commonCurrency = taxInvoice.getCommonCurrency();
mmap.put("taxInvoice", taxInvoice);
if ("1".equals(commonCurrency)){
return prefix + "/auditInvoiceRMB";
}else {
return prefix + "/auditInvoiceUSD";
}
}
/**
* 审核国税发票
*/
@RequiresPermissions("financial:taxInvoice:auditInvoice")
@Log(title = "国税发票", businessType = BusinessType.INSERT)
@PostMapping("/auditInvoice")
@ResponseBody
public AjaxResult auditInvoiceSave(FinancialTaxInvoice financialTaxInvoice,@RequestParam("taxInvoiceStatus") String taxInvoiceStatus)
{
return toAjax(financialTaxInvoiceService.auditInvoiceFinancialTaxInvoice(financialTaxInvoice,taxInvoiceStatus));
}
/**
* 国税发票物料列表展示
*/
@ResponseBody
@PostMapping("/getInvoiceMaterialListByCode")
public TableDataInfo getInvoiceMaterialListByCode(@RequestParam("taxInvoiceCode") String taxInvoiceCode){
startPage();
List<FinancialTaxInvoiceMaterial> list = taxInvoiceMaterialService.getInvoiceMaterialListByCode(taxInvoiceCode);
return getDataTable(list);
}
/**
* 修改国税发票
*/

8
ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceMaterialMapper.java

@ -84,4 +84,12 @@ public interface FinancialTaxInvoiceMaterialMapper
* @return 结果
*/
public int restoreFinancialTaxInvoiceMaterialById(Long invoiceMaterialId);
/**
* 根据发票单号获取发票物料信息集合
*
* @param taxInvoiceCode 发票单号
* @return 结果
*/
List<FinancialTaxInvoiceMaterial> selectFinancialTaxInvoiceMaterialByCode(String taxInvoiceCode);
}

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

@ -81,4 +81,11 @@ public interface IFinancialTaxInvoiceMaterialService
* @return
*/
int restoreFinancialTaxInvoiceMaterialById(Long invoiceMaterialId);
/**
* 根据发票单号获取发票物料集合
* @param taxInvoiceCode 发票单号
* @return
*/
List<FinancialTaxInvoiceMaterial> getInvoiceMaterialListByCode(String taxInvoiceCode);
}

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

@ -87,4 +87,9 @@ public interface IFinancialTaxInvoiceService
* @return
*/
int makeInvoiceSave(FinancialTaxInvoice financialTaxInvoice);
/**
* 审核国税发票
*/
int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice,String taxInvoiceStatus);
}

13
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceMaterialServiceImpl.java

@ -143,4 +143,17 @@ public class FinancialTaxInvoiceMaterialServiceImpl implements IFinancialTaxInvo
{
return financialTaxInvoiceMaterialMapper.restoreFinancialTaxInvoiceMaterialById(invoiceMaterialId);
}
/**
* 根据发票单号获取发票物料信息集合
*
* @param taxInvoiceCode 发票单号
* @return 结果
*/
@Override
public List<FinancialTaxInvoiceMaterial> getInvoiceMaterialListByCode(String taxInvoiceCode) {
return financialTaxInvoiceMaterialMapper.selectFinancialTaxInvoiceMaterialByCode(taxInvoiceCode);
}
}

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

@ -258,4 +258,20 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi
return financialTaxInvoiceMapper.insertFinancialTaxInvoice(financialTaxInvoice);
}
/**
* 审核国税发票
*/
@Override
public int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice,String taxInvoiceStatus) {
if ("1".equals(taxInvoiceStatus)){
//审核通过
financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus);
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice);
}else {
financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus);
return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice);
}
}
}

5
ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMaterialMapper.xml

@ -49,6 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where invoice_material_id = #{invoiceMaterialId}
</select>
<select id="selectFinancialTaxInvoiceMaterialByCode" parameterType="String" resultMap="FinancialTaxInvoiceMaterialResult">
<include refid="selectFinancialTaxInvoiceMaterialVo"/>
where tax_invoice_code = #{taxInvoiceCode}
</select>
<insert id="insertFinancialTaxInvoiceMaterial" parameterType="FinancialTaxInvoiceMaterial" useGeneratedKeys="true" keyProperty="invoiceMaterialId">
insert into financial_tax_invoice_material
<trim prefix="(" suffix=")" suffixOverrides=",">

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

@ -0,0 +1,350 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('审核国税发票')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-taxInvoice-auditRmb" th:object="${taxInvoice}">
<input name="taxInvoiceId" th:field="*{taxInvoiceId}" type="hidden">
<div class="form-group">
<label class="col-sm-5 control-label">发票单号:</label>
<div class="col-sm-7">
<input name="taxInvoiceCode" th:field="*{taxInvoiceCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">销售订单编号:</label>
<div class="col-sm-7">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">订单类型:</label>
<div class="col-sm-7">
<select name="salesOrderType" class="form-control m-b" th:with="type=${@dict.getType('sys_order_type')}" readonly>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{salesOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">报价币种:</label>
<div class="col-sm-7">
<select name="commonCurrency" class="form-control m-b" th:with="type=${@dict.getType('sys_common_currency')}" readonly>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{commonCurrency}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">客户代码/ID:</label>
<div class="col-sm-7">
<input name="enterpriseCode" th:field="*{enterpriseCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">客户名称:</label>
<div class="col-sm-7">
<input name="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">联系电话:</label>
<div class="col-sm-7">
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司地址:</label>
<div class="col-sm-7">
<input name="enterpriseAddress" th:field="*{enterpriseAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票公司名称:</label>
<div class="col-sm-7">
<input name="invoiceCompanyName" th:field="*{invoiceCompanyName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票公司税号:</label>
<div class="col-sm-7">
<input name="invoiceCompanyCode" th:field="*{invoiceCompanyCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司开户行:</label>
<div class="col-sm-7">
<input name="depositBank" th:field="*{depositBank}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">公司开户账号:</label>
<div class="col-sm-7">
<input name="bankAccount" th:field="*{bankAccount}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">税率:</label>
<div class="col-sm-7">
<div class="input-group">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" readonly>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required" >发票种类:</label>
<div class="col-sm-7">
<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>
<label th:for="${'taxInvoiceClass_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">发票类型:</label>
<div class="col-sm-7">
<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>
<label th:for="${'taxInvoiceType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label is-required">发票抬头:</label>
<div class="col-sm-7">
<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>
<label th:for="${'taxInvoiceTitle_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">邮箱:</label>
<div class="col-sm-7">
<input name="invoiceEmail" th:field="*{invoiceEmail}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">业务备注:</label>
<div class="col-sm-7">
<input name="businessRemark" th:field="*{businessRemark}" class="form-control" type="text" readonly>
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">开票物料</h4>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table-material"></table>
</div>
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">开票额度</h4>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">不含税总价(RMB):</label>
<div class="col-sm-7">
<input name="noRmbSum" th:field="*{noRmbSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">含税总价(RMB):</label>
<div class="col-sm-7">
<input name="rmbTaxSum" th:field="*{rmbTaxSum}" class="form-control" type="text" id="rmbTaxSumInput" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">物料数合计:</label>
<div class="col-sm-7">
<input name="materialSum" th:field="*{materialSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">数量合计:</label>
<div class="col-sm-7">
<input name="enterpriseSum" th:field="*{enterpriseSum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票额度比例:</label>
<div class="col-sm-7">
<div class="input-group">
<input name="invoiceQuotaRatio" th:field="*{invoiceQuotaRatio}" class="form-control" type="text" id="invoiceQuotaRatioInput" readonly>
<span class="input-group-addon">%</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票金额(RMB):</label>
<div class="col-sm-7">
<input name="invoiceAmountRmb" th:field="*{invoiceAmountRmb}" class="form-control" type="text" id="invoiceAmountRmbInput" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">开票用途:</label>
<div class="col-sm-7">
<input name="invoicePurpose" th:field="*{invoicePurpose}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">备注:</label>
<div class="col-sm-7">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var materialProcessMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]];
var taxInvoice = [[${taxInvoice}]];
var prefix = ctx + "financial/taxInvoice";
$("#form-taxInvoice-auditRmb").validate({
focusCleanup: true
});
// function submitHandler() {
//
//
// $.operate.save(prefix + "/auditRmb", $('#form-taxInvoice-auditRmb').serialize());
// }
//开票物料
$(function() {
var options = {
id: 'bootstrap-table-material',
url: prefix + "/getInvoiceMaterialListByCode",
queryParams: function(params) {
return {
taxInvoiceCode: $("#taxInvoiceCode").val(),
}
},
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
modalName: "国税发票物料",
columns: [{
checkbox: true
},
{
title: '国税发票物料ID',
field: 'invoiceMaterialId',
visible: false
},
{
title: '物料编号',
field: 'materialCode',
},
{
title: '物料名称',
field: 'materialName',
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(materialProcessMethodDatas, value);
}
},
{
title: '物料品牌',
field: 'materialBrand',
},
{
title: '物料图片',
field: 'materialPhotourl',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料的数量',
field: 'materialNum',
},
{
title: '物料的含税单价(RMB)',
field: 'taxRmb',
},
{
title: '物料的不含税单价(RMB)',
field: 'noTaxRmb',
},
{
title: '物料的含税单价(美元)',
field: 'taxUsd',
},
{
title: '物料的不含税单价(美元)',
field: 'noTaxUsd',
},
{
title: '已出库数量',
field: 'outBoundQuantity',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '退货数',
field: 'refundsNum',
}]
};
$.table.init(options);
});
</script>
</body>
</html>

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

@ -99,25 +99,22 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('financial:taxInvoice:edit')}]];
var removeFlag = [[${@permission.hasPermi('financial:taxInvoice:remove')}]];
var cancelFlag = [[${@permission.hasPermi('financial:taxInvoice:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('financial:taxInvoice:restore')}]];
var auditInvoiceFlag = [[${@permission.hasPermi('financial:taxInvoice:auditInvoice')}]];
var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]];
var salesOrderTypeDatas = [[${@dict.getType('sys_order_type')}]];
var taxInvoiceTypeDatas = [[${@dict.getType('tax_invoice_type')}]];
var taxInvoiceClassDatas = [[${@dict.getType('tax_invoice_class')}]];
var taxInvoiceTitleDatas = [[${@dict.getType('tax_invoice_title')}]];
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var prefix = ctx + "financial/taxInvoice";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "国税发票",
columns: [{
@ -265,11 +262,8 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.taxInvoiceId + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
if (row.taxInvoiceStatus=="0"){
actions.push('<a class="btn btn-success btn-xs ' + auditInvoiceFlag + '" href="javascript:void(0)" onclick="auditInvoice(\'' + row.taxInvoiceId + '\')"><i class="fa fa-edit"></i>审核</a>');
}
return actions.join('');
}
@ -277,6 +271,41 @@
};
$.table.init(options);
});
//审核页面
function auditInvoice(taxInvoiceId) {
var btn = ['<i class="fa fa-check"></i> 审核通过', '<i class="fa fa-remove"></i> 审核拒绝', '<i class="fa fa-close"></i> 关闭'];
var options = {
title: '审核发票',
url: prefix + "/auditInvoice/" + taxInvoiceId,
btn: btn,
yes: function (index, layero) { // 审核通过按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-auditRmb').serialize();
var taxInvoiceStatus = "1";
var url= prefix + "/auditInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 true 表示审核通过
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false
},
btn2: function (index, layero) { // 审核拒绝按钮
var iframeWin = window[layero.find('iframe')[0]['name']];
var auditRmbData = iframeWin.$('#form-taxInvoice-auditRmb').serialize();
var taxInvoiceStatus = "3";
var url= prefix + "/auditInvoice";
$.operate.save(url, auditRmbData + '&taxInvoiceStatus=' + taxInvoiceStatus); // 添加 false 表示审核拒绝
layer.close(index);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
return false;
}
};
$.modal.openOptions(options);
}
</script>
</body>
</html>
Loading…
Cancel
Save