Browse Source

Merge remote-tracking branch 'origin/master'

tags/24080901
WendyYang 1 year ago
parent
commit
25201068d6
4 changed files with 79 additions and 5 deletions
  1. +33
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  2. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java
  3. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java
  4. +43
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest3.java

+ 33
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java View File

@@ -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;

/**
* <p>
@@ -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<String> forEntity = restTemplate.getForEntity(url, String.class);
log.info(forEntity.getBody());

return forEntity.getBody();
}
}

+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectStatusEnum.java View File

@@ -4,10 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* <p>


+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java View File

@@ -149,9 +149,10 @@ public class ApplicationManage {
}

List<String> projectCodes = page.getRecords().stream().map(Project::getProjectCode).collect(Collectors.toList());
//要去查询应用
//要去查询应用 此阶段 必定是 建设方案后的 所以直接查 建设方案的应用
List<ProjectApplication> apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.in(ProjectApplication::getProjectCode, projectCodes));
.in(ProjectApplication::getProjectCode, projectCodes)
.eq(ProjectApplication::getIsConstruct,Boolean.TRUE));
Map<String, List<ProjectApplication>> appMap = apps.stream().collect(Collectors.groupingBy(ProjectApplication::getProjectCode));
List<ProjectDetailVO> res = page.getRecords().stream().map(p -> {
ProjectDetailVO vo = BeanUtil.copyProperties(p,ProjectDetailVO.class);


+ 43
- 0
pmapi/src/test/java/com/ningdatech/pmapi/irs/irsTest3.java View File

@@ -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<String> forEntity = restTemplate.getForEntity(url, String.class);
System.out.println(forEntity.getBody());
}

}

Loading…
Cancel
Save