|
@@ -222,11 +222,14 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
|
|
|
body.put("form",form);
|
|
|
|
|
|
Map document = JSONObject.parseObject(UtilHttp.doPost(stEkbConfig.getPreUrl() + ("/api/openapi/v2.2/flow/data"), null, param, body));
|
|
|
+ Map flow = (Map) document.get("flow");
|
|
|
+ String flowId = flow.get("id").toString();
|
|
|
|
|
|
Shantai shantai = new Shantai();
|
|
|
shantai.setProcInstId(procInstId);
|
|
|
shantai.setState("3");
|
|
|
shantai.setUserId(userId);
|
|
|
+ shantai.setFlowId(flowId);
|
|
|
shantaiMapper.insert(shantai);
|
|
|
|
|
|
log.info("新增单据成功:{}",document);
|
|
@@ -254,16 +257,18 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
|
|
|
if (Objects.isNull(userId)){
|
|
|
userId = map.get("userId").toString();
|
|
|
}
|
|
|
+ //上传钉盘目前设置为管理员
|
|
|
+ String unionId = operatorUnionId;
|
|
|
|
|
|
- DDR_New ddrNew = (DDR_New) UtilHttp.doPost("https://oapi.dingtalk.com/topapi/v2/user/get", null, ddClient.initTokenParams(), UtilMap.map("userid", userId), DDR_New.class);
|
|
|
+ /*DDR_New ddrNew = (DDR_New) UtilHttp.doPost("https://oapi.dingtalk.com/topapi/v2/user/get", null, ddClient.initTokenParams(), UtilMap.map("userid", userId), DDR_New.class);
|
|
|
Map result = (Map) ddrNew.getResult();
|
|
|
- String unionId = "4SLghmRuGL3Gii2DHXENHlwiEiE";
|
|
|
+
|
|
|
if (Objects.nonNull(result)){
|
|
|
-// unionId = result.get("unionid").toString();
|
|
|
+ unionId = result.get("unionid").toString();
|
|
|
}else {
|
|
|
unionId = operatorUnionId;//曹艳杰
|
|
|
userId = operatorUserId;//曹艳杰
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
//获取附件上传到钉盘
|
|
|
List<String> paths = (List<String>) map.get("paths");
|
|
@@ -277,13 +282,14 @@ public class StDingProcServiceImpl extends ServiceImpl<ShantaiMapper, Shantai> i
|
|
|
dentries.add(dentry);
|
|
|
}catch (IOException e){
|
|
|
e.printStackTrace();
|
|
|
+ log.info("上传文件至钉盘失败:{}",e.getMessage());
|
|
|
+ return McR.errorUnknown("上传文件至钉盘失败");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
String state = map.get("state").toString();
|
|
|
|
|
|
-
|
|
|
if (Objects.nonNull(shantai) && shantai.getState().equals("2") && dentries.isEmpty()){
|
|
|
log.info("该单据Id:{}本次无水单上传,不进行同步",flowId);
|
|
|
return McR.success();
|