|
@@ -17,6 +17,8 @@ import nckd.jimin.jyyy.hr.wtc.wtis.util.DingTalkSyncUtil;
|
|
|
import org.apache.commons.net.util.Base64;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.time.Duration;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
@@ -72,6 +74,18 @@ public class MokaApiUtil {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ public static JSONObject doKingdeePostByHttpClient(String url, JSONObject bodyData) throws IOException {
|
|
|
+ Map<String, String> headers = new HashMap();
|
|
|
+ headers.put("Content-Type", "application/json");
|
|
|
+ headers.put("Accept", "*/*");
|
|
|
+ logger.info(String.format("url[%s],data[%s]", url, bodyData.toJSONString()));
|
|
|
+ System.out.println(String.format("url[%s],data[%s]", url, bodyData.toJSONString()));
|
|
|
+ String responseEntify = HttpClientUtils.postjson(url, headers, bodyData.toJSONString(), 10000, 10000);
|
|
|
+ logger.info(responseEntify);
|
|
|
+ JSONObject result = (JSONObject)JSONObject.parse(responseEntify);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 新增调用日志
|
|
@@ -145,5 +159,17 @@ public class MokaApiUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 按分钟漂移
|
|
|
+ * @param offset
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static LocalDateTime offsetMinute(int offset) {
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ Duration fiveMinutes = Duration.ofMinutes(offset);
|
|
|
+ LocalDateTime fiveMinutesAgo = now.minus(fiveMinutes);
|
|
|
+ return fiveMinutesAgo;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|