package com.qmth.teachcloud.mark.dto.mark;

import java.io.Serializable;

import com.qmth.teachcloud.common.contant.SystemConstant;
import com.qmth.teachcloud.mark.entity.*;
import com.qmth.teachcloud.mark.params.MarkHeaderGroupResult;

public class SpecialTagDTO implements Serializable {

    private static final long serialVersionUID = -5424015292124065736L;

    private String tagName;

    private String tagType;

    private Double positionX;

    private Double positionY;

    private Integer offsetIndex;

    private Integer offsetX;

    private Integer offsetY;

    public SpecialTagDTO() {

    }

    public SpecialTagDTO(MarkSpecialTag markSpecialTag) {
        this.tagType = markSpecialTag.getTagType();
        this.tagName = markSpecialTag.getTagName();
        this.positionX = markSpecialTag.getPositionX();
        this.positionY = markSpecialTag.getPositionY();
        this.offsetIndex = markSpecialTag.getOffsetIndex();
        this.offsetX = markSpecialTag.getOffsetX();
        this.offsetY = markSpecialTag.getOffsetY();
    }

    public SpecialTagDTO(MarkHeaderTag tag) {
        this.tagType = tag.getTagType();
        this.tagName = tag.getTagName();
        this.positionX = tag.getPositionX();
        this.positionY = tag.getPositionY();
        this.offsetIndex = tag.getOffsetIndex();
        this.offsetX = tag.getOffsetX();
        this.offsetY = tag.getOffsetY();
    }

    public MarkSpecialTag transform(MarkTask markTask) {
        MarkSpecialTag markSpecialTag = new MarkSpecialTag();
        markSpecialTag.setId(SystemConstant.getDbUuid());
        markSpecialTag.setTaskId(markTask.getId());
        markSpecialTag.setTagName(tagName);
        markSpecialTag.setPositionX(positionX);
        markSpecialTag.setPositionY(positionY);
        markSpecialTag.setOffsetIndex(offsetIndex);
        markSpecialTag.setOffsetX(offsetX);
        markSpecialTag.setOffsetY(offsetY);
        markSpecialTag.setTagType(tagType);
        return markSpecialTag;
    }

    public MarkHeaderTag transform(MarkArbitrateHistory arbitrateHistory) {
        MarkHeaderTag markSpecialTag = new MarkHeaderTag();
        markSpecialTag.setId(SystemConstant.getDbUuid());
        markSpecialTag.setStudentId(arbitrateHistory.getStudentId());
        markSpecialTag.setGroupNumber(arbitrateHistory.getGroupNumber());
        markSpecialTag.setUserId(arbitrateHistory.getUpdateUserId());
        markSpecialTag.setTagName(tagName);
        markSpecialTag.setTagType(tagType);
        markSpecialTag.setPositionX(positionX);
        markSpecialTag.setPositionY(positionY);
        markSpecialTag.setOffsetIndex(offsetIndex);
        markSpecialTag.setOffsetX(offsetX);
        markSpecialTag.setOffsetY(offsetY);
        return markSpecialTag;
    }

    public MarkHeaderTag transform(MarkHeaderGroupResult markResult, Long userId) {
        MarkHeaderTag markSpecialTag = new MarkHeaderTag();
        markSpecialTag.setId(SystemConstant.getDbUuid());
        markSpecialTag.setStudentId(markResult.getStudentId());
        markSpecialTag.setGroupNumber(markResult.getGroupNumber());
        markSpecialTag.setUserId(userId);
        markSpecialTag.setTagName(tagName);
        markSpecialTag.setTagType(tagType);
        markSpecialTag.setPositionX(positionX);
        markSpecialTag.setPositionY(positionY);
        markSpecialTag.setOffsetIndex(offsetIndex);
        markSpecialTag.setOffsetX(offsetX);
        markSpecialTag.setOffsetY(offsetY);
        return markSpecialTag;
    }

    public String getTagName() {
        return tagName;
    }

    public void setTagName(String tagName) {
        this.tagName = tagName;
    }

    public Double getPositionX() {
        return positionX;
    }

    public void setPositionX(Double positionX) {
        this.positionX = positionX;
    }

    public Double getPositionY() {
        return positionY;
    }

    public void setPositionY(Double positionY) {
        this.positionY = positionY;
    }

    public Integer getOffsetIndex() {
        return offsetIndex;
    }

    public void setOffsetIndex(Integer offsetIndex) {
        this.offsetIndex = offsetIndex;
    }

    public void setOffsetX(Integer offsetX) {
        this.offsetX = offsetX;
    }

    public Integer getOffsetX() {
        return offsetX;
    }

    public Integer getOffsetY() {
        return offsetY;
    }

    public void setOffsetY(Integer offsetY) {
        this.offsetY = offsetY;
    }

    public String getTagType() {
        return tagType;
    }

    public void setTagType(String tagType) {
        this.tagType = tagType;
    }

}
