package org.dromara.facility.service;

import org.dromara.facility.domain.FacPhotovoltaicPanelColumn;
import org.dromara.facility.domain.FacPhotovoltaicPanelPoint;
import org.dromara.facility.domain.FacPhotovoltaicPanelSupport;
import org.dromara.facility.domain.dto.photovoltaicpanelparts.FacPhotovoltaicPanelPartsCreateByGeoJsonReq;
import org.dromara.facility.domain.dto.photovoltaicpanelparts.FacPhotovoltaicPanelPartsCreateReq;

import java.util.Collection;
import java.util.List;

/**
 * 设施-光伏板（桩点、立柱、支架）Service接口
 *
 * @author lcj
 * @date 2025-04-21
 */
public interface IFacPhotovoltaicPanelPartsService {

    /**
     * 批量新增设施-光伏板（桩点、立柱、支架）
     *
     * @param geoJson GeoJson格式
     * @return 是否新增成功
     */
    Boolean insertPartsByGeoJson(FacPhotovoltaicPanelPartsCreateByGeoJsonReq geoJson);

    /**
     * 批量新增设施-光伏板（桩点、立柱、支架）内部方法
     *
     * @param pointList   桩点列表
     * @param columnList  立柱列表
     * @param supportList 支架列表
     */
    void batchInsertPartsInner(List<FacPhotovoltaicPanelPoint> pointList,
                               List<FacPhotovoltaicPanelColumn> columnList,
                               List<FacPhotovoltaicPanelSupport> supportList);

    /**
     * 批量删除设施-光伏板（桩点、立柱、支架）内部方法
     *
     * @param pointList   桩点列表
     * @param columnList  立柱列表
     * @param supportList 支架列表
     */
    void batchDeletePartsInner(List<FacPhotovoltaicPanelPoint> pointList,
                               List<FacPhotovoltaicPanelColumn> columnList,
                               List<FacPhotovoltaicPanelSupport> supportList);

    /**
     * 批量新增设施-光伏板（桩点、立柱、支架）
     *
     * @param req 设施-光伏板（桩点、立柱、支架）
     * @return 是否新增成功
     */
    Boolean insertPartsByBatch(FacPhotovoltaicPanelPartsCreateReq req);

    /**
     * 根据方阵主键判断是否存在光伏板点
     *
     * @param projectId 项目id
     * @param matrixIds 方阵Id列表
     * @return 是否存在
     */
    Boolean validPartsExistByMatrix(Long projectId, Collection<Long> matrixIds);

    /**
     * 根据光伏板名称判断是否存在光伏板点
     *
     * @param projectId              项目id
     * @param photovoltaicPanelNames 光伏板名称列表
     * @return 是否存在
     */
    Boolean validPartsExistByPhotovoltaicPanel(Long projectId, Collection<String> photovoltaicPanelNames);

}
