|
@@ -1004,6 +1004,68 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
return classGradeStudentVos;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<ClassGradeStudentAllExportVo> listGradeAllExport(ClassGradeUserQueryBo bo) {
|
|
|
+ if (Validator.isNotEmpty(bo.getIdCard()) && Validator.isNotEmpty(bo.getIdCards())) {
|
|
|
+ String idCard = bo.getIdCard();
|
|
|
+ List<String> idCards = bo.getIdCards();
|
|
|
+ Set<String> set = new HashSet<>();
|
|
|
+ for (String id : idCards) {
|
|
|
+ set.add(id);
|
|
|
+ }
|
|
|
+ set.add(idCard);
|
|
|
+ if (Validator.isNotEmpty(set)) {
|
|
|
+ bo.setIdCards(new ArrayList<>(set));
|
|
|
+ }
|
|
|
+ bo.setIdCard(null);
|
|
|
+ }
|
|
|
+ //查找班级学员
|
|
|
+ List<ClassGradeStudentVo> classGradeStudentVos = baseMapper.listGradeAll(bo);
|
|
|
+ //得到每个学员的课程学习记录
|
|
|
+ for (ClassGradeStudentVo classGradeStudentVo : classGradeStudentVos) {
|
|
|
+ Long secLong = 0L;
|
|
|
+ Long studyLong = 0L;
|
|
|
+
|
|
|
+ SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
|
|
|
+ subjectStudyRecordQueryBo.setGoodsId(classGradeStudentVo.getGoodsId());
|
|
|
+ subjectStudyRecordQueryBo.setUserId(classGradeStudentVo.getUserId());
|
|
|
+ subjectStudyRecordQueryBo.setGradeId(bo.getGradeId());
|
|
|
+ subjectStudyRecordQueryBo.setOrderGoodsId(classGradeStudentVo.getOrderGoodsId());
|
|
|
+ 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();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Long> timeList = classGradeUserMapper.selectStart(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId());
|
|
|
+ if (!org.springframework.util.CollectionUtils.isEmpty(timeList)) {
|
|
|
+ //查找开始学习时间
|
|
|
+ classGradeStudentVo.setStartTime(timeList.get(0));
|
|
|
+ }else{
|
|
|
+ classGradeStudentVo.setStartTime(classGradeUserMapper.selectStartNoPhoto(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ //BigDecimal divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()),2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ //classGradeStudentVo.setStudyNum(divide.multiply(new BigDecimal("100")).longValue());
|
|
|
+ classGradeStudentVo.setSecAllNum(secLong);
|
|
|
+ classGradeStudentVo.setStuAllNum(studyLong);
|
|
|
+ /*UserUpdateQueryBo userUpdateQueryBo = new UserUpdateQueryBo();
|
|
|
+ userUpdateQueryBo.setUserId(classGradeStudentVo.getUserId());
|
|
|
+ classGradeStudentVo.setUserUpdates(iUserUpdateService.queryList(userUpdateQueryBo));*/
|
|
|
+ /*if (Validator.isNotEmpty(classGradeStudentVo.getRebuyOrderGoodsId()) && classGradeStudentVo.getRebuyOrderGoodsId().longValue() > 0) {
|
|
|
+ classGradeStudentVo.setRebuy(orderMapper.getGradePeriod(classGradeStudentVo.getRebuyOrderGoodsId(), classGradeStudentVo.getUserId()));
|
|
|
+ }*/
|
|
|
+ if (ObjectUtils.isNotNull(classGradeStudentVo.getOrgId())){
|
|
|
+ SysTenant tenant = iSysTenantService.getById(classGradeStudentVo.getOrgId());
|
|
|
+ if (ObjectUtils.isNotNull(tenant)){
|
|
|
+ classGradeStudentVo.setTenantName(tenant.getTenantName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean editUserGrade(ClassGradeUserAddQueryBo bo) {
|