代码提交

提交人:陈绍鑫
时间:2024/12/12  18:00
内容:成本测算插件
This commit is contained in:
陈绍鑫 2024-12-15 19:49:28 +08:00
parent 5cac03da1e
commit 24b330212f
1 changed files with 9 additions and 7 deletions

View File

@ -195,6 +195,8 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
// 设置垂直居中 // 设置垂直居中
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
titleStyle.setLocked(false);
headCell.setCellStyle(titleStyle); headCell.setCellStyle(titleStyle);
// 合并第1行的前几列合并列数 = excel的列数 // 合并第1行的前几列合并列数 = excel的列数
@ -471,7 +473,7 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
calculation = new Calculation( calculation = new Calculation(
String.valueOf(getcellvallue(row.getCell(6))),//科目编码 String.valueOf(getcellvallue(row.getCell(6))),//科目编码
String.valueOf(getcellvallue(row.getCell(7))),//科目名称 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(9))),//估算口径
String.valueOf(getcellvallue(row.getCell(10))),//单位 String.valueOf(getcellvallue(row.getCell(10))),//单位
(double)getcellvallue(row.getCell(11)),//工程量基数 (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(16)),//单价调整值
(double)getcellvallue(row.getCell(17)),//单价 (double)getcellvallue(row.getCell(17)),//单价
(double)getcellvallue(row.getCell(18)),//合价含税 (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)))//备注 String.valueOf(getcellvallue(row.getCell(20)))//备注
); );
} catch (Exception e) { } catch (Exception e) {
@ -688,7 +691,7 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
break; break;
case "估算口径": case "估算口径":
// 1. 设置下拉项数据 // 1. 设置下拉项数据
String[] products1 = {"按建筑面积指标", "按施工面积指标", "按项估入", "其他计算口径","个/套/组/件/点位"}; String[] products1 = {"按建筑面积指标", "按施工面积指标", "按项估入", "其他计算口径","个/套/组/件/点位","按点位估入","按个估入","按扩电容量","按套估入","费率","以上述费用合计数为基数"};
DataValidationHelper helper1 = sheet.getDataValidationHelper(); DataValidationHelper helper1 = sheet.getDataValidationHelper();
DataValidationConstraint constraint1 = helper1.createExplicitListConstraint(products1); DataValidationConstraint constraint1 = helper1.createExplicitListConstraint(products1);
int totalRowCount1 = sheet.getLastRowNum() + 1; int totalRowCount1 = sheet.getLastRowNum() + 1;
@ -706,7 +709,7 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
sheet.createFreezePane(0, 4); // 0列, 4行 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++) { for (int i = 0; i < numColumns; i++) {
Cell cell = sheet.getRow(3).getCell(i); Cell cell = sheet.getRow(3).getCell(i);
if (cell==null){ if (cell==null){
@ -745,9 +748,8 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
} }
} }
} }
//设置合并
//设置保护单元格密码
sheet.protectSheet("password"); // sheet.protectSheet("password");
} }
} }