@ -240,7 +240,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询本车次是否第一次扫码,没有则更新上车时间
//Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper . updateloadByReservationId ( distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
Integer j = distributionSignforMapper . updateloadByReservationId ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . get ReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
//修改签收表司机签收数量
this . update ( new UpdateWrapper < DistributionSignforEntity > ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getReservationId , distributionLoadscanEntity . getReservationId ( ) )
@ -281,7 +281,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity . setReceivedQuantity ( 1 ) ;
distributionLoadscanEntity . setIsInsert ( 2 ) ;
//更新签收表的装车数量
Integer j = distributionSignforMapper . updateloadByReservationId ( distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
Integer j = distributionSignforMapper . updateloadByReservationId ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . get ReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
}
boolean b = distributionLoadscaninvnService . saveBatch ( distributionLoadscanvnEntities ) ;
@ -339,6 +339,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public IPage < DistributionAppStockArticleVO > getAppDeliveryorderListPage ( IPage < DistributionAppStockArticleVO > page , DistributionAppDeliveryListDTO distributionDeliveryList ) {
List < DistributionAppStockArticleVO > selectord = baseMapper . selectord ( page , distributionDeliveryList ) ;
if ( null ! = distributionDeliveryList . getCompletecode ( ) ) {
if ( distributionDeliveryList . getCompletecode ( ) = = 2 ) {
selectord = baseMapper . selectorda ( page , distributionDeliveryList ) ;
} else if ( distributionDeliveryList . getCompletecode ( ) = = 1 ) {
selectord = baseMapper . selectordb ( page , distributionDeliveryList ) ;
} else if ( distributionDeliveryList . getCompletecode ( ) = = 3 ) {
selectord = baseMapper . selectordc ( page , distributionDeliveryList ) ;
}
}
return page . setRecords ( selectord ) ;
}
@ -441,8 +450,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public R positioning ( DistributionSignforEntity distributionSignfor ) {
DistributionSignforEntity distributionSignforEntity = baseMapper . selectOne ( new QueryWrapper < DistributionSignforEntity > ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getReservationId , distributionSignfor . getReservationId ( ) )
. eq ( DistributionSignforEntity : : getDeliveryId , distributionSignfor . getDeliveryId ( ) )
) ;
if ( null ! = distributionSignforEntity . getPositioning ( ) | | null ! = distributionSignforEntity . getPositioningAdr ( ) ) {
return R . fail ( 3008 , "已打卡" ) ;
}
boolean update = this . update ( new UpdateWrapper < DistributionSignforEntity > ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getReservationId , distributionSignfor . getReservationId ( ) )
. eq ( DistributionSignforEntity : : getDeliveryId , distributionSignfor . getDeliveryId ( ) )
. set ( StringUtils . isNotBlank ( distributionSignfor . getPositioning ( ) ) , DistributionSignforEntity : : getPositioning , distributionSignfor . getPositioning ( ) )
. set ( StringUtils . isNotBlank ( distributionSignfor . getPositioningAdr ( ) ) , DistributionSignforEntity : : getPositioningAdr , distributionSignfor . getPositioningAdr ( ) )
) ;
@ -451,6 +468,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public R oneclick ( DistributionSignforDTO distributionSignfor ) {
DistributionSignforEntity distributionSignforEntity = baseMapper . selectOne ( new QueryWrapper < DistributionSignforEntity > ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getDeliveryId , distributionSignfor . getDeliveryId ( ) )
. eq ( DistributionSignforEntity : : getReservationId , distributionSignfor . getReservationId ( ) )
) ;
if ( distributionSignfor . getIsClerk ( ) ) {
if ( null ! = distributionSignforEntity . getSigningType ( ) ) { return R . fail ( 3010 , "已经签收" ) ; }
} else {
if ( null ! = distributionSignforEntity . getSjsigningTime ( ) ) { return R . fail ( 3010 , "已经签收" ) ; }
}
//获取当前用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper . selectById ( distributionSignfor . getDeliveryId ( ) ) ;
DistributionDeliverySelfEntity distributionDeliverySelfEntity = null ;
@ -465,11 +492,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
) ;
BeanUtils . copyProperties ( distributionDeliveryTripartiteEntity , distributionDeliverySelfEntity ) ;
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyy-MM-dd hh:mm:ss" ) ;
//先查询有数据的
List < DistributionLoadscanEntity > distributionLoadscanEntities = distributionDeliveryListMapper . selectdeliverOne ( distributionSignfor . getReservationId ( ) ) ;
List < DistributionLoadscanEntity > distributionLoadscanEntities = distributionDeliveryListMapper . selectdeliverOne ( distributionSignfor . getReservationId ( ) , distributionSignfor . getDeliveryId ( ) ) ;
//查询所有的库存品(拆包)
List < DistributionLoadscaninvnEntity > distributionLoadscanvnEntitiesopen = distributionDeliveryListMapper . selectdeliverOnevnopen ( distributionSignfor . getReservationId ( ) ) ;
List < DistributionLoadscaninvnEntity > distributionLoadscanvnEntitiesopen = distributionDeliveryListMapper . selectdeliverOnevnopen ( distributionSignfor . getReservationId ( ) , distributionSignfor . getDeliveryId ( ) ) ;
//将该客户所有的物品上该车辆
if ( distributionLoadscanEntities . size ( ) > 0 ) {
for ( DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities ) {
@ -480,6 +507,20 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
. ne ( DistributionLoadscanEntity : : getScanStatus , 1 )
) ;
if ( distributionLoadscanEntitiesflag . size ( ) > 0 ) {
// 修改该记录
for ( DistributionLoadscanEntity loadscanEntity : distributionLoadscanEntitiesflag ) {
if ( loadscanEntity . getSignforState ( ) = = 2 ) break ;
distributionLoadscanService . update ( new UpdateWrapper < DistributionLoadscanEntity > ( ) . lambda ( )
. eq ( DistributionLoadscanEntity : : getDeliveryId , distributionLoadscanEntity . getDeliveryId ( ) )
. eq ( DistributionLoadscanEntity : : getOrderPackageCode , distributionLoadscanEntity . getOrderPackageCode ( ) )
. set ( DistributionLoadscanEntity : : getSigningTime , simpleDateFormat . format ( new Date ( ) ) )
. set ( DistributionLoadscanEntity : : getSignforState , 2 )
. set ( DistributionLoadscanEntity : : getReceivedQuantity , 1 )
) ;
//更新签收表的签收数量和装车数量
Integer j = distributionSignforMapper . updateSignforByReservationId ( loadscanEntity . getDeliveryId ( ) , loadscanEntity . getReservationId ( ) , loadscanEntity . getPackageNub ( ) ) ;
}
// distributionLoadscanService.update()
continue ;
}
//依次插入该装车记录,设置车辆,
@ -506,15 +547,22 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
distributionLoadscanEntity . setLoadingId ( distributionDeliverySelfEntity . getId ( ) . toString ( ) ) ;
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper . updateloadingTimeById ( distributionDeliveryListEntity . getId ( ) ) ;
//更新签收表的装车数量
Integer j = distributionSignforMapper . updateloadByReservationId ( distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收表的签收数量和 装车数量
Integer j = distributionSignforMapper . updateSignforByReservationId ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
distributionLoadscanService . save ( distributionLoadscanEntity ) ;
}
}
if ( distributionLoadscanvnEntitiesopen . size ( ) > 0 ) {
for ( DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen ) {
//查询是否重复扫码
List < DistributionLoadscaninvnEntity > distributionLoadscanEntitiesflag = distributionLoadscaninvnMapper . selectList ( new QueryWrapper < DistributionLoadscaninvnEntity > ( ) . lambda ( )
. eq ( DistributionLoadscaninvnEntity : : getDeliveryId , distributionLoadscanEntity . getDeliveryId ( ) )
. eq ( DistributionLoadscaninvnEntity : : getOrderPackageCode , distributionLoadscanEntity . getOrderPackageCode ( ) )
. ne ( DistributionLoadscaninvnEntity : : getScanStatus , 1 )
. eq ( DistributionLoadscaninvnEntity : : getSignforState , 2 )
) ;
//依次插入该装车记录,设置车辆
if ( null ! = distributionDeliverySelfEntity . getDriverId ( ) ) {
distributionLoadscanEntity . setDriverId ( distributionDeliverySelfEntity . getDriverId ( ) ) ;
@ -543,16 +591,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity . setVehicleId ( distributionDeliverySelfEntity . getVehicleId ( ) ) ;
}
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper . updateloadingTimeById ( distributionDeliveryListEntity . getId ( ) ) ;
//更新签收表的装车数量
Integer j = distributionSignforMapper . updateloadByinvn ( distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收表的装车数量和签收数量
Integer j = distributionSignforMapper . updatesignforByinvn ( distributionLoadscanEntity . getDeliveryId ( ) , distributionLoadscanEntity . getReservationId ( ) , distributionLoadscanEntity . getPackageNub ( ) ) ;
}
distributionLoadscaninvnService . saveBatch ( distributionLoadscanvnEntitiesopen ) ;
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat ( "yyyy-MM-dd hh:mm:ss" ) ;
boolean update = this . update ( new UpdateWrapper < DistributionSignforEntity > ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getDeliveryType , distributionSignfor . getReservationId ( ) )
. eq ( DistributionSignforEntity : : getReservationId , distributionSignfor . getReservationId ( ) )
. eq ( DistributionSignforEntity : : getId , distributionSignforEntity . getId ( ) )
. set ( StringUtils . isNotBlank ( distributionSignfor . getDeliverySignPictures ( ) ) , DistributionSignforEntity : : getDeliverySignPictures , distributionSignfor . getDeliverySignPictures ( ) )
. set ( StringUtils . isNotBlank ( distributionSignfor . getSigningType ( ) ) , DistributionSignforEntity : : getSigningType , distributionSignfor . getSigningType ( ) )
. set ( distributionSignfor . getIsClerk ( ) , DistributionSignforEntity : : getSigningStatus , 2 )