修复bug2
This commit is contained in:
@ -131,8 +131,8 @@ public class AppVideoController extends BaseController {
|
||||
* 删除语音文件
|
||||
*/
|
||||
@GetMapping("/deleteAudioFile")
|
||||
public R<Void> deleteAudioFile(Long fileId,Long deviceId) {
|
||||
return audioProcessService.deleteAudioFile(fileId,deviceId);
|
||||
public R<Void> deleteAudioFile(Long id) {
|
||||
return audioProcessService.deleteAudioFile(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -6,6 +6,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
@Data
|
||||
public class AppFileRenameDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
|
||||
@ -414,19 +414,18 @@ public class AudioProcessService {
|
||||
}
|
||||
|
||||
private Long getUserId(String source,Long deviceId){
|
||||
Long userId = null;
|
||||
if("app".equals( source)){
|
||||
userId = AppLoginHelper.getUserId();
|
||||
return AppLoginHelper.getUserId();
|
||||
} else if ("web".equals( source)){
|
||||
AppDeviceBindRecordBo appDeviceBindRecordBo = new AppDeviceBindRecordBo();
|
||||
appDeviceBindRecordBo.setDeviceId(deviceId);
|
||||
appDeviceBindRecordBo.setCommunicationMode(0);
|
||||
List<AppDeviceBindRecordVo> appDeviceBindRecordVos = appDeviceBindRecordService.queryList(appDeviceBindRecordBo);
|
||||
if (appDeviceBindRecordVos != null && !appDeviceBindRecordVos.isEmpty()){
|
||||
userId = appDeviceBindRecordVos.get(0).getBindingUserId();
|
||||
}
|
||||
// AppDeviceBindRecordBo appDeviceBindRecordBo = new AppDeviceBindRecordBo();
|
||||
// appDeviceBindRecordBo.setDeviceId(deviceId);
|
||||
//// appDeviceBindRecordBo.setCommunicationMode(0);
|
||||
// List<AppDeviceBindRecordVo> appDeviceBindRecordVos = appDeviceBindRecordService.queryList(appDeviceBindRecordBo);
|
||||
// if (appDeviceBindRecordVos != null && !appDeviceBindRecordVos.isEmpty()){
|
||||
// userId = appDeviceBindRecordVos.get(0).getBindingUserId();
|
||||
// }
|
||||
}
|
||||
return userId;
|
||||
return 0L;
|
||||
}
|
||||
/**
|
||||
* 校验音频文件格式
|
||||
@ -572,26 +571,29 @@ public class AudioProcessService {
|
||||
if(deviceId == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
Long userId = getUserId(source, deviceId);
|
||||
AppBusinessFileBo bo = new AppBusinessFileBo();
|
||||
bo.setBusinessId(deviceId);
|
||||
bo.setCreateBy(userId);
|
||||
bo.setFileType(3L);
|
||||
if("web".equals(source)){
|
||||
bo.setCreateBy(null);
|
||||
}else{
|
||||
bo.setCreateBy(userId);
|
||||
}
|
||||
return appBusinessFileService.queryAppFileList(bo);
|
||||
}
|
||||
|
||||
public R<Void> deleteAudioFile(Long fileId,Long deviceId) {
|
||||
public R<Void> deleteAudioFile(Long id) {
|
||||
UpdateWrapper<AppBusinessFile> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("file_id",fileId);
|
||||
updateWrapper.eq("business_id",deviceId);
|
||||
updateWrapper.eq("id",id);
|
||||
appBusinessFileMapper.delete(updateWrapper);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
public R<Void> renameAudioFile(AppFileRenameDto bo) {
|
||||
UpdateWrapper<AppBusinessFile> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("file_id",bo.getFileId());
|
||||
updateWrapper.eq("business_id",bo.getDeviceId());
|
||||
updateWrapper.eq("id",bo.getId());
|
||||
updateWrapper.set("re_name",bo.getFileName());
|
||||
appBusinessFileMapper.update(updateWrapper);
|
||||
return R.ok();
|
||||
|
||||
@ -123,8 +123,8 @@ public class WebVideoController extends BaseController {
|
||||
* 删除语音文件
|
||||
*/
|
||||
@GetMapping("/deleteAudioFile")
|
||||
public R<Void> deleteAudioFile(Long fileId,Long deviceId) {
|
||||
return audioProcessService.deleteAudioFile(fileId,deviceId);
|
||||
public R<Void> deleteAudioFile(Long id) {
|
||||
return audioProcessService.deleteAudioFile(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -38,6 +38,7 @@ public class WebDeviceHBY100JController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/updateVoice")
|
||||
public R<Void> updateVoice(@RequestBody HBY100JUpdateVoiceDto dto) {
|
||||
dto.setCommunicationMode(0);
|
||||
deviceHBY100JBizService.updateVoice(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ public class DeviceHBY100JBizService {
|
||||
if(StringUtils.isNotBlank(voicePlayStatus)){
|
||||
FuncType6VoicePlayRequest funcType6VoicePlayRequest = JSONObject.parseObject(voicePlayStatus, FuncType6VoicePlayRequest.class);
|
||||
if(funcType6VoicePlayRequest.getData() != null){
|
||||
vo.setVolume(funcType6VoicePlayRequest.getData().getVoiceBroadcast());
|
||||
vo.setVoiceBroadcast(funcType6VoicePlayRequest.getData().getVoiceBroadcast());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user