package com.zm.order.tool.server.dto;

import com.alibaba.fastjson.JSON;
import org.springframework.util.StringUtils;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 订单商品评价DTO
 *
 * @author zhuxiaofeng
 * @ClassName OrderItemCommentDTO
 * @date 2022/04/22 2:00 下午
 */
public class OrderItemCommentDTO extends OperateOrderItemCommentDTO {

    /**
     * 主键
     */
    private Long id;

    /**
     * 门店id
     */
    private Long storeId;

    /**
     * 评价分数
     */
    private Integer commentScore;

    /**
     * 评价内容
     */
    private String commentInfo;

    /**
     * 订单类型
     */
    private Integer orderType;

    /**
     * 是否存在图片 0:不存在 1:存在
     */
    private Integer existImage;

    /**
     * 评论图片列表
     */
    private List<String> commentImageList;

    /**
     * 评论时间
     */
    private Date commentAt;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 修改时间
     */
    private Date updatedAt;

    /**
     * 删除标识
     */
    private Integer isDeleted;

    /**
     * 同步标记
     */
    private Integer syncFlag;

    /**
     * 商品快照
     */
    private String itemInfo;

    /**
     * 商品信息
     */
    private Map<String, Object> itemInfoMap;

    /**
     * 订单评价扩展信息
     */
    private Map<String, Object> orderCommentExtraMap;

    /**
     * 评论详情列表
     */
    private List<OrderCommentDetailsDTO> commentDetailsList;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 履约类型
     */
    private Integer performanceType;

    public Integer getPerformanceType() {
        return performanceType;
    }

    public void setPerformanceType(Integer performanceType) {
        this.performanceType = performanceType;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public List<OrderCommentDetailsDTO> getCommentDetailsList() {
        return commentDetailsList;
    }

    public void setCommentDetailsList(List<OrderCommentDetailsDTO> commentDetailsList) {
        this.commentDetailsList = commentDetailsList;
    }

    public Map<String, Object> getOrderCommentExtraMap() {
        return orderCommentExtraMap;
    }

    public void setOrderCommentExtraMap(Map<String, Object> orderCommentExtraMap) {
        this.orderCommentExtraMap = orderCommentExtraMap;
    }

    public Map<String, Object> getItemInfoMap() {
        if (!StringUtils.isEmpty(itemInfo)) {
            return JSON.parseObject(itemInfo, Map.class);
        }
        return itemInfoMap;
    }

    public void setItemInfoMap(Map<String, Object> itemInfoMap) {
        this.itemInfoMap = itemInfoMap;
    }

    public String getItemInfo() {
        return itemInfo;
    }

    public void setItemInfo(String itemInfo) {
        this.itemInfo = itemInfo;
    }

    public Integer getSyncFlag() {
        return syncFlag;
    }

    public void setSyncFlag(Integer syncFlag) {
        this.syncFlag = syncFlag;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Integer getCommentScore() {
        return commentScore;
    }

    public void setCommentScore(Integer commentScore) {
        this.commentScore = commentScore;
    }

    public String getCommentInfo() {
        return commentInfo;
    }

    public void setCommentInfo(String commentInfo) {
        this.commentInfo = commentInfo;
    }

    public Integer getExistImage() {
        return existImage;
    }

    public void setExistImage(Integer existImage) {
        this.existImage = existImage;
    }

    public List<String> getCommentImageList() {
        return commentImageList;
    }

    public void setCommentImageList(List<String> commentImageList) {
        this.commentImageList = commentImageList;
    }

    public Date getCommentAt() {
        return commentAt;
    }

    public void setCommentAt(Date commentAt) {
        this.commentAt = commentAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
