|
@@ -47,7 +47,36 @@ public class SaasWebServiceImpl {
|
|
|
puser.put("userId", USERID);
|
|
|
puser.put("loginDevice", LOGINDEVICE);
|
|
|
param.put("puser", puser);
|
|
|
- param.put("groupCode",systemCode);
|
|
|
+ param.put("groupCode", systemCode);
|
|
|
+ if (!CollectionUtils.isEmpty(projectIdList)) {
|
|
|
+ param.put("projectIds", projectIdList);
|
|
|
+ }
|
|
|
+ String resultStr = saasWebClient.queryInUseProjectsByIds(param.toJSONString());
|
|
|
+ JSONObject parseObject = JSONObject.parseObject(resultStr);
|
|
|
+ if ("failure".equals(parseObject.getString("result"))) {
|
|
|
+ throw new Exception("查询分区失败:" + parseObject.getString("reson"));
|
|
|
+ }
|
|
|
+ List<ProjectDTO> result = new ArrayList<>();
|
|
|
+ JSONArray jsonArray = parseObject.getJSONArray("content");
|
|
|
+ if (jsonArray == null || jsonArray.isEmpty()) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (Object object : jsonArray) {
|
|
|
+ JSONObject obj = (JSONObject) object;
|
|
|
+ ProjectDTO projectDTO = ProjectDTO.builder().projectId(obj.getString("projectId")).projectLocalId(obj.getString("projectLocalID")).build();
|
|
|
+ result.add(projectDTO);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<ProjectDTO> queryProjectFromEmsSaasWeb(List<String> projectIdList) throws Exception {
|
|
|
+ JSONObject param = new JSONObject();
|
|
|
+ JSONObject puser = new JSONObject();
|
|
|
+ puser.put("userId", USERID);
|
|
|
+ puser.put("loginDevice", LOGINDEVICE);
|
|
|
+ param.put("puser", puser);
|
|
|
+ param.put("groupCode", systemCode);
|
|
|
if (!CollectionUtils.isEmpty(projectIdList)) {
|
|
|
param.put("projectIds", projectIdList);
|
|
|
}
|
|
@@ -77,7 +106,7 @@ public class SaasWebServiceImpl {
|
|
|
puser.put("loginDevice", LOGINDEVICE);
|
|
|
puser.put("pd", DEFAULT_PD);
|
|
|
param.put("puser", puser);
|
|
|
- param.put("groupCode",systemCode);
|
|
|
+ param.put("groupCode", systemCode);
|
|
|
param.put("projectId", projectId);
|
|
|
String resultStr = saasWebClient.getProjectByIdService(param.toJSONString());
|
|
|
JSONObject parseObject = JSONObject.parseObject(resultStr);
|