@ -265,6 +265,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
// IPage<DistributionStockupListVO> distributionStockupEntityIPage = baseMapper.selectStockupPage(page, stockupDTO);
List < DistributionStockupListVO > records = distributionStockupEntityIPage . getRecords ( ) ;
for ( DistributionStockupListVO vo : records ) {
//查询以扫数量
List < DistributionStockEntity > list = distributionStockService . list ( Wrappers . < DistributionStockEntity > query ( ) . lambda ( ) . eq ( DistributionStockEntity : : getStockupId , vo . getId ( ) ) ) ;
if ( list . isEmpty ( ) ) {
vo . setRealNum ( 0 ) ;
} else {
vo . setRealNum ( list . size ( ) ) ;
}
intToStrDistributionStockupListVO ( vo ) ;
if ( ObjectUtils . isNull ( vo . getInventoryNub ( ) ) ) {
vo . setInventoryNub ( 0 ) ;
@ -956,42 +963,91 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionStockArticleEntity byId = distributionStockArticleService . getById ( stockupDTO . getStockArticleId ( ) ) ;
if ( stockupDTO . getStatus ( ) . equals ( 1 ) ) {
//已备货
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService . selectDistrilbutionBillOverPackWuSelf ( stockupDTO ) ;
List < DistributionStockupSelfVO > distributionStockupSelf = distrilbutionBillStockService . selectDistrilbutionBillOverPackWuSelf ( stockupDTO ) ;
// DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
QueryWrapper < DistributionParcelListEntity > queryWrapper = new QueryWrapper < > ( ) ;
if ( stockupDTO . getStockArticleId ( ) . contains ( "," ) ) {
queryWrapper . in ( "stock_article_id" , stockupDTO . getStockArticleId ( ) . split ( "," ) ) ;
DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO ( ) ;
AtomicReference < Integer > j = new AtomicReference < > ( 0 ) ;
AtomicReference < Integer > y = new AtomicReference < > ( 0 ) ;
if ( ObjectUtils . isNotNull ( stockupDTO . getAllocationId ( ) ) ) {
distributionStockupSelf . forEach ( i - > {
if ( ObjectUtils . isNotNull ( i . getLwugId ( ) ) ) {
j . updateAndGet ( v - > v + i . getPlanNum ( ) ) ;
y . updateAndGet ( v - > v + i . getScanNum ( ) ) ;
if ( ObjectUtils . isNull ( distributionStockupSelfVO . getConsignee ( ) ) ) {
distributionStockupSelfVO . setConsignee ( i . getConsignee ( ) ) ;
} else {
if ( ObjectUtils . isNotNull ( distributionStockupSelfVO . getConsignee ( ) ) & & ! distributionStockupSelfVO . getConsignee ( ) . equals ( i . getConsignee ( ) ) ) {
distributionStockupSelfVO . setConsignee ( distributionStockupSelfVO . getConsignee ( ) + "," + i . getConsignee ( ) ) ;
}
}
if ( ObjectUtils . isNull ( distributionStockupSelfVO . getTrays ( ) ) ) {
distributionStockupSelfVO . setTrays ( i . getTrays ( ) ) ;
} else {
if ( ObjectUtils . isNotNull ( distributionStockupSelfVO . getTrays ( ) ) & & ! distributionStockupSelfVO . getTrays ( ) . equals ( i . getTrays ( ) ) ) {
distributionStockupSelfVO . setTrays ( distributionStockupSelfVO . getTrays ( ) + "," + i . getTrays ( ) ) ;
}
}
}
} ) ;
} else {
queryWrapper . eq ( "stock_article_id" , stockupDTO . getStockArticleId ( ) ) ;
distributionStockupSelf . forEach ( i - > {
if ( ObjectUtils . isNull ( i . getLwugId ( ) ) ) {
j . updateAndGet ( v - > v + 1 ) ;
y . updateAndGet ( v - > v + i . getScanNum ( ) ) ;
if ( ObjectUtils . isNull ( distributionStockupSelfVO . getConsignee ( ) ) ) {
distributionStockupSelfVO . setConsignee ( i . getConsignee ( ) ) ;
} else {
if ( ObjectUtils . isNotNull ( distributionStockupSelfVO . getConsignee ( ) ) & & ! distributionStockupSelfVO . getConsignee ( ) . equals ( i . getConsignee ( ) ) ) {
distributionStockupSelfVO . setConsignee ( distributionStockupSelfVO . getConsignee ( ) + "," + i . getConsignee ( ) ) ;
}
}
if ( ObjectUtils . isNull ( distributionStockupSelfVO . getTrays ( ) ) ) {
distributionStockupSelfVO . setTrays ( i . getTrays ( ) ) ;
} else {
if ( ObjectUtils . isNotNull ( distributionStockupSelfVO . getTrays ( ) ) & & ! distributionStockupSelfVO . getTrays ( ) . equals ( i . getTrays ( ) ) ) {
distributionStockupSelfVO . setTrays ( distributionStockupSelfVO . getTrays ( ) + "," + i . getTrays ( ) ) ;
}
}
}
} ) ;
}
if ( ! stockupDTO . getTypeService ( ) . equals ( "3" ) ) {
queryWrapper . eq ( "order_package_reservation_status" , OrderPackageReservationStatusConstant . yiyueyue . getValue ( ) ) ;
distributionStockupSelfVO . setPlanNum ( j . get ( ) ) ;
distributionStockupSelfVO . setScanNum ( y . get ( ) ) ;
if ( stockupDTO . getStockArticleId ( ) . contains ( "," ) ) {
stockupDTO . setStockArticleIdList ( stockupDTO . getStockArticleId ( ) . split ( "," ) ) ;
stockupDTO . setStockArticleId ( null ) ;
}
List < DistributionParcelListEntity > list = distributionParcelListService . list ( queryWrapper ) ;
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient . getMyCurrentWarehouse ( ) ;
List < PackageStockupVO > list = distributionParcelListService . selectOrderInfoSelfAllocationList ( stockupDTO ) ;
Iterator < PackageStockupVO > iterator = list . iterator ( ) ;
List < PackageStockupVO > listPack = new ArrayList < > ( ) ;
list . forEach ( i - > {
WarehouseUpdownGoodsLogEntity updownGoodsLogEntity = new WarehouseUpdownGoodsLogEntity ( ) ;
updownGoodsLogEntity . setAssociationType ( "3" ) ;
updownGoodsLogEntity . setAssociationId ( i . getId ( ) ) ;
updownGoodsLogEntity . setAllocationId ( stockupDTO . getAllocationId ( ) ) ;
updownGoodsLogEntity . setBindingType ( "2" ) ;
updownGoodsLogEntity . setWarehouseId ( myCurrentWarehouse . getId ( ) ) ;
// updownGoodsLogEntity.setAllocationId(i.getId());
WarehouseUpdownGoodsLogEntity updownGoods = warehouseUpdownGoodsLogClient . getUpdownGoods ( updownGoodsLogEntity ) ;
if ( ObjectUtils . isNotNull ( updownGoods ) ) {
PackageStockupVO packageStockupVO = new PackageStockupVO ( ) ;
packageStockupVO . setOrderCode ( i . getOrderCode ( ) ) ;
packageStockupVO . setPackageBarCode ( i . getOrderPackageCode ( ) ) ;
packageStockupVO . setGoodsType ( 1 ) ;
packageStockupVO . setGoodsTypeStr ( "定制品" ) ;
packageStockupVO . setMaterialName ( i . getMaterialName ( ) ) ;
packageStockupVO . setIsScanStr ( "已备货" ) ;
packageStockupVO . setIsScan ( 2 ) ;
listPack . add ( packageStockupVO ) ;
if ( ObjectUtils . isNotNull ( stockupDTO . getAllocationId ( ) ) ) {
while ( iterator . hasNext ( ) ) {
PackageStockupVO next = iterator . next ( ) ;
if ( stockupDTO . getAllocationId ( ) . equals ( next . getAllocationId ( ) ) ) {
next . setIsScanStr ( "已备货" ) ;
next . setIsScan ( 2 ) ;
listPack . add ( next ) ;
}
}
} ) ;
} else {
while ( iterator . hasNext ( ) ) {
PackageStockupVO next = iterator . next ( ) ;
if ( ObjectUtils . isNull ( next . getAllocationId ( ) ) ) {
next . setIsScanStr ( "已备货" ) ;
next . setIsScan ( 2 ) ;
listPack . add ( next ) ;
}
}
}
// list.forEach(i -> {
// DistributionStockAllocationVO stockAllocationVO = distributionStockService.selectSelfAllocation(stockupDTO.getReservationId(),stockupDTO.getStockupId(),i.getId());
//
// });
DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO ( ) ;
vo . setReservationId ( stockupDTO . getReservationId ( ) ) ; //预约id
vo . setCustomer ( byId . getMallName ( ) ) ; //客户0
@ -1484,21 +1540,22 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
case 1 :
//订单
String orderCode = stockupDTO . getOrderCode ( ) ;
QueryWrapper < DistributionStockEntity > queryWrapper = new QueryWrapper < > ( ) ;
if ( stockupDTO . getOrderCode ( ) . contains ( "," ) ) {
stockupDTO . setOrderCodeList ( stockupDTO . getOrderCode ( ) . split ( "," ) ) ;
queryWrapper . in ( "order_self_numbering" , stockupDTO . getOrderCodeList ( ) ) ;
stockupDTO . setOrderCode ( null ) ;
} else {
queryWrapper . eq ( "order_self_numbering" , orderCode ) ;
}
String packetBarCode = stockupDTO . getPacketBarCode ( ) ;
Integer integer = baseMapper . selectPackageExist ( stockupDTO ) ;
if ( ObjectUtils . isNotNull ( integer ) & & integer > 0 ) {
//存在
List < DistributionStockEntity > list = distributionStockService . list ( Wrappers . < DistributionStockEntity > query ( ) . lambda ( )
. eq ( DistributionStockEntity : : getCoding , packetBarCode )
. eq ( StringUtils . isNotBlank ( stockupDTO . getOrderCode ( ) ) , DistributionStockEntity : : getOrderSelfNumbering , orderCode )
. in ( stockupDTO . getOrderCodeList ( ) . length > 0 , DistributionStockEntity : : getOrderSelfNumbering , stockupDTO . getOrderCodeList ( ) )
. eq ( DistributionStockEntity : : getStockupId , stockupId )
. eq ( DistributionStockEntity : : getReservationId , reservationId )
) ;
queryWrapper . eq ( "coding" , packetBarCode ) ;
queryWrapper . eq ( "stockup_id" , stockupId ) ;
queryWrapper . eq ( "reservation_id" , reservationId ) ;
List < DistributionStockEntity > list = distributionStockService . list ( queryWrapper ) ;
if ( ! list . isEmpty ( ) ) {
//重复扫码
return 2 ;