|
@@ -44,9 +44,10 @@ public class OutInterfaceService {
|
|
|
private String PASUrl;
|
|
|
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
|
|
|
private final CacheUtils cacheUtils;
|
|
|
- private final LoginUtils loginUtils;
|
|
|
+ private final LoginUtils loginUtils;
|
|
|
private final ReportService reportService;
|
|
|
private final ImportTaskService importTaskService;
|
|
|
+
|
|
|
/**
|
|
|
* @title 获取验证码
|
|
|
* @description 接口来源:PCS
|
|
@@ -130,7 +131,7 @@ public class OutInterfaceService {
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
Request request = new Request.Builder()
|
|
|
.url(PCSUrl + "/permission/api/system/getPermissionList?code=" + code)
|
|
|
- .addHeader("Cookie", LoginUtils.getToken())
|
|
|
+ .addHeader("Cookie", LoginUtils.getToken())
|
|
|
.get()
|
|
|
.build();
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
@@ -168,25 +169,17 @@ public class OutInterfaceService {
|
|
|
* @title 获取所有人员(无权限控制)
|
|
|
* @description 接口来源:PCS
|
|
|
*/
|
|
|
- public String getPartPersonnelID(Integer ID)throws IOException{
|
|
|
+ public String getPartPersonnelID(Integer ID) throws IOException {
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
- Request request = new Request.Builder()
|
|
|
- .url(PCSUrl + "/permission/api/personnel/getPerson?id="+ID)
|
|
|
- .addHeader("Cookie", LoginUtils.getToken())
|
|
|
- .get()
|
|
|
- .build();
|
|
|
- return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
+ Request request = new Request.Builder()
|
|
|
+ .url(PCSUrl + "/permission/api/personnel/getPerson?id=" + ID)
|
|
|
+ .addHeader("Cookie", LoginUtils.getToken())
|
|
|
+ .get()
|
|
|
+ .build();
|
|
|
+ return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
}
|
|
|
|
|
|
public String getAllPersonnelFromPCS() throws IOException {
|
|
|
-// if(id!=null){
|
|
|
-// OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
-// Request request = new Request.Builder()
|
|
|
-// .url(PCSUrl + "/permission/api/system/getPerson?id=id")
|
|
|
-// .get()
|
|
|
-// .build();
|
|
|
-// return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
-// }
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
Request request = new Request.Builder()
|
|
|
.url(PCSUrl + "/permission/api/system/getAllPersonnel")
|
|
@@ -201,10 +194,9 @@ public class OutInterfaceService {
|
|
|
*/
|
|
|
public String getPartPersonnelFromPCS(PersonnelVO personnelVO) throws IOException {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
-if(personnelVO.getName()==null)
|
|
|
-{
|
|
|
- personnelVO.setName("");
|
|
|
-}
|
|
|
+ if (personnelVO.getName() == null) {
|
|
|
+ personnelVO.setName("");
|
|
|
+ }
|
|
|
map.put("name", personnelVO.getName());
|
|
|
map.put("tenant", personnelVO.getTenant());
|
|
|
map.put("size", personnelVO.getSize());
|
|
@@ -245,7 +237,7 @@ if(personnelVO.getName()==null)
|
|
|
public String getAllClientFromPCS() throws IOException {
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
Request request = new Request.Builder()
|
|
|
- .url(PASUrl + "/api/v2/client/getAllClient?id="+cacheUtils.getLoginUser(loginUtils.getId()).getTenantId())
|
|
|
+ .url(PASUrl + "/api/v2/client/getAllClient?id=" + cacheUtils.getLoginUser(loginUtils.getId()).getTenantId())
|
|
|
.get()
|
|
|
.build();
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
@@ -265,6 +257,7 @@ if(personnelVO.getName()==null)
|
|
|
.build();
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* @title 根据专利号获得专利信息
|
|
|
* @description 接口来源:PCS
|
|
@@ -276,9 +269,10 @@ if(personnelVO.getName()==null)
|
|
|
// .addHeader("Cookie", LoginUtils.getToken())
|
|
|
.get()
|
|
|
.build();
|
|
|
- String a=Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
+ String a = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* @title 根据专利号获得专利信息
|
|
|
* @description 接口来源:PCS
|
|
@@ -302,10 +296,10 @@ if(personnelVO.getName()==null)
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
}
|
|
|
|
|
|
- public String getPersonNameAndDepart(Integer personId ,Integer departId) throws IOException {
|
|
|
+ public String getPersonNameAndDepart(Integer personId, Integer departId) throws IOException {
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
|
Request request = new Request.Builder()
|
|
|
- .url(PCSUrl + "/permission/api/system/getPersonNameAndDepart?personId=" + personId+"&departId="+departId)
|
|
|
+ .url(PCSUrl + "/permission/api/system/getPersonNameAndDepart?personId=" + personId + "&departId=" + departId)
|
|
|
.get()
|
|
|
.build();
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
@@ -321,8 +315,8 @@ if(personnelVO.getName()==null)
|
|
|
}
|
|
|
|
|
|
public String getDictsFromPAS() throws IOException {
|
|
|
- List<String> dicts =new ArrayList<>();
|
|
|
- dicts.add(Constants.ENTERPRISE_APPLICATION_SCENARIO);
|
|
|
+ List<String> dicts = new ArrayList<>();
|
|
|
+ dicts.add(Constants.ENTERPRISE_APPLICATION_SCENARIO);
|
|
|
String param = new Gson().toJson(dicts);
|
|
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
@@ -333,22 +327,23 @@ if(personnelVO.getName()==null)
|
|
|
return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
|
|
|
}
|
|
|
|
|
|
- public String getPatentFromPAS(PatentVO patentVO,int type) throws IOException {
|
|
|
- LambdaQueryWrapper<ImportTask> queryWrapper =new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(ImportTask::getReportId,patentVO.getReportId());
|
|
|
- List<ImportTask> importTasks =importTaskService.list(queryWrapper);
|
|
|
- List<Integer> taskIds= importTasks.stream().map(ImportTask::getId).collect(Collectors.toList());
|
|
|
- Map<String,Object> map =new HashMap<>();
|
|
|
- Report report = reportService.getById(patentVO.getReportId());
|
|
|
- if(type ==0){
|
|
|
- map.put("projectId", report.getProjectId());
|
|
|
- map.put("importTaskId", taskIds);
|
|
|
- map.put("startNumber",patentVO.getStartNumber());
|
|
|
- map.put("endNumber",patentVO.getEndNumber());}
|
|
|
+ public String getPatentFromPAS(PatentVO patentVO, int type) throws IOException {
|
|
|
+ LambdaQueryWrapper<ImportTask> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(ImportTask::getReportId, patentVO.getReportId());
|
|
|
+ List<ImportTask> importTasks = importTaskService.list(queryWrapper);
|
|
|
+ List<Integer> taskIds = importTasks.stream().map(ImportTask::getId).collect(Collectors.toList());
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ Report report = reportService.getById(patentVO.getReportId());
|
|
|
+ if (type == 0) {
|
|
|
+ map.put("projectId", report.getProjectId());
|
|
|
+ map.put("importTaskId", taskIds);
|
|
|
+ map.put("startNumber", patentVO.getStartNumber());
|
|
|
+ map.put("endNumber", patentVO.getEndNumber());
|
|
|
+ }
|
|
|
map.put("size", patentVO.getSize());
|
|
|
map.put("current", patentVO.getCurrent());
|
|
|
- map.put("patentNos",patentVO.getPatentNos());
|
|
|
- map.put("notInPatentNos",patentVO.getNotInPatentNos());
|
|
|
+ map.put("patentNos", patentVO.getPatentNos());
|
|
|
+ map.put("notInPatentNos", patentVO.getNotInPatentNos());
|
|
|
JSONObject json = new JSONObject(map);
|
|
|
RequestBody requestBody = RequestBody.create(JSON, String.valueOf(json));
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
@@ -360,18 +355,18 @@ if(personnelVO.getName()==null)
|
|
|
}
|
|
|
|
|
|
public String getComPatentNos(PatentVO patentVO) throws IOException {
|
|
|
- LambdaQueryWrapper<ImportTask> queryWrapper =new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(ImportTask::getReportId,patentVO.getReportId());
|
|
|
- Map<String,Object> map =new HashMap<>();
|
|
|
- Report report = reportService.getById(patentVO.getReportId());
|
|
|
- map.put("projectId", report.getProjectId());
|
|
|
- List<ImportTask> importTasks = importTaskService.list(queryWrapper);
|
|
|
- List<Integer> taskIds = importTasks.stream().map(ImportTask::getId).collect(Collectors.toList());
|
|
|
- map.put("importTaskId", taskIds);
|
|
|
+ LambdaQueryWrapper<ImportTask> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(ImportTask::getReportId, patentVO.getReportId());
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ Report report = reportService.getById(patentVO.getReportId());
|
|
|
+ map.put("projectId", report.getProjectId());
|
|
|
+ List<ImportTask> importTasks = importTaskService.list(queryWrapper);
|
|
|
+ List<Integer> taskIds = importTasks.stream().map(ImportTask::getId).collect(Collectors.toList());
|
|
|
+ map.put("importTaskId", taskIds);
|
|
|
|
|
|
- map.put("startNumber",patentVO.getStartNumber());
|
|
|
- map.put("endNumber",patentVO.getEndNumber());
|
|
|
- map.put("patentNos",patentVO.getPatentNos());
|
|
|
+ map.put("startNumber", patentVO.getStartNumber());
|
|
|
+ map.put("endNumber", patentVO.getEndNumber());
|
|
|
+ map.put("patentNos", patentVO.getPatentNos());
|
|
|
JSONObject json = new JSONObject(map);
|
|
|
RequestBody requestBody = RequestBody.create(JSON, String.valueOf(json));
|
|
|
OkHttpClient okHttpClient = new OkHttpClient();
|
|
@@ -386,7 +381,7 @@ if(personnelVO.getName()==null)
|
|
|
OkHttpClient httpClient = new OkHttpClient.Builder()
|
|
|
.pingInterval(40, TimeUnit.SECONDS) // 设置 PING 帧发送间隔
|
|
|
.build();
|
|
|
- String param = new Gson().toJson(taskParams);
|
|
|
+ String param = new Gson().toJson(taskParams);
|
|
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
|
|
|
Request request = new Request.Builder()
|
|
|
.url(PASUrl + "/api/v2/project/import/sysPatent")
|