|
|
@@ -23,6 +23,7 @@ import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; |
|
|
|
import com.ningdatech.pmapi.todocenter.handle.PassHandle; |
|
|
|
import com.ningdatech.pmapi.todocenter.handle.WithDrawHandle; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.dto.*; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.*; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.TodoNumVO; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
|
import com.wflow.contants.HisProInsEndActId; |
|
|
@@ -40,7 +41,6 @@ import org.flowable.engine.HistoryService; |
|
|
|
import org.flowable.engine.RepositoryService; |
|
|
|
import org.flowable.engine.TaskService; |
|
|
|
import org.flowable.engine.history.HistoricProcessInstance; |
|
|
|
import org.flowable.engine.task.Comment; |
|
|
|
import org.flowable.task.api.Task; |
|
|
|
import org.flowable.task.api.history.HistoricTaskInstance; |
|
|
|
import org.flowable.variable.api.history.HistoricVariableInstance; |
|
|
@@ -85,9 +85,6 @@ import com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.TodoCenterStatisticsVO; |
|
|
|
import com.ningdatech.pmapi.todocenter.service.StatisticsService; |
|
|
|
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; |
|
|
|
import com.ningdatech.pmapi.todocenter.utils.PdfUtils; |
|
|
@@ -455,17 +452,14 @@ public class TodoCenterManage { |
|
|
|
* @param req |
|
|
|
* @param declaredProject |
|
|
|
* @param templateName |
|
|
|
* @param paramsMap |
|
|
|
* @param notSealedFileId |
|
|
|
* @return void |
|
|
|
* @author CMM |
|
|
|
* @since 2023/03/16 21:34 |
|
|
|
*/ |
|
|
|
private Long getSealedPdf(SealInfoDTO req, Project declaredProject, String templateName, JSONObject paramsMap) { |
|
|
|
Long projectId = req.getProjectId(); |
|
|
|
// 再次获取装配了盖章意见和盖章日期参数的未盖章pdf文件 |
|
|
|
Long pretrialFileId = generateNotSealedPdf(projectId, templateName, paramsMap); |
|
|
|
private Long generateSealedPdf(SealInfoDTO req, Project declaredProject, String templateName, Long notSealedFileId) { |
|
|
|
// 获取预审申请单文件,并转换为Base64 |
|
|
|
File pdfFile = fileService.getById(pretrialFileId); |
|
|
|
File pdfFile = fileService.getById(notSealedFileId); |
|
|
|
InputStream fileInputStream = fileService.getFileInputStream(pdfFile); |
|
|
|
String pdfEncode64 = Base64.encode(fileInputStream); |
|
|
|
// 装配盖章接口请求参数信息 |
|
|
@@ -477,13 +471,19 @@ public class TodoCenterManage { |
|
|
|
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) |
|
|
|
.eq(CompanySignature::getOrganizationCode, userFullInfo.getEmpPosUnitCode())); |
|
|
|
String sealSn = companySignature.getSealSn(); |
|
|
|
String sealSn; |
|
|
|
if (Objects.isNull(req.getSealSn())) { |
|
|
|
// 获取当前登录签章用户信息 |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取印章编号 |
|
|
|
CompanySignature companySignature = companySignatureService.getOne(Wrappers.lambdaQuery(CompanySignature.class) |
|
|
|
.eq(CompanySignature::getOrganizationCode, userFullInfo.getEmpPosUnitCode())); |
|
|
|
sealSn = companySignature.getSealSn(); |
|
|
|
}else { |
|
|
|
// 区县预审时,对有上级条线主管单位并进行了盖章的情况,需要根据上次的印章编号再次盖章 |
|
|
|
sealSn = req.getSealSn(); |
|
|
|
} |
|
|
|
signReq.setSealSn(sealSn); |
|
|
|
String posPage = req.getPosPage(); |
|
|
|
signReq.setPosPage(posPage); |
|
|
@@ -1098,14 +1098,21 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取未盖章的预审申请单/建设方案申请单pdf文件 |
|
|
|
* @param projectId |
|
|
|
* @param req |
|
|
|
* @return java.lang.Long |
|
|
|
* @author CMM |
|
|
|
* @since 2023/03/16 22:46 |
|
|
|
*/ |
|
|
|
public Long getNotSealedPdf(Long projectId) { |
|
|
|
public NotSealedInfoVO getNotSealedPdf(SealInfoDTO req) { |
|
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
|
String empPosUnitCode = user.getEmpPosUnitCode(); |
|
|
|
Long projectId = req.getProjectId(); |
|
|
|
String auditOpinion = req.getAuditOpinion(); |
|
|
|
String auditDate = NdDateUtils.format(LocalDateTime.now(), NdDateUtils.DEFAULT_DATE_TIME_FORMAT); |
|
|
|
NotSealedInfoVO notSealedInfoVo = new NotSealedInfoVO(); |
|
|
|
// 判断项目盖章审批类型 |
|
|
|
Project project = projectService.getById(projectId); |
|
|
|
String buildOrgCode = project.getBuildOrgCode(); |
|
|
|
String instanceId = project.getInstCode(); |
|
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.eq(ProjectInst::getInstCode, instanceId)); |
|
|
@@ -1115,37 +1122,119 @@ public class TodoCenterManage { |
|
|
|
// 再根据项目所属区域判断是市级预审还是区县预审 |
|
|
|
String areaCode = project.getAreaCode(); |
|
|
|
Long pretrialFileId = project.getPretrialFileId(); |
|
|
|
// 如果项目关联的预审文件ID不为空,说明已经进行过盖章审核,直接返回盖章后的预审申请单文件ID |
|
|
|
// 如果项目关联的预审文件ID不为空,说明已经提交过审核意见,直接返回文件ID |
|
|
|
if (Objects.nonNull(pretrialFileId)){ |
|
|
|
return pretrialFileId; |
|
|
|
notSealedInfoVo.setFileId(pretrialFileId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
Region region = regionService.getOne(Wrappers.lambdaQuery(Region.class) |
|
|
|
.eq(Region::getRegionCode, areaCode)); |
|
|
|
if (Objects.isNull(region)){ |
|
|
|
throw new BizException("项目所属区域不存在!"); |
|
|
|
} |
|
|
|
VUtils.isTrue(Objects.isNull(region)).throwMessage("项目所属区域不存在!"); |
|
|
|
Integer regionLevel = region.getRegionLevel(); |
|
|
|
// 获取项目申报时是否选择了主管单位和上级条线主管单位 |
|
|
|
// 主管单位信息 |
|
|
|
Integer isSuperOrg = project.getIsSuperOrg(); |
|
|
|
String superOrgCode = project.getSuperOrgCode(); |
|
|
|
// 上级条线主管单位信息 |
|
|
|
Integer isHigherSuperOrg = project.getIsHigherSuperOrg(); |
|
|
|
String higherSuperOrgCode = project.getHigherSuperOrgCode(); |
|
|
|
switch (regionLevel) { |
|
|
|
// 市级预审 |
|
|
|
case RegionConst.RL_CITY: |
|
|
|
String cityTemplateName = TodoCenterConstant.SealTemplate.CITY_TEMPLATE; |
|
|
|
// 设置pdf模板参数 |
|
|
|
JSONObject cityParamsMap = assemblyPdfParams(project,cityTemplateName); |
|
|
|
// 本级主管单位意见 |
|
|
|
cityParamsMap.put("superOrgOpinion",null); |
|
|
|
cityParamsMap.put("superOrgAuditDate",null); |
|
|
|
return generateNotSealedPdf(projectId,cityTemplateName, cityParamsMap); |
|
|
|
// 盖章审核为主管单位审核 |
|
|
|
if (CommonEnum.YES.getCode().equals(isSuperOrg)){ |
|
|
|
// 有主管单位信息且登录用户所在单位是主管单位 |
|
|
|
checkEmpPosUnitCode(empPosUnitCode, auditOpinion, auditDate, superOrgCode, cityParamsMap); |
|
|
|
} else if (CommonEnum.NO.getCode().equals(isSuperOrg)) { |
|
|
|
// 没有选主管单位,默认为项目建设单位且登录用户所在单位为项目建设单位 |
|
|
|
checkEmpPosUnitCode(empPosUnitCode, auditOpinion, auditDate, buildOrgCode, cityParamsMap); |
|
|
|
} |
|
|
|
Long cityPdfId = generateNotSealedPdf(projectId, cityTemplateName, cityParamsMap); |
|
|
|
notSealedInfoVo.setFileId(cityPdfId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
return notSealedInfoVo; |
|
|
|
// 区县预审 |
|
|
|
case RegionConst.RL_COUNTY: |
|
|
|
String countryTemplateName = TodoCenterConstant.SealTemplate.COUNTRY_TEMPLATE; |
|
|
|
String sealNo = null; |
|
|
|
Long notSealedId = null; |
|
|
|
// 设置pdf模板参数 |
|
|
|
JSONObject countryParamsMap = assemblyPdfParams(project, countryTemplateName); |
|
|
|
// 本级主管单位意见、上级主管单位意见 |
|
|
|
countryParamsMap.put("superOrgOpinion",null); |
|
|
|
countryParamsMap.put("superOrgAuditDate",null); |
|
|
|
countryParamsMap.put("higherOrgOpinion",null); |
|
|
|
countryParamsMap.put("higherOrgAuditDate",null); |
|
|
|
return generateNotSealedPdf(projectId,countryTemplateName, countryParamsMap); |
|
|
|
// 以是否有上级主管单位的维度判断(有上级条线主管单位,才有可能需要盖两次章) |
|
|
|
if (CommonEnum.YES.getCode().equals(isHigherSuperOrg)) { |
|
|
|
// 盖章审核登录用户所在单位为上级条线主管单位,此时为区县预审盖章流程第一个章 |
|
|
|
if (empPosUnitCode.equals(higherSuperOrgCode)) { |
|
|
|
// 有上级条线主管单位信息且登录用户所在单位是上级条线主管单位, |
|
|
|
countryParamsMap.put("higherOrgOpinion", auditOpinion); |
|
|
|
countryParamsMap.put("higherOrgAuditDate", auditDate); |
|
|
|
// 获取上级条线主管单位印章编号 |
|
|
|
CompanySignature companySignature = |
|
|
|
companySignatureService.getOne(Wrappers.lambdaQuery(CompanySignature.class) |
|
|
|
.eq(CompanySignature::getOrganizationCode, higherSuperOrgCode)); |
|
|
|
if (Objects.nonNull(companySignature)) { |
|
|
|
sealNo = companySignature.getSealSn(); |
|
|
|
} |
|
|
|
// 保存区县预审上级条线主管单位盖章审核意见、审核日期和盖章编号 |
|
|
|
project.setCountrySealNo(sealNo); |
|
|
|
project.setCountrySealAuditOpinion(auditOpinion); |
|
|
|
project.setCountrySealAuditDate(auditDate); |
|
|
|
projectService.updateById(project); |
|
|
|
countryParamsMap.put("superOrgOpinion", null); |
|
|
|
countryParamsMap.put("superOrgAuditDate", null); |
|
|
|
// 直接返回装填了上级条线主管单位意见的未盖章文件 |
|
|
|
notSealedId = generateNotSealedPdf(projectId, countryTemplateName, countryParamsMap); |
|
|
|
} |
|
|
|
// 盖章审核登录用户所在单位不为上级条线主管单位(可能为选择的主管单位、项目建设单位、其他单位), |
|
|
|
// 此时为区县预审盖章流程第二个章 |
|
|
|
else if (CommonEnum.YES.getCode().equals(isSuperOrg)) { |
|
|
|
// 有上级条线主管单位信息且有本级主管单位信息 |
|
|
|
// 有主管单位信息且登录用户所在单位是主管单位 |
|
|
|
// 装配本级主管单位审核意见 |
|
|
|
checkEmpPosUnitCode(empPosUnitCode,auditOpinion,auditDate,superOrgCode,countryParamsMap); |
|
|
|
// 装配上级条线主管单位意见,调用盖章接口, |
|
|
|
// 重新生成上级条线主管单位盖章而本级主管单位未盖章的pdf文件 |
|
|
|
SealInfoDTO sealInfoDTO = getHigherSealInfoDTO(project, countryParamsMap); |
|
|
|
Long notSealedPdfId = generateNotSealedPdf(projectId, countryTemplateName, countryParamsMap); |
|
|
|
notSealedId = generateSealedPdf(sealInfoDTO, project, countryTemplateName, notSealedPdfId); |
|
|
|
}else if (CommonEnum.NO.getCode().equals(isSuperOrg)) { |
|
|
|
// 有上级条线主管单位信息,没有本级主管单位信息 |
|
|
|
// 没有选主管单位,默认为项目建设单位且登录用户所在单位为项目建设单位 |
|
|
|
checkEmpPosUnitCode(empPosUnitCode,auditOpinion,auditDate,buildOrgCode,countryParamsMap); |
|
|
|
// 装配上级条线主管单位意见,调用盖章接口, |
|
|
|
// 重新生成上级条线主管单位盖章而本级主管单位未盖章的pdf文件 |
|
|
|
SealInfoDTO sealInfoDTO = getHigherSealInfoDTO(project, countryParamsMap); |
|
|
|
Long notSealedPdfId = generateNotSealedPdf(projectId, countryTemplateName, countryParamsMap); |
|
|
|
notSealedId = generateSealedPdf(sealInfoDTO, project, countryTemplateName, notSealedPdfId); |
|
|
|
} |
|
|
|
} |
|
|
|
// 没有上级主管条线单位 |
|
|
|
else if (CommonEnum.NO.getCode().equals(isHigherSuperOrg)) { |
|
|
|
// 有本级主管单位信息 |
|
|
|
if (CommonEnum.YES.getCode().equals(isSuperOrg)) { |
|
|
|
// 登录用户所在单位是本级主管单位,装配本级主管单位审核意见 |
|
|
|
checkEmpPosUnitCode(empPosUnitCode,auditOpinion,auditDate,superOrgCode,countryParamsMap); |
|
|
|
// 直接返回装配了本级主管单位审核意见的未盖章文件 |
|
|
|
countryParamsMap.put("higherOrgOpinion", null); |
|
|
|
countryParamsMap.put("higherOrgAuditDate", null); |
|
|
|
notSealedId = generateNotSealedPdf(projectId, countryTemplateName, countryParamsMap); |
|
|
|
} |
|
|
|
// 没有选主管单位,默认为项目建设单位 |
|
|
|
else if (CommonEnum.NO.getCode().equals(isSuperOrg)) { |
|
|
|
// 登录用户所在单位为项目建设单位 |
|
|
|
checkEmpPosUnitCode(empPosUnitCode,auditOpinion,auditDate,buildOrgCode,countryParamsMap); |
|
|
|
// 直接返回装配了项目建设单位审核意见的未盖章文件 |
|
|
|
countryParamsMap.put("higherOrgOpinion", null); |
|
|
|
countryParamsMap.put("higherOrgAuditDate", null); |
|
|
|
notSealedId = generateNotSealedPdf(projectId, countryTemplateName, countryParamsMap); |
|
|
|
} |
|
|
|
} |
|
|
|
notSealedInfoVo.setFileId(notSealedId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
return notSealedInfoVo; |
|
|
|
default: |
|
|
|
throw new IllegalStateException("Unexpected value: " + regionLevel); |
|
|
|
} |
|
|
@@ -1153,19 +1242,50 @@ public class TodoCenterManage { |
|
|
|
// 如果为建设方案申报审批 |
|
|
|
else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)){ |
|
|
|
Long constructFileId = project.getConstructFileId(); |
|
|
|
// 如果项目关联的建设方案文件ID不为空,说明已经进行过盖章审核,直接返回盖章后的建设方案申请单文件ID |
|
|
|
// 如果项目关联的建设方案文件ID不为空,说明已经提交过审核意见,直接返回文件ID |
|
|
|
if (Objects.nonNull(constructFileId)){ |
|
|
|
return constructFileId; |
|
|
|
notSealedInfoVo.setFileId(constructFileId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
// 设置pdf模板参数 |
|
|
|
String constructTemplateName = TodoCenterConstant.SealTemplate.CONSTRUCT_TEMPLATE; |
|
|
|
JSONObject countryParamsMap = assemblyPdfParams(project, constructTemplateName); |
|
|
|
// 本级主管单位意见、上级主管单位意见 |
|
|
|
countryParamsMap.put("bigDataBureauOpinion",null); |
|
|
|
countryParamsMap.put("bigDataBureauAuditDate",null); |
|
|
|
return generateNotSealedPdf(projectId,constructTemplateName, countryParamsMap); |
|
|
|
JSONObject constructParamsMap = assemblyPdfParams(project, constructTemplateName); |
|
|
|
// 审核为指定大数据局盖章 |
|
|
|
// 获取流程配置的指定单位信息 |
|
|
|
constructParamsMap.put("bigDataBureauOpinion",auditOpinion); |
|
|
|
constructParamsMap.put("bigDataBureauAuditDate",auditDate); |
|
|
|
Long constructNotFileId = generateNotSealedPdf(projectId, constructTemplateName, constructParamsMap); |
|
|
|
notSealedInfoVo.setFileId(constructNotFileId); |
|
|
|
notSealedInfoVo.setIsCommit(Boolean.TRUE); |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
return notSealedInfoVo; |
|
|
|
} |
|
|
|
|
|
|
|
private SealInfoDTO getHigherSealInfoDTO(Project project, JSONObject countryParamsMap) { |
|
|
|
String countrySealAuditOpinion = project.getCountrySealAuditOpinion(); |
|
|
|
String countrySealAuditDate = project.getCountrySealAuditDate(); |
|
|
|
countryParamsMap.put("higherOrgOpinion", countrySealAuditOpinion); |
|
|
|
countryParamsMap.put("higherOrgAuditDate", countrySealAuditDate); |
|
|
|
SealInfoDTO sealInfoDTO = new SealInfoDTO(); |
|
|
|
sealInfoDTO.setPosPage(TodoCenterConstant.SealTemplate.COUNTRY_SEAL_POS_PAGE); |
|
|
|
sealInfoDTO.setProjectId(project.getId()); |
|
|
|
sealInfoDTO.setPosX(TodoCenterConstant.SealTemplate.COUNTRY_SEAL_POS_X); |
|
|
|
sealInfoDTO.setPosY(TodoCenterConstant.SealTemplate.COUNTRY_SEAL_POS_Y); |
|
|
|
sealInfoDTO.setSignType(TodoCenterConstant.SealTemplate.COUNTRY_SEAL_SIGN_TYPE); |
|
|
|
sealInfoDTO.setSealSn(project.getCountrySealNo()); |
|
|
|
return sealInfoDTO; |
|
|
|
} |
|
|
|
|
|
|
|
private void checkEmpPosUnitCode(String empPosUnitCode, String auditOpinion, String auditDate, String orgCode, JSONObject cityParamsMap) { |
|
|
|
if (empPosUnitCode.equals(orgCode)) { |
|
|
|
cityParamsMap.put("superOrgOpinion", auditOpinion); |
|
|
|
cityParamsMap.put("superOrgAuditDate", auditDate); |
|
|
|
}else { |
|
|
|
cityParamsMap.put("superOrgOpinion", null); |
|
|
|
cityParamsMap.put("superOrgAuditDate", null); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
private Long generateNotSealedPdf(Long projectId, String templateName, JSONObject paramsMap) { |
|
|
@@ -1186,14 +1306,22 @@ public class TodoCenterManage { |
|
|
|
MultipartFile multipartFile = new MockMultipartFile("file", fileName + ".pdf", "application/pdf", pdf); |
|
|
|
|
|
|
|
// 上传OSS |
|
|
|
FileResultVO resultVO = fileService.upload(multipartFile, "default"); |
|
|
|
FileResultVO resultVo = fileService.upload(multipartFile, "default"); |
|
|
|
|
|
|
|
// 将返回的文件ID保存到项目库中 |
|
|
|
Project project = projectService.getById(projectId); |
|
|
|
project.setPretrialFileId(resultVO.getId()); |
|
|
|
project.setPretrialFileName(resultVO.getOriginalFileName()); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
projectService.updateById(project); |
|
|
|
// 将返回的文件ID更新到项目库中对应的项目下 |
|
|
|
Project declaredProject = projectService.getById(projectId); |
|
|
|
// 根据模版名称判断是预审申请单还是建设方案申请单 |
|
|
|
if (TodoCenterConstant.SealTemplate.CITY_TEMPLATE.equals(templateName) || |
|
|
|
TodoCenterConstant.SealTemplate.COUNTRY_TEMPLATE.equals(templateName)) { |
|
|
|
declaredProject.setPretrialFileId(resultVo.getId()); |
|
|
|
declaredProject.setPretrialFileName(resultVo.getOriginalFileName()); |
|
|
|
declaredProject.setUpdateOn(LocalDateTime.now()); |
|
|
|
} else if (TodoCenterConstant.SealTemplate.CONSTRUCT_TEMPLATE.equals(templateName)) { |
|
|
|
declaredProject.setConstructFileId(resultVo.getId()); |
|
|
|
declaredProject.setConstructFileName(resultVo.getOriginalFileName()); |
|
|
|
declaredProject.setUpdateOn(LocalDateTime.now()); |
|
|
|
} |
|
|
|
projectService.updateById(declaredProject); |
|
|
|
try { |
|
|
|
if (null != htmlInputStream) { |
|
|
|
htmlInputStream.close(); |
|
|
@@ -1210,7 +1338,7 @@ public class TodoCenterManage { |
|
|
|
} |
|
|
|
|
|
|
|
// 返回文件id供前端下载 |
|
|
|
return resultVO.getId(); |
|
|
|
return resultVo.getId(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -1340,14 +1468,10 @@ public class TodoCenterManage { |
|
|
|
} |
|
|
|
|
|
|
|
public Long getSealedPdf(SealInfoDTO req) { |
|
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
|
String empPosUnitCode = user.getEmpPosUnitCode(); |
|
|
|
|
|
|
|
Long projectId = req.getProjectId(); |
|
|
|
// 盖章审核意见 |
|
|
|
String auditOpinion = req.getAuditOpinion(); |
|
|
|
String auditDate = NdDateUtils.format(LocalDateTime.now(), NdDateUtils.DEFAULT_DATE_TIME_FORMAT); |
|
|
|
Long notSealedFileId = req.getNotSealedFileId(); |
|
|
|
Project declaredProject = projectService.getById(projectId); |
|
|
|
String buildOrgCode = declaredProject.getBuildOrgCode(); |
|
|
|
String instanceId = declaredProject.getInstCode(); |
|
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.eq(ProjectInst::getInstCode, instanceId)); |
|
|
@@ -1362,61 +1486,15 @@ public class TodoCenterManage { |
|
|
|
throw new BizException("项目所属区域不存在!"); |
|
|
|
} |
|
|
|
Integer regionLevel = region.getRegionLevel(); |
|
|
|
// 获取项目申报时是否选择了主管单位和上级条线主管单位 |
|
|
|
// 主管单位信息 |
|
|
|
Integer isSuperOrg = declaredProject.getIsSuperOrg(); |
|
|
|
String superOrgCode = declaredProject.getSuperOrgCode(); |
|
|
|
// 上级条线主管单位信息 |
|
|
|
Integer isHigherSuperOrg = declaredProject.getIsHigherSuperOrg(); |
|
|
|
String higherSuperOrgCode = declaredProject.getHigherSuperOrgCode(); |
|
|
|
switch (regionLevel) { |
|
|
|
// 市级预审 |
|
|
|
case RegionConst.RL_CITY: |
|
|
|
String cityTemplateName = TodoCenterConstant.SealTemplate.CITY_TEMPLATE; |
|
|
|
// 设置pdf模板参数 |
|
|
|
JSONObject cityParamsMap = assemblyPdfParams(declaredProject, cityTemplateName); |
|
|
|
// 盖章审核为主管单位审核 |
|
|
|
if (CommonEnum.YES.getCode().equals(isSuperOrg)){ |
|
|
|
// 有主管单位信息且登录用户所在单位是主管单位 |
|
|
|
if (superOrgCode.equals(empPosUnitCode)){ |
|
|
|
cityParamsMap.put("superOrgOpinion",auditOpinion); |
|
|
|
cityParamsMap.put("superOrgAuditDate",auditDate); |
|
|
|
} |
|
|
|
} else if (CommonEnum.NO.getCode().equals(isSuperOrg)) { |
|
|
|
// 没有选主管单位,默认为项目建设单位且登录用户所在单位为项目建设单位 |
|
|
|
if (buildOrgCode.equals(empPosUnitCode)) { |
|
|
|
cityParamsMap.put("superOrgOpinion", auditOpinion); |
|
|
|
cityParamsMap.put("superOrgAuditDate", auditDate); |
|
|
|
} |
|
|
|
} |
|
|
|
return getSealedPdf(req, declaredProject,cityTemplateName,cityParamsMap); |
|
|
|
return generateSealedPdf(req, declaredProject,cityTemplateName,notSealedFileId); |
|
|
|
// 区县预审 |
|
|
|
case RegionConst.RL_COUNTY: |
|
|
|
String countryTemplateName = TodoCenterConstant.SealTemplate.COUNTRY_TEMPLATE; |
|
|
|
// 设置pdf模板参数 |
|
|
|
JSONObject countryParamsMap = assemblyPdfParams(declaredProject, countryTemplateName); |
|
|
|
|
|
|
|
// 判断当前盖章用户所在单位是本级主管单位还是上级主管单位 |
|
|
|
if (CommonEnum.YES.getCode().equals(isSuperOrg)){ |
|
|
|
// 有主管单位信息且登录用户所在单位是主管单位 |
|
|
|
if (superOrgCode.equals(empPosUnitCode)){ |
|
|
|
countryParamsMap.put("superOrgOpinion",auditOpinion); |
|
|
|
countryParamsMap.put("superOrgAuditDate",auditDate); |
|
|
|
} |
|
|
|
} else if (CommonEnum.NO.getCode().equals(isSuperOrg)) { |
|
|
|
// 没有选主管单位,默认为项目建设单位且登录用户所在单位为项目建设单位 |
|
|
|
if (buildOrgCode.equals(empPosUnitCode)) { |
|
|
|
countryParamsMap.put("superOrgOpinion", auditOpinion); |
|
|
|
countryParamsMap.put("superOrgAuditDate", auditDate); |
|
|
|
} |
|
|
|
} else if (CommonEnum.YES.getCode().equals(isHigherSuperOrg)) { |
|
|
|
// 有上级条线主管单位信息且登录用户所在单位是上级条线主管单位 |
|
|
|
if (higherSuperOrgCode.equals(empPosUnitCode)){ |
|
|
|
countryParamsMap.put("higherOrgOpinion",auditOpinion); |
|
|
|
countryParamsMap.put("higherOrgAuditDate",auditDate); |
|
|
|
} |
|
|
|
} |
|
|
|
return getSealedPdf(req, declaredProject,countryTemplateName, countryParamsMap); |
|
|
|
return generateSealedPdf(req, declaredProject,countryTemplateName, notSealedFileId); |
|
|
|
default: |
|
|
|
throw new IllegalStateException("Unexpected value: " + regionLevel); |
|
|
|
} |
|
|
@@ -1425,12 +1503,7 @@ public class TodoCenterManage { |
|
|
|
else if (InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode().equals(instType)){ |
|
|
|
// 设置pdf模板参数 |
|
|
|
String constructTemplateName = TodoCenterConstant.SealTemplate.CONSTRUCT_TEMPLATE; |
|
|
|
JSONObject constructParamsMap = assemblyPdfParams(declaredProject, constructTemplateName); |
|
|
|
// 审核为指定大数据局盖章 |
|
|
|
// 获取流程配置的指定单位信息 |
|
|
|
constructParamsMap.put("bigDataBureauOpinion",auditOpinion); |
|
|
|
constructParamsMap.put("bigDataBureauAuditDate",auditDate); |
|
|
|
return getSealedPdf(req, declaredProject,constructTemplateName, constructParamsMap); |
|
|
|
return generateSealedPdf(req, declaredProject,constructTemplateName, notSealedFileId); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|