|
@@ -231,383 +231,4 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /*public String createSignatureContractId(){
|
|
|
- //public Map<String,Object> createSignatureContractId(){
|
|
|
- List<WorkAttachment> fileList = Lists.newArrayList();
|
|
|
- if(fileList.size()>0){
|
|
|
-
|
|
|
- //下载审定单文件
|
|
|
- String path = null;
|
|
|
- if(System.getProperty("os.name").toLowerCase().contains("win")){
|
|
|
- path = "D:/attachment-file/";
|
|
|
- }else{
|
|
|
- path = "/attachment-file/";
|
|
|
- }
|
|
|
- String aliyunUrl = Global.getAliyunUrl();
|
|
|
- String aliDownloadUrl = Global.getAliDownloadUrl();
|
|
|
-
|
|
|
- //获取文件生成的documentId
|
|
|
- List<String> documentList = Lists.newArrayList();
|
|
|
-
|
|
|
- for (WorkAttachment workattachment : fileList) {
|
|
|
- String deleteFile = null;
|
|
|
- try{
|
|
|
- if(StringUtils.isBlank(workattachment.getUrl())){
|
|
|
- return "审定单文件存储路径为空,无法进行签章操作,请驳回后重新上传审定单";
|
|
|
- }
|
|
|
-
|
|
|
- String file = workattachment.getUrl();
|
|
|
- file = file.replace("amp;","");
|
|
|
- String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
|
|
|
- String cons = "";
|
|
|
- if (file.contains(aliyunUrl)){
|
|
|
- cons = aliyunUrl;
|
|
|
- }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
|
|
|
- cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
|
|
|
- }else {
|
|
|
- cons = aliDownloadUrl;
|
|
|
- }
|
|
|
- String ossKey = file.split(cons+"/")[1];
|
|
|
- new OSSClientService().downByStreamSaveLocal(ossKey,fileName,path+fileName);
|
|
|
- //将下载下来的文件转换为file文件
|
|
|
- File srcFile = new File(path+fileName);
|
|
|
- deleteFile = path+fileName;
|
|
|
-
|
|
|
- //截取文件名称
|
|
|
- String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
|
|
|
- //截取文件后缀名
|
|
|
- String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
|
|
|
- if(!"doc".equals(substring.toLowerCase()) && !"docx".equals(substring.toLowerCase()) && !"pdf".equals(substring.toLowerCase())){
|
|
|
- return "请上传doc、docx或者pdf的文件进行签章操作";
|
|
|
- }
|
|
|
- //获取真签单的documentId
|
|
|
- HashMap hashMap = SignaturePostUtil.getDocument(srcFile);
|
|
|
- String code = hashMap.get("code").toString();
|
|
|
- String documentId = "";
|
|
|
- if("0".equals(code)){
|
|
|
- String result = hashMap.get("result").toString();
|
|
|
- HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
|
|
|
- documentId = documentIdMap.get("documentId").toString();
|
|
|
- if("".equals(documentId)){
|
|
|
- return "签章文件创建失败";
|
|
|
- }
|
|
|
- }else{
|
|
|
- String message = hashMap.get("message").toString();
|
|
|
- return message;
|
|
|
- }
|
|
|
-
|
|
|
- documentList.add(documentId);
|
|
|
-
|
|
|
- }catch (Exception e){
|
|
|
-
|
|
|
- }finally {
|
|
|
- if(StringUtils.isNotBlank(deleteFile)){
|
|
|
- //根据路径创建文件对象
|
|
|
- File file = new File(deleteFile);
|
|
|
- //路径是个文件且不为空时删除文件
|
|
|
- if(file.isFile()&&file.exists()){
|
|
|
- file.delete();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //将documentId存入数据库中
|
|
|
- projectReportData.setSignatureInvalidDocumentId(String.join(",", documentList));
|
|
|
- //根据项目id 和 documentId生成合同id
|
|
|
- HashMap contractIdHashMap = ruralProjectMessageService.getSignatureContractIdByPageSign(ruralProjectRecords.getId(), documentList);
|
|
|
- String contractIdCode = contractIdHashMap.get("code").toString();
|
|
|
- String contractId = "";
|
|
|
- if("0".equals(contractIdCode)){
|
|
|
- contractId = contractIdHashMap.get("contractId").toString();
|
|
|
- if("".equals(contractId)){
|
|
|
- return "签章文件创建失败";
|
|
|
- }
|
|
|
- contractUrl = ruralProjectMessageService.getSignatureContractUrl(contractId);
|
|
|
- System.out.println(contractUrl);
|
|
|
- }else{
|
|
|
- return contractIdHashMap.get("message").toString();
|
|
|
- }
|
|
|
- //将documentId 和contractId存储到质量复核对应的数据种
|
|
|
- //签章完成则进行数据的保存
|
|
|
- projectReportData.setSignatureFlag(1);
|
|
|
- projectReportData.setSignatureDocumentId(documentId);
|
|
|
- projectReportData.setSignatureContractId(contractId);
|
|
|
- projectReportData.setSignatureFileName(srcFileName);
|
|
|
- projectReportData.setSignatureUploadFileUser(UserUtils.getUser());
|
|
|
- projectReportData.setSignatureUploadDate(new Date());
|
|
|
- //修改签章对应信息文件
|
|
|
- projectReportDataService.updateSignatureInfo(projectReportData);
|
|
|
-
|
|
|
- //将数据信息以contractId作为key 并且有效期为1天 存储在redis中
|
|
|
- Gson gson = new Gson();
|
|
|
- String toJson = gson.toJson(projectApprovalSignature);
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(toJson)){
|
|
|
- Jedis jedis = JedisUtils.getResource();
|
|
|
- String contractIdRedis = jedis.get("qiyuesuo" + contractId);
|
|
|
- if (StringUtils.isBlank(contractIdRedis)) {
|
|
|
- //将该盖章url存放到redis 并设置1天的过期时间
|
|
|
- jedis.set("qiyuesuo" + contractId, toJson);
|
|
|
- jedis.expire("qiyuesuo" + contractId,86400);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- String auditUserListJson = gson.toJson(auditUsers);
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(auditUserListJson)){
|
|
|
- Jedis jedis = JedisUtils.getResource();
|
|
|
- String contractIdRedis = jedis.get("qiyuesuoAuditUserList" + contractId);
|
|
|
- if (StringUtils.isBlank(contractIdRedis)) {
|
|
|
- //将该盖章url存放到redis 并设置1天的过期时间
|
|
|
- jedis.set("qiyuesuoAuditUserList" + contractId, auditUserListJson);
|
|
|
- jedis.expire("qiyuesuoAuditUserList" + contractId,86400);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }else{
|
|
|
- return "审定单文件未找到,无法进行签章操作";
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- private static final String HTTPTOP = Global.getConfig("signature_http_top");
|
|
|
- private static final String COMPANYROUNDSEALID = Global.getConfig("company_round_seal_id");
|
|
|
- private static final String COMPANYROUNDSEALIDVERTICAL = Global.getConfig("company_round_seal_id_vertical");
|
|
|
- private static final String COMPANYPARTIESSEALID = Global.getConfig("company_parties_seal_id");
|
|
|
- private static final String APPROVALCATEGORYID = Global.getConfig("approval_category_id");
|
|
|
- private static final String APPROVALYCCATEGORYID = Global.getConfig("approval_YC_category_id");
|
|
|
- private static final String REPORTCATEGORYID = Global.getConfig("report_category_id");
|
|
|
- private static final String REPORTYCCATEGORYID = Global.getConfig("report_YC_category_id");
|
|
|
- private static final String JUDGEMENTCATEGORYID = Global.getConfig("judgement_category_id");
|
|
|
-
|
|
|
-
|
|
|
- *//**
|
|
|
- * 根据项目id 和 documentId生成合同id(页面签署生成)
|
|
|
- * 个人签字章功能
|
|
|
- * @param projectId
|
|
|
- * @param documentList
|
|
|
- * @return
|
|
|
- *//*
|
|
|
- public HashMap getSignatureContractIdByPageSign(String projectId, List<String> documentList){
|
|
|
- HashMap hashMap = new HashMap();
|
|
|
- Set<String> serialIdSet = new HashSet<>();
|
|
|
- //根据项目id查询项目信息
|
|
|
- RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
|
|
|
- //创建签署方信息
|
|
|
- List<Action> actions = Lists.newArrayList();
|
|
|
- Action companyAction = new Action();
|
|
|
- companyAction.setType("CORPORATE");
|
|
|
- companyAction.setName("公司印章");
|
|
|
- companyAction.setSerialNo("3");
|
|
|
- //公司圆章-竖
|
|
|
- //serialIdSet.add(COMPANYROUNDSEALIDVERTICAL);
|
|
|
- //添加盖章位置
|
|
|
- List<Location> locations = Lists.newArrayList();
|
|
|
- *//*for (String documentId: documentList) {
|
|
|
- Location location = new Location();
|
|
|
- location.setSealId(COMPANYROUNDSEALIDVERTICAL);
|
|
|
- location.setDocumentId(documentId);
|
|
|
- location.setPage("0");
|
|
|
- location.setRectType("SEAL_CORPORATE");
|
|
|
- location.setKeywordIndex(-1);
|
|
|
- location.setOffsetX("0.5264");
|
|
|
- location.setOffsetY("0.6787");
|
|
|
- locations.add(location);
|
|
|
- }*//*
|
|
|
-
|
|
|
- //根据角色信息录入签署方信息
|
|
|
- //负责人
|
|
|
- if(StringUtils.isNotBlank(principalUserId)){
|
|
|
- User user = UserUtils.get(principalUserId);
|
|
|
- if(null != user){
|
|
|
- //获取成员印章id信息
|
|
|
- String userSealId = SignaturePostUtil.getUserSealByMobile(user.getMobile(),"","江苏兴光项目管理有限公司公章");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(userSealId)){
|
|
|
- for (String documentId: documentList) {
|
|
|
- //添加盖章位置
|
|
|
- Location principalLocation = new Location();
|
|
|
- serialIdSet.add(userSealId);
|
|
|
- principalLocation.setSealId(userSealId);
|
|
|
- principalLocation.setDocumentId(documentId);
|
|
|
- principalLocation.setPage("0");
|
|
|
- principalLocation.setRectType("SEAL_CORPORATE");
|
|
|
- principalLocation.setKeywordIndex(-1);
|
|
|
- principalLocation.setOffsetX("0.5971");
|
|
|
- principalLocation.setOffsetY("0.8176");
|
|
|
- locations.add(principalLocation);
|
|
|
- }
|
|
|
- }else{
|
|
|
- hashMap.put("code","2");
|
|
|
- hashMap.put("message","查询不到江苏兴光项目管理有限公司公章信息!请联系管理员");
|
|
|
- return hashMap;
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- hashMap.put("code","2");
|
|
|
- hashMap.put("message","查询不到江苏兴光项目管理有限公司公章信息!请联系管理员");
|
|
|
- return hashMap;
|
|
|
- }
|
|
|
-
|
|
|
- List<String> serialIdList = new ArrayList<String>(serialIdSet);
|
|
|
- companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
|
|
|
- //判定该action是否采用自动签署
|
|
|
- companyAction.setAutoSign("false");
|
|
|
- companyAction.setLocations(locations);
|
|
|
- actions.add(companyAction);
|
|
|
-
|
|
|
- //创建个人职业章参数
|
|
|
- Action professionalChapterAction = new Action();
|
|
|
- professionalChapterAction.setType("PRACTICE");
|
|
|
- professionalChapterAction.setName("杨荣华个人职业章");
|
|
|
- professionalChapterAction.setSerialNo("1");
|
|
|
-
|
|
|
- //添加盖章位置
|
|
|
- List<Location> professionalChapterLocations = Lists.newArrayList();
|
|
|
-
|
|
|
- Set<String> professionalChapterSerialIdSet = new HashSet<>();
|
|
|
-
|
|
|
- //添加个人职业章人员信息
|
|
|
- ActionOperatorInfo actionOperatorInfo = new ActionOperatorInfo();
|
|
|
- actionOperatorInfo.setOperatorContact("15240492484");//个人职业章盖章人的手机号
|
|
|
- List<ActionOperatorInfo> actionOperators = Lists.newArrayList();
|
|
|
- actionOperators.add(actionOperatorInfo);
|
|
|
- professionalChapterAction.setActionOperators(actionOperators);
|
|
|
-
|
|
|
- //获取成员印章id信息
|
|
|
- long s1=System.currentTimeMillis();
|
|
|
- String userSealId = SignaturePostUtil.getUserSealByMobile("15240492484","","杨荣华个人签名");
|
|
|
- long s2=System.currentTimeMillis();
|
|
|
- System.out.println("第三个人员印章获取时间:" + (s2 - s1));
|
|
|
- if(StringUtils.isNotBlank(userSealId)){
|
|
|
- }else{
|
|
|
- hashMap.put("code","2");
|
|
|
- hashMap.put("message","查询不到项目负责人 的印章信息!请联系管理员");
|
|
|
- return hashMap;
|
|
|
- }
|
|
|
-
|
|
|
- List<String> serialIdsList = new ArrayList<String>(professionalChapterSerialIdSet);
|
|
|
- professionalChapterAction.setSealIds("[" + String.join(",", serialIdsList) + "]");
|
|
|
- professionalChapterAction.setLocations(professionalChapterLocations);
|
|
|
- net.sf.json.JSONObject professionalChapterJson = net.sf.json.JSONObject.fromObject(professionalChapterAction);
|
|
|
- System.out.println(professionalChapterJson.toString());
|
|
|
- actions.add(professionalChapterAction);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //创建个人职业章参数
|
|
|
- Action professionalChapterTwoAction = new Action();
|
|
|
- professionalChapterTwoAction.setType("PRACTICE");
|
|
|
- professionalChapterTwoAction.setName("刘建春个人职业章");
|
|
|
- professionalChapterTwoAction.setSerialNo("2");
|
|
|
-
|
|
|
- //添加盖章位置
|
|
|
- List<Location> professionalChapterTwoLocations = Lists.newArrayList();
|
|
|
-
|
|
|
- Set<String> professionalChapterTwoSerialIdSet = new HashSet<>();
|
|
|
-
|
|
|
- //添加个人职业章人员信息
|
|
|
- ActionOperatorInfo actionTwoOperatorInfo = new ActionOperatorInfo();
|
|
|
- actionTwoOperatorInfo.setOperatorContact("13398782899");
|
|
|
- List<ActionOperatorInfo> actionTwoOperators = Lists.newArrayList();
|
|
|
- actionTwoOperators.add(actionTwoOperatorInfo);
|
|
|
- professionalChapterTwoAction.setActionOperators(actionTwoOperators);
|
|
|
-
|
|
|
- //获取成员印章id信息
|
|
|
- long s3=System.currentTimeMillis();
|
|
|
- String userSealId2 = SignaturePostUtil.getUserSealByMobile("13398782899","","杨荣华个人签名章");
|
|
|
- long s4=System.currentTimeMillis();
|
|
|
- System.out.println("第四个人员印章获取时间:" + (s4 - s3));
|
|
|
-
|
|
|
- serialIdsList = new ArrayList<String>(professionalChapterTwoSerialIdSet);
|
|
|
- professionalChapterTwoAction.setSealIds("[" + String.join(",", serialIdsList) + "]");
|
|
|
- professionalChapterTwoAction.setLocations(professionalChapterTwoLocations);
|
|
|
- professionalChapterJson = net.sf.json.JSONObject.fromObject(professionalChapterTwoAction);
|
|
|
- System.out.println(professionalChapterJson.toString());
|
|
|
- actions.add(professionalChapterTwoAction);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //创建签署方信息表
|
|
|
- List<SignatorieInfo> signatories = Lists.newArrayList();
|
|
|
- SignatorieInfo signatorieInfo1 = new SignatorieInfo();
|
|
|
- signatorieInfo1.setSerialNo("1");
|
|
|
- signatorieInfo1.setTenantName("江苏兴光项目管理有限公司");
|
|
|
- signatorieInfo1.setTenantType("COMPANY");
|
|
|
- signatorieInfo1.setActions(actions);
|
|
|
- signatories.add(signatorieInfo1);
|
|
|
- SignatureContract signatureContract = new SignatureContract();
|
|
|
- signatureContract.setDocuments(documentList);
|
|
|
- //审定单用印流程id
|
|
|
- signatureContract.setCategoryId(APPROVALCATEGORYID);
|
|
|
- signatureContract.setSend(true);
|
|
|
- signatureContract.setSignatories(signatories);
|
|
|
- signatureContract.setSn("");
|
|
|
- signatureContract.setSubject(ruralProjectRecords.getProjectName());//添加项目名称
|
|
|
- net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(signatureContract);
|
|
|
- System.out.println(json.toString());
|
|
|
- long s5=System.currentTimeMillis();
|
|
|
- System.out.println(json.toString());
|
|
|
- String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
|
|
|
- long s6=System.currentTimeMillis();
|
|
|
- System.out.println("获取合同id获取时间:" + (s6 - s5));
|
|
|
- hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
|
|
|
-
|
|
|
-
|
|
|
- return hashMap;
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 审定单签章回调操作(个人职业章盖章)
|
|
|
- * @param presignCallBack 回调参数
|
|
|
- * @return
|
|
|
- */
|
|
|
- /*@RequestMapping(value = "/getApprovalCallBackCoordinates", method= RequestMethod.POST)
|
|
|
- public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack) throws Exception {
|
|
|
-
|
|
|
- Jedis jedis = JedisUtils.getResource();
|
|
|
- String contractIdRedis = jedis.get("qiyuesuo" + presignCallBack.getContractId());
|
|
|
- String auditUsersStr = jedis.get("qiyuesuoAuditUserList" + presignCallBack.getContractId());
|
|
|
- Gson gson = new Gson();
|
|
|
- ProjectApprovalSignature projectApprovalSignature1 = gson.fromJson(contractIdRedis, ProjectApprovalSignature.class);
|
|
|
-
|
|
|
- Type listType = new TypeToken<ArrayList<User>>(){}.getType();
|
|
|
- List<User> auditUserList = new Gson().fromJson(auditUsersStr, listType);
|
|
|
-
|
|
|
- //根据contractId查询对应的报告信息
|
|
|
- ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectApprovalSignature1.getProjectId());
|
|
|
-
|
|
|
- if(null == projectReportData){
|
|
|
- return null;
|
|
|
- }
|
|
|
- //根据项目id查询对应的审定单数据状态是否是已经被送审或者 是否存在值
|
|
|
- ProjectApprovalSignature projectApprovalSignature = ruralProjectMessageElectronicSealService.getProjectApprovalSignature(projectReportData.getProject().getId());
|
|
|
- projectApprovalSignature1.setCreateBy(projectApprovalSignature.getCreateBy());
|
|
|
-
|
|
|
- //对流程数据进行处理
|
|
|
- approvalSaveAudit(projectApprovalSignature1,auditUserList);
|
|
|
-
|
|
|
- return null;
|
|
|
- }*/
|
|
|
-
|
|
|
}
|