package com.sqx.modules.reconciliation.model;

import com.sqx.common.query.PageQuery;
import lombok.Data;
import org.springframework.util.StringUtils;

@Data
public class PlatformBillDto extends PageQuery {

    private String startDate;
    private String endDate;
    private String riderStation;
    private String riderName;
    private String riderPhone;
    private String shopName;
    private String shopPhone;
    private String userId;

    public String toStrMessage() {
        StringBuilder stringBuilder=new StringBuilder();
        stringBuilder
                .append(StringUtils.hasText(startDate)?"开始日期："+startDate+";":"")
                .append(StringUtils.hasText(endDate)?"结束日期："+endDate+";":"")
                .append(StringUtils.hasText(riderName)?"骑手名称："+riderName+";":"")
                .append(StringUtils.hasText(riderPhone)?"骑手手机号："+riderPhone+";":"")
                .append(StringUtils.hasText(shopName)?"商户名称："+shopName+";":"")
                .append(StringUtils.hasText(shopPhone)?"商户手机号："+shopPhone+";":"")
                ;
        return stringBuilder.toString();
    }

    public String toStrCode() {
        return
                ","+(startDate==null?"":startDate)
                        +","+(endDate==null?"":endDate)
                        +","+(riderName==null?"":riderName)
                        +","+(riderPhone==null?"":riderPhone)
                        +","+(shopName==null?"":shopName)
                        +","+(shopPhone==null?"":shopPhone)
                        +","+(riderStation==null?"":riderStation)
                        +",";
    }
}
