|
|
|
@ -1609,13 +1609,16 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
.eq("association_value",materialCode) |
|
|
|
|
.eq("incoming_batch",incomingBatch); |
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(queryWrapper); |
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode,incomingBatch); |
|
|
|
|
if(!Objects.isNull(updownGoodsEntity)){ |
|
|
|
|
Integer num = updownGoodsEntity.getNum(); |
|
|
|
|
if (enterNum>num){ |
|
|
|
|
int i = num + enterNum; |
|
|
|
|
//对比原库存数量
|
|
|
|
|
if (i>stockListEntity.getQuantityStock()){ |
|
|
|
|
stringBuffer.append("{").append(materialCode).append("},"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
updownGoodsEntity.setNum(num+enterNum); |
|
|
|
|
updownGoodsEntity.setNum(i); |
|
|
|
|
updownGoodsList.add(updownGoodsEntity); |
|
|
|
|
//存入日志对象
|
|
|
|
|
WarehouseUpdownGoodsEntity oldUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
@ -1624,7 +1627,11 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
|
|
|
|
|
oldUpdownGoodsEntity.setId(null); |
|
|
|
|
updownGoodsLogList.add(oldUpdownGoodsEntity); |
|
|
|
|
}else{ |
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode,incomingBatch); |
|
|
|
|
//对比原库存数量
|
|
|
|
|
if (enterNum>stockListEntity.getQuantityStock()){ |
|
|
|
|
stringBuffer.append("{").append(materialCode).append("},"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
updownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
updownGoodsEntity.setUpdownTypeId(updownTypeEntity.getId()); |
|
|
|
|
updownGoodsEntity.setAreaId(updownTypeEntity.getAreaId()); |
|
|
|
|