Compare commits
2 Commits
afd057e868
...
ea65cfb963
| Author | SHA1 | Date |
|---|---|---|
|
|
ea65cfb963 | |
|
|
bc0d932b92 |
|
|
@ -42,6 +42,12 @@ public class AllocKind {
|
|||
this.stallId = stallId;
|
||||
}
|
||||
|
||||
public AllocKind(Long kindId, String kindName, Long stallId) {
|
||||
this.kindId = kindId;
|
||||
this.kindName = kindName;
|
||||
this.stallId = stallId;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,19 +65,10 @@ public class AllocKindServiceImpl extends ServiceImpl<AllocKindMapper, AllocKind
|
|||
public void saveStallKind(List<String> kindNameList, Long stallId) {
|
||||
this.remove(Wrappers.lambdaUpdate(AllocKind.class).eq(AllocKind::getStallId, stallId));
|
||||
if (!CollUtil.isEmpty(kindNameList)) {
|
||||
List<AllocKind> kindList = ((AllocKindMapper)this.baseMapper).listKindByNameList(kindNameList);
|
||||
Map<String, AllocKind> kindMap = new HashMap();
|
||||
kindList.forEach((kind) -> {
|
||||
kindMap.put(kind.getKindName(), kind);
|
||||
});
|
||||
List<AllocKind> allocKindList = new ArrayList();
|
||||
Iterator var6 = kindMap.entrySet().iterator();
|
||||
|
||||
while(var6.hasNext()) {
|
||||
Map.Entry<String, AllocKind> entry = (Map.Entry)var6.next();
|
||||
allocKindList.add(new AllocKind(Id.next(), (AllocKind)entry.getValue(), stallId));
|
||||
}
|
||||
|
||||
kindNameList.forEach((kindName) -> {
|
||||
allocKindList.add(new AllocKind(Id.next(), kindName, stallId));
|
||||
});
|
||||
this.saveBatch(allocKindList);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue