package com.sqx.modules.exportExecl.dto;

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

@Data
public class AccountEntry extends PageQuery {

    private String shopName;
    private String shopPhone;
    private String userPhone;
    private String couponName;
    private String orderNumber;
    private String startTime;
    private String endTime;
    private String userId;
    private String flag;

    public String toStrMessage() {
        return (StringUtils.hasText(shopName) ? "商铺名称：" + shopName + ";" : "") +
                (StringUtils.hasText(shopPhone) ? "商铺手机号：" + shopPhone + ";" : "") +
                (StringUtils.hasText(userPhone) ? "用户手机号：" + userPhone + ";" : "") +
                (StringUtils.hasText(couponName) ? "优惠活动：" + couponName + ";" : "") +
                (StringUtils.hasText(orderNumber) ? "订单号：" + orderNumber + ";" : "") +
                (StringUtils.hasText(startTime) ? "开始时间：" + startTime + ";" : "") +
                (StringUtils.hasText(endTime) ? "结束时间：" + endTime + ";" : "")+
                ("1".equals(flag) ? "是否异常订单： 是;" : "是否异常订单：否");
    }

    public String toStrCode() {
        return
                ","+(shopName==null?"":shopName)
                +","+(shopPhone==null?"":shopPhone)
                +","+(userPhone==null?"":userPhone)
                +","+(couponName==null?"":couponName)
                +","+(orderNumber==null?"":orderNumber)
                +","+(startTime==null?"":startTime)
                +","+(endTime==null?"":endTime)
                +","+(flag==null?"":flag)
                +",";
    }
}
