|
@@ -147,32 +147,16 @@ public class TIeInvigilateWarnInfoController {
|
|
|
TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
AuthDto authDto = themisCacheService.addAccountAuthCache(tbUser.getId());
|
|
|
if (!authDto.getRoleCodes().toString().contains(RoleEnum.ADMIN.name())) {
|
|
|
- if (CollectionUtils.isEmpty(warnInfoParams.getWarningIds()) && Objects.isNull(warnInfoParams.getExamRecordId())) {
|
|
|
+ if (org.apache.commons.collections.CollectionUtils.isEmpty(warnInfoParams.getWarningIds()) && Objects.isNull(warnInfoParams.getExamRecordId())) {
|
|
|
throw new BusinessException("预警id数组或考试记录id不能同时为空");
|
|
|
}
|
|
|
UpdateWrapper<TIeInvigilateWarnInfo> tIeInvigilateWarnInfoUpdateWrapper = new UpdateWrapper<>();
|
|
|
tIeInvigilateWarnInfoUpdateWrapper.lambda().set(TIeInvigilateWarnInfo::getApproveStatus, warnInfoParams.getApproveStatus());
|
|
|
- if (!CollectionUtils.isEmpty(warnInfoParams.getWarningIds())) {
|
|
|
+ if (!org.apache.commons.collections.CollectionUtils.isEmpty(warnInfoParams.getWarningIds())) {
|
|
|
List<Long> warningTranIds = warnInfoParams.getWarningIds().stream().map(x -> Long.parseLong(x)).collect(Collectors.toList());
|
|
|
- List<TIeInvigilateWarnInfo> tIeInvigilateWarnInfoList = tIeInvigilateWarnInfoService.listByIds(warningTranIds);
|
|
|
- if (!CollectionUtils.isEmpty(tIeInvigilateWarnInfoList)) {
|
|
|
- Map<Long, Integer> map = new HashMap<>();
|
|
|
- for (TIeInvigilateWarnInfo t : tIeInvigilateWarnInfoList) {
|
|
|
- if (map.containsKey(t.getExamRecordId())) {
|
|
|
- Integer number = map.get(t.getExamRecordId());
|
|
|
- map.put(t.getExamRecordId(), number + 1);
|
|
|
- } else {
|
|
|
- map.put(t.getExamRecordId(), 1);
|
|
|
- }
|
|
|
- }
|
|
|
- map.forEach((k, v) -> {
|
|
|
- tOeExamRecordService.updateWarningUnreadCache(k, v);
|
|
|
- });
|
|
|
- }
|
|
|
tIeInvigilateWarnInfoUpdateWrapper.lambda().in(TIeInvigilateWarnInfo::getId, warningTranIds);
|
|
|
} else if (Objects.nonNull(warnInfoParams.getExamRecordId())) {
|
|
|
tIeInvigilateWarnInfoUpdateWrapper.lambda().eq(TIeInvigilateWarnInfo::getExamRecordId, warnInfoParams.getExamRecordId());
|
|
|
- tOeExamRecordService.updateWarningUnreadCache(warnInfoParams.getExamRecordId(), 0);
|
|
|
}
|
|
|
tIeInvigilateWarnInfoService.update(tIeInvigilateWarnInfoUpdateWrapper);
|
|
|
}
|