|
@@ -21,6 +21,9 @@ import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
|
import com.zhongzheng.modules.goods.mapper.GoodsAttachedMapper;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
|
|
|
import com.zhongzheng.modules.inform.bo.*;
|
|
|
+import com.zhongzheng.modules.inform.domain.InformCourse;
|
|
|
+import com.zhongzheng.modules.inform.domain.InformExam;
|
|
|
+import com.zhongzheng.modules.inform.domain.InformUser;
|
|
|
import com.zhongzheng.modules.inform.service.IInformCourseService;
|
|
|
import com.zhongzheng.modules.inform.service.IInformExamService;
|
|
|
import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
@@ -161,6 +164,37 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
|
|
|
Inform update = BeanUtil.toBean(bo, Inform.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ LambdaQueryWrapper<InformExam> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq( InformExam::getInformId, update.getInformId());
|
|
|
+ iInformExamService.remove(lqw);
|
|
|
+ LambdaQueryWrapper<InformCourse> informCount = Wrappers.lambdaQuery();
|
|
|
+ informCount.eq(InformCourse::getInformId, update.getInformId());
|
|
|
+ iInformCourseService.remove(informCount);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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);
|
|
|
}
|
|
|
|
|
@@ -265,6 +299,14 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
|
|
|
return goodsInformAttachedVos;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean editClassifyId(InformEditBo bo) {
|
|
|
+ Inform update = BeanUtil.toBean(bo, Inform.class);
|
|
|
+ validEntityBeforeSave(update);
|
|
|
+ update.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ return this.updateById(update);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 实体类转化成视图对象
|