|
|
@@ -23,6 +23,9 @@ import org.springframework.stereotype.Service;
|
|
|
import java.io.*;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Slf4j
|
|
|
@@ -516,6 +519,36 @@ public class BoyangServiceImpl implements BoyangService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public McR retrySign(String businessId) {
|
|
|
+ // 前12位: 年月日时分
|
|
|
+ String datePart = businessId.substring(0, 12);
|
|
|
+ // 16-17位: 秒
|
|
|
+ String secondPart = businessId.substring(15, 17);
|
|
|
+
|
|
|
+ // 组合完整时间: 年月日时分秒
|
|
|
+ String dateTimeStr = datePart + secondPart;
|
|
|
+ LocalDateTime localDateTime = LocalDateTime.parse(dateTimeStr, DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
|
|
|
+
|
|
|
+ // 转换为时间戳(毫秒)
|
|
|
+ long startTime = localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
|
|
+ long endTime = localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() + 1000;//应对审批编号与实际时间戳存在差异情况
|
|
|
+
|
|
|
+ Map instanceIds = ddClient_workflow.getInstanceIds(ddClient.getAccessToken(), "PROC-7DF36B3B-FBAD-4DF6-B8CD-723FFA8DBEC5", startTime, endTime, null);
|
|
|
+
|
|
|
+ List<String> list = UtilMap.getList(instanceIds, "list");
|
|
|
+
|
|
|
+ if (list.size() == 1){
|
|
|
+ String processInstanceId = list.get(0);
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("processInstanceId",processInstanceId);
|
|
|
+
|
|
|
+ return eSignSubmit(map);
|
|
|
+ }else {
|
|
|
+ return McR.errorUnknown("未找到符合条件的数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//下载钉钉OA审批单附件
|
|
|
private void downloadDdFile(String processInstanceId,String fileId,String downloadPath){
|
|
|
try {
|