1.优化合同清单导入功能

S
This commit is contained in:
weiyunlong 2025-03-04 10:53:32 +08:00
parent a2bece6b4d
commit dddd798ad0
1 changed files with 3 additions and 1 deletions

View File

@ -47,6 +47,7 @@ import javax.script.ScriptException;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;
@ -384,6 +385,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
}
break;
case 8:
//todo:保留几位有效数字
Cell cell1 = row.getCell(6);
Cell cell2 = row.getCell(7);
if (cell1 != null && cell2 != null && StringUtils.isNotEmpty(cell1.toString()) && StringUtils.isNotEmpty(cell2.toString())) {
@ -391,7 +393,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
try {
double value1 = cell1.getNumericCellValue();
double value2 = cell2.getNumericCellValue();
results = BigDecimal.valueOf(value1 * value2);
results = BigDecimal.valueOf(value1 * value2).setScale(3, RoundingMode.HALF_UP);
contractsummarylist.set("qeug_amounttotal", results); // 合计金额
} catch (Exception e) {
this.getView().showErrorNotification("清单汇总识别--生成明细失败:" + e.getMessage());