|
|
@@ -11,10 +11,6 @@ import com.malk.service.dingtalk.*;
|
|
|
import com.malk.utils.UtilHttp;
|
|
|
import com.malk.utils.UtilMap;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import okhttp3.*;
|
|
|
-import okio.BufferedSink;
|
|
|
-import okio.Okio;
|
|
|
-import okio.Sink;
|
|
|
import org.apache.commons.codec.binary.Hex;
|
|
|
import org.apache.commons.codec.digest.HmacAlgorithms;
|
|
|
import org.apache.commons.codec.digest.HmacUtils;
|
|
|
@@ -27,7 +23,6 @@ import org.springframework.stereotype.Service;
|
|
|
import java.io.*;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
-import java.text.MessageFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Slf4j
|
|
|
@@ -67,16 +62,21 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
final static String organizationCode = "b60a9c18b8cc4ecc80e30f36b4267a68";// 宁波博洋家纺集团有限公司
|
|
|
final static String host = "http://122.227.225.202:9011/";// 接口调用域名
|
|
|
final static String intranet_host = "http://11.0.11.62/";// 接口调用域名(内网)
|
|
|
- final static String signerUser = "wangze";// 签署人*/
|
|
|
+ final static String signerUser = "wangze";// 签署人
|
|
|
+ final static String uploadFileUrlHost = "http://11.0.11.62:8199/";// 返回的上传文件url host*/
|
|
|
|
|
|
//正式环境
|
|
|
final static String projectId = "1000003";// 应用ID
|
|
|
final static String secret = "5V6xsY3q8JWZ9Qik";// 应用密钥
|
|
|
- final static String businessTypeCode = "dcbf2d9db561a0e656c86177d36279cd";// 钉钉对接测试业务模板
|
|
|
+ final static String businessTypeCode = "f5e84fdb04ef4ead57f37e2a60729066";// 钉钉OA对接业务模板
|
|
|
final static String organizationCode = "0c8dd6496e7f4d228ec033aeef95a526";// 宁波博洋家纺集团有限公司
|
|
|
final static String host = "https://dzqz.beyond-it-service.com/";// 接口调用域名
|
|
|
- final static String intranet_host = "https://dzqz.beyond-it-service.com/";// 接口调用域名(内网)
|
|
|
+ final static String intranet_host = "http://11.0.11.82/";// 接口调用域名(内网)
|
|
|
final static String signerUser = "22060093";// 签署人
|
|
|
+ final static String uploadFileUrlHost = "http://11.0.11.82:8199/";// 返回的上传文件url host
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public McR eSignSubmit(Map map) {
|
|
|
@@ -326,7 +326,7 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
String signedFileName = fileName.substring(0, suffixIndex) + "(已签署)" + fileName.substring(suffixIndex);
|
|
|
|
|
|
//todo 1、评论签署后附件下载链接
|
|
|
-// comment(processInstanceId,userId,"接口测试 "+ fileName + "已签署,签署文件下载地址:" + signDownloadOuterUrl,null);
|
|
|
+// comment(processInstanceId,userId,"接口测试 "+ "已签署,签署文件下载地址:" + signDownloadOuterUrl,null);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -336,7 +336,7 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
//todo 签署后文件上传到钉盘
|
|
|
Map dentry = uploadDdFile(spaceId, parentDentryUuid, downloadPath + signedFileName, operatorUnionId);
|
|
|
//todo 审批单添加评论
|
|
|
- comment(processInstanceId,originatorUserId,"接口测试 "+ fileName + "已签署",Arrays.asList(dentry));
|
|
|
+ comment(processInstanceId,originatorUserId,fileName + "已签署",Arrays.asList(dentry));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
@@ -370,18 +370,26 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //options按label排序
|
|
|
+ options.sort(Comparator.comparing(m -> UtilMap.getString(m, "label")));
|
|
|
+
|
|
|
return McR.success(options);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void start(String processInstanceId, String signPreUrl) {
|
|
|
+ public void start(String processInstanceId,String signFlowId) {
|
|
|
try {
|
|
|
Map result = ddClient_workflow.getProcessInstanceId(ddClient.getAccessToken(), processInstanceId);
|
|
|
String originatorUserId = UtilMap.getString(result, "originatorUserId");
|
|
|
|
|
|
+ //获取签署地址列表
|
|
|
+ Map eqbData = (Map) eqbGet(host + "/esign-signs/v1/signFlow/signUrls?signFlowId=" + signFlowId);
|
|
|
+ Map signUrlInfo = ((List<Map>) UtilMap.getList(eqbData, "signUrlInfos")).get(0);
|
|
|
+
|
|
|
+ String signUrlShort = UtilMap.getString(signUrlInfo, "signUrlShort");
|
|
|
+
|
|
|
//审批单添加评论
|
|
|
- String signPreUrl2 = signPreUrl.replace(intranet_host, host);
|
|
|
- comment(processInstanceId,originatorUserId,"签署预览地址:" + signPreUrl2,null);
|
|
|
+ comment(processInstanceId,originatorUserId,"签署地址:" + signUrlShort,null);
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
@@ -566,7 +574,8 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
|
|
|
String url = UtilMap.getString(data, "url");
|
|
|
|
|
|
- url = url.replace("http://11.0.11.62:8199/",host);
|
|
|
+ url = url.replace(uploadFileUrlHost,host);
|
|
|
+
|
|
|
|
|
|
//2、上传文件到指定链接
|
|
|
Map<String,Object> body = new HashMap<>();
|
|
|
@@ -616,7 +625,9 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
header.put("Content-Type", contentType);
|
|
|
|
|
|
// 发送GET请求
|
|
|
+ log.info("eqb请求入参,url:{},header:{}",url,header);
|
|
|
String resultStr = HTTPHelper.sendGet(url, header, "UTF-8");
|
|
|
+ log.info("eqb请求响应:{}",resultStr);
|
|
|
Map result = (Map) JSONObject.parse(resultStr);
|
|
|
|
|
|
isSuccess(result);
|
|
|
@@ -647,8 +658,12 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
header.put("Accept", "*/*");
|
|
|
header.put("Content-Type", "application/json; charset=UTF-8");
|
|
|
|
|
|
+ log.info("eqb请求入参,url:{},reqBodyData:{},header:{}",url,reqBodyData,header);
|
|
|
+
|
|
|
String resultStr = HTTPHelper.sendPOST(url, reqBodyData, header, "UTF-8");
|
|
|
|
|
|
+ log.info("eqb请求响应:{}",resultStr);
|
|
|
+
|
|
|
Map result = (Map) JSONObject.parse(resultStr);
|
|
|
|
|
|
isSuccess(result);
|
|
|
@@ -672,7 +687,9 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
header.put("X-timevale-signature", reqSignature);
|
|
|
header.put("Accept", "*/*");
|
|
|
|
|
|
+ log.info("eqb请求入参,url:{},filePath:{},body:{},header:{}",url,filePath,body,header);
|
|
|
String resultStr = HTTPHelper.uploadFile(url, "file", filePath, body, header, "UTF-8");
|
|
|
+ log.info("eqb请求响应:{}",resultStr);
|
|
|
|
|
|
Map result = (Map) JSONObject.parse(resultStr);
|
|
|
|