package com.ssj.bean.sys.problem.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.ssj.framework.weixin.util.DateUtil;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: chchen
 * @Description
 * @Date Create in 16:44 2019/10/24
 * @Modified By
 */
public class ProblemPictureListDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private String problemPictureId;

    /**
     * 0未编辑1已编辑（老师端使用，如果老师编辑了文字、图片、语音，则是已编辑）
     */
    private int type;

    /**
     * 家长端：（解答状态    0未解答，1已解答）
     * 其他端：（解析状态    0未解析，1已解析，2解析失败）
     * 此字段后续需要修改
     */
    private Integer resolutionStatus;

    /**
     * 老师评语
     */
    private String teacherComment;

    private String subject;

    private String childName;

    private String ChildImg;

    private String createTime;

    private String problemPicturePath;

    /**
     * 解答状态
     */
    private int queryStatus;

    private String week;

    private int taskStatus;

    private int dealFlag;

    private int teacherMessageType;
    /**
     * 是否反馈：1已反馈，0未反馈
     */
    private int isFeedback;

//    public void setCreateTime(String createTime) {
//        this.createTime = createTime;
//    }

    public int getIsFeedback() {
        return isFeedback;
    }

    public void setIsFeedback(int isFeedback) {
        this.isFeedback = isFeedback;
    }

    public String getProblemPictureId() {
        return problemPictureId;
    }

    public void setProblemPictureId(String problemPictureId) {
        this.problemPictureId = problemPictureId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public Integer getResolutionStatus() {
//        if (taskStatus == 1 && dealFlag == 0) {
//            return  2;
//        } else {
//            return taskStatus;
//        }
        if  (resolutionStatus != null){
            return resolutionStatus;
        } else if (dealFlag == 2 || dealFlag == 3 || type == 1){
            return 1;
        } else {
            return 0;
        }
    }

    public void setResolutionStatus(Integer resolutionStatus) {
        this.resolutionStatus = resolutionStatus;
    }

    public String getTeacherComment() {
        return teacherComment;
    }

    public void setTeacherComment(String teacherComment) {
        this.teacherComment = teacherComment;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getChildName() {
        return childName;
    }

    public void setChildName(String childName) {
        this.childName = childName;
    }

    public String getChildImg() {
        return ChildImg;
    }

    public void setChildImg(String childImg) {
        ChildImg = childImg;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = DateUtil.format_yyyyMMddHHmmss(createTime);
    }

    public String getProblemPicturePath() {
        return problemPicturePath;
    }

    public void setProblemPicturePath(String problemPicturePath) {
        this.problemPicturePath = problemPicturePath;
    }

    public int getQueryStatus() {
        /*if (dealFlag == 2 || dealFlag == 3 || type == 1){
            return 2;
        } else {
            return 1;
        }*/
        return isFeedback == 1 ? 2 : 1;
    }

    public void setQueryStatus(int queryStatus) {
        this.queryStatus = queryStatus;
    }

    public String getWeek() {
        return week;
    }

    public void setWeek(String week) {
        this.week = week;
    }

    @JSONField(serialize = false)
    public int getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(int taskStatus) {
        this.taskStatus = taskStatus;
    }

    @JSONField(serialize = false)
    public int getDealFlag() {
        return dealFlag;
    }

    public void setDealFlag(int dealFlag) {
        this.dealFlag = dealFlag;
    }

    public int getTeacherMessageType() {
        return teacherMessageType;
    }

    public void setTeacherMessageType(int teacherMessageType) {
        this.teacherMessageType = teacherMessageType;
    }
}
