Compare commits

..

No commits in common. '3bf76dd12ea91b157a490412556dad2461d60ae0' and '6cebdaaac425ff6d99ffe06515142575f43dfc7d' have entirely different histories.

  1. 6
      jnpf-tendering-biz/src/main/java/jnpf/service/impl/BiddingProjectSubscribeServiceImpl.java
  2. 56
      jnpf-tendering-biz/src/main/java/jnpf/service/impl/ExpertServiceImpl.java
  3. 58
      jnpf-tendering-biz/src/main/java/jnpf/service/impl/LotteryProjectServiceImpl.java
  4. 1
      jnpf-tendering-entity/src/main/java/jnpf/model/dto/LotteryProjectDto.java
  5. BIN
      jnpf-tendering-server/src/main/resources/jnpf/templete/招投标公司打印.docx
  6. BIN
      jnpf-tendering-server/src/main/resources/jnpf/templete/浙江出版传媒股份有限公司ERP系统建设项目.docx

6
jnpf-tendering-biz/src/main/java/jnpf/service/impl/BiddingProjectSubscribeServiceImpl.java

@ -1535,12 +1535,6 @@ public class BiddingProjectSubscribeServiceImpl extends ServiceImpl<BiddingProje
.createUserId(userInfo.getUserId()) .createUserId(userInfo.getUserId())
.build(); .build();
iBiddingProjectSubscribeStepService.saveOrUpdate(step); iBiddingProjectSubscribeStepService.saveOrUpdate(step);
//抽签项目完成抽签
iLotteryProjectService.lambdaUpdate()
.set(LotteryProject::getStatus, LotteryProjectDto.StatusEnum.ARCHIVIST.getCode())
.eq(LotteryProject::getStatus, LotteryProjectDto.StatusEnum.TO_BE_EXTRACTED.getCode())
.eq(LotteryProject::getRelationId, param.getId())
.update();
} }
@Override @Override

56
jnpf-tendering-biz/src/main/java/jnpf/service/impl/ExpertServiceImpl.java

@ -189,33 +189,33 @@ public class ExpertServiceImpl extends ServiceImpl<ExpertMapper, Expert> impleme
if (StrUtil.isBlank(param.getExpertName())) { if (StrUtil.isBlank(param.getExpertName())) {
throw new DataException("专家名称不能为空"); throw new DataException("专家名称不能为空");
} }
// if (StrUtil.isBlank(param.getExpertGroup())) { if (StrUtil.isBlank(param.getExpertGroup())) {
// throw new DataException("专家组别不能为空"); throw new DataException("专家组别不能为空");
// } }
// if (StrUtil.isBlank(param.getSex())) { if (StrUtil.isBlank(param.getSex())) {
// throw new DataException("专家性别不能为空"); throw new DataException("专家性别不能为空");
// } }
// if (StrUtil.isBlank(param.getPhoneNumber())) { if (StrUtil.isBlank(param.getPhoneNumber())) {
// throw new DataException("专家电话不能为空"); throw new DataException("专家电话不能为空");
// } }
// if (StrUtil.isBlank(param.getExpertSources())) { if (StrUtil.isBlank(param.getExpertSources())) {
// throw new DataException("专家来源不能为空"); throw new DataException("专家来源不能为空");
// } }
// if (StrUtil.isBlank(param.getWorkUnit())) { if (StrUtil.isBlank(param.getWorkUnit())) {
// throw new DataException("工作单位不能为空"); throw new DataException("工作单位不能为空");
// } }
// if (StrUtil.isBlank(param.getPost())) { if (StrUtil.isBlank(param.getPost())) {
// throw new DataException("职务不能为空"); throw new DataException("职务不能为空");
// } }
// if (StrUtil.isBlank(param.getTechnicalPosition())) { if (StrUtil.isBlank(param.getTechnicalPosition())) {
// throw new DataException("专业技术职称不能为空"); throw new DataException("专业技术职称不能为空");
// } }
// if (StrUtil.isBlank(param.getProfessionalExpertise())) { if (StrUtil.isBlank(param.getProfessionalExpertise())) {
// throw new DataException("专业特长不能为空"); throw new DataException("专业特长不能为空");
// } }
// if (StrUtil.isBlank(param.getStatus())) { if (StrUtil.isBlank(param.getStatus())) {
// throw new DataException("专家状态不能为空"); throw new DataException("专家状态不能为空");
// } }
break; break;
case "2": case "2":
if (CollectionUtil.isEmpty(param.getContactInformation())) { if (CollectionUtil.isEmpty(param.getContactInformation())) {
@ -312,7 +312,7 @@ public class ExpertServiceImpl extends ServiceImpl<ExpertMapper, Expert> impleme
if (StrUtil.isNotBlank(row.getCell(10).getStringCellValue())){ if (StrUtil.isNotBlank(row.getCell(10).getStringCellValue())){
addParam.setWorkingYears(row.getCell(10).getStringCellValue()); addParam.setWorkingYears(row.getCell(10).getStringCellValue());
} }
addParam.setStatus("0"); addParam.setStatus("1");
addParamList.add(addParam); addParamList.add(addParam);
} }
for (ExpertDto.AddParam addParam : addParamList) { for (ExpertDto.AddParam addParam : addParamList) {

58
jnpf-tendering-biz/src/main/java/jnpf/service/impl/LotteryProjectServiceImpl.java

@ -81,9 +81,7 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
lotteryProject.setType(LotteryProjectDto.TypeEnum.ONESELF.getCode()); lotteryProject.setType(LotteryProjectDto.TypeEnum.ONESELF.getCode());
lotteryProject.setStatus(LotteryProjectDto.StatusEnum.TO_BE_EXTRACTED.getCode()); lotteryProject.setStatus(LotteryProjectDto.StatusEnum.TO_BE_EXTRACTED.getCode());
lotteryProject.setStatusName(LotteryProjectDto.StatusEnum.TO_BE_EXTRACTED.getDescribe()); lotteryProject.setStatusName(LotteryProjectDto.StatusEnum.TO_BE_EXTRACTED.getDescribe());
if (null != param.getBidEvaluationTime()) {
lotteryProject.setBidOpeningTime(LocalDate.parse(LocalDateTimeUtil.format(param.getBidEvaluationTime(), "yyyy-MM-dd"))); lotteryProject.setBidOpeningTime(LocalDate.parse(LocalDateTimeUtil.format(param.getBidEvaluationTime(), "yyyy-MM-dd")));
}
UserInfo userInfo = userProvider.get(); UserInfo userInfo = userProvider.get();
lotteryProject.setUserDeptId(userInfo.getOrganizeId()); lotteryProject.setUserDeptId(userInfo.getOrganizeId());
//添加根子单数据 //添加根子单数据
@ -104,9 +102,7 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
throw new DataException("id不能为空"); throw new DataException("id不能为空");
} }
LotteryProject lotteryProject = BeanUtil.copyProperties(param, LotteryProject.class); LotteryProject lotteryProject = BeanUtil.copyProperties(param, LotteryProject.class);
if (null != param.getBidEvaluationTime()) {
lotteryProject.setBidOpeningTime(LocalDate.parse(LocalDateTimeUtil.format(param.getBidEvaluationTime(), "yyyy-MM-dd"))); lotteryProject.setBidOpeningTime(LocalDate.parse(LocalDateTimeUtil.format(param.getBidEvaluationTime(), "yyyy-MM-dd")));
}
UserInfo userInfo = userProvider.get(); UserInfo userInfo = userProvider.get();
; ;
lotteryProject.setUpdateId(userInfo.getUserId()); lotteryProject.setUpdateId(userInfo.getUserId());
@ -347,7 +343,7 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
throw new DataException("暂未有确认专家,无法打印"); throw new DataException("暂未有确认专家,无法打印");
} }
try { try {
MockMultipartFile mockMultipartFile = expertPrinting("专家抽取结果打印.docx", extractExpertsInfo, lotteryProject.getProjectName()); MockMultipartFile mockMultipartFile = expertPrinting("专家抽取结果打印.docx", extractExpertsInfo);
String temporaryFilePath = fileApi.getPath(FileTypeConstant.TEMPORARY); String temporaryFilePath = fileApi.getPath(FileTypeConstant.TEMPORARY);
FileInfo fileInfo = fileUploadApi.uploadFile(mockMultipartFile, temporaryFilePath, "专家抽取结果打印.docx"); FileInfo fileInfo = fileUploadApi.uploadFile(mockMultipartFile, temporaryFilePath, "专家抽取结果打印.docx");
vo.setName(fileInfo.getFilename()); vo.setName(fileInfo.getFilename());
@ -361,13 +357,13 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
if (CollectionUtil.isEmpty(extractExpertsInfo)){ if (CollectionUtil.isEmpty(extractExpertsInfo)){
throw new DataException("暂未有确认公司,无法打印"); throw new DataException("暂未有确认公司,无法打印");
} }
MockMultipartFile mockMultipartFile = companyPrinting("招投标公司抽取结果打印.docx", extractExpertsInfo,lotteryProject.getProjectName()); MockMultipartFile mockMultipartFile = companyPrinting("招投标公司抽取结果打印.docx", extractExpertsInfo);
String temporaryFilePath = fileApi.getPath(FileTypeConstant.TEMPORARY); String temporaryFilePath = fileApi.getPath(FileTypeConstant.TEMPORARY);
FileInfo fileInfo = fileUploadApi.uploadFile(mockMultipartFile, temporaryFilePath, "招投标公司抽取结果打印.docx"); FileInfo fileInfo = fileUploadApi.uploadFile(mockMultipartFile, temporaryFilePath, "招投标公司抽取结果打印.docx");
vo.setName(fileInfo.getFilename()); vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + "招投标公司抽取结果打印.docx"); vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + "招投标公司抽取结果打印.docx");
} catch (Exception e) { } catch (Exception e) {
log.error("公司抽取结果打印异常", e); log.error("专家抽取结果打印异常", e);
} }
break; break;
} }
@ -376,42 +372,27 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
return vo; return vo;
} }
private MockMultipartFile expertPrinting(String fileName, List<LotteryProjectDto.ExtractExpertsInfo> data, String projectName) throws Exception { private MockMultipartFile expertPrinting(String fileName, List<LotteryProjectDto.ExtractExpertsInfo> data) throws Exception {
try (InputStream inputStream = ResourceUtil.getStream("jnpf/templete/浙江出版传媒股份有限公司ERP系统建设项目.docx"); try (InputStream inputStream = ResourceUtil.getStream("jnpf/templete/浙江出版传媒股份有限公司ERP系统建设项目.docx");
XWPFDocument doc = new XWPFDocument(inputStream)) { XWPFDocument doc = new XWPFDocument(inputStream)) {
// 找到标记位置的段落 // 找到标记位置的段落
XWPFParagraph placeholderParagraph = null; XWPFParagraph placeholderParagraph = null;
XWPFParagraph textParagraph = null;
for (XWPFParagraph paragraph : doc.getParagraphs()) { for (XWPFParagraph paragraph : doc.getParagraphs()) {
if (paragraph.getText().contains("{{table_here}}")) { if (paragraph.getText().contains("{{table_here}}")) {
placeholderParagraph = paragraph; placeholderParagraph = paragraph;
break; break;
} }
if (paragraph.getText().contains("{{projectName}}")) {
textParagraph = paragraph;
}
} }
if (placeholderParagraph == null) { if (placeholderParagraph == null) {
throw new IllegalStateException("Cannot find placeholder in the document."); throw new IllegalStateException("Cannot find placeholder in the document.");
} }
// 删除包含占位符的段落 // 删除包含占位符的段落
XWPFRun run = placeholderParagraph.getRuns().get(0); XWPFRun run = placeholderParagraph.getRuns().get(0);
run.setText(run.getText(0).replace("{{table_here}}", ""), 0); run.setText(run.getText(0).replace("{{table_here}}", ""), 0);
//替换项目名称
if (textParagraph != null) {
String join = StrUtil.join("", textParagraph.getRuns().stream().map(te -> te.getText(0)).collect(Collectors.toList()));
XWPFRun xwpfRun = textParagraph.getRuns().get(0);
for (XWPFRun textParagraphRun : textParagraph.getRuns()) {
textParagraphRun.setText("");
}
xwpfRun.setText(join.replace("{{projectName}}",projectName), 0);
}
// 在占位符位置插入表格 // 在占位符位置插入表格
// 插入表格到占位符位置后 // 插入表格到占位符位置后
@ -482,22 +463,18 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
} }
} }
private MockMultipartFile companyPrinting(String fileName, List<LotteryProjectDto.ExtractExpertsInfo> data, String projectName) throws Exception { private MockMultipartFile companyPrinting(String fileName, List<LotteryProjectDto.ExtractExpertsInfo> data) throws Exception {
try (InputStream inputStream = ResourceUtil.getStream("jnpf/templete/招投标公司打印.docx"); try (InputStream inputStream = ResourceUtil.getStream("jnpf/templete/招投标公司打印.docx");
XWPFDocument doc = new XWPFDocument(inputStream)) { XWPFDocument doc = new XWPFDocument(inputStream)) {
// 找到标记位置的段落 // 找到标记位置的段落
XWPFParagraph placeholderParagraph = null; XWPFParagraph placeholderParagraph = null;
XWPFParagraph textParagraph = null;
for (XWPFParagraph paragraph : doc.getParagraphs()) { for (XWPFParagraph paragraph : doc.getParagraphs()) {
if (paragraph.getText().contains("{{table_here}}")) { if (paragraph.getText().contains("{{table_here}}")) {
placeholderParagraph = paragraph; placeholderParagraph = paragraph;
break; break;
} }
if (paragraph.getText().contains("{{projectName}}")) {
textParagraph = paragraph;
}
} }
if (placeholderParagraph == null) { if (placeholderParagraph == null) {
@ -508,16 +485,6 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
XWPFRun run = placeholderParagraph.getRuns().get(0); XWPFRun run = placeholderParagraph.getRuns().get(0);
run.setText(run.getText(0).replace("{{table_here}}", ""), 0); run.setText(run.getText(0).replace("{{table_here}}", ""), 0);
//替换项目名称
if (textParagraph != null) {
String join = StrUtil.join("", textParagraph.getRuns().stream().map(te -> te.getText(0)).collect(Collectors.toList()));
XWPFRun xwpfRun = textParagraph.getRuns().get(0);
for (XWPFRun textParagraphRun : textParagraph.getRuns()) {
textParagraphRun.setText("");
}
xwpfRun.setText(join.replace("{{projectName}}",projectName), 0);
}
// 在占位符位置插入表格 // 在占位符位置插入表格
// 插入表格到占位符位置后 // 插入表格到占位符位置后
// XWPFTable table = doc.createTable(); // XWPFTable table = doc.createTable();
@ -703,20 +670,16 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
"]"; "]";
// List<LotteryProjectDto.ExtractExpertsInfo> data = JSON.parseArray(s, LotteryProjectDto.ExtractExpertsInfo.class); // List<LotteryProjectDto.ExtractExpertsInfo> data = JSON.parseArray(s, LotteryProjectDto.ExtractExpertsInfo.class);
List<LotteryProjectDto.ExtractExpertsInfo> data = JSON.parseArray(s2, LotteryProjectDto.ExtractExpertsInfo.class); List<LotteryProjectDto.ExtractExpertsInfo> data = JSON.parseArray(s2, LotteryProjectDto.ExtractExpertsInfo.class);
try (InputStream inputStream = new FileInputStream(new File("/Users/yangzhenli/code/jnpfsoft-jnpf-jnpf-java-cloud-/jnpf-tendering/jnpf-tendering-server/src/main/resources/jnpf/templete/浙江出版传媒股份有限公司ERP系统建设项目.docx")); try (InputStream inputStream = new FileInputStream(new File("/Users/yangzhenli/Documents/项目/jnpf/浙江出版传媒股份有限公司ERP系统建设项目.docx"));
XWPFDocument doc = new XWPFDocument(inputStream)) { XWPFDocument doc = new XWPFDocument(inputStream)) {
// 找到标记位置的段落 // 找到标记位置的段落
XWPFParagraph placeholderParagraph = null; XWPFParagraph placeholderParagraph = null;
XWPFParagraph textParagraph = null;
for (XWPFParagraph paragraph : doc.getParagraphs()) { for (XWPFParagraph paragraph : doc.getParagraphs()) {
if (paragraph.getText().contains("{{table_here}}")) { if (paragraph.getText().contains("{{table_here}}")) {
placeholderParagraph = paragraph; placeholderParagraph = paragraph;
break; break;
} }
if (paragraph.getText().contains("{{projectName}}")) {
textParagraph = paragraph;
}
} }
if (placeholderParagraph == null) { if (placeholderParagraph == null) {
@ -726,15 +689,6 @@ public class LotteryProjectServiceImpl extends ServiceImpl<LotteryProjectMapper,
// 删除包含占位符的段落 // 删除包含占位符的段落
XWPFRun run = placeholderParagraph.getRuns().get(0); XWPFRun run = placeholderParagraph.getRuns().get(0);
run.setText(run.getText(0).replace("{{table_here}}", ""), 0); run.setText(run.getText(0).replace("{{table_here}}", ""), 0);
//替换项目名称
if (textParagraph != null) {
String join = StrUtil.join("", textParagraph.getRuns().stream().map(te -> te.getText(0)).collect(Collectors.toList()));
XWPFRun xwpfRun = textParagraph.getRuns().get(0);
for (XWPFRun textParagraphRun : textParagraph.getRuns()) {
textParagraphRun.setText("");
}
xwpfRun.setText(join.replace("{{projectName}}","测试2"), 0);
}
// 在占位符位置插入表格 // 在占位符位置插入表格
// 插入表格到占位符位置后 // 插入表格到占位符位置后

1
jnpf-tendering-entity/src/main/java/jnpf/model/dto/LotteryProjectDto.java

@ -26,7 +26,6 @@ public class LotteryProjectDto {
TO_BE_EXTRACTED("0", "待抽取"), TO_BE_EXTRACTED("0", "待抽取"),
ALREADY_EXTRACTED("1", "已抽取"), ALREADY_EXTRACTED("1", "已抽取"),
SUSPENSION("2", "中止"), SUSPENSION("2", "中止"),
ARCHIVIST("3", "已归档"),
; ;
private String code; private String code;

BIN
jnpf-tendering-server/src/main/resources/jnpf/templete/招投标公司打印.docx

Binary file not shown.

BIN
jnpf-tendering-server/src/main/resources/jnpf/templete/浙江出版传媒股份有限公司ERP系统建设项目.docx

Binary file not shown.
Loading…
Cancel
Save