|
|
@ -4,6 +4,7 @@ |
|
|
namespace App\Admin\Extensions; |
|
|
namespace App\Admin\Extensions; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use App\Admin\Common\Rpc; |
|
|
use App\Models\Feprint; |
|
|
use App\Models\Feprint; |
|
|
use App\Models\ImsCjdcOrderMain; |
|
|
use App\Models\ImsCjdcOrderMain; |
|
|
use Dcat\Admin\Grid\RowAction; |
|
|
use Dcat\Admin\Grid\RowAction; |
|
|
@ -44,7 +45,6 @@ class OrderPrint extends RowAction |
|
|
|
|
|
|
|
|
public function doPrint($oid) |
|
|
public function doPrint($oid) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
$row = ImsCjdcOrderMain::find($oid); |
|
|
$row = ImsCjdcOrderMain::find($oid); |
|
|
|
|
|
|
|
|
//>>1.获取打印机状态
|
|
|
//>>1.获取打印机状态
|
|
|
@ -52,7 +52,7 @@ class OrderPrint extends RowAction |
|
|
|
|
|
|
|
|
//>>2.调用打印
|
|
|
//>>2.调用打印
|
|
|
if ($result == 1) { |
|
|
if ($result == 1) { |
|
|
$res = $this->rpcPrint($oid); |
|
|
|
|
|
|
|
|
$res = Rpc::doPrint($row->global_order_id); |
|
|
$res = json_decode($res, true)['result']; |
|
|
$res = json_decode($res, true)['result']; |
|
|
$res = json_decode($res); |
|
|
$res = json_decode($res); |
|
|
|
|
|
|
|
|
@ -81,20 +81,4 @@ class OrderPrint extends RowAction |
|
|
return -1; |
|
|
return -1; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function rpcPrint($oid) |
|
|
|
|
|
{ |
|
|
|
|
|
$client = Client::factory(env('RPC_SITE_HOST')); |
|
|
|
|
|
$request = $client->request(uniqid(), '/feie/doPrint', ['oid' => $oid]); |
|
|
|
|
|
$response = $client->send($request); |
|
|
|
|
|
return $response->getBody()->getContents(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function feiErPrint($order_num) |
|
|
|
|
|
{ |
|
|
|
|
|
include_once app_path('Libs\feier_print\api_php_demo.php'); |
|
|
|
|
|
$result = json_decode(FeiePrint($order_num)); |
|
|
|
|
|
dd($result); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |