|
@@ -8,6 +8,7 @@ import edu.nju.model.ReviewPaperVO;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -43,6 +44,9 @@ public class ReviewPaperService {
|
|
|
@Autowired
|
|
|
ReviewGroupDao reviewGroupDao;
|
|
|
|
|
|
+ @Value("${report.port}")
|
|
|
+ String port;
|
|
|
+
|
|
|
|
|
|
public ReviewPaperJson getReviewPaperJson(String paperId) {
|
|
|
return reviewPaperJsonDao.findJsonByPaper(paperId);
|
|
@@ -288,8 +292,6 @@ public class ReviewPaperService {
|
|
|
String reportName=report.getString("name");
|
|
|
String originalId=report.getString("original_id");
|
|
|
String reportDescription=report.getString("description");
|
|
|
-// JSONArray imgUrls=report.getJSONArray("img_url");
|
|
|
-// JSONArray fileUrls=report.getJSONArray("file_url");
|
|
|
|
|
|
}
|
|
|
|
|
@@ -329,33 +331,8 @@ public class ReviewPaperService {
|
|
|
JSONArray options=item.getJSONArray("options");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-// JSONArray groupList=jsonObject.getJSONArray("group_list");
|
|
|
-// Set<String>workers=new HashSet<>();
|
|
|
-// for(int i=0;i<groupList.length();i++){
|
|
|
-// JSONObject groupObject=groupList.getJSONObject(i);
|
|
|
-// String groupName=groupObject.getString("name");
|
|
|
-// String groupDescription=groupObject.getString("description");
|
|
|
-// JSONArray workerList=groupObject.getJSONArray("worker_list");
|
|
|
-// for(int j=0;j<workerList.length();j++){
|
|
|
-// String workerId=String.valueOf(workerList.get(j));
|
|
|
-// if(workers.contains(workerId)){
|
|
|
-// throw new Exception("同一个worker不能属于不同的group");
|
|
|
-// }else{
|
|
|
-// workers.add(workerId);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// JSONArray workerReportList=groupObject.getJSONArray("report_list");
|
|
|
-// for(int j=0;j<workerReportList.length();j++){
|
|
|
-// int reportIndex= Integer.parseInt(String.valueOf(workerReportList.get(j)));
|
|
|
-// if(!reportIndexs.contains(reportIndex)){
|
|
|
-// throw new Exception("group_report_list中包含不存在的report ");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
}catch (Exception e){
|
|
|
- return e.getMessage();
|
|
|
+ return "paperJson格式不正确:"+e.getMessage();
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
@@ -397,7 +374,7 @@ public class ReviewPaperService {
|
|
|
ReviewWorker reviewWorker=reviewWorkerDao.getWorkerByOriginalId(workerIndex,jobId);
|
|
|
if(reviewWorker!=null){
|
|
|
String workerId=reviewWorker.getId();
|
|
|
- String url="http://47.99.140.117:9090/report/review/job/"+jobId+"/"+workerId+"/0";
|
|
|
+ String url="http://47.99.140.117:"+port+"/report/review/job/"+jobId+"/"+workerId+"/0";
|
|
|
return url;
|
|
|
}
|
|
|
String workerId=reviewWorkerDao.save(new ReviewWorker(workerIndex,paperId,examId,jobId));
|
|
@@ -410,7 +387,7 @@ public class ReviewPaperService {
|
|
|
workerIds.add(workerId);
|
|
|
reviewGroup.setWorkers_id(workerIds);
|
|
|
reviewGroupDao.save(reviewGroup);
|
|
|
- String url="http://47.99.140.117:9090/report/review/job/"+jobId+"/"+workerId+"/0";
|
|
|
+ String url="http://47.99.140.117:"+port+"/report/review/job/"+jobId+"/"+workerId+"/0";
|
|
|
return url;
|
|
|
// TODO: 2019/12/13 对reviewWorker为null的情况返回错误提示
|
|
|
}
|