zhb.dong 1 år sedan
förälder
incheckning
6987e04fc7

+ 4 - 11
zd-modules/zd-exam/src/main/java/com/zd/exam/service/convert/ConvertTimingService.java

@@ -114,17 +114,13 @@ public class ConvertTimingService {
         obtainBonusPoints.put("joinUserId", convertRecord.getUserId());
         // 渠道资源
         obtainBonusPoints.put("channelSource", convertRecord.getBusinessId());
-
         // 模拟练习每题获得奖励分值 乘法取余
         Long rpactiseRule = scoreRewardconfig.getExerciseScore();
-
         // 模拟考试 除法取余
         Long examRule = scoreRewardconfig.getMockExam();
-
         // 学习时长 除法取余
         Long learnRule = scoreRewardconfig.getStudyLen();
 
-
         // 暂时只处理 非遗留的换算
         if(convertRecord.getParentId() == null){
             // deductPoints 奖励分计算并 取余数值保留用作下次计算
@@ -134,7 +130,7 @@ public class ConvertTimingService {
                 deductPoints = convertRecord.getBusinessNum() * rpactiseRule;
                 convertRecord.setUseNum(convertRecord.getBusinessNum());
                 reason = "练习得分";
-
+                logger.info("convertRecord type is {},deductPoints : {},channelType :{},reason:{}",ConvertType.PRACTISE,deductPoints, channelType, reason);
             }else if(ConvertType.EXAMPAPER.equals(convertRecord.getType()) && examRule != null && examRule > 0){
                 isLegacy = true;
                 channelType = ConvertType.rewardType.EXAMPAPER.toString();
@@ -142,33 +138,30 @@ public class ConvertTimingService {
                 deductPoints = convertRecord.getBusinessNum()/examRule;
                 legacyNum = convertRecord.getBusinessNum()%examRule;
                 convertRecord.setUseNum(deductPoints * examRule);
-
                 // 此ID 为试卷ID 需反查出考试名称
                 String examTitle = Optional.ofNullable(elPaperMapper.selectExamTitleByPaperId(convertRecord.getBusinessId())).orElse("");
 
                 reason = examTitle + "考试得分";
+                logger.info("convertRecord type is {},deductPoints : {},legacyNum :{},channelType:{} ,reason:{}",ConvertType.EXAMPAPER,deductPoints, legacyNum, channelType,reason);
             }else if(ConvertType.LEARN.equals(convertRecord.getType()) && learnRule != null && learnRule > 0){
                 isLegacy = true;
                 channelType = ConvertType.rewardType.LEARN.toString();
 
-                logger.error(JSONUtil.toJsonStr(convertRecord));
                 // 学习时长秒转分钟
-
                 deductPoints = (convertRecord.getBusinessNum()/60)/learnRule;
                 convertRecord.setUseNum(deductPoints * 60 * learnRule);
                 legacyNum = (convertRecord.getBusinessNum()/60)%learnRule;
-
-                logger.error("deductPoints : " + deductPoints  + ",legacyNum :" + legacyNum);
-
                 // 此ID 为学习记录ID 需要反查出资源名称
                 String courseTitle = Optional.ofNullable(elCourseChapterMapper.selectCourseTitleByChapterId(convertRecord.getBusinessId())).orElse("");
                 reason = courseTitle+ "学习得分";
+                logger.info("convertRecord type is {},deductPoints : {},legacyNum :{},reason:{}",ConvertType.LEARN,deductPoints,legacyNum,reason);
             }else if(ConvertType.ASSESS.equals(convertRecord.getType()) && rpactiseRule != null && rpactiseRule > 0){
                 isLegacy = true;
                 channelType = ConvertType.rewardType.PRACTISE.toString();
                 deductPoints = convertRecord.getBusinessNum() * rpactiseRule;
                 convertRecord.setUseNum(convertRecord.getBusinessNum());
                 reason = "考核得分";
+                logger.info("convertRecord type is {},deductPoints : {},reason:{}",ConvertType.ASSESS,deductPoints,reason);
             }
 
             // 渠道类型