|
@@ -0,0 +1,714 @@
|
|
|
+package com.jeeplus.modules.cg.reservemanagementcenter.statisticalTable.util;
|
|
|
+
|
|
|
+import com.jeeplus.modules.cg.reservemanagementcenter.statisticalTable.entity.*;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.*;
|
|
|
+import java.net.URLEncoder;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author: 王强
|
|
|
+ * @create: 2022-08-17 13:59
|
|
|
+ **/
|
|
|
+public class ExcelExportUtil {
|
|
|
+
|
|
|
+ private XSSFCellStyle style = null;
|
|
|
+
|
|
|
+ public static ExcelExportUtil getOne(){
|
|
|
+
|
|
|
+ return new ExcelExportUtil();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 传入excel模板名称 获取workbook对象
|
|
|
+ * @param fileName excel模板名称
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public XSSFWorkbook getWorkbook(String fileName){
|
|
|
+ InputStream inputStream = null;
|
|
|
+ XSSFWorkbook workbook = null;
|
|
|
+ try {
|
|
|
+ File file = new File(this.getClass().getResource("/").getPath() + "/freemarker/excelmodel/"+fileName+".xlsx");
|
|
|
+ inputStream = new FileInputStream(file);// 将excel文件转为输入流
|
|
|
+ workbook = new XSSFWorkbook(inputStream);// 创建个workbook,
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return workbook;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建Cell对象 同时设置style
|
|
|
+ * @param workbook
|
|
|
+ * @param row
|
|
|
+ * @param num
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ Cell crateCell(XSSFWorkbook workbook,Row row, int num){
|
|
|
+ Cell cell = row.createCell(num);
|
|
|
+ if(style == null){
|
|
|
+ style =workbook.createCellStyle();
|
|
|
+ style.setWrapText(true);
|
|
|
+ style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
|
|
|
+ }
|
|
|
+ cell.setCellStyle(style);
|
|
|
+ return cell;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出储备项目概预算统计表信息
|
|
|
+ * @param response
|
|
|
+ * @param workbook
|
|
|
+ * @param list
|
|
|
+ */
|
|
|
+ public void exportBasic(HttpServletResponse response, XSSFWorkbook workbook, List<BudgetStats> list){
|
|
|
+ try {
|
|
|
+ int index = 1;//第一列序号
|
|
|
+ int rowNum = 3;//数据起始列
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
+ Row row = sheet.createRow(rowNum+i);
|
|
|
+ Cell cell0 = crateCell(workbook,row,0); //序号
|
|
|
+ Cell cell1 = crateCell(workbook,row,1); //项目年份
|
|
|
+ Cell cell2 = crateCell(workbook,row,2); //项目性质
|
|
|
+ Cell cell3 = crateCell(workbook,row,3); //需求单位
|
|
|
+ Cell cell4 = crateCell(workbook,row,4); //区域
|
|
|
+ Cell cell5 = crateCell(workbook,row,5); //项目分组
|
|
|
+ Cell cell6 = crateCell(workbook,row,6); //储备批次
|
|
|
+ Cell cell7 = crateCell(workbook,row,7); //供电区域
|
|
|
+ Cell cell8 = crateCell(workbook,row,8); //网格编号
|
|
|
+ Cell cell9 = crateCell(workbook,row,9); //单元格编号
|
|
|
+ Cell cell10 = crateCell(workbook,row,10); //项目储备编号
|
|
|
+ Cell cell11 = crateCell(workbook,row,11); //项目名称
|
|
|
+ Cell cell12 = crateCell(workbook,row,12); //建设必要性及内容
|
|
|
+ Cell cell13 = crateCell(workbook,row,13); //变电站名称
|
|
|
+ Cell cell14 = crateCell(workbook,row,14); //线路名称
|
|
|
+ Cell cell15 = crateCell(workbook,row,15); //网架项目划分
|
|
|
+ Cell cell16 = crateCell(workbook,row,16); //需求类型
|
|
|
+ Cell cell17 = crateCell(workbook,row,17); //费用估算
|
|
|
+ Cell cell18 = crateCell(workbook,row,18); //备注
|
|
|
+ Cell cell19 = crateCell(workbook,row,19); //储备进度
|
|
|
+ Cell cell20 = crateCell(workbook,row,20); //是否纳入实施计划
|
|
|
+ Cell cell21 = crateCell(workbook,row,21); //初定实施批次
|
|
|
+ Cell cell22 = crateCell(workbook,row,22); //审前总概算金额(含税)
|
|
|
+ Cell cell23 = crateCell(workbook,row,23); //审前总概算金额(不含税)
|
|
|
+ Cell cell24 = crateCell(workbook,row,24); //审前可抵扣金额(税金)
|
|
|
+ Cell cell25 = crateCell(workbook,row,25); //审前施工费(含税)
|
|
|
+ Cell cell26 = crateCell(workbook,row,26); //审前甲供物资金额(含税)
|
|
|
+ Cell cell27 = crateCell(workbook,row,27); //审前其他费用(含税)
|
|
|
+ Cell cell28 = crateCell(workbook,row,28); //审前前期工程费(含税)
|
|
|
+ Cell cell29 = crateCell(workbook,row,29); //审前勘察费(含税)
|
|
|
+ Cell cell30 = crateCell(workbook,row,30); //审前设计费(含税)
|
|
|
+ Cell cell31 = crateCell(workbook,row,31); //审前监理费(含税)
|
|
|
+ Cell cell32 = crateCell(workbook,row,32); //审后总概算金额(含税)
|
|
|
+ Cell cell33 = crateCell(workbook,row,33); //审后总概算金额(不含税)
|
|
|
+ Cell cell34 = crateCell(workbook,row,34); //审后可抵扣金额(税金)
|
|
|
+ Cell cell35 = crateCell(workbook,row,35); //审后施工费(含税)
|
|
|
+ Cell cell36 = crateCell(workbook,row,36); //审后甲供物资金额(含税)
|
|
|
+ Cell cell37 = crateCell(workbook,row,37); //审后其他费用(含税)
|
|
|
+ Cell cell38 = crateCell(workbook,row,38); //审后前期工程费(含税)
|
|
|
+ Cell cell39 = crateCell(workbook,row,39); //审后勘察费(含税)
|
|
|
+ Cell cell40 = crateCell(workbook,row,40); //审后设计费(含税)
|
|
|
+ Cell cell41 = crateCell(workbook,row,41); //审后监理费(含税)
|
|
|
+ Cell cell42 = crateCell(workbook,row,42); //是否完成概算修改
|
|
|
+ Cell cell43 = crateCell(workbook,row,43); //概算修改完成时间
|
|
|
+
|
|
|
+ BudgetStats budgetStats = list.get(i);
|
|
|
+
|
|
|
+ cell0.setCellValue(String.valueOf(index++));
|
|
|
+ cell1.setCellValue(budgetStats.getProjectYear());
|
|
|
+ cell2.setCellValue(budgetStats.getProjectNature());
|
|
|
+ cell3.setCellValue(budgetStats.getDemandUnit());
|
|
|
+ cell4.setCellValue(budgetStats.getDistrict());
|
|
|
+ cell5.setCellValue(budgetStats.getProjectGroup());
|
|
|
+ cell6.setCellValue(budgetStats.getReserveBatches());
|
|
|
+ cell7.setCellValue(budgetStats.getBlockSupply());
|
|
|
+ cell8.setCellValue(budgetStats.getGridNumber());
|
|
|
+ cell9.setCellValue(budgetStats.getCellNumber());
|
|
|
+ cell10.setCellValue(budgetStats.getProjectReserveId());
|
|
|
+ cell11.setCellValue(budgetStats.getProjectName());
|
|
|
+ cell12.setCellValue(budgetStats.getConstructionNecessityAndContent());
|
|
|
+ cell13.setCellValue(budgetStats.getSubstationName());
|
|
|
+ cell14.setCellValue(budgetStats.getCircuitName());
|
|
|
+ cell15.setCellValue(budgetStats.getNetRackProjectDivide());
|
|
|
+ cell16.setCellValue(budgetStats.getRequirementType());
|
|
|
+
|
|
|
+ String costEstimateStr= budgetStats.getCostEstimate().toString();
|
|
|
+ if(StringUtils.isNotBlank(costEstimateStr)){
|
|
|
+ cell17.setCellValue(Double.parseDouble(costEstimateStr));
|
|
|
+ }
|
|
|
+ cell18.setCellValue(budgetStats.getBasicRemarks());
|
|
|
+ cell19.setCellValue(budgetStats.getReserveProgress());
|
|
|
+ cell20.setCellValue(budgetStats.getImplementPlan());
|
|
|
+ cell21.setCellValue(budgetStats.getImplementBatch());
|
|
|
+ cell22.setCellValue(budgetStats.getPretrialEstimateAmount());
|
|
|
+ cell23.setCellValue(budgetStats.getPretrialEstimateAmountExcludeTax());
|
|
|
+ cell24.setCellValue(budgetStats.getPretrialDeductibleAmount());
|
|
|
+ cell25.setCellValue(budgetStats.getPretrialConstructeConsts());
|
|
|
+ cell26.setCellValue(budgetStats.getPretrialMaterialAmount());
|
|
|
+ cell27.setCellValue(budgetStats.getPretrialOtherExpanses());
|
|
|
+ cell28.setCellValue(budgetStats.getPretrialPreliminaryConstructeFee());
|
|
|
+ cell29.setCellValue(budgetStats.getPretrialSurveyFee());
|
|
|
+ cell30.setCellValue(budgetStats.getPretrialDesignFee());
|
|
|
+ cell31.setCellValue(budgetStats.getPretrialSupervisionFee());
|
|
|
+ cell32.setCellValue(budgetStats.getAfterTrialEstimateAmount());
|
|
|
+ cell33.setCellValue(budgetStats.getAfterTrialEstimateAmountExcludeTax());
|
|
|
+ cell34.setCellValue(budgetStats.getAfterTrialDeductibleAmount());
|
|
|
+ cell35.setCellValue(budgetStats.getAfterTrialConstructeConsts());
|
|
|
+ cell36.setCellValue(budgetStats.getAfterTrialMaterialAmount());
|
|
|
+ cell37.setCellValue(budgetStats.getAfterTrialOtherExpanses());
|
|
|
+ cell38.setCellValue(budgetStats.getAfterTrialPreliminaryConstructeFee());
|
|
|
+ cell39.setCellValue(budgetStats.getAfterTrialSurveyFee());
|
|
|
+ cell40.setCellValue(budgetStats.getAfterTrialDesignFee());
|
|
|
+ cell41.setCellValue(budgetStats.getAfterTrialSupervisionFee());
|
|
|
+ cell42.setCellValue(budgetStats.getBudgetRevision());
|
|
|
+ cell43.setCellValue(budgetStats.getCompleteTime());
|
|
|
+ }
|
|
|
+
|
|
|
+ String str = URLEncoder.encode("储备项目概预算统计表.xlsx", "UTF8");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="+str);
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出储备项目概预算统计表信息
|
|
|
+ * @param response
|
|
|
+ * @param workbook
|
|
|
+ * @param list
|
|
|
+ */
|
|
|
+ public void exportProgress(HttpServletResponse response, XSSFWorkbook workbook, List<ProgressStats> list){
|
|
|
+ try {
|
|
|
+ int index = 1;//第一列序号
|
|
|
+ int rowNum = 3;//数据起始列
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
+ Row row = sheet.createRow(rowNum+i);
|
|
|
+ Cell cell0 = crateCell(workbook,row,0); //序号
|
|
|
+ Cell cell1 = crateCell(workbook,row,1); //储备项目编号
|
|
|
+ Cell cell2 = crateCell(workbook,row,2); //储备项目名称
|
|
|
+ Cell cell3 = crateCell(workbook,row,3); //储备项目类型
|
|
|
+ Cell cell4 = crateCell(workbook,row,4); //需求提出单位
|
|
|
+ Cell cell5 = crateCell(workbook,row,5); //储备批次
|
|
|
+ Cell cell6 = crateCell(workbook,row,6); //备注
|
|
|
+ Cell cell7 = crateCell(workbook,row,7); //储备进度
|
|
|
+ Cell cell8 = crateCell(workbook,row,8); //是否纳入实施计划
|
|
|
+ Cell cell9 = crateCell(workbook,row,9); //初定实施批次
|
|
|
+ Cell cell10 = crateCell(workbook,row,10); //是否通过运检部评审
|
|
|
+ Cell cell11 = crateCell(workbook,row,11); //通过运检部评审时间
|
|
|
+ Cell cell12 = crateCell(workbook,row,12); //运检部下达储备时间
|
|
|
+ Cell cell13 = crateCell(workbook,row,13); //是否发出设计委托
|
|
|
+ Cell cell14 = crateCell(workbook,row,14); //设计委托发出时间
|
|
|
+ Cell cell15 = crateCell(workbook,row,15); //初设提交限定日期
|
|
|
+ Cell cell16 = crateCell(workbook,row,16); //是否进行现场交底
|
|
|
+ Cell cell17 = crateCell(workbook,row,17); //交底完成时间
|
|
|
+ Cell cell18 = crateCell(workbook,row,18); //是否进行储备
|
|
|
+ Cell cell19 = crateCell(workbook,row,19); //是否完成初设
|
|
|
+ Cell cell20 = crateCell(workbook,row,20); //初设提交时间
|
|
|
+ Cell cell21 = crateCell(workbook,row,21); //是否完成审图
|
|
|
+ Cell cell22 = crateCell(workbook,row,22); //是否通过图纸审核
|
|
|
+ Cell cell23 = crateCell(workbook,row,23); //未通过原因分析
|
|
|
+ Cell cell24 = crateCell(workbook,row,24); //通过审核日期
|
|
|
+ Cell cell25 = crateCell(workbook,row,25); //是否需设计变更
|
|
|
+ Cell cell26 = crateCell(workbook,row,26); //是否完成审核
|
|
|
+ Cell cell27 = crateCell(workbook,row,27); //是否通过专家审核
|
|
|
+ Cell cell28 = crateCell(workbook,row,28); //未通过原因分析
|
|
|
+ Cell cell29 = crateCell(workbook,row,29); //通过审核日期
|
|
|
+ Cell cell30 = crateCell(workbook,row,30); //是否需设计变更
|
|
|
+ Cell cell31 = crateCell(workbook,row,31); //是否参加省公司评审
|
|
|
+ Cell cell32 = crateCell(workbook,row,32); //省公司评审批次
|
|
|
+ Cell cell33 = crateCell(workbook,row,33); //是否通过省公司评审
|
|
|
+ Cell cell34 = crateCell(workbook,row,34); //未通过原因分析
|
|
|
+ Cell cell35 = crateCell(workbook,row,35); //是否需设计变更
|
|
|
+ Cell cell36 = crateCell(workbook,row,36); //是否进行图纸审查
|
|
|
+ Cell cell37 = crateCell(workbook,row,37); //审图日期
|
|
|
+ Cell cell38 = crateCell(workbook,row,38); //是否通过图纸审查
|
|
|
+ Cell cell39 = crateCell(workbook,row,39); //未通过审图意见
|
|
|
+ Cell cell40 = crateCell(workbook,row,40); //通过审核日期
|
|
|
+ Cell cell41 = crateCell(workbook,row,41); //是否需设计变更
|
|
|
+ Cell cell42 = crateCell(workbook,row,42); //图纸是否定稿
|
|
|
+ Cell cell43 = crateCell(workbook,row,43); //定稿日期
|
|
|
+ Cell cell44 = crateCell(workbook,row,44); //是否打印正式图纸
|
|
|
+ Cell cell45 = crateCell(workbook,row,45); //通知出图日期
|
|
|
+ Cell cell46 = crateCell(workbook,row,46); //正式图纸移交项目中心日期
|
|
|
+ Cell cell47 = crateCell(workbook,row,47); //正式图纸移交施工单位日期
|
|
|
+
|
|
|
+ ProgressStats progressStats = list.get(i);
|
|
|
+
|
|
|
+ cell0.setCellValue(String.valueOf(index++));
|
|
|
+ cell1.setCellValue(progressStats.getProjectReserveId());
|
|
|
+ cell2.setCellValue(progressStats.getProjectName());
|
|
|
+ cell3.setCellValue(progressStats.getRequirementType());
|
|
|
+ cell4.setCellValue(progressStats.getDemandUnit());
|
|
|
+ cell5.setCellValue(progressStats.getReserveBatches());
|
|
|
+ cell6.setCellValue(progressStats.getBasicRemarks());
|
|
|
+ cell7.setCellValue(progressStats.getReserveProgress());
|
|
|
+ cell8.setCellValue(progressStats.getImplementPlan());
|
|
|
+ cell9.setCellValue(progressStats.getInitialImplementBatch());
|
|
|
+ cell10.setCellValue(progressStats.getInspectDepartmentReview());
|
|
|
+ cell11.setCellValue(progressStats.getInspectDepartmentReviewTime());
|
|
|
+ cell12.setCellValue(progressStats.getReleaseReserveTime());
|
|
|
+ cell13.setCellValue(progressStats.getDesignCommission());
|
|
|
+ cell14.setCellValue(progressStats.getDesignCommissionIssueTime());
|
|
|
+ cell15.setCellValue("");
|
|
|
+ cell16.setCellValue(progressStats.getOnSiteConfess());
|
|
|
+ cell17.setCellValue(progressStats.getConfessCompleteTime());
|
|
|
+ cell18.setCellValue(progressStats.getIncludeReserve());
|
|
|
+ cell19.setCellValue(progressStats.getCompleteDesign());
|
|
|
+ cell20.setCellValue(progressStats.getSubmitTime());
|
|
|
+ cell21.setCellValue(progressStats.getCompleteDraw());
|
|
|
+ cell22.setCellValue(progressStats.getDrawAudit());
|
|
|
+ cell23.setCellValue(progressStats.getReasonForFailure());
|
|
|
+ cell24.setCellValue(progressStats.getPassAuditDate());
|
|
|
+ cell25.setCellValue(progressStats.getChangeDesign());
|
|
|
+ cell26.setCellValue(progressStats.getCompleteReview());
|
|
|
+ cell27.setCellValue(progressStats.getExpertReview());
|
|
|
+ cell28.setCellValue(progressStats.getEstimateReasonForFailure());
|
|
|
+ cell29.setCellValue(progressStats.getEstimatePassAuditDate());
|
|
|
+ cell30.setCellValue(progressStats.getEstimateChangeDesign());
|
|
|
+ cell31.setCellValue(progressStats.getProvincialCompanyReview());
|
|
|
+ cell32.setCellValue(progressStats.getProvincialCompanyReviewBatch());
|
|
|
+ cell33.setCellValue(progressStats.getPassProvincialCompanyReview());
|
|
|
+ cell34.setCellValue(progressStats.getCauseAnalysis());
|
|
|
+ cell35.setCellValue(progressStats.getDesignChange());
|
|
|
+ cell36.setCellValue(progressStats.getDrawingReview());
|
|
|
+ cell37.setCellValue(progressStats.getReviewDate());
|
|
|
+ cell38.setCellValue(progressStats.getPassDrawingReview());
|
|
|
+ cell39.setCellValue(progressStats.getReviewComment());
|
|
|
+ cell40.setCellValue(progressStats.getApprovedDate());
|
|
|
+ cell41.setCellValue(progressStats.getJointReviewDesignChange());
|
|
|
+ cell42.setCellValue(progressStats.getDrawingFinalize());
|
|
|
+ cell43.setCellValue(progressStats.getFinalDate());
|
|
|
+ cell44.setCellValue(progressStats.getFormalDrawing());
|
|
|
+ cell45.setCellValue(progressStats.getDrawingDate());
|
|
|
+ cell46.setCellValue(progressStats.getTransferProjectCenterDate());
|
|
|
+ cell47.setCellValue(progressStats.getTransferToConstructionUnitDate());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ String str = URLEncoder.encode("储备进度统计表.xlsx", "UTF8");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="+str);
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出储备项目概预算统计表信息
|
|
|
+ * @param response
|
|
|
+ * @param workbook
|
|
|
+ * @param list
|
|
|
+ */
|
|
|
+ public void exportConstructe(HttpServletResponse response, XSSFWorkbook workbook, List<ConstructeScale> list){
|
|
|
+ try {
|
|
|
+ int index = 1;//第一列序号
|
|
|
+ int rowNum = 2;//数据起始列
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
+ Row row = sheet.createRow(rowNum+i);
|
|
|
+ Cell cell0 = crateCell(workbook,row,0); //序号
|
|
|
+ Cell cell1 = crateCell(workbook,row,1); //市公司
|
|
|
+ Cell cell2 = crateCell(workbook,row,2); //县公司
|
|
|
+ Cell cell3 = crateCell(workbook,row,3); //供电区域
|
|
|
+ Cell cell4 = crateCell(workbook,row,4); //网格编号
|
|
|
+ Cell cell5 = crateCell(workbook,row,5); //单元格编号
|
|
|
+ Cell cell6 = crateCell(workbook,row,6); //项目编号
|
|
|
+ Cell cell7 = crateCell(workbook,row,7); //项目名称
|
|
|
+ Cell cell8 = crateCell(workbook,row,8); //建设必要性及内容
|
|
|
+ Cell cell9 = crateCell(workbook,row,9); //建设目的
|
|
|
+ Cell cell10 = crateCell(workbook,row,10); //项目进度
|
|
|
+ Cell cell11 = crateCell(workbook,row,11); //开关柜
|
|
|
+ Cell cell12 = crateCell(workbook,row,12); //架空线路
|
|
|
+ Cell cell13 = crateCell(workbook,row,13); //电力电缆
|
|
|
+ Cell cell14 = crateCell(workbook,row,14); //电缆分支箱
|
|
|
+ Cell cell15 = crateCell(workbook,row,15); //户外环网箱
|
|
|
+ Cell cell16 = crateCell(workbook,row,16); //环网室(开关站)
|
|
|
+ Cell cell17 = crateCell(workbook,row,17); //柱上开关
|
|
|
+ Cell cell18 = crateCell(workbook,row,18); //配电室kva
|
|
|
+ Cell cell19 = crateCell(workbook,row,19); //配电室
|
|
|
+ Cell cell20 = crateCell(workbook,row,20); //箱变kva
|
|
|
+ Cell cell21 = crateCell(workbook,row,21); //箱变
|
|
|
+ Cell cell22 = crateCell(workbook,row,22); //配电变压器kva
|
|
|
+ Cell cell23 = crateCell(workbook,row,23); //配电变压器
|
|
|
+ Cell cell24 = crateCell(workbook,row,24); //低压线路
|
|
|
+ Cell cell25 = crateCell(workbook,row,25); //低压电缆
|
|
|
+ Cell cell26 = crateCell(workbook,row,26); //低压电缆分支箱
|
|
|
+ Cell cell27 = crateCell(workbook,row,27); //低压配电柜
|
|
|
+ Cell cell28 = crateCell(workbook,row,28); //配电自动化终端(FTU)
|
|
|
+ Cell cell29 = crateCell(workbook,row,29); //配电自动化终端(DTU)
|
|
|
+ Cell cell30 = crateCell(workbook,row,30); //光缆
|
|
|
+ Cell cell31 = crateCell(workbook,row,31); //电缆通道
|
|
|
+ Cell cell32 = crateCell(workbook,row,32); //土建工厂化预制
|
|
|
+ Cell cell33 = crateCell(workbook,row,33); //附属设施
|
|
|
+ Cell cell34 = crateCell(workbook,row,34); //施工作业方式(完全不停电作业、部分不停电作业、停电作业)
|
|
|
+ Cell cell35 = crateCell(workbook,row,35); //不停电作业
|
|
|
+ Cell cell36 = crateCell(workbook,row,36); //停电时户数
|
|
|
+ Cell cell37 = crateCell(workbook,row,37); //费用估算
|
|
|
+ Cell cell38 = crateCell(workbook,row,38); //是否迎峰度夏项目
|
|
|
+ Cell cell39 = crateCell(workbook,row,39); //通过第几批项目评审
|
|
|
+ Cell cell40 = crateCell(workbook,row,40); //概算
|
|
|
+
|
|
|
+
|
|
|
+ ConstructeScale constructeScale = list.get(i);
|
|
|
+
|
|
|
+ cell0.setCellValue(String.valueOf(index++));
|
|
|
+ cell1.setCellValue("国网镇江供电公司");
|
|
|
+ cell2.setCellValue(constructeScale.getDistrict());
|
|
|
+ cell3.setCellValue(constructeScale.getBlockSupply());
|
|
|
+ cell4.setCellValue(constructeScale.getGridNumber());
|
|
|
+ cell5.setCellValue(constructeScale.getCellNumber());
|
|
|
+ cell6.setCellValue(constructeScale.getProjectReserveId());
|
|
|
+ cell7.setCellValue(constructeScale.getProjectName());
|
|
|
+ cell8.setCellValue(constructeScale.getConstructionNecessityAndContent());
|
|
|
+ cell9.setCellValue(constructeScale.getConstructePurpose());
|
|
|
+ cell10.setCellValue(constructeScale.getReserveProgress());
|
|
|
+ cell11.setCellValue(constructeScale.getSwitchCabinet());
|
|
|
+ cell12.setCellValue(constructeScale.getOverheadLine());
|
|
|
+ cell13.setCellValue(constructeScale.getPowerCable());
|
|
|
+ cell14.setCellValue(constructeScale.getCableBranchBox());
|
|
|
+ cell15.setCellValue(constructeScale.getOutdoorRingCage());
|
|
|
+ cell16.setCellValue(constructeScale.getRingRoom());
|
|
|
+ cell17.setCellValue(constructeScale.getOnColumnSwitch());
|
|
|
+ cell18.setCellValue(constructeScale.getSwitchRoomKVA());
|
|
|
+ cell19.setCellValue(constructeScale.getSwitchRoom());
|
|
|
+ cell20.setCellValue(constructeScale.getBoxChangeKVA());
|
|
|
+ cell21.setCellValue(constructeScale.getBoxChange());
|
|
|
+ cell22.setCellValue(constructeScale.getDistributionTransformerKVA());
|
|
|
+ cell23.setCellValue(constructeScale.getDistributionTransformer());
|
|
|
+ cell24.setCellValue(constructeScale.getLowVoltageLine());
|
|
|
+ cell25.setCellValue(constructeScale.getLowVoltageCable());
|
|
|
+ cell26.setCellValue(constructeScale.getLowVoltageCableBox());
|
|
|
+ cell27.setCellValue(constructeScale.getLowVoltageCabinet());
|
|
|
+ cell28.setCellValue(constructeScale.getDistributeAutoMateTerminalFTU());
|
|
|
+ cell29.setCellValue(constructeScale.getDistributeAutoMateTerminalDTU());
|
|
|
+ cell30.setCellValue(constructeScale.getOpticalCable());
|
|
|
+ cell31.setCellValue(constructeScale.getCablePassage());
|
|
|
+ cell32.setCellValue(constructeScale.getFactoryPrefab());
|
|
|
+ cell33.setCellValue(constructeScale.getAncillaryFacility());
|
|
|
+ cell34.setCellValue(constructeScale.getConstructionWorkMethod());
|
|
|
+ cell35.setCellValue(constructeScale.getWorkWithoutInterruption());
|
|
|
+ cell36.setCellValue(constructeScale.getPowerFailureHouseNum());
|
|
|
+ cell37.setCellValue(constructeScale.getCostEstimate());
|
|
|
+ cell38.setCellValue(constructeScale.getPeakSummerProject());
|
|
|
+ cell39.setCellValue(constructeScale.getProjectReview());
|
|
|
+ cell40.setCellValue(constructeScale.getAfterTrialEstimateAmount());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ String str = URLEncoder.encode("储备项目建设规模统计表.xlsx", "UTF8");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="+str);
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出储备项目概预算统计表信息
|
|
|
+ * @param response
|
|
|
+ * @param workbook
|
|
|
+ * @param list
|
|
|
+ */
|
|
|
+ public void exportEnginnerQuery(HttpServletResponse response, XSSFWorkbook workbook, List<EnginnerQuery> list){
|
|
|
+ try {
|
|
|
+ int index = 1;//第一列序号
|
|
|
+ int rowNum = 3;//数据起始列
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
+ Row row = sheet.createRow(rowNum+i);
|
|
|
+ Cell cell0 = crateCell(workbook,row,0); //序号
|
|
|
+ Cell cell1 = crateCell(workbook,row,1); //项目年份
|
|
|
+ Cell cell2 = crateCell(workbook,row,2); //项目性质
|
|
|
+ Cell cell3 = crateCell(workbook,row,3); //需求单位
|
|
|
+ Cell cell4 = crateCell(workbook,row,4); //区域
|
|
|
+ Cell cell5 = crateCell(workbook,row,5); //项目分组
|
|
|
+ Cell cell6 = crateCell(workbook,row,6); //储备批次
|
|
|
+ Cell cell7 = crateCell(workbook,row,7); //供电区域
|
|
|
+ Cell cell8 = crateCell(workbook,row,8); //网格编号
|
|
|
+ Cell cell9 = crateCell(workbook,row,9); //单元格编号
|
|
|
+ Cell cell10 = crateCell(workbook,row,10); //项目储备编号
|
|
|
+ Cell cell11 = crateCell(workbook,row,11); //项目名称
|
|
|
+ Cell cell12 = crateCell(workbook,row,12); //建设必要性及内容
|
|
|
+ Cell cell13 = crateCell(workbook,row,13); //变电站名称
|
|
|
+ Cell cell14 = crateCell(workbook,row,14); //线路名称
|
|
|
+ Cell cell15 = crateCell(workbook,row,15); //网架项目划分
|
|
|
+ Cell cell16 = crateCell(workbook,row,16); //需求类型
|
|
|
+ Cell cell17 = crateCell(workbook,row,17); //项目类型
|
|
|
+ Cell cell18 = crateCell(workbook,row,18); //费用估算
|
|
|
+ Cell cell19 = crateCell(workbook,row,19); //备注
|
|
|
+ Cell cell20 = crateCell(workbook,row,20); //储备进度
|
|
|
+ Cell cell21 = crateCell(workbook,row,21); //是否纳入实施计划
|
|
|
+ Cell cell22 = crateCell(workbook,row,22); //初定实施批次
|
|
|
+ Cell cell23 = crateCell(workbook,row,23); //是否含土建工作量
|
|
|
+ Cell cell24 = crateCell(workbook,row,24); //是否立杆工作量
|
|
|
+ Cell cell25 = crateCell(workbook,row,25); //立杆信息Φ190×10×M×I
|
|
|
+ Cell cell26 = crateCell(workbook,row,26); //立杆信息Φ190×12×M×G
|
|
|
+ Cell cell27 = crateCell(workbook,row,27); //立杆信息Φ190×15×M×G
|
|
|
+ Cell cell28 = crateCell(workbook,row,28); //立杆信息Φ230×15×N
|
|
|
+ Cell cell29 = crateCell(workbook,row,29); //立杆信息Φ230×18×N×G
|
|
|
+ Cell cell30 = crateCell(workbook,row,30); //立杆信息Φ300×9
|
|
|
+ Cell cell31 = crateCell(workbook,row,31); //立杆信息Φ350×15×T×BY
|
|
|
+ Cell cell32 = crateCell(workbook,row,32); //钢管杆信息GNH31-13B(含钢管桩)
|
|
|
+ Cell cell33 = crateCell(workbook,row,33); //钢管杆信息GNH31-13B(不含钢管桩)
|
|
|
+ Cell cell34 = crateCell(workbook,row,34); //钢管杆信息GNH31-13D(含钢管桩)
|
|
|
+ Cell cell35 = crateCell(workbook,row,35); //钢管杆信息GNH31-13D(不含钢管桩)
|
|
|
+ Cell cell36 = crateCell(workbook,row,36); //钢管杆信息GNH35-13B(含钢管桩)
|
|
|
+ Cell cell37 = crateCell(workbook,row,37); //钢管杆信息GNH35-13B(不含钢管桩)
|
|
|
+ Cell cell38 = crateCell(workbook,row,38); //钢管杆信息GNH35-13E(含钢管桩)
|
|
|
+ Cell cell39 = crateCell(workbook,row,39); //钢管杆信息GNH35-13E(不含钢管桩)
|
|
|
+ Cell cell40 = crateCell(workbook,row,40); //钢管杆信息GNH39-13B(含钢管桩)
|
|
|
+ Cell cell41 = crateCell(workbook,row,41); //钢管杆信息GNH39-13B(不含钢管桩)
|
|
|
+ Cell cell42 = crateCell(workbook,row,42); //预制化井
|
|
|
+ Cell cell43 = crateCell(workbook,row,43); //预制化基础
|
|
|
+ Cell cell44 = crateCell(workbook,row,44); //预制化包封
|
|
|
+
|
|
|
+ EnginnerQuery enginnerQuery = list.get(i);
|
|
|
+
|
|
|
+ cell0.setCellValue(String.valueOf(index++));
|
|
|
+ cell1.setCellValue(enginnerQuery.getProjectYear());
|
|
|
+ cell2.setCellValue(enginnerQuery.getProjectNature());
|
|
|
+ cell3.setCellValue(enginnerQuery.getDemandUnit());
|
|
|
+ cell4.setCellValue(enginnerQuery.getDistrict());
|
|
|
+ cell5.setCellValue(enginnerQuery.getProjectGroup());
|
|
|
+ cell6.setCellValue(enginnerQuery.getReserveBatches());
|
|
|
+ cell7.setCellValue(enginnerQuery.getBlockSupply());
|
|
|
+ cell8.setCellValue(enginnerQuery.getGridNumber());
|
|
|
+ cell9.setCellValue(enginnerQuery.getCellNumber());
|
|
|
+ cell10.setCellValue(enginnerQuery.getProjectReserveId());
|
|
|
+ cell11.setCellValue(enginnerQuery.getProjectName());
|
|
|
+ cell12.setCellValue(enginnerQuery.getConstructionNecessityAndContent());
|
|
|
+ cell13.setCellValue(enginnerQuery.getSubstationName());
|
|
|
+ cell14.setCellValue(enginnerQuery.getCircuitName());
|
|
|
+ cell15.setCellValue(enginnerQuery.getNetRackProjectDivide());
|
|
|
+ cell16.setCellValue(enginnerQuery.getRequirementType());
|
|
|
+ cell17.setCellValue(enginnerQuery.getProjectType());
|
|
|
+
|
|
|
+ String costEstimateStr= enginnerQuery.getCostEstimate().toString();
|
|
|
+ if(StringUtils.isNotBlank(costEstimateStr)){
|
|
|
+ cell18.setCellValue(Double.parseDouble(costEstimateStr));
|
|
|
+ }
|
|
|
+ cell19.setCellValue(enginnerQuery.getBasicRemarks());
|
|
|
+ cell20.setCellValue(enginnerQuery.getReserveProgress());
|
|
|
+ cell21.setCellValue(enginnerQuery.getImplementPlan());
|
|
|
+ cell22.setCellValue(enginnerQuery.getImplementBatch());
|
|
|
+ cell23.setCellValue(enginnerQuery.getCivilWork());
|
|
|
+ cell24.setCellValue(enginnerQuery.getPoleWorkload());
|
|
|
+ cell25.setCellValue(enginnerQuery.getPole190X10());
|
|
|
+ cell26.setCellValue(enginnerQuery.getPole190X12());
|
|
|
+ cell27.setCellValue(enginnerQuery.getPole190X15());
|
|
|
+ cell28.setCellValue(enginnerQuery.getPole230X15());
|
|
|
+ cell29.setCellValue(enginnerQuery.getPole230X18());
|
|
|
+ cell30.setCellValue(enginnerQuery.getPole300X9());
|
|
|
+ cell31.setCellValue(enginnerQuery.getPole350X15());
|
|
|
+ cell32.setCellValue(enginnerQuery.getSteelPipeGNH31Contains());
|
|
|
+ cell33.setCellValue(enginnerQuery.getSteelPipeGNH31NoContains());
|
|
|
+ cell34.setCellValue(enginnerQuery.getSteelPipeGNH3113DContains());
|
|
|
+ cell35.setCellValue(enginnerQuery.getSteelPipeGNH3113DNoContains());
|
|
|
+ cell36.setCellValue(enginnerQuery.getSteelPipeCNH35Contains());
|
|
|
+ cell37.setCellValue(enginnerQuery.getSteelPipeCNH35NoContains());
|
|
|
+ cell38.setCellValue(enginnerQuery.getSteelPipeCNH3513EContains());
|
|
|
+ cell39.setCellValue(enginnerQuery.getSteelPipeCNH3513ENoContains());
|
|
|
+ cell40.setCellValue(enginnerQuery.getSteelPipeCNH39Contains());
|
|
|
+ cell41.setCellValue(enginnerQuery.getSteelPipeCNH39NoContains());
|
|
|
+ cell42.setCellValue(enginnerQuery.getPrefabricatedWell());
|
|
|
+ cell43.setCellValue(enginnerQuery.getPrefabricatedBase());
|
|
|
+ cell44.setCellValue(enginnerQuery.getPrefabricatedPackage());
|
|
|
+ }
|
|
|
+
|
|
|
+ String str = URLEncoder.encode("立杆和土建工程量统计表.xlsx", "UTF8");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="+str);
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 特殊物资统计表信息
|
|
|
+ * @param response
|
|
|
+ * @param workbook
|
|
|
+ * @param list
|
|
|
+ */
|
|
|
+ public void exportSpecialSupply(HttpServletResponse response, XSSFWorkbook workbook, List<SpecialSupply> list){
|
|
|
+ try {
|
|
|
+ int index = 1;//第一列序号
|
|
|
+ int rowNum = 2;//数据起始列
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
+ Row row = sheet.createRow(rowNum+i);
|
|
|
+ Cell cell0 = crateCell(workbook,row,0); //序号
|
|
|
+ Cell cell1 = crateCell(workbook,row,1); //项目年份
|
|
|
+ Cell cell2 = crateCell(workbook,row,2); //项目性质
|
|
|
+ Cell cell3 = crateCell(workbook,row,3); //需求单位
|
|
|
+ Cell cell4 = crateCell(workbook,row,4); //区域
|
|
|
+ Cell cell5 = crateCell(workbook,row,5); //项目分组
|
|
|
+ Cell cell6 = crateCell(workbook,row,6); //储备批次
|
|
|
+ Cell cell7 = crateCell(workbook,row,7); //供电区域
|
|
|
+ Cell cell8 = crateCell(workbook,row,8); //网格编号
|
|
|
+ Cell cell9 = crateCell(workbook,row,9); //单元格编号
|
|
|
+ Cell cell10 = crateCell(workbook,row,10); //项目储备编号
|
|
|
+ Cell cell11 = crateCell(workbook,row,11); //项目名称
|
|
|
+ Cell cell12 = crateCell(workbook,row,12); //建设必要性及内容
|
|
|
+ Cell cell13 = crateCell(workbook,row,13); //变电站名称
|
|
|
+ Cell cell14 = crateCell(workbook,row,14); //线路名称
|
|
|
+ Cell cell15 = crateCell(workbook,row,15); //网架项目划分
|
|
|
+ Cell cell16 = crateCell(workbook,row,16); //需求类型
|
|
|
+ Cell cell17 = crateCell(workbook,row,17); //项目类型
|
|
|
+ Cell cell18 = crateCell(workbook,row,18); //费用估算
|
|
|
+ Cell cell19 = crateCell(workbook,row,19); //备注
|
|
|
+ Cell cell20 = crateCell(workbook,row,20); //储备进度
|
|
|
+ Cell cell21 = crateCell(workbook,row,21); //是否纳入实施计划
|
|
|
+ Cell cell22 = crateCell(workbook,row,22); //初定实施批次
|
|
|
+ Cell cell23 = crateCell(workbook,row,23); //A物资
|
|
|
+ Cell cell24 = crateCell(workbook,row,24); //B物资
|
|
|
+ Cell cell25 = crateCell(workbook,row,25); //C物资
|
|
|
+ Cell cell26 = crateCell(workbook,row,26); //D物资
|
|
|
+ Cell cell27 = crateCell(workbook,row,27); //环网柜AC10kV
|
|
|
+ Cell cell28 = crateCell(workbook,row,28); //环网柜AC10kV02
|
|
|
+ Cell cell29 = crateCell(workbook,row,29); //低压开关柜进线
|
|
|
+ Cell cell30 = crateCell(workbook,row,30); //低压开关柜分段
|
|
|
+ Cell cell31 = crateCell(workbook,row,31); //低压开关柜馈线
|
|
|
+ Cell cell32 = crateCell(workbook,row,32); //电缆分支箱四路
|
|
|
+ Cell cell33 = crateCell(workbook,row,33); //电缆分支箱五路
|
|
|
+ Cell cell34 = crateCell(workbook,row,34); //电缆分支箱七路
|
|
|
+ Cell cell35 = crateCell(workbook,row,35); //箱变路数
|
|
|
+ Cell cell36 = crateCell(workbook,row,36); //特殊物资A
|
|
|
+ Cell cell37 = crateCell(workbook,row,37); //特殊物资B
|
|
|
+ Cell cell38 = crateCell(workbook,row,38); //特殊物资C
|
|
|
+ Cell cell39 = crateCell(workbook,row,39); //特殊物资D
|
|
|
+
|
|
|
+
|
|
|
+ SpecialSupply specialSupply = list.get(i);
|
|
|
+
|
|
|
+ cell0.setCellValue(String.valueOf(index++));
|
|
|
+ cell1.setCellValue(specialSupply.getProjectYear());
|
|
|
+ cell2.setCellValue(specialSupply.getProjectNature());
|
|
|
+ cell3.setCellValue(specialSupply.getDemandUnit());
|
|
|
+ cell4.setCellValue(specialSupply.getDistrict());
|
|
|
+ cell5.setCellValue(specialSupply.getProjectGroup());
|
|
|
+ cell6.setCellValue(specialSupply.getReserveBatches());
|
|
|
+ cell7.setCellValue(specialSupply.getBlockSupply());
|
|
|
+ cell8.setCellValue(specialSupply.getGridNumber());
|
|
|
+ cell9.setCellValue(specialSupply.getCellNumber());
|
|
|
+ cell10.setCellValue(specialSupply.getProjectReserveId());
|
|
|
+ cell11.setCellValue(specialSupply.getProjectName());
|
|
|
+ cell12.setCellValue(specialSupply.getConstructionNecessityAndContent());
|
|
|
+ cell13.setCellValue(specialSupply.getSubstationName());
|
|
|
+ cell14.setCellValue(specialSupply.getCircuitName());
|
|
|
+ cell15.setCellValue(specialSupply.getNetRackProjectDivide());
|
|
|
+ cell16.setCellValue(specialSupply.getRequirementType());
|
|
|
+ cell17.setCellValue(specialSupply.getProjectType());
|
|
|
+
|
|
|
+ String costEstimateStr= specialSupply.getCostEstimate().toString();
|
|
|
+ if(StringUtils.isNotBlank(costEstimateStr)){
|
|
|
+ cell18.setCellValue(Double.parseDouble(costEstimateStr));
|
|
|
+ }
|
|
|
+ cell19.setCellValue(specialSupply.getBasicRemarks());
|
|
|
+ cell20.setCellValue(specialSupply.getReserveProgress());
|
|
|
+ cell21.setCellValue(specialSupply.getImplementPlan());
|
|
|
+ cell22.setCellValue(specialSupply.getImplementBatch());
|
|
|
+ cell23.setCellValue(specialSupply.getMaterialStatisticA());
|
|
|
+ cell24.setCellValue(specialSupply.getMaterialStatisticB());
|
|
|
+ cell25.setCellValue(specialSupply.getMaterialStatisticC());
|
|
|
+ cell26.setCellValue(specialSupply.getMaterialStatisticD());
|
|
|
+ cell27.setCellValue(specialSupply.getSwitchCabinet10KV());
|
|
|
+ cell28.setCellValue(specialSupply.getSwitchCabinet10KV02());
|
|
|
+ cell29.setCellValue(specialSupply.getSwitchCabinetIncomeLine());
|
|
|
+ cell30.setCellValue(specialSupply.getSwitchCabinetSegment());
|
|
|
+ cell31.setCellValue(specialSupply.getSwitchCabinetFeeder());
|
|
|
+ cell32.setCellValue(specialSupply.getNumberOfBranchBoxFourWay());
|
|
|
+ cell33.setCellValue(specialSupply.getNumberOfBranchBoxFiveWay());
|
|
|
+ cell34.setCellValue(specialSupply.getNumberOfBranchBoxSevenWay());
|
|
|
+ cell35.setCellValue(specialSupply.getNumberOfBox());
|
|
|
+ cell36.setCellValue(specialSupply.getSpecialSizeA());
|
|
|
+ cell37.setCellValue(specialSupply.getSpecialSizeB());
|
|
|
+ cell38.setCellValue(specialSupply.getSpecialSizeC());
|
|
|
+ cell39.setCellValue(specialSupply.getSpecialSizeD());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ String str = URLEncoder.encode("特殊物资统计表.xlsx", "UTF8");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="+str);
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出储备项目概预算统计表信息
|
|
|
+ * @param response
|
|
|
+ * @param workbook
|
|
|
+ * @param list
|
|
|
+ */
|
|
|
+ public void exportDemoliteList(HttpServletResponse response, XSSFWorkbook workbook, List<DemoliteList> list){
|
|
|
+ try {
|
|
|
+ int index = 1;//第一列序号
|
|
|
+ int rowNum = 3;//数据起始列
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
+ Row row = sheet.createRow(rowNum+i);
|
|
|
+ Cell cell0 = crateCell(workbook,row,0); //序号
|
|
|
+ Cell cell1 = crateCell(workbook,row,1); //储备项目名称
|
|
|
+ Cell cell2 = crateCell(workbook,row,2); //储备项目编码
|
|
|
+ Cell cell3 = crateCell(workbook,row,3); //物料名称
|
|
|
+ Cell cell4 = crateCell(workbook,row,4); //规格型号
|
|
|
+ Cell cell5 = crateCell(workbook,row,5); //单位
|
|
|
+ Cell cell6 = crateCell(workbook,row,6); //数量
|
|
|
+ Cell cell7 = crateCell(workbook,row,7); //备注
|
|
|
+
|
|
|
+ DemoliteList demoliteList = list.get(i);
|
|
|
+
|
|
|
+ cell0.setCellValue(String.valueOf(index++));
|
|
|
+ cell1.setCellValue(demoliteList.getProjectName());
|
|
|
+ cell2.setCellValue(demoliteList.getProjectReserveId());
|
|
|
+ cell3.setCellValue(demoliteList.getMaterialName());
|
|
|
+ cell4.setCellValue(demoliteList.getSpecification());
|
|
|
+ cell5.setCellValue(demoliteList.getUnit());
|
|
|
+ cell6.setCellValue(demoliteList.getCount());
|
|
|
+ cell7.setCellValue(demoliteList.getRemark());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ String str = URLEncoder.encode("储备项目拆旧物资汇总表.xlsx", "UTF8");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename="+str);
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
+ OutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+ outputStream.flush();
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|