# MonthlyRevenueInternalService.java

    package cloud.wconnect.workperformance.service;

    import cloud.wconnect.commonlib.component.restclient.RestClient;
    import cloud.wconnect.commonlib.util.SignUtils;
    import cloud.wconnect.workperformance.pojo.dto.internal.MonthlyRevenueInternalDTO;
    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.core.ParameterizedTypeReference;
    import org.springframework.stereotype.Service;

    import jakarta.annotation.Resource;

    import java.util.Collections;
    import java.util.List;
    import java.util.Map;

    /**
     * 内部服务类：Monthly Revenue
     *
     * @author zc
     * @date 2024/10/17
     */
    @Service
    public class MonthlyRevenueInternalService {
        @Resource
        private RestClient restClient;

        @Value("${internal.service.base-url.rate-shop}")
        private String rateShopBaseUrl;
        @Value("${internal.service.auth-key.rate-shop}")
        private String rateShopAuthKey;

        /**
         * 获取指定日期范围的 Monthly Revenue 数据
         *
         * @param propertyId  资产 id
         * @param versionDate 版本日期(yyyyMMdd)
         * @param startDate   开始日期(yyyyMMdd)
         * @param endDate     结束日期(yyyyMMdd)
         * @return MonthlyRevenueInternalDTO 集合
         * @author zc
         * @date 2025/5/23
         */
        public List<MonthlyRevenueInternalDTO> listMonthlyRevenue(int propertyId, long versionDate, long startDate, long endDate) {
            // 将请求参数进行签名
            String sign = SignUtils.signWithKey(rateShopAuthKey, propertyId, versionDate, startDate, endDate);
            Map<String, String> headers = Collections.singletonMap("sign", sign);
            return restClient.getForList(rateShopBaseUrl + "/internal/weekly-monthly-revenue?propertyId={propertyId}" +
                            "&versionDate={versionDate}&startDate={startDate}&endDate={endDate}",
                    headers, new ParameterizedTypeReference<>() {}, propertyId, versionDate, startDate, endDate);
        }
    }