|
@@ -3,6 +3,9 @@ package com.zhongzheng.modules.user.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+import com.microsoft.schemas.office.visio.x2012.main.SectionType;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.UserStudyRecord;
|
|
@@ -137,18 +140,35 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
|
|
|
for (GoodsStudyRecordVo goodsStudyRecordVo : list) {
|
|
|
Long secLong = 0L;
|
|
|
Long studyLong = 0L;
|
|
|
+
|
|
|
SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
|
|
|
subjectStudyRecordQueryBo.setGoodId(goodsStudyRecordVo.getGoodsId());
|
|
|
subjectStudyRecordQueryBo.setUserId(goodsStudyRecordVo.getUserId());
|
|
|
List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
|
|
|
for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
|
|
|
+ String sectionType = "";
|
|
|
secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
|
|
|
studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(baseMapper.sectionType(subjectStudyRecordVo.getCourseId(),1L))){
|
|
|
+ sectionType = sectionType.concat("1,");
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isNotEmpty(baseMapper.sectionType(subjectStudyRecordVo.getCourseId(),2L))){
|
|
|
+ sectionType = sectionType.concat("2,");
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isNotEmpty(baseMapper.sectionType(subjectStudyRecordVo.getCourseId(),3L))){
|
|
|
+ sectionType = sectionType.concat("3,");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(sectionType)) {
|
|
|
+ subjectStudyRecordVo.setSectionType(sectionType.substring(0, sectionType.length() - 1));
|
|
|
+ }
|
|
|
}
|
|
|
BigDecimal divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()),2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
goodsStudyRecordVo.setStudyNum(divide.multiply(new BigDecimal("100")).longValue());
|
|
|
goodsStudyRecordVo.setSubjectStudyRecordVos(subjectStudyRecordVos);
|
|
|
+ goodsStudyRecordVo.setSecAllNum(secLong);
|
|
|
+ goodsStudyRecordVo.setStuAllNum(studyLong);
|
|
|
}
|
|
|
|
|
|
return list;
|