diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/IrsController.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/IrsController.java similarity index 95% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/IrsController.java rename to pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/IrsController.java index 764267a..d783bcd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/IrsController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/IrsController.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.projectdeclared.controller; +package com.ningdatech.pmapi.irs.controller; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectdeclared.manage.IrsManage; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java index 192c97a..c805dcf 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java @@ -152,20 +152,19 @@ public class AppIrsManage { public ApiApplySearchResult searchApp(ApiApplyDTO apply) throws NoSuchAlgorithmException { long timestamp = System.currentTimeMillis(); String appCode = apply.getAppId(); - String areaCode = RegionContant.LS_SC_CODE; String requestSecret = RefreshKeyUtil.getRequestSecret(searchAppKey, searchAppScret); String sign = CryptUtils.MD5Encode(searchAppKey + requestSecret + timestamp); String url = searchUrl + "?requestTime=" + timestamp + "&sign=" + sign + "&appKey=" + searchAppKey + "&" + "pageSize=10&pageNum=1&appCode=" + appCode + - "&areaCode=" + areaCode + "&deptCode=&name="; + "&areaCode=&deptCode=&name="; log.info("url : {}",url); RestTemplate restTemplate = new RestTemplate(); ResponseEntity forEntity = restTemplate.getForEntity(url, ApiDTO.class); log.info("查询应用目录 : {}",JSON.toJSONString(forEntity)); - if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody().getData()) + if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody().getDatas()) && CollUtil.isNotEmpty(forEntity.getBody().getDatas().getApiApplySearchResult())){ return forEntity.getBody().getDatas().getApiApplySearchResult().get(0); } @@ -174,19 +173,20 @@ public class AppIrsManage { public List searchApps(ApiApplyDTO apply) throws NoSuchAlgorithmException { long timestamp = System.currentTimeMillis(); - String areaCode = RegionContant.LS_SC_CODE; + String areaCode = StringUtils.isNotBlank(apply.getAreaCode()) ? + apply.getAreaCode() : null; String requestSecret = RefreshKeyUtil.getRequestSecret(searchAppKey, searchAppScret); String sign = CryptUtils.MD5Encode(searchAppKey + requestSecret + timestamp); String url = searchUrl + "?requestTime=" + timestamp + "&sign=" + sign + - "&appKey=" + searchAppKey + "&" + - "pageSize=100&pageNum=1&areaCode=" + areaCode + + "&appKey=" + searchAppKey + "&pageSize=1000&" + + "pageNum=1&areaCode=" + areaCode + "&deptCode=&name="; RestTemplate restTemplate = new RestTemplate(); ResponseEntity forEntity = restTemplate.getForEntity(url, ApiDTO.class); log.info("查询应用目录 : {}",JSON.toJSONString(forEntity)); - if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody().getData()) + if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody().getDatas()) && CollUtil.isNotEmpty(forEntity.getBody().getDatas().getApiApplySearchResult())){ return forEntity.getBody().getDatas().getApiApplySearchResult(); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplyDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplyDTO.java index 59c85e7..47f065d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplyDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplyDTO.java @@ -2,8 +2,13 @@ package com.ningdatech.pmapi.irs.model.dto; import lombok.Data; +import java.io.Serializable; + @Data -public class ApiApplyDTO { +public class ApiApplyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + private int id; private String orgId; private String userId; @@ -21,6 +26,7 @@ public class ApiApplyDTO { private String deployType; private String principal; private String employeeCode; + private String areaCode; private String areaName; private String createTime; private String modifiedTime; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java index 168109e..53c5f02 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiApplySearchResult.java @@ -1,9 +1,18 @@ package com.ningdatech.pmapi.irs.model.dto; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; @Data -public class ApiApplySearchResult { +@AllArgsConstructor +@NoArgsConstructor +public class ApiApplySearchResult implements Serializable { + + private static final long serialVersionUID = 1L; + private int id; private String orgId; private String userId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiDTO.java index b09265e..0127367 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiDTO.java @@ -1,8 +1,11 @@ package com.ningdatech.pmapi.irs.model.dto; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import org.apache.poi.ss.formula.functions.T; +import java.io.Serializable; import java.util.List; /** @@ -12,7 +15,11 @@ import java.util.List; * @Author PoffyZhang */ @Data -public class ApiDTO { +@AllArgsConstructor +@NoArgsConstructor +public class ApiDTO implements Serializable { + private static final long serialVersionUID = 1L; + private String code; private String msg; private String data; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiSearchResult.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiSearchResult.java index 2a33fe7..a6c32dc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiSearchResult.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/ApiSearchResult.java @@ -1,11 +1,19 @@ package com.ningdatech.pmapi.irs.model.dto; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; +import java.io.Serializable; import java.util.List; @Data -public class ApiSearchResult { +@AllArgsConstructor +@NoArgsConstructor +public class ApiSearchResult implements Serializable { + + private static final long serialVersionUID = 1L; + private Boolean success; private Integer code; private String message; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/PushProjectAppToIrsDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/PushProjectAppToIrsDTO.java index 353d1fd..3f03492 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/PushProjectAppToIrsDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/model/dto/PushProjectAppToIrsDTO.java @@ -8,6 +8,7 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import java.io.Serializable; /** * @Classname PushProjectAppToIrsDto @@ -19,7 +20,8 @@ import javax.validation.constraints.NotNull; @Builder @AllArgsConstructor @NoArgsConstructor -public class PushProjectAppToIrsDTO { +public class PushProjectAppToIrsDTO implements Serializable { + private static final long serialVersionUID = 1L; @ApiModelProperty("我们系统的appId") @NotNull(message = "appId 不能为空")