|
@@ -233,8 +233,8 @@ public class DingOaServiceImpl implements DingOaService {
|
|
OapiProcessinstanceCreateRequest req = new OapiProcessinstanceCreateRequest();
|
|
OapiProcessinstanceCreateRequest req = new OapiProcessinstanceCreateRequest();
|
|
//自建应用的AgentId
|
|
//自建应用的AgentId
|
|
req.setAgentId(2121466878L);
|
|
req.setAgentId(2121466878L);
|
|
- //TODO 审批模板processCode 采购申请单TEST
|
|
|
|
- req.setProcessCode("PROC-C897D925-5856-4200-BB0E-2AC03A1CBD60");
|
|
|
|
|
|
+ //TODO 审批模板processCode 采购申请单TEST【PROC-C897D925-5856-4200-BB0E-2AC03A1CBD60】
|
|
|
|
+ req.setProcessCode("PROC-66672CF8-BFC0-4C4B-A0AF-6ED11400D80F");
|
|
//发起人userid
|
|
//发起人userid
|
|
req.setOriginatorUserId(userid);
|
|
req.setOriginatorUserId(userid);
|
|
//发起人部门id(long型)
|
|
//发起人部门id(long型)
|
|
@@ -302,6 +302,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
R r = addFile(download_url, userid);
|
|
R r = addFile(download_url, userid);
|
|
Integer FileCode = r.getCode();
|
|
Integer FileCode = r.getCode();
|
|
if (FileCode == 200){
|
|
if (FileCode == 200){
|
|
|
|
+ log.info("======将文件添加至采购审批单附件控件中======");
|
|
//上传审批附件
|
|
//上传审批附件
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo11 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo11 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
formComponentValueVoList.add(formComponentValueVo11);
|
|
formComponentValueVoList.add(formComponentValueVo11);
|
|
@@ -569,8 +570,8 @@ public class DingOaServiceImpl implements DingOaService {
|
|
OapiProcessinstanceCreateRequest req = new OapiProcessinstanceCreateRequest();
|
|
OapiProcessinstanceCreateRequest req = new OapiProcessinstanceCreateRequest();
|
|
//自建应用的AgentId
|
|
//自建应用的AgentId
|
|
req.setAgentId(2121466878L);
|
|
req.setAgentId(2121466878L);
|
|
- //TODO 审批模板processCode 销售审批合同TEST
|
|
|
|
- req.setProcessCode("PROC-67912B9E-E328-469E-BF1A-0578297B49B1");
|
|
|
|
|
|
+ //TODO 审批模板processCode 销售审批合同TEST【PROC-67912B9E-E328-469E-BF1A-0578297B49B1】
|
|
|
|
+ req.setProcessCode("PROC-E1119A1C-CEC4-402E-9DFE-6B6D9C5EB225");
|
|
//发起人userid
|
|
//发起人userid
|
|
req.setOriginatorUserId(userid);
|
|
req.setOriginatorUserId(userid);
|
|
//发起人部门id(long型)
|
|
//发起人部门id(long型)
|
|
@@ -633,29 +634,112 @@ public class DingOaServiceImpl implements DingOaService {
|
|
formComponentValueVo11.setName("唯一编码");
|
|
formComponentValueVo11.setName("唯一编码");
|
|
formComponentValueVo11.setValue(pk);
|
|
formComponentValueVo11.setValue(pk);
|
|
|
|
|
|
|
|
+ //单选框组件
|
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo12 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
|
+ formComponentValueVoList.add(formComponentValueVo12);
|
|
|
|
+ formComponentValueVo12.setName("选择用章类型");
|
|
|
|
+ formComponentValueVo12.setValue("请选择");
|
|
|
|
+
|
|
|
|
+ //单选框组件
|
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo13 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
|
+ formComponentValueVoList.add(formComponentValueVo13);
|
|
|
|
+ formComponentValueVo13.setName("对方是否已盖章");
|
|
|
|
+ formComponentValueVo13.setValue("请选择");
|
|
|
|
+
|
|
|
|
+ //单选框组件
|
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo14 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
|
+ formComponentValueVoList.add(formComponentValueVo14);
|
|
|
|
+ formComponentValueVo14.setName("是否包含血压PAD?");
|
|
|
|
+ formComponentValueVo14.setValue("请选择");
|
|
|
|
+
|
|
|
|
+ //单选框组件
|
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo15 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
|
+ formComponentValueVoList.add(formComponentValueVo15);
|
|
|
|
+ formComponentValueVo15.setName("填写血压PAD项目类型");
|
|
|
|
+ formComponentValueVo15.setValue("请选择");
|
|
|
|
+
|
|
|
|
|
|
/*调用上传附件到审批钉盘,并获取文件id接口*/
|
|
/*调用上传附件到审批钉盘,并获取文件id接口*/
|
|
|
|
|
|
- R r = addFile(download_url, userid);
|
|
|
|
- Integer FileCode = r.getCode();
|
|
|
|
- if (FileCode == 200){
|
|
|
|
|
|
+ //切分下载合同附件的地址,循环获取不同附件地址文本
|
|
|
|
+ String[] download_url_strs = download_url.split(";");//根据,切分字符串
|
|
|
|
+ Integer FileCode = null;
|
|
|
|
+ if (download_url_strs.length == 1){
|
|
|
|
+ R r = addFile(download_url_strs[0], userid);
|
|
|
|
+ FileCode = r.getCode();
|
|
|
|
+ if (FileCode == 200){
|
|
|
|
+ log.info("======将文件添加至销售审批单附件控件中======");
|
|
|
|
+ //上传审批附件
|
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo10 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
|
+ formComponentValueVoList.add(formComponentValueVo10);
|
|
|
|
+ JSONObject jsonObjectSP = new JSONObject();
|
|
|
|
+ jsonObjectSP.put("spaceId", spaceId);
|
|
|
|
+ jsonObjectSP.put("fileName", fileName);
|
|
|
|
+ jsonObjectSP.put("fileSize", fileSize);
|
|
|
|
+ jsonObjectSP.put("fileType", fileType);
|
|
|
|
+ jsonObjectSP.put("fileId", fileId);
|
|
|
|
+
|
|
|
|
+// JSONObject jsonObjectSP1 = new JSONObject();
|
|
|
|
+// jsonObjectSP1.put("spaceId", spaceId);
|
|
|
|
+// jsonObjectSP1.put("fileName", "测试");
|
|
|
|
+// jsonObjectSP1.put("fileSize", fileSize);
|
|
|
|
+// jsonObjectSP1.put("fileType", fileType);
|
|
|
|
+// jsonObjectSP1.put("fileId", fileId);
|
|
|
|
+ Object o[] = new Object[]{jsonObjectSP};//,jsonObjectSP1
|
|
|
|
+ String s = JSON.toJSONString(o);
|
|
|
|
+ formComponentValueVo10.setName("附件");
|
|
|
|
+ formComponentValueVo10.setValue(s);
|
|
|
|
+ }else {
|
|
|
|
+ String message = r.getMessage();
|
|
|
|
+ System.out.println("获取文件id失败消息:" + message);
|
|
|
|
+ }
|
|
|
|
+ }else if (download_url_strs.length ==2){
|
|
//上传审批附件
|
|
//上传审批附件
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo10 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo10 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
formComponentValueVoList.add(formComponentValueVo10);
|
|
formComponentValueVoList.add(formComponentValueVo10);
|
|
|
|
+
|
|
|
|
+ R r1 = addFile(download_url_strs[0], userid);
|
|
|
|
+ FileCode = r1.getCode();
|
|
JSONObject jsonObjectSP = new JSONObject();
|
|
JSONObject jsonObjectSP = new JSONObject();
|
|
- jsonObjectSP.put("spaceId", spaceId);
|
|
|
|
- jsonObjectSP.put("fileName", fileName);
|
|
|
|
- jsonObjectSP.put("fileSize", fileSize);
|
|
|
|
- jsonObjectSP.put("fileType", fileType);
|
|
|
|
- jsonObjectSP.put("fileId", fileId);
|
|
|
|
- Object o[] = new Object[]{jsonObjectSP};
|
|
|
|
|
|
+ if (FileCode == 200){
|
|
|
|
+ log.info("======将文件添加至销售审批单附件控件中======");
|
|
|
|
+
|
|
|
|
+ jsonObjectSP.put("spaceId", spaceId);
|
|
|
|
+ jsonObjectSP.put("fileName", fileName);
|
|
|
|
+ jsonObjectSP.put("fileSize", fileSize);
|
|
|
|
+ jsonObjectSP.put("fileType", fileType);
|
|
|
|
+ jsonObjectSP.put("fileId", fileId);
|
|
|
|
+ }else {
|
|
|
|
+ String message = r1.getMessage();
|
|
|
|
+ System.out.println("获取文件id失败消息:" + message);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ R r2 = addFile(download_url_strs[1], userid);
|
|
|
|
+ FileCode = r2.getCode();
|
|
|
|
+ JSONObject jsonObjectSP1 = new JSONObject();
|
|
|
|
+ if (FileCode == 200){
|
|
|
|
+ log.info("======将文件添加至销售审批单附件控件中======");
|
|
|
|
+
|
|
|
|
+ jsonObjectSP1.put("spaceId", spaceId);
|
|
|
|
+ jsonObjectSP1.put("fileName", fileName);
|
|
|
|
+ jsonObjectSP1.put("fileSize", fileSize);
|
|
|
|
+ jsonObjectSP1.put("fileType", fileType);
|
|
|
|
+ jsonObjectSP1.put("fileId", fileId);
|
|
|
|
+ }else {
|
|
|
|
+ String message = r1.getMessage();
|
|
|
|
+ System.out.println("获取文件id失败消息:" + message);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Object o[] = new Object[]{jsonObjectSP,jsonObjectSP1};//,jsonObjectSP1
|
|
String s = JSON.toJSONString(o);
|
|
String s = JSON.toJSONString(o);
|
|
formComponentValueVo10.setName("附件");
|
|
formComponentValueVo10.setName("附件");
|
|
formComponentValueVo10.setValue(s);
|
|
formComponentValueVo10.setValue(s);
|
|
- }else {
|
|
|
|
- String message = r.getMessage();
|
|
|
|
- System.out.println("获取文件id失败消息:" + message);
|
|
|
|
}
|
|
}
|
|
|
|
+// for(int i = 0;i < download_url_strs.length; i++){
|
|
|
|
+// System.out.println(download_url_strs[i]);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
log.info("开始创建钉钉OA审批......");
|
|
log.info("开始创建钉钉OA审批......");
|
|
req.setFormComponentValues(formComponentValueVoList);
|
|
req.setFormComponentValues(formComponentValueVoList);
|
|
@@ -839,7 +923,13 @@ public class DingOaServiceImpl implements DingOaService {
|
|
// File file = downloadFile(download_url, "D:\\pdf\\" + format);
|
|
// File file = downloadFile(download_url, "D:\\pdf\\" + format);
|
|
|
|
|
|
//【Linux端下载文件保存路径】
|
|
//【Linux端下载文件保存路径】
|
|
- File file = downloadFile(download_url, format);
|
|
|
|
|
|
+// File file = downloadFile(download_url, format);
|
|
|
|
+
|
|
|
|
+ //TODO 本地的绝对文件地址使用这个
|
|
|
|
+ download_url = "D:\\U8CPDF\\" + download_url;
|
|
|
|
+ log.info("<<<<<<拼接本地文件的绝对路径地址:" + download_url);
|
|
|
|
+
|
|
|
|
+ File file =new File(download_url.trim());
|
|
|
|
|
|
System.out.println("&&&&&&&&&&&&&&&&&" + file);
|
|
System.out.println("&&&&&&&&&&&&&&&&&" + file);
|
|
if (file != null){
|
|
if (file != null){
|
|
@@ -988,7 +1078,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
OutputStream out = connection.getOutputStream();
|
|
OutputStream out = connection.getOutputStream();
|
|
|
|
|
|
//本地上传文件路径
|
|
//本地上传文件路径
|
|
- InputStream is = new FileInputStream(new File(strFileLinux));
|
|
|
|
|
|
+ InputStream is = new FileInputStream(new File(download_url));//TODO 如果不是本地文件的绝对路径将使用这个:strFileLinux
|
|
|
|
|
|
byte[] b =new byte[1024];
|
|
byte[] b =new byte[1024];
|
|
int temp;
|
|
int temp;
|
|
@@ -1174,49 +1264,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
if (type.equals("采购订单")){
|
|
if (type.equals("采购订单")){
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
- .url("http://111.111.2.251:8081/service/wbPurchaseOrder")
|
|
|
|
- .method("POST", body)
|
|
|
|
- .addHeader("Content-Type", "application/json")
|
|
|
|
- .build();
|
|
|
|
- try {
|
|
|
|
- Response response = client.newCall(request).execute();
|
|
|
|
- System.out.println("U8C回传状态【采购订单】接口返回信息:" + JSON.toJSONString(response.body()));
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }else if (type.equals("销售订单")){
|
|
|
|
- okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
|
|
- Request request = new Request.Builder()
|
|
|
|
- .url("http://111.111.2.251:8081/service/wbSaleorder")
|
|
|
|
- .method("POST", body)
|
|
|
|
- .addHeader("Content-Type", "application/json")
|
|
|
|
- .build();
|
|
|
|
- try {
|
|
|
|
- Response response = client.newCall(request).execute();
|
|
|
|
- System.out.println("U8C回传状态【销售订单】接口返回信息:" + JSON.toJSONString(response.body()));
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else if (status.equals("RUNNING")){
|
|
|
|
- updateWrapper.eq("processid",processid);
|
|
|
|
- updateWrapper.set("status","审批中");
|
|
|
|
- stateZhizhongMapper.update(null,updateWrapper);
|
|
|
|
-
|
|
|
|
- Map map = new HashMap();
|
|
|
|
- map.put("pk",pk);
|
|
|
|
- map.put("vdef17","审批中");
|
|
|
|
- String mapStr = JSON.toJSONString(map);
|
|
|
|
- System.out.println("写入U8C回传状态接口对象:" + mapStr);
|
|
|
|
-
|
|
|
|
- log.info("开始执行回传U8C【钉钉审批】状态接口>>>>>>>>>>>");
|
|
|
|
- OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
- .build();
|
|
|
|
- MediaType mediaType = MediaType.parse("application/json");
|
|
|
|
- if (type.equals("采购订单")){
|
|
|
|
- okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
|
|
- Request request = new Request.Builder()
|
|
|
|
- .url("http://111.111.2.251:8081/service/wbPurchaseOrder")
|
|
|
|
|
|
+ .url("http://111.111.2.251:8080/service/wbPurchaseOrder")
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
.addHeader("Content-Type", "application/json")
|
|
.addHeader("Content-Type", "application/json")
|
|
.build();
|
|
.build();
|
|
@@ -1229,7 +1277,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
}else if (type.equals("销售订单")){
|
|
}else if (type.equals("销售订单")){
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
- .url("http://111.111.2.251:8081/service/wbSaleorder")
|
|
|
|
|
|
+ .url("http://111.111.2.251:8080/service/wbSaleorder")
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
.addHeader("Content-Type", "application/json")
|
|
.addHeader("Content-Type", "application/json")
|
|
.build();
|
|
.build();
|
|
@@ -1240,7 +1288,51 @@ public class DingOaServiceImpl implements DingOaService {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else if (status.equals("TERMINATED")){
|
|
|
|
|
|
+ }
|
|
|
|
+// else if (status.equals("RUNNING")){
|
|
|
|
+// updateWrapper.eq("processid",processid);
|
|
|
|
+// updateWrapper.set("status","审批中");
|
|
|
|
+// stateZhizhongMapper.update(null,updateWrapper);
|
|
|
|
+//
|
|
|
|
+// Map map = new HashMap();
|
|
|
|
+// map.put("pk",pk);
|
|
|
|
+// map.put("vdef17","审批中");
|
|
|
|
+// String mapStr = JSON.toJSONString(map);
|
|
|
|
+// System.out.println("写入U8C回传状态接口对象:" + mapStr);
|
|
|
|
+//
|
|
|
|
+// log.info("开始执行回传U8C【钉钉审批】状态接口>>>>>>>>>>>");
|
|
|
|
+// OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
+// .build();
|
|
|
|
+// MediaType mediaType = MediaType.parse("application/json");
|
|
|
|
+// if (type.equals("采购订单")){
|
|
|
|
+// okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
|
|
+// Request request = new Request.Builder()
|
|
|
|
+// .url("http://111.111.2.251:8099/service/wbPurchaseOrder")
|
|
|
|
+// .method("POST", body)
|
|
|
|
+// .addHeader("Content-Type", "application/json")
|
|
|
|
+// .build();
|
|
|
|
+// try {
|
|
|
|
+// Response response = client.newCall(request).execute();
|
|
|
|
+// System.out.println("U8C回传状态【采购订单】接口返回信息:" + JSON.toJSONString(response.body()));
|
|
|
|
+// }catch (Exception e){
|
|
|
|
+// e.printStackTrace();
|
|
|
|
+// }
|
|
|
|
+// }else if (type.equals("销售订单")){
|
|
|
|
+// okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
|
|
+// Request request = new Request.Builder()
|
|
|
|
+// .url("http://111.111.2.251:8099/service/wbSaleorder")
|
|
|
|
+// .method("POST", body)
|
|
|
|
+// .addHeader("Content-Type", "application/json")
|
|
|
|
+// .build();
|
|
|
|
+// try {
|
|
|
|
+// Response response = client.newCall(request).execute();
|
|
|
|
+// System.out.println("U8C回传状态【销售订单】接口返回信息:" + JSON.toJSONString(response.body()));
|
|
|
|
+// }catch (Exception e){
|
|
|
|
+// e.printStackTrace();
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ else if (status.equals("TERMINATED")){
|
|
updateWrapper.eq("processid",processid);
|
|
updateWrapper.eq("processid",processid);
|
|
updateWrapper.set("status","审批被终止");
|
|
updateWrapper.set("status","审批被终止");
|
|
stateZhizhongMapper.update(null,updateWrapper);
|
|
stateZhizhongMapper.update(null,updateWrapper);
|
|
@@ -1258,7 +1350,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
if (type.equals("采购订单")){
|
|
if (type.equals("采购订单")){
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
- .url("http://111.111.2.251:8081/service/wbPurchaseOrder")
|
|
|
|
|
|
+ .url("http://111.111.2.251:8080/service/wbPurchaseOrder")
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
.addHeader("Content-Type", "application/json")
|
|
.addHeader("Content-Type", "application/json")
|
|
.build();
|
|
.build();
|
|
@@ -1271,7 +1363,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
}else if (type.equals("销售订单")){
|
|
}else if (type.equals("销售订单")){
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
- .url("http://111.111.2.251:8081/service/wbSaleorder")
|
|
|
|
|
|
+ .url("http://111.111.2.251:8080/service/wbSaleorder")
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
.addHeader("Content-Type", "application/json")
|
|
.addHeader("Content-Type", "application/json")
|
|
.build();
|
|
.build();
|
|
@@ -1300,7 +1392,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
if (type.equals("采购订单")){
|
|
if (type.equals("采购订单")){
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
- .url("http://111.111.2.251:8081/service/wbPurchaseOrder")
|
|
|
|
|
|
+ .url("http://111.111.2.251:8080/service/wbPurchaseOrder")
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
.addHeader("Content-Type", "application/json")
|
|
.addHeader("Content-Type", "application/json")
|
|
.build();
|
|
.build();
|
|
@@ -1313,7 +1405,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
}else if (type.equals("销售订单")){
|
|
}else if (type.equals("销售订单")){
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
- .url("http://111.111.2.251:8081/service/wbSaleorder")
|
|
|
|
|
|
+ .url("http://111.111.2.251:8080/service/wbSaleorder")
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
.addHeader("Content-Type", "application/json")
|
|
.addHeader("Content-Type", "application/json")
|
|
.build();
|
|
.build();
|
|
@@ -1416,17 +1508,18 @@ public class DingOaServiceImpl implements DingOaService {
|
|
|
|
|
|
UpdateWrapper<StateZhizhong> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<StateZhizhong> updateWrapper = new UpdateWrapper<>();
|
|
updateWrapper.eq("processid", processid);
|
|
updateWrapper.eq("processid", processid);
|
|
- if (signStatus.equals("1")) {
|
|
|
|
- map.put("vdef17","待发起");
|
|
|
|
-
|
|
|
|
- updateWrapper.set("status", "待发起");
|
|
|
|
- stateZhizhongMapper.update(null, updateWrapper);
|
|
|
|
- } else if (signStatus.equals("2")) {
|
|
|
|
- map.put("vdef17","签署中");
|
|
|
|
-
|
|
|
|
- updateWrapper.set("status", "签署中");
|
|
|
|
- stateZhizhongMapper.update(null, updateWrapper);
|
|
|
|
- } else if (signStatus.equals("3")) {
|
|
|
|
|
|
+// if (signStatus.equals("1")) {
|
|
|
|
+// map.put("vdef17","待发起");
|
|
|
|
+//
|
|
|
|
+// updateWrapper.set("status", "待发起");
|
|
|
|
+// stateZhizhongMapper.update(null, updateWrapper);
|
|
|
|
+// } else if (signStatus.equals("2")) {
|
|
|
|
+// map.put("vdef17","签署中");
|
|
|
|
+//
|
|
|
|
+// updateWrapper.set("status", "签署中");
|
|
|
|
+// stateZhizhongMapper.update(null, updateWrapper);
|
|
|
|
+// } else
|
|
|
|
+ if (signStatus.equals("3")) {
|
|
map.put("vdef17","签署完成");
|
|
map.put("vdef17","签署完成");
|
|
|
|
|
|
updateWrapper.set("status", "签署完成");
|
|
updateWrapper.set("status", "签署完成");
|
|
@@ -1448,7 +1541,7 @@ public class DingOaServiceImpl implements DingOaService {
|
|
MediaType mediaType = MediaType.parse("application/json");
|
|
MediaType mediaType = MediaType.parse("application/json");
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
Request request = new Request.Builder()
|
|
Request request = new Request.Builder()
|
|
- .url("http://111.111.2.251:8081/service/wbSaleorder")
|
|
|
|
|
|
+ .url("http://111.111.2.251:8080/service/wbSaleorder")
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
.addHeader("Content-Type", "application/json")
|
|
.addHeader("Content-Type", "application/json")
|
|
.build();
|
|
.build();
|
|
@@ -1460,10 +1553,159 @@ public class DingOaServiceImpl implements DingOaService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// }
|
|
// }
|
|
|
|
+ }else if (type.equals("采购订单")){
|
|
|
|
+ JSONObject jsonObject = null;
|
|
|
|
+ try {
|
|
|
|
+ com.aliyun.dingtalkworkflow_1_0.Client client = createClient();
|
|
|
|
+ com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders getProcessInstanceHeaders = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders();
|
|
|
|
+ getProcessInstanceHeaders.xAcsDingtalkAccessToken = accessTokenService.getAccessToken();
|
|
|
|
+ com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest getProcessInstanceRequest = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest()
|
|
|
|
+ //审批实例id
|
|
|
|
+ .setProcessInstanceId(processid);
|
|
|
|
+ GetProcessInstanceResponse processInstanceWithOptions = client.getProcessInstanceWithOptions(getProcessInstanceRequest, getProcessInstanceHeaders, new RuntimeOptions());
|
|
|
|
+ System.out.println("*************" + JSON.toJSONString(processInstanceWithOptions.getBody()));
|
|
|
|
+ String s = JSON.toJSONString(processInstanceWithOptions.getBody());
|
|
|
|
+ jsonObject = JSON.parseObject(s);
|
|
|
|
+ System.out.println("获取审批实例详情接口object对象:" + jsonObject);
|
|
|
|
+ } catch (TeaException err) {
|
|
|
|
+ if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
|
|
|
|
+ // err 中含有 code 和 message 属性,可帮助开发定位问题
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception _err) {
|
|
|
|
+ TeaException err = new TeaException(_err.getMessage(), _err);
|
|
|
|
+ if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
|
|
|
|
+ // err 中含有 code 和 message 属性,可帮助开发定位问题
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ JSONObject result = jsonObject.getJSONObject("result");
|
|
|
|
+ JSONArray formComponentValues = result.getJSONArray("formComponentValues");
|
|
|
|
+
|
|
|
|
+ //TODO 审批单中附件的控件固定下标位置,不能随意修改
|
|
|
|
+ JSONArray value = formComponentValues.getJSONObject(8).getJSONArray("value");
|
|
|
|
+
|
|
|
|
+ //TODO 如果审批附件中存在多个附件,需要开启这个for循环用于逐条抓取附件的签署信息!!!
|
|
|
|
+// for (int j = 0; j < value.size(); j++) {
|
|
|
|
+ //如果e签宝签署了会在附件控件中有这个对象
|
|
|
|
+ JSONObject eSign = null;
|
|
|
|
+ try {
|
|
|
|
+ eSign = value.getJSONObject(0).getJSONObject("eSign");
|
|
|
|
+ System.out.println("如果e签宝签署了会在附件控件中有这个对象:" + eSign);
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if (eSign == null) {
|
|
|
|
+ System.out.println("附件还没有发起e签宝签署!");
|
|
|
|
+ } else {
|
|
|
|
+ //e签宝签署状态:1待发起 2签署中 3签署完成 4拒绝签署
|
|
|
|
+ String signStatus = eSign.getString("signStatus");
|
|
|
|
+ System.out.println("e签宝签署状态:" + signStatus);
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ map.put("pk",pk);
|
|
|
|
+ UpdateWrapper<StateZhizhong> updateWrapper = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.eq("processid", processid);
|
|
|
|
+// if (signStatus.equals("1")) {
|
|
|
|
+// map.put("vdef17","待发起");
|
|
|
|
+// updateWrapper.set("status", "待发起");
|
|
|
|
+// stateZhizhongMapper.update(null, updateWrapper);
|
|
|
|
+// } else if (signStatus.equals("2")) {
|
|
|
|
+// map.put("vdef17","签署中");
|
|
|
|
+// updateWrapper.set("status", "签署中");
|
|
|
|
+// stateZhizhongMapper.update(null, updateWrapper);
|
|
|
|
+// } else
|
|
|
|
+
|
|
|
|
+ if (signStatus.equals("3")) {
|
|
|
|
+ map.put("vdef17","签署完成");
|
|
|
|
+ updateWrapper.set("status", "签署完成");
|
|
|
|
+ stateZhizhongMapper.update(null, updateWrapper);
|
|
|
|
+ } else if (signStatus.equals("4")) {
|
|
|
|
+ map.put("vdef17","拒绝签署");
|
|
|
|
+ updateWrapper.set("status", "拒绝签署");
|
|
|
|
+ stateZhizhongMapper.update(null, updateWrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String mapStr = JSON.toJSONString(map);
|
|
|
|
+ System.out.println("写入U8C回传状态接口对象:" + mapStr);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ log.info("开始执行回传U8C【采购订单】【合同签署】状态接口>>>>>>>>>>>");
|
|
|
|
+ OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
+ .build();
|
|
|
|
+ MediaType mediaType = MediaType.parse("application/json");
|
|
|
|
+ okhttp3.RequestBody body = RequestBody.create(mediaType, mapStr);
|
|
|
|
+ Request request = new Request.Builder()
|
|
|
|
+ .url("http://111.111.2.251:8080/service/wbPurchaseOrder")
|
|
|
|
+ .method("POST", body)
|
|
|
|
+ .addHeader("Content-Type", "application/json")
|
|
|
|
+ .build();
|
|
|
|
+ try {
|
|
|
|
+ Response response = client.newCall(request).execute();
|
|
|
|
+ System.out.println("U8C回传状态【采购订单】接口返回信息:" + JSON.toJSONString(response.body()));
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
return R.ok().message("钉钉审批单合同附件签署状态同步U8C完成!");
|
|
return R.ok().message("钉钉审批单合同附件签署状态同步U8C完成!");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 表单提交时校验
|
|
|
|
+ * @param xzyzlx(连接器传参:选择用章类型)
|
|
|
|
+ * @param dfsfygz(连接器传参:对方是否已盖章)
|
|
|
|
+ * @param sfbhxypad(连接器传参:是否包含需要PAD)
|
|
|
|
+ * @param txxypadxmlx(连接器传参:填写血压PAD项目类型)
|
|
|
|
+ * @param BU(连接器传参:所属项目BU)
|
|
|
|
+// * @param hcfj(连接器传参:回传附件)
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map getJiaoYan(String xzyzlx, String dfsfygz, String sfbhxypad, String txxypadxmlx, String BU){//, String hcfj
|
|
|
|
+ System.out.println("连接器传参:选择用章类型:" + xzyzlx);
|
|
|
|
+ System.out.println("连接器传参:对方是否已盖章:" + dfsfygz);
|
|
|
|
+ System.out.println("连接器传参:是否包含需要PAD:" + sfbhxypad);
|
|
|
|
+ System.out.println("连接器传参:填写血压PAD项目类型:" + txxypadxmlx);
|
|
|
|
+ System.out.println("连接器传参:所属项目BU:" + BU);
|
|
|
|
+// System.out.println("连接器传参:回传附件:" + hcfj);
|
|
|
|
+
|
|
|
|
+// xzyzlx = "请选择";
|
|
|
|
+// dfsfygz = "请选择";
|
|
|
|
+// sfbhxypad = "请选择";
|
|
|
|
+// txxypadxmlx = "请选择";
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Boolean zhi = null;
|
|
|
|
+
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+
|
|
|
|
+ if (xzyzlx.equals("请选择")){
|
|
|
|
+ zhi = false;
|
|
|
|
+ map.put("jiaoyanxinxi","请选择【用章类型】!");
|
|
|
|
+ }else if (dfsfygz.equals("请选择")){
|
|
|
|
+ zhi = false;
|
|
|
|
+ map.put("jiaoyanxinxi","请选择【对方是否已盖章】!");
|
|
|
|
+ }else if ((BU.equals("MMC") || BU.equals("IHEC") || BU.equals("达标中心") || BU.equals("高血压达标")) && sfbhxypad.equals("请选择")){
|
|
|
|
+ zhi = false;
|
|
|
|
+ map.put("jiaoyanxinxi","请选择【是否包含需要PAD】!");
|
|
|
|
+ }else if (sfbhxypad.equals("是") && (txxypadxmlx.equals("请选择") || txxypadxmlx.equals("") || txxypadxmlx == null)){
|
|
|
|
+ zhi = false;
|
|
|
|
+ map.put("jiaoyanxinxi","请选择【填写血压PAD项目类型】!");
|
|
|
|
+ }
|
|
|
|
+// else if (xzyzlx.equals("物理章") && hcfj.equals("") || hcfj == null){
|
|
|
|
+// zhi = false;
|
|
|
|
+// map.put("jiaoyanxinxi","当前用章类型为【物理章】,请选择【回传附件】进行上传!");
|
|
|
|
+// }
|
|
|
|
+ else {
|
|
|
|
+ zhi = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ System.out.println("校验结果:" + zhi);
|
|
|
|
+
|
|
|
|
+ map.put("jiaoyanjieguo", zhi);
|
|
|
|
+
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
}
|
|
}
|