From f9a92cf31011448dab2694ad4a1f2c4f071a79a4 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 20 Jul 2023 15:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ding/controller/DingInfoPullController.java | 21 ++++++++++++ .../pmapi/projectlib/manage/ProjectLibManage.java | 4 +-- .../java/com/ningdatech/pmapi/irs/IrsTest2.java | 38 ++++++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest2.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 5928655..f708e4f 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 @@ -14,6 +14,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.client.RestTemplate; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.security.NoSuchAlgorithmException; /** @@ -87,4 +89,23 @@ public class DingInfoPullController { public String init() { return procDefManage.init(); } + + @ApiOperation(value = "系统流程配置初始化", notes = "系统流程配置初始化") + @GetMapping("/test") + public String test() throws NoSuchAlgorithmException, UnsupportedEncodingException { + String appSecret = "e066f496194540afa829c66983d4710e"; + String appkey = "8fb070a1f1194b2ebffdc6f596bb8a96"; + String dataName = URLEncoder.encode("丽水市数管公司","UTF-8"); + long timestamp = System.currentTimeMillis(); + String sign = CryptUtils.MD5Encode(appkey + appSecret + timestamp); + String url = "https://interface.ls.local/a/api/shared/1689239219101?data_name=" + dataName + "&appKey=" + appkey + + "&sign=" + sign + "&requestTime=" + timestamp; + RestTemplate restTemplate = new RestTemplate(); + log.info("url:" + url); + ResponseEntity forEntity = restTemplate.getForEntity(url, String.class); + + System.out.println(JSON.toJSONString(forEntity)); + + return JSON.toJSONString(forEntity); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 6ace74a..b072ec6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -684,13 +684,13 @@ public class ProjectLibManage { // 如果是建设方案申报后的项目,过滤掉初步方案的应用信息 if (Boolean.TRUE.equals(projectInfo.getIsConstruct())){ applicationList = applications.stream() - .filter(a -> !projectIdList.contains(a.getProjectId())) + .filter(a -> !projectIdList.contains(a.getProjectCode())) .collect(Collectors.toList()); } // 如果不是,展示初步方案的应用信息 else { applicationList = applications.stream() - .filter(a -> projectIdList.contains(a.getProjectId())) + .filter(a -> projectIdList.contains(a.getProjectCode())) .collect(Collectors.toList()); } diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest2.java b/pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest2.java new file mode 100644 index 0000000..6a0f480 --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest2.java @@ -0,0 +1,38 @@ +package com.ningdatech.pmapi.irs; + +import com.alibaba.fastjson.JSON; +import com.ningdatech.pmapi.common.util.CryptUtils; +import com.ningdatech.pmapi.common.util.RefreshKeyUtil; +import org.junit.Test; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestTemplate; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.NoSuchAlgorithmException; + +/** + * @Classname IrsTest2 + * @Description + * @Date 2023/7/20 10:48 + * @Author PoffyZhang + */ +public class IrsTest2 { + + @Test + public void test() throws UnsupportedEncodingException, NoSuchAlgorithmException { + String appSecret = "e066f496194540afa829c66983d4710e"; + String appkey = "8fb070a1f1194b2ebffdc6f596bb8a96"; + String dataName = URLEncoder.encode("丽水市大数据","UTF-8"); + long timestamp = System.currentTimeMillis(); + String sign = CryptUtils.MD5Encode(appkey + appSecret + timestamp); + String url = "https://interface.ls.local/a/api/shared/1689239219101?data_name=" + dataName + "&appKey=" + appkey + + "&sign=" + sign + "&requestTime=" + timestamp; + RestTemplate restTemplate = new RestTemplate(); + System.out.println("url:" + url); + ResponseEntity forEntity = restTemplate.getForEntity(url, String.class); + + System.out.println(JSON.toJSONString(forEntity)); + } + +}