package com.hdkj.lt.bf.entity.convert;

import com.hdkj.fhzg.optimization.response.StationSvgResponse;
import com.hdkj.lt.bf.entity.FhzgProblemFeedback;
import com.hdkj.lt.bf.entity.FhzgProblemFeedbackAttachment;
import com.hdkj.lt.bf.entity.dto.AttachmentDTO;
import com.hdkj.lt.bf.entity.vo.*;
import com.hdkj.lt.core.bizms.modle.po.DwdShbDsSwitchBase;
import com.hdkj.lt.core.bizms.modle.po.FhzgSwitchProtectionSettings;
import com.hdkj.lt.core.bizms.modle.po.FhzgTransferSchemeSwitchProtectionRecommend;
import com.hdkj.lt.core.bizms.modle.po.XlRel;
import com.hdkj.lt.core.bizms.modle.po.fault.FhzgDistLineSwitchSection;
import com.hdkj.lt.core.bizms.modle.po.plan.FhzgPlanTransferSchemePowerTransferInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author rj
 * @date 2025/6/27 9:57
 * @description
 */
@Component
@Mapper
public interface EntityToVOConvertor {

    EntityToVOConvertor INSTANCE = Mappers.getMapper(EntityToVOConvertor.class);

    @Mapping(source = "stationName", target = "stationName")
    @Mapping(source = "maintOrgName", target = "maintOrgName")
    @Mapping(source = "feederName", target = "feederName")
    @Mapping(source = "name", target = "switchName")
    @Mapping(source = "psrId", target = "switchId")
    @Mapping(source = "switchRoleName", target = "switchRoleName")
    SwitchInfoVO toSwitchInfoVO(DwdShbDsSwitchBase dwdShbDsSwitchBase);

    List<SwitchInfoVO> toSwitchInfoVOList(List<DwdShbDsSwitchBase> list);

    @Mapping(source = "j.oc1Value", target = "oc1Value")
    @Mapping(source = "j.oc1Delay", target = "oc1Delay")
    @Mapping(source = "j.oc1Setting", target = "oc1Setting")
    @Mapping(source = "j.oc2Value", target = "oc2Value")
    @Mapping(source = "j.oc2Delay", target = "oc2Delay")
    @Mapping(source = "j.oc2Setting", target = "oc2Setting")
    @Mapping(source = "j.oc3Value", target = "oc3Value")
    @Mapping(source = "j.oc3Delay", target = "oc3Delay")
    @Mapping(source = "j.oc3Setting", target = "oc3Setting")
    @Mapping(source = "j.protEnableStatus", target = "protEnableStatus")
    @Mapping(source = "j.recloseEnableStatus", target = "recloseEnableStatus")
    @Mapping(source = "j.hazardType", target = "hazardType")
    @Mapping(source = "j.hazardDesc", target = "hazardDesc")
    SwitchInfoVO FhzgSwitchProtectionSettingstoSwitchInfoVOList(SwitchInfoVO i, FhzgSwitchProtectionSettings j);

    FhzgDistLineSwitchSectionVO toDistLineSwitchSectionVO(FhzgDistLineSwitchSection fhzgDistLineSwitchSection);

    List<FhzgDistLineSwitchSectionVO> toDistLineSwitchSectionVOList(List<FhzgDistLineSwitchSection> list);

    SwitchProtectionRecommendVO toSwitchProtectionRecommendVO(FhzgTransferSchemeSwitchProtectionRecommend recommend);

    List<SwitchProtectionRecommendVO> toSwitchProtectionRecommendVOList(List<FhzgTransferSchemeSwitchProtectionRecommend> list);

    List<FhzgPowerTransferInfoVO> toFhzgPowerTransferInfoVOList(List<FhzgPlanTransferSchemePowerTransferInfo> list);

    ProblemFeedbackVO toProblemFeedbackVO(FhzgProblemFeedback fhzgProblemFeedback);

    List<AttachmentDTO> toFhzgProblemFeedbackAttachmentList(List<FhzgProblemFeedbackAttachment> list);

    @Mapping(source = "fileSize",target = "size")
    AttachmentDTO toAttachmentDTO(FhzgProblemFeedbackAttachment fhzgProblemFeedbackAttachment);

    XlRelVO toXlRelVO(XlRel xlRel);

    List<XlRelVO> toXlRelVOList(List<XlRel> list);

    StationSvgResponse toStationSvgResponse(XlRel xlRel);

    List<StationSvgResponse> toStationSvgResponseList(List<XlRel> list);
}
