package com.sckw.example.service;

import com.sckw.transport.api.dubbo.TransportRemoteStatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @author lfdc
 * @description 运输服务service
 * @date 2023-09-08 14:09:23
 */
@Slf4j
@Service
@RefreshScope
public class TransportService {


    @Value("${refreshScope.demo}")
    private String refreshScope;

    @DubboReference(version = "1.0.0", group = "design", check = false)
    private TransportRemoteStatisticsService statisticsService;

    public Integer statisticsLogistics(Long topEntId) {
        return statisticsService.statisticsLogistics(topEntId,new ArrayList<>());
    }

    public Integer statisticsWaybillSendCar(Long topEntId) {
        return statisticsService.statisticsWaybillSendCar(topEntId);
    }

    public Integer statisticsPendingVerificationWaybill(Long topEntId) {
        return statisticsService.statisticsPendingVerificationWaybill(topEntId);
    }


    public void refreshScopeDemo() {
        System.out.println("refreshScope:" + refreshScope);
    }
}
