# OooRoomInternalService.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.OooRoomCountInternalDTO;
    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;

    /**
     * 内部服务类：OOO Room
     *
     * @author zc
     * @date 2024/10/20
     */
    @Service
    public class OooRoomInternalService {
        @Resource
        private RestClient restClient;

        @Value("${internal.service.base-url.front-office}")
        private String frontOfficeBaseUrl;
        @Value("${internal.service.auth-key.front-office}")
        private String frontOfficeAuthKey;

        /**
         * 获取指定日期范围未完成的 OOO Room Count 数据
         *
         * @param propertyId 资产 id
         * @param startDate  开始日期(yyyyMMdd)
         * @param endDate    结束日期(yyyyMMdd)
         * @return MonthlyReportSegmentInternalDTO 集合
         * @author zc
         * @date 2024/10/17
         */
        public List<OooRoomCountInternalDTO> listCount(int propertyId, long startDate, long endDate) {
            // 将请求参数进行签名
            String sign = SignUtils.signWithKey(frontOfficeAuthKey, propertyId, startDate, endDate);
            Map<String, String> headers = Collections.singletonMap("sign", sign);
            return restClient.getForList(frontOfficeBaseUrl + "/internal/ooo-room/count?propertyId={propertyId}&startDate={startDate}&endDate={endDate}",
                    headers, new ParameterizedTypeReference<List<OooRoomCountInternalDTO>>() {
                    },
                    propertyId, startDate, endDate);
        }
    }