|
@@ -51,6 +51,7 @@ import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
|
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
|
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamCourseRelationBean;
|
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamPaperTypeRelation;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.bean.ExamSpecialSettingsBean;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.CountExamStudentReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamCourseListReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamCoursePaperTypeListReq;
|
|
@@ -290,10 +291,11 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
|
|
|
predicates.add(cb.equal(root.get("examEnable"), enable));
|
|
|
predicates.add(cb.isNull(root.get("courseId")));
|
|
|
|
|
|
- Predicate pr1 = cb.isNull(root.get("orgId"));
|
|
|
- Predicate pr2 = cb.equal(root.get("orgId"), orgId);
|
|
|
-
|
|
|
- predicates.add(cb.or(pr1, pr2));
|
|
|
+ if (null != orgId) {
|
|
|
+ Predicate pr1 = cb.isNull(root.get("orgId"));
|
|
|
+ Predicate pr2 = cb.equal(root.get("orgId"), orgId);
|
|
|
+ predicates.add(cb.or(pr1, pr2));
|
|
|
+ }
|
|
|
|
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
};
|
|
@@ -306,10 +308,12 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
|
|
|
List<ExamSpecialSettingsEntity> resultList = Lists.newArrayList();
|
|
|
Map<String, ExamSpecialSettingsEntity> examMap = Maps.newHashMap();
|
|
|
for (ExamSpecialSettingsEntity cur : entityList) {
|
|
|
- resultList.add(cur);
|
|
|
- if (null == cur.getOrgId() || null == cur.getCourseId()) {
|
|
|
+ if (null == cur.getOrgId() && null == cur.getCourseId()) {
|
|
|
examMap.put(String.valueOf(cur.getExamId()), cur);
|
|
|
}
|
|
|
+ if (null != cur.getBeginTime() && null != cur.getEndTime()) {
|
|
|
+ resultList.add(cur);
|
|
|
+ }
|
|
|
}
|
|
|
for (ExamSpecialSettingsEntity cur : entityList) {
|
|
|
if ((null != cur.getOrgId() || null != cur.getCourseId()) && null != cur.getEndTime()) {
|
|
@@ -320,25 +324,25 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- List<ExamBean> list = Lists.newArrayList();
|
|
|
- for (ExamSpecialSettingsEntity cur : entityList) {
|
|
|
- ExamBean bean = new ExamBean();
|
|
|
+ List<ExamSpecialSettingsBean> list = Lists.newArrayList();
|
|
|
+ for (ExamSpecialSettingsEntity cur : resultList) {
|
|
|
+ ExamSpecialSettingsBean bean = new ExamSpecialSettingsBean();
|
|
|
list.add(bean);
|
|
|
- ExamEntity exam = examRepo.findOne(cur.getExamId());
|
|
|
- bean.setId(exam.getId());
|
|
|
- bean.setBeginTime(exam.getBeginTime());
|
|
|
- bean.setDuration(exam.getDuration());
|
|
|
- bean.setEnable(exam.getEnable());
|
|
|
- bean.setEndTime(exam.getEndTime());
|
|
|
- bean.setExamTimes(exam.getExamTimes());
|
|
|
- bean.setExamType(exam.getExamType().name());
|
|
|
- bean.setName(exam.getName());
|
|
|
- bean.setRemark(exam.getRemark());
|
|
|
- bean.setRootOrgId(exam.getRootOrgId());
|
|
|
+ bean.setId(cur.getId());
|
|
|
+ bean.setOrgId(cur.getOrgId());
|
|
|
+ cur.setRootOrgId(cur.getRootOrgId());
|
|
|
+ cur.setUpdateTime(cur.getUpdateTime());
|
|
|
+ bean.setBeginTime(cur.getBeginTime());
|
|
|
+ bean.setCourseId(cur.getCourseId());
|
|
|
+ bean.setEndTime(cur.getEndTime());
|
|
|
+ bean.setExamEnable(cur.getExamEnable());
|
|
|
+ bean.setExamId(cur.getExamId());
|
|
|
+ bean.setExamLimit(cur.getExamLimit());
|
|
|
+ bean.setExamType(cur.getExamType().name());
|
|
|
}
|
|
|
|
|
|
GetOngoingExamListResp resp = new GetOngoingExamListResp();
|
|
|
- resp.setExamList(list);
|
|
|
+ resp.setExamSpecialSettingsList(list);
|
|
|
return resp;
|
|
|
}
|
|
|
|