|
|
@@ -56,6 +56,9 @@ public class ZhongcheServiceImpl implements ZhongcheService {
|
|
|
@Autowired
|
|
|
private TBConf tbConf;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private YDConf ydConf;
|
|
|
+
|
|
|
@Value("${file.path}")
|
|
|
private String filePath;
|
|
|
|
|
|
@@ -176,6 +179,32 @@ public class ZhongcheServiceImpl implements ZhongcheService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //获取管理员审批人
|
|
|
+ String tbOperatorId = tbConf.getOperatorId();
|
|
|
+
|
|
|
+ Map param = new HashMap();
|
|
|
+ param.put("appType",ydConf.getAppType());
|
|
|
+ param.put("systemToken",ydConf.getSystemToken());
|
|
|
+ param.put("userId","yida_pub_account");
|
|
|
+ param.put("processInstanceId",formInstId);
|
|
|
+ Map jsonMap = (Map) JSONObject.parse(UtilHttp.doGet("https://api.dingtalk.com/v1.0/yida/processes/operationRecords", ddClient.initTokenHeader(), param));
|
|
|
+ List<Map> result = UtilMap.getList(jsonMap, "result");
|
|
|
+ for (Map map1 : result) {
|
|
|
+ String activityId = UtilMap.getString(map1, "activityId");
|
|
|
+
|
|
|
+ //管理员审批节点
|
|
|
+ if ("node_ocmouwh06v1".equals(activityId)){
|
|
|
+ String operatorUserId = UtilMap.getString(map1, "operatorUserId");
|
|
|
+
|
|
|
+ Map jsonMap2 = (Map) JSONObject.parse(UtilHttp.doGet("https://open.teambition.com/api/idmap/dingtalk/getTbUserId", initHeaderToken(), UtilMap.map("dingUserIds", operatorUserId)));
|
|
|
+ List<Map> result2 = UtilMap.getList(jsonMap2, "result");
|
|
|
+ if (Objects.nonNull(result2) && !result2.isEmpty()){
|
|
|
+ Map map2 = result2.get(0);
|
|
|
+ tbOperatorId = UtilMap.getString(map2, "tbUserId");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//更新任务截止时间
|
|
|
|
|
|
// 1. 转换为 Instant(UTC 时间点)
|
|
|
@@ -187,7 +216,7 @@ public class ZhongcheServiceImpl implements ZhongcheService {
|
|
|
String utcDateTime = utcTime.format(utcFormatter);
|
|
|
System.out.println("UTC date-time (比上海早8小时): " + utcDateTime); // 输出: 2026-03-20T01:30:00Z
|
|
|
|
|
|
- tbClient.updateTaskDueDate(taskId, utcDateTime, tbConf.getOperatorId());
|
|
|
+ tbClient.updateTaskDueDate(taskId, utcDateTime, tbOperatorId);
|
|
|
|
|
|
//更新任务延期次数
|
|
|
Map body = new HashMap();
|
|
|
@@ -197,7 +226,7 @@ public class ZhongcheServiceImpl implements ZhongcheService {
|
|
|
value.put("title",delayNum + 1 + "");
|
|
|
body.put("value",Arrays.asList(value));
|
|
|
|
|
|
- Map map1 = tbClient.updateTaskCustomField(taskId, tbConf.getOperatorId(), body);
|
|
|
+ Map map1 = tbClient.updateTaskCustomField(taskId, tbOperatorId, body);
|
|
|
|
|
|
log.info("map1:{}",JSONObject.toJSONString(map1));
|
|
|
|
|
|
@@ -212,7 +241,7 @@ public class ZhongcheServiceImpl implements ZhongcheService {
|
|
|
}
|
|
|
body2.put("value",value2);
|
|
|
|
|
|
- Map map2 = tbClient.updateTaskCustomField(taskId, tbConf.getOperatorId(), body2);
|
|
|
+ Map map2 = tbClient.updateTaskCustomField(taskId, tbOperatorId, body2);
|
|
|
|
|
|
log.info("map2:{}",JSONObject.toJSONString(map2));
|
|
|
|