|
@@ -2,6 +2,7 @@ package com.ruoyi.common.utils.http;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.ruoyi.common.config.bpm.BpmProperties;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.*;
|
|
@@ -88,6 +89,7 @@ public class Sending<T> {
|
|
|
// 将请求体和请求头添加到 HttpEntity
|
|
|
HttpEntity<Object> requestEntity = new HttpEntity<>(param, headers);
|
|
|
// 发送请求
|
|
|
+ System.err.println(url);
|
|
|
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.resolve(httpMethod), requestEntity, String.class);
|
|
|
// 返回响应
|
|
|
return response;
|
|
@@ -142,5 +144,50 @@ public class Sending<T> {
|
|
|
return this.sendCommon(bpmProperties.queryUserExistsByUserIdsIp, "GET", param);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * FORM_共通批量新增接口
|
|
|
+ */
|
|
|
+ public ResponseEntity sendCommonInsert(T param) {
|
|
|
+ return this.sendCommon(bpmProperties.formCommonInsertIp, "POST", param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据fid获取表单详情接口
|
|
|
+ */
|
|
|
+ public ResponseEntity sendGetFormInfo(Long fId) {
|
|
|
+ // 得到当前用户的token 下发流程请求需要携带
|
|
|
+ String token = SecurityUtils.getLoginUser().getToken();
|
|
|
+ // 设置请求头
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.set("Authorization", "XIAFA" + token);
|
|
|
+ HttpEntity request = new HttpEntity(headers);
|
|
|
+ ResponseEntity<AjaxResult> response = restTemplate.exchange(
|
|
|
+ bpmProperties.formGetFormInfoIp,
|
|
|
+ HttpMethod.GET,
|
|
|
+ request,
|
|
|
+ AjaxResult.class,
|
|
|
+ fId
|
|
|
+ );
|
|
|
+ return response;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据fid获取表格组详情接口
|
|
|
+ */
|
|
|
+ public ResponseEntity sendGetGroupInfo(String groupKey) {
|
|
|
+ // 得到当前用户的token 下发流程请求需要携带
|
|
|
+ String token = SecurityUtils.getLoginUser().getToken();
|
|
|
+ // 设置请求头
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.set("Authorization", "XIAFA" + token);
|
|
|
+ HttpEntity request = new HttpEntity(headers);
|
|
|
+ ResponseEntity<AjaxResult> response = restTemplate.exchange(
|
|
|
+ bpmProperties.getFormGetGroupInfoIp(),
|
|
|
+ HttpMethod.GET,
|
|
|
+ request,
|
|
|
+ AjaxResult.class,
|
|
|
+ groupKey
|
|
|
+ );
|
|
|
+ return response;
|
|
|
+ }
|
|
|
}
|