|
@@ -47,6 +47,7 @@ import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; |
|
|
import com.ningdatech.pmapi.todocenter.enumeration.IsOrNotEnum; |
|
|
import com.ningdatech.pmapi.todocenter.enumeration.IsOrNotEnum; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.PdfGenerateDTO; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.PdfGenerateDTO; |
|
|
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.SealInfoDTO; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.SignReqDTO; |
|
|
import com.ningdatech.pmapi.todocenter.model.dto.SignReqDTO; |
|
|
import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; |
|
|
import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; |
|
|
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; |
|
|
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum; |
|
@@ -64,7 +65,6 @@ import com.wflow.contants.HisProInsEndActId; |
|
|
import com.wflow.exception.BusinessException; |
|
|
import com.wflow.exception.BusinessException; |
|
|
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; |
|
|
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; |
|
|
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO; |
|
|
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO; |
|
|
import com.wflow.workflow.bean.dto.SealPositionInfoDTO; |
|
|
|
|
|
import com.wflow.workflow.bean.process.ProgressNode; |
|
|
import com.wflow.workflow.bean.process.ProgressNode; |
|
|
import com.wflow.workflow.bean.process.enums.NodeTypeEnum; |
|
|
import com.wflow.workflow.bean.process.enums.NodeTypeEnum; |
|
|
import com.wflow.workflow.bean.vo.ProcessInstanceVo; |
|
|
import com.wflow.workflow.bean.vo.ProcessInstanceVo; |
|
@@ -268,10 +268,6 @@ public class TodoCenterManage { |
|
|
case SEAL_PASS: |
|
|
case SEAL_PASS: |
|
|
// 通过该任务,流程到下一审核人处 |
|
|
// 通过该任务,流程到下一审核人处 |
|
|
processTaskService.handleTask(param, userId); |
|
|
processTaskService.handleTask(param, userId); |
|
|
if (ProcessHandlerEnum.SEAL_PASS.name().equals(param.getAction().name())) { |
|
|
|
|
|
// 调用IRS接口,获取盖章后的pdf文件,并保存到项目库中 |
|
|
|
|
|
getSignPdf(param, declaredProject); |
|
|
|
|
|
} |
|
|
|
|
|
// 获取流程通过后的流程实例 |
|
|
// 获取流程通过后的流程实例 |
|
|
HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() |
|
|
HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() |
|
|
.processInstanceId(processInstanceId) |
|
|
.processInstanceId(processInstanceId) |
|
@@ -426,16 +422,16 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 调用IRS接口,获取盖章后的pdf文件,上传到OSS,并保存文件ID到项目库中 |
|
|
* 调用IRS接口,获取盖章后的pdf文件,上传到OSS,并保存文件ID到项目库中 |
|
|
* @param param |
|
|
|
|
|
|
|
|
* @param req |
|
|
* @param declaredProject |
|
|
* @param declaredProject |
|
|
* @return void |
|
|
* @return void |
|
|
* @author CMM |
|
|
* @author CMM |
|
|
* @since 2023/03/16 21:34 |
|
|
* @since 2023/03/16 21:34 |
|
|
*/ |
|
|
*/ |
|
|
private void getSignPdf(ReqProcessHandlerDTO param, Project declaredProject) { |
|
|
|
|
|
Long projectId = param.getProjectId(); |
|
|
|
|
|
|
|
|
private Long getSealedPdf(SealInfoDTO req, Project declaredProject) { |
|
|
|
|
|
Long projectId = req.getProjectId(); |
|
|
// 设置pdf模板参数 |
|
|
// 设置pdf模板参数 |
|
|
JSONObject paramsMap = assemblyPdfParams(projectId); |
|
|
|
|
|
|
|
|
JSONObject paramsMap = assemblyPdfParams(declaredProject); |
|
|
// TODO 根据当前盖章单位设置对应的盖章意见与盖章日期 |
|
|
// TODO 根据当前盖章单位设置对应的盖章意见与盖章日期 |
|
|
paramsMap.put("superOrgOpinion",null); |
|
|
paramsMap.put("superOrgOpinion",null); |
|
|
paramsMap.put("superOrgAuditDate",null); |
|
|
paramsMap.put("superOrgAuditDate",null); |
|
@@ -450,26 +446,24 @@ public class TodoCenterManage { |
|
|
InputStream fileInputStream = fileService.getFileInputStream(pdfFile); |
|
|
InputStream fileInputStream = fileService.getFileInputStream(pdfFile); |
|
|
String pdfEncode64 = Base64.encode(fileInputStream); |
|
|
String pdfEncode64 = Base64.encode(fileInputStream); |
|
|
// 装配盖章接口请求参数信息 |
|
|
// 装配盖章接口请求参数信息 |
|
|
SignReqDTO req = new SignReqDTO(); |
|
|
|
|
|
req.setPdfEncode64(pdfEncode64); |
|
|
|
|
|
|
|
|
SignReqDTO signReq = new SignReqDTO(); |
|
|
|
|
|
signReq.setPdfEncode64(pdfEncode64); |
|
|
String originalFileName = pdfFile.getOriginalFileName(); |
|
|
String originalFileName = pdfFile.getOriginalFileName(); |
|
|
req.setFileName(originalFileName); |
|
|
|
|
|
SealPositionInfoDTO sealPositionInfo = param.getSealInfo(); |
|
|
|
|
|
Float posX = sealPositionInfo.getPosX(); |
|
|
|
|
|
Float posY = sealPositionInfo.getPosY(); |
|
|
|
|
|
req.setPosX(posX); |
|
|
|
|
|
req.setPosY(posY); |
|
|
|
|
|
// 获取流程发起人信息 |
|
|
|
|
|
Long projectSponsor = declaredProject.getSponsor(); |
|
|
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(projectSponsor); |
|
|
|
|
|
|
|
|
signReq.setFileName(originalFileName); |
|
|
|
|
|
Float posX = req.getPosX(); |
|
|
|
|
|
Float posY = req.getPosY(); |
|
|
|
|
|
signReq.setPosX(posX); |
|
|
|
|
|
signReq.setPosY(posY); |
|
|
|
|
|
// 获取当前登录签章用户信息 |
|
|
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
// 获取印章编号 |
|
|
// 获取印章编号 |
|
|
CompanySignature companySignature = companySignatureService.getOne(Wrappers.lambdaQuery(CompanySignature.class) |
|
|
CompanySignature companySignature = companySignatureService.getOne(Wrappers.lambdaQuery(CompanySignature.class) |
|
|
.eq(CompanySignature::getOrganizationCode, userFullInfo.getOrganizationCode())); |
|
|
.eq(CompanySignature::getOrganizationCode, userFullInfo.getOrganizationCode())); |
|
|
String sealSn = companySignature.getSealSn(); |
|
|
String sealSn = companySignature.getSealSn(); |
|
|
req.setSealSn(sealSn); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
signReq.setSealSn(sealSn); |
|
|
// 调用盖章接口,获取盖章后返回的pdf文件字符数组 |
|
|
// 调用盖章接口,获取盖章后返回的pdf文件字符数组 |
|
|
byte[] signPdf = IRSAPIRequest.createSignPdf(req); |
|
|
|
|
|
|
|
|
byte[] signPdf = IRSAPIRequest.createSignPdf(signReq); |
|
|
// 转换成MultipartFile |
|
|
// 转换成MultipartFile |
|
|
MultipartFile multipartFile = new MockMultipartFile("file", originalFileName + ".pdf", "application/pdf", signPdf); |
|
|
MultipartFile multipartFile = new MockMultipartFile("file", originalFileName + ".pdf", "application/pdf", signPdf); |
|
|
// 上传OSS |
|
|
// 上传OSS |
|
@@ -479,6 +473,7 @@ public class TodoCenterManage { |
|
|
declaredProject.setPretrialFileName(resultVo.getOriginalFileName()); |
|
|
declaredProject.setPretrialFileName(resultVo.getOriginalFileName()); |
|
|
declaredProject.setUpdateOn(LocalDateTime.now()); |
|
|
declaredProject.setUpdateOn(LocalDateTime.now()); |
|
|
projectService.updateById(declaredProject); |
|
|
projectService.updateById(declaredProject); |
|
|
|
|
|
return resultVo.getId(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1023,7 +1018,8 @@ public class TodoCenterManage { |
|
|
*/ |
|
|
*/ |
|
|
public Long getNotSealedPdf(Long projectId) { |
|
|
public Long getNotSealedPdf(Long projectId) { |
|
|
// 设置pdf模板参数 |
|
|
// 设置pdf模板参数 |
|
|
JSONObject paramsMap = assemblyPdfParams(projectId); |
|
|
|
|
|
|
|
|
Project project = projectService.getById(projectId); |
|
|
|
|
|
JSONObject paramsMap = assemblyPdfParams(project); |
|
|
paramsMap.put("superOrgOpinion",null); |
|
|
paramsMap.put("superOrgOpinion",null); |
|
|
paramsMap.put("superOrgAuditDate",null); |
|
|
paramsMap.put("superOrgAuditDate",null); |
|
|
paramsMap.put("higherOrgOpinion",null); |
|
|
paramsMap.put("higherOrgOpinion",null); |
|
@@ -1053,11 +1049,9 @@ public class TodoCenterManage { |
|
|
project.setPretrialFileName(resultVO.getOriginalFileName()); |
|
|
project.setPretrialFileName(resultVO.getOriginalFileName()); |
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
projectService.updateById(project); |
|
|
projectService.updateById(project); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
if (null != htmlInputStream) { |
|
|
if (null != htmlInputStream) { |
|
|
htmlInputStream.close(); |
|
|
|
|
|
|
|
|
htmlInputStream.close(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 删除输出文件夹下的临时文件 |
|
|
// 删除输出文件夹下的临时文件 |
|
@@ -1076,34 +1070,23 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 装配pdf模板参数 |
|
|
* 装配pdf模板参数 |
|
|
* @param projectId 申报项目ID |
|
|
|
|
|
|
|
|
* @param project 申报项目ID |
|
|
* @return com.alibaba.fastjson.JSONObject |
|
|
* @return com.alibaba.fastjson.JSONObject |
|
|
* @author CMM |
|
|
* @author CMM |
|
|
* @since 2023/03/16 22:28 |
|
|
* @since 2023/03/16 22:28 |
|
|
*/ |
|
|
*/ |
|
|
private JSONObject assemblyPdfParams(Long projectId) { |
|
|
|
|
|
|
|
|
private JSONObject assemblyPdfParams(Project project) { |
|
|
// 获取本地目录的pdf模板 |
|
|
// 获取本地目录的pdf模板 |
|
|
String fileName = "预审申请单"; |
|
|
String fileName = "预审申请单"; |
|
|
|
|
|
Long projectId = project.getId(); |
|
|
// 获取表单数据 |
|
|
// 获取表单数据 |
|
|
Project project = projectService.getById(projectId); |
|
|
|
|
|
PdfGenerateDTO pdfGenerateDTO = new PdfGenerateDTO(); |
|
|
PdfGenerateDTO pdfGenerateDTO = new PdfGenerateDTO(); |
|
|
BeanUtils.copyProperties(project, pdfGenerateDTO); |
|
|
BeanUtils.copyProperties(project, pdfGenerateDTO); |
|
|
JSONObject paramsMap = JSONObject.parseObject(JSONObject.toJSONString(pdfGenerateDTO)); |
|
|
JSONObject paramsMap = JSONObject.parseObject(JSONObject.toJSONString(pdfGenerateDTO)); |
|
|
// 设置title |
|
|
// 设置title |
|
|
String title = "【" + project.getProjectName() + "】" + fileName; |
|
|
String title = "【" + project.getProjectName() + "】" + fileName; |
|
|
paramsMap.put("title",title); |
|
|
paramsMap.put("title",title); |
|
|
// 获取流程发起人信息 |
|
|
|
|
|
Long projectSponsor = project.getSponsor(); |
|
|
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(projectSponsor); |
|
|
|
|
|
// 获取印章编号 |
|
|
|
|
|
CompanySignature companySignature = companySignatureService.getOne(Wrappers.lambdaQuery(CompanySignature.class) |
|
|
|
|
|
.eq(CompanySignature::getOrganizationCode, userFullInfo.getOrganizationCode())); |
|
|
|
|
|
if (Objects.nonNull(companySignature)){ |
|
|
|
|
|
String sealSn = companySignature.getSealSn(); |
|
|
|
|
|
paramsMap.put("projectNo", sealSn); |
|
|
|
|
|
}else { |
|
|
|
|
|
paramsMap.put("projectNo", null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
paramsMap.put("projectNo", projectId); |
|
|
// 获取预审申报的开始时间 |
|
|
// 获取预审申报的开始时间 |
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
.eq(ProjectInst::getProjectId, projectId) |
|
|
.eq(ProjectInst::getProjectId, projectId) |
|
@@ -1151,4 +1134,10 @@ public class TodoCenterManage { |
|
|
paramsMap.put("bigDataBureauName",null); |
|
|
paramsMap.put("bigDataBureauName",null); |
|
|
return paramsMap; |
|
|
return paramsMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Long getSealedPdf(SealInfoDTO req) { |
|
|
|
|
|
Long projectId = req.getProjectId(); |
|
|
|
|
|
Project declaredProject = projectService.getById(projectId); |
|
|
|
|
|
return getSealedPdf(req, declaredProject); |
|
|
|
|
|
} |
|
|
} |
|
|
} |