|
@@ -8,7 +8,7 @@ use app\common\model\ShsendqueueModel;
|
|
|
|
|
|
//use app\common\server\SouhuanAnalysis;
|
|
|
|
|
|
-//use think\facade\Log;
|
|
|
+use think\facade\Log;
|
|
|
|
|
|
/**
|
|
|
* 手环命令创建
|
|
@@ -63,6 +63,7 @@ class ShouhuanCommand
|
|
|
}
|
|
|
$content_arr = $data['content_arr'];
|
|
|
$config = $infoarr;
|
|
|
+
|
|
|
$m_ssl = new ShsendlistModel();
|
|
|
$commandxy = "3G";
|
|
|
//仅创建
|
|
@@ -189,6 +190,7 @@ class ShouhuanCommand
|
|
|
case 'SILENCETIME2':
|
|
|
case 'BOOTOFF':
|
|
|
case 'REMOVE':
|
|
|
+ case 'CALL':
|
|
|
$weight = 0;
|
|
|
break;
|
|
|
default:
|
|
@@ -388,6 +390,15 @@ class ShouhuanCommand
|
|
|
'kind' => 'send',
|
|
|
'need_back' => 1,
|
|
|
],
|
|
|
+ //拨打电话
|
|
|
+ 'CALL' => [
|
|
|
+ 'content' => [
|
|
|
+ 'command' => 'CALL',
|
|
|
+ 'telno' => '',
|
|
|
+ ],
|
|
|
+ 'kind' => 'send',
|
|
|
+ 'need_back' => 1,
|
|
|
+ ],
|
|
|
//平台回复
|
|
|
'LK' => [
|
|
|
'content' => [
|
|
@@ -461,11 +472,11 @@ class ShouhuanCommand
|
|
|
public function getSOSCommandinfo($param)
|
|
|
{
|
|
|
if (count($param) <= 0) {
|
|
|
- throw new \Exception("未设置电话");
|
|
|
+ throw new \Exception("SOS未设置电话");
|
|
|
|
|
|
}
|
|
|
if (count($param) > 3) {
|
|
|
- throw new \Exception("设置电话数量过多");
|
|
|
+ throw new \Exception("SOS设置电话数量过多");
|
|
|
|
|
|
}
|
|
|
foreach ($param as $key => $value) {
|
|
@@ -507,7 +518,10 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function getPHLCommandinfo($param)
|
|
|
{
|
|
|
- if (50 < count($param)) {
|
|
|
+ if (empty($param)) {
|
|
|
+ throw new \Exception("PHL无设置参数");
|
|
|
+ }
|
|
|
+ if (count($param) > 50) {
|
|
|
throw new \Exception("PHL参数错误");
|
|
|
}
|
|
|
$usedata = [];
|
|
@@ -728,6 +742,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createsoscommand($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
+ $param = array_filter($param);
|
|
|
$command = ['command' => 'SOS', 'content_arr' => ['command' => 'SOS']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
@@ -741,12 +756,14 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createphlcommand($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
+ $param = array_filter($param);
|
|
|
$command = ['command' => 'PHL', 'content_arr' => ['command' => 'PHL']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
|
//设备初始化
|
|
|
public function facilityinit($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
+ Log::write($param, 'shouhuan');
|
|
|
$zone = $param['zone'];
|
|
|
$upload_interval = $param['upload_interval'];
|
|
|
$fd_is_open = $param['fd_is_open'];
|
|
@@ -777,6 +794,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function setdatainterval($facility_id, $device_id_code, $param = [], $sys_user_id)
|
|
|
{
|
|
|
+ Log::write($param, 'shouhuan');
|
|
|
$cr_interval = $param['cr_interval'];
|
|
|
$hrt_interval = $param['hrt_interval'];
|
|
|
$wd_interval = $param['wd_interval'];
|
|
@@ -837,6 +855,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createremindcommand($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
+ Log::write($param, 'shouhuan');
|
|
|
$command = ['command' => 'REMIND', 'content_arr' => ['command' => 'REMIND']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
@@ -853,6 +872,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createsilencetime2command($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
+ Log::write($param, 'shouhuan');
|
|
|
$command = ['command' => 'SILENCETIME2', 'content_arr' => ['command' => 'SILENCETIME2']];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, $param, $sys_user_id);
|
|
|
}
|
|
@@ -869,6 +889,7 @@ class ShouhuanCommand
|
|
|
*/
|
|
|
public function createbootoffcommand($facility_id, $device_id_code, $param, $sys_user_id)
|
|
|
{
|
|
|
+ Log::write($param, 'shouhuan');
|
|
|
$is_open = $param['is_open'];
|
|
|
$bootup_time = $param['bootup_time'];
|
|
|
$shutdown_time = $param['shutdown_time'];
|
|
@@ -894,4 +915,20 @@ class ShouhuanCommand
|
|
|
$command = ['command' => 'REMOVE', 'content_arr' => ['command' => 'REMOVE', 'is_open' => $is_open]];
|
|
|
$this->createsendmsg($facility_id, $device_id_code, $command, [], $sys_user_id);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 拨打电话
|
|
|
+ *
|
|
|
+ * @param [type] $facility_id
|
|
|
+ * @param [type] $device_id_code
|
|
|
+ * @param [type] $telno
|
|
|
+ * @param [type] $sys_user_id
|
|
|
+ * @return void
|
|
|
+ * @author wj
|
|
|
+ * @date 2023-09-15
|
|
|
+ */
|
|
|
+ public function createcallcommand($facility_id, $device_id_code, $telno, $sys_user_id)
|
|
|
+ {
|
|
|
+ $command = ['command' => 'CALL', 'content_arr' => ['command' => 'CALL', 'telno' => $telno]];
|
|
|
+ $this->createsendmsg($facility_id, $device_id_code, $command, [], $sys_user_id);
|
|
|
+ }
|
|
|
}
|