|
|
@@ -7,6 +7,8 @@ import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; |
|
|
|
import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask; |
|
|
|
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; |
|
|
|
import com.ningdatech.pmapi.organization.manage.ProcDefManage; |
|
|
|
import com.ningdatech.zwdd.ZwddIntegrationProperties; |
|
|
|
import com.ningdatech.zwdd.client.provider.ZwddAuthClientProvider; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@@ -43,16 +45,13 @@ public class DingInfoPullController { |
|
|
|
@Resource(name = "refreshToken") |
|
|
|
private IRefreshTokenService refreshTokenService; |
|
|
|
|
|
|
|
@Value("${irs.interface-local-refresh.request-token-url}") |
|
|
|
private String requestTokenUrl; |
|
|
|
@Value("${irs.interface-local-refresh.refresh-token-url}") |
|
|
|
private String refreshTokenUrl; |
|
|
|
|
|
|
|
@Value("${irs.interface-refresh.request-token-url}") |
|
|
|
private String govRequestTokenUrl; |
|
|
|
@Value("${irs.interface-refresh.refresh-token-url}") |
|
|
|
private String govRefreshTokenUrl; |
|
|
|
|
|
|
|
private final ZwddIntegrationProperties zwddIntegrationProperties; |
|
|
|
|
|
|
|
@GetMapping("/employee") |
|
|
|
public void employeeBatchGet() { |
|
|
|
employeeBatchGetTask.batchGetEmployeeTask(); |
|
|
@@ -116,9 +115,8 @@ public class DingInfoPullController { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; |
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
|
String dataName = "大数据管理局"; |
|
|
|
String method = "GET"; |
|
|
|
String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl,method); |
|
|
|
String method = "POST"; |
|
|
|
String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,method); |
|
|
|
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp); |
|
|
|
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); |
|
|
|
RestTemplate restTemplate; |
|
|
@@ -128,8 +126,12 @@ public class DingInfoPullController { |
|
|
|
restTemplate = new RestTemplate(); |
|
|
|
} |
|
|
|
|
|
|
|
String url = "https://interface.ls.local/a/api/shared/1689239219101?" + |
|
|
|
"data_name=" + dataName + "&appKey=" + appKey + "&sign=" + sign + "&requestTime=" + timestamp; |
|
|
|
String url = "https://interface.zjzwfw.gov.cn/gateway" + |
|
|
|
"/api/proxy/001003001029/dataSharing/62vd5jAdM0b7Gr00.htm?" + |
|
|
|
"requestTime=" + timestamp + "&sign=" + sign + |
|
|
|
"&appKey=" + appKey + "×tamp=" + timestamp + |
|
|
|
"&authSignature=" + zwddIntegrationProperties.getAppSecret() + |
|
|
|
"&authKey=" + zwddIntegrationProperties.getAppKey(); |
|
|
|
log.info("url :{}",url); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); |
|
|
|
log.info(forEntity.getBody()); |
|
|
@@ -145,6 +147,7 @@ public class DingInfoPullController { |
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
|
String method = "POST"; |
|
|
|
String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,method); |
|
|
|
log.info("secret :{}",secret); |
|
|
|
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp); |
|
|
|
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); |
|
|
|
RestTemplate restTemplate; |
|
|
|