Forráskód Böngészése

feat:云教练评测视频上传

Joburgess 4 éve
szülő
commit
3161e05e96

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

@@ -68,7 +68,14 @@ public class SysMusicCompareRecord {
 	private float playTime = 0;
 
 	private String clientId;
-	
+
+	public SysMusicCompareRecord() {
+	}
+
+	public SysMusicCompareRecord(FeatureType feature) {
+		this.feature = feature;
+	}
+
 	public void setId(Long id){
 		this.id = id;
 	}

+ 0 - 4
mec-biz/src/main/java/com/ym/mec/biz/handler/WebSocketHandler.java

@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.dal.dto.WebSocketClientDetail;
 import com.ym.mec.biz.dal.dto.WebSocketInfo;
 import com.ym.mec.biz.dal.enums.WebsocketTypeEnum;
-import com.ym.mec.biz.service.SoundSocketService;
 import com.ym.mec.biz.service.WebSocketEventHandler;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -16,7 +13,6 @@ import org.springframework.web.socket.*;
 import org.springframework.web.socket.handler.AbstractWebSocketHandler;
 
 import java.io.IOException;
-import java.util.Date;
 import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;

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

@@ -10,10 +10,7 @@ import com.ym.mec.biz.dal.config.SoundCompareConfig;
 import com.ym.mec.biz.dal.dao.SysMusicScoreAccompanimentDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.SysMusicCompareRecord;
-import com.ym.mec.biz.dal.enums.DeviceTypeEnum;
-import com.ym.mec.biz.dal.enums.HeardLevelEnum;
-import com.ym.mec.biz.dal.enums.MusicalErrorTypeEnum;
-import com.ym.mec.biz.dal.enums.WebsocketTypeEnum;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.handler.WebSocketHandler;
 import com.ym.mec.biz.service.SoundSocketService;
 import com.ym.mec.biz.service.SysMusicCompareRecordService;
@@ -135,7 +132,7 @@ public class SoundCompareHandler implements WebSocketEventHandler {
                     musicPitchDetailDto.setDontEvaluating(dc == userMeasureXmlInfoEntry.getValue().size());
                     userSoundInfoMap.get(phone).getMeasureEndTime().put(userMeasureXmlInfoEntry.getKey(), musicPitchDetailDto);
                 }
-                SysMusicCompareRecord sysMusicCompareRecord = new SysMusicCompareRecord();
+                SysMusicCompareRecord sysMusicCompareRecord = new SysMusicCompareRecord(FeatureType.CLOUD_STUDY_EVALUATION);
                 sysMusicCompareRecordService.insert(sysMusicCompareRecord);
                 LOGGER.info("评测记录编号:{}", sysMusicCompareRecord.getId());
                 userSoundInfoMap.get(phone).setRecordId(sysMusicCompareRecord.getId());
@@ -296,7 +293,8 @@ public class SoundCompareHandler implements WebSocketEventHandler {
         //存储评分数据
         if(saveData){
             sysMusicCompareRecordService.saveMusicCompareData(phone, userSoundInfoMap.get(phone));
-        }else if(Objects.nonNull(userSoundInfoMap.get(phone).getFile())){
+            userSoundInfoMap.get(phone).setRecordId(null);
+        }else if(Objects.nonNull(userSoundInfoMap.get(phone).getRecordId())){
             sysMusicCompareRecordService.delete(userSoundInfoMap.get(phone).getRecordId());
         }