|
|
|
@ -5,7 +5,8 @@ import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataClientEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataClientClient; |
|
|
|
|
import com.logpm.distribution.feign.IDistributionParcelListClient; |
|
|
|
|
import com.logpm.statistics.entity.*; |
|
|
|
|
import com.logpm.statistics.service.*; |
|
|
|
@ -14,7 +15,6 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
|
|
|
|
|
import com.logpm.trunkline.entity.TrunklineAdvanceEntity; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineAdvanceClient; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklineWaybillOrderClient; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWayBillDetail; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillClient; |
|
|
|
@ -30,7 +30,6 @@ import org.springframework.amqp.rabbit.annotation.Queue;
|
|
|
|
|
import org.springframework.amqp.rabbit.annotation.QueueBinding; |
|
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.*; |
|
|
|
@ -52,6 +51,7 @@ public class WaybillCheckListener {
|
|
|
|
|
private final IStatisticsDistributionPackageService distributionPackageService; |
|
|
|
|
private final IStatisticsBalanceOrderInfoService balanceOrderInfoService; |
|
|
|
|
private final IDistributionParcelListClient distributionParcelListClient; |
|
|
|
|
private final IBasicdataClientClient basicdataClientClient; |
|
|
|
|
|
|
|
|
|
@RabbitListener(bindings = @QueueBinding( |
|
|
|
|
value = @Queue(name = FanoutConstants.trunkline.CHECKWAYBILL.QUEUE.CHECKWAYBILL_INCOMINGDATA), |
|
|
|
@ -200,6 +200,10 @@ public class WaybillCheckListener {
|
|
|
|
|
Long consigneeId = waybillEntity.getConsigneeId(); |
|
|
|
|
String consignee = waybillEntity.getConsignee(); |
|
|
|
|
Integer serviceType = waybillEntity.getServiceType(); |
|
|
|
|
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(consigneeId); |
|
|
|
|
if(!Objects.isNull(basicdataClient)){ |
|
|
|
|
serviceType=basicdataClient.getTypeService(); |
|
|
|
|
} |
|
|
|
|
String payWay = waybillEntity.getPayWay(); |
|
|
|
|
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); |
|
|
|
|
String departureWarehouseName = waybillEntity.getDepartureWarehouseName(); |
|
|
|
@ -482,6 +486,10 @@ public class WaybillCheckListener {
|
|
|
|
|
Long consigneeId = waybillEntity.getConsigneeId(); |
|
|
|
|
String consignee = waybillEntity.getConsignee(); |
|
|
|
|
Integer serviceType = waybillEntity.getServiceType(); |
|
|
|
|
BasicdataClientEntity basicdataClient = basicdataClientClient.findEntityById(consigneeId); |
|
|
|
|
if(!Objects.isNull(basicdataClient)){ |
|
|
|
|
serviceType=basicdataClient.getTypeService(); |
|
|
|
|
} |
|
|
|
|
String payWay = waybillEntity.getPayWay(); |
|
|
|
|
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); |
|
|
|
|
String departureWarehouseName = waybillEntity.getDepartureWarehouseName(); |
|
|
|
@ -491,6 +499,8 @@ public class WaybillCheckListener {
|
|
|
|
|
Integer pickupCompleteOrNot = waybillEntity.getPickupCompleteOrNot(); |
|
|
|
|
Date signTime = waybillEntity.getSignTime(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//单价计算
|
|
|
|
|
// BigDecimal pickupFee = Objects.isNull(waybillEntity.getPickupFee())?BigDecimal.ZERO:waybillEntity.getPickupFee();
|
|
|
|
|
BigDecimal warehouseManagementFee = Objects.isNull(waybillEntity.getWarehouseManagementFee()) ? BigDecimal.ZERO : waybillEntity.getWarehouseManagementFee(); |
|
|
|
@ -546,6 +556,7 @@ public class WaybillCheckListener {
|
|
|
|
|
//保存订单信息
|
|
|
|
|
List<StatisticsOrderInfoEntity> orderInfoEntities = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
Integer finalServiceType = serviceType; |
|
|
|
|
advanceEntities.forEach(advanceEntity -> { |
|
|
|
|
StatisticsOrderInfoEntity orderInfoEntity = new StatisticsOrderInfoEntity(); |
|
|
|
|
orderInfoEntity.setOrderCode(advanceEntity.getOrderCode()); |
|
|
|
@ -555,7 +566,7 @@ public class WaybillCheckListener {
|
|
|
|
|
orderInfoEntity.setBrand(brand); |
|
|
|
|
orderInfoEntity.setConsigneeId(consigneeId); |
|
|
|
|
orderInfoEntity.setConsignee(consignee); |
|
|
|
|
orderInfoEntity.setTypeService(serviceType); |
|
|
|
|
orderInfoEntity.setTypeService(finalServiceType); |
|
|
|
|
orderInfoEntity.setSignDate(signTime); |
|
|
|
|
orderInfoEntity.setSignStatus(0); |
|
|
|
|
orderInfoEntity.setSyncFeeStatus(0); |
|
|
|
|