@ -18,6 +18,8 @@ package com.logpm.distribution.service.impl;
import cn.hutool.core.date.DatePattern ;
import cn.hutool.core.date.DateUtil ;
import cn.hutool.core.date.DateUtil ;
import cn.hutool.json.JSONUtil ;
import com.alibaba.fastjson.JSON ;
import com.alibaba.fastjson.JSONObject ;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper ;
@ -34,97 +36,18 @@ import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataDriverArteryClient ;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient ;
import com.logpm.distribution.bean.Resp ;
import com.logpm.distribution.dto.DistributionAddvalueDTO ;
import com.logpm.distribution.dto.DistributionDeliverySelfDTO ;
import com.logpm.distribution.dto.DistributionNumberDetailDTO ;
import com.logpm.distribution.dto.DistributionParcelNumberDTO ;
import com.logpm.distribution.dto.DistributionSignforDTO ;
import com.logpm.distribution.dto.DistributionSignforExcelDTO ;
import com.logpm.distribution.dto.DistrilbutionAppsignforDTO ;
import com.logpm.distribution.dto.* ;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO ;
import com.logpm.distribution.entity.DisStockListDetailEntity ;
import com.logpm.distribution.entity.DistributionAddvaluePackageEntity ;
import com.logpm.distribution.entity.DistributionBillLadingScanEntity ;
import com.logpm.distribution.entity.DistributionDeliveryListEntity ;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity ;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity ;
import com.logpm.distribution.entity.DistributionLoadscanAbnormalEntity ;
import com.logpm.distribution.entity.DistributionLoadscanEntity ;
import com.logpm.distribution.entity.DistributionLoadscaninvnEntity ;
import com.logpm.distribution.entity.DistributionParcelListEntity ;
import com.logpm.distribution.entity.DistributionParcelNumberEntity ;
import com.logpm.distribution.entity.DistributionReservationEntity ;
import com.logpm.distribution.entity.DistributionReservationPackageEntity ;
import com.logpm.distribution.entity.DistributionReservationStockarticleEntity ;
import com.logpm.distribution.entity.DistributionReservationStocklistEntity ;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity ;
import com.logpm.distribution.entity.DistributionSignPrintEntity ;
import com.logpm.distribution.entity.DistributionSignforEntity ;
import com.logpm.distribution.entity.DistributionStockArticleEntity ;
import com.logpm.distribution.entity.DistributionStockEntity ;
import com.logpm.distribution.entity.DistributionStockListEntity ;
import com.logpm.distribution.entity.DistributionStockupEntity ;
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity ;
import com.logpm.distribution.excel.DistributionSignforExcel ;
import com.logpm.distribution.excel.DistributionSignforInventoryExcel ;
import com.logpm.distribution.excel.DistributionSignforOrderExcel ;
import com.logpm.distribution.excel.DistributionSignforOwnExcel ;
import com.logpm.distribution.excel.DistributionSignforPackageExcel ;
import com.logpm.distribution.mapper.DistributionAddvalueMapper ;
import com.logpm.distribution.mapper.DistributionDeliveryListMapper ;
import com.logpm.distribution.mapper.DistributionDeliverySelfMapper ;
import com.logpm.distribution.mapper.DistributionDeliveryTripartiteMapper ;
import com.logpm.distribution.mapper.DistributionLoadscanMapper ;
import com.logpm.distribution.mapper.DistributionLoadscaninvnMapper ;
import com.logpm.distribution.mapper.DistributionParcelListMapper ;
import com.logpm.distribution.mapper.DistributionReservationMapper ;
import com.logpm.distribution.mapper.DistributionSignforMapper ;
import com.logpm.distribution.mapper.DistributionStockArticleMapper ;
import com.logpm.distribution.mapper.DistributionStockListMapper ;
import com.logpm.distribution.mapper.DistributionStockMapper ;
import com.logpm.distribution.mapper.DistributionStockupMapper ;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper ;
import com.logpm.distribution.service.IDisStockListDetailService ;
import com.logpm.distribution.service.IDistributionAddvaluePackageService ;
import com.logpm.distribution.service.IDistributionAddvalueService ;
import com.logpm.distribution.service.IDistributionAsyncService ;
import com.logpm.distribution.service.IDistributionBillLadingScanService ;
import com.logpm.distribution.service.IDistributionDeliveryListService ;
import com.logpm.distribution.service.IDistributionLoadscanAbnormalService ;
import com.logpm.distribution.service.IDistributionParcelListService ;
import com.logpm.distribution.service.IDistributionParcelNumberService ;
import com.logpm.distribution.service.IDistributionReservationPackageService ;
import com.logpm.distribution.service.IDistributionReservationService ;
import com.logpm.distribution.service.IDistributionReservationStockarticleService ;
import com.logpm.distribution.service.IDistributionReservationZeroPackageService ;
import com.logpm.distribution.service.IDistributionSignPrintService ;
import com.logpm.distribution.service.IDistributionSignforService ;
import com.logpm.distribution.service.IDistributionStockArticleService ;
import com.logpm.distribution.service.IDistributionStockListService ;
import com.logpm.distribution.service.IDistributionStockupService ;
import com.logpm.distribution.service.IDistrilbutionBillLadingService ;
import com.logpm.distribution.vo.DeliveryNodeVo ;
import com.logpm.distribution.vo.DistributionAddvaluePackageVO ;
import com.logpm.distribution.vo.DistributionAddvalueVO ;
import com.logpm.distribution.vo.DistributionDeliverySelfVO ;
import com.logpm.distribution.vo.DistributionLoadscanAbnormalVO ;
import com.logpm.distribution.vo.DistributionParcelListVO ;
import com.logpm.distribution.vo.DistributionParcelNumberVO ;
import com.logpm.distribution.vo.DistributionSignPrintVO ;
import com.logpm.distribution.vo.DistributionSignforStockListVO ;
import com.logpm.distribution.vo.DistributionSignforVO ;
import com.logpm.distribution.vo.DistributionSignforsnmbVO ;
import com.logpm.distribution.vo.DistributionStockArticleVO ;
import com.logpm.distribution.vo.SignforPageCountVO ;
import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO ;
import com.logpm.distribution.vo.app.DistributionAppDeliverySelfVO ;
import com.logpm.distribution.vo.app.DistributionAppPackageDetailVO ;
import com.logpm.distribution.vo.app.DistributionAppParcelListVO ;
import com.logpm.distribution.vo.app.DistributionAppSignforVO ;
import com.logpm.distribution.vo.app.DistributionAppStockArticleVO ;
import com.logpm.distribution.entity.* ;
import com.logpm.distribution.excel.* ;
import com.logpm.distribution.mapper.* ;
import com.logpm.distribution.service.* ;
import com.logpm.distribution.vo.* ;
import com.logpm.distribution.vo.app.* ;
import com.logpm.distribution.wrapper.DistributionParcelListAppWrapper ;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper ;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper ;
import com.logpm.factory.comfac.dto.OrderStatusDTO ;
import com.logpm.oldproject.dto.SignPushDataContactDTO ;
import com.logpm.oldproject.dto.SignPushDataDTO ;
import com.logpm.oldproject.dto.SignPushDataUnitDTO ;
@ -151,16 +74,8 @@ import org.springblade.common.constant.loading.LoadScanSigningStatusConstant;
import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant ;
import org.springblade.common.constant.loading.LoadingIsInsertConstant ;
import org.springblade.common.constant.loading.LoadingStatusConstant ;
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant ;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant ;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant ;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant ;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant ;
import org.springblade.common.constant.reservation.ReservationLoadingStatusConstant ;
import org.springblade.common.constant.reservation.ReservationOrderStatusConstant ;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant ;
import org.springblade.common.constant.reservation.ReservationSigningStatusConstant ;
import org.springblade.common.constant.reservation.ReservationStatusConstant ;
import org.springblade.common.constant.orderpackage.* ;
import org.springblade.common.constant.reservation.* ;
import org.springblade.common.constant.signing.SignforDriverSigningStatusConstant ;
import org.springblade.common.constant.signing.SignforStatusConstant ;
import org.springblade.common.constant.stockup.StockAssignStatusConstant ;
@ -200,15 +115,7 @@ import java.io.IOException;
import java.math.BigDecimal ;
import java.text.ParseException ;
import java.text.SimpleDateFormat ;
import java.util.ArrayList ;
import java.util.Arrays ;
import java.util.Collections ;
import java.util.Date ;
import java.util.HashMap ;
import java.util.Iterator ;
import java.util.List ;
import java.util.Map ;
import java.util.Objects ;
import java.util.* ;
import java.util.concurrent.atomic.AtomicInteger ;
import java.util.concurrent.atomic.AtomicReference ;
import java.util.function.Function ;
@ -2502,6 +2409,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if ( Objects . isNull ( myCurrentWarehouse ) ) {
return R . fail ( 403 , "配送任务错误" ) ;
}
//查询是否完成复核
DistributionSignforEntity signforEntity = this . getOne ( Wrappers . < DistributionSignforEntity > query ( ) . lambda ( )
. eq ( DistributionSignforEntity : : getReservationId , distrilbutionloadingscanDTO . getReservationId ( ) )
) ;
if ( Objects . isNull ( signforEntity ) ) {
//查询签收信息错误
log . error ( "签收扫描查询签收表信息错误reservationId:{}" , distrilbutionloadingscanDTO . getReservationId ( ) ) ;
return R . fail ( 403 , "配送任务错误" ) ;
}
if ( SignforStatusConstant . yiqianshou . getValue ( ) . equals ( signforEntity . getSigningStatus ( ) ) ) {
return Resp . scanFail ( "此任务已完成复核" , "此任务已完成复核" ) ;
}
List < Long > packageLockIds = new ArrayList < > ( ) ;
try {
@ -2763,6 +2685,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionDeliveryListService . maintenanceDeliveryInfo ( distrilbutionloadingscanDTO . getDeliveryId ( ) ) ;
trunklinePackageTrackLogClient . addPackageTrackLog ( aaa ) ;
// 推送
sendMessage ( distrilbutionloadingscanDTO . getBarcode ( ) , distributionReservationEntity . getReservationCode ( ) ,
deliveryListEntity . getTrainNumber ( ) , deliveryListEntity . getVehicleName ( ) , deliveryListEntity . getDriverName ( ) ,
AuthUtil . getUserName ( ) , myCurrentWarehouse . getId ( ) , AuthUtil . getTenantId ( ) ) ;
return Resp . scanSuccessWithData ( "签收成功" , str , orderPackageCodes ) ;
} catch ( Exception e ) {
log . error ( ">>>>> 签收异常报错" , e ) ;
@ -2770,6 +2700,49 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
/ * *
*
* @param orderPackageCode
* @param reservationCode
* @param distrCarNumber
* @param vehicleName
* @param driverName
* @param userName
* @param warehouseId
* @param tenantId 当前的租户
*
* /
private void sendMessage ( String orderPackageCode ,
String reservationCode ,
String distrCarNumber ,
String vehicleName ,
String driverName ,
String userName ,
Long warehouseId ,
String tenantId
) {
try {
JSONObject jsonObject = new JSONObject ( ) ;
jsonObject . put ( "orderPackageCode" , orderPackageCode ) ;
jsonObject . put ( "reservationCode" , reservationCode ) ;
jsonObject . put ( "distrCarNumber" , distrCarNumber ) ;
jsonObject . put ( "vehicleName" , vehicleName ) ;
jsonObject . put ( "driverName" , driverName ) ;
jsonObject . put ( "userName" , userName ) ;
jsonObject . put ( "warehouseId" , warehouseId ) ;
jsonObject . put ( "tenantId" , tenantId ) ;
// 发送入库消息
Map mapState = new HashMap ( ) ;
mapState . put ( "messageId" , CommonUtil . getUUID ( ) ) ;
mapState . put ( "createTime" , System . currentTimeMillis ( ) ) ;
Map < String , Object > map = new HashMap < > ( ) ;
map . put ( "messageData" , jsonObject ) ;
rabbitTemplate . convertAndSend ( RabbitConstant . BUSINESS_IN_CONVERSION_DATA_EXCHANGE , RabbitConstant . BUSINESS_IN_CONVERSION_DATA_ROUTING , map ) ;
} catch ( Exception e ) {
log . error ( "签收商家推送:{}" , e ) ;
}
}
@Override
@Transactional ( rollbackFor = Exception . class )
public R signforPC ( DistrilbutionAppsignforDTO distrilbutionloadingscanDTO ) {
@ -3803,8 +3776,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public List < DistributionAppStockArticleVO > getAppDeliveryorderListPage ( DistributionAppDeliveryListDTO distributionDeliveryList ) {
List < DistributionAppStockArticleVO > orderVos = new ArrayList < > ( ) ;
if ( Func . isEmpty ( distributionDeliveryList . getReservationId ( ) ) ) {
log . error ( "参数缺失reservationId:{}" , distributionDeliveryList . getReservationId ( ) ) ;
return orderVos ;
}
//查询该客户装车
@ -3830,32 +3805,40 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
Map < Long , List < DistributionReservationStockarticleEntity > > reservationOrderMap = reservationStockarticleEntityList . stream ( ) . collect ( Collectors . groupingBy ( DistributionReservationStockarticleEntity : : getStockArticleId ) ) ;
Map < Long , List < DistributionLoadscanEntity > > loadingOrderMap = distributionLoadscanEntities . stream ( ) . collect ( Collectors . groupingBy ( DistributionLoadscanEntity : : getOrderId ) ) ;
List < DistributionAppStockArticleVO > orderVos = new ArrayList < > ( ) ;
if ( Func . isNotEmpty ( orderIds ) ) {
orderIds = orderIds . stream ( ) . distinct ( ) . collect ( Collectors . toList ( ) ) ;
for ( Long orderId : orderIds ) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService . getById ( orderId ) ;
DistributionAppStockArticleVO distributionAppStockArticleVO = Func . copy ( stockArticleEntity , DistributionAppStockArticleVO . class ) ;
distributionAppStockArticleVO . setTotalNumber ( stockArticleEntity . getTotalNumber ( ) ) ;
distributionAppStockArticleVO . setStockArticleId ( stockArticleEntity . getId ( ) ) ;
distributionAppStockArticleVO . setLoadingNub ( 0 ) ;
List < DistributionStockArticleEntity > distributionStockArticleEntities = distributionStockArticleService . listByIds ( orderIds ) ;
List < DistributionReservationStockarticleEntity > reservationOrders = distributionReservationStockarticleService . list ( Wrappers . < DistributionReservationStockarticleEntity > query ( ) . lambda ( )
. eq ( DistributionReservationStockarticleEntity : : getReservationId , distributionDeliveryList . getReservationId ( ) )
. in ( DistributionReservationStockarticleEntity : : getStockArticleId , orderIds )
. ne ( DistributionReservationStockarticleEntity : : getStockArticleStatus , ReservationOrderStatusConstant . quxiao . getValue ( ) )
) ;
for ( DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities ) {
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId);
DistributionAppStockArticleVO distributionAppStockArticleVO = Func . copy ( distributionStockArticleEntity , DistributionAppStockArticleVO . class ) ;
assert distributionAppStockArticleVO ! = null ;
distributionAppStockArticleVO . setLoadingNub ( 0 ) ;
distributionAppStockArticleVO . setSignforNub ( 0 ) ;
distributionAppStockArticleVO . setReservationNum ( 0 ) ;
//查询预约该订单计划数量
DistributionReservationStockarticleEntity reservationOrder = distributionReservationStockarticleService . getOne ( Wrappers . < DistributionReservationStockarticleEntity > query ( ) . lambda ( )
. eq ( DistributionReservationStockarticleEntity : : getReservationId , distributionDeliveryList . getReservationId ( ) )
. eq ( DistributionReservationStockarticleEntity : : getStockArticleId , orderId )
. ne ( DistributionReservationStockarticleEntity : : getStockArticleStatus , ReservationOrderStatusConstant . quxiao . getValue ( ) )
) ;
DistributionReservationStockarticleEntity reservationOrder = findReservationOrders ( reservationOrders , distributionStockArticleEntity . getId ( ) ) ;
if ( Func . isNotEmpty ( reservationOrder ) ) {
distributionAppStockArticleVO . setReservationNum ( reservationOrder . getReservationNum ( ) ) ;
}
if ( stockArticleEntity . getIsZero ( ) . equals ( IsOrNoConstant . no . getValue ( ) ) ) {
if ( distributionStockArticleEntity . getIsZero ( ) . equals ( IsOrNoConstant . no . getValue ( ) ) ) {
//判断此订单是是否是异常装车
if ( Func . isEmpty ( reservationOrderMap . get ( orderId ) ) ) {
if ( Func . isEmpty ( reservationOrderMap . get ( distributionStockArticleEntity . getId ( ) ) ) ) {
//不存在计划之中的订单装车
List < DistributionLoadscanEntity > loadscanEntityList = loadingOrderMap . get ( orderId ) ;
List < DistributionLoadscanEntity > loadscanEntityList = loadingOrderMap . get ( distributionStockArticleEntity . getId ( ) ) ;
List < Long > abnormalPackageIds = loadscanEntityList . stream ( ) . map ( DistributionLoadscanEntity : : getPackageId ) . collect ( Collectors . toList ( ) ) ;
List < DistributionParcelListEntity > distributionParcelListEntities = distributionParcelListService . listByIds ( abnormalPackageIds ) ;
List < DistributionAppParcelListVO > distributionAppParcelListVOS = DistributionParcelListAppWrapper . build ( ) . listVO ( distributionParcelListEntities ) ;
@ -3877,7 +3860,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询此预约该订单下的包件信息
List < DistributionReservationPackageEntity > reservationPackage = distributionReservationPackageService . list ( Wrappers . < DistributionReservationPackageEntity > query ( ) . lambda ( )
. eq ( DistributionReservationPackageEntity : : getReservationId , distributionDeliveryList . getReservationId ( ) )
. eq ( DistributionReservationPackageEntity : : getStockArticleId , orderId )
. eq ( DistributionReservationPackageEntity : : getStockArticleId , distributionStockArticleEntity . getId ( ) )
. ne ( DistributionReservationPackageEntity : : getPacketBarStatus , ReservationPackageStatusConstant . quxiao . getValue ( ) )
) ;
List < Long > packageIds = new ArrayList < > ( ) ;
@ -3887,8 +3870,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
Map < Long , DistributionLoadscanEntity > collect = null ;
if ( Func . isNotEmpty ( loadingOrderMap . get ( orderId ) ) ) {
List < DistributionLoadscanEntity > loadscanEntityList = loadingOrderMap . get ( orderId ) ;
if ( Func . isNotEmpty ( loadingOrderMap . get ( distributionStockArticleEntity . getId ( ) ) ) ) {
List < DistributionLoadscanEntity > loadscanEntityList = loadingOrderMap . get ( distributionStockArticleEntity . getId ( ) ) ;
List < Long > loadingPackageIds = loadscanEntityList . stream ( ) . map ( DistributionLoadscanEntity : : getPackageId ) . collect ( Collectors . toList ( ) ) ;
packageIds . addAll ( loadingPackageIds ) ;
collect = loadscanEntityList . stream ( ) . collect ( Collectors . toMap ( DistributionLoadscanEntity : : getPackageId , Function . identity ( ) , ( k1 , k2 ) - > k2 ) ) ;
@ -3900,11 +3883,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List < DistributionAppParcelListVO > packageVOS = new ArrayList < > ( ) ;
if ( Func . isNotEmpty ( packageIds ) ) {
packageIds = packageIds . stream ( ) . distinct ( ) . collect ( Collectors . toList ( ) ) ;
for ( Long packageId : packageIds ) {
DistributionParcelListEntity parcelListEntity = distributionParcelListService . getById ( packageId ) ;
List < DistributionParcelListEntity > parcelListEntitys = distributionParcelListService . listByIds ( packageIds ) ;
for ( DistributionParcelListEntity parcelListEntity : parcelListEntitys ) {
// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
DistributionAppParcelListVO distributionAppParcelListVO = DistributionParcelListAppWrapper . build ( ) . entityVO ( parcelListEntity ) ;
if ( Func . isNotEmpty ( collect ) ) {
DistributionLoadscanEntity distributionLoadscanEntity = collect . get ( packageId ) ;
DistributionLoadscanEntity distributionLoadscanEntity = collect . get ( parcelListEntity . getId ( ) ) ;
if ( Func . isNotEmpty ( distributionLoadscanEntity ) ) {
distributionAppParcelListVO . setMaterialName ( parcelListEntity . getMaterialName ( ) ) ;
if ( distributionLoadscanEntity . getIsAbnormalLoading ( ) . equals ( 2 ) ) {
@ -3931,16 +3916,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List < DistributionReservationZeroPackageEntity > reservationZeroPackageEntityList = distributionReservationZeroPackageService . list ( Wrappers . < DistributionReservationZeroPackageEntity > query ( ) . lambda ( )
. eq ( DistributionReservationZeroPackageEntity : : getReservationId , distributionDeliveryList . getReservationId ( ) )
. eq ( DistributionReservationZeroPackageEntity : : getStockArticleId , orderId )
. eq ( DistributionReservationZeroPackageEntity : : getStockArticleId , distributionStockArticleEntity . getId ( ) )
. ne ( DistributionReservationZeroPackageEntity : : getZeroPackageStatus , ReservationPackageStatusConstant . quxiao . getValue ( ) ) ) ;
if ( Func . isNotEmpty ( reservationZeroPackageEntityList ) ) {
int reservationTotal = reservationZeroPackageEntityList . stream ( ) . mapToInt ( DistributionReservationZeroPackageEntity : : getQuantity ) . sum ( ) ;
distributionAppStockArticleVO . setReservationNum ( reservationTotal ) ;
List < DistributionParcelNumberVO > parcelNumberVOS = distributionReservationMapper . selectReservationZeroOrderDetail ( orderId , Long . parseLong ( distributionDeliveryList . getReservationId ( ) ) ) ;
List < DistributionParcelNumberVO > parcelNumberVOS = distributionReservationMapper . selectReservationZeroOrderDetail ( distributionStockArticleEntity . getId ( ) , Long . parseLong ( distributionDeliveryList . getReservationId ( ) ) ) ;
distributionAppStockArticleVO . setSignforNub ( 0 ) ;
if ( Func . isNotEmpty ( parcelNumberVOS ) ) {
parcelNumberVOS . forEach ( p - > {
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService . getOne ( Wrappers . < DistributionLoadscanEntity > query ( ) . lambda ( ) . eq ( DistributionLoadscanEntity : : getReservationId , distributionDeliveryList . getReservationId ( ) ) . eq ( DistributionLoadscanEntity : : getOrderId , orderId ) . eq ( DistributionLoadscanEntity : : getPackageId , p . getParcelListId ( ) ) . ne ( DistributionLoadscanEntity : : getScanStatus , LoadingStatusConstant . quxiao . getValue ( ) ) ) ;
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService . getOne ( Wrappers . < DistributionLoadscanEntity > query ( ) . lambda ( ) . eq ( DistributionLoadscanEntity : : getReservationId , distributionDeliveryList . getReservationId ( ) ) . eq ( DistributionLoadscanEntity : : getOrderId , distributionStockArticleEntity . getId ( ) ) . eq ( DistributionLoadscanEntity : : getPackageId , p . getParcelListId ( ) ) . ne ( DistributionLoadscanEntity : : getScanStatus , LoadingStatusConstant . quxiao . getValue ( ) ) ) ;
p . setLoadingNum ( 0 ) ;
p . setSigningNum ( 0 ) ;
if ( Func . isNotEmpty ( loadscanEntity ) ) {
@ -3965,6 +3950,16 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
/ * *
* 寻找预约单中订单
* @param reservationOrders
* @param id
* @return
* /
private DistributionReservationStockarticleEntity findReservationOrders ( List < DistributionReservationStockarticleEntity > reservationOrders , Long id ) {
return reservationOrders . stream ( ) . filter ( f - > f . getStockArticleId ( ) . equals ( id ) ) . findFirst ( ) . orElse ( null ) ;
}
// Map<Long, List<DistributionLoadscanEntity>> orderMap = distributionLoadscanEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId));
// List<DistributionAppStockArticleVO> distributionAppStockArticleVOS = new ArrayList<>();