@ -679,8 +679,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionSignforService . save ( distributionSignforEntity ) ;
//修改预约信息为待配送
reservationEntity . setReservationStatus ( ReservationStatusConstant . daipeisong . getValue ( ) ) ;
//这里需要查询出订单数量
Long count = distributionReservationStocklistService . getBaseMapper ( ) . selectCount ( Wrappers . < DistributionReservationStocklistEntity > query ( ) . lambda ( ) . eq ( DistributionReservationStocklistEntity : : getReservationId , reservationEntity . getId ( ) ) ) ;
//预约订单数量
orderNum . getAndAdd ( reservationEntity . getStockArticleId ( ) . split ( "," ) . length ) ;
orderNum . getAndAdd ( Integer . parseInt ( count . toString ( ) ) ) ;
//统计包件数量
packageNum . getAndAdd ( reservationEntity . getReservationNum ( ) ) ;
//TODO 设置是否齐套
@ -692,7 +694,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
w . lambda ( ) . eq ( DistributionReservationStocklistEntity : : getReservationId , reservationEntity . getId ( ) ) ;
List < DistributionReservationStockarticleEntity > reservationStockarticleEntityList = distributionReservationStockarticleService . getBaseMapper ( ) . selectList ( q ) ;
List < DistributionReservationStocklistEntity > reservationStocklistEntityList = distributionReservationStocklistService . getBaseMapper ( ) . selectList ( w ) ;
//查询预约单下的包件信息
if ( ! Func . isEmpty ( reservationStockarticleEntityList ) ) {
@ -1396,16 +1397,41 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
public List < DistributionStockArticleVO > selectUpdateAvailableStockArticle ( Long reservationId ) {
public List < DistributionStockArticleVO > selectUpdateAvailableStockArticle ( Long reservationId , Map < String , Object > distributionStockArticle ) {
//这里还需要查询出该预约单下的订单信息
//这里将该预约下的订单进行过滤
String orderCode = ( String ) distributionStockArticle . get ( "orderCode" ) ;
String mallName = ( String ) distributionStockArticle . get ( "mallName" ) ;
String descriptionGoods = ( String ) distributionStockArticle . get ( "descriptionGoods" ) ;
String brand = ( String ) distributionStockArticle . get ( "brand" ) ;
String customerName = ( String ) distributionStockArticle . get ( "customerName" ) ;
String customerTelephone = ( String ) distributionStockArticle . get ( "customerTelephone" ) ;
List < DistributionReservationStockarticleEntity > reservationStockarticleEntityList = distributionReservationStockarticleService . getBaseMapper ( ) . selectList ( Wrappers . < DistributionReservationStockarticleEntity > query ( ) . lambda ( ) . eq ( DistributionReservationStockarticleEntity : : getReservationId , reservationId ) ) ;
List < DistributionStockArticleVO > stockArticleVOArrayList = new ArrayList < > ( ) ;
List < String > list = new ArrayList < > ( ) ;
reservationStockarticleEntityList . forEach ( r - > {
list . add ( r . getStockArticleId ( ) . toString ( ) ) ;
List < DistributionStockArticleEntity > stockArticleEntities = distributionStockArticleService . getBaseMapper ( ) . selectList ( Wrappers . < DistributionStockArticleEntity > query ( ) . lambda ( ) . eq ( DistributionStockArticleEntity : : getId , r . getStockArticleId ( ) ) ) ;
LambdaQueryWrapper < DistributionStockArticleEntity > lambda = Wrappers . < DistributionStockArticleEntity > query ( ) . lambda ( ) ;
if ( Func . isNotEmpty ( orderCode ) ) {
lambda . like ( DistributionStockArticleEntity : : getOrderCode , orderCode ) ;
}
if ( Func . isNotEmpty ( mallName ) ) {
lambda . like ( DistributionStockArticleEntity : : getOrderCode , mallName ) ;
}
if ( Func . isNotEmpty ( descriptionGoods ) ) {
lambda . like ( DistributionStockArticleEntity : : getOrderCode , descriptionGoods ) ;
}
if ( Func . isNotEmpty ( brand ) ) {
lambda . like ( DistributionStockArticleEntity : : getOrderCode , brand ) ;
}
if ( Func . isNotEmpty ( customerName ) ) {
lambda . like ( DistributionStockArticleEntity : : getOrderCode , customerName ) ;
}
if ( Func . isNotEmpty ( customerTelephone ) ) {
lambda . like ( DistributionStockArticleEntity : : getOrderCode , customerTelephone ) ;
}
lambda . eq ( DistributionStockArticleEntity : : getId , r . getStockArticleId ( ) ) ;
List < DistributionStockArticleEntity > stockArticleEntities = distributionStockArticleService . getBaseMapper ( ) . selectList ( lambda ) ;
List < DistributionStockArticleVO > stockArticleVOList = DistributionStockArticleWrapper . build ( ) . listVO ( stockArticleEntities ) ;
stockArticleVOList . forEach ( s - > {
List < DistributionParcelListEntity > parcelListEntityList = distributionParcelListService . getBaseMapper ( ) . selectList ( Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( ) . eq ( DistributionParcelListEntity : : getStockArticleId , s . getId ( ) ) ) ;
@ -1429,6 +1455,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if ( ! Func . isEmpty ( list ) ) {
qw . notIn ( DistributionStockArticleEntity : : getId , list ) ;
}
if ( Func . isNotEmpty ( orderCode ) ) {
qw . like ( DistributionStockArticleEntity : : getOrderCode , orderCode ) ;
}
if ( Func . isNotEmpty ( mallName ) ) {
qw . like ( DistributionStockArticleEntity : : getOrderCode , mallName ) ;
}
if ( Func . isNotEmpty ( descriptionGoods ) ) {
qw . like ( DistributionStockArticleEntity : : getOrderCode , descriptionGoods ) ;
}
if ( Func . isNotEmpty ( brand ) ) {
qw . like ( DistributionStockArticleEntity : : getOrderCode , brand ) ;
}
if ( Func . isNotEmpty ( customerName ) ) {
qw . like ( DistributionStockArticleEntity : : getOrderCode , customerName ) ;
}
if ( Func . isNotEmpty ( customerTelephone ) ) {
qw . like ( DistributionStockArticleEntity : : getOrderCode , customerTelephone ) ;
}
List < DistributionStockArticleEntity > stockArticleEntityList = distributionStockArticleService . getBaseMapper ( ) . selectList ( qw ) ;
List < DistributionStockArticleVO > stockArticleVOS = DistributionStockArticleWrapper . build ( ) . listVO ( stockArticleEntityList ) ;
stockArticleVOS . forEach ( s - > {
@ -1441,6 +1485,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
@Transactional
public boolean insertAutonomouslyReservation ( DistributionReservationDTO distributionReservationDTO ) {
if ( Func . isEmpty ( distributionReservationDTO ) ) {
log . error ( "参数错误+{" + distributionReservationDTO + "}" ) ;