|
@@ -340,18 +340,18 @@ public class AliPayOpenDeviceFatoryImpl implements DeviceFactory, SpiDeviceServi
|
|
|
String value = dto.getValue();
|
|
|
|
|
|
//查询设备信息
|
|
|
- DeviceInfo deviceInfo = deviceInfoService.getById(Long.valueOf(terminalId));
|
|
|
+ DeviceInfoDto.Vo deviceInfo = R.feignCheckData(deviceInfoService.obj(new DeviceInfoDto.Obj().setIsSysinfo(true).setDeviceId(Long.valueOf(terminalId))));
|
|
|
if (deviceInfo == null) {
|
|
|
log.warn("温度、音量查询SPI通知,无设备信息");
|
|
|
return SpiResponseConst.SUCCESS;
|
|
|
}
|
|
|
+ DeviceSysinfoDto.Vo deviceSysinfo = deviceInfo.getDeviceSysinfo();
|
|
|
+ boolean isHaveNfc = false;
|
|
|
+ if (deviceSysinfo != null && StrUtil.isNotEmpty(deviceSysinfo.getNfcSn())) {
|
|
|
+ isHaveNfc = true;
|
|
|
+ }
|
|
|
//温度更新
|
|
|
FunctionUtils.NoParamsNoResult updateTmp = () -> {
|
|
|
-// deviceStatus.setTempValue(Integer.valueOf(value));
|
|
|
-// deviceStatusService.updateById(deviceStatus);
|
|
|
-// DeviceSysinfoDto.Up sysUp = new DeviceSysinfoDto.Up();
|
|
|
-// sysUp.setDeviceId(deviceInfo.getDeviceId()).setIsHaveTemp(true);
|
|
|
-// deviceSysinfoService.up(sysUp);
|
|
|
DeviceStatusDto.Up up = new DeviceStatusDto.Up();
|
|
|
up.setDeviceId(deviceInfo.getDeviceId())
|
|
|
.setTempState(0)
|
|
@@ -360,21 +360,19 @@ public class AliPayOpenDeviceFatoryImpl implements DeviceFactory, SpiDeviceServi
|
|
|
};
|
|
|
|
|
|
DeviceStatus deviceStatus = deviceStatusService.getById(deviceInfo.getDeviceId());
|
|
|
- if (deviceStatus == null) {
|
|
|
+ if (deviceStatus == null && !isHaveNfc) {
|
|
|
log.warn("温度、音量查询SPI通知,无设备状态记录");
|
|
|
return SpiResponseConst.SUCCESS;
|
|
|
}
|
|
|
//音量更新
|
|
|
FunctionUtils.NoParamsNoResult updateVoice = () -> {
|
|
|
-// deviceStatus.setVoiceVolume(Integer.valueOf(value));
|
|
|
-// deviceStatusService.updateById(deviceStatus);
|
|
|
DeviceStatusDto.Up up = new DeviceStatusDto.Up();
|
|
|
up.setDeviceId(deviceInfo.getDeviceId())
|
|
|
.setVoiceVolume(Integer.valueOf(value));
|
|
|
deviceStatusService.up(up);
|
|
|
};
|
|
|
|
|
|
- if (BooleanUtil.isTrue(success)) {
|
|
|
+ if (BooleanUtil.isTrue(success) && !isHaveNfc) {
|
|
|
//温度:TEMP 音量:VOL
|
|
|
if ("VOL".equals(type)) {
|
|
|
updateVoice.run();
|
|
@@ -394,13 +392,19 @@ public class AliPayOpenDeviceFatoryImpl implements DeviceFactory, SpiDeviceServi
|
|
|
String value = dto.getValue();
|
|
|
|
|
|
//查询设备信息
|
|
|
- DeviceInfo deviceInfo = deviceInfoService.getById(Long.valueOf(terminalId));
|
|
|
+ DeviceInfoDto.Vo deviceInfo = R.feignCheckData(deviceInfoService.obj(new DeviceInfoDto.Obj().setIsSysinfo(true).setDeviceId(Long.valueOf(terminalId))));
|
|
|
if (deviceInfo == null) {
|
|
|
- log.warn("温度、音量设置SPI通知,无设备信息");
|
|
|
+ log.warn("温度、音量查询SPI通知,无设备信息");
|
|
|
return SpiResponseConst.SUCCESS;
|
|
|
}
|
|
|
+ DeviceSysinfoDto.Vo deviceSysinfo = deviceInfo.getDeviceSysinfo();
|
|
|
+ boolean isHaveNfc = false;
|
|
|
+ if (deviceSysinfo != null && StrUtil.isNotEmpty(deviceSysinfo.getNfcSn())) {
|
|
|
+ isHaveNfc = true;
|
|
|
+ }
|
|
|
+
|
|
|
DeviceStatus deviceStatus = deviceStatusService.getById(deviceInfo.getDeviceId());
|
|
|
- if (deviceStatus == null) {
|
|
|
+ if (deviceStatus == null && !isHaveNfc) {
|
|
|
log.warn("温度、音量设置SPI通知,无设备状态记录");
|
|
|
return SpiResponseConst.SUCCESS;
|
|
|
}
|
|
@@ -415,7 +419,7 @@ public class AliPayOpenDeviceFatoryImpl implements DeviceFactory, SpiDeviceServi
|
|
|
deviceStatusService.updateById(deviceStatus);
|
|
|
};
|
|
|
|
|
|
- if (BooleanUtil.isTrue(success)) {
|
|
|
+ if (BooleanUtil.isTrue(success) && !isHaveNfc) {
|
|
|
//温度:TEMP 音量:VOL
|
|
|
if ("VOL".equals(type)) {
|
|
|
updateVoice.run();
|