@ -3792,6 +3792,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//audio = (realLoadingNumber+1)+"件";
}
Long finalNodeId = carsOrderEntity . getFinalNodeId ( ) ;
Long signOrderId = carsOrderEntity . getSignOrderId ( ) ;
carsLoadScanEntity . setSignOrderId ( signOrderId ) ;
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient . getEntityWarehouseId ( finalNodeId ) ;
String finalNodeName = null ;
if ( ! Objects . isNull ( finalNode ) ) {
@ -4659,8 +4661,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String num = numArray [ i ] ;
String volume = volumeArray [ i ] ;
String weight = weightArray [ i ] ;
volumeMap . put ( nameArray [ i ] , new BigDecimal ( volume ) . divide ( new BigDecimal ( num ) , 2 , RoundingMode . HALF_UP ) . toString ( ) ) ;
weightMap . put ( nameArray [ i ] , new BigDecimal ( weight ) . divide ( new BigDecimal ( num ) , 2 , RoundingMode . HALF_UP ) . toString ( ) ) ;
volumeMap . put ( nameArray [ i ] , new BigDecimal ( volume ) . divide ( new BigDecimal ( num ) , 8 , RoundingMode . HALF_UP ) . toPlain String ( ) ) ;
weightMap . put ( nameArray [ i ] , new BigDecimal ( weight ) . divide ( new BigDecimal ( num ) , 8 , RoundingMode . HALF_UP ) . toPlain String ( ) ) ;
chargeTypeMap . put ( nameArray [ i ] , chargeTypeArray [ i ] ) ;
}
@ -4701,7 +4703,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List < TrunklineCarsLoadScanVO > trunklineCarsLoadScanListByOrderCode = trunklineCarsLoadScanMapByOrderCode . get ( orderCode ) ; //订单实际装车
//把trunklineCarsLoadScanListByOrderCode中所有元素num求和,num为空用0代替
Integer loadingNum = trunklineCarsLoadScanListByOrderCode . stream ( ) . map ( TrunklineCarsLoadScanVO : : getNum ) . reduce ( 0 , Integer : : sum ) ;
Integer loadingNum = trunklineCarsLoadScanListByOrderCode . stream ( ) . filter ( t - > ! Objects . isNull ( t . getWarehouseId ( ) ) ) . map ( TrunklineCarsLoadScanVO : : getNum ) . reduce ( 0 , Integer : : sum ) ;
Integer unloadNum = trunklineCarsLoadScanListByOrderCode . stream ( ) . map ( TrunklineCarsLoadScanVO : : getUnloadNum ) . reduce ( 0 , Integer : : sum ) ;
Integer signNum = trunklineCarsLoadScanListByOrderCode . stream ( ) . filter ( t - > t . getScanStatus ( ) . equals ( "3" ) ) . map ( TrunklineCarsLoadScanVO : : getUnloadNum ) . reduce ( 0 , Integer : : sum ) ;
@ -4874,14 +4876,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
goodsByNum . keySet ( ) . forEach ( g - > {
orderGoodsNameList . add ( g ) ;
orderGoodsNumList . add ( goodsByNum . get ( g ) + "" ) ;
orderGoodsVolumeList . add ( goodsByVolume . get ( g ) . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) . toString ( ) ) ;
orderGoodsWeightList . add ( goodsByWeight . get ( g ) . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) . toString ( ) ) ;
orderGoodsVolumeList . add ( goodsByVolume . get ( g ) . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) . toPlain String ( ) ) ;
orderGoodsWeightList . add ( goodsByWeight . get ( g ) . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) . toPlain String ( ) ) ;
} ) ;
carsLoadOrderInfoVO . setUnloadIncome ( totalIncomingParice . get ( ) ) ;
carsLoadOrderInfoVO . setWeight ( totalWeight . get ( ) ) ;
carsLoadOrderInfoVO . setVolume ( totalVolume . get ( ) ) ;
carsLoadOrderInfoVO . setUnloadIncome ( totalIncomingParice . get ( ) . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) ) ;
carsLoadOrderInfoVO . setWeight ( totalWeight . get ( ) . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) ) ;
carsLoadOrderInfoVO . setVolume ( totalVolume . get ( ) . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) ) ;
carsLoadOrderInfoVO . setOrderGoodsNum ( String . join ( "," , orderGoodsNumList ) ) ;
carsLoadOrderInfoVO . setOrderGoodsName ( String . join ( "," , orderGoodsNameList ) ) ;
carsLoadOrderInfoVO . setOrderGoodsVolume ( String . join ( "," , orderGoodsVolumeList ) ) ;
@ -9560,6 +9562,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String orderCode = parcelListEntity . getOrderCode ( ) ;
TrunklineCarsOrderEntity carsOrderEntity = carsOrderMap . get ( orderCode + "&&" + waybillNo ) ;
Long finalNodeId = carsOrderEntity . getFinalNodeId ( ) ;
Long signOrderId = carsOrderEntity . getSignOrderId ( ) ;
DistributionStockArticleEntity stockArticle = stockArticleMap . get ( orderCode ) ;
TrunklineCarsLoadScanEntity carsLoadScanEntity = new TrunklineCarsLoadScanEntity ( ) ;
@ -9584,6 +9587,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity . setOrderCode ( orderCode ) ;
carsLoadScanEntity . setFromWarehouseId ( warehouseId ) ;
carsLoadScanEntity . setLoadingAbnormal ( 0 ) ;
carsLoadScanEntity . setSignOrderId ( signOrderId ) ;
String finalName = warehouseMap . get ( finalNodeId ) ;
carsLoadScanEntity . setFinalNodeId ( finalNodeId ) ;
carsLoadScanEntity . setFinalNodeName ( finalName ) ;
@ -10444,6 +10448,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long currentOrderId = null ;
//查询当前仓库订单信息有没有
Integer totalNumber = trunklineAdvanceDetailService . findTotalNumByOrderCode ( orderCode ) ;
DistributionStockArticleEntity currentStockArticleEntity = distributionStockArticleClient . findStockArticleByOrderCodeAndWarehouseId ( orderCode , warehouseId ) ;
if ( Objects . isNull ( currentStockArticleEntity ) ) {
@ -10456,6 +10461,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity . setWarehouseId ( warehouseId ) ;
currentStockArticleEntity . setWarehouse ( warehouseName ) ;
currentStockArticleEntity . setGenre ( 1 ) ;
currentStockArticleEntity . setTotalNumber ( totalNumber ) ;
currentStockArticleEntity . setHandQuantity ( 0 ) ;
currentStockArticleEntity . setCompleteSet ( 1 ) ;
currentStockArticleEntity . setStockupStatus ( "10" ) ;
@ -10484,6 +10490,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity . setOrderStatus ( "70" ) ;
}
currentStockArticleEntity . setGenre ( 1 ) ;
currentStockArticleEntity . setTotalNumber ( totalNumber ) ;
distributionStockArticleClient . updateEntity ( currentStockArticleEntity ) ;
}
@ -10653,6 +10660,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long currentOrderId = null ;
//查询当前仓库订单信息有没有
Integer totalNumber = trunklineAdvanceDetailService . findTotalNumByOrderCode ( orderCode ) ;
DistributionStockArticleEntity currentStockArticleEntity = distributionStockArticleClient . findStockArticleByOrderCodeAndWarehouseId ( orderCode , warehouseId ) ;
if ( Objects . isNull ( currentStockArticleEntity ) ) {
//查询包件前面仓的订单信息
@ -10661,6 +10669,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity . setId ( null ) ;
currentStockArticleEntity . setWarehouseId ( warehouseId ) ;
currentStockArticleEntity . setWarehouse ( warehouseName ) ;
currentStockArticleEntity . setTotalNumber ( totalNumber ) ;
currentStockArticleEntity . setHandQuantity ( 0 ) ;
currentStockArticleEntity . setCompleteSet ( 1 ) ;
currentStockArticleEntity . setStockupStatus ( "10" ) ;
@ -10690,6 +10699,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
currentStockArticleEntity . setOrderStatus ( "70" ) ;
}
currentStockArticleEntity . setGenre ( 1 ) ;
currentStockArticleEntity . setTotalNumber ( totalNumber ) ;
distributionStockArticleClient . updateEntity ( currentStockArticleEntity ) ;
}
@ -10816,6 +10826,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} else {
Long currentOrderId = null ;
//查询当前仓库订单信息有没有
Integer totalNum = trunklineAdvanceDetailService . findTotalNumByOrderCode ( orderCode ) ;
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient . findStockArticleByOrderCodeAndWarehouseId ( orderCode , warehouseId ) ;
if ( Objects . isNull ( stockArticleEntity ) ) {
//查询包件前面仓的订单信息
@ -10825,6 +10836,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
stockArticleEntity . setId ( null ) ;
stockArticleEntity . setWarehouseId ( warehouseId ) ;
stockArticleEntity . setWarehouse ( warehouseName ) ;
stockArticleEntity . setTotalNumber ( totalNum ) ;
stockArticleEntity . setHandQuantity ( 0 ) ;
stockArticleEntity . setCompleteSet ( 1 ) ;
stockArticleEntity . setStockupStatus ( "10" ) ;
@ -10844,7 +10856,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
stockArticleEntity . setId ( currentOrderId ) ;
} else {
currentOrderId = stockArticleEntity . getId ( ) ;
String reservationStatus = stockArticleEntity . getReservationStatus ( ) ;
if ( "30" . equals ( reservationStatus ) ) {
stockArticleEntity . setReservationStatus ( "20" ) ;
}
String orderStatus = stockArticleEntity . getOrderStatus ( ) ;
if ( "80" . equals ( orderStatus ) ) {
stockArticleEntity . setOrderStatus ( "70" ) ;
}
stockArticleEntity . setGenre ( 1 ) ;
stockArticleEntity . setTotalNumber ( totalNum ) ;
distributionStockArticleClient . updateEntity ( stockArticleEntity ) ;
}