Просмотр исходного кода

1.课程笔记、笔记本一些功能完善
2.课程关联信息删除改成真删,并修改之前需要删除关联信息的方法
3.修复一些bug

honorfire 7 месяцев назад
Родитель
Сommit
f449330d57
11 измененных файлов с 39 добавлено и 6 удалено
  1. 1 1
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseChapterController.java
  2. 1 1
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseClassHourController.java
  3. 1 1
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseNotesController.java
  4. 4 3
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseStudentRelateController.java
  5. 2 0
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/CourseRelateMapper.java
  6. 9 0
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/CourseRelateMapper.xml
  7. 5 0
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/CourseRelateService.java
  8. 7 0
      snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/CourseRelateServiceImpl.java
  9. 3 0
      snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/org/controller/SysOrgController.java
  10. 3 0
      snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/org/mapper/mapping/SysOrgMapper.xml
  11. 3 0
      snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/service/impl/SysUserServiceImpl.java

+ 1 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseChapterController.java

@@ -249,7 +249,7 @@ public class CourseChapterController {
             relateParam.put("infoType","0");
             List<CourseRelate> delCourseRelateList=courseRelateService.wrapperList(relateParam);
             List<String> delCourseRelateIdList=CollStreamUtil.toList(delCourseRelateList, CourseRelate::getId);
-            courseRelateService.deleteByIds(delCourseRelateIdList);
+            courseRelateService.deleteByIdsReal(delCourseRelateIdList);
             courseRelates = courseRelates.stream()
                     .peek(oneCourseRelate -> oneCourseRelate.setChapterhourType("0")) // 修改属性
                     .peek(oneCourseRelate -> oneCourseRelate.setMainId(chapter.getId())) // 修改属性

+ 1 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseClassHourController.java

@@ -150,7 +150,7 @@ public class CourseClassHourController {
             relateParam.put("infoType","0");
             List<CourseRelate> delCourseRelateList=courseRelateService.wrapperList(relateParam);
             List<String> delCourseRelateIdList=CollStreamUtil.toList(delCourseRelateList, CourseRelate::getId);
-            courseRelateService.deleteByIds(delCourseRelateIdList);
+            courseRelateService.deleteByIdsReal(delCourseRelateIdList);
             courseRelates = courseRelates.stream()
                     .peek(oneCourseRelate -> oneCourseRelate.setChapterhourType("1"))
                     .peek(oneCourseRelate -> oneCourseRelate.setMainId(classHour.getId())) // 修改属性

+ 1 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseNotesController.java

@@ -173,7 +173,7 @@ public class CourseNotesController {
         param.put("relateIdList", deleteNoteIdList);
         List<CourseRelate> courseRelateList=courseRelateService.wrapperList(param);
         List<String> deleteRelateIdList=CollStreamUtil.toList(courseRelateList, CourseRelate::getId);
-        courseRelateService.deleteByIds(deleteRelateIdList);
+        courseRelateService.deleteByIdsReal(deleteRelateIdList);
         return CommonResult.ok();
     }
 

+ 4 - 3
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseStudentRelateController.java

@@ -151,11 +151,12 @@ public class CourseStudentRelateController {
         param.put("courseId", courseStudentRelateAddParam.getCourseId());
         List<CourseStudentRelate> alreadyRelateList=courseStudentRelateService.listWrapper(param);
         List<String> alreadyRelateIdList=CollStreamUtil.toList(alreadyRelateList, CourseStudentRelate::getUserId);
-        for(String willUserId:willUserIdList)
+        for (int i = willUserIdList.size() - 1; i >= 0; i--)
         {
+            String willUserId = willUserIdList.get(i);
             if(alreadyRelateIdList.contains(willUserId))
             {
-                willUserIdList.remove(willUserId);
+                willUserIdList.remove(i);
             }
         }
         if(willUserIdList.size()>0)
@@ -166,9 +167,9 @@ public class CourseStudentRelateController {
                 courseStudentRelate.setUserId(willUserId);
                 willAddList.add(courseStudentRelate);
             }
+            courseStudentRelateService.addBatch(willAddList);
         }
 
-        courseStudentRelateService.addBatch(willAddList);
         return CommonResult.ok();
     }
 

+ 2 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/CourseRelateMapper.java

@@ -30,4 +30,6 @@ public interface CourseRelateMapper extends BaseMapper<CourseRelate> {
      * 获取课程-相关关联表-map列表
      */
     List<Map<String,Object>> queryMapList(Map param);
+
+    void deleteByIdsReal(List<String> deleteIdList);
 }

+ 9 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/CourseRelateMapper.xml

@@ -1,6 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="vip.xiaonuo.disk.mapper.CourseRelateMapper">
+    <delete id="deleteByIdsReal">
+        <if test="deleteIdList !=null and deleteIdList.size()>0">
+            DELETE FROM COURSE_RELATE WHERE ID IN
+            <foreach collection=" deleteIdList" close=")" index="index" item="item" open="(" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
+    </delete>
 
     <select id="queryMapList" resultType="java.util.Map" >
         SELECT

+ 5 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/CourseRelateService.java

@@ -100,6 +100,11 @@ public interface CourseRelateService extends IService<CourseRelate> {
 
     void deleteByIds(List<String> deleteIdList);
 
+    /**
+     * 课程-相关关联-真实删除
+     */
+    void deleteByIdsReal(List<String> deleteIdList);
+
     /**
      * 获取课程-相关关联表详情
      *

+ 7 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/CourseRelateServiceImpl.java

@@ -161,6 +161,13 @@ public class CourseRelateServiceImpl extends ServiceImpl<CourseRelateMapper, Cou
         this.removeByIds(deleteIdList);
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void deleteByIdsReal(List<String> deleteIdList)
+    {
+        courseRelateMapper.deleteByIdsReal(deleteIdList);
+    }
+
     @Override
     public CourseRelate detail(CourseRelateIdParam courseRelateIdParam) {
         return this.queryEntity(courseRelateIdParam.getId());

+ 3 - 0
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/org/controller/SysOrgController.java

@@ -210,6 +210,8 @@ public class SysOrgController {
     @GetMapping("/sys/org/orgUserTreeSelector")
     public CommonResult<List<Map<String,Object>>> orgUserTreeSelector(HttpServletRequest req) {
         Map param=new HashMap();
+        param.put("category",req.getParameter("category"));
+
         Map result = new HashMap();
         String collegeParentId = "0";
         if(StringUtils.isNotEmpty(req.getParameter("collegeParentId")))collegeParentId=req.getParameter("collegeParentId");
@@ -260,6 +262,7 @@ public class SysOrgController {
     @GetMapping("/sys/org/orgUserTreeRespectively")
     public CommonResult<List<Map<String, Object>>> orgUserTreeRespectively(HttpServletRequest req) {
         Map param =new HashMap();
+        param.put("category",req.getParameter("category"));
         String collegeParentId="0";
         if(StringUtils.isNotEmpty(req.getParameter("collegeParentId")))collegeParentId=req.getParameter("collegeParentId");
         param.put("collegeParentId",collegeParentId );

+ 3 - 0
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/org/mapper/mapping/SysOrgMapper.xml

@@ -16,5 +16,8 @@
         <if test="collegeParentId !=null and collegeParentId != ''">
             AND t1.PARENT_ID =#{collegeParentId}
         </if>
+        <if test="category !=null and category != ''">
+            AND t1.CATEGORY =#{category}
+        </if>
     </select>
 </mapper>

+ 3 - 0
snowy-plugin/snowy-plugin-sys/snowy-plugin-sys-func/src/main/java/vip/xiaonuo/sys/modular/user/service/impl/SysUserServiceImpl.java

@@ -300,6 +300,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         if (ObjectUtil.isNotEmpty(sysUserPageParam.getName())) {
             queryWrapper.lambda().like(SysUser::getName, sysUserPageParam.getName());
         }
+        if (ObjectUtil.isNotEmpty(sysUserPageParam.getIsResourceaccount())) {
+            queryWrapper.lambda().eq(SysUser::getIsResourceaccount, sysUserPageParam.getIsResourceaccount());
+        }
 
         queryWrapper.lambda().orderByAsc(SysUser::getSortCode);
         List<SysUser> jsonList =  this.list(queryWrapper);