档口品类管理

This commit is contained in:
gaowdong 2025-03-28 13:55:17 +08:00
parent e9403316d8
commit bc0d932b92
2 changed files with 9 additions and 12 deletions

View File

@ -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;
}

View File

@ -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);
}
}