|
|
@@ -1,5 +1,7 @@ |
|
|
|
package com.ningdatech.pmapi.ding.controller; |
|
|
|
|
|
|
|
import com.ningdatech.pmapi.common.util.CryptUtils; |
|
|
|
import com.ningdatech.pmapi.common.util.HttpUtil; |
|
|
|
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; |
|
|
|
import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask; |
|
|
|
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; |
|
|
@@ -7,7 +9,13 @@ import com.ningdatech.pmapi.organization.manage.ProcDefManage; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
import java.security.NoSuchAlgorithmException; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
/** |
|
|
|
* <p> |
|
|
@@ -86,4 +94,29 @@ public class DingInfoPullController { |
|
|
|
public String initByArea(@PathVariable String areaCode) { |
|
|
|
return procDefManage.initByArea(areaCode); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "系统流程配置初始化", notes = "系统流程配置初始化") |
|
|
|
@GetMapping("/test-org") |
|
|
|
public String testOrg() throws NoSuchAlgorithmException { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; |
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
|
String dataName = "大数据管理局"; |
|
|
|
String sign = CryptUtils.MD5Encode(appKey + appSecret + timestamp); |
|
|
|
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); |
|
|
|
RestTemplate restTemplate; |
|
|
|
if(Objects.nonNull(factory)){ |
|
|
|
restTemplate = new RestTemplate(factory); |
|
|
|
}else{ |
|
|
|
restTemplate = new RestTemplate(); |
|
|
|
} |
|
|
|
|
|
|
|
String url = "https://interface.ls.local/a/api/shared/1689239219101?" + |
|
|
|
"data_name=" + dataName + "&appKey=" + appKey + "&sign=" + sign + "&requestTime=" + timestamp; |
|
|
|
log.info("url :{}",url); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); |
|
|
|
log.info(forEntity.getBody()); |
|
|
|
|
|
|
|
return forEntity.getBody(); |
|
|
|
} |
|
|
|
} |