|
@@ -1,23 +1,48 @@
|
|
package cn.com.qmth.examcloud.core.examwork.api.controller;
|
|
package cn.com.qmth.examcloud.core.examwork.api.controller;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.Iterator;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+import javax.persistence.criteria.Predicate;
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.io.FileUtils;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.Example;
|
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
|
+import org.springframework.data.jpa.domain.Specification;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamStageStartExamStatus;
|
|
import cn.com.qmth.examcloud.api.commons.enums.ExamStageStartExamStatus;
|
|
-import cn.com.qmth.examcloud.api.commons.enums.ExamType;
|
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.SubmitType;
|
|
import cn.com.qmth.examcloud.api.commons.enums.SubmitType;
|
|
import cn.com.qmth.examcloud.api.commons.exchange.PageInfo;
|
|
import cn.com.qmth.examcloud.api.commons.exchange.PageInfo;
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
|
|
import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
|
|
import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
-import cn.com.qmth.examcloud.commons.util.RegExpUtil;
|
|
|
|
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamDomain;
|
|
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamStageDomain;
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamStageDomain;
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamStageSettingDomain;
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamStageSettingDomain;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStageRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStageRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStageSettingRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStageSettingRepo;
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
|
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStageEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStageEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStageSettingEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStageSettingEntity;
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
|
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStageService;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStageService;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStageSettingService;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStageSettingService;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
|
|
@@ -28,29 +53,8 @@ import cn.com.qmth.examcloud.web.config.SystemProperties;
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import cn.com.qmth.examcloud.web.jpa.PageUtils;
|
|
import cn.com.qmth.examcloud.web.jpa.PageUtils;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
-import com.google.common.collect.Lists;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
-import org.apache.commons.collections.CollectionUtils;
|
|
|
|
-import org.apache.commons.io.FileUtils;
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.data.domain.Example;
|
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
|
-import org.springframework.data.domain.PageRequest;
|
|
|
|
-import org.springframework.data.domain.Sort;
|
|
|
|
-import org.springframework.data.jpa.domain.Specification;
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
-
|
|
|
|
-import javax.persistence.criteria.Predicate;
|
|
|
|
-import javax.persistence.criteria.Root;
|
|
|
|
-import javax.persistence.criteria.Subquery;
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
-import java.io.File;
|
|
|
|
-import java.text.ParseException;
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description 场次
|
|
* @Description 场次
|
|
@@ -63,8 +67,8 @@ import java.util.*;
|
|
@RequestMapping("${$rmp.ctr.examwork}/examStage")
|
|
@RequestMapping("${$rmp.ctr.examwork}/examStage")
|
|
public class ExamStageController extends ControllerSupport {
|
|
public class ExamStageController extends ControllerSupport {
|
|
|
|
|
|
- private static final String[] EXAM_STAGE_EXCEL_HEADER = new String[]{"场次ID", "场次号",
|
|
|
|
- "开始时间", "结束考试时间", "控制设置", "状态"};
|
|
|
|
|
|
+ private static final String[] EXAM_STAGE_EXCEL_HEADER = new String[] { "场次ID", "场次号", "开始时间", "结束考试时间", "控制设置",
|
|
|
|
+ "状态" };
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
ExamStageService examStageService;
|
|
ExamStageService examStageService;
|
|
@@ -83,30 +87,35 @@ public class ExamStageController extends ControllerSupport {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
SystemProperties systemConfig;
|
|
SystemProperties systemConfig;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
ExamStageCache examStageCache;
|
|
ExamStageCache examStageCache;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 分页查询场次列表
|
|
* 分页查询场次列表
|
|
*
|
|
*
|
|
- * @param curPage 页索引
|
|
|
|
- * @param pageSize 页大小
|
|
|
|
- * @param examId 考试id
|
|
|
|
- * @param stageOrder 场次号
|
|
|
|
- * @param startTime 允许考试开始时间
|
|
|
|
- * @param endTime 允许考试结束时间
|
|
|
|
- * @param enable 是否启用
|
|
|
|
|
|
+ * @param curPage
|
|
|
|
+ * 页索引
|
|
|
|
+ * @param pageSize
|
|
|
|
+ * 页大小
|
|
|
|
+ * @param examId
|
|
|
|
+ * 考试id
|
|
|
|
+ * @param stageOrder
|
|
|
|
+ * 场次号
|
|
|
|
+ * @param startTime
|
|
|
|
+ * 允许考试开始时间
|
|
|
|
+ * @param endTime
|
|
|
|
+ * 允许考试结束时间
|
|
|
|
+ * @param enable
|
|
|
|
+ * 是否启用
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@ApiOperation(value = "分页查询场次")
|
|
@ApiOperation(value = "分页查询场次")
|
|
@GetMapping("queryPage/{curPage}/{pageSize}")
|
|
@GetMapping("queryPage/{curPage}/{pageSize}")
|
|
- public PageInfo<ExamStageDomain> queryPage(@PathVariable Integer curPage,
|
|
|
|
- @PathVariable Integer pageSize,
|
|
|
|
- @RequestParam Long examId,
|
|
|
|
- @RequestParam(required = false) Integer stageOrder,
|
|
|
|
- @RequestParam(required = false) String startTime,
|
|
|
|
- @RequestParam(required = false) String endTime,
|
|
|
|
- @RequestParam(required = false) Boolean enable) {
|
|
|
|
|
|
+ public PageInfo<ExamStageDomain> queryPage(@PathVariable Integer curPage, @PathVariable Integer pageSize,
|
|
|
|
+ @RequestParam Long examId, @RequestParam(required = false) Integer stageOrder,
|
|
|
|
+ @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
|
|
|
+ @RequestParam(required = false) Boolean enable) {
|
|
User accessUser = getAccessUser();
|
|
User accessUser = getAccessUser();
|
|
|
|
|
|
Specification<ExamStageEntity> specification = (root, query, cb) -> {
|
|
Specification<ExamStageEntity> specification = (root, query, cb) -> {
|
|
@@ -131,8 +140,7 @@ public class ExamStageController extends ControllerSupport {
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
};
|
|
};
|
|
|
|
|
|
- PageRequest pageRequest = PageRequest.of(curPage, pageSize,
|
|
|
|
- Sort.by(Sort.Direction.DESC, "stageOrder"));
|
|
|
|
|
|
+ PageRequest pageRequest = PageRequest.of(curPage, pageSize, Sort.by(Sort.Direction.DESC, "stageOrder"));
|
|
|
|
|
|
Page<ExamStageEntity> page = examStageRepo.findAll(specification, pageRequest);
|
|
Page<ExamStageEntity> page = examStageRepo.findAll(specification, pageRequest);
|
|
|
|
|
|
@@ -176,16 +184,15 @@ public class ExamStageController extends ControllerSupport {
|
|
@ApiOperation(value = "查询考试批次")
|
|
@ApiOperation(value = "查询考试批次")
|
|
@GetMapping("queryByNameLike")
|
|
@GetMapping("queryByNameLike")
|
|
public List<ExamStageDomain> query(@RequestParam(required = true) String name,
|
|
public List<ExamStageDomain> query(@RequestParam(required = true) String name,
|
|
- @RequestParam(required = true) Long examId,
|
|
|
|
- @RequestParam(required = false) Boolean enable,
|
|
|
|
- @RequestParam(required = false) Long rootOrgId) {
|
|
|
|
|
|
+ @RequestParam(required = true) Long examId, @RequestParam(required = false) Boolean enable,
|
|
|
|
+ @RequestParam(required = false) Long rootOrgId) {
|
|
|
|
|
|
if (null == rootOrgId) {
|
|
if (null == rootOrgId) {
|
|
rootOrgId = getRootOrgId();
|
|
rootOrgId = getRootOrgId();
|
|
}
|
|
}
|
|
final Long finalRootOrgId = rootOrgId;
|
|
final Long finalRootOrgId = rootOrgId;
|
|
|
|
|
|
- //如果场次号不为数字,则直接返回空集合
|
|
|
|
|
|
+ // 如果场次号不为数字,则直接返回空集合
|
|
if (StringUtils.isNotEmpty(name) && !StringUtils.isNumeric(name)) {
|
|
if (StringUtils.isNotEmpty(name) && !StringUtils.isNumeric(name)) {
|
|
return Lists.newArrayList();
|
|
return Lists.newArrayList();
|
|
}
|
|
}
|
|
@@ -204,8 +211,7 @@ public class ExamStageController extends ControllerSupport {
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
};
|
|
};
|
|
|
|
|
|
- PageRequest pageRequest = PageRequest.of(0, 100,
|
|
|
|
- Sort.by(Sort.Direction.ASC, "stageOrder"));
|
|
|
|
|
|
+ PageRequest pageRequest = PageRequest.of(0, 100, Sort.by(Sort.Direction.ASC, "stageOrder"));
|
|
Page<ExamStageEntity> page = examStageRepo.findAll(specification, pageRequest);
|
|
Page<ExamStageEntity> page = examStageRepo.findAll(specification, pageRequest);
|
|
|
|
|
|
Iterator<ExamStageEntity> iterator = page.iterator();
|
|
Iterator<ExamStageEntity> iterator = page.iterator();
|
|
@@ -254,7 +260,7 @@ public class ExamStageController extends ControllerSupport {
|
|
Date examStartTime = examSettings.getBeginTime();
|
|
Date examStartTime = examSettings.getBeginTime();
|
|
Date examEndTime = examSettings.getEndTime();
|
|
Date examEndTime = examSettings.getEndTime();
|
|
|
|
|
|
- //起始场次号
|
|
|
|
|
|
+ // 起始场次号
|
|
int startStageOrder = 0;
|
|
int startStageOrder = 0;
|
|
ExamStageEntity maxStageOrderEntity = examStageRepo.findFirstByExamIdOrderByStageOrderDesc(examId);
|
|
ExamStageEntity maxStageOrderEntity = examStageRepo.findFirstByExamIdOrderByStageOrderDesc(examId);
|
|
if (null != maxStageOrderEntity) {
|
|
if (null != maxStageOrderEntity) {
|
|
@@ -324,12 +330,9 @@ public class ExamStageController extends ControllerSupport {
|
|
@PutMapping(value = "modifyStage")
|
|
@PutMapping(value = "modifyStage")
|
|
@ApiOperation(value = "修改场次信息")
|
|
@ApiOperation(value = "修改场次信息")
|
|
@Transactional
|
|
@Transactional
|
|
- public void modifyStage(@RequestParam Long id,
|
|
|
|
- @RequestParam(required = false) String startTime,
|
|
|
|
- @RequestParam(required = false) String endTime,
|
|
|
|
- @RequestParam Boolean specialSetting,
|
|
|
|
- @RequestParam(required = false) String submitType,
|
|
|
|
- @RequestParam(required = false) Integer submitDuration) {
|
|
|
|
|
|
+ public void modifyStage(@RequestParam Long id, @RequestParam(required = false) String startTime,
|
|
|
|
+ @RequestParam(required = false) String endTime, @RequestParam Boolean specialSetting,
|
|
|
|
+ @RequestParam(required = false) String submitType, @RequestParam(required = false) Integer submitDuration) {
|
|
if (null == id) {
|
|
if (null == id) {
|
|
throw new StatusException("10001", "场次id不允许为空");
|
|
throw new StatusException("10001", "场次id不允许为空");
|
|
}
|
|
}
|
|
@@ -366,7 +369,7 @@ public class ExamStageController extends ControllerSupport {
|
|
esEntity.setEndTime(et);
|
|
esEntity.setEndTime(et);
|
|
}
|
|
}
|
|
|
|
|
|
- //未进行特殊设置,默认不使用特殊设置
|
|
|
|
|
|
+ // 未进行特殊设置,默认不使用特殊设置
|
|
if (null == specialSetting) {
|
|
if (null == specialSetting) {
|
|
specialSetting = false;
|
|
specialSetting = false;
|
|
}
|
|
}
|
|
@@ -390,15 +393,14 @@ public class ExamStageController extends ControllerSupport {
|
|
|
|
|
|
examStageRepo.save(esEntity);
|
|
examStageRepo.save(esEntity);
|
|
|
|
|
|
- //刷新缓存
|
|
|
|
|
|
+ // 刷新缓存
|
|
examStageCache.refresh(examId, esEntity.getId());
|
|
examStageCache.refresh(examId, esEntity.getId());
|
|
}
|
|
}
|
|
|
|
|
|
@PutMapping(value = "modifyStageEnable")
|
|
@PutMapping(value = "modifyStageEnable")
|
|
@ApiOperation(value = "启用/禁用场次")
|
|
@ApiOperation(value = "启用/禁用场次")
|
|
@Transactional
|
|
@Transactional
|
|
- public void modifyStageEnable(@RequestParam List<Long> examStageIds,
|
|
|
|
- @RequestParam Boolean enable) {
|
|
|
|
|
|
+ public void modifyStageEnable(@RequestParam List<Long> examStageIds, @RequestParam Boolean enable) {
|
|
if (examStageIds.size() == 0) {
|
|
if (examStageIds.size() == 0) {
|
|
throw new StatusException("10001", "examStageIds参数不允许为空");
|
|
throw new StatusException("10001", "examStageIds参数不允许为空");
|
|
}
|
|
}
|
|
@@ -407,7 +409,7 @@ public class ExamStageController extends ControllerSupport {
|
|
entity.setEnable(enable);
|
|
entity.setEnable(enable);
|
|
examStageRepo.save(entity);
|
|
examStageRepo.save(entity);
|
|
|
|
|
|
- //刷新缓存
|
|
|
|
|
|
+ // 刷新缓存
|
|
examStageCache.refresh(entity.getExamId(), entity.getId());
|
|
examStageCache.refresh(entity.getExamId(), entity.getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -417,7 +419,7 @@ public class ExamStageController extends ControllerSupport {
|
|
@Transactional
|
|
@Transactional
|
|
public void saveStageSetting(@RequestBody ExamStageSettingDomain domain) {
|
|
public void saveStageSetting(@RequestBody ExamStageSettingDomain domain) {
|
|
ExamStageSettingEntity essEntity;
|
|
ExamStageSettingEntity essEntity;
|
|
- //新增
|
|
|
|
|
|
+ // 新增
|
|
if (null == domain.getId()) {
|
|
if (null == domain.getId()) {
|
|
if (null == domain.getExamId()) {
|
|
if (null == domain.getExamId()) {
|
|
throw new StatusException("10001", "考试id不允许为空");
|
|
throw new StatusException("10001", "考试id不允许为空");
|
|
@@ -442,7 +444,7 @@ public class ExamStageController extends ControllerSupport {
|
|
|
|
|
|
examStageSettingRepo.save(essEntity);
|
|
examStageSettingRepo.save(essEntity);
|
|
}
|
|
}
|
|
- //修改
|
|
|
|
|
|
+ // 修改
|
|
else {
|
|
else {
|
|
if (null == domain.getExamId()) {
|
|
if (null == domain.getExamId()) {
|
|
throw new StatusException("10004", "考试id不允许为空");
|
|
throw new StatusException("10004", "考试id不允许为空");
|
|
@@ -460,7 +462,6 @@ public class ExamStageController extends ControllerSupport {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
essEntity = examStageSettingRepo.findByExamId(domain.getExamId());
|
|
essEntity = examStageSettingRepo.findByExamId(domain.getExamId());
|
|
essEntity.setSubmitType(domain.getSubmitType());
|
|
essEntity.setSubmitType(domain.getSubmitType());
|
|
essEntity.setSubmitDuration(domain.getSubmitDuration());
|
|
essEntity.setSubmitDuration(domain.getSubmitDuration());
|
|
@@ -468,7 +469,7 @@ public class ExamStageController extends ControllerSupport {
|
|
examStageSettingRepo.save(essEntity);
|
|
examStageSettingRepo.save(essEntity);
|
|
}
|
|
}
|
|
|
|
|
|
- //刷新缓存
|
|
|
|
|
|
+ // 刷新缓存
|
|
List<ExamStageEntity> existExamStageList = examStageRepo.findByExamId(domain.getExamId());
|
|
List<ExamStageEntity> existExamStageList = examStageRepo.findByExamId(domain.getExamId());
|
|
if (null != existExamStageList && !existExamStageList.isEmpty()) {
|
|
if (null != existExamStageList && !existExamStageList.isEmpty()) {
|
|
existExamStageList.forEach(p -> {
|
|
existExamStageList.forEach(p -> {
|
|
@@ -507,7 +508,7 @@ public class ExamStageController extends ControllerSupport {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- //如果存在已经开考的场次,则不允许清空
|
|
|
|
|
|
+ // 如果存在已经开考的场次,则不允许清空
|
|
ExamStageEntity query = new ExamStageEntity();
|
|
ExamStageEntity query = new ExamStageEntity();
|
|
query.setExamId(examId);
|
|
query.setExamId(examId);
|
|
query.setStartExamStatus(ExamStageStartExamStatus.STARTED);
|
|
query.setStartExamStatus(ExamStageStartExamStatus.STARTED);
|
|
@@ -517,10 +518,10 @@ public class ExamStageController extends ControllerSupport {
|
|
throw new StatusException("10002", "该考试下已存在已经开考的场次,不允许清空");
|
|
throw new StatusException("10002", "该考试下已存在已经开考的场次,不允许清空");
|
|
}
|
|
}
|
|
|
|
|
|
- //解绑考生与场次的对应关系
|
|
|
|
|
|
+ // 解绑考生与场次的对应关系
|
|
examStudentService.unbindExamStudentExamStage(examId);
|
|
examStudentService.unbindExamStudentExamStage(examId);
|
|
examStageRepo.deleteByExamId(examId);
|
|
examStageRepo.deleteByExamId(examId);
|
|
- //删除相关缓存
|
|
|
|
|
|
+ // 删除相关缓存
|
|
existExamStageList.forEach(p -> examStageCache.remove(p.getExamId(), p.getId()));
|
|
existExamStageList.forEach(p -> examStageCache.remove(p.getExamId(), p.getId()));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -536,25 +537,22 @@ public class ExamStageController extends ControllerSupport {
|
|
List<Object[]> datas = Lists.newArrayList();
|
|
List<Object[]> datas = Lists.newArrayList();
|
|
|
|
|
|
for (ExamStageEntity cur : examStageList) {
|
|
for (ExamStageEntity cur : examStageList) {
|
|
- String startTime = null == cur.getStartTime()
|
|
|
|
- ? null
|
|
|
|
|
|
+ String startTime = null == cur.getStartTime() ? null
|
|
: DateUtil.format(cur.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT);
|
|
: DateUtil.format(cur.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT);
|
|
- String endTime = null == cur.getEndTime()
|
|
|
|
- ? null
|
|
|
|
|
|
+ String endTime = null == cur.getEndTime() ? null
|
|
: DateUtil.format(cur.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT);
|
|
: DateUtil.format(cur.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT);
|
|
String specialSetting = cur.getSpecialSetting() ? "自定义" : "通用";
|
|
String specialSetting = cur.getSpecialSetting() ? "自定义" : "通用";
|
|
String enable = cur.getEnable() ? "启用" : "禁用";
|
|
String enable = cur.getEnable() ? "启用" : "禁用";
|
|
- datas.add(new Object[]{String.valueOf(cur.getId()), String.valueOf(cur.getStageOrder()),
|
|
|
|
- startTime, endTime, specialSetting, enable});
|
|
|
|
|
|
+ datas.add(new Object[] { String.valueOf(cur.getId()), String.valueOf(cur.getStageOrder()), startTime,
|
|
|
|
+ endTime, specialSetting, enable });
|
|
}
|
|
}
|
|
|
|
|
|
String filePath = systemConfig.getTempDataDir() + File.separator + "examStage_" + examId + "_"
|
|
String filePath = systemConfig.getTempDataDir() + File.separator + "examStage_" + examId + "_"
|
|
+ System.currentTimeMillis() + ".xlsx";
|
|
+ System.currentTimeMillis() + ".xlsx";
|
|
File file = new File(filePath);
|
|
File file = new File(filePath);
|
|
|
|
|
|
- ExcelWriter.write(
|
|
|
|
- EXAM_STAGE_EXCEL_HEADER, new Class[]{String.class, String.class,
|
|
|
|
- String.class, String.class, String.class, String.class},
|
|
|
|
|
|
+ ExcelWriter.write(EXAM_STAGE_EXCEL_HEADER,
|
|
|
|
+ new Class[] { String.class, String.class, String.class, String.class, String.class, String.class },
|
|
datas, new File(filePath));
|
|
datas, new File(filePath));
|
|
|
|
|
|
exportFile("场交设置-" + examId + ".xlsx", file);
|
|
exportFile("场交设置-" + examId + ".xlsx", file);
|