diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java index 23701e98..615af13f 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java @@ -838,8 +838,23 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu } } - // 审核文件签名() - + // 审核文件签名 + String filePath = proProjectInfoSubdeptsUsers.getEduFilePath().replace(ProfileConfig.profile, ProfileConfig.profilePath); + BasSignet query = new BasSignet(); + query.setProjectId(proProjectInfoSubdeptsUsers.getProjectId()); + query.setUserId(SecurityUtils.getUserId()); + List signets = basSignetMapper.selectBasSignetList(query); + if(StringUtils.isEmpty(signets)){ + throw new ServiceException("获取签名异常"); + } + File pdfFile = org.apache.commons.io.FileUtils.getFile(filePath); + if (!pdfFile.getParentFile().exists()) { + boolean mkdirs = pdfFile.getParentFile().mkdirs(); + log.info("创建目录...{}...{}",mkdirs,filePath); + } + String newFilePath = filePath.replace(".pdf","-c.pdf"); + PdfImageSignetUtil.imageWaterMark(filePath, filePath, signets.get(0).getSignetPath().replace(ProfileConfig.profile, ProfileConfig.profilePath),SignetKeyEnums.COMPANY_SIGN.getCode()); + proProjectInfoSubdeptsUsers.setEduFilePath(newFilePath); proProjectInfoSubdeptsUsers.setUseStatus(UseStateEnums.IN.getCode()); proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.exempt.getCode()); @@ -855,9 +870,23 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu @Override public void approveSubDeptsUserGroSign(Long id){ ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(id); - ProProjectInfoSubdeptsUsers myProUser = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersByParamId(proProjectInfoSubdeptsUsers.getProjectId(),SecurityUtils.getUserId()); String filePath = proProjectInfoSubdeptsUsers.getEduFilePath().replace(ProfileConfig.profile, ProfileConfig.profilePath); - PdfImageSignetUtil.imageWaterMark(filePath, filePath, myProUser.gets().replace(Constants.RESOURCE_PREFIX, AppConfig.getProfile()),SignetTypeEnum.USER.getCode()); + BasSignet query = new BasSignet(); + query.setProjectId(proProjectInfoSubdeptsUsers.getProjectId()); + query.setUserId(SecurityUtils.getUserId()); + List signets = basSignetMapper.selectBasSignetList(query); + if(StringUtils.isEmpty(signets)){ + throw new ServiceException("获取签名异常"); + } + File pdfFile = org.apache.commons.io.FileUtils.getFile(filePath); + if (!pdfFile.getParentFile().exists()) { + boolean mkdirs = pdfFile.getParentFile().mkdirs(); + log.info("创建目录...{}...{}",mkdirs,filePath); + } + String newFilePath = filePath.replace(".pdf","-g.pdf"); + PdfImageSignetUtil.imageWaterMark(filePath, newFilePath, signets.get(0).getSignetPath().replace(ProfileConfig.profile, ProfileConfig.profilePath),SignetKeyEnums.GROUP_SIGN.getCode()); + proProjectInfoSubdeptsUsers.setEduFilePath(newFilePath); + proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers); } /** @@ -867,6 +896,23 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu @Override public void approveSubDeptsUserProSign(Long id){ ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(id); + String filePath = proProjectInfoSubdeptsUsers.getEduFilePath().replace(ProfileConfig.profile, ProfileConfig.profilePath); + BasSignet query = new BasSignet(); + query.setProjectId(proProjectInfoSubdeptsUsers.getProjectId()); + query.setUserId(SecurityUtils.getUserId()); + List signets = basSignetMapper.selectBasSignetList(query); + if(StringUtils.isEmpty(signets)){ + throw new ServiceException("获取签名异常"); + } + File pdfFile = org.apache.commons.io.FileUtils.getFile(filePath); + if (!pdfFile.getParentFile().exists()) { + boolean mkdirs = pdfFile.getParentFile().mkdirs(); + log.info("创建目录...{}...{}",mkdirs,filePath); + } + String newFilePath = filePath.replace(".pdf","-p.pdf"); + PdfImageSignetUtil.imageWaterMark(filePath, filePath, signets.get(0).getSignetPath().replace(ProfileConfig.profile, ProfileConfig.profilePath),SignetKeyEnums.PROJECT_SIGN.getCode()); + proProjectInfoSubdeptsUsers.setEduFilePath(newFilePath); + proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers); } /** @@ -877,6 +923,8 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu */ private Map getUserDataMap(ProProjectInfoSubdeptsUsers proSubdeptsUser,String signPath){ Map dataMap = new HashMap<>(); + dataMap.put("fProName",proSubdeptsUser.getProjectName()); + dataMap.put("fSubDeptName",proSubdeptsUser.getSubDeptName()); dataMap.put("fName",proSubdeptsUser.getUserName()); dataMap.put("fSex",proSubdeptsUser.getUserSex()); dataMap.put("fAge",StringUtils.getAgeFromIdCard(proSubdeptsUser.getCardCode())); diff --git a/yanzhu-ui-app/miniprogram/api/publics.js b/yanzhu-ui-app/miniprogram/api/publics.js index a9fc7e98..2bcaad4e 100644 --- a/yanzhu-ui-app/miniprogram/api/publics.js +++ b/yanzhu-ui-app/miniprogram/api/publics.js @@ -53,7 +53,7 @@ export function findMyTask(data) { // 获取身份证正面信息 export function findCardOcrFront(url){ return request({ - url: '/wxApi/cardOCR/front?url='+url, + url: '/manage/wxApi/cardOCR/front?url='+url, method: 'get' }) } @@ -61,7 +61,7 @@ export function findCardOcrFront(url){ // 获取身份证反面信息 export function findCardOcrBack(url){ return request({ - url: '/wxApi/cardOCR/back?url='+url, + url: '/manage/wxApi/cardOCR/back?url='+url, method: 'get' }) } diff --git a/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxml b/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxml index 2ecaf78f..470d39c6 100644 --- a/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxml +++ b/yanzhu-ui-app/miniprogram/pages/project_qr/index.wxml @@ -74,13 +74,13 @@ 法定代表人姓名 - + 法定代表人身份证号 - + @@ -144,13 +144,13 @@ 委托代理人姓名 - + 委托代理人身份证号 - + @@ -232,13 +232,13 @@ 项目经理姓名 - + 项目经理身份证号 - + @@ -250,13 +250,13 @@ 籍贯民族 - + 籍贯地址 -