@ -26,7 +26,9 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils ;
import com.baomidou.mybatisplus.core.toolkit.Wrappers ;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page ;
import com.logpm.basicdata.entity.BasicdataClientEntity ;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity ;
import com.logpm.basicdata.feign.IBasicdataClientClient ;
import com.logpm.basicdata.feign.IBasicdataCodeClient ;
import com.logpm.basicdata.feign.IBasicdataGoodsAreaClient ;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient ;
@ -201,6 +203,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private DistributionStockListInfoMapper distributionStockListInfoMapper ;
@Autowired
private IBasicdataClientClient basicdataClientClient ;
@Override
public IPage < DistributionStockupVO > selectDistributionStockupPage ( IPage < DistributionStockupVO > page , DistributionStockupVO distributionStockup ) {
@ -1135,10 +1140,28 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public List < DistributionStockupStockListVO > selectStockupStockList ( StockupDTO stockupDTO ) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient . getMyCurrentWarehouse ( ) ;
if ( Func . isEmpty ( myCurrentWarehouse ) ) {
log . error ( "###########myCurrentWarehouse:{}" , myCurrentWarehouse ) ;
return null ;
}
Long reservationId = stockupDTO . getReservationId ( ) ; //预约单id
DistributionReservationEntity reservationEntity = distributionReservationService . getById ( reservationId ) ;
if ( Func . isEmpty ( reservationEntity ) ) {
log . error ( "###########查询预约失败reservationId:{}" , reservationId ) ;
return null ;
}
String mallName = reservationEntity . getMallName ( ) ;
if ( Func . isBlank ( mallName ) ) {
//预约商场名称为空 查看是否存在商场ID
if ( Func . isNotEmpty ( reservationEntity . getMallId ( ) ) ) {
BasicdataClientEntity basicdataClientEntity = basicdataClientClient . getMallById ( reservationEntity . getMallId ( ) ) ;
mallName = basicdataClientEntity . getClientName ( ) ;
} else {
log . error ( "###########预约单无商场信息:{}" , reservationId ) ;
}
}
if ( stockupDTO . getTypeService ( ) . equals ( "3" ) ) {
//自
@ -1167,30 +1190,29 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} else {
//商,市
List < DistributionStockupStockListVO > list = distributionReservationService . selectStockupStockList ( reservationId , reservationEntity . getWarehouseId ( ) ) ;
for ( int i = 0 ; i < list . size ( ) ; i + + ) {
DistributionStockupStockListVO distributionStockupStockListVO = list . get ( i ) ;
if ( distributionStockupStockListVO . getPlanNum ( ) . equals ( distributionStockupStockListVO . getRealNum ( ) ) ) {
distributionStockupStockListVO . setCompleteStact ( true ) ;
}
if ( Func . isNotEmpty ( distributionStockupStockListVO . getAllocations ( ) ) ) {
String [ ] ids = distributionStockupStockListVO . getAllocations ( ) . split ( "," ) ;
List < WarehouseGoodsAllocationEntity > allocationInforByIds = warehouseGoodsAllocationClient . getAllocationInforByIds ( ids ) ;
for ( WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds ) {
if ( distributionStockupStockListVO . getAllocationList ( ) = = null ) {
distributionStockupStockListVO . setAllocationList ( new ArrayList < > ( ) ) ;
}
Map < String , Object > map = new HashMap < > ( ) ;
map . put ( "id" , allocationInforById . getId ( ) ) ;
map . put ( "name" , allocationInforById . getQrCode ( ) ) ;
distributionStockupStockListVO . getAllocationList ( ) . add ( map ) ;
}
}
}
List < DistributionStockupStockListVO > list = distributionReservationService . selectStockupStockList ( reservationId , myCurrentWarehouse . getId ( ) , mallName ) ;
for ( DistributionStockupStockListVO distributionStockupStockListVO : list ) {
if ( distributionStockupStockListVO . getPlanNum ( ) . equals ( distributionStockupStockListVO . getRealNum ( ) ) ) {
distributionStockupStockListVO . setCompleteStact ( true ) ;
}
if ( Func . isNotEmpty ( distributionStockupStockListVO . getAllocations ( ) ) ) {
String [ ] ids = distributionStockupStockListVO . getAllocations ( ) . split ( "," ) ;
List < WarehouseGoodsAllocationEntity > allocationInforByIds = warehouseGoodsAllocationClient . getAllocationInforByIds ( ids ) ;
for ( WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds ) {
if ( distributionStockupStockListVO . getAllocationList ( ) = = null ) {
distributionStockupStockListVO . setAllocationList ( new ArrayList < > ( ) ) ;
}
Map < String , Object > map = new HashMap < > ( ) ;
map . put ( "id" , allocationInforById . getId ( ) ) ;
map . put ( "name" , allocationInforById . getQrCode ( ) ) ;
distributionStockupStockListVO . getAllocationList ( ) . add ( map ) ;
}
}
}
return list ;
}