Ver Fonte

submit:讲义修改

yangdamao há 2 anos atrás
pai
commit
721abc0147

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseHandoutsMapper.java

@@ -42,4 +42,7 @@ public interface CourseHandoutsMapper extends BaseMapper<CourseHandouts> {
 
     @InterceptorIgnore(tenantLine = "true")
     List<CourseHandouts> getHandoutsListByTenant(@Param("encoder") String encoder,@Param("handoutsName") String handoutsName,@Param("tenantId") Long tenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    void removeHandoutsRecord(@Param("handoutsId")Long handoutsId,@Param("tenantId") Long tenantId);
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseHandoutsServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
@@ -84,7 +85,7 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
             });
             courseHandoutsVo.setFileList(courseFileVos);
         } else {
-            List<CourseFileVo> fileVos = courseFileVos.stream().filter(item -> item.getParentId() == 0L).collect(Collectors.toList());
+            List<CourseFileVo> fileVos = courseFileVos.stream().filter(item -> ObjectUtils.isNotNull(item.getParentId()) && item.getParentId() == 0L).collect(Collectors.toList());
             if (!CollectionUtils.isEmpty(fileVos)) {
                 fileVos.forEach(file -> {
                     assembleFile(file, courseFileVos,true);
@@ -335,6 +336,7 @@ public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper,
         baseMapper.removeHandouts(handoutsId, tenantId);
         baseMapper.removeHandoutsBusiness(handoutsId, tenantId);
         baseMapper.removeHandoutsFile(handoutsId, tenantId);
+        baseMapper.removeHandoutsRecord(handoutsId, tenantId);
     }
 
     @Override

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseHandoutsMapper.xml

@@ -146,4 +146,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getHandoutsListByTenant" parameterType="map" resultType="com.zhongzheng.modules.course.domain.CourseHandouts" >
         SELECT * FROM `course_handouts` WHERE encoder = #{encoder} AND handouts_name = #{handoutsName} AND tenant_id = #{tenantId}
     </select>
+
+    <delete id="removeHandoutsRecord" parameterType="java.lang.Long" >
+        DELETE FROM sys_goods_copy_record WHERE new_id = #{handoutsId} AND tenant_id = #{tenantId} AND type = 15
+    </delete>
 </mapper>