@ -778,51 +778,55 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查找出该包件信息
DistributionParcelListEntity parcelListEntity = distributionParcelListService . getOne ( Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( ) . eq ( DistributionParcelListEntity : : getOrderPackageCode , distrilbutionloadingscanDTO . getBarcode ( ) ) . eq ( DistributionParcelListEntity : : getWarehouseId , myCurrentWarehouse . getId ( ) ) ) ;
List < DistributionReservationEntity > reservationEntityList = distributionDeliveryListMapper . selectReservationByDeliveryListId ( distrilbutionloadingscanDTO . getDeliveryId ( ) ) ;
boolean shangpeiFlag = reservationEntityList . stream ( ) . allMatch ( r - > r . getDeliveryType ( ) . equals ( DistributionTypeConstant . shipie . getValue ( ) ) ) ;
if ( Func . isEmpty ( parcelListEntity ) ) {
return Resp . scanFail ( "无包件信息" , "无包件信息" ) ;
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper . selectById ( parcelListEntity . getStockArticleId ( ) ) ;
if ( shangpeiFlag ) {
List < DistributionReservationEntity > reservationEntities = reservationEntityList . stream ( ) . filter ( r - > Func . isNotEmpty ( r . getConsignee ( ) ) & & r . getConsignee ( ) . equals ( stockArticleEntity . getCustomerName ( ) ) & & r . getDeliveryAddress ( ) . equals ( stockArticleEntity . getCustomerAddress ( ) ) & & r . getDeliveryPhone ( ) . equals ( stockArticleEntity . getCustomerTelephone ( ) ) & & r . getMallName ( ) . equals ( stockArticleEntity . getMallName ( ) ) & & r . getId ( ) . equals ( distrilbutionloadingscanDTO . getReservationId ( ) ) ) . collect ( Collectors . toList ( ) ) ;
//查看是否存在满足条件的预约单
//存在多个,操作人指定具体客户即可
if ( ! reservationEntities . isEmpty ( ) ) {
if ( Func . isEmpty ( distrilbutionloadingscanDTO . getReservationId ( ) ) ) {
log . info ( "异常装车未指定客户" ) ;
return Resp . scanFail ( "请指定客户进行异常装车" , "请指定客户进行异常装车" ) ;
}
return R . fail ( 5000 , "异常装车" ) ;
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
} else {
if ( parcelListEntity . getConditions ( ) = = 2 ) {
return Resp . scanFail ( "此包件不是订制品" , "此包件不是订制品" ) ;
} else {
return Resp . scanFail ( "窜货" , "窜货" ) ;
}
if ( ! reservationEntityList . isEmpty ( ) ) {
boolean shangpeiFlag = reservationEntityList . stream ( ) . allMatch ( r - > r . getDeliveryType ( ) . equals ( DistributionTypeConstant . shipie . getValue ( ) ) ) ;
if ( Func . isEmpty ( parcelListEntity ) ) {
return Resp . scanFail ( "无包件信息" , "无包件信息" ) ;
}
} else {
shangpeiFlag = reservationEntityList . stream ( ) . allMatch ( r - > r . getDeliveryType ( ) . equals ( DistributionTypeConstant . shangpei . getValue ( ) ) ) ;
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper . selectById ( parcelListEntity . getStockArticleId ( ) ) ;
if ( shangpeiFlag ) {
List < DistributionReservationEntity > reservationEntities = reservationEntityList . stream ( ) . filter ( r - > r . getReceivingUnit ( ) . equals ( stockArticleEntity . getConsigneeUnit ( ) ) & & r . getMallName ( ) . equals ( stockArticleEntity . getMallName ( ) ) & & r . getId ( ) . equals ( distrilbutionloadingscanDTO . getReservationId ( ) ) ) . collect ( Collectors . toList ( ) ) ;
//查询是否满足商配异常装车
List < DistributionReservationEntity > reservationEntities = reservationEntityList . stream ( ) . filter ( r - > Func . isNotEmpty ( r . getConsignee ( ) ) & & r . getConsignee ( ) . equals ( stockArticleEntity . getCustomerName ( ) ) & & r . getDeliveryAddress ( ) . equals ( stockArticleEntity . getCustomerAddress ( ) ) & & r . getDeliveryPhone ( ) . equals ( stockArticleEntity . getCustomerTelephone ( ) ) & & r . getMallName ( ) . equals ( stockArticleEntity . getMallName ( ) ) & & r . getId ( ) . equals ( distrilbutionloadingscanDTO . getReservationId ( ) ) ) . collect ( Collectors . toList ( ) ) ;
//查看是否存在满足条件的预约单
boolean flag = reservationEntities . stream ( ) . anyMatch ( r - > r . getReceivingUnit ( ) . equals ( stockArticleEntity . getConsigneeUnit ( ) ) & & r . getMallName ( ) . equals ( stockArticleEntity . getMallName ( ) ) ) ;
if ( flag ) {
return R . fail ( 5000 , "异常装车" ) ;
} else {
if ( Func . isEmpty ( distrilbutionloadingscanDTO . getReservationId ( ) ) ) {
//存在多个,操作人指定具体客户即可
if ( ! reservationEntities . isEmpty ( ) & & flag ) {
if ( Func . isEmpty ( distrilbutionloadingscanDTO . getReservationId ( ) ) ) {
log . info ( "异常装车未指定客户" ) ;
return Resp . scanFail ( "请指定客户进行异常装车" , "请指定客户进行异常装车" ) ;
} else {
}
return R . fail ( 5000 , "异常装车" ) ;
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
} else {
if ( parcelListEntity . getConditions ( ) = = 2 ) {
return Resp . scanFail ( "此包件不是订制品" , "此包件不是订制品" ) ;
} else {
return Resp . scanFail ( "窜货" , "窜货" ) ;
}
}
} else {
log . error ( "配送计划预约类型错误:{}" , reservationEntityList ) ;
shangpeiFlag = reservationEntityList . stream ( ) . allMatch ( r - > r . getDeliveryType ( ) . equals ( DistributionTypeConstant . shangpei . getValue ( ) ) ) ;
if ( shangpeiFlag ) {
List < DistributionReservationEntity > reservationEntities = reservationEntityList . stream ( ) . filter ( r - > r . getReceivingUnit ( ) . equals ( stockArticleEntity . getConsigneeUnit ( ) ) & & r . getMallName ( ) . equals ( stockArticleEntity . getMallName ( ) ) & & r . getId ( ) . equals ( distrilbutionloadingscanDTO . getReservationId ( ) ) ) . collect ( Collectors . toList ( ) ) ;
//查询是否满足商配异常装车
boolean flag = reservationEntities . stream ( ) . anyMatch ( r - > r . getReceivingUnit ( ) . equals ( stockArticleEntity . getConsigneeUnit ( ) ) & & r . getMallName ( ) . equals ( stockArticleEntity . getMallName ( ) ) ) ;
if ( flag ) {
return R . fail ( 5000 , "异常装车" ) ;
} else {
if ( Func . isEmpty ( distrilbutionloadingscanDTO . getReservationId ( ) ) ) {
return Resp . scanFail ( "请指定客户进行异常装车" , "请指定客户进行异常装车" ) ;
} else {
return Resp . scanFail ( "窜货" , "窜货" ) ;
}
}
} else {
log . error ( "配送计划预约类型错误:{}" , reservationEntityList ) ;
}
}
}
log . info ( "异常装车判定成功>>>>>>packageCode:{},reservationId:{}" , distrilbutionloadingscanDTO . getBarcode ( ) , distrilbutionloadingscanDTO . getReservationId ( ) ) ;
}
} else if ( distrilbutionloadingscanDTO . getType ( ) = = 2 ) {