@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils ;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils ;
import com.baomidou.mybatisplus.core.toolkit.Wrappers ;
import com.baomidou.mybatisplus.core.toolkit.Wrappers ;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page ;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page ;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl ;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO ;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO ;
import com.logpm.basic.entity.BasicPrintTemplateEntity ;
import com.logpm.basic.entity.BasicPrintTemplateEntity ;
import com.logpm.basic.feign.IBasicPrintTemplateClient ;
import com.logpm.basic.feign.IBasicPrintTemplateClient ;
@ -577,8 +578,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
//查询当前扫描的包件是否进行了装车
//查询当前扫描的包件是否进行了装车
DistributionParcelListEntity parcelList = distributionParcelListService . selectByOrderPackageCode ( distrilbutionloadingscanDTO . getBarcode ( ) , myCurrentWarehouse . getId ( ) ) ;
DistributionParcelListEntity parcelList = distributionParcelListService . selectByOrderPackageCode ( distrilbutionloadingscanDTO . getBarcode ( ) , myCurrentWarehouse . getId ( ) ) ;
if ( ! Objects . isNull ( parcelList ) ) {
if ( ! Objects . isNull ( parcelList ) ) {
if ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) . equals ( parcelList . getOrderPackageLoadingStatus ( ) ) ) {
if ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) . equals ( parcelList . getOrderPackageLoadingStatus ( ) ) ) {
return Resp . scanFail ( "操作失败" , "包件已装车" ) ;
return Resp . scanFail ( "操作失败" , "包件已装车" ) ;
}
}
}
}
@ -601,8 +602,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
BeanUtils . copyProperties ( distributionDeliveryTripartiteEntity , distributionDeliverySelfEntity ) ;
BeanUtils . copyProperties ( distributionDeliveryTripartiteEntity , distributionDeliverySelfEntity ) ;
}
}
if ( distrilbutionloadingscanDTO . getType ( ) = = 1 ) {
if ( distrilbutionloadingscanDTO . getType ( ) = = 1 ) {
if ( ! Objects . isNull ( parcelList ) ) {
if ( ! Objects . isNull ( parcelList ) ) {
if ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) . equals ( parcelList . getOrderPackageLoadingStatus ( ) ) ) {
if ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) . equals ( parcelList . getOrderPackageLoadingStatus ( ) ) ) {
return Resp . scanFail ( "操作失败" , "包件已装车" ) ;
return Resp . scanFail ( "操作失败" , "包件已装车" ) ;
}
}
}
}
@ -669,14 +670,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer j = distributionSignforMapper . updateloadByReservationId ( loadscanEntity . getDeliveryId ( ) , loadscanEntity . getReservationId ( ) , loadscanEntity . getPackageNub ( ) ) ;
Integer j = distributionSignforMapper . updateloadByReservationId ( loadscanEntity . getDeliveryId ( ) , loadscanEntity . getReservationId ( ) , loadscanEntity . getPackageNub ( ) ) ;
Map < String , Object > map = new HashMap ( ) ;
Map < String , Object > map = new HashMap ( ) ;
String distrilbutionloadingscanDTOJson = JSONObject . toJSONString ( distrilbutionloadingscanDTO ) ;
String distrilbutionloadingscanDTOJson = JSONObject . toJSONString ( distrilbutionloadingscanDTO ) ;
map . put ( "distrilbutionloadingscanDTO" , distrilbutionloadingscanDTOJson ) ;
map . put ( "distrilbutionloadingscanDTO" , distrilbutionloadingscanDTOJson ) ;
String parcelListEntityJson = JSONObject . toJSONString ( parcelListEntity ) ;
String parcelListEntityJson = JSONObject . toJSONString ( parcelListEntity ) ;
map . put ( "parcelListEntity" , parcelListEntityJson ) ;
map . put ( "parcelListEntity" , parcelListEntityJson ) ;
map . put ( "myCurrentWarehouseId" , myCurrentWarehouse . getId ( ) ) ;
map . put ( "myCurrentWarehouseId" , myCurrentWarehouse . getId ( ) ) ;
String reservationEntityJson = JSONObject . toJSONString ( reservationEntity ) ;
String reservationEntityJson = JSONObject . toJSONString ( reservationEntity ) ;
map . put ( "reservationEntity" , reservationEntityJson ) ;
map . put ( "reservationEntity" , reservationEntityJson ) ;
log . info ( ">>>>>>>>>>>>> 进入延迟队列处理包件相关信息状态" ) ;
log . info ( ">>>>>>>>>>>>> 进入延迟队列处理包件相关信息状态" ) ;
@ -1498,7 +1499,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient . getMyCurrentWarehouse ( ) ;
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient . getMyCurrentWarehouse ( ) ;
if ( Objects . isNull ( myCurrentWarehouse ) ) {
if ( Objects . isNull ( myCurrentWarehouse ) ) {
return R . fail ( 403 , "请选择仓库!!" ) ;
return R . fail ( 403 , "请选择仓库!!" ) ;
// throw n/**/ew CustomerException(403, "仓库信息不能为空");
// throw n/**/ew CustomerException(403, "仓库信息不能为空");
}
}
/ *
/ *
@ -2196,19 +2197,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
@Override
public IPage < DistributionAppDeliveryListVO > selectDistributionAppDeliveryListPage ( IPage < DistributionAppDeliveryListVO > page , DistributionAppDeliveryListDTO distributionAppDeliveryListDTO ) {
public IPage < DistributionAppDeliveryListVO > selectDistributionAppDeliveryListPage ( IPage < DistributionAppDeliveryListVO > page , DistributionAppDeliveryListDTO distributionAppDeliveryListDTO ) {
List < DistributionAppDeliveryListVO > distributionAppDeliveryListVOS = new ArrayList < > ( ) ;
//获取当前登录人
try {
//获取当前登录人
BladeUser user = AuthUtil . getUser ( ) ;
BladeUser user = AuthUtil . getUser ( ) ;
String roleId = user . getRoleId ( ) ;
String roleId = user . getRoleId ( ) ;
//判断当前登录人是否为司机
//判断当前登录人是否为司机
List < DistributionAppDeliveryListVO > distributionAppDeliveryListVOS = new ArrayList < > ( ) ;
boolean delivery = false ;
boolean delivery = false ;
String value1 = DictBizCache . getValue ( "role_class" , "delivery_driver_new" ) ;
String value1 = DictBizCache . getValue ( "role_class" , "delivery_driver_new" ) ;
if ( roleId . contains ( value1 ) ) delivery = true ;
if ( roleId . contains ( value1 ) ) delivery = true ;
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient . getMyCurrentWarehouse ( ) ;
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient . getMyCurrentWarehouse ( ) ;
// R<String> value = dictBizClient.getValue("role_class", roleId);
// R<String> value = dictBizClient.getValue("role_class", roleId);
if ( delivery ) {
if ( delivery ) {
//查询当前登录人的配送任务
//查询当前登录人的配送任务
@ -2227,6 +2226,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} else {
} else {
distributionAppDeliveryListVOS = baseMapper . selectDistributionAppDeliveryListPage ( page , distributionAppDeliveryListDTO , null , myCurrentWarehouse . getId ( ) ) ;
distributionAppDeliveryListVOS = baseMapper . selectDistributionAppDeliveryListPage ( page , distributionAppDeliveryListDTO , null , myCurrentWarehouse . getId ( ) ) ;
}
}
log . info ( ">>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}" , distributionAppDeliveryListVOS ) ;
//转换字典字段
//转换字典字段
for ( DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS ) {
for ( DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS ) {
@ -2257,7 +2258,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
//查询包件签收件数
//查询包件签收件数
Integer lad = distributionLoadscanMapper . selectCount ( new QueryWrapper < DistributionLoadscanEntity > ( ) . lambda ( ) . eq ( DistributionLoadscanEntity : : getDeliveryId , distributionAppDeliveryListVO . getId ( ) ) . eq ( DistributionLoadscanEntity : : getSignforState , 2 ) ) . intValue ( ) ;
Integer lad = distributionLoadscanMapper . selectCount ( new QueryWrapper < DistributionLoadscanEntity > ( ) . lambda ( ) . eq ( DistributionLoadscanEntity : : getDeliveryId , distributionAppDeliveryListVO . getId ( ) ) . eq ( DistributionLoadscanEntity : : getSignforState , 2 ) ) . intValue ( ) ;
//查询库存品签收件数
//查询库存品签收件数
Integer nad = distributionLoadscaninvnMapper . selectCount ( new QueryWrapper < DistributionLoadscaninvnEntity > ( ) . lambda ( ) . eq ( DistributionLoadscaninvnEntity : : getDeliveryId , distributionAppDeliveryListVO . getId ( ) ) . eq ( DistributionLoadscaninvnEntity : : getSignforState , 2 ) ) . intValue ( ) ;
Integer nad = distributionLoadscaninvnMapper . selectCount ( new QueryWrapper < DistributionLoadscaninvnEntity > ( ) . lambda ( ) . eq ( DistributionLoadscaninvnEntity : : getDeliveryId , distributionAppDeliveryListVO . getId ( ) ) . eq ( DistributionLoadscaninvnEntity : : getSignforState , 2 ) ) . intValue ( ) ;
//维护计划数
//维护计划数
@ -2267,7 +2267,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
int invertoryNum = reservationEntityList . stream ( ) . mapToInt ( DistributionReservationEntity : : getReservationStockListNum ) . sum ( ) ;
int invertoryNum = reservationEntityList . stream ( ) . mapToInt ( DistributionReservationEntity : : getReservationStockListNum ) . sum ( ) ;
distributionAppDeliveryListVO . setDeliveryNumber ( packageNum + invertoryNum ) ;
distributionAppDeliveryListVO . setDeliveryNumber ( packageNum + invertoryNum ) ;
} else {
} else {
return null ;
continue ;
}
}
distributionAppDeliveryListVO . setSignNub ( lad + nad ) ;
distributionAppDeliveryListVO . setSignNub ( lad + nad ) ;
//查询完成客户数
//查询完成客户数
@ -2343,7 +2343,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionAppDeliveryListVO . setDriverName ( stringBuilder . toString ( ) ) ;
distributionAppDeliveryListVO . setDriverName ( stringBuilder . toString ( ) ) ;
}
}
}
}
} catch ( Exception e ) {
log . error ( ">>>>>>>> 司机配送装车查询 报错" , e ) ;
}
return page . setRecords ( distributionAppDeliveryListVOS ) ;
return page . setRecords ( distributionAppDeliveryListVOS ) ;
}
}
@Override
@Override
@ -3020,9 +3024,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//此订单包件数量统计
//此订单包件数量统计
AtomicInteger orderPackageNum = new AtomicInteger ( ) ;
AtomicInteger orderPackageNum = new AtomicInteger ( ) ;
if ( Func . isEmpty ( oldOrder . get ( s . getId ( ) ) ) ) {
if ( Func . isEmpty ( oldOrder . get ( s . getId ( ) ) ) ) {
if ( Func . isNotEmpty ( signforEntity ) & & signforEntity . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) {
if ( Func . isNotEmpty ( signforEntity ) & & signforEntity . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) {
log . error ( "#############商配文员对已复核预约进行订单追加reservationId:{}" , reservationEntity . getId ( ) ) ;
log . error ( "#############商配文员对已复核预约进行订单追加reservationId:{}" , reservationEntity . getId ( ) ) ;
throw new RuntimeException ( "收货单位:" + reservationEntity . getMallName ( ) + "客户:" + reservationEntity . getConsignee ( ) + "完成复核签收,无法追加订单" ) ;
throw new RuntimeException ( "收货单位:" + reservationEntity . getMallName ( ) + "客户:" + reservationEntity . getConsignee ( ) + "完成复核签收,无法追加订单" ) ;
}
}
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity ( ) ;
DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity ( ) ;
if ( s . getIsZero ( ) . equals ( IsOrNoConstant . no . getValue ( ) ) ) {
if ( s . getIsZero ( ) . equals ( IsOrNoConstant . no . getValue ( ) ) ) {
@ -3051,7 +3055,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List < DistributionParcelListEntity > distributionParcelListEntities = distributionParcelListService . list ( Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( ) . eq ( DistributionParcelListEntity : : getStockArticleId , s . getId ( ) ) . ne ( DistributionParcelListEntity : : getOrderPackageLoadingStatus , OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) ) . ne ( DistributionParcelListEntity : : getOrderPackageReservationStatus , OrderPackageReservationStatusConstant . yiyueyue . getValue ( ) ) . notIn ( DistributionParcelListEntity : : getOrderPackageStatus , new String [ ] { OrderPackageStatusConstant . yichuku . getValue ( ) , OrderPackageStatusConstant . yiqianshou . getValue ( ) } ) ) ;
List < DistributionParcelListEntity > distributionParcelListEntities = distributionParcelListService . list ( Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( ) . eq ( DistributionParcelListEntity : : getStockArticleId , s . getId ( ) ) . ne ( DistributionParcelListEntity : : getOrderPackageLoadingStatus , OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) ) . ne ( DistributionParcelListEntity : : getOrderPackageReservationStatus , OrderPackageReservationStatusConstant . yiyueyue . getValue ( ) ) . notIn ( DistributionParcelListEntity : : getOrderPackageStatus , new String [ ] { OrderPackageStatusConstant . yichuku . getValue ( ) , OrderPackageStatusConstant . yiqianshou . getValue ( ) } ) ) ;
if ( Func . isEmpty ( distributionParcelListEntities ) ) {
if ( Func . isEmpty ( distributionParcelListEntities ) ) {
log . error ( "##############添加空订单" ) ;
log . error ( "##############添加空订单" ) ;
throw new RuntimeException ( s . getOrderCode ( ) + "无可用包件!!!" ) ;
throw new RuntimeException ( s . getOrderCode ( ) + "无可用包件!!!" ) ;
}
}
distributionParcelListEntities . forEach ( dp - > {
distributionParcelListEntities . forEach ( dp - > {
if ( ! dp . getOrderPackageStatus ( ) . equals ( OrderPackageStatusConstant . yiqianshou . getValue ( ) ) ) {
if ( ! dp . getOrderPackageStatus ( ) . equals ( OrderPackageStatusConstant . yiqianshou . getValue ( ) ) ) {
@ -3164,9 +3168,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if ( Func . isNotEmpty ( packageListInfo ) ) {
if ( Func . isNotEmpty ( packageListInfo ) ) {
packageListInfo . forEach ( p - > {
packageListInfo . forEach ( p - > {
if ( Func . isEmpty ( oldPackageList . get ( p . getId ( ) ) ) ) {
if ( Func . isEmpty ( oldPackageList . get ( p . getId ( ) ) ) ) {
if ( Func . isNotEmpty ( signforEntity ) & & signforEntity . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) {
if ( Func . isNotEmpty ( signforEntity ) & & signforEntity . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) {
log . error ( "#############商配文员对已复核预约进行订单追加reservationId:{}" , reservationEntity . getId ( ) ) ;
log . error ( "#############商配文员对已复核预约进行订单追加reservationId:{}" , reservationEntity . getId ( ) ) ;
throw new RuntimeException ( "收货单位:" + reservationEntity . getMallName ( ) + "客户:" + reservationEntity . getConsignee ( ) + "完成复核签收,无法追加订单" ) ;
throw new RuntimeException ( "收货单位:" + reservationEntity . getMallName ( ) + "客户:" + reservationEntity . getConsignee ( ) + "完成复核签收,无法追加订单" ) ;
}
}
//为该订单新增了包件
//为该订单新增了包件
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity ( ) ;
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity ( ) ;
@ -3186,9 +3190,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} ) ;
} ) ;
//进行取消包件的数据清理
//进行取消包件的数据清理
oldPackageList . forEach ( ( a , b ) - > {
oldPackageList . forEach ( ( a , b ) - > {
if ( Func . isNotEmpty ( signforEntity ) & & signforEntity . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) {
if ( Func . isNotEmpty ( signforEntity ) & & signforEntity . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) {
log . error ( "#############商配文员对已复核预约进行订单追加reservationId:{}" , reservationEntity . getId ( ) ) ;
log . error ( "#############商配文员对已复核预约进行订单追加reservationId:{}" , reservationEntity . getId ( ) ) ;
throw new RuntimeException ( "收货单位:" + reservationEntity . getMallName ( ) + "客户:" + reservationEntity . getConsignee ( ) + "完成复核签收,无法追加订单" ) ;
throw new RuntimeException ( "收货单位:" + reservationEntity . getMallName ( ) + "客户:" + reservationEntity . getConsignee ( ) + "完成复核签收,无法追加订单" ) ;
}
}
DistributionReservationPackageEntity reservationPackageEntity = b . get ( 0 ) ;
DistributionReservationPackageEntity reservationPackageEntity = b . get ( 0 ) ;
reservationPackageEntity . setPacketBarStatus ( ReservationPackageStatusConstant . quxiao . getValue ( ) ) ;
reservationPackageEntity . setPacketBarStatus ( ReservationPackageStatusConstant . quxiao . getValue ( ) ) ;
@ -3285,9 +3289,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} ) ;
} ) ;
if ( Func . isNotEmpty ( oldOrder ) ) {
if ( Func . isNotEmpty ( oldOrder ) ) {
oldOrder . forEach ( ( m , n ) - > {
oldOrder . forEach ( ( m , n ) - > {
if ( Func . isNotEmpty ( signforEntity ) & & signforEntity . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) {
if ( Func . isNotEmpty ( signforEntity ) & & signforEntity . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) {
log . error ( "#############商配文员对已复核预约进行订单追加reservationId:{}" , reservationEntity . getId ( ) ) ;
log . error ( "#############商配文员对已复核预约进行订单追加reservationId:{}" , reservationEntity . getId ( ) ) ;
throw new RuntimeException ( "收货单位:" + reservationEntity . getMallName ( ) + "客户:" + reservationEntity . getConsignee ( ) + "完成复核签收,无法追加订单" ) ;
throw new RuntimeException ( "收货单位:" + reservationEntity . getMallName ( ) + "客户:" + reservationEntity . getConsignee ( ) + "完成复核签收,无法追加订单" ) ;
}
}
DistributionReservationStockarticleEntity reservationStockarticleEntity = n . get ( 0 ) ;
DistributionReservationStockarticleEntity reservationStockarticleEntity = n . get ( 0 ) ;
if ( reservationStockarticleEntity . getIsZero ( ) . equals ( IsOrNoConstant . no . getValue ( ) ) ) {
if ( reservationStockarticleEntity . getIsZero ( ) . equals ( IsOrNoConstant . no . getValue ( ) ) ) {
@ -4169,16 +4173,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List < Long > orderIds = reservationStockarticleEntityList . stream ( ) . filter ( order - > order . getIsZero ( ) . equals ( IsOrNoConstant . no . getValue ( ) ) ) . map ( DistributionReservationStockarticleEntity : : getStockArticleId ) . collect ( Collectors . toList ( ) ) ;
List < Long > orderIds = reservationStockarticleEntityList . stream ( ) . filter ( order - > order . getIsZero ( ) . equals ( IsOrNoConstant . no . getValue ( ) ) ) . map ( DistributionReservationStockarticleEntity : : getStockArticleId ) . collect ( Collectors . toList ( ) ) ;
if ( Func . isNotEmpty ( orderIds ) ) {
if ( Func . isNotEmpty ( orderIds ) ) {
//查询该客户的非零但订单包间
//查询该客户的非零但订单包间
IPage < DistributionParcelListEntity > parcelListEntityList = distributionReservationMapper . getReservationPackage ( page , orderIds , distributionDeliveryInfoDTO ) ;
IPage < DistributionParcelListEntity > parcelListEntityList = distributionReservationMapper . getReservationPackage ( page , orderIds , distributionDeliveryInfoDTO ) ;
parcelListVOIPage . setTotal ( parcelListEntityList . getTotal ( ) ) ;
parcelListVOIPage . setTotal ( parcelListEntityList . getTotal ( ) ) ;
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackageNew(distributionDeliveryInfoDTO);
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackageNew(distributionDeliveryInfoDTO);
log . info ( ">>>>>> parcelListEntityList {}" , parcelListEntityList ) ;
log . info ( ">>>>>> parcelListEntityList {}" , parcelListEntityList ) ;
List < DistributionParcelListVO > parcelListVOList = DistributionParcelListWrapper . build ( ) . listVO ( parcelListEntityList . getRecords ( ) ) ;
List < DistributionParcelListVO > parcelListVOList = DistributionParcelListWrapper . build ( ) . listVO ( parcelListEntityList . getRecords ( ) ) ;
for ( DistributionParcelListVO distributionParcelListVO : parcelListVOList ) {
for ( DistributionParcelListVO distributionParcelListVO : parcelListVOList ) {
log . info ( ">>>>>> distributionParcelListVO {}" , distributionParcelListVO ) ;
log . info ( ">>>>>> distributionParcelListVO {}" , distributionParcelListVO ) ;
if ( Func . isNotEmpty ( loadingDataMap ) ) {
if ( Func . isNotEmpty ( loadingDataMap ) ) {
DistributionLoadscanEntity loadscanEntity = loadingDataMap . get ( distributionParcelListVO . getId ( ) ) ;
DistributionLoadscanEntity loadscanEntity = loadingDataMap . get ( distributionParcelListVO . getId ( ) ) ;
log . info ( ">>>>>> loadscanEntity {}" , loadscanEntity ) ;
log . info ( ">>>>>> loadscanEntity {}" , loadscanEntity ) ;
if ( Func . isNotEmpty ( loadscanEntity ) ) {
if ( Func . isNotEmpty ( loadscanEntity ) ) {
if ( loadscanEntity . getSignforState ( ) . equals ( LoadScanSigningStatusConstant . yiqianshou . getValue ( ) ) ) {
if ( loadscanEntity . getSignforState ( ) . equals ( LoadScanSigningStatusConstant . yiqianshou . getValue ( ) ) ) {
@ -4224,7 +4228,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
}
}
}
}
log . info ( ">>>>>> distributionParcelListVO2 {}" , distributionParcelListVO ) ;
log . info ( ">>>>>> distributionParcelListVO2 {}" , distributionParcelListVO ) ;
distributionParcelListVOS . add ( distributionParcelListVO ) ;
distributionParcelListVOS . add ( distributionParcelListVO ) ;
}
}
@ -5134,7 +5138,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List < DistributionParcelListEntity > parcelListEntities = distributionParcelListService . list ( Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( ) . eq ( DistributionParcelListEntity : : getOrderPackageCode , distrilbutionloadingscanDTO . getBarcode ( ) ) ) ;
List < DistributionParcelListEntity > parcelListEntities = distributionParcelListService . list ( Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( ) . eq ( DistributionParcelListEntity : : getOrderPackageCode , distrilbutionloadingscanDTO . getBarcode ( ) ) ) ;
if ( Func . isNotEmpty ( parcelListEntities ) & & parcelListEntities . size ( ) = = 1 ) {
if ( Func . isNotEmpty ( parcelListEntities ) & & parcelListEntities . size ( ) = = 1 ) {
DistributionParcelListEntity parcelListEntity = parcelListEntities . get ( 0 ) ;
DistributionParcelListEntity parcelListEntity = parcelListEntities . get ( 0 ) ;
if ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) . equals ( parcelListEntity . getOrderPackageLoadingStatus ( ) ) ) {
if ( OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) . equals ( parcelListEntity . getOrderPackageLoadingStatus ( ) ) ) {
//包件已装车
//包件已装车
log . error ( "重复异常装车,:{}" , parcelListEntity . getOrderPackageCode ( ) ) ;
log . error ( "重复异常装车,:{}" , parcelListEntity . getOrderPackageCode ( ) ) ;
return Resp . scanFail ( "操作失败" , "包件已装车" ) ;
return Resp . scanFail ( "操作失败" , "包件已装车" ) ;
@ -5289,13 +5293,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionReservationOrderPackageVO reservationOrderPackageVO = new DistributionReservationOrderPackageVO ( ) ;
DistributionReservationOrderPackageVO reservationOrderPackageVO = new DistributionReservationOrderPackageVO ( ) ;
LambdaQueryWrapper < DistributionParcelListEntity > parcelListEntityLambdaQueryWrapper = Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( )
LambdaQueryWrapper < DistributionParcelListEntity > parcelListEntityLambdaQueryWrapper = Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( )
. notIn ( DistributionParcelListEntity : : getOrderPackageStatus , OrderPackageStatusConstant . yiqianshou . getValue ( ) , OrderPackageStatusConstant . yichuku . getValue ( ) )
. notIn ( DistributionParcelListEntity : : getOrderPackageStatus , OrderPackageStatusConstant . yiqianshou . getValue ( ) , OrderPackageStatusConstant . yichuku . getValue ( ) )
. ne ( DistributionParcelListEntity : : getOrderPackageLoadingStatus , OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) )
. ne ( DistributionParcelListEntity : : getOrderPackageLoadingStatus , OrderPackageLoadingStatusConstant . yizhuangche . getValue ( ) )
. eq ( DistributionParcelListEntity : : getStockArticleId , orderId ) ;
. eq ( DistributionParcelListEntity : : getStockArticleId , orderId ) ;
if ( Func . isNotEmpty ( reservationPackageList ) ) {
if ( Func . isNotEmpty ( reservationPackageList ) ) {
List < Long > packageIds = reservationPackageList . stream ( ) . map ( DistributionParcelListEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
List < Long > packageIds = reservationPackageList . stream ( ) . map ( DistributionParcelListEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
if ( Func . isNotEmpty ( packageIds ) ) {
if ( Func . isNotEmpty ( packageIds ) ) {
parcelListEntityLambdaQueryWrapper . notIn ( DistributionParcelListEntity : : getId , packageIds ) ;
parcelListEntityLambdaQueryWrapper . notIn ( DistributionParcelListEntity : : getId , packageIds ) ;
}
}
}
}
List < DistributionParcelListEntity > parcelListEntities = distributionParcelListService . list ( parcelListEntityLambdaQueryWrapper ) ;
List < DistributionParcelListEntity > parcelListEntities = distributionParcelListService . list ( parcelListEntityLambdaQueryWrapper ) ;
@ -6474,7 +6478,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询产品名称拼接
//查询产品名称拼接
String productName = distributionReservationPackageService . getConcatThirdProductByOrderId ( reservationId , stockArticleId ) ;
String productName = distributionReservationPackageService . getConcatThirdProductByOrderId ( reservationId , stockArticleId ) ;
String materialNames = distributionReservationPackageService . getConcatMaterialName ( reservationId , stockArticleId ) ;
String materialNames = distributionReservationPackageService . getConcatMaterialName ( reservationId , stockArticleId ) ;
temp . put ( "产品名称" , productName ) ;
temp . put ( "产品名称" , productName ) ;
//todo 单位是否需要查询物料表
//todo 单位是否需要查询物料表
@ -6744,6 +6748,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
@Override
@Override
@Transactional
public void maintenanceDeliveryNum ( Long deliveryId ) {
public void maintenanceDeliveryNum ( Long deliveryId ) {
DistributionDeliveryListEntity deliveryListEntity = this . getById ( deliveryId ) ;
DistributionDeliveryListEntity deliveryListEntity = this . getById ( deliveryId ) ;
if ( Func . isNotEmpty ( deliveryListEntity ) ) {
if ( Func . isNotEmpty ( deliveryListEntity ) ) {
@ -6754,11 +6759,58 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
deliveryListEntity . setDeliveryNumber ( packageNum ) ;
deliveryListEntity . setDeliveryNumber ( packageNum ) ;
deliveryListEntity . setInventoryNub ( inventoryNum ) ;
deliveryListEntity . setInventoryNub ( inventoryNum ) ;
}
}
deliveryListEntity . setCustomersNumber ( distributionReservationEntities . size ( ) ) ;
this . updateById ( deliveryListEntity ) ;
this . updateById ( deliveryListEntity ) ;
}
}
}
}
@Override
@Transactional
public R cancelDelivery ( Long deliveryId ) {
String method = "###################DistributionDeliveryListServiceImpl执行方法cancelDelivery," ;
DistributionDeliveryListEntity deliveryListEntity = this . getById ( deliveryId ) ;
if ( Func . isEmpty ( deliveryListEntity ) ) {
log . info ( method + "参数缺失deliveryId:{}" , deliveryId ) ;
return R . fail ( "服务器正忙!!!" ) ;
}
List < DistributionReservationEntity > reservationEntities = distributionSignforService . selectReservationByDeliveryId ( deliveryId ) ;
if ( Func . isEmpty ( reservationEntities ) ) {
log . info ( method + "预约查询失败:{}" , deliveryId ) ;
return R . fail ( "服务器正忙!!!" ) ;
}
String reservationCodes = reservationEntities . stream ( ) . filter ( f - > ! f . getLoadingStatus ( ) . equals ( ReservationLoadingStatusConstant . daizhuangche . getValue ( ) ) ) . map ( DistributionReservationEntity : : getReservationCode ) . collect ( Collectors . joining ( "," ) ) ;
if ( Func . isNotEmpty ( reservationCodes ) ) {
log . info ( method + "存在装车数据:{}" , reservationCodes ) ;
return R . fail ( deliveryListEntity . getTrainNumber ( ) + "存在装车包件!!!" ) ;
}
//该配送是否存在异常装车或者异常签收数据
List < DistributionLoadscanEntity > loadscanEntityList = distributionDeliveryListService . selectAbnormalLoadingBydeliveryId ( deliveryId ) ;
if ( Func . isNotEmpty ( loadscanEntityList ) ) {
log . info ( method + "存在异常装车数据:{}" , deliveryId ) ;
return R . fail ( reservationCodes + "存在异常装车、签收包条!!!" ) ;
}
boolean flag = false ;
for ( DistributionReservationEntity reservationEntity : reservationEntities ) {
DistributionReservationDTO reservationDTO = Func . copy ( reservationEntity , DistributionReservationDTO . class ) ;
flag = distributionReservationService . cancelReservation ( reservationDTO ) ;
if ( ! flag ) {
log . info ( method + "取消预约失败:{}" , deliveryId ) ;
throw new RuntimeException ( "取消配送计划失败,请联系管理员" ) ;
}
}
return R . status ( flag ) ;
}
@Override
public List < DistributionLoadscanEntity > selectAbnormalLoadingBydeliveryId ( Long deliveryId ) {
return distributionLoadscanService . list ( Wrappers . < DistributionLoadscanEntity > query ( ) . lambda ( )
. eq ( DistributionLoadscanEntity : : getDeliveryId , deliveryId )
. eq ( DistributionLoadscanEntity : : getScanStatus , LoadingStatusConstant . quxiao . getValue ( ) )
. eq ( DistributionLoadscanEntity : : getIsAbnormalLoading , 2 )
) ;
}
@Override
@Override
@Transactional
@Transactional
public void maintenanceDeliveryInfo ( Long deliveryId ) {
public void maintenanceDeliveryInfo ( Long deliveryId ) {
@ -6798,10 +6850,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List < DistributionSignforEntity > list = distributionSignforService . list ( Wrappers . < DistributionSignforEntity > query ( ) . lambda ( )
List < DistributionSignforEntity > list = distributionSignforService . list ( Wrappers . < DistributionSignforEntity > query ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getDeliveryId , deliveryId )
. eq ( DistributionSignforEntity : : getDeliveryId , deliveryId )
) ;
) ;
if ( ! list . isEmpty ( ) ) {
if ( ! list . isEmpty ( ) ) {
//查看所有的签收信息是否均已完成
//查看所有的签收信息是否均已完成
boolean anyMatch = list . stream ( ) . allMatch ( s - > s . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) ;
boolean anyMatch = list . stream ( ) . allMatch ( s - > s . getSigningStatus ( ) . equals ( SignforStatusConstant . yiqianshou . getValue ( ) ) ) ;
if ( anyMatch ) {
if ( anyMatch ) {
deliveryListEntity . setDeliveryStatus ( DeliveryStatusConstant . yiwancheng . getValue ( ) ) ;
deliveryListEntity . setDeliveryStatus ( DeliveryStatusConstant . yiwancheng . getValue ( ) ) ;
}
}
}
}