|
@@ -347,22 +347,27 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
* @return
|
|
|
*/
|
|
|
private Boolean removeMerRefDevices(List<DeviceInfo> deviceInfos, Long parentId) {
|
|
|
- deviceInfos.forEach(deviceInfo -> {
|
|
|
- //非顶级兴元商户,解绑后,机器归父商户
|
|
|
- if (parentId != 1) {
|
|
|
- deviceInfo.setMercId(parentId);
|
|
|
- }
|
|
|
- //一级商户,解绑后,直接释放
|
|
|
- if (parentId == 0) {
|
|
|
- //-1 释放关系
|
|
|
- deviceInfo.setMercId(-1L);
|
|
|
- }
|
|
|
+ if (CollUtil.isNotEmpty(deviceInfos) && parentId != null) {
|
|
|
+ deviceInfos.forEach(deviceInfo -> {
|
|
|
+ //非顶级兴元商户,解绑后,机器归父商户
|
|
|
+ if (parentId != 1) {
|
|
|
+ deviceInfo.setMercId(parentId);
|
|
|
+ }
|
|
|
+ //一级商户,解绑后,直接释放
|
|
|
+ if (parentId == 0) {
|
|
|
+ //兴元等级 0 释放关系
|
|
|
+ deviceInfo.setMercId(0L);
|
|
|
+ }
|
|
|
+
|
|
|
+ deviceInfo.setMercName(StrUtil.EMPTY);
|
|
|
+ deviceInfo.setMercCode(StrUtil.EMPTY);
|
|
|
+ });
|
|
|
+ //批量更新
|
|
|
+ return updateBatchById(deviceInfos);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Boolean.FALSE;
|
|
|
|
|
|
- deviceInfo.setMercName(StrUtil.EMPTY);
|
|
|
- deviceInfo.setMercCode(StrUtil.EMPTY);
|
|
|
- });
|
|
|
- //批量更新
|
|
|
- return updateBatchById(deviceInfos);
|
|
|
}
|
|
|
|
|
|
|