瀏覽代碼

fix 讲义

he2802 3 年之前
父節點
當前提交
cdf35038d5

+ 0 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseBusiness.java

@@ -46,7 +46,6 @@ private static final long serialVersionUID=1L;
     /** 编码YW */
     private String encoder;
 
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Integer templateStatus;
 
     /** 1限制视频商品做卷顺序 0不限制 */

+ 6 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
@@ -135,11 +136,11 @@ public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper,
     public boolean editModel(CourseBusinessEditBo bo) {
         //批量添加业务层次模板
         for (Long businessId : bo.getBusinessIds()) {
-            CourseBusiness update =new CourseBusiness();
-            update.setUpdateTime(DateUtils.getNowTime());
-            update.setId(businessId);
-            update.setTemplateStatus(bo.getTemplateStatus());
-            this.updateById(update);
+            LambdaUpdateWrapper<CourseBusiness> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+            objectLambdaUpdateWrapper.eq(CourseBusiness::getId, businessId);
+            objectLambdaUpdateWrapper.set(CourseBusiness::getTemplateStatus, bo.getTemplateStatus());
+            objectLambdaUpdateWrapper.set(CourseBusiness::getUpdateTime,DateUtils.getNowTime());
+            this.update(null, objectLambdaUpdateWrapper);
         }
         return true;
     }