Commit 3a96e170 authored by huyf's avatar huyf

海运应收汇总bug

parent 88200fdd
...@@ -20,6 +20,7 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; ...@@ -20,6 +20,7 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.infra.service.file.FileService; import cn.iocoder.yudao.module.infra.service.file.FileService;
import cn.iocoder.yudao.module.order.dto.OrderBackInfoDto; import cn.iocoder.yudao.module.order.dto.OrderBackInfoDto;
import cn.iocoder.yudao.module.order.service.order.*; import cn.iocoder.yudao.module.order.service.order.*;
import cn.iocoder.yudao.module.order.vo.orderItem.OrderItemBackVO;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO; import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxMergePkgDO; import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxMergePkgDO;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxPkgOrderDO; import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxPkgOrderDO;
...@@ -42,8 +43,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -42,8 +43,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
...@@ -470,7 +470,8 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -470,7 +470,8 @@ public class ShipmentReceivableExcelExportListener2 {
map.put("sumNum", orderInfo.getSumNum()); map.put("sumNum", orderInfo.getSumNum());
sum14 = sum14 + orderInfo.getSumNum(); sum14 = sum14 + orderInfo.getSumNum();
} }
map.put("sumVolume", orderInfo.getSumVolume()); map.put("sumVolume", orderInfo.getOrderItemVOList().stream().map(OrderItemBackVO::getChargeVolume).reduce(BigDecimal.ZERO,BigDecimal::add));
// map.put("sumVolume", orderInfo.getSumVolume());
sum15 = sum15.add(orderInfo.getSumVolume()); sum15 = sum15.add(orderInfo.getSumVolume());
map.put("sumWeight", orderInfo.getSumWeight()); map.put("sumWeight", orderInfo.getSumWeight());
sum16 = sum16.add(orderInfo.getSumWeight()); sum16 = sum16.add(orderInfo.getSumWeight());
...@@ -514,7 +515,7 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -514,7 +515,7 @@ public class ShipmentReceivableExcelExportListener2 {
sum6.multiply(new BigDecimal(0.2)). sum6.multiply(new BigDecimal(0.2)).
setScale(2, RoundingMode.HALF_UP)); setScale(2, RoundingMode.HALF_UP));
headMap.put("BillinTTl", headMap.put("BillinTTl",
currencyFuhaoMap.get(qgCurrency) currencyFuhaoMap.get(yfCurrency)
+ sum6.subtract(sum4).subtract( + sum6.subtract(sum4).subtract(
sum6.multiply(new BigDecimal(0.2)).setScale(2, RoundingMode.HALF_UP))); sum6.multiply(new BigDecimal(0.2)).setScale(2, RoundingMode.HALF_UP)));
...@@ -535,6 +536,8 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -535,6 +536,8 @@ public class ShipmentReceivableExcelExportListener2 {
stringBuffer.append(currencyMap.get(otherMainCurrency)).append(":").append(sum4).append(" ").append(currencyMap.get(otherAssisCurrency)).append(":").append(sum5); stringBuffer.append(currencyMap.get(otherMainCurrency)).append(":").append(sum4).append(" ").append(currencyMap.get(otherAssisCurrency)).append(":").append(sum5);
} }
headMap.put("otherFee", stringBuffer.toString()); headMap.put("otherFee", stringBuffer.toString());
headMap.put("otherFeeMain", currencyMap.get(otherMainCurrency)+":"+sum4);
headMap.put("otherFeeAssis", currencyMap.get(otherAssisCurrency)+":"+sum5);
File fileDir = new File(dir); File fileDir = new File(dir);
if (!fileDir.exists()) { if (!fileDir.exists()) {
// 不存在则创建一个目录 // 不存在则创建一个目录
...@@ -576,6 +579,24 @@ public class ShipmentReceivableExcelExportListener2 { ...@@ -576,6 +579,24 @@ public class ShipmentReceivableExcelExportListener2 {
start = start + count; start = start + count;
} }
} }
//业务数据从12行开始,22列为是否控货
Font font = workbook.createFont();
font.setColor(Font.COLOR_RED); //红色
CellStyle cellStyle=workbook.createCellStyle();
cellStyle.setFont(font);
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setBorderTop(BorderStyle.THIN);
for (int i = 0; i < list.size(); i++) {
if (poiSheet.getRow(i+12).getCell(22).getStringCellValue().equals("YES")) {
for (int i1 = 0; i1 < 29; i1++) {
poiSheet.getRow(i+12).getCell(i1).setCellStyle(cellStyle);
}
}
}
FileOutputStream fileOutputStream = FileOutputStream fileOutputStream =
new FileOutputStream(new File(dir + fileNameMerge)); new FileOutputStream(new File(dir + fileNameMerge));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment