|
@@ -16,6 +16,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.*;
|
|
import org.springframework.http.*;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.util.LinkedMultiValueMap;
|
|
|
|
+import org.springframework.util.MultiValueMap;
|
|
import org.springframework.web.client.RestTemplate;
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -150,15 +152,24 @@ public class WorkflowServiceImpl {
|
|
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
|
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
|
|
headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
|
|
headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
|
|
headers.add("code", request.getHeader("code"));
|
|
headers.add("code", request.getHeader("code"));
|
|
-// MultiValueMap<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(todoTask), LinkedMultiValueMap.class);
|
|
|
|
- Map<String, String> map = new LinkedHashMap<>();
|
|
|
|
- map.put("iamCode", todoTask.getIamCode());
|
|
|
|
- map.put("order", todoTask.getOrder());
|
|
|
|
- map.put("sort", todoTask.getSort());
|
|
|
|
- map.put("offset", todoTask.getOffset());
|
|
|
|
- map.put("limit", todoTask.getLimit());
|
|
|
|
- HttpEntity<Map> param = new HttpEntity<>(map, headers);
|
|
|
|
- ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
|
|
|
|
|
|
+ headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
|
|
|
+ MultiValueMap<String, Object> map= new LinkedMultiValueMap<String, Object>();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// Map<String, String> map = new LinkedHashMap<>();
|
|
|
|
+ map.add("iamCode", todoTask.getIamCode());
|
|
|
|
+ map.add("order", todoTask.getOrder());
|
|
|
|
+// map.add("sort", todoTask.getSort());
|
|
|
|
+ map.add("offset", (todoTask.getOffset()-1)*todoTask.getLimit());
|
|
|
|
+ map.add("limit", todoTask.getLimit());
|
|
|
|
+
|
|
|
|
+// HttpEntity<Map> param = new HttpEntity<>(map, headers);
|
|
|
|
+// ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
|
|
|
|
+
|
|
|
|
+ HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(map, headers);
|
|
|
|
+ // 执行HTTP请求
|
|
|
|
+ ResponseEntity<String> responseEntity2 = restTemplate.postForEntity(imaConfig.getFlowUrl() + "/bpm/my/todoTaskList", requestEntity, String.class);
|
|
|
|
+
|
|
log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
//
|
|
//
|
|
if (200 == responseEntity2.getStatusCodeValue()) {
|
|
if (200 == responseEntity2.getStatusCodeValue()) {
|
|
@@ -194,11 +205,11 @@ public class WorkflowServiceImpl {
|
|
headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
|
|
headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
|
|
headers.add("code", request.getHeader("code"));
|
|
headers.add("code", request.getHeader("code"));
|
|
// MultiValueMap<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(todoTask), LinkedMultiValueMap.class);
|
|
// MultiValueMap<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(todoTask), LinkedMultiValueMap.class);
|
|
- Map<String, String> map = new LinkedHashMap<>();
|
|
|
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
map.put("iamCode", todoTask.getIamCode());
|
|
map.put("iamCode", todoTask.getIamCode());
|
|
map.put("order", todoTask.getOrder());
|
|
map.put("order", todoTask.getOrder());
|
|
- map.put("sort", todoTask.getSort());
|
|
|
|
- map.put("offset", todoTask.getOffset());
|
|
|
|
|
|
+// map.put("sort", todoTask.getSort());
|
|
|
|
+ map.put("offset", (todoTask.getOffset()-1)*todoTask.getLimit());
|
|
map.put("limit", todoTask.getLimit());
|
|
map.put("limit", todoTask.getLimit());
|
|
HttpEntity<Map> param = new HttpEntity<>(map, headers);
|
|
HttpEntity<Map> param = new HttpEntity<>(map, headers);
|
|
ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
|
|
ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
|
|
@@ -215,8 +226,11 @@ public class WorkflowServiceImpl {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
result.getRows().removeAll(ds);
|
|
result.getRows().removeAll(ds);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|