|
|
@@ -49,6 +49,11 @@ public class DingInfoPullController { |
|
|
|
@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; |
|
|
|
|
|
|
|
@GetMapping("/employee") |
|
|
|
public void employeeBatchGet() { |
|
|
|
employeeBatchGetTask.batchGetEmployeeTask(); |
|
|
@@ -106,15 +111,15 @@ public class DingInfoPullController { |
|
|
|
return procDefManage.initByArea(areaCode); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "系统流程配置初始化", notes = "系统流程配置初始化") |
|
|
|
@ApiOperation(value = "省级主管接口测试", notes = "省级主管接口测试") |
|
|
|
@GetMapping("/test-org") |
|
|
|
public String testOrg() throws NoSuchAlgorithmException { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; |
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
|
String dataName = "大数据管理局"; |
|
|
|
|
|
|
|
String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl); |
|
|
|
String method = "GET"; |
|
|
|
String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl,method); |
|
|
|
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp); |
|
|
|
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); |
|
|
|
RestTemplate restTemplate; |
|
|
@@ -132,4 +137,31 @@ public class DingInfoPullController { |
|
|
|
|
|
|
|
return forEntity.getBody(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "测试项目归并", notes = "测试项目归并") |
|
|
|
@GetMapping("/test-guibing") |
|
|
|
public String testGuibing() throws NoSuchAlgorithmException { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; |
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
|
String dataName = "大数据管理局"; |
|
|
|
String method = "POST"; |
|
|
|
String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl,method); |
|
|
|
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp); |
|
|
|
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); |
|
|
|
RestTemplate restTemplate; |
|
|
|
if(Objects.nonNull(factory)){ |
|
|
|
restTemplate = new RestTemplate(factory); |
|
|
|
}else{ |
|
|
|
restTemplate = new RestTemplate(); |
|
|
|
} |
|
|
|
|
|
|
|
String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/" + |
|
|
|
"dataSharing/5crv7i4727abLCv0.htm?requestTime=1494485467272&sign=11b39a2989f781d9a7eb50abeaeaac53&appKey=7520d721086111e7985b008cfaeb3d74&capCode=abc&appId=abc&capTime=abc"; |
|
|
|
log.info("url :{}",url); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); |
|
|
|
log.info(forEntity.getBody()); |
|
|
|
|
|
|
|
return forEntity.getBody(); |
|
|
|
} |
|
|
|
} |