入库修改

This commit is contained in:
张松
2025-11-27 11:31:12 +08:00
parent bffd378f9b
commit 89463d38a0

View File

@@ -87,9 +87,7 @@
List<ConsStockFlow> insertList = new ArrayList<>();
List<ConsInfo> updateStockList = new ArrayList<>();
for (ConsStockFlow entity : entityList) {
if (entity.getId() == null) {
continue;
}
BeanUtil.copyProperties(head, entity, CopyOptions.create().ignoreNullValue());
entity.setShopId(shopId);
entity.setInOutType(InOutTypeEnum.IN.value());
@@ -97,7 +95,14 @@
entity.setCreateUserId(createUserId);
entity.setCreateUserName(createUserName);
Long conId = entity.getConId();
ConsInfo consInfo = consInfoMapper.selectOneById(conId);
ConsInfo consInfo;
if (entity.getId() == null) {
consInfo = consInfoMapper.selectOneByQuery(new QueryWrapper().like(ConsInfo::getConName, entity.getConName())
.eq(ConsInfo::getShopId, shopId).limit(1));
entity.setConId(consInfo == null ? null : consInfo.getId());
}else {
consInfo = consInfoMapper.selectOneById(conId);
}
if (consInfo == null) {
continue;
}