Browse Source

fix 模考做题记录

tanzh 3 years ago
parent
commit
cfd0345b51

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -75,5 +75,5 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
 
     List<ClassGradeUserGoodsVo> selectGoodsGradeList(Long goodsId);
     List<ClassGradeUserGoodsVo> selectGoodsGradeList(Long goodsId);
 
 
-    List<ClassGradeUserVo> queryCountList(Integer projectId);
+    List<ClassGradeUserVo> queryCountList(@Param("projectId")Integer projectId, @Param("all") Integer all);
 }
 }

+ 11 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -1655,6 +1655,13 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         List<StudyAccountStatusVo> list = new ArrayList<>();
         List<StudyAccountStatusVo> list = new ArrayList<>();
         if (!CollectionUtils.isEmpty(set)) {
         if (!CollectionUtils.isEmpty(set)) {
             for (Long businessId : set) {
             for (Long businessId : set) {
+                LambdaQueryWrapper<CourseBusiness> lqw1 = Wrappers.lambdaQuery();
+                lqw1.eq(CourseBusiness::getId, businessId);
+                lqw1.eq(CourseBusiness::getStatus, 1);
+                CourseBusiness cb = iCourseBusinessService.getOne(lqw1);
+                if (cb == null) {
+                    continue;
+                }
                 Integer notConfiguredNum = 0;
                 Integer notConfiguredNum = 0;
                 Integer interfaceNum = 0;
                 Integer interfaceNum = 0;
                 Integer noInterfaceNum = 0;
                 Integer noInterfaceNum = 0;
@@ -1686,7 +1693,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     vo.setEducationName(courseEducationType.getEducationName());
                     vo.setEducationName(courseEducationType.getEducationName());
                     vo.setEducationTypeId(courseEducationType.getId());
                     vo.setEducationTypeId(courseEducationType.getId());
                 }
                 }
-                List<ClassGradeUserVo> countList = queryCountList(goods.getProjectId());
+                List<ClassGradeUserVo> countList = queryCountList(goods.getProjectId(), 0);
                 for (ClassGradeUserVo classGradeUser : countList) {
                 for (ClassGradeUserVo classGradeUser : countList) {
                     if (Validator.isNotEmpty(classGradeUser.getLearnStatus())) {
                     if (Validator.isNotEmpty(classGradeUser.getLearnStatus())) {
                         //统计账号未开通数量
                         //统计账号未开通数量
@@ -1729,7 +1736,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     }
                     }
                 }
                 }
                 //统计所有班级人数
                 //统计所有班级人数
-                vo.setUserNum(countList.size());
+                vo.setUserNum(queryCountList(goods.getProjectId(), null).size());
                 vo.setNotConfiguredNum(notConfiguredNum);
                 vo.setNotConfiguredNum(notConfiguredNum);
                 vo.setInterfaceNum(interfaceNum);
                 vo.setInterfaceNum(interfaceNum);
                 vo.setNoInterfaceNum(noInterfaceNum);
                 vo.setNoInterfaceNum(noInterfaceNum);
@@ -1751,8 +1758,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     }
     }
 
 
 
 
-    private List<ClassGradeUserVo> queryCountList(Integer projectId) {
-        return baseMapper.queryCountList(projectId);
+    private List<ClassGradeUserVo> queryCountList(Integer projectId, Integer all) {
+        return baseMapper.queryCountList(projectId, all);
     }
     }
 
 
 
 

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -1215,6 +1215,8 @@
         WHERE
         WHERE
           cgu.`status` = 1
           cgu.`status` = 1
           and g.project_id = #{projectId}
           and g.project_id = #{projectId}
-          and (cg.interface_account_id is not null or cg.no_interface_account_id is not null)
+          <if test="all != null and all == 0">
+            and (cg.interface_account_id is not null or cg.no_interface_account_id is not null)
+          </if>
     </select>
     </select>
 </mapper>
 </mapper>