修改表报打印bug

This commit is contained in:
付庆吉
2021-06-21 09:29:44 +08:00
parent d2dd2ae97e
commit e7ca7a8096
8 changed files with 65 additions and 37 deletions

View File

@ -29,6 +29,7 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -71,7 +72,7 @@ public class BidOpenRecordImpl implements ExportService {
OpenRecordExportData data = new OpenRecordExportData();
data.setProjName(proj.getProjectName())
.setProjNum(proj.getProjectBizNum())
.setProjNum(Optional.ofNullable(proj.getAgencyCompanyProjectNum()).orElse(proj.getEbpProjectNumber()))
.setBidNum(section.getBidSectBizNum());
ExportTableData tableData = new ExportTableData();

View File

@ -4,6 +4,7 @@ import com.chinaunicom.mall.ebtp.common.poiExport.constant.ExportConstant;
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTable;
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTd;
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTr;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.extend.export.bean.CbpsExportData;
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParam;
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
@ -15,6 +16,7 @@ import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.BidEvalEarlyJudgesSumm
import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.ReviewConfigCategoryDTO;
import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.ReviewConfigDetailDTO;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -23,6 +25,7 @@ import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
@ -31,6 +34,7 @@ import java.util.Map;
* @author fqj
*/
@Service("cbps")
@Slf4j
public class CbpsExportServiceImpl implements ExportService {
@Autowired
@ -47,21 +51,22 @@ public class CbpsExportServiceImpl implements ExportService {
@SneakyThrows
@Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("初步评审表ExportParam = {}", JsonUtils.objectToJson(param));
//导出的表格名称
String dictName = commonFeignService.exportDictName(param.getId(), "初步评审表");
//查询包
ProjectSectionVO section = commonFeignService.projectGetSectionById(param.getSectionId());
log.info("初步评审表 {},查询包信息 {}", param.getAssessRoomId(), JsonUtils.objectToJson(section));
//查询项目
ProjectRecordVO proj = commonFeignService.projectGetProjById(section.getProjectId());
log.info("初步评审表 {},查询项目信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(proj));
//供应商信息
List<BizSupplierRegister> suppliers = commonFeignService.tenderGetSupplierRegisterByRoomId(param.getAssessRoomId());
log.info("初步评审表 {},查询供应商信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(suppliers));
//初审评分信息
List<ReviewConfigCategoryDTO> earlySummary = commonFeignService.rsmsFindScoreEarlySummary(param);
log.info("初步评审表 {},查询评分信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(earlySummary));
ExcelTable table = new ExcelTable(dictName);
table.setFileName(dictName);
@ -74,7 +79,7 @@ public class CbpsExportServiceImpl implements ExportService {
table.add(new ExcelTr().setExcelTdList(list));
list = new ArrayList<>();
list.add(new ExcelTd().setTdValue("招标编号:" + proj.getProjectBizNum()).setCellStyleKey("noBorderLeft12").setIsRowMerge(true).setRowMergeNum(suppliers.size() + 3));
list.add(new ExcelTd().setTdValue("招标编号:" + Optional.ofNullable(proj.getAgencyCompanyProjectNum()).orElse(proj.getEbpProjectNumber())).setCellStyleKey("noBorderLeft12").setIsRowMerge(true).setRowMergeNum(suppliers.size() + 3));
table.add(new ExcelTr().setExcelTdList(list));
list = new ArrayList<>();

View File

@ -1,5 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.export.service.impl;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParam;
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
import com.chinaunicom.mall.ebtp.extend.export.service.common.ExportCommonFeignService;
@ -10,6 +11,7 @@ import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.BidEvalDetailJudgesSum
import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.BidEvalDetailSummaryVO;
import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.JuryPrintVO;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.streaming.SXSSFCell;
@ -24,16 +26,14 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 打分汇总
*/
@Service("dfhz")
@Slf4j
public class DfhzExportServiceImpl implements ExportService {
@ -50,24 +50,25 @@ public class DfhzExportServiceImpl implements ExportService {
@SneakyThrows
@Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("打分汇总表ExportParam = {}", JsonUtils.objectToJson(param));
//导出的表格名称
String dictName = commonFeignService.exportDictName(param.getId(), "打分汇总表");
//查询包
ProjectSectionVO section = commonFeignService.projectGetSectionById(param.getSectionId());
log.info("打分汇总表 {},查询包信息 {}", param.getAssessRoomId(), JsonUtils.objectToJson(section));
//查询项目
ProjectRecordVO proj = commonFeignService.projectGetProjById(section.getProjectId());
log.info("打分汇总表 {},查询项目信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(proj));
//供应商信息
List<BizSupplierRegister> suppliers = commonFeignService.tenderGetSupplierRegisterByRoomId(param.getAssessRoomId());
log.info("打分汇总表 {},查询供应商信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(suppliers));
//评委
List<JuryPrintVO> memberAll = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId());
log.info("打分汇总表 {},查询评委信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(memberAll));
//所有类型打分数据源
Map<String, List<BidEvalDetailSummaryVO>> detailList = commonFeignService.exportScoreSummary(param);
log.info("打分汇总表 {},查询所有类型打分数据源 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(detailList));
// 创建工作簿
SXSSFWorkbook wb = new SXSSFWorkbook();
//表格样式
@ -110,7 +111,7 @@ public class DfhzExportServiceImpl implements ExportService {
SXSSFCell projectNumCell0 = projectNumRow.createCell(0);
projectNumCell0.setCellValue("项目编号:");
SXSSFCell projectNumCell1 = projectNumRow.createCell(1);
projectNumCell1.setCellValue(proj.getProjectBizNum());
projectNumCell1.setCellValue(Optional.ofNullable(proj.getAgencyCompanyProjectNum()).orElse(proj.getEbpProjectNumber()));
//列头
List<String> titles0 = new ArrayList<>();
titles0.add("投标人名称");
@ -170,10 +171,10 @@ public class DfhzExportServiceImpl implements ExportService {
this.createCell(row, cellIndex, cellStyle, "-");
} else {
BidEvalDetailSummaryVO detailSummary = detailScore.stream().filter(f -> f.getSupplierRegisterId().equals(vo.getCompanyName())).findFirst().orElseGet(BidEvalDetailSummaryVO::new);
BidEvalDetailSummaryVO detailSummary = detailScore.stream().filter(f -> f.getSupplierRegisterId().equals(vo.getId())).findFirst().orElseGet(BidEvalDetailSummaryVO::new);
Map<String, BidEvalDetailJudgesSummaryVO> memberScoreMap = detailSummary.getScoreMap();
for (JuryPrintVO memberVO : memberAll) {
if (memberScoreMap !=null && memberScoreMap.containsKey(memberVO.getUserId())) {
if (memberScoreMap != null && memberScoreMap.containsKey(memberVO.getUserId())) {
BigDecimal score = memberScoreMap.get(memberVO.getUserId()).getScore();
this.createCell(row, cellIndex++, cellStyle, score == null ? "" : String.valueOf(score));
} else {
@ -269,8 +270,8 @@ public class DfhzExportServiceImpl implements ExportService {
row = this.createRow(sheet, rowIndex);
c = row.createCell(titles0.size() - 3);
c.setCellValue("日期:");
c = row.createCell(titles0.size() - 2);
c.setCellValue(new SimpleDateFormat("yyyy年MM月dd日").format(new Date()));
// c = row.createCell(titles0.size() - 2);
// c.setCellValue(new SimpleDateFormat("yyyy年MM月dd日").format(new Date()));
//合并表头
CellRangeAddress region = new CellRangeAddress(0, 0, 0, titles0.size() - 1);

View File

@ -4,6 +4,7 @@ import com.chinaunicom.mall.ebtp.common.poiExport.constant.ExportConstant;
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTable;
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTd;
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTr;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParam;
import com.chinaunicom.mall.ebtp.extend.export.bean.JgdfExportData;
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
@ -14,16 +15,14 @@ import com.chinaunicom.mall.ebtp.extend.feign.entity.ProjectSectionVO;
import com.chinaunicom.mall.ebtp.extend.feign.entity.TfileContentData;
import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.SupplierRegisterPriceScoreVO;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -32,6 +31,7 @@ import java.util.stream.Collectors;
* 价格打分
*/
@Service("jgdf")
@Slf4j
public class JgdfExportServiceImpl implements ExportService {
@ -49,24 +49,27 @@ public class JgdfExportServiceImpl implements ExportService {
@SneakyThrows
@Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("价格打分表ExportParam = {}", JsonUtils.objectToJson(param));
//导出的表格名称
String dictName = commonFeignService.exportDictName(param.getId(), "价格打分表");
//查询包
ProjectSectionVO section = commonFeignService.projectGetSectionById(param.getSectionId());
log.info("价格打分表 {},查询包信息 {}", param.getAssessRoomId(), JsonUtils.objectToJson(section));
//查询项目
ProjectRecordVO proj = commonFeignService.projectGetProjById(section.getProjectId());
log.info("价格打分表 {},查询项目信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(proj));
//供应商信息
List<BizSupplierRegister> suppliers = commonFeignService.tenderGetSupplierRegisterByRoomId(param.getAssessRoomId());
log.info("价格打分表 {},查询供应商信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(suppliers));
//查询报价信息
List<TfileContentData> prices = commonFeignService.respsGetQuoteByRoomIdAndTurnSort(param);
log.info("价格打分表 {},查询报价信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(prices));
Map<String, TfileContentData> priceMap = prices.stream().collect(Collectors.toMap(TfileContentData::getTendererId, Function.identity(), (o1, o2) -> o1));
//报价评分
List<SupplierRegisterPriceScoreVO> priceScores = commonFeignService.exportPrice(param);
log.info("价格打分表 {},查询报价评分 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(priceScores));
Map<String, SupplierRegisterPriceScoreVO> priceScoreMap = priceScores.stream().collect(Collectors.toMap(SupplierRegisterPriceScoreVO::getSupplierRegisterId, Function.identity(), (o1, o2) -> o1));
ExcelTable table = new ExcelTable(dictName);
@ -81,7 +84,7 @@ public class JgdfExportServiceImpl implements ExportService {
table.add(new ExcelTr().setExcelTdList(list));
list = new ArrayList<>();
list.add(new ExcelTd().setTdValue("招标编号:" + proj.getProjectBizNum()).setCellStyleKey("noBorderLeft12").setIsRowMerge(true).setRowMergeNum(7));
list.add(new ExcelTd().setTdValue("招标编号:" + Optional.ofNullable(proj.getAgencyCompanyProjectNum()).orElse(proj.getEbpProjectNumber())).setCellStyleKey("noBorderLeft12").setIsRowMerge(true).setRowMergeNum(7));
table.add(new ExcelTr().setExcelTdList(list));
list = new ArrayList<>();

View File

@ -1,5 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.export.service.impl;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParam;
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
import com.chinaunicom.mall.ebtp.extend.export.service.common.ExportCommonFeignService;
@ -9,6 +10,7 @@ import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.JuryPrintVO;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -26,6 +28,7 @@ import java.util.Map;
* 评标委员会签字表
*/
@Service("judgesSign")
@Slf4j
public class JudgesSignImpl implements ExportService {
@Autowired
@ -44,11 +47,13 @@ public class JudgesSignImpl implements ExportService {
*/
@Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("评标委员会签字表ExportParam = {}", JsonUtils.objectToJson(param));
//项目和招标名称数据
ProjectSectionVO section = commonFeignService.projectGetSectionById(param.getSectionId());
log.info("评标委员会签字表 {},查询项目信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(section));
//专家人员数据
List<JuryPrintVO> list = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId());
log.info("评标委员会签字表 {},查询专家人员数据 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(list));
ArrayList<Map<String, Object>> maps = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {

View File

@ -1,5 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.export.service.impl;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParam;
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
import com.chinaunicom.mall.ebtp.extend.export.service.common.ExportCommonFeignService;
@ -9,6 +10,7 @@ import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,6 +26,7 @@ import java.util.*;
* 评审专家签到表
*/
@Service("judgesSignIn")
@Slf4j
public class JudgesSignInImpl implements ExportService {
@Autowired
private TemplateFileService templateFileService;
@ -40,9 +43,10 @@ public class JudgesSignInImpl implements ExportService {
@SneakyThrows
@Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("评审专家签到表ExportParam = {}", JsonUtils.objectToJson(param));
//专家人员数据
List<JuryPrintVO> list = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId());
log.info("评标委员会签字表 {},查询专家人员数据 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(list));
ArrayList<Map<String, Object>> maps = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
Map<String, Object> data = new HashMap<>();

View File

@ -1,6 +1,7 @@
package com.chinaunicom.mall.ebtp.extend.export.service.impl;
import cn.hutool.core.util.StrUtil;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParam;
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
import com.chinaunicom.mall.ebtp.extend.export.service.common.ExportCommonFeignService;
@ -13,6 +14,7 @@ import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -33,6 +35,7 @@ import java.util.stream.Collectors;
* 评审报告
*/
@Service("reviewReport")
@Slf4j
public class ReviewReportImpl implements ExportService {
@Autowired
@ -52,10 +55,10 @@ public class ReviewReportImpl implements ExportService {
@SneakyThrows
@Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("评审报告ExportParam = {}", JsonUtils.objectToJson(param));
// 项目信息
ProjectRecordVO project = commonFeignService.projectGetProjById(param.getProjectId());
log.info("评审报告 {},查询项目信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(project));
String zbfs = "";
switch (project.getBidMethodDict()) {
@ -86,7 +89,7 @@ public class ReviewReportImpl implements ExportService {
//供应商信息
List<BizSupplierRegister> registerList = commonFeignService.tenderGetSupplierRegisterByRoomId(param.getAssessRoomId());
log.info("初步评审表 {},查询供应商信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(registerList));
//表一
List<Map<String, Object>> list1 = new ArrayList<>();
for (int i = 0; i < registerList.size(); i++) {
@ -101,6 +104,7 @@ public class ReviewReportImpl implements ExportService {
//表二 专家人员数据
List<JuryPrintVO> memberList = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId());
log.info("评审报告 {},查询专家人员信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(memberList));
ArrayList<Map<String, Object>> list2 = new ArrayList<>();
String pbwyhzz = null;
for (int i = 0; i < memberList.size(); i++) {
@ -132,6 +136,7 @@ public class ReviewReportImpl implements ExportService {
//评审结果表数据
List<ResultDetailVO> resultDetails = commonFeignService.rsmsQueryReviewDetailByRoomId(param.getAssessRoomId());
log.info("评审报告 {},查询评审结果表数据 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(resultDetails));
Map<String, ResultDetailVO> detailVOMap = resultDetails.stream().collect(Collectors.toMap(ResultDetailVO::getCompanyId, Function.identity(), (o1, o2) -> o1));
for (int i = 0; i < registerList.size(); i++) {
BizSupplierRegister register = registerList.get(i);

View File

@ -1,5 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.export.service.impl;
import com.chinaunicom.mall.ebtp.common.util.JsonUtils;
import com.chinaunicom.mall.ebtp.extend.export.bean.ExportParam;
import com.chinaunicom.mall.ebtp.extend.export.service.ExportService;
import com.chinaunicom.mall.ebtp.extend.export.service.common.ExportCommonFeignService;
@ -10,6 +11,7 @@ import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.JuryPrintVO;
import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.ReviewConfigCategoryDTO;
import com.chinaunicom.mall.ebtp.extend.feign.entity.rsms.ReviewConfigDetailDTO;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
@ -33,6 +35,7 @@ import java.util.stream.Collectors;
* 专家个人打分表/评委打分表
*/
@Service("zjgr")
@Slf4j
public class ZjgrExportServiceImpl implements ExportService {
@Autowired
@ -48,20 +51,21 @@ public class ZjgrExportServiceImpl implements ExportService {
@SneakyThrows
@Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("专家个人打分表ExportParam = {}", JsonUtils.objectToJson(param));
//查询项目名称
ProjectSectionVO section = commonFeignService.projectGetSectionById(param.getSectionId());
log.info("专家个人打分表 {},查询项目信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(section));
//供应商信息
List<BizSupplierRegister> suppliers = commonFeignService.tenderGetSupplierRegisterByRoomId(param.getAssessRoomId());
log.info("专家个人打分表 {},查询供应商信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(suppliers));
//评委
List<JuryPrintVO> members = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId());
log.info("专家个人打分表 {},查询评委信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(members));
param.setUserList(members.stream().map(JuryPrintVO::getUserId).collect(Collectors.toList()));
//打分数据
Map<String, List<ReviewConfigCategoryDTO>> map = commonFeignService.exportDetail(param);
log.info("专家个人打分表 {},查询打分数据 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(map));
//列头
StringBuilder titles0 = new StringBuilder("分类,类别名称,标准说明,分值");