当天数据导入

This commit is contained in:
2026-04-25 14:13:27 +08:00
parent 4d9e6f1ef8
commit 217422f422
16 changed files with 907 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rj.common.DictItemConstants;
import com.rj.common.PasswordUtil;
import com.rj.common.QiWeiApiConstants;
import com.rj.dto.QiWeiConfig;
import com.rj.entity.DictItem;
import com.rj.entity.QweiDepartment;
@@ -305,7 +306,7 @@ public class QweiDepartmentServiceImpl extends ServiceImpl<QweiDepartmentMapper,
}
private String getAccessToken(String corpId, String secret) throws Exception {
String url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="
String url = QiWeiApiConstants.GET_TOKEN + "?corpid="
+ URLEncoder.encode(corpId, StandardCharsets.UTF_8)
+ "&corpsecret=" + URLEncoder.encode(secret, StandardCharsets.UTF_8);
HttpRequest request = HttpRequest.newBuilder(URI.create(url)).GET().build();
@@ -319,7 +320,7 @@ public class QweiDepartmentServiceImpl extends ServiceImpl<QweiDepartmentMapper,
}
private List<QweiDepartment> fetchDepartments(String token) throws Exception {
String url = "https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token="
String url = QiWeiApiConstants.DEPARTMENT_LIST + "?access_token="
+ URLEncoder.encode(token, StandardCharsets.UTF_8);
HttpRequest request = HttpRequest.newBuilder(URI.create(url)).GET().build();
String body = HTTP_CLIENT.send(request, HttpResponse.BodyHandlers.ofString()).body();