From 8a73fec746fc5285448cc43065ac84022c8c1b00 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 25 Jul 2023 15:05:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BB=BA=E8=AE=BE=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E7=9A=84=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ding/controller/DingInfoPullController.java | 33 +++++++++++++++++ .../pmapi/projectlib/manage/ApplicationManage.java | 5 ++- .../java/com/ningdatech/pmapi/irs/irsTest3.java | 43 ++++++++++++++++++++++ 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest3.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java index 2107e02..714edf3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java @@ -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; /** *
@@ -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