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

1.论坛修复回复数量bug
2.资源管理加入三级资源类型
3.统计bug修复

honorfire 5 месяцев назад
Родитель
Сommit
628800669f

+ 4 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/domain/CourseAuditRecord.java

@@ -90,6 +90,10 @@ public class CourseAuditRecord extends CommonEntity {
     @ApiModelProperty(value = "二级资源类型", position = 7)
     private String resourceTwoType;
 
+    /** 三级资源类型 */
+    @ApiModelProperty(value = "三级资源类型", position = 7)
+    private String resourceThreeType;
+
     /** 是否推荐 */
     @ApiModelProperty(value = "是否推荐,0否1是", position = 7)
     private String isRecommend;

+ 21 - 6
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/CourseAuditRecordMapper.xml

@@ -27,8 +27,10 @@
             IFNULL (rt.NAME,'') AS resourceTypeName,
             IFNULL (t1.RESOURCE_TWO_TYPE,'') AS resourceTwoType,
             IFNULL (rt2.NAME,'') AS resourceTwoTypeName,
-            IFNULL (CONCAT(t1.RESOURCE_TYPE,',',t1.RESOURCE_TWO_TYPE),'') AS resourceAllType,
-            IFNULL (CONCAT(rt.NAME,',',rt2.NAME),'') AS resourceALLTypeName,
+            IFNULL (t1.RESOURCE_THREE_TYPE,'') AS resourceThreeType,
+            IFNULL (rt3.NAME,'') AS resourceThreeTypeName,
+            IFNULL (CONCAT(t1.RESOURCE_TYPE,',',t1.RESOURCE_TWO_TYPE,',',t1.RESOURCE_THREE_TYPE),'') AS resourceAllType,
+            IFNULL (CONCAT(rt.NAME,',',rt2.NAME,',',rt3.NAME),'') AS resourceALLTypeName,
             IFNULL (t1.COURSE_ID,'') as courseId,
             IFNULL (t3.COURSE_NAME,'') AS courseIdName,
             IFNULL (TRIM(t1.IS_RECOMMEND),'') AS isRecommend,
@@ -38,6 +40,7 @@
         LEFT JOIN RESOURCE_FILE rf ON t2.FILE_ID= rf.FILE_ID
         LEFT JOIN resource_type rt  ON t1.RESOURCE_TYPE =rt.ID AND rt.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN resource_type rt2  ON t1.RESOURCE_TWO_TYPE =rt2.ID AND rt2.DELETE_FLAG ='NOT_DELETE'
+        LEFT JOIN resource_type rt3  ON t1.RESOURCE_THREE_TYPE =rt3.ID AND rt3.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN COURSE_INFO t3 ON t1.COURSE_ID =t3.COURSE_ID AND t3.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN SYS_ORG t4 ON t1.COLLEGE_ID=t4.id AND t4.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN major t5 ON t1.MAJOR_ID=t5.id AND t5.DELETE_FLAG ='NOT_DELETE'
@@ -78,6 +81,9 @@
         <if test="param.resourceTwoType!=null and param.resourceTwoType != ''">
             and t1.RESOURCE_TWO_TYPE=#{param.resourceTwoType}
         </if>
+        <if test="param.resourceThreeType!=null and param.resourceThreeType != ''">
+            and t1.RESOURCE_THREE_TYPE=#{param.resourceThreeType}
+        </if>
         <if test="param.suffix!=null and param.suffix != ''">
             and t2.EXTEND_NAME =#{param.suffix}
         </if>
@@ -144,6 +150,9 @@
         <if test="param.resourceTwoType!=null and param.resourceTwoType != ''">
             and t1.RESOURCE_TWO_TYPE=#{param.resourceTwoType}
         </if>
+        <if test="param.resourceThreeType!=null and param.resourceThreeType != ''">
+            and t1.RESOURCE_THREE_TYPE=#{param.resourceThreeType}
+        </if>
         <if test="param.suffix!=null and param.suffix != ''">
             and t2.EXTEND_NAME like CONCAT('%',#{param.suffix}, '%')
         </if>
@@ -200,8 +209,10 @@
             IFNULL (rt.NAME,'') AS resourceTypeName,
             IFNULL (t1.RESOURCE_TWO_TYPE,'') AS resourceTwoType,
             IFNULL (rt2.NAME,'') AS resourceTwoTypeName,
-            CONCAT(t1.RESOURCE_TYPE,',',t1.RESOURCE_TWO_TYPE) AS resourceAllType,
-            CONCAT(rt.NAME,',',rt2.NAME) AS resourceALLTypeName,
+            IFNULL (t1.RESOURCE_THREE_TYPE,'') AS resourceThreeType,
+            IFNULL (rt3.NAME,'') AS resourceThreeTypeName,
+            IFNULL (CONCAT(t1.RESOURCE_TYPE,',',t1.RESOURCE_TWO_TYPE,',',t1.RESOURCE_THREE_TYPE),'') AS resourceAllType,
+            IFNULL (CONCAT(rt.NAME,',',rt2.NAME,',',rt3.NAME),'') AS resourceALLTypeName,
             IFNULL (t1.KEYWORD ,'') as keyword,
             IFNULL (t1.KEYWORD_VALUE  ,'') as keywordValue,
             IFNULL (t1.COURSE_ID,'') as courseId,
@@ -220,6 +231,7 @@
         LEFT JOIN RESOURCE_FILE rf ON t2.FILE_ID= rf.FILE_ID
         LEFT JOIN resource_type rt  ON t1.RESOURCE_TYPE =rt.ID AND rt.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN resource_type rt2  ON t1.RESOURCE_TWO_TYPE =rt2.ID AND rt2.DELETE_FLAG ='NOT_DELETE'
+        LEFT JOIN resource_type rt3  ON t1.RESOURCE_THREE_TYPE =rt3.ID AND rt3.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN COURSE_INFO t3 ON t1.COURSE_ID =t3.COURSE_ID AND t3.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN SYS_ORG t4 ON t1.COLLEGE_ID=t4.id AND t4.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN major t5 ON t1.MAJOR_ID=t5.id AND t5.DELETE_FLAG ='NOT_DELETE'
@@ -250,8 +262,10 @@
             IFNULL (rt.NAME,'') AS resourceTypeName,
             IFNULL (t1.RESOURCE_TWO_TYPE,'') AS resourceTwoType,
             IFNULL (rt2.NAME,'') AS resourceTwoTypeName,
-            IFNULL (CONCAT(t1.RESOURCE_TYPE,',',t1.RESOURCE_TWO_TYPE),'') AS resourceAllType,
-            IFNULL (CONCAT(rt.NAME,',',rt2.NAME),'') AS resourceALLTypeName,
+            IFNULL (t1.RESOURCE_THREE_TYPE,'') AS resourceThreeType,
+            IFNULL (rt3.NAME,'') AS resourceThreeTypeName,
+            IFNULL (CONCAT(t1.RESOURCE_TYPE,',',t1.RESOURCE_TWO_TYPE,',',t1.RESOURCE_THREE_TYPE),'') AS resourceAllType,
+            IFNULL (CONCAT(rt.NAME,',',rt2.NAME,',',rt3.NAME),'') AS resourceALLTypeName,
             IFNULL (t1.AUTH_TYPE,'') AS authType,
             IFNULL(( SELECT dd1.DICT_LABEL FROM (SELECT d1.DICT_LABEL,d1.DICT_VALUE  FROM  DEV_DICT d1 WHERE PARENT_ID = (SELECT d2.ID  FROM  DEV_DICT d2 WHERE d2.DICT_VALUE='RESOURCE_RECORD_AUTH_TYPE') )dd1 WHERE dd1.DICT_VALUE = TRIM(t1.AUTH_TYPE) ),'') AS authTypeName,
             IFNULL (t1.KEYWORD ,'') as keyword,
@@ -263,6 +277,7 @@
         FROM RESOURCE_RECORD t1
         LEFT JOIN resource_type rt  ON t1.RESOURCE_TYPE =rt.ID AND rt.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN resource_type rt2  ON t1.RESOURCE_TWO_TYPE =rt2.ID AND rt2.DELETE_FLAG ='NOT_DELETE'
+        LEFT JOIN resource_type rt3  ON t1.RESOURCE_THREE_TYPE =rt3.ID AND rt3.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN SYS_ORG t4 ON t1.COLLEGE_ID=t4.id AND t4.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN major t5 ON t1.MAJOR_ID=t5.id AND t5.DELETE_FLAG ='NOT_DELETE'
         LEFT JOIN SYS_ORG t42 ON t1.COLLEGE_TWO_ID=t42.id AND t42.DELETE_FLAG ='NOT_DELETE'

+ 2 - 2
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/VideoAnalysisProgressMapper.xml

@@ -1231,8 +1231,8 @@
                 AND cch1.ID IS NOT NULL
                 AND cc1.ID IS NOT NULL
                 AND ci1.COURSE_ID IS NOT NULL
-                <if test="courseId !=null and courseId != ''">
-                    and ci1.COURSE_ID=#{courseId}
+                <if test="param.courseId !=null and param.courseId != ''">
+                    and ci1.COURSE_ID=#{param.courseId}
                 </if>
                 GROUP BY cch1.ID,cc1.ID,ci1.COURSE_ID
             )basis

+ 4 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/param/courseauditrecord/CourseAuditRecordAddParam.java

@@ -83,6 +83,10 @@ public class CourseAuditRecordAddParam {
     @ApiModelProperty(value = "二级资源类型", position = 7)
     private String resourceTwoType;
 
+    /** 三级资源类型 */
+    @ApiModelProperty(value = "三级资源类型", position = 7)
+    private String resourceThreeType;
+
     /** 是否推荐 */
     @ApiModelProperty(value = "是否推荐,0否1是", position = 7)
     private String isRecommend;

+ 4 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/param/courseauditrecord/CourseAuditRecordEditParam.java

@@ -85,6 +85,10 @@ public class CourseAuditRecordEditParam {
     @ApiModelProperty(value = "二级资源类型", position = 7)
     private String resourceTwoType;
 
+    /** 三级资源类型 */
+    @ApiModelProperty(value = "三级资源类型", position = 7)
+    private String resourceThreeType;
+
     /** 是否推荐 */
     @ApiModelProperty(value = "是否推荐,0否1是", position = 7)
     private String isRecommend;

+ 15 - 1
snowy-plugin/snowy-plugin-forum/snowy-plugin-forum-func/src/main/java/vip/xiaonuo/forum/modular/postreply/service/impl/ForumPostReplyServiceImpl.java

@@ -198,7 +198,12 @@ public class ForumPostReplyServiceImpl extends ServiceImpl<ForumPostReplyMapper,
         // 修改帖子信息中的最后回复
         forumPostInfo.setLastReplyUserId(loginUser.getId());
         forumPostInfo.setLastReplyTime(new Date());
-        forumPostInfo.setReplyCount(forumPostInfo.getReplyCount() + 1);
+        // 查询帖子信息中的实际数量
+        QueryWrapper<ForumPostReply> replyQueryWrapper = new QueryWrapper<>();
+        replyQueryWrapper.lambda().eq(ForumPostReply::getPostId, forumPostInfo.getPostId());
+        List<ForumPostReply> replyList=this.list(replyQueryWrapper);
+//        forumPostInfo.setReplyCount(forumPostInfo.getReplyCount() + 1);
+        forumPostInfo.setReplyCount(replyList.size());
         forumPostInfoMapper.updateById(forumPostInfo);
         return CommonResult.ok();
     }
@@ -250,6 +255,9 @@ public class ForumPostReplyServiceImpl extends ServiceImpl<ForumPostReplyMapper,
     @Transactional(rollbackFor = Exception.class)
     @Override
     public CommonResult<String> delete(List<ForumPostReplyIdParam> forumPostReplyIdParamList) {
+        //根据待删回帖,取出其一来查回当前对应的主帖子
+        ForumPostReply willDelForumPostReply=this.queryEntity(forumPostReplyIdParamList.get(0).getReplyId());
+        ForumPostInfo forumPostInfo = forumPostInfoMapper.selectById(willDelForumPostReply.getPostId());
         // 执行删除
         boolean b = this.removeByIds(CollStreamUtil.toList(forumPostReplyIdParamList, ForumPostReplyIdParam::getReplyId));
         if (b) {
@@ -261,6 +269,12 @@ public class ForumPostReplyServiceImpl extends ServiceImpl<ForumPostReplyMapper,
             QueryWrapper<ForumPostNotLike> queryWrapper1 = new QueryWrapper<>();
             queryWrapper1.lambda().in(ForumPostNotLike::getTargetId, CollStreamUtil.toList(forumPostReplyIdParamList, ForumPostReplyIdParam::getReplyId));
             forumPostNotLikeMapper.delete(queryWrapper1);
+            // 查询主帖子信息中的实际数量,更新
+            QueryWrapper<ForumPostReply> replyQueryWrapper = new QueryWrapper<>();
+            replyQueryWrapper.lambda().eq(ForumPostReply::getPostId, forumPostInfo.getPostId());
+            List<ForumPostReply> replyList=this.list(replyQueryWrapper);
+            forumPostInfo.setReplyCount(replyList.size());
+            forumPostInfoMapper.updateById(forumPostInfo);
             return CommonResult.ok();
         } else {
             return CommonResult.error();