|
@@ -314,6 +314,80 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<ClassPeriodStudentExportVo> exportPo(ClassGradeUserQueryBo bo) {
|
|
|
+ //查询班级学员信息
|
|
|
+ List<ClassPeriodStudentVo> classPeriodStudentVos = baseMapper.listUserPeriod(bo);
|
|
|
+ List<ClassPeriodStudentExportVo> exportList = new ArrayList<>();
|
|
|
+ //查找学员学习记录
|
|
|
+ for (ClassPeriodStudentVo classPeriodStudentVo : classPeriodStudentVos) {
|
|
|
+ Long secLong = 0L;
|
|
|
+ Long studyLong = 0L;
|
|
|
+
|
|
|
+ SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
|
|
|
+ subjectStudyRecordQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
|
|
|
+ subjectStudyRecordQueryBo.setUserId(classPeriodStudentVo.getUserId());
|
|
|
+ subjectStudyRecordQueryBo.setGradeId(bo.getGradeId());
|
|
|
+ List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
|
|
|
+ for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
|
|
|
+ secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
|
|
|
+ studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
|
|
|
+
|
|
|
+ }
|
|
|
+ //BigDecimal divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()),2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ //classGradeStudentVo.setStudyNum(divide.multiply(new BigDecimal("100")).longValue());
|
|
|
+ //总节数
|
|
|
+ classPeriodStudentVo.setSecAllNum(secLong);
|
|
|
+ //学习节数
|
|
|
+ classPeriodStudentVo.setStuAllNum(studyLong);
|
|
|
+
|
|
|
+ //总的审核状态按照策划规则
|
|
|
+ ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
|
|
|
+ classGradeUserQueryBo.setGradeId(bo.getGradeId());
|
|
|
+ classGradeUserQueryBo.setUserId(classPeriodStudentVo.getUserId());
|
|
|
+ classGradeUserQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
|
|
|
+ List<ClassPeriodUserVo> classPeriodUserVos1 = baseMapper.listPeriod(classGradeUserQueryBo);
|
|
|
+ ClassPeriodUserVo classPeriodUserVos = classPeriodUserVos1.get(0);
|
|
|
+ classPeriodUserVos.setPending(classPeriodStudentVo.getSecAllNum()-classPeriodUserVos.getPass()-classPeriodUserVos.getCheat());
|
|
|
+ classPeriodUserVos.setExamPending(classPeriodUserVos.getExamNum()-classPeriodUserVos.getExamPass()-classPeriodUserVos.getExamCheat());
|
|
|
+ //當前班級學員審核狀態 -1不可审核 0待審 1未通过 2通过
|
|
|
+ Integer gradePeriodStatus = 0; //班级里的审核状态字段,保持一致 0 未通过 1通过 2待审核 -1 不可审核
|
|
|
+ if (classPeriodStudentVo.getStuAllNum().equals(classPeriodStudentVo.getSecAllNum()) && classPeriodStudentVo.getExamNum().equals(classPeriodStudentVo.getRecordNum())){
|
|
|
+ if (classPeriodUserVos.getPending() != 0 || classPeriodUserVos.getExamPending() != 0){
|
|
|
+ classPeriodStudentVo.setAllStatus(0);
|
|
|
+ gradePeriodStatus = 2;
|
|
|
+ }else if (classPeriodUserVos.getCheat() != 0 || classPeriodUserVos.getExamCheat() != 0){
|
|
|
+ classPeriodStudentVo.setAllStatus(1);
|
|
|
+ gradePeriodStatus = 0;
|
|
|
+ }else {
|
|
|
+ classPeriodStudentVo.setAllStatus(2);
|
|
|
+ gradePeriodStatus = 1;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ classPeriodStudentVo.setAllStatus(-1);
|
|
|
+ gradePeriodStatus = -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ classPeriodStudentVo.setWaitRebuildNum(classPeriodUserVos.getCheat()+classPeriodUserVos.getExamCheat());
|
|
|
+ if (!CollectionUtils.isEmpty(baseMapper.selectStart(classPeriodStudentVo.getUserId(),classPeriodStudentVo.getGoodsId(),classPeriodStudentVo.getGradeId()))) {
|
|
|
+ //查找开始学习时间
|
|
|
+ classPeriodStudentVo.setStartTime(baseMapper.selectStart(classPeriodStudentVo.getUserId(),classPeriodStudentVo.getGoodsId(),classPeriodStudentVo.getGradeId()).get(0));
|
|
|
+ }
|
|
|
+ ClassPeriodStudentExportVo addItem = BeanUtil.toBean(classPeriodStudentVo, ClassPeriodStudentExportVo.class);
|
|
|
+
|
|
|
+ List<UserPeriodVo> periodVoList = new ArrayList<>();
|
|
|
+ UserPeriodVo v1 = new UserPeriodVo();
|
|
|
+ v1.setSectionId(113L);
|
|
|
+ UserPeriodVo v2 = new UserPeriodVo();
|
|
|
+ v2.setSectionId(115L);
|
|
|
+ periodVoList.add(v1);
|
|
|
+ periodVoList.add(v2);
|
|
|
+ addItem.setPeriodVoList(periodVoList);
|
|
|
+ exportList.add(addItem);
|
|
|
+ }
|
|
|
+ return exportList;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean updateByEditBo(ClassGradeUserEditBo bo) {
|
|
|
for (Long aLong : bo.getId()) {
|