@ -7,14 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page ;
import com.logpm.basic.entity.BasicMaterialEntity ;
import com.logpm.basic.feign.IBasicMaterialClient ;
import com.logpm.basicdata.entity.BasicdataClientEntity ;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity ;
import com.logpm.basicdata.entity.BasicdataTrayEntity ;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity ;
import com.logpm.basicdata.feign.IBasicdataClientClient ;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient ;
import com.logpm.basicdata.feign.IBasicdataTrayClient ;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient ;
import com.logpm.basicdata.entity.* ;
import com.logpm.basicdata.feign.* ;
import com.logpm.distribution.entity.DistributionParcelListEntity ;
import com.logpm.distribution.entity.DistributionStockArticleEntity ;
import com.logpm.distribution.entity.DistributionStockListEntity ;
@ -123,6 +117,11 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
private ITrunklineAdvanceClient trunklineAdvanceClient ;
@Autowired
private BladeRedis redis ;
@Autowired
private IBasicdataTripartiteMallClient basicdataTripartiteMallClient ;
@Autowired
private IBasicdataStorageServicesClient basicdataStorageServicesClient ;
@Override
public IPage < WarehouseTrayTypeVO > orderPageList ( TrayTypeDTO trayTypeDTO , Long warehouseId ) {
@ -529,8 +528,26 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
trayTypeEntity . setFilterId ( stockArticleEntity . getId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getOrderCode ( ) ) ;
} else if ( "30" . equals ( trayType ) ) { //商场
trayTypeEntity . setFilterId ( stockArticleEntity . getMallId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getMallName ( ) ) ;
Long mallId = stockArticleEntity . getMallId ( ) ;
if ( ! Objects . isNull ( mallId ) ) {
trayTypeEntity . setFilterId ( stockArticleEntity . getMallId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getMallName ( ) ) ;
} else {
String dealerName = stockArticleEntity . getDealerName ( ) ;
String brand = stockArticleEntity . getBrand ( ) ;
Long clientId = basicdataTripartiteMallClient . getClientIdByNameAndBrand ( dealerName , brand ) ;
if ( ! Objects . isNull ( clientId ) ) {
BasicdataClientEntity basicdataClientEntity = basicdataClientClient . findEntityById ( clientId ) ;
if ( Objects . isNull ( basicdataClientEntity ) ) {
log . error ( "#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}" , clientId ) ;
throw new CustomerException ( 405 , "未找到三方商场对应的汇通商场" ) ;
}
trayTypeEntity . setFilterId ( basicdataClientEntity . getId ( ) ) ;
trayTypeEntity . setFilterValue ( basicdataClientEntity . getClientName ( ) ) ;
} else {
trayTypeEntity . setFilterValue ( dealerName ) ;
}
}
} else if ( "40" . equals ( trayType ) ) { //门店
trayTypeEntity . setFilterId ( stockArticleEntity . getStoreId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getStoreName ( ) ) ;
@ -568,7 +585,24 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
} else if ( "30" . equals ( tt ) ) { //商场
Long mallId = stockArticleEntity . getMallId ( ) ;
String mallName = stockArticleEntity . getMallName ( ) ;
String mallName = null ;
if ( ! Objects . isNull ( mallId ) ) {
mallName = stockArticleEntity . getMallName ( ) ;
} else {
String dealerName = stockArticleEntity . getDealerName ( ) ;
String brand = stockArticleEntity . getBrand ( ) ;
Long clientId = basicdataTripartiteMallClient . getClientIdByNameAndBrand ( dealerName , brand ) ;
if ( ! Objects . isNull ( clientId ) ) {
BasicdataClientEntity basicdataClientEntity = basicdataClientClient . findEntityById ( clientId ) ;
if ( Objects . isNull ( basicdataClientEntity ) ) {
log . error ( "#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}" , clientId ) ;
throw new CustomerException ( 405 , "未找到三方商场对应的汇通商场" ) ;
}
mallName = basicdataClientEntity . getClientName ( ) ;
} else {
mallName = dealerName ;
}
}
if ( ! filterValue . equals ( mallName ) ) {
chuanFlag = true ;
msg = "商场" + filterValue ;
@ -588,7 +622,31 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
msg = "客户" + filterValue ;
}
} else if ( "60" . equals ( tt ) ) { //仓库
String warehouse = stockArticleEntity . getWarehouse ( ) ;
String warehouse = null ;
String waybillNumber = parcelListEntity . getWaybillNumber ( ) ;
if ( StringUtil . isBlank ( waybillNumber ) ) {
//如果运单为空则去找有没有对应的dealName是否有对应的维护的商场信息
String brand = stockArticleEntity . getBrand ( ) ;
String dealerName = parcelListEntity . getDealerName ( ) ;
Long clientId = basicdataTripartiteMallClient . getClientIdByNameAndBrand ( dealerName , brand ) ;
if ( ! Objects . isNull ( clientId ) ) {
BasicdataStorageServicesEntity storageServicesEntity = basicdataStorageServicesClient . findEntityBySendWarehouseIdAndClientId ( warehouseId , clientId ) ;
if ( ! Objects . isNull ( storageServicesEntity ) ) {
warehouse = storageServicesEntity . getServeWarehouseName ( ) ;
} else {
warehouse = "" ;
}
} else {
warehouse = "" ;
}
} else {
WarehouseWaybillEntity waybillEntity = warehouseWaybillService . findByWaybillNo ( waybillNumber ) ;
if ( ! Objects . isNull ( waybillEntity ) ) {
warehouse = waybillEntity . getDestinationWarehouseName ( ) ;
} else {
warehouse = "" ;
}
}
if ( ! filterValue . equals ( warehouse ) ) {
chuanFlag = true ;
msg = "仓库" + filterValue ;
@ -726,16 +784,31 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
trayTypeEntity . setFilterId ( stockArticleEntity . getId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getOrderCode ( ) ) ;
} else if ( "30" . equals ( trayType ) ) { //商场
trayTypeEntity . setFilterId ( stockArticleEntity . getMallId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getMallName ( ) ) ;
Long mallId = stockArticleEntity . getMallId ( ) ;
if ( ! Objects . isNull ( mallId ) ) {
trayTypeEntity . setFilterId ( stockArticleEntity . getMallId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getMallName ( ) ) ;
} else {
String dealerName = stockArticleEntity . getDealerName ( ) ;
String brand = stockArticleEntity . getBrand ( ) ;
Long clientId = basicdataTripartiteMallClient . getClientIdByNameAndBrand ( dealerName , brand ) ;
if ( ! Objects . isNull ( clientId ) ) {
BasicdataClientEntity basicdataClientEntity = basicdataClientClient . findEntityById ( clientId ) ;
if ( Objects . isNull ( basicdataClientEntity ) ) {
log . error ( "#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}" , clientId ) ;
throw new CustomerException ( 405 , "未找到三方商场对应的汇通商场" ) ;
}
trayTypeEntity . setFilterId ( basicdataClientEntity . getId ( ) ) ;
trayTypeEntity . setFilterValue ( basicdataClientEntity . getClientName ( ) ) ;
} else {
trayTypeEntity . setFilterValue ( dealerName ) ;
}
}
} else if ( "40" . equals ( trayType ) ) { //门店
trayTypeEntity . setFilterId ( stockArticleEntity . getStoreId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getStoreName ( ) ) ;
} else if ( "50" . equals ( trayType ) ) { //客户
trayTypeEntity . setFilterValue ( stockArticleEntity . getCustomerName ( ) + stockArticleEntity . getCustomerTelephone ( ) ) ;
} else if ( "60" . equals ( trayType ) ) { //仓库
trayTypeEntity . setFilterId ( stockArticleEntity . getWarehouseId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getWarehouse ( ) ) ;
}
updateById ( trayTypeEntity ) ;
}
@ -765,7 +838,24 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
} else if ( "30" . equals ( tt ) ) { //商场
Long mallId = stockArticleEntity . getMallId ( ) ;
String mallName = stockArticleEntity . getMallName ( ) ;
String mallName = null ;
if ( ! Objects . isNull ( mallId ) ) {
mallName = stockArticleEntity . getMallName ( ) ;
} else {
String dealerName = stockArticleEntity . getDealerName ( ) ;
String brand = stockArticleEntity . getBrand ( ) ;
Long clientId = basicdataTripartiteMallClient . getClientIdByNameAndBrand ( dealerName , brand ) ;
if ( ! Objects . isNull ( clientId ) ) {
BasicdataClientEntity basicdataClientEntity = basicdataClientClient . findEntityById ( clientId ) ;
if ( Objects . isNull ( basicdataClientEntity ) ) {
log . error ( "#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}" , clientId ) ;
throw new CustomerException ( 405 , "未找到三方商场对应的汇通商场" ) ;
}
mallName = basicdataClientEntity . getClientName ( ) ;
} else {
mallName = dealerName ;
}
}
if ( ! filterValue . equals ( mallName ) ) {
chuanFlag = true ;
msg = "商场" + filterValue ;
@ -785,7 +875,31 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
msg = "客户" + filterValue ;
}
} else if ( "60" . equals ( tt ) ) { //仓库
String warehouse = stockArticleEntity . getWarehouse ( ) ;
String warehouse = null ;
String waybillNumber = parcelListEntity . getWaybillNumber ( ) ;
if ( StringUtil . isBlank ( waybillNumber ) ) {
//如果运单为空则去找有没有对应的dealName是否有对应的维护的商场信息
String brand = stockArticleEntity . getBrand ( ) ;
String dealerName = parcelListEntity . getDealerName ( ) ;
Long clientId = basicdataTripartiteMallClient . getClientIdByNameAndBrand ( dealerName , brand ) ;
if ( ! Objects . isNull ( clientId ) ) {
BasicdataStorageServicesEntity storageServicesEntity = basicdataStorageServicesClient . findEntityBySendWarehouseIdAndClientId ( warehouseId , clientId ) ;
if ( ! Objects . isNull ( storageServicesEntity ) ) {
warehouse = storageServicesEntity . getServeWarehouseName ( ) ;
} else {
warehouse = "" ;
}
} else {
warehouse = "" ;
}
} else {
WarehouseWaybillEntity waybillEntity = warehouseWaybillService . findByWaybillNo ( waybillNumber ) ;
if ( ! Objects . isNull ( waybillEntity ) ) {
warehouse = waybillEntity . getDestinationWarehouseName ( ) ;
} else {
warehouse = "" ;
}
}
if ( ! filterValue . equals ( warehouse ) ) {
chuanFlag = true ;
msg = "仓库" + filterValue ;
@ -1001,16 +1115,61 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
trayTypeEntity . setFilterId ( stockArticleEntity . getId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getOrderCode ( ) ) ;
} else if ( "30" . equals ( trayType ) ) { //商场
trayTypeEntity . setFilterId ( stockArticleEntity . getMallId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getMallName ( ) ) ;
Long mallId = stockArticleEntity . getMallId ( ) ;
if ( ! Objects . isNull ( mallId ) ) {
trayTypeEntity . setFilterId ( stockArticleEntity . getMallId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getMallName ( ) ) ;
} else {
String dealerName = stockArticleEntity . getDealerName ( ) ;
String brand = stockArticleEntity . getBrand ( ) ;
Long clientId = basicdataTripartiteMallClient . getClientIdByNameAndBrand ( dealerName , brand ) ;
if ( ! Objects . isNull ( clientId ) ) {
BasicdataClientEntity basicdataClientEntity = basicdataClientClient . findEntityById ( clientId ) ;
if ( Objects . isNull ( basicdataClientEntity ) ) {
log . error ( "#############saveTrayTypeByOrderPackageCode: 未找到三方商场对应的汇通商场 clientId={}" , clientId ) ;
throw new CustomerException ( 405 , "未找到三方商场对应的汇通商场" ) ;
}
trayTypeEntity . setFilterId ( basicdataClientEntity . getId ( ) ) ;
trayTypeEntity . setFilterValue ( basicdataClientEntity . getClientName ( ) ) ;
} else {
trayTypeEntity . setFilterValue ( dealerName ) ;
}
}
} else if ( "40" . equals ( trayType ) ) { //门店
trayTypeEntity . setFilterId ( stockArticleEntity . getStoreId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getStoreName ( ) ) ;
} else if ( "50" . equals ( trayType ) ) { //客户
trayTypeEntity . setFilterValue ( stockArticleEntity . getCustomerName ( ) + stockArticleEntity . getCustomerTelephone ( ) ) ;
} else if ( "60" . equals ( trayType ) ) { //仓库
trayTypeEntity . setFilterId ( stockArticleEntity . getWarehouseId ( ) ) ;
trayTypeEntity . setFilterValue ( stockArticleEntity . getWarehouse ( ) ) ;
String waybillNumber = parcelListEntity . getWaybillNumber ( ) ;
if ( StringUtil . isBlank ( waybillNumber ) ) {
//如果运单为空则去找有没有对应的dealName是否有对应的维护的商场信息
String brand = stockArticleEntity . getBrand ( ) ;
String dealerName = parcelListEntity . getDealerName ( ) ;
Long clientId = basicdataTripartiteMallClient . getClientIdByNameAndBrand ( dealerName , brand ) ;
if ( ! Objects . isNull ( clientId ) ) {
BasicdataStorageServicesEntity storageServicesEntity = basicdataStorageServicesClient . findEntityBySendWarehouseIdAndClientId ( warehouseId , clientId ) ;
if ( ! Objects . isNull ( storageServicesEntity ) ) {
trayTypeEntity . setFilterId ( storageServicesEntity . getServeWarehouseId ( ) ) ;
trayTypeEntity . setFilterValue ( storageServicesEntity . getServeWarehouseName ( ) ) ;
} else {
trayTypeEntity . setFilterId ( null ) ;
trayTypeEntity . setFilterValue ( "" ) ;
}
} else {
trayTypeEntity . setFilterId ( null ) ;
trayTypeEntity . setFilterValue ( "" ) ;
}
} else {
WarehouseWaybillEntity waybillEntity = warehouseWaybillService . findByWaybillNo ( waybillNumber ) ;
if ( ! Objects . isNull ( waybillEntity ) ) {
trayTypeEntity . setFilterId ( waybillEntity . getDestinationWarehouseId ( ) ) ;
trayTypeEntity . setFilterValue ( waybillEntity . getDestinationWarehouseName ( ) ) ;
} else {
trayTypeEntity . setFilterId ( null ) ;
trayTypeEntity . setFilterValue ( "" ) ;
}
}
}
save ( trayTypeEntity ) ;