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 forEntity = restTemplate.getForEntity(url, String.class); + log.info(forEntity.getBody()); + + return forEntity.getBody(); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java index a5dadb6..f85c7ad 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java @@ -149,9 +149,10 @@ public class ApplicationManage { } List projectCodes = page.getRecords().stream().map(Project::getProjectCode).collect(Collectors.toList()); - //要去查询应用 + //要去查询应用 此阶段 必定是 建设方案后的 所以直接查 建设方案的应用 List apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .in(ProjectApplication::getProjectCode, projectCodes)); + .in(ProjectApplication::getProjectCode, projectCodes) + .eq(ProjectApplication::getIsConstruct,Boolean.TRUE)); Map> appMap = apps.stream().collect(Collectors.groupingBy(ProjectApplication::getProjectCode)); List res = page.getRecords().stream().map(p -> { ProjectDetailVO vo = BeanUtil.copyProperties(p,ProjectDetailVO.class); diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest3.java b/pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest3.java new file mode 100644 index 0000000..27e870c --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest3.java @@ -0,0 +1,43 @@ +package com.ningdatech.pmapi.irs; + +import com.ningdatech.pmapi.common.util.CryptUtils; +import com.ningdatech.pmapi.common.util.HttpUtil; +import org.junit.Test; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.web.client.RestTemplate; + +import java.security.NoSuchAlgorithmException; +import java.util.Objects; + +/** + * @Classname irsTest3 + * @Description + * @Date 2023/7/25 9:52 + * @Author PoffyZhang + */ +public class irsTest3 { + + @Test + public void test1() 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; + + ResponseEntity forEntity = restTemplate.getForEntity(url, String.class); + System.out.println(forEntity.getBody()); + } + +}