package com.hai.config;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.*;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;

/**
 * 商鹏打印机模板
 * @author hurui
 */
public class SpPrinterTemplate {

    /**
     * 加油站收银员存根模板
     * @param gasName     油站名称
     * @param orderNo     订单号
     * @param payTime     支付时间
     * @param source      来源
     * @param gunNo       抢号
     * @param oilNo       油号
     * @param oilLiters   升数
     * @param orderPrice 加油金额
     * @return
     */
    public static String oilCashierStubTemp(String gasName,
                                            String orderNo,
                                            String payTime,
                                            String source,
                                            String gunNo,
                                            String oilNo,
                                            String oilLiters,
                                            String orderPrice) {
        String str = "<C><B>" + gasName + "</B></C> <BR> " +
                "<C>（收银员存根）</C> <BR>" +
                "------------------------------<BR>" +
                "流水：" + orderNo + "<BR>" +
                "------------------------------<BR>" +
                "时间：" + payTime + "<BR>" +
                "来源：" + source + "<BR>" +
                "油枪："+ gunNo + "号<BR>" +
                "油品：" + oilNo + "#<BR>" +
                "升数：" + oilLiters +"升<BR>" +
                "实际加油升数以油站加油机为准！<BR>" +
                "------------------------------<BR>" +
                "<L1>加油金额</L1><BR>" +
                "<L1>￥" + orderPrice + "元</L1><BR>" +
                "------------------------------<BR>" +
                "<C>来＂嗨森逛“；开心又省钱</C>";
        return str;
    }

    /**
     * 加油站客户存根模板
     * @param gasName     油站名称
     * @param orderNo     订单号
     * @param payTime     支付时间
     * @param source      来源
     * @param gunNo       抢号
     * @param oilNo       油号
     * @param oilLiters   升数
     * @param orderPrice 加油金额
     * @return
     */
    public static String oilClientStubTemp(String gasName,
                                            String orderNo,
                                            String payTime,
                                            String source,
                                            String gunNo,
                                            String oilNo,
                                            String oilLiters,
                                            String orderPrice) {
        String str = "<C><B>" + gasName + "</B></C> <BR> " +
                "<C>（客户存根）</C> <BR>" +
                "------------------------------<BR>" +
                "流水：" + orderNo + "<BR>" +
                "------------------------------<BR>" +
                "时间：" + payTime + "<BR>" +
                "来源：" + source + "<BR>" +
                "油枪："+ gunNo + "号<BR>" +
                "油品：" + oilNo + "#<BR>" +
                "升数：" + oilLiters +"升<BR>" +
                "实际加油升数以油站加油机为准！<BR>" +
                "------------------------------<BR>" +
                "<L1>加油金额</L1><BR>" +
                "<L1>￥" + orderPrice + "元</L1><BR>" +
                "------------------------------<BR>" +
                "<C>来＂嗨森逛“；开心又省钱</C>";
        return str;
    }

}
