From 1f79b84dc378ddde4625ed0b4446cd67be9e1847 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Wed, 19 Mar 2025 15:18:04 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E5=90=88=E5=90=8C=E8=AF=86?= =?UTF-8?q?=E5=88=ABexcel=E6=8A=A5=E9=94=99=E7=B2=BE=E7=A1=AE=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S --- .../recon/formplugin/ContractFormPlugin.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main/java/shkd/repc/recon/formplugin/ContractFormPlugin.java b/main/java/shkd/repc/recon/formplugin/ContractFormPlugin.java index a4d4566..8f29363 100644 --- a/main/java/shkd/repc/recon/formplugin/ContractFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/ContractFormPlugin.java @@ -34,6 +34,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.DeleteServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.bos.util.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.Cell; @@ -342,6 +343,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList contractsummarylist.set("qeug_contractid", this.getModel().getDataEntity().getPkValue().toString());//合同id contractsummarylist.set("qeug_sheetname", sheet.getSheetName());//sheet名字 for (Cell cell : row) { + int rowNum1 = row.getRowNum() +1;//excel行号 int columnIndex = cell.getColumnIndex(); switch (columnIndex) { case 0: @@ -371,7 +373,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList BigDecimal results = new BigDecimal(value6); contractsummarylist.set("qeug_decimalqty", results); } catch (NumberFormatException e) { - this.getView().showErrorNotification("清单汇总识别--生成明细失败: 数量列格式错误"); + this.getView().showErrorNotification("清单汇总识别--生成明细失败: 工程量格式错误,行数:"+ rowNum1); return; } } @@ -383,7 +385,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList BigDecimal results = new BigDecimal(value7); contractsummarylist.set("qeug_unitprice", results);// 综合单价 } catch (NumberFormatException e) { - this.getView().showErrorNotification("清单汇总识别--生成明细失败: 单价列格式错误"); + this.getView().showErrorNotification("清单汇总识别--生成明细失败: 单价列格式错误,行数:"+ rowNum1); return; } } @@ -398,7 +400,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList contractsummarylist.set("qeug_amounttotal", results); // 合计金额 amounttotal = amounttotal.add(results); } catch (NumberFormatException e) { - this.getView().showErrorNotification("清单汇总识别--生成明细失败: 合计金额列格式错误"); + this.getView().showErrorNotification("清单汇总识别--生成明细失败: 合计金额列格式错误,行数:"+ rowNum1); return; } } @@ -409,7 +411,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList try { contractsummarylist.set("qeug_artificial", new BigDecimal(value9));// 人工单价 } catch (NumberFormatException e) { - this.getView().showErrorNotification("清单汇总识别--生成明细失败: 人工单价列格式错误"); + this.getView().showErrorNotification("清单汇总识别--生成明细失败: 人工单价列格式错误,行数:"+ rowNum1); return; } } @@ -420,7 +422,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList try { contractsummarylist.set("qeug_provisional", new BigDecimal(value10));// 辅材单价 } catch (NumberFormatException e) { - this.getView().showErrorNotification("清单汇总识别--生成明细失败: 辅材单价列格式错误"); + this.getView().showErrorNotification("清单汇总识别--生成明细失败: 辅材单价列格式错误,行数:"+ rowNum1); return; } } @@ -431,7 +433,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList try { contractsummarylist.set("qeug_unitpriceofmainmater", new BigDecimal(value11));// 主材单价 } catch (NumberFormatException e) { - this.getView().showErrorNotification("清单汇总识别--生成明细失败: 主材单价列格式错误"); + this.getView().showErrorNotification("清单汇总识别--生成明细失败: 主材单价列格式错误,行数:"+ rowNum1); return; } } @@ -442,7 +444,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList try { contractsummarylist.set("qeug_mechanicalunitprice", new BigDecimal(value12));// 机械,设备单价 } catch (NumberFormatException e) { - this.getView().showErrorNotification("清单汇总识别--生成明细失败: 机械设备单价列格式错误"); + this.getView().showErrorNotification("清单汇总识别--生成明细失败: 机械设备单价列格式错误,行数:"+ rowNum1); return; } } @@ -507,7 +509,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList this.getView().download(url); } } else { - this.getView().showErrorNotification("请先联系管理员维护模板附件管理中的清单模板模板!"); + this.getView().showErrorNotification("请先联系管理员维护模板附件管理中的清单模板!"); } break; default: