|
@@ -1,23 +1,22 @@
|
|
|
package cn.com.qmth.stmms.monitor;
|
|
|
|
|
|
import java.util.Date;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import net.sf.json.JSONArray;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
+
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
-import cn.com.qmth.stmms.biz.utils.FormalTaskUtil;
|
|
|
-import cn.com.qmth.stmms.biz.utils.TaskEntry;
|
|
|
import cn.com.qmth.stmms.biz.utils.TaskLock;
|
|
|
+import cn.com.qmth.stmms.biz.utils.TaskLock.LockNode;
|
|
|
import cn.com.qmth.stmms.biz.utils.TaskLockUtil;
|
|
|
import cn.com.qmth.stmms.common.utils.DateUtils;
|
|
|
-import net.sf.json.JSONArray;
|
|
|
-import net.sf.json.JSONObject;
|
|
|
|
|
|
@Controller("taskMonitor")
|
|
|
@RequestMapping("/monitor/task")
|
|
@@ -29,14 +28,15 @@ public class TaskMonitorController {
|
|
|
@RequestParam Integer groupNumber) {
|
|
|
TaskLock taskLock = TaskLockUtil.getFormalTask(examId + "_" + subjectCode + "_" + groupNumber);
|
|
|
JSONArray array = new JSONArray();
|
|
|
- // for (TaskEntry entry : set) {
|
|
|
- // JSONObject obj = new JSONObject();
|
|
|
- // obj.accumulate("taskId", entry.getTaskId());
|
|
|
- // obj.accumulate("markerId", entry.getMarkerId());
|
|
|
- // obj.accumulate("time", DateUtils.formatDateTime(new
|
|
|
- // Date(entry.getTimestamp())));
|
|
|
- // array.add(obj);
|
|
|
- // }
|
|
|
+ List<LockNode> list = taskLock.list();
|
|
|
+ for (LockNode node : list) {
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.accumulate("taskId", node.getId());
|
|
|
+ obj.accumulate("number", node.getNumber());
|
|
|
+ obj.accumulate("markerId", node.getOwner());
|
|
|
+ obj.accumulate("time", DateUtils.formatDateTime(new Date(node.getTime())));
|
|
|
+ array.add(obj);
|
|
|
+ }
|
|
|
return array;
|
|
|
}
|
|
|
|