|
@@ -52,6 +52,9 @@ public class TaskService {
|
|
@Value("${task.info.addr}")
|
|
@Value("${task.info.addr}")
|
|
String taskInfoAddr;
|
|
String taskInfoAddr;
|
|
|
|
|
|
|
|
+ @Value("${task.distribute.url}")
|
|
|
|
+ String distributeUrl;
|
|
|
|
+
|
|
@Value("${report.host}")
|
|
@Value("${report.host}")
|
|
String reportHost ;
|
|
String reportHost ;
|
|
private final String HTTP = "http://";
|
|
private final String HTTP = "http://";
|
|
@@ -184,6 +187,19 @@ public class TaskService {
|
|
//
|
|
//
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
+ public boolean distribute(String taskId){
|
|
|
|
+ RestTemplate template = new RestTemplate();
|
|
|
|
+ String url = distributeUrl+"team/dopreteam";
|
|
|
|
+ MultiValueMap<String, Object> paramMap = new LinkedMultiValueMap<String, Object>();
|
|
|
|
+ paramMap.add("id",taskId);
|
|
|
|
+ template.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
|
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
|
+ HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<MultiValueMap<String, Object>>(paramMap,headers);
|
|
|
|
+ ResponseEntity<String> response2 = template.postForEntity(url, httpEntity, String.class);
|
|
|
|
+ JSONArray tasksJson = JSON.parseArray(response2.getBody());
|
|
|
|
+ return tasksJson != null;
|
|
|
|
+ }
|
|
|
|
+
|
|
private int [] getGradeInt(JSONObject jsonObject){
|
|
private int [] getGradeInt(JSONObject jsonObject){
|
|
int [] res = new int[11];
|
|
int [] res = new int[11];
|
|
for (int i = 0 ; i < 11 ; i++ ){
|
|
for (int i = 0 ; i < 11 ; i++ ){
|