Commit 8e3bc869 authored by TIANZHI.HU's avatar TIANZHI.HU

对账单打印最新更到pre add by 39135 HuTianzhi

parent 6797ed5f
...@@ -14,8 +14,10 @@ import java.io.*; ...@@ -14,8 +14,10 @@ import java.io.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URL; import java.net.URL;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
...@@ -332,13 +334,27 @@ public class ConExportServiceImpl implements ConExportService { ...@@ -332,13 +334,27 @@ public class ConExportServiceImpl implements ConExportService {
if(x.compareTo((BigDecimal) map1.get("CF_ITEM")) ==0){ if(x.compareTo((BigDecimal) map1.get("CF_ITEM")) ==0){
cell.setCellValue(""); cell.setCellValue("");
}else { }else {
DataFormat df = wb.createDataFormat(); // 此处设置数据格式 // 系统时间大于应收日的才set值
contentTable.setDataFormat(df.getFormat("#,##0.00"));//保留两位小数点 DateFormat dft = new SimpleDateFormat("yyyy-MM-dd");
cell.setCellStyle(contentTable); Date dueDate = dft.parse((String) map1.get("DUE_DATE"));
cell.setCellValue(new DecimalFormat().parse(map1.get("UNRECEIVED_AMOUNT").toString()).doubleValue());// 未收金额 // 去除时分秒
Date now = dft.parse(dft.format(new Date()));
if(Objects.nonNull(dueDate) && now.compareTo(dueDate) == 1){
DataFormat df = wb.createDataFormat(); // 此处设置数据格式
contentTable.setDataFormat(df.getFormat("#,##0.00"));//保留两位小数点
cell.setCellStyle(contentTable);
cell.setCellValue(new DecimalFormat().parse(map1.get("UNRECEIVED_AMOUNT").toString()).doubleValue());// 未收金额
}else{
cell.setCellValue("0");
}
} }
} else { } else {
cell.setCellValue(""); // 未收金额 BigDecimal x = new BigDecimal(100);
if(x.compareTo((BigDecimal) map1.get("CF_ITEM")) ==0){
cell.setCellValue("");
}else{
cell.setCellValue("0"); // 未收金额
}
} }
cell.setCellStyle(contentTable); cell.setCellStyle(contentTable);
} }
......
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