|
@@ -1,10 +1,17 @@ |
|
|
package com.ningdatech.pmapi.ding.controller; |
|
|
package com.ningdatech.pmapi.ding.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import com.ningdatech.pmapi.common.util.CryptUtils; |
|
|
|
|
|
import com.ningdatech.pmapi.common.util.RefreshKeyUtil; |
|
|
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; |
|
|
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; |
|
|
import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask; |
|
|
import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask; |
|
|
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; |
|
|
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
|
|
|
|
import java.security.NoSuchAlgorithmException; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* <p> |
|
|
* <p> |
|
@@ -58,4 +65,27 @@ public class DingInfoPullController { |
|
|
public void getBatchEmployeeByCode(@PathVariable String orgCode) { |
|
|
public void getBatchEmployeeByCode(@PathVariable String orgCode) { |
|
|
employeeBatchGetTask.getBatchEmployeeByCode(orgCode); |
|
|
employeeBatchGetTask.getBatchEmployeeByCode(orgCode); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/test-app") |
|
|
|
|
|
public void testApp() throws NoSuchAlgorithmException { |
|
|
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
|
|
String areaCode = "331121"; |
|
|
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
|
|
|
String appScret = "496f0f2a19994f76b4fd9dae087366c7"; |
|
|
|
|
|
|
|
|
|
|
|
String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret); |
|
|
|
|
|
String capCode = CryptUtils.MD5Encode(timestamp + areaCode); |
|
|
|
|
|
String capTime = String.valueOf(timestamp); |
|
|
|
|
|
String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp); |
|
|
|
|
|
String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/94wbaL1I1Pbz0648.htm?requestTime=" + timestamp + |
|
|
|
|
|
"&sign=" + sign + "&appKey=" + appKey + "&capCode=" + capCode + "&capTime=" + capTime + |
|
|
|
|
|
"&baseProjSys=测试应用&areaCode=331121&baseProjName=nsl-丽水演示项目&baseProjId=331100230130112233001" + |
|
|
|
|
|
"&isEffective=1&baseProjSysCode=25083657"; |
|
|
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
|
|
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); |
|
|
|
|
|
|
|
|
|
|
|
System.out.println(JSON.toJSONString(forEntity)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |