|
@@ -16,14 +16,10 @@ public class sending<T> {
|
|
|
@Autowired
|
|
|
private BpmProperties bpmProperties;
|
|
|
|
|
|
-
|
|
|
// 创建RestTemplate实例
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|
|
- /**
|
|
|
- * 执行流程排产
|
|
|
- */
|
|
|
- public HttpStatus sendCommonUpdate(T param) {
|
|
|
+ public HttpStatus sendCommonPOST(String url, T param) {
|
|
|
// 得到当前用户的token 下发流程请求需要携带
|
|
|
String token = SecurityUtils.getLoginUser().getToken();
|
|
|
// 设置请求头
|
|
@@ -34,7 +30,7 @@ public class sending<T> {
|
|
|
// 将请求体和请求头添加到HttpEntity
|
|
|
HttpEntity<Map<String, Object>> requestEntity = (HttpEntity<Map<String, Object>>) new HttpEntity<>(param, headers);
|
|
|
// 发送POST请求
|
|
|
- ResponseEntity<String> response = restTemplate.exchange(bpmProperties.formCommonUpdateIp, HttpMethod.PUT, requestEntity, String.class);
|
|
|
+ ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class);
|
|
|
// 处理响应
|
|
|
if (response.getStatusCode().is2xxSuccessful()) {
|
|
|
String responseBody = response.getBody();
|
|
@@ -44,4 +40,13 @@ public class sending<T> {
|
|
|
return response.getStatusCode();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 执行流程排产
|
|
|
+ */
|
|
|
+ public HttpStatus sendCommonUpdate(T param) {
|
|
|
+ return this.sendCommonPOST(bpmProperties.formCommonUpdateIp, param);
|
|
|
+ }
|
|
|
+
|
|
|
}
|