147 lines
4.9 KiB
PHP
147 lines
4.9 KiB
PHP
<?php
|
|
/**
|
|
* @link http://www.yiiframework.com/
|
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
|
* @license http://www.yiiframework.com/license/
|
|
*/
|
|
|
|
namespace app\commands;
|
|
|
|
use app\components\XtOpenApi;
|
|
use app\components\YopointApi;
|
|
use app\models\BallCart;
|
|
use app\models\BallMark;
|
|
use app\models\DevList;
|
|
use app\models\Goods;
|
|
use app\models\GoodsHub;
|
|
use app\models\Order;
|
|
use app\modules\api\components\Mqtt;
|
|
use yii\console\Controller;
|
|
use yii\console\ExitCode;
|
|
use \PhpMqtt\Client\MQTTClient;
|
|
use \PhpMqtt\Client\ConnectionSettings;
|
|
use app\models\Store;
|
|
use app\modules\api\models\MsgCentreForm;
|
|
|
|
/**
|
|
* This command echoes the first argument that you have entered.
|
|
*
|
|
* This command is provided as an example for you to learn how to create console commands.
|
|
*
|
|
* @author Qiang Xue <qiang.xue@gmail.com>
|
|
* @since 2.0
|
|
*/
|
|
class HelloController extends Controller
|
|
{
|
|
/**
|
|
* This command echoes what you have entered as the message.
|
|
* @param string $message the message to be echoed.
|
|
* @return int Exit code
|
|
*/
|
|
public function actionIndex($message = 'hello world')
|
|
{
|
|
$obj = new YopointApi();
|
|
|
|
$redis_name = "cxgyc:YopointNotify:list";
|
|
|
|
\Yii::$app->redis->lpush($redis_name,"VI230505202541340549");
|
|
// $data = $obj->getOrderInfo("VI230505202541340549");
|
|
// $res = $obj->getOrderList(1,10,'2023-04-23 17:40:01','2023-04-23 17:45:11');
|
|
$res = $obj->openDevCall('https://c.yopoint.com/thirdpay/gateway/cabinet_notify/641422fd4a824400110ab7c6','VI230423174421704775','202304231744218026534334',1);
|
|
// var_dump($data);
|
|
exit();
|
|
$redis_name = "cxgyc:YopointNotify:list";
|
|
\Yii::$app->redis->lpush($redis_name,"VI230419141752714354");
|
|
\Yii::$app->redis->lpush($redis_name,"VI230419142440224827");
|
|
\Yii::$app->redis->lpush($redis_name,"VI230419142522988476");
|
|
/*$find = Order::findOne([
|
|
'id' => 250,
|
|
]);
|
|
MsgCentreForm::sendWxAppletGoodsContainerCloseRemind($find);*/
|
|
exit();
|
|
/*$arr = [
|
|
'method' => 'notify.close.door',
|
|
'biz_content' => '{"OID":"641422fd4a824400110ab7c6","Status":1,"ReceiptNo":"VI230411102328809663","Msg":"开门成功","ThirdpartyAppID":"179396370818"}',
|
|
'appid' => $obj->appid,
|
|
'sign_type' => 'md5',
|
|
'timestamp' => 1681179822,
|
|
];
|
|
$sign_res = $obj->getSign($arr,'openDevCall5');
|
|
|
|
// 48fa60da361b9613d57f7b661b992358
|
|
var_dump($sign_res);
|
|
exit();*/
|
|
/*
|
|
$t_id = "10003";
|
|
$res = $obj->openDev("62fc5e3680ea9300116ad910",$t_id,'18111111111');
|
|
if(!empty($res['data'])){
|
|
$res_ = $obj->openDevCall($res['data']['NotifyUrl'],$res['data']['ReceiptNo'],$t_id,1);
|
|
}
|
|
*/
|
|
// $res = $obj->getOrderInfo("VI230411110251238175");
|
|
// $res_ = $obj->openDevCall("https://c.yopoint.com/thirdpay/gateway/cabinet_notify/641422fd4a824400110ab7c6","VI230411100006129492",$t_id,1);
|
|
// var_dump($res);
|
|
// var_dump($res_);
|
|
|
|
|
|
|
|
// 门id -- 28d7f7a4d4734c6fa878a9251cec0b8f
|
|
// 单位id -- ec8788e2328841cda0ea09ae89cd1146
|
|
// 房屋id -- 201dad375b454e2e91cd7292d8978577
|
|
// 用户id -- c4a02f047d4a45e393dd6fab70067eed
|
|
// 小区id -- 30062d4a1845453a81be9a625445ffb6
|
|
// sn -- 10000559
|
|
$obj = new XtOpenApi();
|
|
$res = $obj->Open("10000559");
|
|
var_dump($res);
|
|
exit();
|
|
// $res = $obj->OpenQr(10000559,1681113652+600);
|
|
/*$res = $obj->getDoorSignal([
|
|
'id' => '28d7f7a4d4734c6fa878a9251cec0b8f',
|
|
])->getData();*/
|
|
/*$res = $obj->getOpenDoorRecord([
|
|
'villageId' => '30062d4a1845453a81be9a625445ffb6',
|
|
])->getData();*/
|
|
/*$res = $obj->getDoorQR([
|
|
'villageId' => '30062d4a1845453a81be9a625445ffb6',
|
|
'doorIds' => '28d7f7a4d4734c6fa878a9251cec0b8f',
|
|
'timeout' => time()+60*60*24,
|
|
'userId' => 'c4a02f047d4a45e393dd6fab70067eed',
|
|
])->getData();*/
|
|
/*$res = $obj->getDoor([
|
|
'name' => '测试门',
|
|
'sn' => '10000559',
|
|
'unitId' => 'ec8788e2328841cda0ea09ae89cd1146',
|
|
]);*/
|
|
// var_dump($res);
|
|
}
|
|
|
|
public function actionGetArea(){
|
|
|
|
$obj = new XtOpenApi();
|
|
$arr = [
|
|
'福建省',
|
|
'厦门市',
|
|
'思明区'
|
|
];
|
|
$res = $obj->getArea();
|
|
if(empty($res[$arr[0]])){
|
|
var_dump("cuow ");
|
|
exit();
|
|
}
|
|
$res = $obj->getArea($res[$arr[0]]['id']);
|
|
if(empty($res[$arr[1]])){
|
|
var_dump("cuow 2");
|
|
exit();
|
|
}
|
|
$res = $obj->getArea($res[$arr[1]]['id']);
|
|
if(empty($res[$arr[2]])){
|
|
var_dump("cuow 2");
|
|
exit();
|
|
}
|
|
$res = $obj->getArea($res[$arr[2]]['id']);
|
|
var_dump($res);
|
|
}
|
|
|
|
}
|