Commit 1f02b04c authored by 赵啸非's avatar 赵啸非

添加样表皮肤管理

parent 3ba734db
...@@ -155,6 +155,9 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -155,6 +155,9 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
List<SkinEntity> oldSkinList = skinService.find(new SkinQuery()); List<SkinEntity> oldSkinList = skinService.find(new SkinQuery());
Map<Long, SkinEntity> oldSkinMap = oldSkinList.stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n)); Map<Long, SkinEntity> oldSkinMap = oldSkinList.stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
Map<Long, SkinEntity> newSkinMap = newSkinList.stream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
List<SkinEntity> updateSkinLsit = newSkinList.stream().map(item -> { List<SkinEntity> updateSkinLsit = newSkinList.stream().map(item -> {
if (oldSkinMap.containsKey(item.getId())) { if (oldSkinMap.containsKey(item.getId())) {
...@@ -176,6 +179,15 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -176,6 +179,15 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
//做差集
List<Long> delSkinList = oldSkinList.stream().map(item -> {
if (!newSkinMap.containsKey(item.getId())) {
return item.getId();
}
return null;
}).filter(f -> f != null).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(updateSkinLsit)) { if (!ObjectUtils.isEmpty(updateSkinLsit)) {
log.info("皮肤更新,size:{}", updateSkinLsit.size()); log.info("皮肤更新,size:{}", updateSkinLsit.size());
skinService.update(updateSkinLsit); skinService.update(updateSkinLsit);
...@@ -186,6 +198,11 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService { ...@@ -186,6 +198,11 @@ public class SyncSiteDeviceTaskImpl implements ITaskExcuteService {
skinService.save(saveSkinList); skinService.save(saveSkinList);
} }
if (!ObjectUtils.isEmpty(delSkinList)) {
log.info("皮肤删除,size:{}", delSkinList.size());
skinService.remove(delSkinList,null);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment