嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java

131 lines
6.1 KiB

package com.hai.config;
import com.hai.common.utils.DateUtil;
import com.hai.model.GasClassGroupTaskDataCount;
import com.hai.model.GasClassGroupTaskOilCount;
import java.util.Date;
/**
* 商鹏打印机模板
* @author hurui
*/
public class SpPrinterTemplate {
/**
* 加油站收银员存根模板
*/
public static String classGroupCountTemp(GasClassGroupTaskDataCount dataCount, boolean makeUp) throws Exception {
String str = "<C>" + dataCount.getClassNum() + "班结流水" + (makeUp?"(补打)":"") + "</C> <BR> " +
"===============================<BR>" +
"开始时间:" + DateUtil.date2String(dataCount.getStartTime(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"结束时间:" + DateUtil.date2String(dataCount.getEndTime(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"<BR>" +
"加油金额汇总:" + dataCount.getRefuelPrice() + "元<BR>" +
"加油笔数汇总:" + dataCount.getRefuelNum() + "笔<BR>" +
"加油升数汇总:" + dataCount.getRefuelLiters() + "升<BR>" +
"<BR>" +
"退款金额汇总:" + dataCount.getRefundPrice() + "元<BR>" +
"退款笔数汇总:" + dataCount.getRefundNum() + "笔<BR>" +
"退款升数汇总:" + dataCount.getRefundLiters() + "升<BR>" +
"<BR>" +
"--------------收款-------------<BR>" +
"油号 金额(元) 升数 笔数<BR>";
String oilCountStr = "";
for (GasClassGroupTaskOilCount oilCount : dataCount.getGroupTaskOilCountList()) {
oilCountStr += oilCount.getOilNo() + "# " + oilCount.getRefuelPrice() + " " + oilCount.getRefuelLiters() + " " + oilCount.getRefuelNum() + "<BR>";
}
str += oilCountStr +
"================================<BR>" +
"<C>" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") +"</C> <BR>";
return str;
}
/**
* 加油站收银员存根模板
* @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 phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice,
boolean makeUp) throws Exception {
String str = "<C><B>" + gasName + (makeUp?"(补打)":"") + "</B></C> <BR> " +
"<C>(收银员存根)</C> <BR>" +
"------------------------------<BR>" +
"流水:" + orderNo + "<BR>" +
"------------------------------<BR>" +
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"支付时间:" + payTime + "<BR>" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "<BR>" +
"来源:" + source + "<BR>" +
"油枪:"+ gunNo + "号<BR>" +
"油品:" + oilNo + "#<BR>" +
"升数:" + oilLiters +"升<BR>" +
"实际加油升数以油站加油机为准!<BR>" +
"------------------------------<BR>" +
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"------------------------------<BR>" +
"<C><B>开心又省钱; 来"嗨森逛"</B></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 phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice,
boolean makeUp) throws Exception {
String str = "<C><B>" + gasName + (makeUp?"(补打)":"") +"</B></C> <BR> " +
"<C>(客户存根)</C> <BR>" +
"------------------------------<BR>" +
"流水:" + orderNo + "<BR>" +
"------------------------------<BR>" +
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"支付时间:" + payTime + "<BR>" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "<BR>" +
"来源:" + source + "<BR>" +
"油枪:"+ gunNo + "号<BR>" +
"油品:" + oilNo + "#<BR>" +
"升数:" + oilLiters +"升<BR>" +
"实际加油升数以油站加油机为准!<BR>" +
"------------------------------<BR>" +
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"------------------------------<BR>" +
"<C><B>开心又省钱; 来"嗨森逛"</B></C>";
return str;
}
}