Browse Source

测试打印

shish 5 years ago
parent
commit
d0cca9b095
2 changed files with 31 additions and 2 deletions
  1. 29 0
      biz-ghs/order/services/OrderService.php
  2. 2 2
      vendor/feie/API_PHP_DEMO.php

+ 29 - 0
biz-ghs/order/services/OrderService.php

@@ -572,6 +572,35 @@ class OrderService extends BaseService
             }
         }
 
+        header("Content-type: text/html; charset=utf-8");
+        include 'HttpClient.class.php';
+
+        $fei = Yii::getAlias("@vendor/feie");
+        require_once($fei . '/HttpClient.class.php');
+        $content = '<CB>测试打印</CB><BR>';
+        $content .= '名称      单价  数量 金额<BR>';
+        $content .= '--------------------------------<BR>';
+        $content .= '饭       10.0   10  100.0<BR>';
+        $content .= '炒饭      10.0   10  100.0<BR>';
+        $content .= '蛋炒饭     10.0   10  100.0<BR>';
+        $content .= '鸡蛋炒饭    10.0   10  100.0<BR>';
+        $content .= '西红柿炒饭   10.0   10  100.0<BR>';
+        $content .= '西红柿蛋炒饭  10.0   10  100.0<BR>';
+        $content .= '西红柿鸡蛋炒饭 10.0   10  100.0<BR>';
+        $content .= '--------------------------------<BR>';
+        $content .= '备注:加辣<BR>';
+        $content .= '合计:xx.0元<BR>';
+        $content .= '送货地点:广州市南沙区xx路xx号<BR>';
+        $content .= '联系电话:13888888888888<BR>';
+        $content .= '订餐时间:2014-08-08 08:08:08<BR>';
+        $content .= '<QR>http://www.feieyun.com</QR>';
+
+        //提示:
+        $sn = '530501507';
+        //打开注释可测试
+        printMsg($sn,$content,1);//该接口只能是小票机使用,如购买的是标签机请使用下面方法3,调用打印
+
+
     }
 
     //发起退款

+ 2 - 2
vendor/feie/API_PHP_DEMO.php

@@ -210,11 +210,11 @@
     );
     $client = new HttpClient(IP,PORT);
     if(!$client->post(PATH,$msgInfo)){
-      echo 'error';
+      //echo 'error';
     }else{
       //服务器返回的JSON字符串,建议要当做日志记录起来
       $result = $client->getContent();
-      echo $result;
+      //echo $result;
     }
   }