|
@@ -4900,6 +4900,68 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询【公司-视频】答题奖励配置
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public FsCourseAnswerRewardVO getAnswerRewardConfig(Long videoId, Long companyId) {
|
|
|
|
|
+ String json = configService.selectConfigByKey("course.config");
|
|
|
|
|
+ CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseAnswerRewardVO vo = new FsCourseAnswerRewardVO();
|
|
|
|
|
+ vo.setRedPacketRuleId(videoRelationMapper.getRewardIdByCompanyIdAndVideoIdAndType(companyId, videoId, 2));
|
|
|
|
|
+ vo.setPointRuleId(videoRelationMapper.getRewardIdByCompanyIdAndVideoIdAndType(companyId, videoId, 3));
|
|
|
|
|
+ vo.setTurntableRuleId(videoRelationMapper.getRewardIdByCompanyIdAndVideoIdAndType(companyId, videoId, 4));
|
|
|
|
|
+ vo.setTurntableGuaranteeRuleId(videoRelationMapper.getRewardIdByCompanyIdAndVideoIdAndType(companyId, videoId, 5));
|
|
|
|
|
+ vo.setDefaultRedPacketAmount(config.getRedPackageMoney());
|
|
|
|
|
+ vo.setDefaultPointNum(config.getAnswerIntegral());
|
|
|
|
|
+ vo.setDefaultAppPointNum(config.getAppAnswerIntegral());
|
|
|
|
|
+ vo.setDefaultTurntableRuleId(config.getDefaultSpinReward());
|
|
|
|
|
+ return vo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 修改【公司-视频】答题奖励配置
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void changeAnswerRewardConfig(FsCourseAnswerRewardParam param, Long companyId) {
|
|
|
|
|
+ videoRelationMapper.deleteByTypes(param.getVideoId(), companyId, Arrays.asList(2,3,4,5));
|
|
|
|
|
+
|
|
|
|
|
+ if (Objects.nonNull(param.getRedPacketRuleId())) {
|
|
|
|
|
+ FsCourseRewardVideoRelation relation = new FsCourseRewardVideoRelation();
|
|
|
|
|
+ relation.setVideoSectionId(param.getVideoId());
|
|
|
|
|
+ relation.setRewardId(param.getRedPacketRuleId());
|
|
|
|
|
+ relation.setCompanyId(companyId);
|
|
|
|
|
+ videoRelationMapper.insertFsCourseRewardVideoRelation(relation);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (Objects.nonNull(param.getPointRuleId())) {
|
|
|
|
|
+ FsCourseRewardVideoRelation relation = new FsCourseRewardVideoRelation();
|
|
|
|
|
+ relation.setVideoSectionId(param.getVideoId());
|
|
|
|
|
+ relation.setRewardId(param.getPointRuleId());
|
|
|
|
|
+ relation.setCompanyId(companyId);
|
|
|
|
|
+ videoRelationMapper.insertFsCourseRewardVideoRelation(relation);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (Objects.nonNull(param.getTurntableRuleId())) {
|
|
|
|
|
+ FsCourseRewardVideoRelation relation = new FsCourseRewardVideoRelation();
|
|
|
|
|
+ relation.setVideoSectionId(param.getVideoId());
|
|
|
|
|
+ relation.setRewardId(param.getTurntableRuleId());
|
|
|
|
|
+ relation.setCompanyId(companyId);
|
|
|
|
|
+ videoRelationMapper.insertFsCourseRewardVideoRelation(relation);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (Objects.nonNull(param.getTurntableGuaranteeRuleId())) {
|
|
|
|
|
+ FsCourseRewardVideoRelation relation = new FsCourseRewardVideoRelation();
|
|
|
|
|
+ relation.setVideoSectionId(param.getVideoId());
|
|
|
|
|
+ relation.setRewardId(param.getTurntableGuaranteeRuleId());
|
|
|
|
|
+ relation.setCompanyId(companyId);
|
|
|
|
|
+ videoRelationMapper.insertFsCourseRewardVideoRelation(relation);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
private R executeWithdrawal(FsCourseSendRewardUParam param){
|
|
private R executeWithdrawal(FsCourseSendRewardUParam param){
|
|
|
log.info("进入用户判断");
|
|
log.info("进入用户判断");
|