Compare commits

..

2 Commits

Author SHA1 Message Date
陈绍鑫 f97dea2d99 Merge remote-tracking branch 'origin/main' into main 2024-11-20 13:46:05 +08:00
陈绍鑫 b8956e97ad 代码提交
提交人:陈绍鑫
时间:2024/11/19  17:00
内容:成本测算插件
2024-11-20 13:45:54 +08:00
1 changed files with 12 additions and 8 deletions

View File

@ -195,17 +195,11 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
billFont.setFontName("黑体");
billFont.setFontHeight(15);
billStyle.setFont(billFont);
//写入单据列表数据
for (int i = 0; i < excel.size(); i++) {
// i+1是因为前面第1行加了一个标题单据列表数据是从Excel的第2行开始的所以要+1
XSSFRow nrow = sheet.createRow(i+1);
// if (i==0){
// XSSFCellStyle style = workbook.createCellStyle();
// style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
// XSSFColor grayColor = new XSSFColor(new java.awt.Color(128, 128, 128), new DefaultIndexedColorMap());
// style.setFillForegroundColor(grayColor);
// nrow.setRowStyle(style);
// }
for (int u=0;u<excel.get(i).size();u++){
XSSFCell ncell = nrow.createCell(u);
ncell.setCellStyle(billStyle);
@ -332,7 +326,7 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
row.getCell(13).getNumericCellValue(),//单价
row.getCell(11).getNumericCellValue(),//工程量
row.getCell(9).getStringCellValue(),//估算口径
row.getCell(15).getStringCellValue()//备注
String.valueOf(getcellvallue(row.getCell(15)))//备注
);
arrayList.add(calculation);
}
@ -466,4 +460,14 @@ public class RecosMeasurecosFormPlugin extends AbstractFormPlugin implements Upl
String targetFormId = view.getPageCache().get(tabKey);
return StringUtils.isEmpty(targetFormId) ? null : view.getView(targetFormId);
}
public Object getcellvallue(Cell cell) {
if (cell.getCellType() == CellType.STRING) {
String Stringvalue = cell.getStringCellValue();
return Stringvalue;
}else {
double numericCellValue = cell.getNumericCellValue();
return numericCellValue;
}
}
}