|
@@ -63,8 +63,15 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
final static String host = "http://122.227.225.202:9011/";// 接口调用域名
|
|
final static String host = "http://122.227.225.202:9011/";// 接口调用域名
|
|
|
final static String intranet_host = "http://11.0.11.62/";// 接口调用域名(内网)
|
|
final static String intranet_host = "http://11.0.11.62/";// 接口调用域名(内网)
|
|
|
final static String signerUser = "wangze";// 签署人
|
|
final static String signerUser = "wangze";// 签署人
|
|
|
|
|
+ final static String cw_signerUser = "";// 财务签署人
|
|
|
final static String uploadFileUrlHost = "http://11.0.11.62:8199/";// 返回的上传文件url host*/
|
|
final static String uploadFileUrlHost = "http://11.0.11.62:8199/";// 返回的上传文件url host*/
|
|
|
|
|
|
|
|
|
|
+ /*//(本地)e签宝对接测试-用印申请流程节点
|
|
|
|
|
+ final static String[] activityIds = new String[]{"f0e3_8ef9","2af6_ccd3","68d8_0e65"};//e签宝签署节点id、e签宝财务签署节点id、e签宝会签签署节点id*/
|
|
|
|
|
+
|
|
|
|
|
+ //e签宝对接测试-用印申请流程节点
|
|
|
|
|
+ final static String[] activityIds = new String[]{"f0e3_8ef9","2af6_ccd3","b8e5_160a"};//e签宝签署节点id、e签宝财务签署节点id、e签宝会签签署节点id
|
|
|
|
|
+
|
|
|
//正式环境
|
|
//正式环境
|
|
|
final static String projectId = "1000003";// 应用ID
|
|
final static String projectId = "1000003";// 应用ID
|
|
|
final static String secret = "5V6xsY3q8JWZ9Qik";// 应用密钥
|
|
final static String secret = "5V6xsY3q8JWZ9Qik";// 应用密钥
|
|
@@ -73,6 +80,7 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
final static String host = "https://dzqz.beyond-it-service.com/";// 接口调用域名
|
|
final static String host = "https://dzqz.beyond-it-service.com/";// 接口调用域名
|
|
|
final static String intranet_host = "http://11.0.11.82/";// 接口调用域名(内网)
|
|
final static String intranet_host = "http://11.0.11.82/";// 接口调用域名(内网)
|
|
|
final static String signerUser = "22060093";// 签署人
|
|
final static String signerUser = "22060093";// 签署人
|
|
|
|
|
+ final static String cw_signerUser = "13586834789";// 财务签署人
|
|
|
final static String uploadFileUrlHost = "http://11.0.11.82:8199/";// 返回的上传文件url host
|
|
final static String uploadFileUrlHost = "http://11.0.11.82:8199/";// 返回的上传文件url host
|
|
|
|
|
|
|
|
|
|
|
|
@@ -93,7 +101,7 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
String url = "https://aflow.dingtalk.com/dingtalk/web/query/pchomepage.htm?from=oflow&op=true&corpid=ding76a1e955807327f7f5bf40eda33b7ba0#/plainapproval?procInstId="+processInstanceId;
|
|
String url = "https://aflow.dingtalk.com/dingtalk/web/query/pchomepage.htm?from=oflow&op=true&corpid=ding76a1e955807327f7f5bf40eda33b7ba0#/plainapproval?procInstId="+processInstanceId;
|
|
|
List<String> sealTypeCodeList = new ArrayList<>();
|
|
List<String> sealTypeCodeList = new ArrayList<>();
|
|
|
List<Map> companyList = new ArrayList<>();
|
|
List<Map> companyList = new ArrayList<>();
|
|
|
-
|
|
|
|
|
|
|
+ boolean hasFiance = false;
|
|
|
|
|
|
|
|
for (Map formComponentValue : formComponentValues) {
|
|
for (Map formComponentValue : formComponentValues) {
|
|
|
String id = UtilMap.getString(formComponentValue, "id");
|
|
String id = UtilMap.getString(formComponentValue, "id");
|
|
@@ -129,7 +137,7 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
switch (yzlx){
|
|
switch (yzlx){
|
|
|
case "公章":sealTypeCodeList.add("PUBLIC");break;
|
|
case "公章":sealTypeCodeList.add("PUBLIC");break;
|
|
|
case "合同章":sealTypeCodeList.add("CONTRACT");break;
|
|
case "合同章":sealTypeCodeList.add("CONTRACT");break;
|
|
|
- case "财务章":sealTypeCodeList.add("FINANCE");break;
|
|
|
|
|
|
|
+ case "财务章":sealTypeCodeList.add("FINANCE");hasFiance = true;break;
|
|
|
case "其他":sealTypeCodeList.add("COMMON");break;
|
|
case "其他":sealTypeCodeList.add("COMMON");break;
|
|
|
case "人事专用章":sealTypeCodeList.add("PERSONNEL");break;
|
|
case "人事专用章":sealTypeCodeList.add("PERSONNEL");break;
|
|
|
case "法人章":sealTypeCodeList.add("LEGAL-PERSON-SEAL");break;
|
|
case "法人章":sealTypeCodeList.add("LEGAL-PERSON-SEAL");break;
|
|
@@ -273,16 +281,32 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
for (int i = 0; i < companyList.size(); i++) {
|
|
for (int i = 0; i < companyList.size(); i++) {
|
|
|
Map<String, Object> signer = new HashMap<>();
|
|
Map<String, Object> signer = new HashMap<>();
|
|
|
signer.put("userType", "1");
|
|
signer.put("userType", "1");
|
|
|
|
|
+// signer.put("userCode", "FINANCE".equals(sealType) ? cw_signerUser : signerUser);
|
|
|
signer.put("userCode", signerUser);
|
|
signer.put("userCode", signerUser);
|
|
|
signer.put("organizationCode", UtilMap.getString(companyList.get(i),"key"));
|
|
signer.put("organizationCode", UtilMap.getString(companyList.get(i),"key"));
|
|
|
signer.put("signNode", 1);
|
|
signer.put("signNode", 1);
|
|
|
- signer.put("signMode", "0");
|
|
|
|
|
- signer.put("signOrder", i + 1);
|
|
|
|
|
|
|
+ if (hasFiance){
|
|
|
|
|
+ signer.put("signMode", "1");//0:顺序签 1:无序签
|
|
|
|
|
+ signer.put("signOrder", 1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ signer.put("signMode", "0");//0:顺序签 1:无序签
|
|
|
|
|
+ signer.put("signOrder", i + 1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// signer.put("sealTypeCode", String.join(",",sealTypeCodeList));
|
|
// signer.put("sealTypeCode", String.join(",",sealTypeCodeList));
|
|
|
|
|
|
|
|
signerInfos.add(signer);
|
|
signerInfos.add(signer);
|
|
|
|
|
+
|
|
|
|
|
+ if (hasFiance){
|
|
|
|
|
+ Map signer2 = new HashMap<>(signer);
|
|
|
|
|
+ signer2.put("userCode", cw_signerUser);
|
|
|
|
|
+ signer2.put("signOrder", 1);
|
|
|
|
|
+
|
|
|
|
|
+ signerInfos.add(signer2);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
requestMap.put("signerInfos", signerInfos);
|
|
requestMap.put("signerInfos", signerInfos);
|
|
|
|
|
|
|
|
// 打印结果(可选)
|
|
// 打印结果(可选)
|
|
@@ -343,22 +367,22 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
List<Map> tasks = UtilMap.getList(result, "tasks");
|
|
List<Map> tasks = UtilMap.getList(result, "tasks");
|
|
|
for (Map task : tasks) {
|
|
for (Map task : tasks) {
|
|
|
String activityId = UtilMap.getString(task, "activityId");
|
|
String activityId = UtilMap.getString(task, "activityId");
|
|
|
- //e签宝签署节点id:f0e3_8ef9
|
|
|
|
|
- if ("f0e3_8ef9".equals(activityId)){
|
|
|
|
|
- long taskId = UtilMap.getLong(task, "taskId");
|
|
|
|
|
- String userId = UtilMap.getString(task, "userId");
|
|
|
|
|
-
|
|
|
|
|
- Map body = new HashMap();
|
|
|
|
|
- body.put("processInstanceId",processInstanceId);
|
|
|
|
|
- body.put("remark","签署完成自动通过");
|
|
|
|
|
- body.put("result","agree");
|
|
|
|
|
- body.put("actionerUserId",userId);
|
|
|
|
|
- body.put("taskId",taskId);
|
|
|
|
|
-
|
|
|
|
|
- UtilHttp.doPost("https://api.dingtalk.com/v1.0/workflow/processInstances/execute", ddClient.initTokenHeader(), null, body);
|
|
|
|
|
-
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ for (String id : activityIds) {
|
|
|
|
|
+ if (id.equals(activityId)){
|
|
|
|
|
+ long taskId = UtilMap.getLong(task, "taskId");
|
|
|
|
|
+ String userId = UtilMap.getString(task, "userId");
|
|
|
|
|
+
|
|
|
|
|
+ Map body = new HashMap();
|
|
|
|
|
+ body.put("processInstanceId",processInstanceId);
|
|
|
|
|
+ body.put("remark","签署完成自动通过");
|
|
|
|
|
+ body.put("result","agree");
|
|
|
|
|
+ body.put("actionerUserId",userId);
|
|
|
|
|
+ body.put("taskId",taskId);
|
|
|
|
|
+
|
|
|
|
|
+ UtilHttp.doPost("https://api.dingtalk.com/v1.0/workflow/processInstances/execute", ddClient.initTokenHeader(), null, body);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -407,12 +431,17 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
|
|
|
|
|
//获取签署地址列表
|
|
//获取签署地址列表
|
|
|
Map eqbData = (Map) eqbGet(host + "/esign-signs/v1/signFlow/signUrls?signFlowId=" + signFlowId);
|
|
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");
|
|
|
|
|
|
|
+ List<Map> signUrlInfos = UtilMap.getList(eqbData, "signUrlInfos");
|
|
|
|
|
|
|
|
- //审批单添加评论
|
|
|
|
|
- comment(processInstanceId,originatorUserId,"签署地址:" + signUrlShort,null);
|
|
|
|
|
|
|
+ for (Map signUrlInfo : signUrlInfos) {
|
|
|
|
|
+ String userName = UtilMap.getString(signUrlInfo, "userName");
|
|
|
|
|
+ String organizationName = UtilMap.getString(signUrlInfo, "organizationName");
|
|
|
|
|
+ String signUrlShort = UtilMap.getString(signUrlInfo, "signUrlShort");
|
|
|
|
|
+
|
|
|
|
|
+ //审批单添加评论
|
|
|
|
|
+ comment(processInstanceId,originatorUserId,"签署人:" + userName + ",签署组织:" + organizationName + ",签署地址:" + signUrlShort,null);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//自动通过节点
|
|
//自动通过节点
|
|
|
List<Map> tasks = UtilMap.getList(result, "tasks");
|
|
List<Map> tasks = UtilMap.getList(result, "tasks");
|