From b53dacf7cfcc8a2b18baeb784eb9a205ad47ecde Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 14 Aug 2024 08:58:26 +0800 Subject: [PATCH 01/10] =?UTF-8?q?[feat]=E9=94=80=E5=94=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86=20=E5=9B=BD?= =?UTF-8?q?=E7=A8=8E=E5=8F=91=E7=A5=A8=E5=AE=9E=E4=BD=93=E7=B1=BB=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BC=80=E7=A5=A8=E9=87=91=E9=A2=9D=E7=BE=8E?= =?UTF-8?q?=E5=85=83=E5=AD=97=E6=AE=B5=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=E9=87=91=E9=A2=9D=E4=BA=BA=E6=B0=91=E5=B8=81=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20=E4=BF=AE=E6=94=B9=E5=9B=BD=E7=A8=8E=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=EF=BC=9A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=BC=80=E7=A5=A8=E9=87=91=E9=A2=9D=E7=BE=8E=E5=85=83?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E4=BA=BA=E6=B0=91=E5=B8=81=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=9B=BD=E7=A8=8E=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=EF=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=BC=80=E7=A5=A8=E9=87=91=E9=A2=9D=E7=BE=8E=E5=85=83=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=BC=80=E7=A5=A8=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E4=BA=BA=E6=B0=91=E5=B8=81=E5=AD=97=E6=AE=B5=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E7=A8=8E=E5=8F=91=E7=A5=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=A5=E5=8F=A3=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=E9=87=91=E9=A2=9D=E7=BE=8E=E5=85=83=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=BC=80=E7=A5=A8=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E4=BA=BA=E6=B0=91=E5=B8=81=E5=AD=97=E6=AE=B5=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=BC=80=E7=A5=A8-=E5=9B=BD=E5=86=85=E5=85=AC?= =?UTF-8?q?=E5=8F=B8=E5=89=8D=E7=AB=AF=E5=88=97=E8=A1=A8=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=BC=80=E7=A5=A8=E9=87=91=E9=A2=9D=E4=BA=BA=E6=B0=91?= =?UTF-8?q?=E5=B8=81=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../financial/domain/FinancialTaxInvoice.java | 37 +++++++++++++------ .../financial/FinancialTaxInvoiceMapper.xml | 14 ++++--- .../system/salesOrder/makeInvoiceRMB.html | 4 +- 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java index 14e14bd9..ac8e9a8d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java @@ -130,8 +130,12 @@ public class FinancialTaxInvoice extends BaseEntity @Excel(name = "开票额度比例") private BigDecimal invoiceQuotaRatio; - /** 开票金额 */ - private BigDecimal invoiceAmount; + /** 开票金额(RMB) */ + private BigDecimal invoiceAmountRmb; + + /** 开票金额(美元) */ + private BigDecimal invoiceAmountUsd; + /** 实际开票金额 */ @Excel(name = "实际开票金额") @@ -455,16 +459,16 @@ public class FinancialTaxInvoice extends BaseEntity { return invoiceQuotaRatio; } - public void setInvoiceAmount(BigDecimal invoiceAmount) - { - this.invoiceAmount = invoiceAmount; + + public BigDecimal getInvoiceAmountRmb() { + return invoiceAmountRmb; } - public BigDecimal getInvoiceAmount() - { - return invoiceAmount; + public void setInvoiceAmountRmb(BigDecimal invoiceAmountRmb) { + this.invoiceAmountRmb = invoiceAmountRmb; } - public void setActualInvoiceAmount(BigDecimal actualInvoiceAmount) + + public void setActualInvoiceAmount(BigDecimal actualInvoiceAmount) { this.actualInvoiceAmount = actualInvoiceAmount; } @@ -473,7 +477,17 @@ public class FinancialTaxInvoice extends BaseEntity { return actualInvoiceAmount; } - public void setActualInvoiceAmountRmb(BigDecimal actualInvoiceAmountRmb) + + + public BigDecimal getInvoiceAmountUsd() { + return invoiceAmountUsd; + } + + public void setInvoiceAmountUsd(BigDecimal invoiceAmountUsd) { + this.invoiceAmountUsd = invoiceAmountUsd; + } + + public void setActualInvoiceAmountRmb(BigDecimal actualInvoiceAmountRmb) { this.actualInvoiceAmountRmb = actualInvoiceAmountRmb; } @@ -597,7 +611,8 @@ public class FinancialTaxInvoice extends BaseEntity .append("usdTaxSum", getUsdTaxSum()) .append("invoiceEmail", getInvoiceEmail()) .append("invoiceQuotaRatio", getInvoiceQuotaRatio()) - .append("invoiceAmount", getInvoiceAmount()) + .append("invoiceAmountRmb", getInvoiceAmountRmb()) + .append("invoiceAmountUsd", getInvoiceAmountUsd()) .append("actualInvoiceAmount", getActualInvoiceAmount()) .append("actualInvoiceAmountRmb", getActualInvoiceAmountRmb()) .append("actualInvoiceAmountUsd", getActualInvoiceAmountUsd()) diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml index f6f096d5..3545cd82 100644 --- a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml @@ -36,7 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + @@ -55,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select tax_invoice_id, tax_invoice_code, tax_invoice_status, use_status, sales_order_code, sales_order_number, sales_order_type, tax_invoice_type, tax_invoice_class, tax_invoice_title, business_members, apply_user, enterprise_code, enterprise_name, contact_number, enterprise_address, common_currency, invoice_company_name, invoice_company_code, deposit_bank, bank_account, tax_rate, usd_tax, material_sum, enterprise_sum, noRmbSum, rmbTaxSum, noUsdSum, usdTaxSum, invoice_email, invoice_quota_ratio, invoice_amount, actual_invoice_amount, actual_invoice_amount_rmb, actual_invoice_amount_usd, invoice_purpose, business_remark, invoice_remark, invoice_data, invoice_code, invoice_phone, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice + select tax_invoice_id, tax_invoice_code, tax_invoice_status, use_status, sales_order_code, sales_order_number, sales_order_type, tax_invoice_type, tax_invoice_class, tax_invoice_title, business_members, apply_user, enterprise_code, enterprise_name, contact_number, enterprise_address, common_currency, invoice_company_name, invoice_company_code, deposit_bank, bank_account, tax_rate, usd_tax, material_sum, enterprise_sum, noRmbSum, rmbTaxSum, noUsdSum, usdTaxSum, invoice_email, invoice_quota_ratio, invoice_amount_rmb, invoice_amount_usd, actual_invoice_amount, actual_invoice_amount_rmb, actual_invoice_amount_usd, invoice_purpose, business_remark, invoice_remark, invoice_data, invoice_code, invoice_phone, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice +
From 5c7be1f66be7b0a5e1223c98b56fe4504102585b Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 14 Aug 2024 09:16:29 +0800 Subject: [PATCH 02/10] =?UTF-8?q?[feat]=E8=B4=A2=E5=8A=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86:=20=E5=9B=BD=E7=A8=8E=E5=8F=91=E7=A5=A8=E7=89=A9?= =?UTF-8?q?=E6=96=99=20=E6=96=B0=E5=A2=9E=E5=9B=BD=E7=A8=8E=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=A1=A8=20=E6=96=B0=E5=A2=9E=E5=9B=BD=E7=A8=8E?= =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95domain=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9B=BD=E7=A8=8E=E5=8F=91=E7=A5=A8=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AE=B0=E5=BD=95Mapper=20=E6=96=B0=E5=A2=9E=E5=9B=BD?= =?UTF-8?q?=E7=A8=8E=E5=8F=91=E7=A5=A8=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?Mapper.xml=20=E6=96=B0=E5=A2=9E=E5=9B=BD=E7=A8=8E=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95Service=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9B=BD=E7=A8=8E=E5=8F=91=E7=A5=A8=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AE=B0=E5=BD=95ServiceImpl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/FinancialTaxInvoiceHistory.java | 197 ++++++++++++++++++ .../FinancialTaxInvoiceHistoryMapper.java | 77 +++++++ .../IFinancialTaxInvoiceHistoryService.java | 75 +++++++ ...FinancialTaxInvoiceHistoryServiceImpl.java | 126 +++++++++++ .../FinancialTaxInvoiceHistoryMapper.xml | 124 +++++++++++ 5 files changed, 599 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java create mode 100644 ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java new file mode 100644 index 00000000..60208ce2 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java @@ -0,0 +1,197 @@ +package com.ruoyi.financial.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 国税发票历史记录对象 financial_tax_invoice_history + * + * @author 刘晓旭 + * @date 2024-08-14 + */ +public class FinancialTaxInvoiceHistory extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 国税发票历史id */ + private Long invoiceHistoryId; + + /** 国税发票单号 */ + @Excel(name = "国税发票单号") + private String taxInvoiceCode; + + /** 销售订单编号 */ + private String salesOrderCode; + + /** 发票状态(0待审核、1待开具、2已开具、3审核拒绝) */ + @Excel(name = "发票状态(0待审核、1待开具、2已开具、3审核拒绝)") + private String taxInvoiceStatus; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date applyTime; + + /** 财务员 */ + @Excel(name = "财务员") + private String financeMembers; + + /** 开票额度比例 */ + @Excel(name = "开票额度比例") + private BigDecimal invoiceQuotaRatio; + + /** 开票金额(RMB) */ + @Excel(name = "开票金额(RMB)") + private BigDecimal invoiceAmountRmb; + + /** 开票金额(美元) */ + @Excel(name = "开票金额(美元)") + private BigDecimal invoiceAmountUsd; + + /** 开票用途 */ + @Excel(name = "开票用途") + private String invoicePurpose; + + /** 使用状态(1是、0否、2已作废) */ + private String useStatus; + + /** 删除标志 0正常 1删除 */ + private String delFlag; + + public void setInvoiceHistoryId(Long invoiceHistoryId) + { + this.invoiceHistoryId = invoiceHistoryId; + } + + public Long getInvoiceHistoryId() + { + return invoiceHistoryId; + } + public void setTaxInvoiceCode(String taxInvoiceCode) + { + this.taxInvoiceCode = taxInvoiceCode; + } + + public String getTaxInvoiceCode() + { + return taxInvoiceCode; + } + public void setSalesOrderCode(String salesOrderCode) + { + this.salesOrderCode = salesOrderCode; + } + + public String getSalesOrderCode() + { + return salesOrderCode; + } + public void setTaxInvoiceStatus(String taxInvoiceStatus) + { + this.taxInvoiceStatus = taxInvoiceStatus; + } + + public String getTaxInvoiceStatus() + { + return taxInvoiceStatus; + } + public void setApplyTime(Date applyTime) + { + this.applyTime = applyTime; + } + + public Date getApplyTime() + { + return applyTime; + } + public void setFinanceMembers(String financeMembers) + { + this.financeMembers = financeMembers; + } + + public String getFinanceMembers() + { + return financeMembers; + } + public void setInvoiceQuotaRatio(BigDecimal invoiceQuotaRatio) + { + this.invoiceQuotaRatio = invoiceQuotaRatio; + } + + public BigDecimal getInvoiceQuotaRatio() + { + return invoiceQuotaRatio; + } + public void setInvoiceAmountRmb(BigDecimal invoiceAmountRmb) + { + this.invoiceAmountRmb = invoiceAmountRmb; + } + + public BigDecimal getInvoiceAmountRmb() + { + return invoiceAmountRmb; + } + public void setInvoiceAmountUsd(BigDecimal invoiceAmountUsd) + { + this.invoiceAmountUsd = invoiceAmountUsd; + } + + public BigDecimal getInvoiceAmountUsd() + { + return invoiceAmountUsd; + } + public void setInvoicePurpose(String invoicePurpose) + { + this.invoicePurpose = invoicePurpose; + } + + public String getInvoicePurpose() + { + return invoicePurpose; + } + public void setUseStatus(String useStatus) + { + this.useStatus = useStatus; + } + + public String getUseStatus() + { + return useStatus; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("invoiceHistoryId", getInvoiceHistoryId()) + .append("taxInvoiceCode", getTaxInvoiceCode()) + .append("salesOrderCode", getSalesOrderCode()) + .append("taxInvoiceStatus", getTaxInvoiceStatus()) + .append("applyTime", getApplyTime()) + .append("financeMembers", getFinanceMembers()) + .append("invoiceQuotaRatio", getInvoiceQuotaRatio()) + .append("invoiceAmountRmb", getInvoiceAmountRmb()) + .append("invoiceAmountUsd", getInvoiceAmountUsd()) + .append("invoicePurpose", getInvoicePurpose()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("useStatus", getUseStatus()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java new file mode 100644 index 00000000..6b0fab8a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.financial.mapper; + +import java.util.List; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; + +/** + * 国税发票历史记录Mapper接口 + * + * @author 刘晓旭 + * @date 2024-08-14 + */ +public interface FinancialTaxInvoiceHistoryMapper +{ + /** + * 查询国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 国税发票历史记录 + */ + public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 查询国税发票历史记录列表 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 国税发票历史记录集合 + */ + public List selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 新增国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 修改国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 删除国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 批量删除国税发票历史记录 + * + * @param invoiceHistoryIds 需要删除的数据ID + * @return 结果 + */ + public int deleteFinancialTaxInvoiceHistoryByIds(String[] invoiceHistoryIds); + + /** + * 作废国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + public int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 恢复国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + public int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java new file mode 100644 index 00000000..b18c141d --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java @@ -0,0 +1,75 @@ +package com.ruoyi.financial.service; + +import java.util.List; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; + +/** + * 国税发票历史记录Service接口 + * + * @author 刘晓旭 + * @date 2024-08-14 + */ +public interface IFinancialTaxInvoiceHistoryService +{ + /** + * 查询国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 国税发票历史记录 + */ + public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 查询国税发票历史记录列表 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 国税发票历史记录集合 + */ + public List selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 新增国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 修改国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 批量删除国税发票历史记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteFinancialTaxInvoiceHistoryByIds(String ids); + + /** + * 删除国税发票历史记录信息 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 作废国税发票历史记录 + * @param invoiceHistoryId 国税发票历史记录ID + * @return + */ + int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 恢复国税发票历史记录 + * @param invoiceHistoryId 国税发票历史记录ID + * @return + */ + int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java new file mode 100644 index 00000000..3e7a9c8a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java @@ -0,0 +1,126 @@ +package com.ruoyi.financial.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; +import com.ruoyi.financial.service.IFinancialTaxInvoiceHistoryService; +import com.ruoyi.common.core.text.Convert; + +/** + * 国税发票历史记录Service业务层处理 + * + * @author 刘晓旭 + * @date 2024-08-14 + */ +@Service +public class FinancialTaxInvoiceHistoryServiceImpl implements IFinancialTaxInvoiceHistoryService +{ + @Autowired + private FinancialTaxInvoiceHistoryMapper financialTaxInvoiceHistoryMapper; + + /** + * 查询国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 国税发票历史记录 + */ + @Override + public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId) + { + return financialTaxInvoiceHistoryMapper.selectFinancialTaxInvoiceHistoryById(invoiceHistoryId); + } + + /** + * 查询国税发票历史记录列表 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 国税发票历史记录 + */ + @Override + public List selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory) + { + return financialTaxInvoiceHistoryMapper.selectFinancialTaxInvoiceHistoryList(financialTaxInvoiceHistory); + } + + /** + * 新增国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + @Override + public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory) + { + String loginName = ShiroUtils.getLoginName(); + financialTaxInvoiceHistory.setCreateBy(loginName); + financialTaxInvoiceHistory.setCreateTime(DateUtils.getNowDate()); + return financialTaxInvoiceHistoryMapper.insertFinancialTaxInvoiceHistory(financialTaxInvoiceHistory); + } + + /** + * 修改国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + @Override + public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory) + { + String loginName = ShiroUtils.getLoginName(); + financialTaxInvoiceHistory.setUpdateBy(loginName); + financialTaxInvoiceHistory.setUpdateTime(DateUtils.getNowDate()); + return financialTaxInvoiceHistoryMapper.updateFinancialTaxInvoiceHistory(financialTaxInvoiceHistory); + } + + /** + * 删除国税发票历史记录对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteFinancialTaxInvoiceHistoryByIds(String ids) + { + return financialTaxInvoiceHistoryMapper.deleteFinancialTaxInvoiceHistoryByIds(Convert.toStrArray(ids)); + } + + /** + * 删除国税发票历史记录信息 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + @Override + public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId) + { + return financialTaxInvoiceHistoryMapper.deleteFinancialTaxInvoiceHistoryById(invoiceHistoryId); + } + + /** + * 作废国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + @Override + public int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId) + { + return financialTaxInvoiceHistoryMapper.cancelFinancialTaxInvoiceHistoryById(invoiceHistoryId); + } + + /** + * 恢复国税发票历史记录信息 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + @Override + public int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId) + { + return financialTaxInvoiceHistoryMapper.restoreFinancialTaxInvoiceHistoryById(invoiceHistoryId); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml new file mode 100644 index 00000000..f9017ac3 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select invoice_history_id, tax_invoice_code, sales_order_code, tax_invoice_status, apply_time, finance_members, invoice_quota_ratio, invoice_amount_rmb, invoice_amount_usd, invoice_purpose, create_by, create_time, update_by, update_time, remark, use_status, del_flag from financial_tax_invoice_history + + + + + + + + insert into financial_tax_invoice_history + + tax_invoice_code, + sales_order_code, + tax_invoice_status, + apply_time, + finance_members, + invoice_quota_ratio, + invoice_amount_rmb, + invoice_amount_usd, + invoice_purpose, + create_by, + create_time, + update_by, + update_time, + remark, + use_status, + del_flag, + + + #{taxInvoiceCode}, + #{salesOrderCode}, + #{taxInvoiceStatus}, + #{applyTime}, + #{financeMembers}, + #{invoiceQuotaRatio}, + #{invoiceAmountRmb}, + #{invoiceAmountUsd}, + #{invoicePurpose}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{useStatus}, + #{delFlag}, + + + + + update financial_tax_invoice_history + + tax_invoice_code = #{taxInvoiceCode}, + sales_order_code = #{salesOrderCode}, + tax_invoice_status = #{taxInvoiceStatus}, + apply_time = #{applyTime}, + finance_members = #{financeMembers}, + invoice_quota_ratio = #{invoiceQuotaRatio}, + invoice_amount_rmb = #{invoiceAmountRmb}, + invoice_amount_usd = #{invoiceAmountUsd}, + invoice_purpose = #{invoicePurpose}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + use_status = #{useStatus}, + del_flag = #{delFlag}, + + where invoice_history_id = #{invoiceHistoryId} + + + + delete from financial_tax_invoice_history where invoice_history_id = #{invoiceHistoryId} + + + + delete from financial_tax_invoice_history where invoice_history_id in + + #{invoiceHistoryId} + + + + + update financial_tax_invoice_history set del_flag = '1' where invoice_history_id = #{invoiceHistoryId} + + + + update financial_tax_invoice_history set del_flag = '0' where invoice_history_id = #{invoiceHistoryId} + + + \ No newline at end of file From 9abf6ca59e8f45273f0d45cf4ff73a5484c54357 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 14 Aug 2024 10:00:57 +0800 Subject: [PATCH 03/10] =?UTF-8?q?[feat]=E8=B4=A2=E5=8A=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20=E9=94=80?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95Controller=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=EF=BC=9A=E6=9F=A5=E8=AF=A2=E5=BC=80=E7=A5=A8=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=BC=80?= =?UTF-8?q?=E7=A5=A8-=E5=9B=BD=E5=86=85=E5=89=8D=E7=AB=AF=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=BC=80=E7=A5=A8=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=EF=BC=9B=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=9F=A5=E8=AF=A2=E5=BC=80=E7=A5=A8=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E5=9B=BD=E7=A8=8E?= =?UTF-8?q?=E5=BC=80=E7=A5=A8=E5=8E=86=E5=8F=B2=E6=96=B0=E5=A2=9E=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E9=9B=86?= =?UTF-8?q?=E5=90=88=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancialTaxInvoiceHistoryMapper.java | 8 ++ .../IFinancialTaxInvoiceHistoryService.java | 7 ++ ...FinancialTaxInvoiceHistoryServiceImpl.java | 14 ++++ .../controller/SysSalesOrderController.java | 26 ++++++- .../FinancialTaxInvoiceHistoryMapper.xml | 7 +- .../system/salesOrder/makeInvoiceRMB.html | 75 ++++++++++++++++++- 6 files changed, 132 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java index 6b0fab8a..5dd24a68 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java @@ -74,4 +74,12 @@ public interface FinancialTaxInvoiceHistoryMapper * @return 结果 */ public int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 根据销售订单编号查询发票历史记录集合 + * + * @param salesOrderCode 销售订单编号 + * @return 结果 + */ + List selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java index b18c141d..59c8ccbe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java @@ -72,4 +72,11 @@ public interface IFinancialTaxInvoiceHistoryService * @return */ int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 根据销售订单编号查询发票历史记录集合 + * @param salesOrderCode 销售订单编号 + * @return + */ + List selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java index 3e7a9c8a..46e4e3f9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java @@ -123,4 +123,18 @@ public class FinancialTaxInvoiceHistoryServiceImpl implements IFinancialTaxInvoi { return financialTaxInvoiceHistoryMapper.restoreFinancialTaxInvoiceHistoryById(invoiceHistoryId); } + + + /** + * 根据销售订单编号查询历史记录集合 + * + * @param salesOrderCode 销售订单编号 + * @return 结果 + */ + @Override + public List selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode) { + + List list = financialTaxInvoiceHistoryMapper.selectInvoiceHistoryListBySalesOrderCode(salesOrderCode); + return list; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java index ba3d6190..167a7301 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java @@ -22,7 +22,9 @@ import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.financial.domain.FinancialTaxInvoice; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; import com.ruoyi.financial.service.IFinancialReceivablesService; +import com.ruoyi.financial.service.IFinancialTaxInvoiceHistoryService; import com.ruoyi.financial.service.IFinancialTaxInvoiceService; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.system.domain.*; @@ -101,6 +103,10 @@ public class SysSalesOrderController extends BaseController @Autowired private IFinancialTaxInvoiceService taxInvoiceService; + @Autowired + private IFinancialTaxInvoiceHistoryService invoiceHistoryService; + + @RequiresPermissions("system:salesOrder:view") @GetMapping() public String salesOrder(ModelMap mmap) @@ -623,11 +629,27 @@ public class SysSalesOrderController extends BaseController */ @ResponseBody - @PostMapping("/getSalesOrderCodeChildListByCode") - public TableDataInfo getSalesOrderCodeChildListByCode(@RequestParam("salesOrderCode") String salesOrderCode) + @PostMapping("/getSalesOrderChildListByCode") + public TableDataInfo getSalesOrderChildListByCode(@RequestParam("salesOrderCode") String salesOrderCode) { startPage(); List list = sysSalesOrderChildService.selectOrderChildListBySalesOrderCode(salesOrderCode); return getDataTable(list); } + + + /** + * 查询开票历史记录列表 + */ + + @ResponseBody + @PostMapping("/getInvoiceHistoryListBySalesOrderCode") + public TableDataInfo getInvoiceHistoryListBySalesOrderCode(@RequestParam("salesOrderCode") String salesOrderCode) + { + startPage(); + List list = invoiceHistoryService.selectInvoiceHistoryListBySalesOrderCode(salesOrderCode); + return getDataTable(list); + } + + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml index f9017ac3..5edd1493 100644 --- a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml @@ -38,7 +38,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where invoice_history_id = #{invoiceHistoryId} - + + + insert into financial_tax_invoice_history diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html index df975bd2..34a57450 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html @@ -224,6 +224,7 @@ var materialProcessMethodDatas = [[${@dict.getType('processMethod')}]]; var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; + var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]]; var taxInvoice = [[${taxInvoice}]]; @@ -273,11 +274,11 @@ } - + //开票物料 $(function() { var options = { id: 'bootstrap-table-material', - url: prefix + "/getSalesOrderCodeChildListByCode", + url: prefix + "/getSalesOrderChildListByCode", queryParams: function(params) { return { salesOrderCode: $("#salesOrderCode").val(), @@ -364,6 +365,76 @@ }); + //开票历史 + $(function() { + var options = { + id: 'bootstrap-table-history', + url: prefix + "/getInvoiceHistoryListBySalesOrderCode", + queryParams: function(params) { + return { + salesOrderCode: $("#salesOrderCode").val(), + } + }, + showSearch: false, + showRefresh: false, + showToggle: false, + showColumns: false, + pagination: false, // 设置不分页 + modalName: "国税发票历史记录", + columns: [{ + checkbox: true + }, + { + title: '国税发票历史id', + field: 'invoiceHistoryId', + visible: false + }, + { + title: '国税发票单号', + field: 'taxInvoiceCode', + }, + { + title: '发票状态', //(0待审核、1待开具、2已开具、3审核拒绝) + field: 'taxInvoiceStatus', + formatter: function(value, row, index) { + return $.table.selectDictLabel(taxInvoiceStatusDatas, value); + } + }, + { + title: '申请时间', + field: 'applyTime', + }, + { + title: '财务员', + field: 'financeMembers', + }, + { + title: '开票额度比例', + field: 'invoiceQuotaRatio', + }, + { + title: '开票金额(RMB)', + field: 'invoiceAmountRmb', + }, + { + title: '开票用途', + field: 'invoicePurpose', + }, + { + title: '操作', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('编辑 '); + return actions.join(''); + } + }] + }; + $.table.init(options); + }); + + + //获取客户发票信息 $(document).ready(function() { From 856f7d00d29db842ce696b6bcee023a97c79240a Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 14 Aug 2024 10:40:15 +0800 Subject: [PATCH 04/10] =?UTF-8?q?[fix]=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=BC=80=E7=A5=A8=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A1=AB=E5=85=85=E5=9B=BD=E7=A8=8E=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E5=89=8D=E9=A1=B5=E9=9D=A2=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E5=B8=81=E7=A7=8D=E7=9A=84=E5=B1=95=E7=A4=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=9B=E6=96=B0=E5=A2=9E=E5=BC=80=E7=A5=A8=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E7=94=B1=E5=BC=80=E7=A5=A8=E9=A2=9D=E5=BA=A6=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E5=8A=A8=E6=80=81=E8=BE=93=E5=85=A5=E5=92=8C=E5=90=AB?= =?UTF-8?q?=E7=A8=8E=E6=80=BB=E4=BB=B7=E5=8A=A8=E6=80=81=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=BE=97=E5=88=B0=EF=BC=9B=E8=B0=83=E6=95=B4=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E5=89=8D=E7=AB=AF=E5=88=97=E8=A1=A8=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FinancialTaxInvoiceServiceImpl.java | 22 ++++++ .../system/salesOrder/makeInvoiceRMB.html | 71 ++++++++++++------- 2 files changed, 69 insertions(+), 24 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java index 12abd152..76a656bd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java @@ -7,7 +7,9 @@ import java.util.List; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial; +import com.ruoyi.financial.mapper.FinancialTaxInvoiceHistoryMapper; import com.ruoyi.financial.mapper.FinancialTaxInvoiceMaterialMapper; import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService; import com.ruoyi.system.domain.SysCustomerVo; @@ -39,6 +41,9 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi @Autowired private IFinancialTaxInvoiceMaterialService invoiceMaterialService; + @Autowired + private FinancialTaxInvoiceHistoryMapper invoiceHistoryMapper; + @Autowired private SysCustomerMapper sysCustomerMapper; @@ -201,6 +206,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi financialTaxInvoice.setApplyUser(loginName); financialTaxInvoice.setBusinessMembers(loginName); + //填充国税发票物料数据 List invoiceMaterialList = financialTaxInvoice.getInvoiceMaterialList(); invoiceMaterialList.parallelStream().forEach(invoiceMaterial -> { invoiceMaterial.setTaxInvoiceCode(taxInvoiceCode); @@ -209,6 +215,22 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi invoiceMaterial.setCreateTime(new Date()); }); invoiceMaterialMapper.insertFinancialTaxInvoiceMaterialBatch(invoiceMaterialList); + + //填充国税发票历史数据 + FinancialTaxInvoiceHistory financialTaxInvoiceHistory = new FinancialTaxInvoiceHistory(); + financialTaxInvoiceHistory.setTaxInvoiceCode(taxInvoiceCode); + financialTaxInvoiceHistory.setSalesOrderCode(financialTaxInvoice.getSalesOrderCode()); + financialTaxInvoiceHistory.setInvoiceAmountRmb(financialTaxInvoice.getInvoiceAmountRmb()); + //financialTaxInvoiceHistory.setInvoiceAmountUsd(financialTaxInvoice.getInvoiceAmountUsd()); + financialTaxInvoiceHistory.setInvoicePurpose(financialTaxInvoice.getInvoicePurpose()); + financialTaxInvoiceHistory.setInvoiceQuotaRatio(financialTaxInvoice.getInvoiceQuotaRatio()); + financialTaxInvoiceHistory.setTaxInvoiceStatus("0");//待审核 + financialTaxInvoiceHistory.setApplyTime(new Date()); + financialTaxInvoiceHistory.setCreateBy(loginName); + financialTaxInvoiceHistory.setCreateTime(new Date()); + invoiceHistoryMapper.insertFinancialTaxInvoiceHistory(financialTaxInvoiceHistory); + + return financialTaxInvoiceMapper.insertFinancialTaxInvoice(financialTaxInvoice); } } diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html index 34a57450..3115902b 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html @@ -25,13 +25,15 @@
-
- - -
+
+ + +
@@ -174,7 +176,7 @@
- +
@@ -194,7 +196,7 @@
- + %
@@ -203,7 +205,7 @@
- +
@@ -213,9 +215,6 @@
- - -
@@ -389,24 +388,13 @@ field: 'invoiceHistoryId', visible: false }, - { - title: '国税发票单号', - field: 'taxInvoiceCode', - }, - { - title: '发票状态', //(0待审核、1待开具、2已开具、3审核拒绝) - field: 'taxInvoiceStatus', - formatter: function(value, row, index) { - return $.table.selectDictLabel(taxInvoiceStatusDatas, value); - } - }, { title: '申请时间', field: 'applyTime', }, { - title: '财务员', - field: 'financeMembers', + title: '国税发票单号', + field: 'taxInvoiceCode', }, { title: '开票额度比例', @@ -416,16 +404,28 @@ title: '开票金额(RMB)', field: 'invoiceAmountRmb', }, + { title: '开票用途', field: 'invoicePurpose', }, + { + title: '发票状态', //(0待审核、1待开具、2已开具、3审核拒绝) + field: 'taxInvoiceStatus', + formatter: function(value, row, index) { + return $.table.selectDictLabel(taxInvoiceStatusDatas, value); + } + }, + { + title: '财务员', + field: 'financeMembers', + }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); + actions.push('详情 '); return actions.join(''); } }] @@ -528,6 +528,29 @@ } + + //通过监听额度比例输入框的值,动态计算开票金额 + $(document).ready(function() { + + var invoiceAmountRmbInput = $('#invoiceAmountRmbInput'); + var invoiceQuotaRatioInput = $('#invoiceQuotaRatioInput'); + var rmbTaxSumInput = $('#rmbTaxSumInput'); + + //监听开票额度比例输入框的变化 + invoiceQuotaRatioInput.on('input', function() { + var rmbTaxSum = parseFloat(rmbTaxSumInput.val()); + var invoiceQuotaRatio = parseFloat($(this).val()); + if (!isNaN(rmbTaxSum) && !isNaN(invoiceQuotaRatio)) { + //计算开票金额 = 税前总额 * 开票比例 + var invoiceAmountRmb = rmbTaxSum * (invoiceQuotaRatio / 100); + //更新开票金额输入框 + invoiceAmountRmbInput.val(invoiceAmountRmb.toFixed(2)); + } else { + invoiceAmountRmbInput.val(''); + } + }); + }); + \ No newline at end of file From 44de7c27591060ec3667d1b596b28c83428e1e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Wed, 14 Aug 2024 11:11:41 +0800 Subject: [PATCH 05/10] =?UTF-8?q?[fix]=20=E4=BB=93=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87mapper=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=8C=89sn=E5=8F=B7=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=AD=E6=96=99=E5=8F=B7=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E5=87=BA=E8=B4=A7=E8=AE=BE?= =?UTF-8?q?=E5=A4=87service=E5=8F=8A=E5=85=B6=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=8C=89sn=E5=8F=B7=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=AD=E6=96=99=E5=8F=B7=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aftersales/mapper/AfterSalesShippingDeviceMapper.java | 2 +- .../aftersales/service/IAfterSalesShippingDeviceService.java | 2 +- .../service/impl/AfterSalesShippingDeviceServiceImpl.java | 4 ++-- .../mapper/aftersales/AfterSalesShippingDeviceMapper.xml | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java index ed533449..253806fa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java @@ -119,5 +119,5 @@ public interface AfterSalesShippingDeviceMapper /* * 根据sn号查询出货设备信息列表 * */ - List selectShippingDeviceListBySnCodeAndMaterialNo(String[] snCode,String materialNo); + List selectShippingDeviceListBySnCodeAndMaterialNo(String[] snCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java index 2f58f853..f1abeedb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java @@ -111,5 +111,5 @@ public interface IAfterSalesShippingDeviceService /* * 根据sn号查询出货设备信息列表 * */ - List selectShippingDeviceListBySnCode(String[] snCode,String materialNo); + List selectShippingDeviceListBySnCode(String[] snCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java index 816e0bb6..cdf63a43 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java @@ -251,7 +251,7 @@ public class AfterSalesShippingDeviceServiceImpl implements IAfterSalesShippingD } @Override - public List selectShippingDeviceListBySnCode(String[] snCode,String materialNo) { - return afterSalesShippingDeviceMapper.selectShippingDeviceListBySnCodeAndMaterialNo(snCode,materialNo); + public List selectShippingDeviceListBySnCode(String[] snCode) { + return afterSalesShippingDeviceMapper.selectShippingDeviceListBySnCodeAndMaterialNo(snCode); } } diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml index 8a497ec5..4fc93874 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml @@ -124,7 +124,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{snCode} - and material_no = #{materialNo} From 0ccb6ab2f78e99c1a001ce204ac74effa17ef978 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 14 Aug 2024 14:15:14 +0800 Subject: [PATCH 06/10] =?UTF-8?q?[feat]=E8=B4=A2=E5=8A=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E6=A0=B9=E6=8D=AE=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=BF=A1=E6=81=AF=E5=A1=AB=E5=85=85=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20=E4=BF=AE=E6=94=B9=E7=A8=8E=E7=8E=87?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=EF=BC=8C=E6=9D=A5=E8=87=AA=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=B5=84=E6=96=99=20=E4=BF=AE=E6=94=B9=20=E9=94=80=E5=94=AE?= =?UTF-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=8C?= =?UTF-8?q?js=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95=EF=BC=8Cjs=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=96=B9=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FinancialTaxInvoiceServiceImpl.java | 43 +- .../com/ruoyi/system/domain/SysCustomer.java | 13 +- .../domain/exportDto/SysCustomerDto.java | 19 +- .../system/salesOrder/makeInvoiceRMB.html | 12 + .../system/salesOrder/makeInvoiceUSD.html | 566 ++++++++++++++++++ .../system/salesOrder/salesOrder.html | 25 +- 6 files changed, 645 insertions(+), 33 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceUSD.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java index 76a656bd..bd95afb5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java @@ -3,8 +3,10 @@ package com.ruoyi.financial.service.impl; import java.math.BigDecimal; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; @@ -22,6 +24,7 @@ import com.ruoyi.financial.domain.FinancialTaxInvoice; import com.ruoyi.financial.service.IFinancialTaxInvoiceService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; /** * 国税发票Service业务层处理 @@ -170,6 +173,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi financialTaxInvoice.setContactNumber(sysSalesOrder.getContactNumber()); financialTaxInvoice.setEnterpriseSum(sysSalesOrder.getEnterpriseSum()); financialTaxInvoice.setMaterialSum(sysSalesOrder.getMaterialSum()); +// financialTaxInvoice.setTaxRate(BigDecimal.valueOf(sysSalesOrder.getTaxRate())); financialTaxInvoice.setRmbTaxSum(BigDecimal.valueOf(sysSalesOrder.getRmbTaxSum())); financialTaxInvoice.setNoRmbSum(BigDecimal.valueOf(sysSalesOrder.getNoRmbSum())); financialTaxInvoice.setUsdTaxSum(BigDecimal.valueOf(sysSalesOrder.getUsdTaxSum())); @@ -179,10 +183,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi financialTaxInvoice.setInvoiceCompanyName(sysCustomerVo.getInvoicingCompanyName()); financialTaxInvoice.setBankAccount(sysCustomerVo.getBankAccount()); financialTaxInvoice.setDepositBank(sysCustomerVo.getDepositBank()); - - - - + financialTaxInvoice.setTaxRate(BigDecimal.valueOf(sysCustomerVo.getTaxRate())); return financialTaxInvoice; } @@ -198,6 +199,8 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi public int makeInvoiceSave(FinancialTaxInvoice financialTaxInvoice) { String loginName = ShiroUtils.getLoginName(); + String salesOrderCode = financialTaxInvoice.getSalesOrderCode(); + financialTaxInvoice.setCreateBy(loginName); financialTaxInvoice.setCreateTime(new Date()); String taxInvoiceCode = redisCache.generateBillNo("FP"); @@ -210,18 +213,41 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi List invoiceMaterialList = financialTaxInvoice.getInvoiceMaterialList(); invoiceMaterialList.parallelStream().forEach(invoiceMaterial -> { invoiceMaterial.setTaxInvoiceCode(taxInvoiceCode); - invoiceMaterial.setSalesOrderCode(financialTaxInvoice.getSalesOrderCode()); + invoiceMaterial.setSalesOrderCode(salesOrderCode); invoiceMaterial.setCreateBy(loginName); invoiceMaterial.setCreateTime(new Date()); }); invoiceMaterialMapper.insertFinancialTaxInvoiceMaterialBatch(invoiceMaterialList); + + //获取历史开票信息 + List financialTaxInvoiceHistories = invoiceHistoryMapper.selectInvoiceHistoryListBySalesOrderCode(salesOrderCode); + //获取除了被审核拒接的历史开票信息 + List filterInvoiceHistories = financialTaxInvoiceHistories.stream().filter(item -> !item.getTaxInvoiceStatus().equals("3")).collect(Collectors.toList()); + //判断历史开票信息是否超出开票限额 + if (!CollectionUtils.isEmpty(filterInvoiceHistories)){ + BigDecimal totalInvoiceQuotaRatio = filterInvoiceHistories.stream().map(FinancialTaxInvoiceHistory::getInvoiceQuotaRatio) + .reduce(BigDecimal.ZERO, BigDecimal::add); + + //判断累计开票比例是否超出开票限额 + if (totalInvoiceQuotaRatio.add(financialTaxInvoice.getInvoiceQuotaRatio()).compareTo(new BigDecimal("100")) > 0 ){ + throw new BusinessException("累计开票比例超出开票限额100%"); + } + + } + + //填充国税发票历史数据 FinancialTaxInvoiceHistory financialTaxInvoiceHistory = new FinancialTaxInvoiceHistory(); financialTaxInvoiceHistory.setTaxInvoiceCode(taxInvoiceCode); - financialTaxInvoiceHistory.setSalesOrderCode(financialTaxInvoice.getSalesOrderCode()); - financialTaxInvoiceHistory.setInvoiceAmountRmb(financialTaxInvoice.getInvoiceAmountRmb()); - //financialTaxInvoiceHistory.setInvoiceAmountUsd(financialTaxInvoice.getInvoiceAmountUsd()); + financialTaxInvoiceHistory.setSalesOrderCode(salesOrderCode); + + if ("1".equals(financialTaxInvoice.getCommonCurrency())){ + financialTaxInvoiceHistory.setInvoiceAmountRmb(financialTaxInvoice.getInvoiceAmountRmb()); + }else { + financialTaxInvoiceHistory.setInvoiceAmountUsd(financialTaxInvoice.getInvoiceAmountUsd()); + } + financialTaxInvoiceHistory.setInvoicePurpose(financialTaxInvoice.getInvoicePurpose()); financialTaxInvoiceHistory.setInvoiceQuotaRatio(financialTaxInvoice.getInvoiceQuotaRatio()); financialTaxInvoiceHistory.setTaxInvoiceStatus("0");//待审核 @@ -230,7 +256,6 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi financialTaxInvoiceHistory.setCreateTime(new Date()); invoiceHistoryMapper.insertFinancialTaxInvoiceHistory(financialTaxInvoiceHistory); - return financialTaxInvoiceMapper.insertFinancialTaxInvoice(financialTaxInvoice); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java index 2a6525fd..2c5352db 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysCustomer.java @@ -88,7 +88,7 @@ public class SysCustomer extends BaseEntity /** 税率 */ @Excel(name = "税率") - private String taxRate; + private Double taxRate; /** 诚信评级 */ @Excel(name = "诚信评级") @@ -556,16 +556,15 @@ public class SysCustomer extends BaseEntity { return confirmTax; } - public void setTaxRate(String taxRate) - { - this.taxRate = taxRate; - } - public String getTaxRate() - { + public Double getTaxRate() { return taxRate; } + public void setTaxRate(Double taxRate) { + this.taxRate = taxRate; + } + public Long getDeliveryAddressId() { return deliveryAddressId; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/exportDto/SysCustomerDto.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/exportDto/SysCustomerDto.java index 933d9003..8e9c4ce3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/exportDto/SysCustomerDto.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/exportDto/SysCustomerDto.java @@ -190,7 +190,7 @@ public class SysCustomerDto extends SysCustomer /** 税率 */ @ExcelProperty("税率") - private String taxRate; + private Double taxRate; /** 国家/地区编号 */ @ExcelProperty("国家/地区编号") @@ -574,16 +574,19 @@ public class SysCustomerDto extends SysCustomer { return confirmTax; } - public void setTaxRate(String taxRate) - { - this.taxRate = taxRate; - } - public String getTaxRate() - { + + @Override + public Double getTaxRate() { return taxRate; } - public void setCountryNumber(String countryNumber) + + @Override + public void setTaxRate(Double taxRate) { + this.taxRate = taxRate; + } + + public void setCountryNumber(String countryNumber) { this.countryNumber = countryNumber; } diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html index 3115902b..21ce9766 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html @@ -91,7 +91,10 @@
+
+ % +
@@ -399,6 +402,13 @@ { title: '开票额度比例', field: 'invoiceQuotaRatio', + formatter: function (value,row,index){ + if (value == null || value == ''){ + return '/'; + }else{ + return value + "%"; + } + } }, { title: '开票金额(RMB)', @@ -478,6 +488,7 @@ $('input[name="invoiceCompanyCode"]').val(details.invoiceCompanyCode); $('input[name="depositBank"]').val(details.depositBank); $('input[name="bankAccount"]').val(details.bankAccount); + $('input[name="taxRate"]').val(details.taxRate); } // 封装清空发票详情的函数 @@ -485,6 +496,7 @@ $('input[name="invoiceCompanyCode"]').val(''); $('input[name="depositBank"]').val(''); $('input[name="bankAccount"]').val(''); + $('input[name="taxRate"]').val(''); } diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceUSD.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceUSD.html new file mode 100644 index 00000000..d236090d --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceUSD.html @@ -0,0 +1,566 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + % +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+

开票物料

+
+
+
+
+
+
+
+ +
+
+

开票历史

+
+
+
+
+
+
+
+ + +
+
+

开票额度

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + % +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html index ea52f23d..a246d4aa 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html @@ -419,22 +419,29 @@ // 定义状态码常量 const AUDIT_STATUS_APPROVED = "1";//审核通过 const INVOICE_ALLOWED = "1";//允许开票 + const DELETE_FLAG = "2"; //作废 // 检查是否选择了恰好一行数据 if (selectedRows.length === 1) { const row = selectedRows[0]; - // 检查是否已审核 - if (row.auditStatus === AUDIT_STATUS_APPROVED) { - // 检查是否允许开票 - if (row.invoice === INVOICE_ALLOWED) { - const invoiceUrl = prefix + "/makeInvoice/" + row.salesOrderId; - $.modal.open("开票", invoiceUrl); + // 检查是否已作废 + if (row.useStatus === DELETE_FLAG) { + showWarning("该订单已作废"); + + }else { + // 检查是否已审核 + if (row.auditStatus === AUDIT_STATUS_APPROVED) { + // 检查是否允许开票 + if (row.invoice === INVOICE_ALLOWED) { + const invoiceUrl = prefix + "/makeInvoice/" + row.salesOrderId; + $.modal.open("开票", invoiceUrl); + } else { + showWarning("该订单不允许开票"); + } } else { - showWarning("该订单不允许开票"); + showWarning("请先审核"); } - } else { - showWarning("请先审核"); } } else { showWarning("请先选择一条销售订单"); From 64efd94ae2eef72bc3f8cf8fb2dfd7b23f4fd59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Wed, 14 Aug 2024 16:45:47 +0800 Subject: [PATCH 07/10] =?UTF-8?q?[feat]=20=E4=BB=93=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E5=87=BA=E8=B4=A7=E5=8D=95=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=87=BA=E8=B4=A7=E5=8D=95mapper=E6=8C=89=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E6=80=BB=E5=92=8C=E5=87=BA=E5=BA=93=E6=95=B0?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java | 5 +++++ .../resources/mapper/warehouse/WarehouseOutOrderMapper.xml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java index 5960c0fc..2aac61f5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java @@ -104,4 +104,9 @@ public interface WarehouseOutOrderMapper * */ WarehouseOutOrder selectWarehouseOutOrderByShippingDeviceId(String shippingDeviceId); + /* + * 根据生产单号查询出库单数据 + * */ + public int sumOutOrderQuantityByMakeNo(String makeNo); + } diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml index be21c038..c0b4b63f 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml @@ -102,6 +102,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where shipping_device_id = #{shippingDeviceId} + insert into warehouse_out_order From 8f8a068b1c8d03273d4c77483327d43cf1f59b73 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 14 Aug 2024 17:29:00 +0800 Subject: [PATCH 08/10] =?UTF-8?q?[feat]=E8=B4=A2=E5=8A=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20=E5=9B=BD?= =?UTF-8?q?=E7=A8=8E=E5=8F=91=E7=A5=A8=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=9B=BD=E7=A8=8E=E5=8F=91=E7=A5=A8-=E5=9B=BD?= =?UTF-8?q?=E5=86=85=E5=89=8D=E7=AB=AF=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E7=85=A7prd=E8=BF=9B=E8=A1=8C=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=EF=BC=9B=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E5=9B=BD?= =?UTF-8?q?=E7=A8=8E=E5=8F=91=E7=A5=A8=E7=89=A9=E6=96=99=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8js=E6=96=B9=E6=B3=95=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=9B=BD=E7=A8=8E=E5=8F=91=E7=A5=A8=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E9=A1=B5=E9=9D=A2=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E5=AE=A1=E6=A0=B8=E5=9B=BD=E7=A8=8E?= =?UTF-8?q?=E5=8F=91=E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Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancialTaxInvoiceController.java | 57 ++- .../FinancialTaxInvoiceMaterialMapper.java | 8 + .../IFinancialTaxInvoiceMaterialService.java | 7 + .../service/IFinancialTaxInvoiceService.java | 5 + ...inancialTaxInvoiceMaterialServiceImpl.java | 13 + .../impl/FinancialTaxInvoiceServiceImpl.java | 16 + .../FinancialTaxInvoiceMaterialMapper.xml | 7 +- .../financial/taxInvoice/auditInvoiceRMB.html | 350 ++++++++++++++++++ .../financial/taxInvoice/taxInvoice.html | 53 ++- 9 files changed, 498 insertions(+), 18 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java index 9696e92f..1e877bd5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialTaxInvoiceController.java +++ b/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 list = taxInvoiceMaterialService.getInvoiceMaterialListByCode(taxInvoiceCode); + return getDataTable(list); + } + + + /** * 修改国税发票 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceMaterialMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceMaterialMapper.java index 6b21f08b..5e107814 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceMaterialMapper.java +++ b/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 selectFinancialTaxInvoiceMaterialByCode(String taxInvoiceCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceMaterialService.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceMaterialService.java index 1e1ba507..afcc6912 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceMaterialService.java +++ b/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 getInvoiceMaterialListByCode(String taxInvoiceCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java index 1899df70..52436aa2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceService.java +++ b/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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceMaterialServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceMaterialServiceImpl.java index a5084197..ff2f5e95 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceMaterialServiceImpl.java +++ b/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 getInvoiceMaterialListByCode(String taxInvoiceCode) { + + return financialTaxInvoiceMaterialMapper.selectFinancialTaxInvoiceMaterialByCode(taxInvoiceCode); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java index bd95afb5..ae49d7ef 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java +++ b/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); + } + } } diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMaterialMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMaterialMapper.xml index 83ae933a..06445568 100644 --- a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMaterialMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMaterialMapper.xml @@ -48,7 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where invoice_material_id = #{invoiceMaterialId} - + + + insert into financial_tax_invoice_material diff --git a/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html b/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html new file mode 100644 index 00000000..3348fe78 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html @@ -0,0 +1,350 @@ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + % +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+

开票物料

+
+
+
+
+
+
+
+ +
+
+

开票额度

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + % +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html b/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html index 242e2de3..12df03f4 100644 --- a/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html +++ b/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/taxInvoice.html @@ -99,25 +99,22 @@ \ No newline at end of file From 71cf4e080685910471c0ee5b376a76fbdde99b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Wed, 14 Aug 2024 17:41:06 +0800 Subject: [PATCH 09/10] =?UTF-8?q?[fix]=20=E5=94=AE=E5=90=8E=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E5=AE=A2=E8=AF=89=E9=80=9A=E7=9F=A5=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AE=A2=E8=AF=89=E9=80=9A=E7=9F=A5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=A3=80=E6=9F=A5?= =?UTF-8?q?sn=E5=8F=B7=E5=AD=98=E5=9C=A8=E6=96=B9=E6=B3=95=EF=BC=9B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E8=AF=89=E9=80=9A=E7=9F=A5=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E6=95=B0=E9=87=8F=E5=AD=97=E6=AE=B5=EF=BC=9B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E=E5=AE=A2=E8=AF=89=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=AE=9E=E4=BD=93=E7=B1=BB=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=89=A9=E6=96=99=E5=90=88=E8=AE=A1=E3=80=81=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=90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E=E5=90=8E=E5=AE=A2=E8=AF=89=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E6=96=B9=E6=B3=95=E3=80=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=94=AE=E5=90=8E=E5=AE=A2=E8=AF=89=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E6=96=B9=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/AftersalesComplaintNotice.java | 14 +-- .../AftersalesComplaintNoticeDetail.java | 18 ++-- ...salesComplaintNoticeDetailServiceImpl.java | 102 ++++++++++++++---- .../AftersalesComplaintNoticeServiceImpl.java | 57 +++++----- .../aftersales/complaintNotice/add.html | 39 +++++-- .../aftersales/complaintNotice/edit.html | 12 ++- 6 files changed, 168 insertions(+), 74 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNotice.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNotice.java index 219883f8..3c8e4b41 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNotice.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNotice.java @@ -51,11 +51,11 @@ public class AftersalesComplaintNotice extends BaseEntity /** 物料合计 */ @Excel(name = "物料合计") - private String materialSum; + private Integer materialSum; /** 数量合计 */ @Excel(name = "数量合计") - private String enterpriseSum; + private Integer enterpriseSum; /** 交货数量 */ private String deliveryGoodsNum; @@ -146,25 +146,25 @@ public class AftersalesComplaintNotice extends BaseEntity this.materialName = materialName; } - public String getMaterialName() + public String getMaterialName() { return materialName; } - public void setMaterialSum(String materialSum) + public void setMaterialSum(Integer materialSum) { this.materialSum = materialSum; } - public String getMaterialSum() + public Integer getMaterialSum() { return materialSum; } - public void setEnterpriseSum(String enterpriseSum) + public void setEnterpriseSum(Integer enterpriseSum) { this.enterpriseSum = enterpriseSum; } - public String getEnterpriseSum() + public Integer getEnterpriseSum() { return enterpriseSum; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNoticeDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNoticeDetail.java index 14591d71..4383aa60 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNoticeDetail.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNoticeDetail.java @@ -102,14 +102,14 @@ public class AftersalesComplaintNoticeDetail extends BaseEntity /** 已出库数量 */ @Excel(name = "交货数量",sort = 8) - private String shippedGoodsSum; + private Integer shippedGoodsSum; /** 物料数合计 */ - private String materialSum; + private Integer materialSum; /** 数量合计 */ @Excel(name = "客诉数量",sort = 9) - private String enterpriseSum; + private Integer enterpriseSum; /** 备注 */ @Excel(name = "备注", sort = 14) @@ -324,30 +324,30 @@ public class AftersalesComplaintNoticeDetail extends BaseEntity { return materialProcessMethod; } - public void setShippedGoodsSum(String shippedGoodsSum) + public void setShippedGoodsSum(Integer shippedGoodsSum) { this.shippedGoodsSum = shippedGoodsSum; } - public String getShippedGoodsSum() + public Integer getShippedGoodsSum() { return shippedGoodsSum; } - public void setMaterialSum(String materialSum) + public void setMaterialSum(Integer materialSum) { this.materialSum = materialSum; } - public String getMaterialSum() + public Integer getMaterialSum() { return materialSum; } - public void setEnterpriseSum(String enterpriseSum) + public void setEnterpriseSum(Integer enterpriseSum) { this.enterpriseSum = enterpriseSum; } - public String getEnterpriseSum() + public Integer getEnterpriseSum() { return enterpriseSum; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java index 9b215048..00de6a31 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java @@ -5,14 +5,21 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Optional; +import com.ruoyi.aftersales.domain.AfterSalesShippingDevice; import com.ruoyi.aftersales.domain.AftersalesComplaintNotice; import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO; import com.ruoyi.aftersales.mapper.AftersalesComplaintNoticeMapper; +import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysMakeorderBom; +import com.ruoyi.warehouse.domain.WarehouseOutOrder; +import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; +import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; +import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,6 +45,12 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo @Autowired private AftersalesComplaintNoticeMapper complaintNoticeMapper; + @Autowired + private IAfterSalesShippingDeviceService afterSalesShippingDeviceService; + + @Autowired + private WarehouseOutOrderMapper warehouseOutOrderMapper; + /** * 查询售后客诉通知单详情 * @@ -61,10 +74,41 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo { return aftersalesComplaintNoticeDetailMapper.selectAftersalesComplaintNoticeDetailList(aftersalesComplaintNoticeDetail); } - - @Override + /** + * 导出售后客诉通知单详情列表 + */ + @Override public List selectDetailListByNoticeCodes(String[] complaintNoticeCodes) { - return aftersalesComplaintNoticeDetailMapper.selectDetailListByNoticeCodes(complaintNoticeCodes); + List complaintNoticeDetailList = aftersalesComplaintNoticeDetailMapper.selectDetailListByNoticeCodes(complaintNoticeCodes); + List exportDetailList = new ArrayList<>(); + for (AftersalesComplaintNoticeDetail noticeDetail:complaintNoticeDetailList) { + String snCodes = noticeDetail.getSnCode(); + String[] snCodeArray = snCodes.split(","); + List salesShippingDeviceList = afterSalesShippingDeviceService.selectShippingDeviceListBySnCode(snCodeArray); + for (String snCode:snCodeArray) { + AftersalesComplaintNoticeDetail exportDetail = new AftersalesComplaintNoticeDetail(); + Optional matchingDevice = salesShippingDeviceList.stream() + .filter(detail -> detail.getSnCode().equals(snCode)) + .findFirst(); + matchingDevice.ifPresent(detail -> { + exportDetail.setCustomerId(noticeDetail.getCustomerId()); + exportDetail.setCustomerName(noticeDetail.getCustomerName()); + exportDetail.setDeviceModelCode(detail.getDeviceModelCode()); + exportDetail.setDeviceModelName(detail.getMaterialName()); + exportDetail.setMakeNo(detail.getSalesOrderCode()); + exportDetail.setDeviceRunningNumber(detail.getDeviceRunningNumber()); + exportDetail.setShippedGoodsSum(noticeDetail.getShippedGoodsSum()); + exportDetail.setEnterpriseSum(1); + exportDetail.setComplaintProblem(noticeDetail.getComplaintProblem()); + exportDetail.setAdverseReportUrl(noticeDetail.getAdverseReportUrl()); + exportDetail.setEmergencyDegree(noticeDetail.getEmergencyDegree()); + exportDetail.setClosingProcedures(noticeDetail.getClosingProcedures()); + exportDetail.setRemark(noticeDetail.getRemark()); + }); + exportDetailList.add(exportDetail); + } + } + return exportDetailList; } /** @@ -95,35 +139,43 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo String loginName = ShiroUtils.getLoginName(); complaintNoticeDetail.setCreateBy(loginName); complaintNoticeDetail.setCreateTime(DateUtils.getNowDate()); - + String makeNo = complaintNoticeDetail.getMakeNo(); //保存信息到AftersalesComplaintNotice数据表中 complaintNotice.setComplaintNoticeCode(newCode); complaintNotice.setCreateBy(loginName); - complaintNotice.setCreateTime(new Date()); + complaintNotice.setCreateTime(DateUtils.getNowDate()); complaintNotice.setMakeNo(complaintNoticeDetail.getMakeNo()); complaintNotice.setCustomerId(complaintNoticeDetail.getCustomerId()); complaintNotice.setCustomerName(complaintNoticeDetail.getCustomerName()); + complaintNotice.setClosingProcedures("1"); complaintNotice.setEmergencyDegree(complaintNoticeDetail.getEmergencyDegree()); - complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice); + if(complaintNoticeDetail.getAftersalesMaterialVOs()!=null){ + complaintNotice.setMaterialSum(complaintNoticeDetail.getAftersalesMaterialVOs().size()); + } List aftersalesMaterialVOs = complaintNoticeDetail.getAftersalesMaterialVOs(); if (StringUtils.isEmpty(aftersalesMaterialVOs)){ - return aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail); - } - for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) { - complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType()); - complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit()); - complaintNoticeDetail.setMaterialProcessMethod(aftersalesMaterialVO.getMaterialProcessMethod()); - complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName()); - complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe()); - complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo()); - complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl()); - complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand()); - complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem()); - complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode()); - complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl()); aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail); - } + }else{ + for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) { + complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo()); + complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName()); + complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType()); + complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit()); + complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe()); + complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl()); + complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand()); + complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode()); + complaintNoticeDetail.setClosingProcedures("1"); + complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem()); + complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl()); +// int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo); + complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum()); + complaintNotice.setEnterpriseSum(aftersalesMaterialVO.getShippedGoodsSum()); + aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail); + } + } + complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice); return 1; } @@ -142,7 +194,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo //更新主表内容 aftersalesComplaintNotice.setComplaintNoticeCode(aftersalesComplaintNoticeDetail.getComplaintNoticeCode()); aftersalesComplaintNotice.setUpdateBy(loginName); - aftersalesComplaintNotice.setUpdateTime(new Date()); + aftersalesComplaintNotice.setUpdateTime(DateUtils.getNowDate()); aftersalesComplaintNotice.setMakeNo(aftersalesComplaintNoticeDetail.getMakeNo()); aftersalesComplaintNotice.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree()); aftersalesComplaintNotice.setRemark(aftersalesComplaintNoticeDetail.getRemark()); @@ -166,7 +218,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo complaintNoticeDetail.setCreateBy(aftersalesComplaintNoticeDetail.getCreateBy()); complaintNoticeDetail.setCreateTime(aftersalesComplaintNoticeDetail.getCreateTime()); complaintNoticeDetail.setUpdateBy(loginName); - complaintNoticeDetail.setUpdateTime(new Date()); + complaintNoticeDetail.setUpdateTime(DateUtils.getNowDate()); complaintNoticeDetail.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId()); complaintNoticeDetail.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName()); complaintNoticeDetail.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree()); @@ -183,6 +235,8 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem()); complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode()); complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl()); + complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum()); + complaintNoticeDetail.setClosingProcedures("1"); aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail); } return 1; @@ -261,6 +315,8 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo aftersalesMaterialVO.setMaterialUnit(complaintNoticeDetail.getMaterialUnit()); aftersalesMaterialVO.setMaterialType(complaintNoticeDetail.getMaterialType()); aftersalesMaterialVO.setComplaintProblem(complaintNoticeDetail.getComplaintProblem()); + aftersalesMaterialVO.setShippedGoodsSum(complaintNoticeDetail.getShippedGoodsSum()); + aftersalesMaterialVO.setEmergencyDegree(complaintNoticeDetail.getEmergencyDegree()); aftersalesMaterialVO.setSnCode(complaintNoticeDetail.getSnCode()); aftersalesMaterialVO.setAdverseReportUrl(complaintNoticeDetail.getAdverseReportUrl()); aftersalesMaterialVOs.add(aftersalesMaterialVO); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java index fe9a0305..8d446930 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java @@ -16,10 +16,13 @@ import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysMakeOrder; import com.ruoyi.system.domain.SysMakeorderBom; +import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.mapper.SysMakeOrderMapper; import com.ruoyi.system.mapper.SysMakeorderBomMapper; +import com.ruoyi.system.mapper.SysSalesOrderChildMapper; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; +import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -49,7 +52,10 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain private SysMakeorderBomMapper sysMakeorderBomMapper; @Autowired - private WarehouseOutOrderDetailMapper warehouseOutOrderDetailMapper; + private WarehouseOutOrderMapper warehouseOutOrderMapper; + + @Autowired + private SysSalesOrderChildMapper sysSalesOrderChildMapper; /** * 查询售后客诉通知单 @@ -191,34 +197,33 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain public List selectMaterialInfoByMakeNo(String makeNo) { ArrayList aftersalesMaterialVOs = new ArrayList<>(); - List sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo); - if (StringUtils.isEmpty(sysMakeorderBoms)){ +// List sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo); +// if (StringUtils.isEmpty(sysMakeorderBoms)){ +// // 记录日志 +// log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo); +// } + SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectSaleNoByMakeNo(makeNo); + if (StringUtils.isEmpty(sysMakeOrder.getSaleNo())){ + log.warn("未查找到与生产订单关联的销售订单, 生产订单号: {}", makeNo); + } + List sysSalesOrderChildList = sysSalesOrderChildMapper.selectSysSalesOrderChildByQuoteId(sysMakeOrder.getSaleNo()); + + if (StringUtils.isEmpty(sysSalesOrderChildList)){ // 记录日志 - log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo); + log.warn("未查找到与销售订单关联的物料相关数据, 销售订单号: {}", sysMakeOrder.getSaleNo()); } - List outOrderDetails = warehouseOutOrderDetailMapper.selectOutOrderDetailListByMakeNo(makeNo); - for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) { + int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo); + for (SysSalesOrderChild salesOrderChild : sysSalesOrderChildList) { AftersalesMaterialVO aftersalesMaterialVO = new AftersalesMaterialVO(); - aftersalesMaterialVO.setMaterialNo(sysMakeorderBom.getMaterialNo()); - if (StringUtils.isEmpty(outOrderDetails)){ - aftersalesMaterialVO.setShippedGoodsSum(0); - }else { - Optional matchingDetail = outOrderDetails.stream() - .filter(detail -> detail.getMaterialNo().equals(sysMakeorderBom.getMaterialNo())) - .findFirst(); - - matchingDetail.ifPresent(detail -> { - int sum = detail.getHasOutOrderSum(); - aftersalesMaterialVO.setShippedGoodsSum(detail.getHasOutOrderSum()==null?0:detail.getHasOutOrderSum()); - }); - } - aftersalesMaterialVO.setMaterialBrand(sysMakeorderBom.getBrand()); - aftersalesMaterialVO.setMaterialDescribe(sysMakeorderBom.getDescribe()); - aftersalesMaterialVO.setMaterialName(sysMakeorderBom.getMaterialName()); - aftersalesMaterialVO.setMaterialProcessMethod(sysMakeorderBom.getProcessMethod()); - aftersalesMaterialVO.setMaterialPhotourl(sysMakeorderBom.getPhotoUrl()); - aftersalesMaterialVO.setMaterialUnit(sysMakeorderBom.getUnit()); - aftersalesMaterialVO.setMaterialType(sysMakeorderBom.getMaterialType()); + aftersalesMaterialVO.setMaterialNo(salesOrderChild.getMaterialCode()); + aftersalesMaterialVO.setShippedGoodsSum(totalQuantity); + aftersalesMaterialVO.setMaterialBrand(salesOrderChild.getBrand()); + aftersalesMaterialVO.setMaterialDescribe(salesOrderChild.getDescribe()); + aftersalesMaterialVO.setMaterialName(salesOrderChild.getMaterialName()); + aftersalesMaterialVO.setMaterialProcessMethod(salesOrderChild.getProcessMethod()); + aftersalesMaterialVO.setMaterialPhotourl(salesOrderChild.getPhotoUrl()); + aftersalesMaterialVO.setMaterialUnit(salesOrderChild.getUnit()); + aftersalesMaterialVO.setMaterialType(salesOrderChild.getMaterialType()); aftersalesMaterialVOs.add(aftersalesMaterialVO); } return aftersalesMaterialVOs; diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html b/ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html index b9df29dc..bdd1cb2f 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html @@ -331,6 +331,16 @@ field: 'snCode', editable: { type: 'text', // 表示该列可以被编辑为文本 + validate: function(value, row) { + // 检查 SN 号是否已存在 + // var materialNo = row.materialNo; + // checkSnCodeExists(materialNo, value, function(exists) { + // if (!exists) { + // // 如果 SN 号不存在,则返回错误信息 + // return '该SN号不存在!'; + // } + // }); + } }, }, @@ -342,13 +352,13 @@ }, }, { - title: '售后问题', - field: 'adverseReportUrl', - editable: { - type: 'text', // 表示该列可以被编辑为文本 - - // 可以在这里定义更多编辑行为,比如验证、提交等 - }, + // title: '售后问题', + // field: 'adverseReportUrl', + // editable: { + // type: 'text', // 表示该列可以被编辑为文本 + // + // // 可以在这里定义更多编辑行为,比如验证、提交等 + // }, }, { title: '不良报告', @@ -385,7 +395,20 @@ }; $.table.init(options); }) - + function checkSnCodeExists(materialNo,snCode, callback) { + $.ajax({ + url: ctx + 'aftersales/complaintNotice/checkSnCode', + method: 'POST', + data: { materialNo: materialNo,snCode: snCode }, + success: function(response) { + callback(response.exists); // 假设响应中有一个布尔值表示是否存在 + }, + error: function(xhr, status, error) { + console.error(error); + callback(false); // 如果出现错误,默认认为不存在 + } + }); + } function doSubmit(index, layero,uniqueId){ console.log(uniqueId); diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/edit.html b/ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/edit.html index 559c0e95..d2138439 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/edit.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/edit.html @@ -100,6 +100,7 @@ "materialUnit": item.materialUnit, "materialBrand": item.materialBrand, "materialDescribe": item.materialDescribe, + "shippedGoodsSum": item.shippedGoodsSum, "snCode": item.snCode, "complaintProblem": item.complaintProblem, // "emergencyDegree": item.emergencyDegree, @@ -283,6 +284,10 @@ title: '描述', field: 'materialDescribe', }, + { + title: '已出库数', + field: 'shippedGoodsSum', + }, { title: 'SN号', field: 'snCode', @@ -299,13 +304,18 @@ }, }, { - title: '售后问题', + title: '不良报告', field: 'adverseReportUrl', editable: { type: 'text', // 表示该列可以被编辑为文本 // 可以在这里定义更多编辑行为,比如验证、提交等 }, }, + { + title: '是否结案', + field: 'closingProcedures', + visible: false, + }, { title: '操作', align: 'center', From 4eda27ee7b83750eb39692f8904da52fc00255ab Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 14 Aug 2024 19:28:02 +0800 Subject: [PATCH 10/10] =?UTF-8?q?[feat]=E8=B4=A2=E5=8A=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E4=BF=AE=E6=94=B9=E5=AE=A1=E6=A0=B8=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=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=9A=E5=A4=9A=E8=A1=A8=E6=93=8D=E4=BD=9C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BA=8B=E5=8A=A1=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=80=9A=E8=BF=87=E5=92=8C=E6=8B=92=E7=BB=9D=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=88=B0=E5=9B=BD=E7=A8=8E=E5=8F=91=E7=A5=A8=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=A1=A8=EF=BC=8C=E5=90=8C=E6=97=B6=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancialTaxInvoiceHistoryMapper.java | 8 + .../impl/FinancialTaxInvoiceServiceImpl.java | 35 +- .../FinancialTaxInvoiceHistoryMapper.xml | 5 + .../financial/taxInvoice/auditInvoiceRMB.html | 8 - .../financial/taxInvoice/auditInvoiceUSD.html | 337 ++++++++++++++++++ 5 files changed, 376 insertions(+), 17 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java index 5dd24a68..d0dffa28 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java @@ -82,4 +82,12 @@ public interface FinancialTaxInvoiceHistoryMapper * @return 结果 */ List selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode); + + /** + * 根据发票编号查询发票历史记录 + * + * @param taxInvoiceCode 发票编号 + * @return 结果 + */ + FinancialTaxInvoiceHistory selectInvoiceHistoryByInvoiceCode(String taxInvoiceCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java index ae49d7ef..8d9c3494 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java @@ -53,6 +53,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi @Autowired private RedisCache redisCache; + /** * 查询国税发票 * @@ -263,15 +264,31 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi /** * 审核国税发票 */ + @Transactional(rollbackFor = Exception.class) @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); - } + public int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice, String taxInvoiceStatus) { + String loginName = ShiroUtils.getLoginName(); + String taxInvoiceCode = financialTaxInvoice.getTaxInvoiceCode(); + FinancialTaxInvoiceHistory invoiceHistory = invoiceHistoryMapper.selectInvoiceHistoryByInvoiceCode(taxInvoiceCode); + invoiceHistory.setUpdateTime(new Date()); + invoiceHistory.setUpdateBy(loginName); + + financialTaxInvoice.setUpdateTime(new Date()); + financialTaxInvoice.setUpdateBy(loginName); + if ("1".equals(taxInvoiceStatus)) { + //审核通过 + invoiceHistory.setTaxInvoiceStatus(taxInvoiceStatus); + invoiceHistoryMapper.updateFinancialTaxInvoiceHistory(invoiceHistory); + + financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus); + return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); + } else { + //审核拒绝 + invoiceHistory.setTaxInvoiceStatus(taxInvoiceStatus); + invoiceHistoryMapper.updateFinancialTaxInvoiceHistory(invoiceHistory); + + financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus); + return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); + } } } diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml index 5edd1493..9e16e0de 100644 --- a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml @@ -44,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where sales_order_code = #{salesOrderCode} + + insert into financial_tax_invoice_history diff --git a/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html b/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html index 3348fe78..4b31eb8d 100644 --- a/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html +++ b/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceRMB.html @@ -314,14 +314,6 @@ title: '物料的不含税单价(RMB)', field: 'noTaxRmb', }, - { - title: '物料的含税单价(美元)', - field: 'taxUsd', - }, - { - title: '物料的不含税单价(美元)', - field: 'noTaxUsd', - }, { title: '已出库数量', field: 'outBoundQuantity', diff --git a/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html b/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html new file mode 100644 index 00000000..720f89c2 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/financial/taxInvoice/auditInvoiceUSD.html @@ -0,0 +1,337 @@ + + + + + + + +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + % +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ + +
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+

开票物料

+
+
+
+
+
+
+
+ +
+
+

开票额度

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + % +
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + + + + \ No newline at end of file