|
@@ -26,6 +26,7 @@ import com.zhongzheng.modules.base.mapper.CertificateTpMapper;
|
|
import com.zhongzheng.modules.base.service.ICertificateTpService;
|
|
import com.zhongzheng.modules.base.service.ICertificateTpService;
|
|
import com.zhongzheng.modules.base.vo.CertificatePhotoVo;
|
|
import com.zhongzheng.modules.base.vo.CertificatePhotoVo;
|
|
import com.zhongzheng.modules.base.vo.CertificateTpVo;
|
|
import com.zhongzheng.modules.base.vo.CertificateTpVo;
|
|
|
|
+import com.zhongzheng.modules.course.mapper.CourseMenuMapper;
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
import com.zhongzheng.modules.course.vo.CourseChapterVo;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
@@ -81,6 +82,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
@Autowired
|
|
@Autowired
|
|
private RedisCache redisCache;
|
|
private RedisCache redisCache;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private CourseMenuMapper courseMenuMapper;
|
|
|
|
|
|
@Value("${certificate.host}")
|
|
@Value("${certificate.host}")
|
|
private String CERTIFICATE_HOST;
|
|
private String CERTIFICATE_HOST;
|
|
@@ -170,6 +173,11 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
|
|
.eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
|
|
.eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
|
|
//获取章列表
|
|
//获取章列表
|
|
List<CourseChapterVo> chapterList = iClassGradeUserService.findChapterList(bo);
|
|
List<CourseChapterVo> chapterList = iClassGradeUserService.findChapterList(bo);
|
|
|
|
+ BigDecimal totalTime = new BigDecimal(0);
|
|
|
|
+ for(CourseChapterVo chapterVo : chapterList){
|
|
|
|
+ totalTime=totalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
|
|
|
|
+ }
|
|
|
|
+ goodsVo.setClassHours(totalTime.divide(new BigDecimal(45*60)));
|
|
UserVo userVo = iUserService.queryById(bo.getUserId());
|
|
UserVo userVo = iUserService.queryById(bo.getUserId());
|
|
if(Validator.isNotEmpty(goodsVo.getCertificateTpId())){
|
|
if(Validator.isNotEmpty(goodsVo.getCertificateTpId())){
|
|
// String[] s = goodsVo.getCertificateIds().split(",");
|
|
// String[] s = goodsVo.getCertificateIds().split(",");
|