Browse Source

[fix] 销售管理

按照万材要求:新增导出销售出货发票vantritek和销售出货发票infinity模板,删除之前的两个模板
dev
liuxiaoxu 2 months ago
parent
commit
1c574be034
  1. 19
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java
  2. 7
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  3. BIN
      ruoyi-admin/src/main/resources/static/attachments/销售出货发票infinity.xlsx
  4. BIN
      ruoyi-admin/src/main/resources/static/attachments/销售出货发票vantritek.xlsx
  5. 4
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

19
ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesShippingInformationServiceImpl.java

@ -647,7 +647,7 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
* */ * */
@Override @Override
public void exportInvoiceInfinity(String shippingInformationCode, HttpServletResponse response) { public void exportInvoiceInfinity(String shippingInformationCode, HttpServletResponse response) {
String fileName = "销售出货发票1.xlsx"; String fileName = "销售出货发票infinity.xlsx";
try { try {
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName); String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName);
@ -688,7 +688,17 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
exportShippingInvoiceDtos.add(exportShippingInvoiceDto); exportShippingInvoiceDtos.add(exportShippingInvoiceDto);
} }
BigDecimal total = BigDecimal.ZERO;
String commonCurrency = sysSalesOrderVo.getCommonCurrency();
if (StringUtils.isNotEmpty(commonCurrency)){
// 使用 Optional 来安全处理可能为 null 的情况,并使用 reduce 方法来合计 BigDecimal 值
total = salesShippingInformationDetails.stream()
.map(detail -> CURRENCY_RMB.equals(commonCurrency)
? detail.getAllNoTaxRmb() // 如果是人民币,获取人民币字段
: detail.getAllNoTaxDollar()) // 否则,获取美元字段
.filter(Objects::nonNull) // 过滤掉可能存在的 null 值
.reduce(BigDecimal.ZERO, BigDecimal::add); // 合计 BigDecimal 值
}
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
@ -700,6 +710,7 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
map.put("orderDate",salesShippingInformation.getOrderDate()); map.put("orderDate",salesShippingInformation.getOrderDate());
map.put("originCountry",salesShippingInformation.getOriginCountry()); map.put("originCountry",salesShippingInformation.getOriginCountry());
map.put("tradeTerms",salesShippingInformation.getTradeTerms()); map.put("tradeTerms",salesShippingInformation.getTradeTerms());
map.put("total",total);
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileAbsolutePath).build(); ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileAbsolutePath).build();
@ -721,7 +732,7 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
* */ * */
@Override @Override
public void exportInvoiceVantritek(String shippingInformationCode, HttpServletResponse response) { public void exportInvoiceVantritek(String shippingInformationCode, HttpServletResponse response) {
String fileName = "销售出货发票2.xlsx"; String fileName = "销售出货发票vantritek.xlsx";
try { try {
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName); String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName);
@ -763,8 +774,6 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform
} }
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("customerContact",salesShippingInformation.getCustomerContact()); map.put("customerContact",salesShippingInformation.getCustomerContact());
map.put("customerContactAddress",salesShippingInformation.getCustomerContactAddress()); map.put("customerContactAddress",salesShippingInformation.getCustomerContactAddress());

7
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java

@ -1219,7 +1219,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
* */ * */
@Override @Override
public void exportShippingInvoiceOne(String outOrderCode, HttpServletResponse response) { public void exportShippingInvoiceOne(String outOrderCode, HttpServletResponse response) {
String fileName = "销售出货发票1.xlsx"; String fileName = "销售出货发票infinity.xlsx";
try { try {
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName); String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName);
@ -1306,9 +1306,6 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
exportShippingInvoiceDtos.add(exportShippingInvoiceDto); exportShippingInvoiceDtos.add(exportShippingInvoiceDto);
} }
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("customerContact",sysSalesShippingInform.getCustomerContact()); map.put("customerContact",sysSalesShippingInform.getCustomerContact());
map.put("customerContactAddress",sysSalesShippingInform.getCustomerContactAddress()); map.put("customerContactAddress",sysSalesShippingInform.getCustomerContactAddress());
@ -1335,7 +1332,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
* */ * */
@Override @Override
public void exportShippingInvoiceTwo(String outOrderCode, HttpServletResponse response) { public void exportShippingInvoiceTwo(String outOrderCode, HttpServletResponse response) {
String fileName = "销售出货发票2.xlsx"; String fileName = "销售出货发票vantritek.xlsx";
try { try {
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName); String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName);

BIN
ruoyi-admin/src/main/resources/static/attachments/销售出货发票infinity.xlsx

Binary file not shown.

BIN
ruoyi-admin/src/main/resources/static/attachments/销售出货发票vantritek.xlsx

Binary file not shown.

4
ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

@ -70,10 +70,10 @@
</a> </a>
<a class="btn btn-success" onclick="exportShippingInvoiceOne()" shiro:hasPermission="system:salesShippingInform:exportShippingInvoiceOne"> <a class="btn btn-success" onclick="exportShippingInvoiceOne()" shiro:hasPermission="system:salesShippingInform:exportShippingInvoiceOne">
<i class="fa fa-download"></i> 导出销售出货发票1 <i class="fa fa-download"></i> 导出销售出货发票infinity
</a> </a>
<a class="btn btn-success" onclick="exportShippingInvoiceTwo()" shiro:hasPermission="system:salesShippingInform:exportShippingInvoiceTwo"> <a class="btn btn-success" onclick="exportShippingInvoiceTwo()" shiro:hasPermission="system:salesShippingInform:exportShippingInvoiceTwo">
<i class="fa fa-download"></i> 导出销售出货发票2 <i class="fa fa-download"></i> 导出销售出货发票vantritek
</a> </a>
<a class="btn btn-success" onclick="exportShippingInformOrder()" shiro:hasPermission="system:salesShippingInform:exportShippingInformOrder"> <a class="btn btn-success" onclick="exportShippingInformOrder()" shiro:hasPermission="system:salesShippingInform:exportShippingInformOrder">

Loading…
Cancel
Save