From 24b330212fbbd5a65d564583000cbcadcc414695 Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Sun, 15 Dec 2024 19:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=99=88=E7=BB=8D=E9=91=AB?= =?UTF-8?q?=20=E6=97=B6=E9=97=B4=EF=BC=9A2024/12/12=20=2018=EF=BC=9A00=20?= =?UTF-8?q?=E5=86=85=E5=AE=B9=EF=BC=9A=E6=88=90=E6=9C=AC=E6=B5=8B=E7=AE=97?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formplugin/RecosMeasurecosFormPlugin.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/main/java/shkd/repc/recos/formplugin/RecosMeasurecosFormPlugin.java b/main/java/shkd/repc/recos/formplugin/RecosMeasurecosFormPlugin.java index 3f517f1..fa0613e 100644 --- a/main/java/shkd/repc/recos/formplugin/RecosMeasurecosFormPlugin.java +++ b/main/java/shkd/repc/recos/formplugin/RecosMeasurecosFormPlugin.java @@ -195,6 +195,8 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl // 设置垂直居中 titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); + titleStyle.setLocked(false); + headCell.setCellStyle(titleStyle); // 合并第1行的前几列,合并列数 = excel的列数 @@ -471,7 +473,7 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl calculation = new Calculation( String.valueOf(getcellvallue(row.getCell(6))),//科目编码 String.valueOf(getcellvallue(row.getCell(7))),//科目名称 - String.valueOf(getcellvallue(row.getCell(8))),//财务预算分类 + row.getCell(8).getStringCellValue(),//财务预算分类 String.valueOf(getcellvallue(row.getCell(9))),//估算口径 String.valueOf(getcellvallue(row.getCell(10))),//单位 (double)getcellvallue(row.getCell(11)),//工程量基数 @@ -482,7 +484,8 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl (double)getcellvallue(row.getCell(16)),//单价调整值 (double)getcellvallue(row.getCell(17)),//单价 (double)getcellvallue(row.getCell(18)),//合价(含税) - String.valueOf(getcellvallue(row.getCell(19))),//明细 + row.getCell(19).getStringCellValue(),//明细 +// String.valueOf(getcellvallue(row.getCell(19))),//明细 String.valueOf(getcellvallue(row.getCell(20)))//备注 ); } catch (Exception e) { @@ -688,7 +691,7 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl break; case "估算口径": // 1. 设置下拉项数据 - String[] products1 = {"按建筑面积指标", "按施工面积指标", "按项估入", "其他计算口径","个/套/组/件/点位"}; + String[] products1 = {"按建筑面积指标", "按施工面积指标", "按项估入", "其他计算口径","个/套/组/件/点位","按点位估入","按个估入","按扩电容量","按套估入","费率","以上述费用合计数为基数"}; DataValidationHelper helper1 = sheet.getDataValidationHelper(); DataValidationConstraint constraint1 = helper1.createExplicitListConstraint(products1); int totalRowCount1 = sheet.getLastRowNum() + 1; @@ -706,7 +709,7 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl sheet.createFreezePane(0, 4); // 0列, 4行 //设置公式 - for (int rowNum =5 ; rowNum < sheet.getPhysicalNumberOfRows(); rowNum++) { + for (int rowNum =5 ; rowNum < sheet.getPhysicalNumberOfRows()+1; rowNum++) { for (int i = 0; i < numColumns; i++) { Cell cell = sheet.getRow(3).getCell(i); if (cell==null){ @@ -745,9 +748,8 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl } } } - //设置合并 - - sheet.protectSheet("password"); + //设置保护单元格密码 +// sheet.protectSheet("password"); } }