package com.bcxin.risk.compose.dto.data;

import com.bcxin.risk.hibernateplus.entity.page.Page;
import lombok.Data;

import java.util.Map;

/**
 * @param
 * @return
 * @auther Administrator
 * @date 2017/07/27 0027
 * @注意事项 </b>
 */
@Data
public class ComposeTaskDataDto {

    private String activityId;

    private String reportId;

    private String taskId;

    private String expertOrderId;

    private String composetaskid;

    private String assignDate;

    private String startDate;

    private String endDate;

    private String createOn;

    private String number;

    private String activityType;

    private String reportUrgent;

    private String frameId;

    private String activityName;

    private String activitySource;

    private String taskName;

    private String acceptDate;

    private String assgin_id;

    private String assgin_name;

    private String assgin_phone;

    private String assgin_email;

    private String assgin_sign;

    private String reportSubStatus;

    private String orderStatus;

    private String taskStatus;

    private String finishDate;

    private String composeComplete;

    private String signature;

    // 任务接收状态
    private String acceptStatus;

    // 专家订单-任务类型
    private String orderType;
    // 专家订单-订单状态
    private String expertOrderStatus;
    // 专家订单-薪酬
    private String payment;
    // 用户真实名称
    private String realName;
    // 用户名
    private String userName;

    /**
     * 专家任务价格
     */
    private String taskQuote;

    /**
     * 当前活动是否需要其他专家操作，Y,N
     */
    private String isNeedOtherZX;

    private Page page;

    public ComposeTaskDataDto(Map<String, Object> map){
        this.taskQuote =safeTransfor(map.get("taskQuote"));
        this.activityId =safeTransfor(map.get("activityId"));
        this.frameId =safeTransfor(map.get("frameId"));
        this.reportId =safeTransfor(map.get("reportId"));
        this.taskId =safeTransfor(map.get("taskId"));
        this.composetaskid =safeTransfor(map.get("composetaskid"));
        this.assignDate =safeTransfor(map.get("assignDate"));
        this.startDate =safeTransfor(map.get("startDate"));
        this.endDate =safeTransfor(map.get("endDate"));
        this.createOn =safeTransfor(map.get("createOn"));
        this.number =safeTransfor(map.get("number"));
        this.activityType =safeTransfor(map.get("activityType"));
        this.reportUrgent =safeTransfor(map.get("reportUrgent"));
        this.activityName =safeTransfor(map.get("activityName"));
        this.activitySource =safeTransfor(map.get("activitySource"));
        this.taskName =safeTransfor(map.get("taskName"));
        this.acceptDate =safeTransfor(map.get("acceptDate"));
        this.assgin_id =safeTransfor(map.get("assgin_id"));
        this.assgin_name =safeTransfor(map.get("assgin_name"));
        this.assgin_phone =safeTransfor(map.get("assgin_phone"));
        this.assgin_email =safeTransfor(map.get("assgin_email"));
        this.assgin_sign =safeTransfor(map.get("assgin_sign"));
        this.reportSubStatus =safeTransfor(map.get("reportSubStatus"));
        this.orderStatus =safeTransfor(map.get("orderStatus"));
        this.taskStatus =safeTransfor(map.get("taskStatus"));
        this.finishDate =safeTransfor(map.get("finishDate"));
        this.composeComplete =safeTransfor(map.get("composeComplete"));
        this.signature =safeTransfor(map.get("signature"));
        this.acceptStatus=safeTransfor(map.get("acceptStatus"));
        this.orderType=safeTransfor(map.get("orderType"));
        this.expertOrderStatus=safeTransfor(map.get("expertOrderStatus"));
        this.payment=safeTransfor(map.get("payment"));
        this.expertOrderId=safeTransfor(map.get("expertOrderId"));
        this.realName=safeTransfor(map.get("realName"));
        this.userName=safeTransfor(map.get("userName"));
        if("0".equals(safeTransfor(map.get("otherZXZJ")))){
            this.isNeedOtherZX="N";
        }else{
            this.isNeedOtherZX="Y";
        }
    }

    private String safeTransfor(Object obj){
        if ( obj == null ) {
            return "";
        }
        return obj.toString();
    }
}
