Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangqinbin
2022-06-15 16:41:26 +08:00
6 changed files with 16 additions and 20 deletions

View File

@ -25,9 +25,9 @@ import java.util.Map;
/** /**
* 评标委员会签字表 * 评审专家签到
*/ */
@Service("judgesSign") @Service("judgesSignIn")
@Slf4j @Slf4j
public class JudgesSignImpl implements ExportService { public class JudgesSignImpl implements ExportService {
@ -47,13 +47,13 @@ public class JudgesSignImpl implements ExportService {
*/ */
@Override @Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) { public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("标委员会签字表ExportParam = {}", JsonUtils.objectToJson(param)); log.info("审专家签到ExportParam = {}", JsonUtils.objectToJson(param));
//项目和招标名称数据 //项目和招标名称数据
ProjectSectionVO section = commonFeignService.projectGetSectionById(param.getSectionId()); ProjectSectionVO section = commonFeignService.projectGetSectionById(param.getSectionId());
log.info("标委员会签字表 {},查询项目信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(section)); log.info("审专家签到 {},查询项目信息 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(section));
//专家人员数据 //专家人员数据
List<JuryPrintVO> list = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId()); List<JuryPrintVO> list = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId());
log.info("标委员会签字表 {},查询专家人员数据 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(list)); log.info("审专家签到 {},查询专家人员数据 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(list));
ArrayList<Map<String, Object>> maps = new ArrayList<>(); ArrayList<Map<String, Object>> maps = new ArrayList<>();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
@ -80,7 +80,7 @@ public class JudgesSignImpl implements ExportService {
XWPFTemplate template = XWPFTemplate.compile(file, config).render(all); XWPFTemplate template = XWPFTemplate.compile(file, config).render(all);
//导出的表格名称 //导出的表格名称
String dictName = commonFeignService.exportDictName(param.getId(), "标委员会签字") + ".docx"; String dictName = commonFeignService.exportDictName(param.getId(), "审专家签到") + ".docx";
String fileName = new String(dictName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1); String fileName = new String(dictName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
this.write(template, fileName, response); this.write(template, fileName, response);

View File

@ -23,9 +23,9 @@ import java.util.*;
/** /**
* 评审专家签到表 * 评审承诺书确认记录
*/ */
@Service("judgesSignIn") @Service("judgesSign")
@Slf4j @Slf4j
public class JudgesSignInImpl implements ExportService { public class JudgesSignInImpl implements ExportService {
@Autowired @Autowired
@ -43,10 +43,10 @@ public class JudgesSignInImpl implements ExportService {
@SneakyThrows @SneakyThrows
@Override @Override
public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) { public void doExport(ExportParam param, HttpServletRequest request, HttpServletResponse response) {
log.info("评审专家签到表ExportParam = {}", JsonUtils.objectToJson(param)); log.info("评审承诺书确认记录ExportParam = {}", JsonUtils.objectToJson(param));
//专家人员数据 //专家人员数据
List<JuryPrintVO> list = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId()); List<JuryPrintVO> list = commonFeignService.rsmsQueryReportPrintByRoomId(param.getAssessRoomId());
log.info("标委员会签字表 {},查询专家人员数据 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(list)); log.info("审承诺书确认记录 {},查询专家人员数据 = {}", param.getAssessRoomId(), JsonUtils.objectToJson(list));
ArrayList<Map<String, Object>> maps = new ArrayList<>(); ArrayList<Map<String, Object>> maps = new ArrayList<>();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
@ -69,7 +69,7 @@ public class JudgesSignInImpl implements ExportService {
Configure config = Configure.builder().bind("table", policy).build(); Configure config = Configure.builder().bind("table", policy).build();
XWPFTemplate template = XWPFTemplate.compile(file, config).render(all); XWPFTemplate template = XWPFTemplate.compile(file, config).render(all);
//导出的表格名称 //导出的表格名称
String dictName = commonFeignService.exportDictName(param.getId(), "评审专家签到") + ".docx"; String dictName = commonFeignService.exportDictName(param.getId(), "评审承诺书确认记录") + ".docx";
String fileName = new String(dictName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1); String fileName = new String(dictName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
this.write(template, fileName, response); this.write(template, fileName, response);

View File

@ -124,20 +124,16 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService {
} }
File f = new File(path + "merged.pdf"); File f = new File(path + "merged.pdf");
FileOutputStream fos = null;
try {
FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true); FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true);
fos = new FileOutputStream(f); try (FileOutputStream fos = new FileOutputStream(f);) {
com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx"); com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx");
doc.save(fos, SaveFormat.PDF); doc.save(fos, SaveFormat.PDF);
fos.flush();
} catch (Exception e) { } catch (Exception e) {
log.info(ExceptionUtil.stacktraceToString(e)); log.info(ExceptionUtil.stacktraceToString(e));
} finally { } finally {
IOUtils.closeQuietly(source); source.close();
IOUtils.closeQuietly(addObj); addObj.close();
IOUtils.closeQuietly(fos);
} }
long l1 = System.currentTimeMillis(); long l1 = System.currentTimeMillis();