提交 f044e8ee authored 作者: zhoushaopan's avatar zhoushaopan

fix(入库模块): 入库做校验

入库做校验
上级 94525471
......@@ -447,7 +447,19 @@ public class StorageBillController {
throw new ApiException("序列号与入库数量不匹配");
}
});
//开始拆分装备
//做校验 检查序列号是否重复
//1.查询出所有的序列号
List<String> allSeqList =
cacheLibraryService.getAllDeviceLibraryList().stream().map(DeviceLibrary::getSeqNumber).collect(Collectors.toList());
createSeqVos.forEach(createSeqVo -> {
List<String> seqList = createSeqVo.getSeqList();
seqList.forEach(s -> {
if (allSeqList.contains(s)){
throw new ApiException("序列号"+s+"已存在");
}
});
});
// 开始拆分装备
for (CreateSeqVo createSeqVo : createSeqVos) {
List<String> seqList = createSeqVo.getSeqList();
for (int i = 0; i < seqList.size(); i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论