|
@@ -67,7 +67,7 @@ public class TEExamReexamController {
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@Transactional
|
|
@Transactional
|
|
public Result apply(@ApiJsonObject(name = "reexamApply", value = {
|
|
public Result apply(@ApiJsonObject(name = "reexamApply", value = {
|
|
- @ApiJsonProperty(key = "examRecordId", type = "long", example = "1", description = "考试记录id", required = true),
|
|
|
|
|
|
+ @ApiJsonProperty(key = "examRecordId", description = "考试记录id数组", required = true),
|
|
@ApiJsonProperty(key = "model", type = "int", example = "1", description = "重考方式", required = true),
|
|
@ApiJsonProperty(key = "model", type = "int", example = "1", description = "重考方式", required = true),
|
|
@ApiJsonProperty(key = "reason", description = "重考原因", required = true),
|
|
@ApiJsonProperty(key = "reason", description = "重考原因", required = true),
|
|
@ApiJsonProperty(key = "remark", description = "备注")
|
|
@ApiJsonProperty(key = "remark", description = "备注")
|
|
@@ -75,7 +75,7 @@ public class TEExamReexamController {
|
|
if (Objects.isNull(mapParameter.get("examRecordId")) || Objects.equals(mapParameter.get("examRecordId"), "")) {
|
|
if (Objects.isNull(mapParameter.get("examRecordId")) || Objects.equals(mapParameter.get("examRecordId"), "")) {
|
|
throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
throw new BusinessException(ExceptionResultEnum.RECORD_ID_IS_NULL);
|
|
}
|
|
}
|
|
- List<Long> recordIdList = (List<Long>) mapParameter.get("examRecordId");
|
|
|
|
|
|
+ List<String> recordIdList = (List<String>) mapParameter.get("examRecordId");
|
|
if (Objects.isNull(mapParameter.get("model")) || Objects.equals(mapParameter.get("model"), "")) {
|
|
if (Objects.isNull(mapParameter.get("model")) || Objects.equals(mapParameter.get("model"), "")) {
|
|
throw new BusinessException("重考方式不能为空");
|
|
throw new BusinessException("重考方式不能为空");
|
|
}
|
|
}
|
|
@@ -88,11 +88,11 @@ public class TEExamReexamController {
|
|
Long examId = null, examStudentId = null, examActivityId = null;
|
|
Long examId = null, examStudentId = null, examActivityId = null;
|
|
Integer reexamAuditing = null, status;
|
|
Integer reexamAuditing = null, status;
|
|
List<TEExamReexamAuditing> teExamReexamAuditingList = new ArrayList<>();
|
|
List<TEExamReexamAuditing> teExamReexamAuditingList = new ArrayList<>();
|
|
- for (Long s : recordIdList) {
|
|
|
|
|
|
+ for (String s : recordIdList) {
|
|
//获取考试记录缓存
|
|
//获取考试记录缓存
|
|
- Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(s));
|
|
|
|
|
|
+ Map<String, Object> objectMap = redisUtil.getHashEntries(RedisKeyHelper.examRecordCacheKey(Long.parseLong(s)));
|
|
if (Objects.isNull(objectMap) || objectMap.size() == 0) {
|
|
if (Objects.isNull(objectMap) || objectMap.size() == 0) {
|
|
- TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(s);
|
|
|
|
|
|
+ TOeExamRecord tOeExamRecord = tOeExamRecordService.getById(Long.parseLong(s));
|
|
if (Objects.isNull(tOeExamRecord)) {
|
|
if (Objects.isNull(tOeExamRecord)) {
|
|
throw new BusinessException("考试记录[" + s + "]不存在");
|
|
throw new BusinessException("考试记录[" + s + "]不存在");
|
|
}
|
|
}
|
|
@@ -110,7 +110,7 @@ public class TEExamReexamController {
|
|
}
|
|
}
|
|
reexamAuditing = examCacheBean.getReexamAuditing();
|
|
reexamAuditing = examCacheBean.getReexamAuditing();
|
|
status = Objects.isNull(reexamAuditing) || reexamAuditing.intValue() == 0 ? 0 : 1;
|
|
status = Objects.isNull(reexamAuditing) || reexamAuditing.intValue() == 0 ? 0 : 1;
|
|
- TEExamReexam teExamReexam = new TEExamReexam(examId, examActivityId, s, examStudentId, model, reason, status, Objects.isNull(mapParameter.get("remark")) ? null : String.valueOf(mapParameter.get("remark")));
|
|
|
|
|
|
+ TEExamReexam teExamReexam = new TEExamReexam(examId, examActivityId, Long.parseLong(s), examStudentId, model, reason, status, Objects.isNull(mapParameter.get("remark")) ? null : String.valueOf(mapParameter.get("remark")));
|
|
teExamReexam.setCreateId(tbUser.getId());
|
|
teExamReexam.setCreateId(tbUser.getId());
|
|
teExamReexamService.save(teExamReexam);
|
|
teExamReexamService.save(teExamReexam);
|
|
if (Objects.nonNull(status) && status.intValue() == 1) {
|
|
if (Objects.nonNull(status) && status.intValue() == 1) {
|
|
@@ -135,25 +135,25 @@ public class TEExamReexamController {
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "{\"success\":true}", response = Result.class)})
|
|
@Transactional
|
|
@Transactional
|
|
public Result auditing(@ApiJsonObject(name = "reexamAuditing", value = {
|
|
public Result auditing(@ApiJsonObject(name = "reexamAuditing", value = {
|
|
- @ApiJsonProperty(key = "reexamId", type = "long", example = "1", description = "重考id", required = true),
|
|
|
|
|
|
+ @ApiJsonProperty(key = "reexamId", description = "重考id数组", required = true),
|
|
@ApiJsonProperty(key = "auditingSuggest", description = "审批意见"),
|
|
@ApiJsonProperty(key = "auditingSuggest", description = "审批意见"),
|
|
@ApiJsonProperty(key = "auditingStatus", type = "long", example = "1", description = "审批状态", required = true)
|
|
@ApiJsonProperty(key = "auditingStatus", type = "long", example = "1", description = "审批状态", required = true)
|
|
}) @ApiParam(value = "重考信息", required = true) @RequestBody Map<String, Object> mapParameter) {
|
|
}) @ApiParam(value = "重考信息", required = true) @RequestBody Map<String, Object> mapParameter) {
|
|
if (Objects.isNull(mapParameter.get("reexamId")) || Objects.equals(mapParameter.get("reexamId"), "")) {
|
|
if (Objects.isNull(mapParameter.get("reexamId")) || Objects.equals(mapParameter.get("reexamId"), "")) {
|
|
throw new BusinessException("重考id不能为空");
|
|
throw new BusinessException("重考id不能为空");
|
|
}
|
|
}
|
|
- List<Long> reexamIdList = null;
|
|
|
|
|
|
+ List<String> reexamIdList = null;
|
|
try {
|
|
try {
|
|
- reexamIdList = (List<Long>) mapParameter.get("reexamId");
|
|
|
|
|
|
+ reexamIdList = (List<String>) mapParameter.get("reexamId");
|
|
if (Objects.isNull(mapParameter.get("auditingStatus")) || Objects.equals(mapParameter.get("auditingStatus"), "")) {
|
|
if (Objects.isNull(mapParameter.get("auditingStatus")) || Objects.equals(mapParameter.get("auditingStatus"), "")) {
|
|
throw new BusinessException("审批状态不能为空");
|
|
throw new BusinessException("审批状态不能为空");
|
|
}
|
|
}
|
|
Integer auditingStatus = Integer.parseInt(String.valueOf(mapParameter.get("auditingStatus")));
|
|
Integer auditingStatus = Integer.parseInt(String.valueOf(mapParameter.get("auditingStatus")));
|
|
TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
List<TEExamReexam> teExamReexamUpdateList = new ArrayList<>();
|
|
List<TEExamReexam> teExamReexamUpdateList = new ArrayList<>();
|
|
- for (Long reexamId : reexamIdList) {
|
|
|
|
- if (redisUtil.lock(SystemConstant.REDIS_LOCK_REEXAM_AUDITING + reexamId, SystemConstant.REDIS_LOCK_REEXAM_TIME_OUT)) {
|
|
|
|
- TEExamReexam teExamReexam = teExamReexamService.getById(reexamId);
|
|
|
|
|
|
+ for (String reexamId : reexamIdList) {
|
|
|
|
+ if (redisUtil.lock(SystemConstant.REDIS_LOCK_REEXAM_AUDITING + Long.parseLong(reexamId), SystemConstant.REDIS_LOCK_REEXAM_TIME_OUT)) {
|
|
|
|
+ TEExamReexam teExamReexam = teExamReexamService.getById(Long.parseLong(reexamId));
|
|
if (Objects.isNull(teExamReexam)) {
|
|
if (Objects.isNull(teExamReexam)) {
|
|
throw new BusinessException("重考id[" + reexamId + "]记录不存在");
|
|
throw new BusinessException("重考id[" + reexamId + "]记录不存在");
|
|
}
|
|
}
|