|
|
|
@ -20,8 +20,12 @@ import com.logpm.distribution.service.IDistributionParcelListService;
|
|
|
|
|
import com.logpm.distribution.service.IDistributionStockArticleService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockListService; |
|
|
|
|
import com.logpm.distribution.service.IQualityDeliverService; |
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWayBillDetail; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillClient; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
@ -71,6 +75,12 @@ public class QualityDeliverListener {
|
|
|
|
|
@Resource |
|
|
|
|
private IBasicdataFactoryCategoryClient factoryCategoryClient; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private ITrunklineAdvanceDetailClient advanceDetailClient; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private IWarehouseWaybillDetailClient waybillDetailClient; |
|
|
|
|
|
|
|
|
|
@RabbitListener(bindings = @QueueBinding( |
|
|
|
|
value = @Queue(name = ReportConstants.REPORT_QUALITY_DELIVER_QUEUE, durable = "true"), |
|
|
|
|
exchange = @Exchange(name = ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE, type = ExchangeTypes.TOPIC), |
|
|
|
@ -205,6 +215,13 @@ public class QualityDeliverListener {
|
|
|
|
|
} |
|
|
|
|
if (ObjectUtil.equals(PackageTypeEnums.LTL.getCode(), conditions)) { |
|
|
|
|
// 零担
|
|
|
|
|
WarehouseWayBillDetail wayBillDetail = waybillDetailClient.findENtityByCodeAndName(qualityDeliverEntity.getOrderCode(), qualityDeliverEntity.getCategory()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(wayBillDetail)) { |
|
|
|
|
qualityDeliverEntity.setCostCategoryId(wayBillDetail.getProductId()); |
|
|
|
|
qualityDeliverEntity.setRevenueCategoryId(wayBillDetail.getProductId()); |
|
|
|
|
qualityDeliverEntity.setCostCategory(wayBillDetail.getProductName()); |
|
|
|
|
qualityDeliverEntity.setRevenueCategory(wayBillDetail.getProductName()); |
|
|
|
|
} |
|
|
|
|
DistributionParcelListEntity parcelListEntity = parcelListService.findByOrderCodeAndCategory(qualityDeliverEntity.getOrderCode(), qualityDeliverEntity.getCategory(), qualityDeliverEntity.getWarehouseId()); |
|
|
|
|
buildCmpBasicInfo(qualityDeliverEntity, parcelListEntity); |
|
|
|
|
// buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode());
|
|
|
|
@ -238,11 +255,17 @@ public class QualityDeliverListener {
|
|
|
|
|
BasicdataFactoryCategoryEntity factoryCategoryEntity = new BasicdataFactoryCategoryEntity(); |
|
|
|
|
factoryCategoryEntity.setMaterielName(materielName); |
|
|
|
|
factoryCategoryEntity.setBrand(brandName); |
|
|
|
|
BasicdataFactoryCategoryEntity categoryEntity = factoryCategoryClient.findEntityByMaterielName(factoryCategoryEntity); |
|
|
|
|
factoryCategoryEntity.setType(2); |
|
|
|
|
BasicdataFactoryCategoryEntity categoryEntity = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity); |
|
|
|
|
factoryCategoryEntity.setType(1); |
|
|
|
|
BasicdataFactoryCategoryEntity categoryEntity1 = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity); |
|
|
|
|
if (ObjectUtil.isNotEmpty(categoryEntity)) { |
|
|
|
|
// TODO 存id
|
|
|
|
|
qualityDeliverEntity.setCostCategoryId(categoryEntity.getCategoryId()); |
|
|
|
|
qualityDeliverEntity.setCostCategory(categoryEntity.getCategory()); |
|
|
|
|
} |
|
|
|
|
if (ObjectUtil.isNotEmpty(categoryEntity1)) { |
|
|
|
|
qualityDeliverEntity.setRevenueCategory(categoryEntity.getCategory()); |
|
|
|
|
qualityDeliverEntity.setRevenueCategoryId(categoryEntity1.getCategoryId()); |
|
|
|
|
} |
|
|
|
|
// TODO 从入库单上查询入库时间
|
|
|
|
|
} |
|
|
|
@ -287,6 +310,14 @@ public class QualityDeliverListener {
|
|
|
|
|
// 构建运单相关信息
|
|
|
|
|
buildWaybillInfo(qualityDeliverEntity, waybillNumber); |
|
|
|
|
} |
|
|
|
|
// 暂存单查询结算品类
|
|
|
|
|
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(advanceDetailEntity)) { |
|
|
|
|
qualityDeliverEntity.setCostCategoryId(advanceDetailEntity.getCostCategoryId()); |
|
|
|
|
qualityDeliverEntity.setCostCategory(advanceDetailEntity.getCostCategoryName()); |
|
|
|
|
qualityDeliverEntity.setRevenueCategoryId(advanceDetailEntity.getIncomeCategoryId()); |
|
|
|
|
qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName()); |
|
|
|
|
} |
|
|
|
|
// 构建订单相关信息
|
|
|
|
|
buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode()); |
|
|
|
|
} |
|
|
|
|