|
@@ -2,6 +2,7 @@ package com.zhongzheng.modules.inform.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
|
import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
|
|
@@ -175,27 +176,33 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
|
|
|
LambdaQueryWrapper<InformUser> informUser = Wrappers.lambdaQuery();
|
|
|
informUser.eq(InformUser::getInformId, update.getInformId());
|
|
|
iInformUserService.remove(informUser);
|
|
|
- for (InformExamAddBo informExamAddBo : bo.getInformExamAddBo()) {
|
|
|
- informExamAddBo.setInformId(update.getInformId());
|
|
|
- iInformExamService.insertByAddBo(informExamAddBo);
|
|
|
+ if (CollectionUtils.isNotEmpty(bo.getInformExamAddBo())) {
|
|
|
+ for (InformExamAddBo informExamAddBo : bo.getInformExamAddBo()) {
|
|
|
+ informExamAddBo.setInformId(update.getInformId());
|
|
|
+ iInformExamService.insertByAddBo(informExamAddBo);
|
|
|
+ }
|
|
|
}
|
|
|
- for (InformCourseAddBo informCourseAddBo : bo.getInformCourseAddBo()) {
|
|
|
- informCourseAddBo.setInformId(update.getInformId());
|
|
|
- iInformCourseService.insertByAddBo(informCourseAddBo);
|
|
|
+ if (CollectionUtils.isNotEmpty(bo.getInformCourseAddBo())) {
|
|
|
+ for (InformCourseAddBo informCourseAddBo : bo.getInformCourseAddBo()) {
|
|
|
+ informCourseAddBo.setInformId(update.getInformId());
|
|
|
+ iInformCourseService.insertByAddBo(informCourseAddBo);
|
|
|
+ }
|
|
|
}
|
|
|
- for (Long userId : bo.getUserId()) {
|
|
|
- if (bo.getOrderStatus().equals(2)) {
|
|
|
- Integer integer = selectNumList(userId, bo.getInformExamAddBo(), bo.getInformCourseAddBo());
|
|
|
- if (integer.equals(0)){
|
|
|
- continue;
|
|
|
+ if (bo.getUserId() != null) {
|
|
|
+ for (Long userId : bo.getUserId()) {
|
|
|
+ if (bo.getOrderStatus().equals(2)) {
|
|
|
+ Integer integer = selectNumList(userId, bo.getInformExamAddBo(), bo.getInformCourseAddBo());
|
|
|
+ if (integer.equals(0)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setInformId(update.getInformId());
|
|
|
+ informUserAddBo.setUserId(userId);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
}
|
|
|
- InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
- informUserAddBo.setInformId(update.getInformId());
|
|
|
- informUserAddBo.setUserId(userId);
|
|
|
- informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
- informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
- iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
}
|
|
|
return this.updateById(update);
|
|
|
}
|