Commit b1aa10a2 authored by Administrator's avatar Administrator

Merge branch 'master' into feature/alarm_order_vue

# Conflicts:
#	app/Http/Controllers/AlarmOrderController.php
#	routes/api.php
parents f72cb9ce 91dedef5
...@@ -89,7 +89,9 @@ class swooleMeTcp extends Command ...@@ -89,7 +89,9 @@ class swooleMeTcp extends Command
// } // }
$swooletcp = new ZehongTcpController(); $swooletcp = new ZehongTcpController();
// $swooletcp->swooletcplist($data); // $swooletcp->swooletcplist($data);
$serv->send($fd,$swooletcp->swooletcplist($data)); $todata = $swooletcp->swooletcplist($data);
Log::channel('slack')->info('返回值' . $todata);
$serv->send($fd,$todata);
}); });
//监听连接关闭事件 //监听连接关闭事件
......
...@@ -217,7 +217,7 @@ class AlarmOrderController extends Controller ...@@ -217,7 +217,7 @@ class AlarmOrderController extends Controller
*/ */
public function getUserInfo() public function getUserInfo()
{ {
if($this->isadmin()) { if ($this->isadmin()) {
$users = DB::table('users') $users = DB::table('users')
->select('users.id', 'users.name', 'users.username', 'users.phone_number', 'ur.name AS role_name', 'ap.area_name AS province', 'aa.area_name AS area', 'ac.area_name AS city') ->select('users.id', 'users.name', 'users.username', 'users.phone_number', 'ur.name AS role_name', 'ap.area_name AS province', 'aa.area_name AS area', 'ac.area_name AS city')
->leftJoin('user_roles AS ur', 'ur.id', '=', 'users.user_role_id') ->leftJoin('user_roles AS ur', 'ur.id', '=', 'users.user_role_id')
...@@ -227,9 +227,15 @@ class AlarmOrderController extends Controller ...@@ -227,9 +227,15 @@ class AlarmOrderController extends Controller
->where('users.user_role_id', '!=', 0) ->where('users.user_role_id', '!=', 0)
->get()->toArray(); ->get()->toArray();
return $this->jsonSuccessData($users); return $this->jsonSuccessData($users);
}else{ } else {
return $this->jsonErrorData(500, '没有权限, 请联系管理员!'); return $this->jsonErrorData(500, '没有权限, 请联系管理员!');
} }
}
//获取当前订单为第几步
public function orderin(Request $request){
$orderid = $request->input('oid');
$status = AlarmOrder::where('id','=',$orderid)->value('isorderone');
return $this->jsonSuccessData($status);
} }
} }
...@@ -36,7 +36,7 @@ class ZehongTcpController extends Controller ...@@ -36,7 +36,7 @@ class ZehongTcpController extends Controller
if($this->getPrc($isdata) == $devicecrc){ if($this->getPrc($isdata) == $devicecrc){
$data = ['id'=>$deviceId,'status'=>$status,'np'=>$devicenp,'famen'=>$devicefamen,'chongqi'=>$devicechongqi,'zijian'=>$devicezijian]; $data = ['id'=>$deviceId,'status'=>$status,'np'=>$devicenp,'famen'=>$devicefamen,'chongqi'=>$devicechongqi,'zijian'=>$devicezijian];
$totcp = json_decode($this->mysqldb($data),true); $totcp = json_decode($this->mysqldb($data),true);
if ($totcp == "暂无设备"){ if ($totcp == "No equipment"){
return $totcp; return $totcp;
} }
$totcpdata = $totcp['devicenum'] . $totcp['device_control'] . $devicechongqi . $devicezijian; $totcpdata = $totcp['devicenum'] . $totcp['device_control'] . $devicechongqi . $devicezijian;
...@@ -44,7 +44,7 @@ class ZehongTcpController extends Controller ...@@ -44,7 +44,7 @@ class ZehongTcpController extends Controller
return $totcpdata .$crcdata ; return $totcpdata .$crcdata ;
} }
} else { } else {
return "数据格式错误"; return "Data format error";
} }
} }
...@@ -94,7 +94,7 @@ class ZehongTcpController extends Controller ...@@ -94,7 +94,7 @@ class ZehongTcpController extends Controller
if ($todata){ if ($todata){
return json_encode($todata); return json_encode($todata);
}else{ }else{
return json_encode("暂无设备"); return json_encode("No equipment");
} }
} }
......
...@@ -55,6 +55,7 @@ Route::group(['middleware' => 'auth:api'], function () { ...@@ -55,6 +55,7 @@ Route::group(['middleware' => 'auth:api'], function () {
Route::delete('alarm_order/{id}', 'AlarmOrderController@destroy'); // 删除工单 Route::delete('alarm_order/{id}', 'AlarmOrderController@destroy'); // 删除工单
Route::get('alarm_order/user', 'AlarmOrderController@getUserInfo'); // 获取派单人员 Route::get('alarm_order/user', 'AlarmOrderController@getUserInfo'); // 获取派单人员
Route::get('alarm_order/show', 'AlarmOrderController@show'); // 工单详情 Route::get('alarm_order/show', 'AlarmOrderController@show'); // 工单详情
Route::get('alarm_order/order_in', 'AlarmOrderController@orderin'); // 获取当前订单为第几步
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment