|
@@ -557,6 +557,8 @@ public class ExamController extends ControllerSupport {
|
|
|
examInfo.setRemark(domain.getRemark());
|
|
|
examInfo.setRootOrgId(accessUser.getRootOrgId());
|
|
|
examInfo.setExamLimit(domain.getExamLimit());
|
|
|
+ examInfo.setSpecialSettingsEnabled(domain.getSpecialSettingsEnabled());
|
|
|
+ examInfo.setSpecialSettingsType(domain.getSpecialSettingsType());
|
|
|
|
|
|
Map<String, String> properties = domain.getProperties();
|
|
|
if (null == properties) {
|
|
@@ -574,7 +576,7 @@ public class ExamController extends ControllerSupport {
|
|
|
@ApiOperation(value = "复制考试批次", notes = "")
|
|
|
@PostMapping("copyExam")
|
|
|
@Transactional
|
|
|
- public void copyExam(@RequestBody CopyExamDomain domain) {
|
|
|
+ public ExamEntity copyExam(@RequestBody CopyExamDomain domain) {
|
|
|
|
|
|
Long srcExamId = domain.getSrcExamId();
|
|
|
|
|
@@ -596,6 +598,8 @@ public class ExamController extends ControllerSupport {
|
|
|
ed.setRootOrgId(srcExam.getRootOrgId());
|
|
|
ed.setStarted(isStarted(srcExam.getId()));
|
|
|
ed.setExamLimit(srcExam.getExamLimit());
|
|
|
+ ed.setSpecialSettingsEnabled(srcExam.getSpecialSettingsEnabled());
|
|
|
+ ed.setSpecialSettingsType(srcExam.getSpecialSettingsType());
|
|
|
|
|
|
ed.setName(domain.getDestExamName());
|
|
|
ed.setCode(domain.getDestExamCode());
|
|
@@ -611,40 +615,7 @@ public class ExamController extends ControllerSupport {
|
|
|
ed.setProperties(map);
|
|
|
|
|
|
ExamEntity savedExam = saveExam(ed, CURD.CREATION);
|
|
|
-
|
|
|
- Boolean copyOrgSettings = domain.getCopyOrgSettings();
|
|
|
-
|
|
|
- if (copyOrgSettings) {
|
|
|
- List<ExamSpecialSettingsEntity> orgSettingsList = examSpecialSettingsRepo
|
|
|
- .findAllByExamIdAndCourseIdIsNullAndStudentIdIsNullAndOrgIdIsNotNull(
|
|
|
- srcExam.getId());
|
|
|
-
|
|
|
- for (ExamSpecialSettingsEntity cur : orgSettingsList) {
|
|
|
-
|
|
|
- ExamSpecialSettingsInfo info = new ExamSpecialSettingsInfo();
|
|
|
- info.setBeginTime(cur.getBeginTime());
|
|
|
- info.setEndTime(cur.getEndTime());
|
|
|
- info.setOrgId(cur.getOrgId());
|
|
|
- info.setExamLimit(cur.getExamLimit());
|
|
|
- info.setRootOrgId(cur.getRootOrgId());
|
|
|
-
|
|
|
- info.setExamId(savedExam.getId());
|
|
|
-
|
|
|
- List<ExamOrgPropertyEntity> propList = examOrgPropertyRepo
|
|
|
- .findByExamIdAndOrgId(cur.getExamId(), cur.getOrgId());
|
|
|
-
|
|
|
- Map<String, String> orgProperties = Maps.newHashMap();
|
|
|
- for (ExamOrgPropertyEntity curOrgProp : propList) {
|
|
|
- DynamicEnum de = manager.getById(curOrgProp.getKeyId());
|
|
|
- map.put(de.getName(), curOrgProp.getValue());
|
|
|
- }
|
|
|
- info.setProperties(orgProperties);
|
|
|
-
|
|
|
- examService.saveExamSpecialSettings(info);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ return savedExam;
|
|
|
}
|
|
|
|
|
|
/**
|