|
@@ -23,10 +23,16 @@ import com.zhongzheng.modules.alioss.service.OssService;
|
|
|
import com.zhongzheng.modules.base.domain.UserProfile;
|
|
|
import com.zhongzheng.modules.base.service.IUserProfileService;
|
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
|
+import com.zhongzheng.modules.course.domain.CourseMenuExam;
|
|
|
+import com.zhongzheng.modules.course.service.ICourseBusinessService;
|
|
|
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
|
+import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
|
+import com.zhongzheng.modules.grade.domain.ClassGrade;
|
|
|
import com.zhongzheng.modules.grade.domain.StudyCountLog;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeService;
|
|
|
import com.zhongzheng.modules.grade.service.IStudyCountLogService;
|
|
@@ -123,6 +129,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
@Autowired
|
|
|
private IUserProfileService iUserProfileService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseBusinessService iCourseBusinessService;
|
|
|
+
|
|
|
@Value("${aliyun.oss.endpoint}")
|
|
|
private String ALIYUN_OSS_ENDPOINT;
|
|
|
|
|
@@ -1604,6 +1613,87 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return baseMapper.selectPeriodNotPush(bo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<StudyAccountStatusVo> listStudyAccountStatus(StudyAccountStatusQueryBo bo) {
|
|
|
+ LambdaQueryWrapper<Goods> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(bo.getEducationTypeId() != null, Goods::getEducationTypeId, bo.getEducationTypeId());
|
|
|
+ lqw.groupBy(Goods::getBusinessId);
|
|
|
+ List<Goods> goodsList = iGoodsService.list(lqw);
|
|
|
+
|
|
|
+ List<StudyAccountStatusVo> list = new ArrayList<>();
|
|
|
+ StudyAccountStatusVo vo = new StudyAccountStatusVo();
|
|
|
+ int notConfiguredNum = 0;
|
|
|
+ int interfaceNum = 0;
|
|
|
+ int noInterfaceNum = 0;
|
|
|
+ int openNum = 0;
|
|
|
+ int noOpenNum = 0;
|
|
|
+ int failNum = 0;
|
|
|
+ int finishNum = 0;
|
|
|
+ int noFinishNum = 0;
|
|
|
+ if (!CollectionUtils.isEmpty(goodsList)) {
|
|
|
+ for (Goods goods : goodsList) {
|
|
|
+ List<ClassGradeVo> classGradeList = iClassGradeService.selectByBusinessId(goods.getBusinessId());
|
|
|
+ vo.setBusinessId(goods.getBusinessId());
|
|
|
+ CourseBusinessVo courseBusinessVo = iCourseBusinessService.queryById(goods.getBusinessId());
|
|
|
+ vo.setBusinessName(courseBusinessVo.getBusinessName());
|
|
|
+ if (goods.getStatus() == 1) {
|
|
|
+ for (ClassGradeVo classGrade : classGradeList) {
|
|
|
+ LambdaQueryWrapper<ClassGradeUser> lq = Wrappers.lambdaQuery();
|
|
|
+ lq.eq(ClassGradeUser::getGradeId, classGrade.getGradeId());
|
|
|
+ List<ClassGradeUser> classGradeUsers = iClassGradeUserService.list(lq);
|
|
|
+ for (ClassGradeUser classGradeUser : classGradeUsers) {
|
|
|
+ //统计账号未开通数量
|
|
|
+ if (classGradeUser.getLearnStatus() == 0) {
|
|
|
+ noOpenNum++;
|
|
|
+ }
|
|
|
+ //统计账号未开通数量
|
|
|
+ if (classGradeUser.getLearnStatus() == 1) {
|
|
|
+ openNum++;
|
|
|
+ }
|
|
|
+ //统计账号标记失败数量
|
|
|
+ if (classGradeUser.getLearnStatus() == 2) {
|
|
|
+ failNum++;
|
|
|
+ }
|
|
|
+ //统计已学完数量
|
|
|
+ if (classGradeUser.getFinishStatus() == 0) {
|
|
|
+ finishNum++;
|
|
|
+ }
|
|
|
+ if (classGradeUser.getFinishStatus() == 1) {
|
|
|
+ noFinishNum++;
|
|
|
+ }
|
|
|
+ //统计未学完数量
|
|
|
+ }
|
|
|
+ //统计未配置班级数量
|
|
|
+ if (Validator.isEmpty(classGrade.getInterfaceAccountId()) && Validator.isEmpty(classGrade.getNoInterfaceAccountId())) {
|
|
|
+ notConfiguredNum++;
|
|
|
+ }
|
|
|
+ //统计有接口班级数量
|
|
|
+ if (Validator.isNotEmpty(classGrade.getInterfaceAccountId())) {
|
|
|
+ interfaceNum++;
|
|
|
+ }
|
|
|
+ //统计无接口班级数量
|
|
|
+ if (Validator.isNotEmpty(classGrade.getNoInterfaceAccountId())) {
|
|
|
+ noInterfaceNum++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //统计所有班级人数
|
|
|
+ vo.setUserNum(classGradeList.size());
|
|
|
+ }
|
|
|
+ vo.setNotConfiguredNum(notConfiguredNum);
|
|
|
+ vo.setInterfaceNum(interfaceNum);
|
|
|
+ vo.setNoInterfaceNum(noInterfaceNum);
|
|
|
+ vo.setOpenNum(openNum);
|
|
|
+ vo.setNoOpenNum(noOpenNum);
|
|
|
+ vo.setFailNum(failNum);
|
|
|
+ vo.setFinishNum(finishNum);
|
|
|
+ vo.setNoFinishNum(noFinishNum);
|
|
|
+
|
|
|
+ list.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 实体类转化成视图对象
|