Преглед на файлове

feat:智能陪练一期

Joburgess преди 3 години
родител
ревизия
30d2129a3d

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MusicalErrorTypeEnum.java

@@ -8,6 +8,9 @@ import com.ym.mec.common.enums.BaseEnum;
 public enum MusicalErrorTypeEnum implements BaseEnum<String, MusicalErrorTypeEnum> {
 	RIGHT("RIGHT", "演奏正确"),
 	WRONG("WRONG", "错音"),
+	CADENCE_WRONG("CADENCE_WRONG", "节奏错误"),
+	INTONATION_WRONG("INTONATION_WRONG", "音准错误"),
+	INTEGRITY_WRONG("INTEGRITY_WRONG", "完整度不足"),
 	NOT_PLAY("NOT_PLAY", "未演奏");
 
 	private String code;

+ 10 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SoundCompareHandler.java

@@ -404,6 +404,7 @@ public class SoundCompareHandler implements WebSocketEventHandler {
 
                 boolean cadenceRight = false;
                 boolean intonationRight = false;
+                boolean integrityRight = false;
 
                 //有效节奏占比
                 float cadenceDuty = cadenceValidNum/compareNum;
@@ -447,13 +448,16 @@ public class SoundCompareHandler implements WebSocketEventHandler {
                 }
                 float integrityDuty = integrityValidNum/compareNum;
                 integrityScore += integrityDuty;
-
-                if(cadenceRight&&intonationRight){
-                    userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.RIGHT));
-                }else if(cadenceRight&&!intonationRight){
-                    userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.WRONG));
+                integrityRight = integrityDuty>0.7;
+
+                if(!cadenceRight){
+                    userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.CADENCE_WRONG));
+                }else if(!intonationRight){
+                    userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.INTONATION_WRONG));
+                }else if(!integrityRight){
+                    userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.INTEGRITY_WRONG));
                 }else{
-                    userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.NOT_PLAY));
+                    userSoundInfoMap.get(phone).getMusicalNotesPlayStats().add(new MusicalNotesPlayStatDto(musicXmlInfo.getMusicalNotesIndex(), MusicalErrorTypeEnum.RIGHT));
                 }
             }
 

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicCompareRecordServiceImpl.java

@@ -168,6 +168,7 @@ public class SysMusicCompareRecordServiceImpl extends BaseServiceImpl<Long, SysM
 
 		PageInfo<SysMusicCompareRecord> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<>();
+		queryInfo.setFeatureType(FeatureType.CLOUD_STUDY_EVALUATION);
 		MapUtil.populateMap(params, queryInfo);
 
 		List<SysMusicCompareRecord> dataList = null;

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/SysMusicCompareRecordMapper.xml

@@ -120,7 +120,7 @@
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysMusicCompareRecord" parameterType="map">
 		SELECT
-			smcr.id_, smcr.user_id_, smcr.sys_music_score_id_, smcr.score_, smcr.intonation_, smcr.cadence_,
+			smcr.id_, smcr.user_id_, smcr.sys_music_score_id_,smcr.heard_level_, smcr.score_, smcr.intonation_, smcr.cadence_,
 		       smcr.integrity_, smcr.record_file_path_, smcr.client_id_, smcr.device_type_, smcr.play_time_,
 		       smcr.monday_, smcr.create_time_,
 			sms.name_ sys_music_score_name_