fix: 扫描设备二维码,bug修复。
This commit is contained in:
@@ -824,19 +824,19 @@ public class DeviceController extends BaseController {
|
||||
.eq(LinkedCtrl::getDeviceId, device.getId())
|
||||
.select(LinkedCtrl::getId)
|
||||
);
|
||||
|
||||
|
||||
if (!linkedCtrls.isEmpty()) {
|
||||
List<Long> linkedCtrlIds = linkedCtrls.stream()
|
||||
.map(LinkedCtrl::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
// 2. 解除关联的开关绑定
|
||||
deviceSwitchMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceSwitch>()
|
||||
.set(DeviceSwitch::getLinkedCtrlId, null)
|
||||
.in(DeviceSwitch::getLinkedCtrlId, linkedCtrlIds)
|
||||
);
|
||||
|
||||
|
||||
// 3. 删除联动控制记录
|
||||
linkedCtrlMapper.delete(
|
||||
new LambdaQueryWrapper<LinkedCtrl>()
|
||||
@@ -985,19 +985,19 @@ public class DeviceController extends BaseController {
|
||||
.eq(LinkedCtrl::getDeviceId, request.getId())
|
||||
.select(LinkedCtrl::getId)
|
||||
);
|
||||
|
||||
|
||||
if (!linkedCtrls.isEmpty()) {
|
||||
List<Long> linkedCtrlIds = linkedCtrls.stream()
|
||||
.map(LinkedCtrl::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
// 2. 解除关联的开关绑定
|
||||
deviceSwitchMapper.update(null,
|
||||
new LambdaUpdateWrapper<DeviceSwitch>()
|
||||
.set(DeviceSwitch::getLinkedCtrlId, null)
|
||||
.in(DeviceSwitch::getLinkedCtrlId, linkedCtrlIds)
|
||||
);
|
||||
|
||||
|
||||
// 3. 删除联动控制记录
|
||||
linkedCtrlMapper.delete(
|
||||
new LambdaQueryWrapper<LinkedCtrl>()
|
||||
@@ -1048,13 +1048,11 @@ public class DeviceController extends BaseController {
|
||||
* 检查设备二维码,解析设备类型和序列号
|
||||
* 二维码格式:pk=xxxxx&dn=xxxxx
|
||||
*
|
||||
* @param rootUserId 用户ID(预留参数)
|
||||
* @param qrCode 设备二维码内容
|
||||
* @return 设备类型和序列号
|
||||
*/
|
||||
@GetMapping("/check_device_qrcode")
|
||||
public R<PublicDeviceTypeAndSerialNum> checkDeviceQrcode(
|
||||
@RequestParam("rootUserId") Long rootUserId,
|
||||
@RequestParam("qrCode") String qrCode) {
|
||||
|
||||
// 验证二维码不能为空
|
||||
|
||||
Reference in New Issue
Block a user