@ -251,11 +251,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 获取当前登录人仓库
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient . getMyCurrentWarehouse ( ) ;
if ( null = = myCurrentWarehouse ) {
if ( null = = myCurrentWarehouse ) {
List < BasicdataWarehouseEntity > myWatchWarehouse = basicdataWarehouseClient . getMyWatchWarehouse ( ) ;
List < Long > collect = myWatchWarehouse . stream ( ) . map ( BasicdataWarehouseEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
distributionSignfor . setWarehouseIdList ( collect ) ;
} else {
} else {
List < Long > collect = new ArrayList < > ( ) ;
collect . add ( myCurrentWarehouse . getId ( ) ) ;
distributionSignfor . setWarehouseIdList ( collect ) ;
@ -266,7 +266,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
try {
distributionSignforVOS = baseMapper . selectDistributionSignforPage ( page , distributionSignfor ) ;
} catch ( Exception e ) {
log . error ( ">>> selectDistributionSignforPage" , e ) ;
log . error ( ">>> selectDistributionSignforPage" , e ) ;
// 这里应该记录日志或者进行一些错误处理
return page . setRecords ( Collections . emptyList ( ) ) ;
}
@ -283,10 +283,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
private void processReservationIds ( List < DistributionSignforVO > distributionSignforVOS , List < Long > reservationIds ) {
List < DistributionParcelListVO > distributionParcelListEntities = distributionReservationMapper . selectPackageListByReservationIds ( reservationIds ) ;
List < DisStockListDetailEntity > list = disStockListDetailService . list ( Wrappers . < DisStockListDetailEntity > query ( ) . lambda ( )
. in ( DisStockListDetailEntity : : getReservationId , reservationIds )
. ne ( DisStockListDetailEntity : : getStockPackageStatus , ReservationPackageStatusConstant . quxiao . getValue ( ) )
) ;
// List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
// .in(DisStockListDetailEntity::getReservationId, reservationIds)
// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
// );
List < DistributionReservationZeroPackageEntity > reservationZeroPackageEntities = distributionReservationZeroPackageService . list ( Wrappers . < DistributionReservationZeroPackageEntity > query ( ) . lambda ( )
. in ( DistributionReservationZeroPackageEntity : : getReservationId , reservationIds )
. ne ( DistributionReservationZeroPackageEntity : : getZeroPackageStatus , ReservationPackageStatusConstant . quxiao . getValue ( ) )
@ -378,9 +378,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
private String getDeliveryTypeName ( String type ) {
switch ( type ) {
case "1" :
return DistributionTypeConstant . shipie . getName ( ) ;
case "2" :
return DistributionTypeConstant . shangpei . getName ( ) ;
case "2" :
return DistributionTypeConstant . shipie . getName ( ) ;
case "3" :
return DistributionTypeConstant . ziti . getName ( ) ;
default :
return "" ;
}
@ -890,9 +892,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
//统计客户装车数
Integer lad = distributionLoadscanMapper . selectCount ( new QueryWrapper < DistributionLoadscanEntity > ( ) . lambda ( ) . eq ( DistributionLoadscanEntity : : getReservationId , signforEntity . getReservationId ( ) ) ) . intValue ( ) ;
Integer lad = distributionLoadscanMapper . selectCount ( new QueryWrapper < DistributionLoadscanEntity > ( ) . lambda ( )
. eq ( DistributionLoadscanEntity : : getReservationId , signforEntity . getReservationId ( ) )
. ne ( DistributionLoadscanEntity : : getScanStatus , LoadingStatusConstant . quxiao . getValue ( ) ) )
. intValue ( ) ;
Integer nad = distributionLoadscaninvnMapper . selectCount ( new QueryWrapper < DistributionLoadscaninvnEntity > ( ) . lambda ( ) . eq ( DistributionLoadscaninvnEntity : : getReservationId , signforEntity . getReservationId ( ) ) ) . intValue ( ) ;
Integer nad = distributionLoadscaninvnMapper . selectCount ( new QueryWrapper < DistributionLoadscaninvnEntity > ( ) . lambda ( )
. eq ( DistributionLoadscaninvnEntity : : getReservationId , signforEntity . getReservationId ( ) )
. ne ( DistributionLoadscaninvnEntity : : getScanStatus , LoadingStatusConstant . quxiao . getValue ( ) ) )
. intValue ( ) ;
signforEntity . setLoadedNumber ( lad ) ;
signforEntity . setLoadedinNumber ( nad ) ;
//统计客户签收数
@ -1711,8 +1719,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
private List < DeliveryNodeVo > handleStockUp ( DistributionStockupEntity distributionStockupEntity ) {
List < DeliveryNodeVo > nodeVos = new ArrayList < > ( ) ;
try {
@ -2378,102 +2384,82 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public List < DistributionSignforOwnExcel > exportDistributionSignforOwn ( DistributionSignforVO distributionSignforVO ) {
// 转换创建时间
try {
// 转换创建时间
distributionSignforVO . setCreateTime_query ( DateUtil . format ( distributionSignforVO . getCreateTime ( ) , "yyyy:MM:dd HH:mm:ss" ) ) ;
// 获取当前登录人仓库
// 获取当前登录人仓库
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient . getMyCurrentWarehouse ( ) ;
if ( null = = myCurrentWarehouse ) {
List < BasicdataWarehouseEntity > myWatchWarehouse = basicdataWarehouseClient . getMyWatchWarehouse ( ) ;
List < Long > collect = myWatchWarehouse . stream ( ) . map ( BasicdataWarehouseEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
distributionSignforVO . setWarehouseIdList ( collect ) ;
} else {
List < Long > collect = new ArrayList < > ( ) ;
collect . add ( myCurrentWarehouse . getId ( ) ) ;
distributionSignforVO . setWarehouseIdList ( collect ) ;
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient . getMyCurrentWarehouse ( ) ;
if ( null = = myCurrentWarehouse ) {
List < BasicdataWarehouseEntity > myWatchWarehouse = basicdataWarehouseClient . getMyWatchWarehouse ( ) ;
List < Long > collect = myWatchWarehouse . stream ( ) . map ( BasicdataWarehouseEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
distributionSignforVO . setWarehouseIdList ( collect ) ;
} else {
List < Long > collect = new ArrayList < > ( ) ;
collect . add ( myCurrentWarehouse . getId ( ) ) ;
distributionSignforVO . setWarehouseIdList ( collect ) ;
}
List < DistributionSignforVO > distributionSignforVOS ;
try {
distributionSignforVOS = baseMapper . selectDistributionSignforPage ( null , distributionSignforVO ) ;
} catch ( Exception e ) {
log . error ( ">>> selectDistributionSignforPage" , e ) ;
// 这里应该记录日志或者进行一些错误处理
return Collections . emptyList ( ) ;
}
List < DistributionSignforVO > distributionSignforVOS ;
try {
distributionSignforVOS = baseMapper . selectDistributionSignforPage ( null , distributionSignforVO ) ;
} catch ( Exception e ) {
log . error ( ">>> selectDistributionSignforPage" , e ) ;
// 这里应该记录日志或者进行一些错误处理
return Collections . emptyList ( ) ;
}
if ( Func . isNotEmpty ( distributionSignforVOS ) ) {
List < Long > reservationIds = distributionSignforVOS . stream ( ) . map ( DistributionSignforVO : : getReservationId ) . collect ( Collectors . toList ( ) ) ;
processReservationIds ( distributionSignforVOS , reservationIds ) ;
}
if ( Func . isNotEmpty ( distributionSignforVOS ) ) {
List < Long > reservationIds = distributionSignforVOS . stream ( ) . map ( DistributionSignforVO : : getReservationId ) . collect ( Collectors . toList ( ) ) ;
processReservationIds ( distributionSignforVOS , reservationIds ) ;
}
List < DistributionSignforOwnExcel > a = new ArrayList < > ( ) ;
distributionSignforVOS . forEach ( d - > {
d . setDeliveryTypeName ( getDeliveryTypeName ( d . getDeliveryType ( ) ) ) ;
List < DistributionSignforOwnExcel > a = new ArrayList < > ( ) ;
distributionSignforVOS . forEach ( d - > {
d . setDeliveryTypeName ( getDeliveryTypeName ( d . getDeliveryType ( ) ) ) ;
DistributionSignforOwnExcel signforExcel = new DistributionSignforOwnExcel ( ) ;
DistributionSignforOwnExcel signforExcel = new DistributionSignforOwnExcel ( ) ;
// BeanUtils.copyProperties(d, signforExcel);
signforExcel . setTrainNumber ( d . getTrainNumber ( ) ) ;
signforExcel . setReservationCode ( d . getReservationCode ( ) ) ;
signforExcel . setDeliveryDriverName ( d . getDriverName ( ) ) ;
signforExcel . setDeliveryDriverPhone ( d . getDriverPhone ( ) ) ;
signforExcel . setVehicleName ( d . getVehicleName ( ) ) ;
signforExcel . setTaskTime ( d . getTaskTime ( ) ) ;
signforExcel . setOrderCode ( d . getStockArticleId ( ) ) ;
signforExcel . setDeliveryTypeName ( d . getDeliveryTypeName ( ) ) ;
signforExcel . setSigningStatusName ( d . getSigningStatusName ( ) ) ;
signforExcel . setSigningTime ( d . getSigningTime ( ) ) ;
signforExcel . setDeliveryStatusName ( d . getDeliveryStatusName ( ) ) ;
signforExcel . setDeliveryPhone ( d . getDriverPhone ( ) ) ;
signforExcel . setLoadedNumber ( d . getLoadedNumber ( ) ) ;
signforExcel . setReceivedQuantity ( d . getReceivedQuantity ( ) ) ;
signforExcel . setReservationNum ( d . getReservationNum ( ) ) ;
signforExcel . setDeliveryAddress ( d . getDeliveryAddress ( ) ) ;
signforExcel . setWithoutScanning ( d . getWithoutScanning ( ) ) ;
signforExcel . setLoadingTime ( d . getSigningTime ( ) ) ;
signforExcel . setConsignee ( d . getConsignee ( ) ) ;
signforExcel . setDeliveryPhone ( d . getDeliveryPhone ( ) ) ;
signforExcel . setDeliveryTypeName ( d . getDeliveryTypeName ( ) ) ;
signforExcel . setSjsigningTime ( d . getSjsigningTime ( ) ) ;
signforExcel . setSigneeName ( d . getSigneeName ( ) ) ;
signforExcel . setSigningStatusName ( d . getSigningStatus ( ) ) ;
signforExcel . setDeliveryStatusName ( d . getSijiSigningStatus ( ) ) ;
signforExcel . setExamineUserName ( d . getExamineUserName ( ) ) ;
signforExcel . setWarehouseName ( d . getWarehouseName ( ) ) ;
signforExcel . setUnsigneds ( d . getTotalNum ( ) - d . getSigningNum ( ) ) ;
a . add ( signforExcel ) ;
} ) ;
return a ;
signforExcel . setTrainNumber ( d . getTrainNumber ( ) ) ;
signforExcel . setReservationCode ( d . getReservationCode ( ) ) ;
signforExcel . setDeliveryDriverName ( d . getDriverName ( ) ) ;
signforExcel . setDeliveryDriverPhone ( d . getDriverPhone ( ) ) ;
signforExcel . setVehicleName ( d . getVehicleName ( ) ) ;
signforExcel . setTaskTime ( d . getTaskTime ( ) ) ;
signforExcel . setOrderCode ( d . getStockArticleId ( ) ) ;
signforExcel . setDeliveryTypeName ( d . getDeliveryTypeName ( ) ) ;
signforExcel . setSigningStatusName ( d . getSigningStatusName ( ) ) ;
signforExcel . setSigningTime ( d . getSigningTime ( ) ) ;
signforExcel . setDeliveryStatusName ( d . getDeliveryStatusName ( ) ) ;
signforExcel . setDeliveryPhone ( d . getDriverPhone ( ) ) ;
signforExcel . setLoadedNumber ( d . getLoadedNumber ( ) ) ;
signforExcel . setReceivedQuantity ( d . getReceivedQuantity ( ) ) ;
signforExcel . setReservationNum ( d . getReservationNum ( ) ) ;
signforExcel . setDeliveryAddress ( d . getDeliveryAddress ( ) ) ;
signforExcel . setWithoutScanning ( d . getWithoutScanning ( ) ) ;
signforExcel . setLoadingTime ( d . getSigningTime ( ) ) ;
signforExcel . setConsignee ( d . getConsignee ( ) ) ;
signforExcel . setDeliveryPhone ( d . getDeliveryPhone ( ) ) ;
signforExcel . setDeliveryTypeName ( d . getDeliveryTypeName ( ) ) ;
signforExcel . setSjsigningTime ( d . getSjsigningTime ( ) ) ;
signforExcel . setSigneeName ( d . getSigneeName ( ) ) ;
signforExcel . setSigningStatusName ( d . getSigningStatus ( ) ) ;
signforExcel . setDeliveryStatusName ( d . getSijiSigningStatus ( ) ) ;
signforExcel . setExamineUserName ( d . getExamineUserName ( ) ) ;
signforExcel . setWarehouseName ( d . getWarehouseName ( ) ) ;
int unsigneds = d . getReservationNum ( ) - d . getReceivedQuantity ( ) ;
signforExcel . setUnsigneds ( unsigneds ) ;
a . add ( signforExcel ) ;
} ) ;
return a ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
}
return null ;
// List<DistributionSignforVO> distributionSignforList = baseMapper.exportDistributionSignforSigningOwn(distributionSignforVO);
//
// List<DistributionSignforOwnExcel> list = new ArrayList<>();
// distributionSignforList.forEach(d -> {
// DistributionSignforOwnExcel signforExcel = Func.copy(d, DistributionSignforOwnExcel.class);
// assert signforExcel != null;
// signforExcel.setLoadingTime(d.getLoadingTime());
// signforExcel.setDeliveryDriverPhone(d.getDriverPhone());
// signforExcel.setDeliveryDriverName(d.getDriverName());
// signforExcel.setReservationNum(d.getTotalNum());
// signforExcel.setLoadedNumber(d.getPackageLoadingNum() + d.getInventoryLoadingNum());
// signforExcel.setReceivedQuantity(d.getPackageSigningNum() + d.getInventorySigningNum());
// signforExcel.setDeliveryStatusName(d.getDeliveryStatusName());
// signforExcel.setDeliveryPhone(d.getDeliveryPhone());
// signforExcel.setWithoutScanning(d.getTotalNum() - (d.getPackageLoadingNum() + d.getInventoryLoadingNum()));
// signforExcel.setUnsigneds(d.getTotalNum() - (d.getPackageSigningNum() + d.getInventorySigningNum()));
// signforExcel.setConsignee(d.getConsignee());
// list.add(signforExcel);
// });
// return list;
}
@Override
@ -2526,7 +2512,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
List < Long > packageLockIds = new ArrayList < > ( ) ;
try {
@ -2767,10 +2752,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
. eq ( DistributionLoadscanAbnormalEntity : : getPackageCode , distrilbutionloadingscanDTO . getBarcode ( ) )
) ;
//查询是否存在驳回操作
if ( ! Func . isEmpty ( abnormalEntity ) ) {
if ( abnormalEntity . getAuditingStatus ( ) . equals ( 3 ) ) {
return Resp . scanFail ( "包件异常已驳回,请扫滞留" , "包件异常已驳回,请扫滞留" ) ;
}
if ( ! Func . isEmpty ( abnormalEntity ) ) {
if ( abnormalEntity . getAuditingStatus ( ) . equals ( 3 ) ) {
return Resp . scanFail ( "包件异常已驳回,请扫滞留" , "包件异常已驳回,请扫滞留" ) ;
}
}
return R . fail ( 3006 , null ) ;
@ -3114,8 +3099,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if ( ! packageLockIds . isEmpty ( ) ) {
List < Long > a = bladeRedis . get ( "warehouseId:" + myCurrentWarehouse . getId ( ) + "trainNumber:" + deliveryListEntity . getTrainNumber ( ) + "orderPackageCode:" ) ;
if ( Func . isNotEmpty ( a ) ) {
assert a ! = null ;
boolean flag = a . stream ( ) . anyMatch ( any - > packageLockIds . contains ( any ) ) ;
assert a ! = null ;
boolean flag = a . stream ( ) . anyMatch ( any - > packageLockIds . contains ( any ) ) ;
if ( flag ) {
//正在操作,请稍后重试
throw new RuntimeException ( "该包件正在被操作,请稍后再试!!!" ) ;
@ -3959,7 +3944,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List < DistributionStockArticleEntity > distributionStockArticleEntities = distributionStockArticleService . listByIds ( orderIds ) ;
List < DistributionReservationStockarticleEntity > reservationOrders = distributionReservationStockarticleService . list ( Wrappers . < DistributionReservationStockarticleEntity > query ( ) . lambda ( )
. eq ( DistributionReservationStockarticleEntity : : getReservationId , distributionDeliveryList . getReservationId ( ) )
. in ( DistributionReservationStockarticleEntity : : getStockArticleId , orderIds )
@ -4099,6 +4083,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
/ * *
* 寻找预约单中订单
*
* @param reservationOrders
* @param id
* @return
@ -6407,7 +6392,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return selectDistributionSignforPageCount ;
}
@Override
@ -6700,11 +6684,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
private void buildReservationNameAndPhone ( List < SignPushDataContactDTO > customers ) {
for ( SignPushDataContactDTO signPushDataUnitDTO : customers ) {
User user = bladeRedis . get ( RedisKeyConstant . USER_NAME_PHONE_KEY + signPushDataUnitDTO . getSignUserId ( ) ) ;
log . info ( "buildNameAndPhone >>> 获取缓存的中的用户信息{}" , user ) ;
log . info ( "buildNameAndPhone >>> 获取缓存的中的用户信息{}" , user ) ;
if ( user = = null ) {
R < User > userT = userClient . userInfoById ( signPushDataUnitDTO . getSignUserId ( ) ) ;
if ( userT . isSuccess ( ) ) {
@ -6715,13 +6698,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if ( ObjectUtils . isNotNull ( user ) ) {
assert user ! = null ;
signPushDataUnitDTO . setSignUserName ( user . getName ( ) ) ;
if ( ObjectUtils . isNotEmpty ( user . getPhone ( ) ) ) {
if ( ObjectUtils . isNotEmpty ( user . getPhone ( ) ) ) {
signPushDataUnitDTO . setSignUserPhone ( user . getPhone ( ) ) ;
} else {
if ( ObjectUtils . isNotEmpty ( user . getAccount ( ) ) ) {
} else {
if ( ObjectUtils . isNotEmpty ( user . getAccount ( ) ) ) {
signPushDataUnitDTO . setSignUserPhone ( user . getAccount ( ) ) ;
} else {
log . info ( "用户无电话号码且账号信息为空>>用户名称:{}" , user . getName ( ) ) ;
} else {
log . info ( "用户无电话号码且账号信息为空>>用户名称:{}" , user . getName ( ) ) ;
}
}
}