|
@@ -536,7 +536,7 @@ class ShOneanalysis
|
|
|
'createtime' => date('Y-m-d H:i:s'),
|
|
|
];
|
|
|
$id = $m_srq->insertData($data);
|
|
|
- Log::write('id:' . $id, 'shouhuan');
|
|
|
+ //Log::write('id:' . $id, 'shouhuan');
|
|
|
if (empty($id)) {
|
|
|
return false;
|
|
|
}
|
|
@@ -555,7 +555,7 @@ class ShOneanalysis
|
|
|
$infoarr = $this->gettsendcommandinfo($command);
|
|
|
if (!$infoarr) {
|
|
|
Log::write("无对应命令数据2:" . $command, 'shouhuan');
|
|
|
- Log::write($data, 'shouhuan');
|
|
|
+ Log::write($original_str, 'shouhuan');
|
|
|
return false;
|
|
|
}
|
|
|
$data = $this->getdata($data, $data[0], $infoarr);
|
|
@@ -599,6 +599,7 @@ class ShOneanalysis
|
|
|
$sririnsertData['facility_id'] = $facility_id;
|
|
|
$sririnsertData['device_id_code'] = $device_id_code;
|
|
|
$sririnsertData['createtime'] = date('Y-m-d H:i:s');
|
|
|
+ $sririnsertData['command'] = $command;
|
|
|
$sririd = $m_srir->insertData($sririnsertData);
|
|
|
if (empty($sririd)) {
|
|
|
throw new \Exception("设备历史信息添加失败:" . $device_id_code);
|
|
@@ -626,18 +627,19 @@ class ShOneanalysis
|
|
|
} else {
|
|
|
$list = $m_srq->getList($where, '*', $page, $size, 'id asc');
|
|
|
if (empty($list)) {
|
|
|
- Log::write("手环接收信息队列-无数据", 'shouhuan');
|
|
|
+ //Log::write("手环接收信息队列-无数据", 'shouhuan');
|
|
|
return false;
|
|
|
}
|
|
|
$list = $list->toArray();
|
|
|
$ids = array_column($list, 'id');
|
|
|
$updatecount = $m_srq->updateinfo(['id' => ['in', $ids], 'status' => 0], ['status' => 1]);
|
|
|
if ($updatecount != count($ids)) {
|
|
|
- Log::write("手环接收信息队列-部分未修改", 'shouhuan');
|
|
|
+ //Log::write("手环接收信息队列-部分未修改", 'shouhuan');
|
|
|
+ $updatecount = empty($updatecount) ? 0 : (int) $updatecount;
|
|
|
Log::write("count:" . count($ids) . " update count:" . $updatecount, 'shouhuan');
|
|
|
}
|
|
|
if (empty($updatecount)) {
|
|
|
- Log::write("手环接收信息队列-无修改数据", 'shouhuan');
|
|
|
+ //Log::write("手环接收信息队列-无修改数据", 'shouhuan');
|
|
|
return false;
|
|
|
}
|
|
|
return $list;
|
|
@@ -688,11 +690,13 @@ class ShOneanalysis
|
|
|
$m_ssq = new ShoneSendQueueModel();
|
|
|
$m_ssl = new ShoneSendListModel();
|
|
|
$ssqid = $item['id'];
|
|
|
- $list_id = $item['list_id'];
|
|
|
- $sslwhere = ['id' => $list_id, 'is_send' => 0];
|
|
|
- $sslinfo = $m_ssl->getInfo($sslwhere);
|
|
|
- if ($sslinfo) {
|
|
|
- $row = $m_ssl->updateinfo(['id' => $sslinfo['id']], ['is_send' => 1, 'send_time' => date('Y-m-d H:i:s')]);
|
|
|
+ if ($item['list_id']) {
|
|
|
+ $list_id = $item['list_id'];
|
|
|
+ $sslwhere = ['id' => $list_id, 'is_send' => 0];
|
|
|
+ $sslinfo = $m_ssl->getInfo($sslwhere);
|
|
|
+ if ($sslinfo) {
|
|
|
+ $row = $m_ssl->updateinfo(['id' => $sslinfo['id']], ['is_send' => 1, 'send_time' => date('Y-m-d H:i:s')]);
|
|
|
+ }
|
|
|
}
|
|
|
$ssqwhere = ['id' => $ssqid];
|
|
|
$ssqinfo = $m_ssq->getInfo($ssqwhere);
|
|
@@ -773,4 +777,16 @@ class ShOneanalysis
|
|
|
}
|
|
|
return $arr;
|
|
|
}
|
|
|
+
|
|
|
+ public function showfortest($data)
|
|
|
+ {
|
|
|
+ $strdata = $this->getline($data);
|
|
|
+ $content = $strdata['content_str'];
|
|
|
+ $content = $this->getcommandcontent($content);
|
|
|
+ $command = $content[0];
|
|
|
+ $showcommands = ['SOS', 'CR', 'UPLOAD', 'SLEEPTIME'];
|
|
|
+ if (in_array($command, $showcommands)) {
|
|
|
+ var_dump($data);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|