|
@@ -303,7 +303,6 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public R<Boolean> mercDeviceAuth(DeviceInfoDto.MercDeviceAuthDto auth) {
|
|
|
Long mercId = auth.getMercId();
|
|
|
- Long parentId = auth.getParentId();
|
|
|
String mercCode = auth.getMercCode();
|
|
|
Long algorithmId = auth.getAlgorithmId();
|
|
|
String mercName = auth.getMercName();
|
|
@@ -315,7 +314,6 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
if (CollUtil.isEmpty(devices)) {
|
|
|
return R.ok(Boolean.TRUE);
|
|
|
}
|
|
|
- return R.ok(removeMerRefDevices(devices, parentId));
|
|
|
}
|
|
|
//更新商户设备授权
|
|
|
List<DeviceInfo> deviceInfos = this.listByIds(deviceIds);
|
|
@@ -358,16 +356,39 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 解绑机器
|
|
|
+ * 解绑机器 回收
|
|
|
*
|
|
|
* @param dto
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public R<Boolean> unBindMercDevice(DeviceInfoDto.MercDeviceUnBindDto dto) {
|
|
|
- Long parentId = dto.getParentId();
|
|
|
List<DeviceInfo> deviceInfos = this.listByIds(dto.getDeviceIds());
|
|
|
- return R.ok(removeMerRefDevices(deviceInfos, parentId));
|
|
|
+ return R.ok(removeMerRefDevicesToTopMerc(deviceInfos));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 回收机器
|
|
|
+ *
|
|
|
+ * @param deviceInfos
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Boolean removeMerRefDevicesToTopMerc(List<DeviceInfo> deviceInfos) {
|
|
|
+ if (CollUtil.isNotEmpty(deviceInfos)) {
|
|
|
+ deviceInfos.forEach(deviceInfo -> {
|
|
|
+ //回收
|
|
|
+ deviceInfo.setMercId(-1L);
|
|
|
+ deviceInfo.setMercDeviceCode(StrUtil.EMPTY);
|
|
|
+ deviceInfo.setMercName(StrUtil.EMPTY);
|
|
|
+ deviceInfo.setMercCode(StrUtil.EMPTY);
|
|
|
+ });
|
|
|
+ //批量更新
|
|
|
+ return updateBatchById(deviceInfos);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Boolean.FALSE;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|