1.开标结束页面功能
功能:页面上增加导出Excel按钮,将开标一览表格绘制成Excel进行导出。
2.实现
1.1前台页面增加按钮、点击事件
//前台开标结束页面修改代码内容 KaiBiaoEnd.html
<div class="page-loading"></div>
<div class="fui-toolbar">
<div id="btnExcelClick" class="mini-button" onclick="btnExcelClick">导出到Excel</div>
</div>
<!--和fui-content平级-->
<form id="download_form" method="post" enctype="multipart/form-data"/>
function btnExcelClick() {
var form = document.getElementById('download_form');
form.action = "kaibiaoendcommonaction.action?cmd=btnExcelClick";
form.submit();
}
1.2后台修改action方法
import org.apache.poi.ss.usermodel.Workbook;
/**
* 点击
*/
public void btnExcelClick() {
String fileName = "开标记录表.xls";// 客户端保存的文件名
String firstKB = getRequestParameter("FirstKB");
Workbook workBook = ExcelUtils.generateExcel(biaoDuanGuid, pbbf, firstKB);
// 以字符流的形式下载文件
try (ByteArrayOutputStream fs = new ByteArrayOutputStream()) {
workBook.write(fs);
workBook.close();
sendRespose(fs.toByteArray(), fileName, "application/x-msdownload;charset=UTF-8");
}
catch (IOException e) {
log.error("生成开标记录表Excel出错", e);
}
}
1.3下载ExcelUtils类
package com.epoint.PingBiao.Bizlogic2.Common.Main;
import org.apache.log4j.Logger;
import Epoint.PingBiao.Core.BaseDB.PingBiaoBiaoDuanService;
import Epoint.PingBiao.Core.BaseDB.PingBiaoKaiBiaoTouBiaoService;
import Epoint.PingBiao.Core.ClsEnum;
import Epoint.PingBiao.Core.Common.CommonFunction;
import Epoint.PingBiao.Core.Common.ReNameAction;
import Epoint.PingBiao.Core.PBCommonDao;
import Epoint.PingBiao.Core.domain.PingBiaoKaiBiaoTouBiao;
import Epoint.PingBiao.Core.domain.PingbiaoBiaoduan;
import com.epoint.Eco.domain.PingbiaoEvalBiaojiabjb;
import com.epoint.PingBiao.Bizlogic2.Common.BaseDB.PingbiaoTbinfomxService;
import com.epoint.PingBiao.domain.PingbiaoTbinfomx;
import com.epoint.ZtbCommon.ZtbCommonDao;
import com.epoint.basic.bizlogic.sysconf.systemparameters.service.FrameConfigService9;
import com.epoint.basic.controller.BaseController;
import com.epoint.core.grammar.Record;
import com.epoint.core.utils.config.ConfigUtil;
import com.epoint.core.utils.string.StringUtil;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import java.util.List;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
* [一句话功能简述]
*
* @author 徐海南
* @version [版本号, 2021-03-23]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class ExcelUtils {
private static final transient Logger log = Logger.getLogger(BaseController.class);
private static final short VerticalAlignment_LEFT = 0;
private static final short VerticalAlignment_CENTER = 1;
private static final short VerticalAlignment_RIGHT = 2;
private static final short HorizontalAlignment_LEFT = 0;
private static final short HorizontalAlignment_CENTER = 1;
private static final short HorizontalAlignment_RIGHT = 2;
private static final int NUMBER2 = 2;
private static final int NUMBER8 = 8;
private static final int NUMBER5 = 5;
private static final int NUMBER6 = 6;
private static final int NUMBER3 = 3;
private static final int NUMBER4000 = 4000;
private static final int NUMBER6000 = 6000;
private static final int NUMBER8000 = 8000;
private static final int NUMBER10000 = 10000;
private static final int NUMBER4 = 4;
private static final int NUMBER7 = 7;
private static final int NUMBER9 = 9;
private static final int NUMBER2000 = 2000;
private static final int NUMBER12000 = 12000;
private static ZtbCommonDao service = ZtbCommonDao.getInstance();
private static PingBiaoBiaoDuanService biaoDuanService = new PingBiaoBiaoDuanService();
private static PingBiaoKaiBiaoTouBiaoService pingBiaoKaiBiaoTouBiaoService = new PingBiaoKaiBiaoTouBiaoService();
private static PingbiaoTbinfomxService pingbiaoTbinfomxService = new PingbiaoTbinfomxService();
/**
* 开标结束阶段生成Excel
*
* @param biaoDuanGuid biaoDuanGuid
* @param pbbf pbbf
* @param firstKB firstKB
* @return Workbook
* @author 徐海南
*/
public static Workbook generateExcel(String biaoDuanGuid, String pbbf, String firstKB) {
String kaiBiaoEndExcel = ConfigUtil.getConfigValue("parameter", "kaiBiaoEndExcel");
String conditionNum = "";
if (kaiBiaoEndExcel != null) {
String[] kaiBiaoEndExcelNum = kaiBiaoEndExcel.split(";");
for (String pbbfs : kaiBiaoEndExcelNum) {
if (pbbfs.contains(pbbf)) {
conditionNum = pbbfs.split(":")[0];
break;
}
}
}
String sql = "select BaoZhengJin,DanWeiName,DanWeiGuid,TouBiaoTotal,Zlcn,FileMiFeng,GongQi,XiangMuJL,KaiBiaoReMark,isnull( UPR_Date,'2099-09-09') AAA from PingBiao_KaiBiaoTouBiao where BiaoDuanGuid=? and IsTouBiao='1' and TuiHuiTime is null order by Row_ID";
if ("JLHYXZDJ".equals(pbbf)) {
if (biaoDuanService.isPFEnd(biaoDuanGuid, String.valueOf(ClsEnum.PFDType.技术标评审))) {
sql = "select BaoZhengJin,DanWeiName,DanWeiGuid,TouBiaoTotal,Zlcn,FileMiFeng,GongQi,XiangMuJL,KaiBiaoReMark,ISNULL( UPR_Date,'2099-09-09') AAA from PingBiao_KaiBiaoTouBiao where BiaoDuanGuid=? and IsTouBiao='1' and (isnull(feibiaojd,' ')=' ' or feibiaojd>3) and isnull(isfeibiao,'0')=0 and TuiHuiTime is null order by Row_ID ";
}
else {
sql = "select BaoZhengJin,DanWeiName,DanWeiGuid,'' as TouBiaoTotal,Zlcn,FileMiFeng,GongQi,XiangMuJL,KaiBiaoReMark,ISNULL( UPR_Date,'2099-09-09') AAA from PingBiao_KaiBiaoTouBiao where BiaoDuanGuid=? and IsTouBiao='1' and TuiHuiTime is null and (isnull(feibiaojd,' ')=' ' or feibiaojd>3) order by Row_ID ";
}
}
if ("AQCGJLHYXZDJ_FL".equals(pbbf)) {
if (biaoDuanService.isPFEnd(biaoDuanGuid, String.valueOf(ClsEnum.PFDType.技术标评审))) {
sql = "select BaoZhengJin,DanWeiName,DanWeiGuid,TouBiaoTotal,Zlcn,FileMiFeng,GongQi,XiangMuJL,KaiBiaoReMark,isnull( UPR_Date,'2099-09-09') AAA from PingBiao_KaiBiaoTouBiao where BiaoDuanGuid=? and IsTouBiao='1' and TuiHuiTime is null and (isnull(feibiaojd,' ')=' ' or feibiaojd>3) and TuiHuiTime is null order by Row_ID ";
}
else {
sql = "select BaoZhengJin,DanWeiName,DanWeiGuid,'' as TouBiaoTotal,Zlcn,FileMiFeng,GongQi,XiangMuJL,KaiBiaoReMark,isnull( UPR_Date,'2099-09-09') AAA from PingBiao_KaiBiaoTouBiao where BiaoDuanGuid=? and IsTouBiao='1' and TuiHuiTime is null and (isnull(feibiaojd,' ')=' ' or feibiaojd>2) order by Row_ID ";
}
}
if ("AQFJLJDZWZ".equals(pbbf) && biaoDuanService.isPFEnd(biaoDuanGuid, String.valueOf(ClsEnum.PFDType.技术标评审))) {
sql = "select BaoZhengJin,DanWeiName,DanWeiGuid,TouBiaoTotal,Zlcn,FileMiFeng,GongQi,XiangMuJL,KaiBiaoReMark,isnull( UPR_Date,'2099-09-09') AAA from PingBiao_KaiBiaoTouBiao where BiaoDuanGuid=? and IsTouBiao='1' and (isnull(isfeibiao,'0')=0 or feibiaojd>2) and issucceed=1 order by Row_ID ";
}
if (!new FrameConfigService9().getFrameConfigValue("非两阶段办法").contains(pbbf + ";") && !biaoDuanService
.isPFEnd(biaoDuanGuid, String.valueOf(ClsEnum.PFDType.技术标评审))) {
sql = "select BaoZhengJin,DanWeiName,DanWeiGuid,'' as TouBiaoTotal,Zlcn,FileMiFeng,GongQi,XiangMuJL,KaiBiaoReMark,isnull( UPR_Date,'2099-09-09') AAA from PingBiao_KaiBiaoTouBiao where BiaoDuanGuid=? and IsTouBiao='1' and TuiHuiTime is null order by Row_ID";
}
List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList = service
.findList(sql, PingBiaoKaiBiaoTouBiao.class, biaoDuanGuid);
// KaiBiaoDate
PingbiaoBiaoduan biaoduan = biaoDuanService.getBean("*", biaoDuanGuid);
String kaiBiaoDate = biaoDuanService.getKaiBiaoDate(biaoduan);
CommonFunction.InsertLog("查询", "", "查询开标时间");
// top 3
sql = "SELECT Row_id,RowGuid,Last_TotalPrice,DanWeiName,DanWeiGuid FROM PingBiao_Eval_BiaoJiaBJB WHERE TYPE='0' and biaoduanguid=? and danweiguid not in (select DanWeiguid from pingbiao_kaibiaotoubiao where isfeibiao='1' and BiaoDuanGuid=?) order by Last_TotalPrice asc";
List<PingbiaoEvalBiaojiabjb> biaojiabjbList = service
.findList(sql, PingbiaoEvalBiaojiabjb.class, biaoDuanGuid, biaoDuanGuid);
// TBInfoMx
sql = "select * from PingBiao_TBInfoMx where biaoduanguid=?";
List<PingbiaoTbinfomx> dvTBInfoMx = PBCommonDao.getInstance(biaoDuanGuid)
.findList(sql, PingbiaoTbinfomx.class, biaoDuanGuid);
try {
Workbook workBook;
switch (StringUtil.isNotBlank(conditionNum) ? conditionNum : "") {
case "0":
workBook = GetWorkBook(pingbiaokaibiaoList, biaojiabjbList, biaoduan, dvTBInfoMx, kaiBiaoDate,
biaoDuanGuid);
break;
case "1":
workBook = GetWorkBook1(pingbiaokaibiaoList, biaojiabjbList, biaoduan, dvTBInfoMx, kaiBiaoDate,
biaoDuanGuid, pbbf);
break;
case "2":
workBook = GetWorkBook2(pingbiaokaibiaoList, biaojiabjbList, biaoduan, dvTBInfoMx, kaiBiaoDate,
biaoDuanGuid);
break;
case "3":
workBook = GetWorkBook_FJ(pingbiaokaibiaoList, dvTBInfoMx, biaoduan, dvTBInfoMx, kaiBiaoDate,
biaoDuanGuid, pbbf);
break;
case "4":
workBook = GetWorkBook_JT(pingbiaokaibiaoList, dvTBInfoMx, biaoduan, dvTBInfoMx, kaiBiaoDate, pbbf);
break;
case "5":
workBook = GetWorkBook_JLHYXZDJ(pingbiaokaibiaoList, dvTBInfoMx, biaoduan, dvTBInfoMx, kaiBiaoDate,
pbbf);
break;
case "6":
workBook = GetWorkBook_SLSG(pingbiaokaibiaoList, dvTBInfoMx, biaoduan, dvTBInfoMx, kaiBiaoDate,
biaoDuanGuid, pbbf);
break;
case "7":
workBook = GetWorkBook_JLJDZWZ(pingbiaokaibiaoList, dvTBInfoMx, biaoduan, dvTBInfoMx, kaiBiaoDate,
biaoDuanGuid, pbbf);
break;
case "8":
workBook = GetWorkBook_XEBF(pingbiaokaibiaoList, dvTBInfoMx, biaoduan, dvTBInfoMx, kaiBiaoDate);
break;
default:
workBook = GetWorkBookDefault(biaoduan, kaiBiaoDate, biaoDuanGuid, pbbf, firstKB);
}
return workBook;
}
catch (Exception ex) {
log.error("导出开标记录表失败", ex);
CommonFunction.InsertLog("导出", "开标记录表", ex.getMessage());
return null;
}
}
/**
* 将dataview的数据转成Excel
* 默认导出唱标列
*
* @param biaoduan 标段
* @param kaiBiaoDate 开标日期
* @param biaoDuanGuid biaoDuanGuid
* @param pbbf pbbf
* @param firstKB firstKB
* @return workbook
*/
public static Workbook GetWorkBookDefault(PingbiaoBiaoduan biaoduan, String kaiBiaoDate, String biaoDuanGuid,
String pbbf, String firstKB) {
String isCBFilter1 = ConfigUtil.getConfigValue("parameter", "isCBFilter1");
String isCBFilter2 = ConfigUtil.getConfigValue("parameter", "isCBFilter2");
// 两阶段未到商务标不唱标
String isEcoCB = ConfigUtil.getConfigValue("parameter", "isEcoCB");
List<Record> dwList = pingBiaoKaiBiaoTouBiaoService.selectAllKBDanWei4Cb(biaoDuanGuid);
String isTechEnd = biaoDuanService.getColumnValue("istechend", biaoDuanGuid);
if ("1".equals(isCBFilter1)) {
if ("1".equals(isTechEnd) && "1".equals(biaoDuanService.getBiaoDuanExtValue(biaoDuanGuid, "EconSucceed"))) {
String strSql = "SELECT row_id,RowGuid,danweiguid,danweiName,TechKBRemark,KaiBiaoReMark,ispayforbzj,IsTechSucceedShow,TBImportPercent," + "IsTechSucceed,IsSucceed,isecosucceed,tbhb,bcbj,zzbj,TBFileAttchGuid,TBFileAttachConnectionstring,UPR_Date,iscanyupb " + "FROM PingBiao_KaibiaoTouBiao WHERE BiaoDuanGuid=? and IsTouBiao='1' and TuiHuiTime is null and (isnull(feibiaojd,' ')=' ' or feibiaojd>3)";
dwList = ZtbCommonDao.getInstance().findList(strSql, PingBiaoKaiBiaoTouBiao.class, biaoDuanGuid)
.stream().sorted().collect(Collectors.toList());
}
}
else if ("1".equals(isCBFilter2) && "1".equals(isTechEnd)) {
String strSql = "SELECT row_id,RowGuid,danweiguid,danweiName,TechKBRemark,KaiBiaoReMark,ispayforbzj,IsTechSucceedShow,TBImportPercent," + "IsTechSucceed,IsSucceed,isecosucceed,tbhb,bcbj,zzbj,TBFileAttchGuid,TBFileAttachConnectionstring,UPR_Date,iscanyupb " + "FROM PingBiao_KaibiaoTouBiao WHERE BiaoDuanGuid=? and issucceed='1' and TuiHuiTime is null and (isnull(isfeibiao,'0')='0' or feibiaojd>2)";
dwList = ZtbCommonDao.getInstance().findList(strSql, PingBiaoKaiBiaoTouBiao.class, biaoDuanGuid).stream()
.sorted().collect(Collectors.toList());
}
else if ("1".equals(isEcoCB)) {
String strSql = "SELECT row_id,RowGuid,danweiguid,danweiName,TechKBRemark,KaiBiaoReMark,ispayforbzj,IsTechSucceedShow,TBImportPercent,IsTechSucceed,IsSucceed,isecosucceed,tbhb,bcbj,zzbj,TBFileAttchGuid,TBFileAttachConnectionstring,UPR_Date,iscanyupb FROM PingBiao_KaibiaoTouBiao WHERE BiaoDuanGuid=? and IsTouBiao='1' and TuiHuiTime is null and (isecosucceed='1' or issucceed='1') and isruwei=1 and isfeibiao<>1 order by Row_ID ";
dwList = ZtbCommonDao.getInstance().findList(strSql, PingBiaoKaiBiaoTouBiao.class, biaoDuanGuid).stream()
.sorted().collect(Collectors.toList());
}
List<Record> cbHeads = pingbiaoTbinfomxService.listCBHeads(biaoDuanGuid);
// 获取投标单位响应值
List<Record> dvKeysTB = pingbiaoTbinfomxService.listCBValue(biaoDuanGuid);
CommonFunction.InsertLog("查询", "", "查询唱标项");
for (Record cbHead : cbHeads) {
String bookMarkName = cbHead.getStr("bookmarkname");
if ("单位名称".equals(cbHead.getStr("BookMarkName")) || "投标人名称".equals(cbHead.getStr("BookMarkName")) || "投标单位"
.equals(cbHead.getStr("BookMarkName")) || "投标单位名称".equals(cbHead.getStr("BookMarkName"))) {
continue;
}
for (Record dw : dwList) {
Predicate<Record> filter = (p) -> (bookMarkName.equals(p.getStr("BookMarkName")) && dw
.getStr("DanWeiGuid").equals(p.getStr("DanWeiGuid")));
Optional<Record> firstA = dvKeysTB.stream().filter(filter).findFirst();
firstA.ifPresent(record -> dw.put(cbHead.getStr("bookmarkname"), record.getStr("markvalue")));
}
}
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("开标记录表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER5));
sheet.addMergedRegion(new CellRangeAddress(1, 1, NUMBER6, NUMBER8));
// Title
HSSFFont font = workBook.createFont();
// 逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(VerticalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue("开标记录表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowZBR = sheet.createRow(1);
HSSFCell cellZBR = rowZBR.createCell(0);
cellZBR.setCellValue(
"招标人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellZBR.setCellStyle(leftCellStyle);
rowZBR.setHeight(Short.parseShort("700"));
HSSFCell cellKBTime = rowZBR.createCell(NUMBER6);
cellKBTime.setCellValue("开标时间:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER2);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("500"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue(new ReNameAction().getTbdw() + "名称");
tbrCell.setCellStyle(cellCellStyle);
int i = NUMBER2;
for (Record cbHead : cbHeads) {
if ("单位名称".equals(cbHead.getStr("BookMarkName")) || "投标人名称".equals(cbHead.getStr("BookMarkName")) || "投标单位"
.equals(cbHead.getStr("BookMarkName")) || "投标单位名称".equals(cbHead.getStr("BookMarkName"))) {
continue;
}
HSSFCell cell = dwRow.createCell(i);
cell.setCellValue(cbHead.getStr("TableHead"));
cell.setCellStyle(cellCellStyle);
i++;
}
HSSFCell kbRemarkCell = dwRow.createCell(i);
kbRemarkCell.setCellValue("开标备注");
kbRemarkCell.setCellStyle(cellCellStyle);
// 从第四行开始
int rowIndex = NUMBER3;
int cellIndex = 0;
for (Record dw : dwList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER2);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getStr("DanWeiName"));
tbrCell.setCellStyle(leftCellStyle);
cellIndex = NUMBER2;
for (Record drvKey : cbHeads) {
String bookMarkName = drvKey.getStr("BookMarkName");
if ("单位名称".equals(bookMarkName) || "投标人名称".equals(bookMarkName) || "投标单位"
.equals(bookMarkName) || "投标单位名称".equals(bookMarkName)) {
continue;
}
HSSFCell cell = dvDetail.createCell(cellIndex);
cell.setCellStyle(cellCellStyle);
if (dw.getStr(drvKey.getStr("BookMarkName")) != null) {
cell.setCellValue(dw.getStr(drvKey.getStr("BookMarkName")));
}
else {
cell.setCellValue("");
}
cellIndex++;
}
kbRemarkCell = dvDetail.createCell(cellIndex);
kbRemarkCell.setCellValue(dw.getStr("kaibiaoremark") != null ? dw.getStr("kaibiaoremark") : "");
kbRemarkCell.setCellStyle(leftCellStyle);
rowIndex++;
}
sheet.setColumnWidth(0, NUMBER4000);
sheet.setColumnWidth(1, NUMBER10000);
for (int n = NUMBER2; n < cellIndex + 1; n++) {
sheet.setColumnWidth(n, NUMBER6000);
}
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param biaojiabjbList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @param biaoDuanGuid biaoDuanGuid
* @return workbook
*/
public static Workbook GetWorkBook(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoEvalBiaojiabjb> biaojiabjbList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate, String biaoDuanGuid) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("开标记录表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER5));
sheet.addMergedRegion(new CellRangeAddress(1, 1, NUMBER6, NUMBER8));
// Title
HSSFFont font = workBook.createFont();
// 逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(HorizontalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue("开标记录表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowZBR = sheet.createRow(1);
HSSFCell cellZBR = rowZBR.createCell(0);
cellZBR.setCellValue(
"招标人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellZBR.setCellStyle(leftCellStyle);
rowZBR.setHeight(Short.parseShort("700"));
HSSFCell cellKBTime = rowZBR.createCell(NUMBER6);
cellKBTime.setCellValue("开标时间:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER2);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("500"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标人");
tbrCell.setCellStyle(cellCellStyle);
HSSFCell mfqkCell = dwRow.createCell(NUMBER2);
mfqkCell.setCellValue("密封情况");
mfqkCell.setCellStyle(cellCellStyle);
HSSFCell totalPriceCell = dwRow.createCell(NUMBER3);
totalPriceCell.setCellValue("投标总报价(元)");
totalPriceCell.setCellStyle(cellCellStyle);
HSSFCell gczlCell = dwRow.createCell(NUMBER4);
gczlCell.setCellValue("工程质量");
gczlCell.setCellStyle(cellCellStyle);
HSSFCell gqCell = dwRow.createCell(NUMBER5);
gqCell.setCellValue("工期(日历天)");
gqCell.setCellStyle(cellCellStyle);
HSSFCell projectManagerCell = dwRow.createCell(NUMBER6);
projectManagerCell.setCellValue("项目经理");
projectManagerCell.setCellStyle(cellCellStyle);
HSSFCell tbrConfirmCell = dwRow.createCell(NUMBER7);
tbrConfirmCell.setCellValue("投标人确认");
tbrConfirmCell.setCellStyle(cellCellStyle);
HSSFCell remarkCell = dwRow.createCell(NUMBER8);
remarkCell.setCellValue("备注");
remarkCell.setCellStyle(cellCellStyle);
// 从第四行开始
int rowIndex = NUMBER3;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER2);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellCellStyle);
mfqkCell = dvDetail.createCell(NUMBER2);
mfqkCell.setCellValue(dw.getFilemifeng());
mfqkCell.setCellStyle(cellCellStyle);
String totalPrice = "";
if (!"1".equals(biaoduan.getIstechend())) {
totalPrice = dw.getToubiaototal();
}
totalPriceCell = dvDetail.createCell(NUMBER3);
totalPriceCell.setCellValue(totalPrice);
totalPriceCell.setCellStyle(cellCellStyle);
gczlCell = dvDetail.createCell(NUMBER4);
String gczl = dw.getZlcn();
if (StringUtil.isBlank(gczl)) {
List<PingbiaoTbinfomx> tbinfomx = tbinfomxes.stream()
.filter(p -> dw.getDanweiguid().equals(p.getDanweiguid()) && "Zlcn".equals(p.getMarktype()))
.collect(Collectors.toList());
if (!tbinfomx.isEmpty()) {
gczl = tbinfomx.get(0).getMarkvalue();
}
}
gczlCell.setCellValue(gczl);
gczlCell.setCellStyle(cellCellStyle);
gqCell = dvDetail.createCell(NUMBER5);
gqCell.setCellValue(dw.getGongqi());
gqCell.setCellStyle(cellCellStyle);
projectManagerCell = dvDetail.createCell(NUMBER6);
projectManagerCell.setCellValue(dw.getXiangmujl());
projectManagerCell.setCellStyle(cellCellStyle);
tbrConfirmCell = dvDetail.createCell(NUMBER7);
tbrConfirmCell.setCellValue("");
tbrConfirmCell.setCellStyle(cellCellStyle);
remarkCell = dvDetail.createCell(NUMBER8);
remarkCell.setCellValue(dw.getKaibiaoremark());
remarkCell.setCellStyle(cellCellStyle);
rowIndex++;
}
}
String sql = "SELECT TouBiaoTotal FROM PingBiao_TouBiao_DetailBaoJia WHERE BiaoDuanGuid=? AND DanWeiGuid='bd001'";
String toubiaoTotal = service.queryString(sql, biaoDuanGuid);
toubiaoTotal = StringUtil.isBlank(toubiaoTotal) ? " " : toubiaoTotal;
HSSFRow baoJiaDetail = sheet.createRow(rowIndex);
baoJiaDetail.setHeight(Short.parseShort("500"));
HSSFRow firstHXRDetail = sheet.createRow(rowIndex + 1);
firstHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow secondHXRDetail = sheet.createRow(rowIndex + NUMBER2);
secondHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow thirdHXRDetail = sheet.createRow(rowIndex + NUMBER3);
thirdHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow forthDetail = sheet.createRow(rowIndex + NUMBER4);
forthDetail.setHeight(Short.parseShort("500"));
HSSFRow fifthDetail = sheet.createRow(rowIndex + NUMBER5);
fifthDetail.setHeight(Short.parseShort("500"));
HSSFRow sixthDetail = sheet.createRow(rowIndex + NUMBER6);
sixthDetail.setHeight(Short.parseShort("500"));
// 合并单元格
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER2, rowIndex + NUMBER2, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER3, rowIndex + NUMBER3, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER4, rowIndex + NUMBER4, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER5, rowIndex + NUMBER5, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER6, rowIndex + NUMBER6, 0, NUMBER8));
// 填充数据
HSSFCell baoJiaCell = baoJiaDetail.createCell(0);
baoJiaCell.setCellValue("招标控制价:" + toubiaoTotal + "元,其中暂列金额(含税): 元、暂估价(含税): 元");
baoJiaCell.setCellStyle(leftCellStyle);
HSSFCell firstHXRCell = firstHXRDetail.createCell(0);
firstHXRCell.setCellValue(
"第一中标候选人: 中标价: 元,其中暂列金额(含税): 元、暂估价(含税): 元");
firstHXRCell.setCellStyle(leftCellStyle);
HSSFCell secondHXRCell = secondHXRDetail.createCell(0);
secondHXRCell.setCellValue("第二中标候选人:");
secondHXRCell.setCellStyle(leftCellStyle);
HSSFCell thirdHXRCell = thirdHXRDetail.createCell(0);
thirdHXRCell.setCellValue("第三中标候选人:");
thirdHXRCell.setCellStyle(leftCellStyle);
HSSFCell forthCell = forthDetail.createCell(0);
forthCell.setCellValue("招标人: 监督人员: 项目负责人: 特邀监督员: 公证人员:");
forthCell.setCellStyle(leftCellStyle);
String sqlXiShu = "select * from PingBiao_YouXiaoPanD where biaoduanguid=?";
Record xiShu = service.find(sqlXiShu, Record.class, biaoDuanGuid);
String canShuC = xiShu == null ? "" : xiShu.getStr("CanShuC");
String canShuF = xiShu == null ? "" : xiShu.getStr("CanShuF");
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("C值:" + canShuC + " F值:" + canShuF);
fifthCell.setCellStyle(leftCellStyle);
HSSFCell sixthCell = sixthDetail.createCell(0);
sixthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
sixthCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER4000);
sheet.setColumnWidth(1, NUMBER8000);
sheet.setColumnWidth(NUMBER2, NUMBER4000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER6, NUMBER6000);
sheet.setColumnWidth(NUMBER7, NUMBER4000);
sheet.setColumnWidth(NUMBER8, NUMBER4000);
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param biaojiabjbList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @param biaoDuanGuid biaoDuanGuid
* @param pbbf pbbf
* @return workbook
*/
public static Workbook GetWorkBook1(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoEvalBiaojiabjb> biaojiabjbList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate, String biaoDuanGuid, String pbbf) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("唱标表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(NUMBER2, NUMBER2, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(NUMBER3, NUMBER3, 0, NUMBER6));
// Title
HSSFFont font = workBook.createFont();
// 逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellStyle = workBook.createCellStyle();
cellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellStyle.setAlignment(HorizontalAlignment_CENTER);
cellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue("唱标表");
titleCell.setCellStyle(cellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowProjectName = sheet.createRow(1);
HSSFCell cellProjectName = rowProjectName.createCell(0);
cellProjectName.setCellValue(
"项目名称:" + (StringUtil.isBlank(biaoduan.getBiaoduanname()) ? "" : biaoduan.getBiaoduanname()));
cellProjectName.setCellStyle(leftCellStyle);
HSSFRow rowCGR = sheet.createRow(NUMBER2);
HSSFCell cellCGR = rowCGR.createCell(0);
cellCGR.setCellValue(
"采购人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellCGR.setCellStyle(leftCellStyle);
HSSFRow rowKBTime = sheet.createRow(NUMBER3);
HSSFCell cellKBTime = rowKBTime.createCell(0);
cellKBTime.setCellValue("开标日期:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER5);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellStyle);
dwRow.setHeight(Short.parseShort("600"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标单位名称");
tbrCell.setCellStyle(cellStyle);
HSSFCell totalPriceCell = dwRow.createCell(NUMBER2);
String baojiaLabel = "总报价(元)";
if ("CGYXZDJ_TBHFL".equals(pbbf) || "ZFCGFWYXZDJ_TBHFL".equals(pbbf)) {
baojiaLabel = "投标报价";
}
else if ("AQZFCGJZXCSZHPFF".equals(pbbf)) {
baojiaLabel = "投标报价(元)";
}
else if ("ZFCGFWZHPFF_FL".equals(pbbf)) {
baojiaLabel = "投标报价(%)";
}
totalPriceCell.setCellValue(baojiaLabel);
totalPriceCell.setCellStyle(cellStyle);
String gongQiLabel = "交货、安装、调试期(日历天)";
if ("ZFCGFWYXZDJ".equals(pbbf) || "ZFCGFWZHPFF".equals(pbbf)) {
gongQiLabel = "服务期限(个月)";
}
else if ("ZFCGFWYXZDJ_TBHFL".equals(pbbf) || "AQCGFWTPYXZDJ".equals(pbbf)) {
gongQiLabel = "服务期限";
}
else if ("AQCGXJ[XJ]".equals(pbbf) || "ZFCGFWZHPFF_FL".equals(pbbf)) {
gongQiLabel = "服务期";
}
else if ("CGYXZDJ_TBHFL".equals(pbbf)) {
gongQiLabel = "交货、安装、调试期";
}
else if ("AQZFCGJZXCSZHPFF".equals(pbbf)) {
gongQiLabel = "工期(日历天)";
}
HSSFCell gqCell = dwRow.createCell(NUMBER3);
gqCell.setCellValue(gongQiLabel);
gqCell.setCellStyle(cellStyle);
HSSFCell fileMiFengCell = dwRow.createCell(NUMBER4);
fileMiFengCell.setCellValue("密封性");
fileMiFengCell.setCellStyle(cellStyle);
HSSFCell remarkCell = dwRow.createCell(NUMBER5);
remarkCell.setCellValue("备注");
remarkCell.setCellStyle(cellStyle);
HSSFCell tbdwSignCell = dwRow.createCell(NUMBER6);
tbdwSignCell.setCellValue("投标单位代表签字");
tbdwSignCell.setCellStyle(cellStyle);
// 从第六行开始
int rowIndex = NUMBER6;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER5);
xhCell.setCellStyle(cellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellStyle);
totalPriceCell = dvDetail.createCell(NUMBER2);
totalPriceCell.setCellValue(dw.getToubiaototal());
totalPriceCell.setCellStyle(cellStyle);
gqCell = dvDetail.createCell(NUMBER3);
gqCell.setCellValue(dw.getGongqi());
gqCell.setCellStyle(cellStyle);
fileMiFengCell = dvDetail.createCell(NUMBER4);
fileMiFengCell.setCellValue(dw.getFilemifeng());
fileMiFengCell.setCellStyle(cellStyle);
remarkCell = dvDetail.createCell(NUMBER5);
remarkCell.setCellValue(dw.getKaibiaoremark());
remarkCell.setCellStyle(cellStyle);
tbdwSignCell = dvDetail.createCell(NUMBER6);
tbdwSignCell.setCellValue("");
tbdwSignCell.setCellStyle(cellStyle);
rowIndex++;
}
}
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER2, rowIndex + NUMBER2, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER3, rowIndex + NUMBER3, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER4, rowIndex + NUMBER4, 0, NUMBER6));
String sql = "SELECT TouBiaoTotal FROM PingBiao_TouBiao_DetailBaoJia WHERE BiaoDuanGuid=? AND DanWeiGuid='bd001'";
String toubiaoTotal = service.queryString(sql, biaoDuanGuid);
toubiaoTotal = StringUtil.isBlank(toubiaoTotal) ? " " : toubiaoTotal;
HSSFRow firstHXRDetail = sheet.createRow(rowIndex);
firstHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow secondHXRDetail = sheet.createRow(rowIndex + 1);
secondHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow thirdHXRDetail = sheet.createRow(rowIndex + NUMBER2);
thirdHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow forthDetail = sheet.createRow(rowIndex + NUMBER3);
forthDetail.setHeight(Short.parseShort("500"));
HSSFRow fifthDetail = sheet.createRow(rowIndex + NUMBER4);
fifthDetail.setHeight(Short.parseShort("500"));
// 填充数据
HSSFCell firstHXRCell = firstHXRDetail.createCell(0);
firstHXRCell.setCellValue("第一中标候选人: 中标价: 元");
firstHXRCell.setCellStyle(leftCellStyle);
HSSFCell secondHXRCell = secondHXRDetail.createCell(0);
secondHXRCell.setCellValue("第二中标候选人: 中标价: 元");
secondHXRCell.setCellStyle(leftCellStyle);
HSSFCell thirdHXRCell = thirdHXRDetail.createCell(0);
thirdHXRCell.setCellValue("第三中标候选人: 中标价: 元");
thirdHXRCell.setCellStyle(leftCellStyle);
HSSFCell forthCell = forthDetail.createCell(0);
forthCell.setCellValue("最高投标限价:" + toubiaoTotal);
forthCell.setCellStyle(leftCellStyle);
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
fifthCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER4000);
sheet.setColumnWidth(1, NUMBER8000);
sheet.setColumnWidth(NUMBER2, NUMBER6000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER6, NUMBER6000);
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param biaojiabjbList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @param biaoDuanGuid biaoDuanGuid
* @return workbook
*/
public static Workbook GetWorkBook2(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoEvalBiaojiabjb> biaojiabjbList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate, String biaoDuanGuid) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("招标现场记录表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER5));
sheet.addMergedRegion(new CellRangeAddress(1, 1, NUMBER6, NUMBER9));
// Title
HSSFFont font = workBook.createFont();
// 逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(HorizontalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue(biaoduan.getBiaoduanname() + "招标现场记录表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowProjectName = sheet.createRow(1);
rowProjectName.setHeight(Short.parseShort("500"));
HSSFCell cellProjectName = rowProjectName.createCell(0);
cellProjectName.setCellValue(
"招标人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellProjectName.setCellStyle(leftCellStyle);
HSSFCell cellKBTime = rowProjectName.createCell(NUMBER6);
cellKBTime.setCellValue("开标时间:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER2);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("500"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标人");
tbrCell.setCellStyle(cellCellStyle);
HSSFCell fileMiFengCell = dwRow.createCell(NUMBER2);
fileMiFengCell.setCellValue("密封情况");
fileMiFengCell.setCellStyle(cellCellStyle);
HSSFCell toubiaoBZJCell = dwRow.createCell(NUMBER3);
toubiaoBZJCell.setCellValue("投标保证金");
toubiaoBZJCell.setCellStyle(cellCellStyle);
HSSFCell touBiaoTotalCell = dwRow.createCell(NUMBER4);
touBiaoTotalCell.setCellValue("投标费率(%)");
touBiaoTotalCell.setCellStyle(cellCellStyle);
HSSFCell zongJianCell = dwRow.createCell(NUMBER5);
zongJianCell.setCellValue("总监");
zongJianCell.setCellStyle(cellCellStyle);
HSSFCell n1Cell = dwRow.createCell(NUMBER6);
n1Cell.setCellValue("N1");
n1Cell.setCellStyle(cellCellStyle);
HSSFCell n2Cell = dwRow.createCell(NUMBER7);
n2Cell.setCellValue("N2");
n2Cell.setCellStyle(cellCellStyle);
HSSFCell n3Cell = dwRow.createCell(NUMBER8);
n3Cell.setCellValue("N3");
n3Cell.setCellStyle(cellCellStyle);
HSSFCell tbrConfirmCell = dwRow.createCell(NUMBER9);
tbrConfirmCell.setCellValue("投标人确认");
tbrConfirmCell.setCellStyle(cellCellStyle);
// 从第三行开始
int rowIndex = NUMBER3;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER2);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellCellStyle);
fileMiFengCell = dvDetail.createCell(NUMBER2);
fileMiFengCell.setCellValue(dw.getFilemifeng());
fileMiFengCell.setCellStyle(cellCellStyle);
toubiaoBZJCell = dvDetail.createCell(NUMBER3);
toubiaoBZJCell.setCellValue(dw.getBaozhengjin());
toubiaoBZJCell.setCellStyle(cellCellStyle);
touBiaoTotalCell = dvDetail.createCell(NUMBER4);
touBiaoTotalCell.setCellValue(dw.getToubiaototal());
touBiaoTotalCell.setCellStyle(cellCellStyle);
String xiangMuJL = dw.getXiangmujl();
if (StringUtil.isBlank(xiangMuJL)) {
String sql = "select markvalue from PingBiao_TBInfoMx where BiaoDuanGuid=? and danweiguid=? and marktype='Zjxm'";
xiangMuJL = service.queryString(sql, biaoDuanGuid, dw.getDanweiguid());
}
zongJianCell = dvDetail.createCell(NUMBER5);
zongJianCell.setCellValue(xiangMuJL);
zongJianCell.setCellStyle(cellCellStyle);
n1Cell = dvDetail.createCell(NUMBER6);
n1Cell.setCellValue(biaoDuanService.getBiaoDuanExtValue(biaoDuanGuid, "N1"));
n1Cell.setCellStyle(cellCellStyle);
n2Cell = dvDetail.createCell(NUMBER7);
n2Cell.setCellValue(biaoDuanService.getBiaoDuanExtValue(biaoDuanGuid, "N2"));
n2Cell.setCellStyle(cellCellStyle);
n3Cell = dvDetail.createCell(NUMBER8);
n3Cell.setCellValue(biaoDuanService.getBiaoDuanExtValue(biaoDuanGuid, "N3"));
CommonFunction.InsertLog("查询", "", "查询biaoduanext表N3");
n3Cell.setCellStyle(cellCellStyle);
tbrConfirmCell = dvDetail.createCell(NUMBER9);
tbrConfirmCell.setCellValue("");
tbrConfirmCell.setCellStyle(cellCellStyle);
rowIndex++;
}
}
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER2, rowIndex + NUMBER2, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER3, rowIndex + NUMBER3, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER4, rowIndex + NUMBER4, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER5, rowIndex + NUMBER5, 0, NUMBER9));
String sql = "SELECT TouBiaoTotal FROM PingBiao_TouBiao_DetailBaoJia WHERE BiaoDuanGuid=? AND DanWeiGuid='bd001'";
String toubiaoTotal = service.queryString(sql, biaoDuanGuid);
toubiaoTotal = StringUtil.isBlank(toubiaoTotal) ? " " : toubiaoTotal;
HSSFRow toubiaoTotalDetail = sheet.createRow(rowIndex);
toubiaoTotalDetail.setHeight(Short.parseShort("500"));
HSSFRow firstHXRDetail = sheet.createRow(rowIndex);
firstHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow secondHXRDetail = sheet.createRow(rowIndex + 1);
secondHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow thirdHXRDetail = sheet.createRow(rowIndex + NUMBER2);
thirdHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow forthDetail = sheet.createRow(rowIndex + NUMBER3);
forthDetail.setHeight(Short.parseShort("500"));
HSSFRow fifthDetail = sheet.createRow(rowIndex + NUMBER4);
fifthDetail.setHeight(Short.parseShort("500"));
// 填充数据
HSSFCell toubiaoTotalCell = toubiaoTotalDetail.createCell(0);
toubiaoTotalCell.setCellValue("监理服务费最高投标报价(或费率):" + toubiaoTotal);
toubiaoTotalCell.setCellStyle(leftCellStyle);
HSSFCell firstHXRCell = firstHXRDetail.createCell(0);
firstHXRCell.setCellValue("第一中标候选人: 中标价(或中标费率):");
firstHXRCell.setCellStyle(leftCellStyle);
HSSFCell secondHXRCell = secondHXRDetail.createCell(0);
secondHXRCell.setCellValue("第二中标候选人:");
secondHXRCell.setCellStyle(leftCellStyle);
HSSFCell thirdHXRCell = thirdHXRDetail.createCell(0);
thirdHXRCell.setCellValue("第三中标候选人:");
thirdHXRCell.setCellStyle(leftCellStyle);
HSSFCell forthCell = forthDetail.createCell(0);
forthCell.setCellValue(
"招标人代表、N3抽取人: 唱标人: 记录人: 监督人: N1、N2抽取人:");
forthCell.setCellStyle(leftCellStyle);
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
fifthCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER2000);
sheet.setColumnWidth(1, NUMBER12000);
sheet.setColumnWidth(NUMBER2, NUMBER6000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER6, NUMBER4000);
sheet.setColumnWidth(NUMBER7, NUMBER4000);
sheet.setColumnWidth(NUMBER8, NUMBER4000);
sheet.setColumnWidth(NUMBER9, NUMBER6000);
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param tbinfomxesList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @param biaoDuanGuid biaoDuanGuid
* @param pbbf pbbf
* @return workbook
*/
public static Workbook GetWorkBook_FJ(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoTbinfomx> tbinfomxesList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate, String biaoDuanGuid, String pbbf) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("招标现场记录表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER5));
sheet.addMergedRegion(new CellRangeAddress(1, 1, NUMBER6, NUMBER9));
// Title
HSSFFont font = workBook.createFont();
// 为了逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(HorizontalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue(biaoduan.getBiaoduanname() + "招标现场记录表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowCGR = sheet.createRow(1);
HSSFCell cellCGR = rowCGR.createCell(0);
cellCGR.setCellValue(
"招标人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellCGR.setCellStyle(leftCellStyle);
HSSFCell cellKBTime = rowCGR.createCell(NUMBER6);
cellKBTime.setCellValue("开标时间:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER2);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("600"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标人");
tbrCell.setCellStyle(cellCellStyle);
HSSFCell fileMiFengCell = dwRow.createCell(NUMBER2);
fileMiFengCell.setCellValue("密封情况");
fileMiFengCell.setCellStyle(cellCellStyle);
HSSFCell totalPriceCell = dwRow.createCell(NUMBER3);
String baojiaLabel;
if ("AQFJZHPGF_BJ".equals(pbbf) || "AQSLSJZHPFF[SL]".equals(pbbf)) {
baojiaLabel = "投标报价(元)";
}
else {
baojiaLabel = "投标费率(%)";
}
totalPriceCell.setCellValue(baojiaLabel);
totalPriceCell.setCellStyle(cellCellStyle);
String xiangMuJL;
if ("AQSLSJZHPFF[SL]".equals(pbbf)) {
xiangMuJL = "项目负责人";
}
else {
xiangMuJL = "设计工程师";
}
HSSFCell xiangMuJLCell = dwRow.createCell(NUMBER4);
xiangMuJLCell.setCellValue(xiangMuJL);
xiangMuJLCell.setCellStyle(cellCellStyle);
HSSFCell gongQiCell = dwRow.createCell(NUMBER5);
gongQiCell.setCellValue("设计周期(日历天)");
gongQiCell.setCellStyle(cellCellStyle);
HSSFCell n1Cell = dwRow.createCell(NUMBER6);
n1Cell.setCellValue("N1");
n1Cell.setCellStyle(cellCellStyle);
HSSFCell n2Cell = dwRow.createCell(NUMBER7);
n2Cell.setCellValue("N2");
n2Cell.setCellStyle(cellCellStyle);
HSSFCell n3Cell = dwRow.createCell(NUMBER8);
n3Cell.setCellValue("N3");
n3Cell.setCellStyle(cellCellStyle);
HSSFCell tbrConfirmCell = dwRow.createCell(NUMBER9);
tbrConfirmCell.setCellValue("投标人确认");
tbrConfirmCell.setCellStyle(cellCellStyle);
// 从第六行开始
int rowIndex = NUMBER3;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER2);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellCellStyle);
fileMiFengCell = dvDetail.createCell(NUMBER2);
fileMiFengCell.setCellValue(dw.getFilemifeng());
fileMiFengCell.setCellStyle(cellCellStyle);
totalPriceCell = dvDetail.createCell(NUMBER3);
totalPriceCell.setCellValue(dw.getToubiaototal());
totalPriceCell.setCellStyle(cellCellStyle);
List<PingbiaoTbinfomx> xmjls = tbinfomxesList.stream()
.filter(p -> dw.getDanweiguid().equals(p.getDanweiguid()) && ("设计工程师姓名"
.equals(p.getBookmarkname()) || "Xmjl".equals(p.getMarktype())))
.collect(Collectors.toList());
xiangMuJLCell = dvDetail.createCell(NUMBER4);
xiangMuJLCell.setCellValue(xmjls.get(0).getMarkvalue());
xiangMuJLCell.setCellStyle(cellCellStyle);
List<PingbiaoTbinfomx> gongQiS = tbinfomxesList.stream()
.filter(p -> dw.getDanweiguid().equals(p.getDanweiguid()) && "设计周期".equals(p.getBookmarkname()))
.collect(Collectors.toList());
gongQiCell = dvDetail.createCell(NUMBER5);
gongQiCell.setCellValue(gongQiS.get(0).getMarkvalue());
gongQiCell.setCellStyle(cellCellStyle);
n1Cell = dvDetail.createCell(NUMBER6);
n1Cell.setCellValue(biaoDuanService.getBiaoDuanExtValue(biaoDuanGuid, "N1"));
n1Cell.setCellStyle(cellCellStyle);
n2Cell = dvDetail.createCell(NUMBER7);
n2Cell.setCellValue(biaoDuanService.getBiaoDuanExtValue(biaoDuanGuid, "N2"));
n2Cell.setCellStyle(cellCellStyle);
n3Cell = dvDetail.createCell(NUMBER8);
n3Cell.setCellValue(biaoDuanService.getBiaoDuanExtValue(biaoDuanGuid, "N3"));
CommonFunction.InsertLog("查询", "", "查询biaoduanext表N3");
n3Cell.setCellStyle(cellCellStyle);
tbrConfirmCell = dvDetail.createCell(NUMBER9);
tbrConfirmCell.setCellValue("");
tbrConfirmCell.setCellStyle(cellCellStyle);
rowIndex++;
}
}
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER2, rowIndex + NUMBER2, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER3, rowIndex + NUMBER3, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER4, rowIndex + NUMBER4, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER5, rowIndex + NUMBER5, 0, NUMBER9));
String sql = "SELECT TouBiaoTotal FROM PingBiao_TouBiao_DetailBaoJia WHERE BiaoDuanGuid=? AND DanWeiGuid='bd001'";
String toubiaoTotal = service.queryString(sql, biaoDuanGuid);
toubiaoTotal = StringUtil.isBlank(toubiaoTotal) ? " " : toubiaoTotal;
HSSFRow touBiaoTotalDetail = sheet.createRow(rowIndex);
touBiaoTotalDetail.setHeight(Short.parseShort("500"));
HSSFRow firstHXRDetail = sheet.createRow(rowIndex);
firstHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow secondHXRDetail = sheet.createRow(rowIndex + 1);
secondHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow thirdHXRDetail = sheet.createRow(rowIndex + NUMBER2);
thirdHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow forthDetail = sheet.createRow(rowIndex + NUMBER3);
forthDetail.setHeight(Short.parseShort("500"));
HSSFRow fifthDetail = sheet.createRow(rowIndex + NUMBER4);
fifthDetail.setHeight(Short.parseShort("500"));
// 填充数据
HSSFCell touBiaoTotalCell = touBiaoTotalDetail.createCell(0);
touBiaoTotalCell.setCellValue("设计服务费最高投标报价(或费率):" + toubiaoTotal);
touBiaoTotalCell.setCellStyle(leftCellStyle);
HSSFCell firstHXRCell = firstHXRDetail.createCell(0);
firstHXRCell.setCellValue("第一中标候选人: 中标价(或中标费率):");
firstHXRCell.setCellStyle(leftCellStyle);
HSSFCell secondHXRCell = secondHXRDetail.createCell(0);
secondHXRCell.setCellValue("第二中标候选人:");
secondHXRCell.setCellStyle(leftCellStyle);
HSSFCell thirdHXRCell = thirdHXRDetail.createCell(0);
thirdHXRCell.setCellValue("第三中标候选人:");
thirdHXRCell.setCellStyle(leftCellStyle);
HSSFCell forthCell = forthDetail.createCell(0);
forthCell.setCellValue(
"招标人代表、N3抽取人: 唱标人: 记录人: 监督人: N1、N2抽取人:");
forthCell.setCellStyle(leftCellStyle);
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
fifthCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER2000);
sheet.setColumnWidth(1, NUMBER12000);
sheet.setColumnWidth(NUMBER2, NUMBER6000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER6, NUMBER4000);
sheet.setColumnWidth(NUMBER7, NUMBER4000);
sheet.setColumnWidth(NUMBER8, NUMBER4000);
sheet.setColumnWidth(NUMBER9, NUMBER6000);
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param tbinfomxesList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @param pbbf pbbf
* @return workbook
*/
public static Workbook GetWorkBook_JT(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoTbinfomx> tbinfomxesList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate, String pbbf) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("开标记录表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER5));
sheet.addMergedRegion(new CellRangeAddress(1, 1, NUMBER6, NUMBER9));
// Title
HSSFFont font = workBook.createFont();
// 逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(HorizontalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue(biaoduan.getBiaoduanname() + "开标记录表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowCGR = sheet.createRow(1);
HSSFCell cellCGR = rowCGR.createCell(0);
cellCGR.setCellValue(
"招标人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellCGR.setCellStyle(leftCellStyle);
HSSFCell cellKBTime = rowCGR.createCell(NUMBER6);
cellKBTime.setCellValue("开标时间:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
rowCGR.setHeight(Short.parseShort("500"));
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER2);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("500"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标人");
tbrCell.setCellStyle(cellCellStyle);
HSSFCell fileMiFengCell = dwRow.createCell(NUMBER2);
fileMiFengCell.setCellValue("密封情况");
fileMiFengCell.setCellStyle(cellCellStyle);
HSSFCell totalPriceCell = dwRow.createCell(NUMBER3);
String baojiaLabel;
if ("AQSLJLZHPFF[SL]".equals(pbbf)) {
baojiaLabel = "投标报价(%)";
}
else {
baojiaLabel = "投标报价";
}
totalPriceCell.setCellValue(baojiaLabel);
totalPriceCell.setCellStyle(cellCellStyle);
String xiangMuJL;
if ("AQSLJLZHPFF[SL]".equals(pbbf)) {
xiangMuJL = "项目总监";
}
else {
xiangMuJL = "监理工程师";
}
HSSFCell xiangMuJLCell = dwRow.createCell(NUMBER4);
xiangMuJLCell.setCellValue(xiangMuJL);
xiangMuJLCell.setCellStyle(cellCellStyle);
HSSFCell tbrConfirmCell = dwRow.createCell(NUMBER5);
tbrConfirmCell.setCellValue("投标人确认");
tbrConfirmCell.setCellStyle(cellCellStyle);
HSSFCell remarkCell = dwRow.createCell(NUMBER6);
remarkCell.setCellValue("备注");
remarkCell.setCellStyle(cellCellStyle);
// 从第4行开始
int rowIndex = NUMBER3;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER2);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellCellStyle);
fileMiFengCell = dvDetail.createCell(NUMBER2);
fileMiFengCell.setCellValue(dw.getFilemifeng());
fileMiFengCell.setCellStyle(cellCellStyle);
totalPriceCell = dvDetail.createCell(NUMBER3);
totalPriceCell.setCellValue(dw.getToubiaototal());
totalPriceCell.setCellStyle(cellCellStyle);
xiangMuJLCell = dvDetail.createCell(NUMBER4);
xiangMuJLCell.setCellValue(dw.getXiangmujl());
xiangMuJLCell.setCellStyle(cellCellStyle);
tbrConfirmCell = dvDetail.createCell(NUMBER9);
tbrConfirmCell.setCellValue("");
tbrConfirmCell.setCellStyle(cellCellStyle);
remarkCell = dvDetail.createCell(NUMBER9);
remarkCell.setCellValue("");
remarkCell.setCellStyle(cellCellStyle);
rowIndex++;
}
}
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER2, rowIndex + NUMBER2, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER3, rowIndex + NUMBER3, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER4, rowIndex + NUMBER4, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER5, rowIndex + NUMBER5, 0, NUMBER9));
HSSFRow touBiaoTotalDetail = sheet.createRow(rowIndex);
touBiaoTotalDetail.setHeight(Short.parseShort("500"));
HSSFRow firstHXRDetail = sheet.createRow(rowIndex);
firstHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow secondHXRDetail = sheet.createRow(rowIndex + 1);
secondHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow thirdHXRDetail = sheet.createRow(rowIndex + NUMBER2);
thirdHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow forthDetail = sheet.createRow(rowIndex + NUMBER3);
forthDetail.setHeight(Short.parseShort("500"));
HSSFRow fifthDetail = sheet.createRow(rowIndex + NUMBER4);
fifthDetail.setHeight(Short.parseShort("500"));
// 填充数据
HSSFCell touBiaoTotalCell = touBiaoTotalDetail.createCell(0);
touBiaoTotalCell.setCellValue("最高投标限价: 元");
touBiaoTotalCell.setCellStyle(leftCellStyle);
HSSFCell firstHXRCell = firstHXRDetail.createCell(0);
firstHXRCell.setCellValue("第一中标候选人: 中标价:");
firstHXRCell.setCellStyle(leftCellStyle);
HSSFCell secondHXRCell = secondHXRDetail.createCell(0);
secondHXRCell.setCellValue("第二中标候选人:");
secondHXRCell.setCellStyle(leftCellStyle);
HSSFCell thirdHXRCell = thirdHXRDetail.createCell(0);
thirdHXRCell.setCellValue("第三中标候选人:");
thirdHXRCell.setCellStyle(leftCellStyle);
HSSFCell forthCell = forthDetail.createCell(0);
forthCell.setCellValue("招标人代表: 唱标人: 记录人: 监督人: ");
forthCell.setCellStyle(leftCellStyle);
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
fifthCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER2000);
sheet.setColumnWidth(1, NUMBER12000);
sheet.setColumnWidth(NUMBER2, NUMBER6000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER9, NUMBER6000);
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param tbinfomxesList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @param pbbf pbbf
* @return workbook
*/
public static Workbook GetWorkBook_JLHYXZDJ(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoTbinfomx> tbinfomxesList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate, String pbbf) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("唱标表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(NUMBER2, NUMBER2, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(NUMBER3, NUMBER3, 0, NUMBER6));
// Title
HSSFFont font = workBook.createFont();
// 为了逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(HorizontalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue("唱标表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowProjectName = sheet.createRow(1);
HSSFCell cellProjectName = rowProjectName.createCell(0);
cellProjectName.setCellValue(
"项目名称:" + (StringUtil.isBlank(biaoduan.getBiaoduanname()) ? "" : biaoduan.getBiaoduanname()));
cellProjectName.setCellStyle(leftCellStyle);
HSSFRow rowCGR = sheet.createRow(NUMBER2);
HSSFCell cellCGR = rowCGR.createCell(0);
cellCGR.setCellValue(
"采购人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellCGR.setCellStyle(leftCellStyle);
HSSFRow rowKBTime = sheet.createRow(NUMBER3);
HSSFCell cellKBTime = rowKBTime.createCell(0);
cellKBTime.setCellValue("开标日期:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER5);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("600"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标人");
tbrCell.setCellStyle(cellCellStyle);
HSSFCell totalPriceCell = dwRow.createCell(NUMBER2);
String baojiaLabel = "总报价(元)";
if ("AQCGJLHYXZDJ_FL".equals(pbbf)) {
baojiaLabel = "投标报价(%)";
}
totalPriceCell.setCellValue(baojiaLabel);
totalPriceCell.setCellStyle(cellCellStyle);
String gongQiLabel = "交货、安装、调试期(日历天)";
if ("AQCGJLHYXZDJ_FL".equals(pbbf)) {
gongQiLabel = "供货周期";
}
HSSFCell gqCell = dwRow.createCell(NUMBER3);
gqCell.setCellValue(gongQiLabel);
gqCell.setCellStyle(cellCellStyle);
HSSFCell fileMiFengCell = dwRow.createCell(NUMBER4);
fileMiFengCell.setCellValue("密封性");
fileMiFengCell.setCellStyle(cellCellStyle);
HSSFCell remarkCell = dwRow.createCell(NUMBER5);
remarkCell.setCellValue("备注");
remarkCell.setCellStyle(cellCellStyle);
HSSFCell tbdwSignCell = dwRow.createCell(NUMBER6);
tbdwSignCell.setCellValue("投标单位代表签字");
tbdwSignCell.setCellStyle(cellCellStyle);
// 从第六行开始
int rowIndex = NUMBER6;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER5);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellCellStyle);
totalPriceCell = dvDetail.createCell(NUMBER2);
totalPriceCell.setCellValue(dw.getToubiaototal());
totalPriceCell.setCellStyle(cellCellStyle);
gqCell = dvDetail.createCell(NUMBER3);
gqCell.setCellValue(dw.getGongqi());
gqCell.setCellStyle(cellCellStyle);
fileMiFengCell = dvDetail.createCell(NUMBER4);
fileMiFengCell.setCellValue(dw.getFilemifeng());
fileMiFengCell.setCellStyle(cellCellStyle);
remarkCell = dvDetail.createCell(NUMBER5);
remarkCell.setCellValue(dw.getKaibiaoremark());
remarkCell.setCellStyle(cellCellStyle);
tbdwSignCell = dvDetail.createCell(NUMBER6);
tbdwSignCell.setCellValue("");
tbdwSignCell.setCellStyle(cellCellStyle);
rowIndex++;
}
}
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER2, rowIndex + NUMBER2, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER3, rowIndex + NUMBER3, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER4, rowIndex + NUMBER4, 0, NUMBER6));
HSSFRow firstHXRDetail = sheet.createRow(rowIndex);
firstHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow secondHXRDetail = sheet.createRow(rowIndex + 1);
secondHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow thirdHXRDetail = sheet.createRow(rowIndex + NUMBER2);
thirdHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow forthDetail = sheet.createRow(rowIndex + NUMBER3);
forthDetail.setHeight(Short.parseShort("500"));
HSSFRow fifthDetail = sheet.createRow(rowIndex + NUMBER4);
fifthDetail.setHeight(Short.parseShort("500"));
// 填充数据
HSSFCell firstHXRCell = firstHXRDetail.createCell(0);
firstHXRCell.setCellValue("第一中标候选人: 中标价:");
firstHXRCell.setCellStyle(leftCellStyle);
HSSFCell secondHXRCell = secondHXRDetail.createCell(0);
secondHXRCell.setCellValue("第二中标候选人: 中标价:");
secondHXRCell.setCellStyle(leftCellStyle);
HSSFCell thirdHXRCell = thirdHXRDetail.createCell(0);
thirdHXRCell.setCellValue("第三中标候选人: 中标价:");
thirdHXRCell.setCellStyle(leftCellStyle);
HSSFCell forthCell = forthDetail.createCell(0);
forthCell.setCellValue("采购人: 监标人: 记录人: 唱标人: ");
forthCell.setCellStyle(leftCellStyle);
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
fifthCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER2000);
sheet.setColumnWidth(1, NUMBER12000);
sheet.setColumnWidth(NUMBER2, NUMBER6000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER6, NUMBER6000);
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param tbinfomxesList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @param biaoDuanGuid biaoDuanGuid
* @param pbbf pbbf
* @return workbook
*/
public static Workbook GetWorkBook_SLSG(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoTbinfomx> tbinfomxesList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate, String biaoDuanGuid, String pbbf) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("开标记录表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER9));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER5));
sheet.addMergedRegion(new CellRangeAddress(1, 1, NUMBER6, NUMBER9));
// Title
HSSFFont font = workBook.createFont();
// 为了逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(HorizontalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue("开标记录表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowZBR = sheet.createRow(1);
HSSFCell cellZBR = rowZBR.createCell(0);
cellZBR.setCellValue(
"招标人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellZBR.setCellStyle(leftCellStyle);
rowZBR.setHeight(Short.parseShort("700"));
HSSFCell cellKBTime = rowZBR.createCell(NUMBER6);
cellKBTime.setCellValue("开标时间:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER2);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("500"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标人");
tbrCell.setCellStyle(cellCellStyle);
HSSFCell mfqkCell = dwRow.createCell(NUMBER2);
mfqkCell.setCellValue("密封情况");
mfqkCell.setCellStyle(cellCellStyle);
HSSFCell totalPriceCell = dwRow.createCell(NUMBER3);
totalPriceCell.setCellValue("投标报价(元)");
totalPriceCell.setCellStyle(cellCellStyle);
HSSFCell toubiaoBZJCell = dwRow.createCell(NUMBER4);
toubiaoBZJCell.setCellValue("投标保证金(元)");
toubiaoBZJCell.setCellStyle(cellCellStyle);
HSSFCell gczlCell = dwRow.createCell(NUMBER5);
gczlCell.setCellValue("质量");
gczlCell.setCellStyle(cellCellStyle);
HSSFCell gqCell = dwRow.createCell(NUMBER6);
gqCell.setCellValue("工期(日历天)");
gqCell.setCellStyle(cellCellStyle);
HSSFCell projectManagerCell = dwRow.createCell(NUMBER7);
projectManagerCell.setCellValue("项目负责人");
projectManagerCell.setCellStyle(cellCellStyle);
HSSFCell tbrConfirmCell = dwRow.createCell(NUMBER8);
tbrConfirmCell.setCellValue("投标人确认");
tbrConfirmCell.setCellStyle(cellCellStyle);
HSSFCell remarkCell = dwRow.createCell(NUMBER9);
remarkCell.setCellValue("备注");
remarkCell.setCellStyle(cellCellStyle);
// 从第四行开始
int rowIndex = NUMBER3;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER2);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellCellStyle);
mfqkCell = dvDetail.createCell(NUMBER2);
mfqkCell.setCellValue(dw.getFilemifeng());
mfqkCell.setCellStyle(cellCellStyle);
String totalPrice = "";
if (!"1".equals(biaoduan.getIstechend())) {
totalPrice = dw.getToubiaototal();
}
totalPriceCell = dvDetail.createCell(NUMBER3);
totalPriceCell.setCellValue(totalPrice);
totalPriceCell.setCellStyle(cellCellStyle);
toubiaoBZJCell = dvDetail.createCell(NUMBER4);
toubiaoBZJCell.setCellValue(dw.getBaozhengjin());
toubiaoBZJCell.setCellStyle(cellCellStyle);
gczlCell = dvDetail.createCell(NUMBER5);
String gczl = dw.getZlcn();
if ("AQSGJSSW[SL]".equals(pbbf) || "AQSGZGSWJS[SL]".equals(pbbf) || "AQSLSWJS_NQB[SL]"
.equals(pbbf) || "AQSLSGXJSSW_NQD[SL]".equals(pbbf) || StringUtil.isBlank(gczl)) {
String gczlSql = "select markvalue from PingBiao_TBInfoMx where BiaoDuanGuid=? and danweiguid = ? and marktype='Zlcn'";
gczl = service.queryString(gczlSql, biaoDuanGuid, dw.getDanweiguid());
}
gczlCell.setCellValue(gczl);
gczlCell.setCellStyle(cellCellStyle);
gqCell = dvDetail.createCell(NUMBER6);
gqCell.setCellValue(dw.getGongqi());
gqCell.setCellStyle(cellCellStyle);
String xiangmuJL = dw.getXiangmujl();
if ("AQSGJSSW[SL]".equals(pbbf) || "AQSGZGSWJS[SL]".equals(pbbf) || "AQSLSWJS_NQB[SL]"
.equals(pbbf) || "AQSLSGXJSSW_NQD[SL]".equals(pbbf)) {
String xiangmuJLSql = "select markvalue from PingBiao_TBInfoMx where BiaoDuanGuid=? and danweiguid = ? and marktype='Xmjl'";
xiangmuJL = service.queryString(xiangmuJLSql, biaoDuanGuid, dw.getDanweiguid());
}
projectManagerCell = dvDetail.createCell(NUMBER7);
projectManagerCell.setCellValue(xiangmuJL);
projectManagerCell.setCellStyle(cellCellStyle);
tbrConfirmCell = dvDetail.createCell(NUMBER8);
tbrConfirmCell.setCellValue("");
tbrConfirmCell.setCellStyle(cellCellStyle);
remarkCell = dvDetail.createCell(NUMBER9);
remarkCell.setCellValue(dw.getKaibiaoremark());
remarkCell.setCellStyle(cellCellStyle);
rowIndex++;
}
}
String sql = "SELECT TouBiaoTotal FROM PingBiao_TouBiao_DetailBaoJia WHERE BiaoDuanGuid=? AND DanWeiGuid='bd001'";
String toubiaoTotal = service.queryString(sql, biaoDuanGuid);
toubiaoTotal = StringUtil.isBlank(toubiaoTotal) ? " " : toubiaoTotal;
HSSFRow baoJiaDetail = sheet.createRow(rowIndex);
baoJiaDetail.setHeight(Short.parseShort("500"));
HSSFRow firstHXRDetail = sheet.createRow(rowIndex + 1);
firstHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow secondHXRDetail = sheet.createRow(rowIndex + NUMBER2);
secondHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow thirdHXRDetail = sheet.createRow(rowIndex + NUMBER3);
thirdHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow forthDetail = sheet.createRow(rowIndex + NUMBER4);
forthDetail.setHeight(Short.parseShort("500"));
HSSFRow fifthDetail = sheet.createRow(rowIndex + NUMBER5);
fifthDetail.setHeight(Short.parseShort("500"));
HSSFRow sixthDetail = sheet.createRow(rowIndex + NUMBER6);
sixthDetail.setHeight(Short.parseShort("500"));
// 合并单元格
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER2, rowIndex + NUMBER2, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER3, rowIndex + NUMBER3, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER4, rowIndex + NUMBER4, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER5, rowIndex + NUMBER5, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER6, rowIndex + NUMBER6, 0, NUMBER8));
// 填充数据
HSSFCell baoJiaCell = baoJiaDetail.createCell(0);
baoJiaCell.setCellValue("招标控制价:" + toubiaoTotal + "元,其中暂列金额(含税): 元、暂估价(含税): 元");
baoJiaCell.setCellStyle(leftCellStyle);
HSSFCell firstHXRCell = firstHXRDetail.createCell(0);
firstHXRCell.setCellValue(
"第一中标候选人: 中标价: 元,其中暂列金额(含税): 元、暂估价(含税): 元");
firstHXRCell.setCellStyle(leftCellStyle);
HSSFCell secondHXRCell = secondHXRDetail.createCell(0);
secondHXRCell.setCellValue("第二中标候选人:");
secondHXRCell.setCellStyle(leftCellStyle);
HSSFCell thirdHXRCell = thirdHXRDetail.createCell(0);
thirdHXRCell.setCellValue("第三中标候选人:");
thirdHXRCell.setCellStyle(leftCellStyle);
HSSFCell forthCell = forthDetail.createCell(0);
forthCell.setCellValue("招标人: 监督人员: 项目负责人: 特邀监督员: 公证人员:");
forthCell.setCellStyle(leftCellStyle);
if ("AQSLSWJS_NQB[SL]".equals(pbbf) || "AQSLGCSGLJD[SL]".equals(pbbf) || "AQSLSGXJSSW_NQD[SL]".equals(pbbf)) {
String sqlXiShu = "select * from PingBiao_YouXiaoPanD where biaoduanguid=?";
Record xiShu = service.find(sqlXiShu, Record.class, biaoDuanGuid);
String canShuC = xiShu == null ? "" : xiShu.getStr("CanShuC");
String canShuF = xiShu == null ? "" : xiShu.getStr("CanShuF");
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("C值:" + canShuC + " F值:" + canShuF);
fifthCell.setCellStyle(leftCellStyle);
HSSFCell sixthCell = sixthDetail.createCell(0);
sixthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
sixthCell.setCellStyle(leftCellStyle);
}
HSSFCell fifthCell = sixthDetail.createCell(0);
fifthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
fifthCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER4000);
sheet.setColumnWidth(1, NUMBER8000);
sheet.setColumnWidth(NUMBER2, NUMBER4000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER6, NUMBER6000);
sheet.setColumnWidth(NUMBER7, NUMBER4000);
sheet.setColumnWidth(NUMBER8, NUMBER4000);
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param tbinfomxesList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @param biaoDuanGuid biaoDuanGuid
* @param pbbf pbbf
* @return workbook
*/
public static Workbook GetWorkBook_JLJDZWZ(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoTbinfomx> tbinfomxesList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate, String biaoDuanGuid, String pbbf) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("开标记录表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER5));
sheet.addMergedRegion(new CellRangeAddress(1, 1, NUMBER6, NUMBER8));
// Title
HSSFFont font = workBook.createFont();
// 为了逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(HorizontalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue("开标记录表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowZBR = sheet.createRow(1);
HSSFCell cellZBR = rowZBR.createCell(0);
cellZBR.setCellValue(
"招标人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellZBR.setCellStyle(leftCellStyle);
rowZBR.setHeight(Short.parseShort("700"));
HSSFCell cellKBTime = rowZBR.createCell(NUMBER6);
cellKBTime.setCellValue("开标时间:" + kaiBiaoDate);
cellKBTime.setCellStyle(leftCellStyle);
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER2);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("500"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标人");
tbrCell.setCellStyle(cellCellStyle);
HSSFCell mfqkCell = dwRow.createCell(NUMBER2);
mfqkCell.setCellValue("密封情况");
mfqkCell.setCellStyle(cellCellStyle);
HSSFCell totalPriceCell = dwRow.createCell(NUMBER3);
totalPriceCell.setCellValue("投标总报价(元)");
totalPriceCell.setCellStyle(cellCellStyle);
HSSFCell gczlCell = dwRow.createCell(NUMBER4);
gczlCell.setCellValue("工程质量");
gczlCell.setCellStyle(cellCellStyle);
HSSFCell gqCell = dwRow.createCell(NUMBER5);
gqCell.setCellValue("工期(日历天)");
gqCell.setCellStyle(cellCellStyle);
HSSFCell projectManagerCell = dwRow.createCell(NUMBER6);
projectManagerCell.setCellValue("项目经理");
projectManagerCell.setCellStyle(cellCellStyle);
HSSFCell tbrConfirmCell = dwRow.createCell(NUMBER7);
tbrConfirmCell.setCellValue("投标人确认");
tbrConfirmCell.setCellStyle(cellCellStyle);
HSSFCell remarkCell = dwRow.createCell(NUMBER8);
remarkCell.setCellValue("备注");
remarkCell.setCellStyle(cellCellStyle);
// 从第四行开始
int rowIndex = NUMBER3;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER2);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellCellStyle);
mfqkCell = dvDetail.createCell(NUMBER2);
mfqkCell.setCellValue(dw.getFilemifeng());
mfqkCell.setCellStyle(cellCellStyle);
String totalPrice = "";
if (!"1".equals(biaoduan.getIstechend())) {
totalPrice = dw.getToubiaototal();
}
totalPriceCell = dvDetail.createCell(NUMBER3);
totalPriceCell.setCellValue(totalPrice);
totalPriceCell.setCellStyle(cellCellStyle);
gczlCell = dvDetail.createCell(NUMBER4);
String gczl = dw.getZlcn();
if (StringUtil.isBlank(gczl)) {
String gczlSql = "select markvalue from PingBiao_TBInfoMx where BiaoDuanGuid=? and danweiguid = ? and marktype='Zlcn'";
gczl = service.queryString(gczlSql, biaoDuanGuid, dw.getDanweiguid());
}
gczlCell.setCellValue(gczl);
gczlCell.setCellStyle(cellCellStyle);
gqCell = dvDetail.createCell(NUMBER5);
gqCell.setCellValue(dw.getGongqi());
gqCell.setCellStyle(cellCellStyle);
projectManagerCell = dvDetail.createCell(NUMBER6);
projectManagerCell.setCellValue(dw.getXiangmujl());
projectManagerCell.setCellStyle(cellCellStyle);
tbrConfirmCell = dvDetail.createCell(NUMBER7);
tbrConfirmCell.setCellValue("");
tbrConfirmCell.setCellStyle(cellCellStyle);
remarkCell = dvDetail.createCell(NUMBER8);
remarkCell.setCellValue(dw.getKaibiaoremark());
remarkCell.setCellStyle(cellCellStyle);
rowIndex++;
}
}
String sql = "SELECT TouBiaoTotal FROM PingBiao_TouBiao_DetailBaoJia WHERE BiaoDuanGuid=? AND DanWeiGuid='bd001'";
String toubiaoTotal = service.queryString(sql, biaoDuanGuid);
toubiaoTotal = StringUtil.isBlank(toubiaoTotal) ? " " : toubiaoTotal;
HSSFRow baoJiaDetail = sheet.createRow(rowIndex);
baoJiaDetail.setHeight(Short.parseShort("500"));
HSSFRow firstHXRDetail = sheet.createRow(rowIndex + 1);
firstHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow secondHXRDetail = sheet.createRow(rowIndex + NUMBER2);
secondHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow thirdHXRDetail = sheet.createRow(rowIndex + NUMBER3);
thirdHXRDetail.setHeight(Short.parseShort("500"));
HSSFRow forthDetail = sheet.createRow(rowIndex + NUMBER4);
forthDetail.setHeight(Short.parseShort("500"));
HSSFRow fifthDetail = sheet.createRow(rowIndex + NUMBER5);
fifthDetail.setHeight(Short.parseShort("500"));
HSSFRow sixthDetail = sheet.createRow(rowIndex + NUMBER6);
sixthDetail.setHeight(Short.parseShort("500"));
// 合并单元格
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER2, rowIndex + NUMBER2, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER3, rowIndex + NUMBER3, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER4, rowIndex + NUMBER4, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER5, rowIndex + NUMBER5, 0, NUMBER8));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + NUMBER6, rowIndex + NUMBER6, 0, NUMBER8));
// 填充数据
HSSFCell baoJiaCell = baoJiaDetail.createCell(0);
baoJiaCell.setCellValue("招标控制价:" + toubiaoTotal + "元,其中暂列金额(含税): 元、暂估价(含税): 元");
baoJiaCell.setCellStyle(leftCellStyle);
HSSFCell firstHXRCell = firstHXRDetail.createCell(0);
firstHXRCell.setCellValue(
"第一中标候选人: 中标价: 元,其中暂列金额(含税): 元、暂估价(含税): 元");
firstHXRCell.setCellStyle(leftCellStyle);
HSSFCell secondHXRCell = secondHXRDetail.createCell(0);
secondHXRCell.setCellValue("第二中标候选人:");
secondHXRCell.setCellStyle(leftCellStyle);
HSSFCell thirdHXRCell = thirdHXRDetail.createCell(0);
thirdHXRCell.setCellValue("第三中标候选人:");
thirdHXRCell.setCellStyle(leftCellStyle);
HSSFCell forthCell = forthDetail.createCell(0);
forthCell.setCellValue("招标人: 监督人员: 项目负责人: 特邀监督员: 公证人员:");
forthCell.setCellStyle(leftCellStyle);
if ("ZJZWZF_SG_GL".equals(pbbf) || "AQXZSZJZWZF".equals(pbbf) || "AQFJLJDZWZ".equals(pbbf) || "AQZJZWZF"
.equals(pbbf)) {
String sqlXiShu = "select * from PingBiao_YouXiaoPanD where biaoduanguid=?";
Record xiShu = service.find(sqlXiShu, Record.class, biaoDuanGuid);
String canShuC = xiShu == null ? "" : xiShu.getStr("CanShuC");
String canShuF = xiShu == null ? "" : xiShu.getStr("CanShuF");
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("C值:" + canShuC + " F值:" + canShuF);
fifthCell.setCellStyle(leftCellStyle);
HSSFCell sixthCell = sixthDetail.createCell(0);
sixthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
sixthCell.setCellStyle(leftCellStyle);
}
HSSFCell fifthCell = fifthDetail.createCell(0);
fifthCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
fifthCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER4000);
sheet.setColumnWidth(1, NUMBER8000);
sheet.setColumnWidth(NUMBER2, NUMBER4000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER6, NUMBER6000);
sheet.setColumnWidth(NUMBER7, NUMBER4000);
sheet.setColumnWidth(NUMBER8, NUMBER4000);
return workBook;
}
/**
* 将dataview的数据转成Excel
*
* @param pingbiaokaibiaoList 单位
* @param tbinfomxesList 报价
* @param biaoduan 标段
* @param tbinfomxes 投标文件明细
* @param kaiBiaoDate 开标日期
* @return workbook
*/
public static Workbook GetWorkBook_XEBF(List<PingBiaoKaiBiaoTouBiao> pingbiaokaibiaoList,
List<PingbiaoTbinfomx> tbinfomxesList, PingbiaoBiaoduan biaoduan, List<PingbiaoTbinfomx> tbinfomxes,
String kaiBiaoDate) {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("开标记录表");
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, NUMBER6));
// Title
HSSFFont font = workBook.createFont();
// 为了逃避sonar检测
font.setFontName("宋a".replace("a", "体"));
font.setBold(true);
font.setFontHeight(Short.parseShort("250"));
// 居中单元格
HSSFCellStyle cellCellStyle = workBook.createCellStyle();
cellCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
cellCellStyle.setAlignment(HorizontalAlignment_CENTER);
cellCellStyle.setFont(font);
// 水平居左单元格
HSSFCellStyle leftCellStyle = workBook.createCellStyle();
leftCellStyle.setVerticalAlignment(VerticalAlignment_CENTER);// 垂直居中
leftCellStyle.setAlignment(HorizontalAlignment_LEFT);
leftCellStyle.setFont(font);
// 标题
HSSFRow titleRow = sheet.createRow(0);
HSSFCell titleCell = titleRow.createCell(0);
titleCell.setCellValue(biaoduan.getBiaoduanname() + "开标记录表");
titleCell.setCellStyle(cellCellStyle);
titleRow.setHeight(Short.parseShort("700"));
HSSFRow rowZBR = sheet.createRow(1);
HSSFCell cellZBR = rowZBR.createCell(0);
cellZBR.setCellValue(
"招标人:" + (StringUtil.isBlank(biaoduan.getJianshedanwei()) ? "" : biaoduan.getJianshedanwei()));
cellZBR.setCellStyle(leftCellStyle);
rowZBR.setHeight(Short.parseShort("700"));
// 单位信息标题
HSSFRow dwRow = sheet.createRow(NUMBER3);
HSSFCell xhCell = dwRow.createCell(0);
xhCell.setCellValue("序号");
xhCell.setCellStyle(cellCellStyle);
dwRow.setHeight(Short.parseShort("500"));
HSSFCell tbrCell = dwRow.createCell(1);
tbrCell.setCellValue("投标单位");
tbrCell.setCellStyle(cellCellStyle);
HSSFCell mfqkCell = dwRow.createCell(NUMBER2);
mfqkCell.setCellValue("密封情况");
mfqkCell.setCellStyle(cellCellStyle);
HSSFCell totalPriceCell = dwRow.createCell(NUMBER3);
totalPriceCell.setCellValue("是否响应计价、结算方式");
totalPriceCell.setCellStyle(cellCellStyle);
HSSFCell toubiaoBZJCell = dwRow.createCell(NUMBER4);
toubiaoBZJCell.setCellValue("是否响应招标文件服务要求");
toubiaoBZJCell.setCellStyle(cellCellStyle);
HSSFCell gczlCell = dwRow.createCell(NUMBER5);
gczlCell.setCellValue("是否响应招标文件中列明的抽签方式(包括特殊项目的抽签方式)");
gczlCell.setCellStyle(cellCellStyle);
HSSFCell remarkCell = dwRow.createCell(NUMBER6);
remarkCell.setCellValue("备注");
remarkCell.setCellStyle(cellCellStyle);
// 从第四行开始
int rowIndex = NUMBER4;
if (pingbiaokaibiaoList != null && !pingbiaokaibiaoList.isEmpty()) {
for (PingBiaoKaiBiaoTouBiao dw : pingbiaokaibiaoList) {
HSSFRow dvDetail = sheet.createRow(rowIndex);
dvDetail.setHeight(Short.parseShort("500"));
xhCell = dvDetail.createCell(0);
xhCell.setCellValue(Double.valueOf(rowIndex) - NUMBER2);
xhCell.setCellStyle(cellCellStyle);
tbrCell = dvDetail.createCell(1);
tbrCell.setCellValue(dw.getDanweiname());
tbrCell.setCellStyle(cellCellStyle);
mfqkCell = dvDetail.createCell(NUMBER2);
mfqkCell.setCellValue(dw.getFilemifeng());
mfqkCell.setCellStyle(cellCellStyle);
totalPriceCell = dvDetail.createCell(NUMBER3);
totalPriceCell.setCellValue("");
totalPriceCell.setCellStyle(cellCellStyle);
toubiaoBZJCell = dvDetail.createCell(NUMBER4);
toubiaoBZJCell.setCellValue("");
toubiaoBZJCell.setCellStyle(cellCellStyle);
gczlCell = dvDetail.createCell(NUMBER5);
gczlCell.setCellValue("");
gczlCell.setCellStyle(cellCellStyle);
remarkCell = dvDetail.createCell(NUMBER9);
remarkCell.setCellValue("");
remarkCell.setCellStyle(cellCellStyle);
rowIndex++;
}
}
HSSFRow baoJiaDetail = sheet.createRow(rowIndex);
baoJiaDetail.setHeight(Short.parseShort("500"));
HSSFRow firstHXRDetail = sheet.createRow(rowIndex + 1);
firstHXRDetail.setHeight(Short.parseShort("500"));
// 合并单元格
sheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 0, NUMBER6));
sheet.addMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, NUMBER6));
// 填充数据
HSSFCell baoJiaCell = baoJiaDetail.createCell(0);
baoJiaCell.setCellValue("招标人: 监督人: 项目负责人: ");
baoJiaCell.setCellStyle(leftCellStyle);
HSSFCell firstCell = firstHXRDetail.createCell(0);
firstCell.setCellValue("本系统抓取的投标报价数字为各投标单位投标函中小写数字");
firstCell.setCellStyle(leftCellStyle);
sheet.setColumnWidth(0, NUMBER4000);
sheet.setColumnWidth(1, NUMBER8000);
sheet.setColumnWidth(NUMBER2, NUMBER6000);
sheet.setColumnWidth(NUMBER3, NUMBER6000);
sheet.setColumnWidth(NUMBER4, NUMBER6000);
sheet.setColumnWidth(NUMBER5, NUMBER6000);
sheet.setColumnWidth(NUMBER6, NUMBER6000);
return workBook;
}
}