|
@@ -629,10 +629,9 @@ public class PayController {
|
|
|
content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
|
|
|
content1 += "优惠: "+discountAmtP+" 元<BR>";
|
|
|
content1 += "支付: "+amtP+" 元<BR>";
|
|
|
- //content1 += "手机号: "+mobilePhoneP+" <BR>";
|
|
|
content1 += "支付方式: "+payWayP+" <BR>";
|
|
|
content1 += "<BR>";
|
|
|
- content1 += "--------------------------------<BR>";
|
|
|
+ //content1 += "--------------------------------<BR>";
|
|
|
content1 += "<BR>";
|
|
|
|
|
|
content2 = "<CB>支付小票--商户联</CB><BR>";
|
|
@@ -661,9 +660,22 @@ public class PayController {
|
|
|
// if(jsonPrintStatus.getString("data").equals("\\u5728\u7ebf\\uff0c\\u5de5\\u4f5c\\u72b6\u6001\\u6b63\\u5e38\\u3002")){
|
|
|
// logger.info("打印机在线,工作状态正常:" + jsonPrintStatus.toString());
|
|
|
//开始打印
|
|
|
- String printInfo = FeiEPrinterUtil.printReceipt(sn, content1 + content2);
|
|
|
+ String printInfo=""; //打印信息
|
|
|
+ if(m.containsKey("printSetting") && m.get("printSetting").toString()!= null && m.get("printSetting").toString()!=""){
|
|
|
+ switch (m.get("printSetting").toString()){
|
|
|
+ case "1": //1 客户联
|
|
|
+ printInfo = FeiEPrinterUtil.printReceipt(sn, content1);
|
|
|
+ break;
|
|
|
+ case "2": //2 商户联
|
|
|
+ printInfo = FeiEPrinterUtil.printReceipt(sn, content2);
|
|
|
+ break;
|
|
|
+ case "3": //3商户联和客户联
|
|
|
+ printInfo = FeiEPrinterUtil.printReceipt(sn, content1 + content2);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
JSONObject jsonObject = JSONObject.parseObject(printInfo);
|
|
|
- if(jsonObject.getString("msg").equals("ok")){
|
|
|
+ if(jsonObject != null && jsonObject.getString("msg").equals("ok")){
|
|
|
logger.info("打印成功:" + jsonObject.toString());
|
|
|
//如果打印成功 添加小票数量
|
|
|
PayOrder p = new PayOrder();
|