|
@@ -28,17 +28,20 @@ public class CallApiOrgCenterServiceImpl implements CallApiOrgCenterService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public List<Map> callOrgInfo() throws IOException {
|
|
|
+ List<Map> orgList = null;
|
|
|
+ if ((Objects.isNull(dictionaryConfig.sysDomain().getAccessKey()) || Objects.equals(dictionaryConfig.sysDomain().getAccessKey(), ""))
|
|
|
+ && (Objects.isNull(dictionaryConfig.sysDomain().getAccessSecret()) || Objects.equals(dictionaryConfig.sysDomain().getAccessSecret(), ""))) {
|
|
|
+ return orgList;
|
|
|
+ }
|
|
|
String url = dictionaryConfig.orgCenterDomain().getUrl() + dictionaryConfig.orgCenterDomain().getOrgQueryApi();
|
|
|
|
|
|
- Map<String,Object> params = new HashMap<>();
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
int pageNumber = 1;
|
|
|
int pageSize = 100;
|
|
|
|
|
|
- List<Map> orgList = null;
|
|
|
-
|
|
|
- while (true){
|
|
|
- params.put("pageNumber",pageNumber);
|
|
|
- params.put("pageSize",pageSize);
|
|
|
+ while (true) {
|
|
|
+ params.put("pageNumber", pageNumber);
|
|
|
+ params.put("pageSize", pageSize);
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.orgCenterDomain().getOrgQueryApi(), timestamp, dictionaryConfig.sysDomain().getAccessKey(), dictionaryConfig.sysDomain().getAccessSecret());
|
|
|
String result = HttpUtil.post(url, params, accessToken, timestamp);
|