修复所有Bug
This commit is contained in:
parent
45a69c2296
commit
080fee8bc7
@ -1,7 +1,5 @@
|
||||
package com.xhpc.invoice.service.impl;
|
||||
|
||||
import cn.hutool.extra.mail.MailUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.xhpc.common.core.utils.DateUtils;
|
||||
@ -23,7 +21,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
@ -129,20 +126,20 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
//发送电子发票pdf到接收者邮箱
|
||||
XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectByPrimaryKey(requestData.getInvoiceId());
|
||||
String receiveEmail = xhpcInvoice.getReceiveEmail();
|
||||
//从阿里云上下载下来电子发票
|
||||
String fileUrl = requestData.getEletricInvoiceUrl();
|
||||
File electricInvoiceFile = new File(environment.getProperty("file.serverStoreDisposableFileLocation") + "ElectricInvoice.pdf");
|
||||
HttpUtil.downloadFile(fileUrl, electricInvoiceFile);
|
||||
try {
|
||||
MailUtil.send(receiveEmail, "【小华充电】电子发票", "邮件来自小华充电", false, electricInvoiceFile);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
return Boolean.FALSE;
|
||||
} finally {
|
||||
if (electricInvoiceFile.exists()) {
|
||||
electricInvoiceFile.delete();
|
||||
}
|
||||
}
|
||||
// //从阿里云上下载下来电子发票
|
||||
// String fileUrl = requestData.getEletricInvoiceUrl();
|
||||
// File electricInvoiceFile = new File(environment.getProperty("file.serverStoreDisposableFileLocation") + "ElectricInvoice.pdf");
|
||||
// HttpUtil.downloadFile(fileUrl, electricInvoiceFile);
|
||||
// try {
|
||||
// MailUtil.send(receiveEmail, "【小华充电】电子发票", "邮件来自小华充电", false, electricInvoiceFile);
|
||||
// } catch (Exception e) {
|
||||
// System.out.println(e.getMessage());
|
||||
// return Boolean.FALSE;
|
||||
// } finally {
|
||||
// if (electricInvoiceFile.exists()) {
|
||||
// electricInvoiceFile.delete();
|
||||
// }
|
||||
// }
|
||||
//更新发票数据,并设置用户未阅读状态
|
||||
Long successFlag = xhpcInvoiceMapper.invoiceToUser(requestData);
|
||||
if (successFlag == 0) {
|
||||
@ -561,7 +558,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
writer.addHeaderAlias("titleContent", "抬头内容");
|
||||
writer.addHeaderAlias("dutyNumber", "税号");
|
||||
writer.addHeaderAlias("invoiceContent", "发票内容");
|
||||
writer.addHeaderAlias("invoiceOrderElectricTotalMoney", "总电量金额");
|
||||
writer.addHeaderAlias("invoiceMoney", "发票总金额");
|
||||
writer.addHeaderAlias("invoiceOrderServiceTotalMoney", "总服务费金额");
|
||||
writer.addHeaderAlias("firmAddress", "地址");
|
||||
writer.addHeaderAlias("firmPhone", "电话号码");
|
||||
|
||||
@ -203,7 +203,7 @@
|
||||
i.title_content as titleContent,
|
||||
i.duty_number as dutyNumber,
|
||||
i.invoice_content as invoiceContent,
|
||||
i.invoice_money as invoiceOrderElectricTotalMoney,
|
||||
i.invoice_money as invoiceMoney,
|
||||
i.invoice_order_service_total_money as invoiceOrderServiceTotalMoney,
|
||||
i.firm_address as firmAddress,
|
||||
i.firm_phone as firmPhone,
|
||||
@ -225,7 +225,7 @@
|
||||
i.finance_notes as financeNotes,
|
||||
i.electric_invoice_url as electricInvoiceUrl,
|
||||
case i.is_read when 1 then '已阅读' when 0 then '未阅读' else '该发票还未处理' END as isRead,
|
||||
h.hisotry_serial_number as historySerialNumber,
|
||||
h.history_serial_number as historySerialNumber,
|
||||
h.power_price_total as powerPriceTotal,
|
||||
h.service_price_total as servicePriceTotal,
|
||||
h.promotion_discount as promotionDiscount,
|
||||
@ -724,7 +724,8 @@
|
||||
invoicing_time = #{invoicingTime},
|
||||
electric_invoice_url = #{eletricInvoiceUrl},
|
||||
`status` = #{status},
|
||||
drawer = #{drawer} is_read = 0
|
||||
drawer = #{drawer},
|
||||
is_read = 0
|
||||
WHERE invoice_id = #{invoiceId}
|
||||
</update>
|
||||
<update id="updateByInvoiceId">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user