修复bug
This commit is contained in:
@ -450,8 +450,9 @@ public class AudioProcessService {
|
||||
throw new IllegalArgumentException("只允许上传MP3、WAV、PCM格式的音频文件");
|
||||
}
|
||||
|
||||
long fileSize = 256 * 1024;
|
||||
// 检查文件大小
|
||||
if (file.getSize() > MAX_AUDIO_SIZE) {
|
||||
if (file.getSize() > fileSize) {
|
||||
throw new IllegalArgumentException("音频大小不能超过5MB");
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,4 +7,8 @@ public class HBY100JUpdateVoiceDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 通讯方式 0:4G;1:蓝牙
|
||||
*/
|
||||
private Integer communicationMode;
|
||||
}
|
||||
@ -271,12 +271,12 @@ public class DeviceBizService {
|
||||
if (type == 0) {
|
||||
QueryWrapper<AppDeviceBindRecord> bindRecordQueryWrapper = new QueryWrapper<>();
|
||||
bindRecordQueryWrapper.eq("device_id", device.getId());
|
||||
bindRecordQueryWrapper.eq("binding_user_id", userId);
|
||||
// bindRecordQueryWrapper.eq("binding_user_id", userId);
|
||||
Long count = appDeviceBindRecordMapper.selectCount(bindRecordQueryWrapper);
|
||||
if (count == 0) {
|
||||
throw new RuntimeException("请先绑定设备!!!");
|
||||
}
|
||||
if (count < 2) {
|
||||
if (count <= 1) {
|
||||
UpdateWrapper<Device> deviceUpdateWrapper = new UpdateWrapper<>();
|
||||
deviceUpdateWrapper.eq("id", device.getId())
|
||||
.set("binding_user_id", null)
|
||||
|
||||
@ -285,8 +285,8 @@ public class DeviceHBY100JBizService {
|
||||
if (getDeviceStatus(deviceObj.getDeviceImei())) {
|
||||
throw new ServiceException(deviceObj.getDeviceName() + ",设备已断开连接");
|
||||
}
|
||||
|
||||
AppLoginUser loginUser = AppLoginHelper.getLoginUser();
|
||||
if(dto.getCommunicationMode()!=null && dto.getCommunicationMode()==0){
|
||||
SysOssVo sysOssVo = sysOssMapper.selectVoById(appBusinessFileVo.getFileId());
|
||||
FuncType5UpdateVoiceRequest request = new FuncType5UpdateVoiceRequest();
|
||||
request.setRequestId(GenerateIdUtil.generateNumericId());
|
||||
@ -300,6 +300,7 @@ public class DeviceHBY100JBizService {
|
||||
log.info("HBY100J更新语音,参数:{}", request);
|
||||
|
||||
mqttGateway.sendMsgToMqtt(buildMqttTopic(deviceObj.getDeviceImei()), 1, JSON.toJSONString(request));
|
||||
}
|
||||
|
||||
UpdateWrapper<AppBusinessFile> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("business_id", appBusinessFileVo.getBusinessId());
|
||||
|
||||
Reference in New Issue
Block a user