Explorar o código

修改 评测速度 数据类型

zouxuan hai 4 meses
pai
achega
ad578db950

+ 3 - 3
audio-analysis/src/main/java/com/yonge/netty/entity/MusicXmlBasicInfo.java

@@ -33,7 +33,7 @@ public class MusicXmlBasicInfo {
 	
 	private String partIndex;
 
-	private int speed;
+	private String speed;
 
 	private String heardLevel;
 
@@ -142,11 +142,11 @@ public class MusicXmlBasicInfo {
 		return partIndex;
 	}
 
-	public int getSpeed() {
+	public String getSpeed() {
 		return speed;
 	}
 
-	public void setSpeed(int speed) {
+	public void setSpeed(String speed) {
 		this.speed = speed;
 	}
 

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SoundCompareHelper.java

@@ -54,7 +54,7 @@ public class SoundCompareHelper implements PitchDetectionHandler {
     private String recordFilePath;
 
     @ApiModelProperty(value = "播放速度")
-    private int speed = 90;
+    private String speed = "90";
 
     @ApiModelProperty(value = "小节xml信息字典")
     private Map<Integer, List<MusicPitchDetailDto>> measureXmlInfoMap = new HashMap<>();
@@ -118,11 +118,11 @@ public class SoundCompareHelper implements PitchDetectionHandler {
         this.recordId = recordId;
     }
 
-    public int getSpeed() {
+    public String getSpeed() {
         return speed;
     }
 
-    public void setSpeed(int speed) {
+    public void setSpeed(String speed) {
         this.speed = speed;
     }
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicCompareRecord.java

@@ -76,7 +76,7 @@ public class SysMusicCompareRecord extends BaseEntity {
 
 	private float playTime = 0;
 
-	private int speed = 90;
+	private String speed = "90";
 
 	private String clientId;
 	

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/MusicPracticeRecordWrapper.java

@@ -508,7 +508,7 @@ public class MusicPracticeRecordWrapper {
                 .sourceTime(record.getSourceTime())
                 .playTime(record.getPlayTime())
                 .playRate(record.getPlayRate())
-                .speed(String.valueOf(OptionalInt.of(record.getSpeed()).orElse(0)))
+                .speed(record.getSpeed())
                 .monday(record.getMonday())
                 .feature(record.getFeature()!=null?record.getFeature().toCbs():null)
                 .heardLevel(record.getHeardLevel() !=null?record.getHeardLevel().getCode():null)
@@ -543,7 +543,7 @@ public class MusicPracticeRecordWrapper {
             sysMusicCompareRecord.setDeviceType(DeviceTypeEnum.valueOf(this.deviceType));
             sysMusicCompareRecord.setSourceTime(this.sourceTime);
             sysMusicCompareRecord.setPlayTime(this.playTime);
-            sysMusicCompareRecord.setSpeed(this.speed!=null?Integer.parseInt(this.speed):90);
+            sysMusicCompareRecord.setSpeed(this.speed);
             sysMusicCompareRecord.setMonday(this.monday);
             sysMusicCompareRecord.setFeature(this.feature!=null? FeatureType.format(this.feature):null);
             sysMusicCompareRecord.setHeardLevel(this.heardLevel!=null? HeardLevelEnum.valueOf(this.heardLevel):null);

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

@@ -118,7 +118,7 @@ public class SoundCompareHandler implements WebSocketEventHandler {
                     userSoundInfoMap.get(phone).setHeardLevel(HeardLevelEnum.valueOf(bodyObject.getString("heardLevel")));
                 }
                 if(bodyObject.containsKey("speed")){
-                    userSoundInfoMap.get(phone).setSpeed(bodyObject.getIntValue("speed"));
+                    userSoundInfoMap.get(phone).setSpeed(bodyObject.getString("speed"));
                 }
                 if(bodyObject.containsKey("subjectId")){
                     userSoundInfoMap.get(phone).setSubjectId(bodyObject.getIntValue("subjectId"));