|
|
@@ -116,7 +116,7 @@ public class DingInfoPullController { |
|
|
|
|
|
|
|
@ApiOperation(value = "测试项目归并", notes = "测试项目归并") |
|
|
|
@GetMapping("/test-guibing") |
|
|
|
public String testGuibing() throws NoSuchAlgorithmException, InvalidKeyException { |
|
|
|
public String testGuibing() throws Exception { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; |
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
@@ -133,8 +133,7 @@ public class DingInfoPullController { |
|
|
|
restTemplate = new RestTemplate(); |
|
|
|
} |
|
|
|
String appId = "A330000100000202105005790"; |
|
|
|
String capCode = bytesToHex(CryptUtils.hmacMd5((timestamp + appId).getBytes(StandardCharsets.UTF_8), |
|
|
|
"bcb4fc0f517fc168ee543fcf4d231f3b".getBytes(StandardCharsets.UTF_8))); |
|
|
|
String capCode = CryptUtils.encryptHMAC(timestamp + appId, "bcb4fc0f517fc168ee543fcf4d231f3b"); |
|
|
|
String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/" + |
|
|
|
"dataSharing/5crv7i4727abLCv0.htm?requestTime=" + timestamp + |
|
|
|
"&sign=" + sign + "&appKey=" + appKey + |
|
|
@@ -148,7 +147,7 @@ public class DingInfoPullController { |
|
|
|
|
|
|
|
@ApiOperation(value = "测试项目详情推送", notes = "测试项目详情推送") |
|
|
|
@GetMapping("/test-push-project") |
|
|
|
public String testPushProject() throws NoSuchAlgorithmException, InvalidKeyException { |
|
|
|
public String testPushProject() throws Exception { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; |
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
@@ -186,8 +185,7 @@ public class DingInfoPullController { |
|
|
|
String baseManDeprtDing = "GO_9a7dce7fbaf54787998fa004f1b7c0e1"; |
|
|
|
String baseProvManDeprtDing = "GO_6c383c049d95461f9a0df780140ceb32"; |
|
|
|
String baseBasisEstablish = "中共遂昌县委办公室关于研究开发“天工”智能化管理平台(三期)的函"; |
|
|
|
String capCode = bytesToHex(CryptUtils.hmacMd5((timestamp + areaCode).getBytes(StandardCharsets.UTF_8), |
|
|
|
"bcb4fc0f517fc168ee543fcf4d231f3b".getBytes(StandardCharsets.UTF_8))); |
|
|
|
String capCode = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b"); |
|
|
|
String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/3XN9R93Pva6db7sf.htm?" + |
|
|
|
"requestTime=" + timestamp + "&sign=" + sign + |
|
|
|
"&appKey=" + appKey + "&baseProjPrincipal=" + baseProjPrincipal + "" + |
|
|
@@ -207,6 +205,13 @@ public class DingInfoPullController { |
|
|
|
return forEntity.getBody(); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String areaCode = "331123000"; |
|
|
|
String res = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b"); |
|
|
|
System.out.println(res); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 将byte数组转为十六进制字符串 |
|
|
|
* @param bytes byte数组 |
|
|
|