|
@@ -17,6 +17,7 @@ import org.springblade.archive.entity.ArchiveExpertScore;
|
|
|
import org.springblade.archive.mapper.ArchiveExpertConclusionMapper;
|
|
|
import org.springblade.archive.service.IArchiveExpertConclusionService;
|
|
|
import org.springblade.archive.service.IArchiveExpertScoreService;
|
|
|
+import org.springblade.archive.utils.FileUtils;
|
|
|
import org.springblade.archive.utils.ItextPdfUtils;
|
|
|
import org.springblade.archive.utils.MyPdfPageHelper;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
@@ -27,6 +28,8 @@ import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.evisa.feign.EVisaClient;
|
|
|
+import org.springblade.evisa.vo.SealPdfVO;
|
|
|
+import org.springblade.evisa.vo.SealStrategyVO;
|
|
|
import org.springblade.manager.entity.ProjectInfo;
|
|
|
import org.springblade.manager.entity.SignPfxFile;
|
|
|
import org.springblade.manager.feign.ProjectClient;
|
|
@@ -232,6 +235,9 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
|
|
|
throw new ServiceException("获取专家账号失败");
|
|
|
}
|
|
|
List<Long> userIds = Func.toLongList(expertIds);
|
|
|
+ if(userIds!=null && userIds.size()>=1){
|
|
|
+ userIds = userIds.stream().distinct().collect(Collectors.toList());
|
|
|
+ }
|
|
|
List<User> users = userClient.userInfoByIds(userIds);
|
|
|
if (users.size() == 0 || users.size() != userIds.size()){
|
|
|
throw new ServiceException("专家账号信息错误,请联系管理员");
|
|
@@ -254,26 +260,26 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
|
|
|
throw new ServiceException("生成PDF失败:"+e.getMessage());
|
|
|
}
|
|
|
//构建专家电签信息
|
|
|
- /* SigInfoVO vo = new SigInfoVO();
|
|
|
- List<SigInfoVO.SigInfo> infos = new ArrayList<>();
|
|
|
+ /* SealPdfVO vo = new SealPdfVO();
|
|
|
+ List<SealStrategyVO> infos = new ArrayList<>();
|
|
|
for (User user : users) {
|
|
|
SignPfxFile file = map.get(user.getId());
|
|
|
if (file == null){
|
|
|
throw new ServiceException("未获取到专家:"+user.getName()+"的电签信息");
|
|
|
}
|
|
|
- SigInfoVO.SigInfo info = new SigInfoVO.SigInfo();
|
|
|
- info.setUserName(user.getName());
|
|
|
+ SealStrategyVO info = new SealStrategyVO();
|
|
|
+ info.set(user.getName());
|
|
|
info.setUserSig(user.getName()+user.getPhone().substring(0,3));
|
|
|
info.setSealCode("S_NEW_"+file.getCertificatePassword());
|
|
|
info.setSealPassword(file.getCertificatePassword());
|
|
|
if (StringUtils.isBlank(file.getSignatureFileUrl())){
|
|
|
throw new ServiceException("未获取到专家:"+user.getName()+"的签字图片");
|
|
|
}
|
|
|
- info.setSigPic(file.getSignatureFileUrl());
|
|
|
+ info.setImageUrl(file.getSignatureFileUrl());
|
|
|
infos.add(info);
|
|
|
}
|
|
|
- vo.setPdfUrl(pdfUrl);
|
|
|
- vo.setList(infos);
|
|
|
+ vo.setPdfFileUrl(pdfUrl);
|
|
|
+ vo.setStrategyVoList(infos);
|
|
|
System.out.println("11111111111");
|
|
|
//PDF电签
|
|
|
R<String> visa = eVisaClient.batchEVisa(vo);
|
|
@@ -285,14 +291,16 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
|
|
|
}
|
|
|
System.out.println(visa);
|
|
|
//修改状态,插入结论PDF
|
|
|
- conclusion.setTableUrl(visa.getData());
|
|
|
+ conclusion.setTableUrl(visa.getData());*/
|
|
|
+ // R<String> visa = eVisaClient.batchEVisa(vo);
|
|
|
+ conclusion.setTableUrl(pdfUrl);
|
|
|
conclusion.setStatus(2);
|
|
|
conclusion.setApproveDate(LocalDate.now());
|
|
|
//还原当前项目所有档案的:申请验收状态,查阅状态,抽检意见,专家id,是否抽检
|
|
|
baseMapper.updateAllArchiveByProject(conclusion.getProjectId());
|
|
|
//还原当前项目所有分配的树节点
|
|
|
baseMapper.updateAllNodeByProject(conclusion.getProjectId());
|
|
|
- this.updateById(conclusion);*/
|
|
|
+ this.updateById(conclusion);
|
|
|
}
|
|
|
|
|
|
private String buildPdf(ArchiveExpertConclusion conclusion,List<User> users) throws Exception {
|
|
@@ -317,7 +325,7 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
|
|
|
Document document = new Document(PageSize.A4, 10, 10, 80, 85);
|
|
|
//文件地址
|
|
|
// String localFile = "C:\\Users\\泓创研发01\\Desktop\\"+conclusion.getId()+".pdf";
|
|
|
- String localFile = "/www/wwwroot/Users/hongchuangyanfa/Desktop/archiveCheck/"+conclusion.getId()+".pdf";
|
|
|
+ String localFile = FileUtils.getSysLocalFileUrl()+ "/archiveCheck/"+conclusion.getId()+".pdf";
|
|
|
//建立一个书写器
|
|
|
FileOutputStream fileOutputStream = new FileOutputStream(localFile);
|
|
|
PdfWriter writer = PdfWriter.getInstance(document,fileOutputStream );
|
|
@@ -328,6 +336,8 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
|
|
|
//创建字体
|
|
|
// BaseFont baseFont2 =BaseFont.createFont("C:/WINDOWS/Fonts/simsun.ttc,0", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
|
|
|
BaseFont baseFont2 =BaseFont.createFont("/usr/share/fonts/chinese/simsun.ttc,0", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
|
|
|
+ // BaseFont baseFont2 =BaseFont.createFont("/Users/hongchuangyanfa/fsdownload/simsun.ttc", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
|
|
|
+ // BaseFont baseFont2 =BaseFont.createFont(); //BaseFont.createFont("/Users/hongchuangyanfa/fsdownload/simsun.ttc", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);
|
|
|
//字体对象,这里可以创建一个方法
|
|
|
Font sigFont = new Font(baseFont2, 0.1F, Font.NORMAL); //大小为0.1的正常字体
|
|
|
Font size13font = new Font(baseFont2, 13, Font.NORMAL); //大小为13的正常字体
|
|
@@ -335,7 +345,7 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
|
|
|
Font size14bold = new Font(baseFont2, 14, Font.BOLD); //大小为14的粗字体
|
|
|
Font size17bold = new Font(baseFont2, 17, Font.BOLD); //大小为17的正常字体
|
|
|
|
|
|
- String firstText = "重庆渝北至长寿高速公路(渝长高速公路扩能)";
|
|
|
+ String firstText = "平塘至天峨高速公路";
|
|
|
String secondText = "档案专项验收意见";
|
|
|
ItextPdfUtils.tableHeader(document,size17bold,firstText);
|
|
|
ItextPdfUtils.tableHeader(document,size17bold,secondText);
|
|
@@ -353,7 +363,7 @@ public class ArchiveExpertConclusionServiceImpl extends BaseServiceImpl<ArchiveE
|
|
|
ItextPdfUtils.tableText(document,size13font,conclusion.getQuestionSuggest());
|
|
|
ItextPdfUtils.blankRow(document,size13font,60);
|
|
|
//落款项目
|
|
|
- ItextPdfUtils.endRight(document,size13font,"重庆渝北至长寿高速公路(渝长高速公路扩能)",widthPercentage);
|
|
|
+ ItextPdfUtils.endRight(document,size13font,"平塘至天峨高速公路",widthPercentage);
|
|
|
//落款档案验收组
|
|
|
ItextPdfUtils.endRight(document,size13font,"档案验收组",60);
|
|
|
//落款日期
|