package com.hdkj.lt.bf.service.impl;

import com.hdkj.lt.base.exception.BusinessException;
import com.hdkj.lt.bf.entity.dto.FhzgPlanTransferSchemeOppositeLineLoadFactorDTO;
import com.hdkj.lt.bf.mapper.FhzgPlanTransferSchemeOppositeLineLoadFactorMapper;
import com.hdkj.lt.bf.service.FhzgPlanTransferSchemeOppositeLineLoadFactorService;
import com.hdkj.lt.core.bizms.modle.po.plan.FhzgPlanTransferSchemeOppositeLineLoadFactor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;

/**
 * @author luorui
 * @date 2025/5/17 9:14
 */
@Service
@Slf4j
public class FhzgPlanTransferSchemeOppositeLineLoadFactorServiceImpl implements FhzgPlanTransferSchemeOppositeLineLoadFactorService {


    @Autowired
    FhzgPlanTransferSchemeOppositeLineLoadFactorMapper fhzgPlanTransferSchemeOppositeLineLoadFactorMapper;

    /**
     *
     * @author luorui
     * @date 2025/5/17 9:15
     * @discription 对侧负载率分页查询
     *
     **/
    @Override
    public List<FhzgPlanTransferSchemeOppositeLineLoadFactorDTO> getTransferSchemeOppositeLineLoadFactorByIdPage(FhzgPlanTransferSchemeOppositeLineLoadFactor fhzgPlanTransferSchemeOppositeLineLoadFactor) {
        if (Objects.isNull(fhzgPlanTransferSchemeOppositeLineLoadFactor.getId())) {
            throw new BusinessException("组合方案id为空");
        }
        //0823 要求去掉分页
//        if (Objects.isNull(fhzgPlanTransferSchemeOppositeLineLoadFactor.getPageNum())) {
//            throw new BusinessException("分页页码为空");
//        }
//        if (Objects.isNull(fhzgPlanTransferSchemeOppositeLineLoadFactor.getPageSize())) {
//            throw new BusinessException("分页长度为空");
//        }
//        Page<FhzgPlanTransferSchemeOppositeLineLoadFactor> page = new Page(fhzgPlanTransferSchemeOppositeLineLoadFactor.getPageNum(), fhzgPlanTransferSchemeOppositeLineLoadFactor.getPageSize());
        return fhzgPlanTransferSchemeOppositeLineLoadFactorMapper.getTransferSchemeOppositeLineLoadFactorByIdPage(fhzgPlanTransferSchemeOppositeLineLoadFactor.getId());

    }

    /**
     *
     * @author luorui
     * @date 2025/5/17 9:15
     * @discription 查询对侧负载率列表
     *
     **/
    @Override
    public List<FhzgPlanTransferSchemeOppositeLineLoadFactorDTO> getTransferSchemeOppositeLineLoadFactorBySchemeId(FhzgPlanTransferSchemeOppositeLineLoadFactor fhzgPlanTransferSchemeOppositeLineLoadFactor) {
        if (Objects.isNull(fhzgPlanTransferSchemeOppositeLineLoadFactor.getSchemeId())) {
            throw new BusinessException("组合方案id为空");
        }
        List<FhzgPlanTransferSchemeOppositeLineLoadFactorDTO> fhzgPlanTransferSchemeOppositeLineLoadFactorDTOList = fhzgPlanTransferSchemeOppositeLineLoadFactorMapper.getTransferSchemeOppositeLineLoadFactorBySchemeId(fhzgPlanTransferSchemeOppositeLineLoadFactor.getSchemeId());
        return fhzgPlanTransferSchemeOppositeLineLoadFactorDTOList;

    }
}
