package com.sqx.modules.pay.controller.query;

import com.sqx.common.query.PageQuery;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;

/**
 * 提现信息查询dto
 */
@Data
@ApiModel("cashOutQueryDTO")
public class CashOutQueryDTO extends PageQuery {
    @ApiModelProperty("银行卡号")
    private String bankCardNo ;
    @ApiModelProperty("银行卡户主名称")
    private String bankRealName ;
    @ApiModelProperty("银行卡开户行")
    private String openBank ;
    @ApiModelProperty("支付宝名称")
    private String zhifubaoName;
    @ApiModelProperty("支付宝账号")
    private String zhifubao;
    @ApiModelProperty("店铺名称")
    private String shopName;
    @ApiModelProperty("用户id")
    private Long userId;
    @ApiModelProperty("提现状态")
    private Integer state;
    @ApiModelProperty("用户手机号")
    private String phone;
    @ApiModelProperty("分类 1用户提现、2退保障金")
    private String type;
    @ApiModelProperty("支付渠道 1支付宝、2微信支付、5银行卡")
    private Integer classify;
    @ApiModelProperty("查询开始时间")
    private String startTime;
    @ApiModelProperty("查询结束时间")
    private String endTime;

    @ApiModelProperty("骑手所在站点id")
    private String riderStationId;
    @ApiModelProperty("操作开始时间")
    private String outStartTime;
    @ApiModelProperty("操作结束时间")
    private String outEndTime;
    @ApiModelProperty("用户名称")
    private String userName;

    public String toStrCode() {
        return
//                ","+bankCardNo+
//                ","+bankRealName+
//                ","+openBank+
                ","+(zhifubaoName==null?"":zhifubaoName)+
                ","+(zhifubao==null?"":zhifubao)+
                ","+(shopName==null?"":shopName)+
//                ","+userId+
                ","+(state==null?"":state)+
//                ","+phone+
                ","+(type==null?"":type)+
//                ","+classify+
                ","+(startTime==null?"":startTime)+
                ","+(endTime==null?"":endTime)+
                ","+(riderStationId==null?"":riderStationId)+
                ","+(outStartTime==null?"":outStartTime)+
                ","+(outEndTime==null?"":outEndTime)+
                ","+(userName==null?"":userName)+
                ","+(phone==null?"":phone)+",";
    }
    public String toStrMessage() {
        StringBuffer stringBuffer=new StringBuffer();

        stringBuffer
//                .append(bankCardNo==null||bankCardNo==""?"":"银行卡号："+bankCardNo+";")
//                .append(bankRealName==null||bankRealName==""?"":"银行卡户主名称："+bankRealName+";")
//                .append(openBank==null||openBank==""?"":"银行卡开户行："+openBank+";")
                .append(zhifubaoName==null||zhifubaoName==""?"":"支付宝名称："+zhifubaoName+";")
                .append(zhifubao==null||zhifubao==""?"":"支付宝账号："+zhifubao+";")
                .append(shopName==null||shopName==""?"":"店铺名称："+shopName+";")
//                .append(phone==null||phone==""?"":"用户手机号："+phone+";")
//                .append(classify==null?"":"支付渠道："+classify+";")
                .append(startTime==null||startTime==""?"":"开始时间："+startTime+";")
                .append(endTime==null||endTime==""?"":"结束时间："+endTime+";")
                .append(outStartTime==null||outStartTime==""?"":"操作开始时间："+outStartTime+";")
                .append(outEndTime==null||outEndTime==""?"":"操作结束时间："+outEndTime+";")
                .append(userName==null||userName==""?"":"姓名："+userName+";")
                .append(phone==null||phone==""?"":"手机号："+phone+";");
        if(state!=null){
            switch (state){
                case 0: stringBuffer.append("状态：待转账;");break;
                case 1: stringBuffer.append("状态：已转账;");break;
                case 2: stringBuffer.append("状态：已拒绝;");break;
            }
        }
        if(StringUtils.hasText(type)){
            switch (type){
                case "1": stringBuffer.append("类型：用户提现;");break;
                case "2": stringBuffer.append("类型：商户提现;");break;
            }
        }
        return stringBuffer.toString();
    }
}
