|
@@ -70,6 +70,62 @@ class Vehicle extends CatchController
|
|
|
];
|
|
|
return $response;
|
|
|
}
|
|
|
+ public function getMapList(Request $request)
|
|
|
+ {
|
|
|
+ $param=$request->param();
|
|
|
+ //联表条件o.rfid_id = s.id and o.owner_id = r.id
|
|
|
+ $cond=[
|
|
|
+ '_string'=>'o.rfid_id = s.id',
|
|
|
+ ];
|
|
|
+ $keywords=$param['keywords'];
|
|
|
+ if($keywords){
|
|
|
+ $cond['_string']= '(s.RFID_SN like \'%'.$keywords.'%\' OR o.PLATE_NO like \'%'.$keywords.'%\') AND o.rfid_id = s.id';
|
|
|
+ }
|
|
|
+
|
|
|
+ $count=queryOracleCount('DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_RFID_TAGS s',$cond);
|
|
|
+
|
|
|
+ $cond['page']=isset($param['page'])?$param['page']:1;
|
|
|
+ $cond['limit']=isset($param['limit'])?$param['limit']:10;
|
|
|
+ $rows=queryOracleSelect('DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_RFID_TAGS s',$cond,'o.PLATE_NO,o.CAR_TYPE,o.CAR_BRAND,s.ID,s.RFID_SN,s.INSTALLER,to_char(s.INSTA_DATE,\'yyyy-mm-dd hh24:mi:ss\') INSTA_DATE');
|
|
|
+ $conn=getOracleConnect();
|
|
|
+ foreach($rows as &$val){
|
|
|
+ $val['CAR_BRAND_TEXT']=(new SysDictData())->getValueByCode('CAR_BRAND_OPTION',$val['CAR_BRAND']);
|
|
|
+ $val['CAR_TYPE_TEXT']=(new SysDictData())->getValueByCode('CAR_TYPE_OPTION',$val['CAR_TYPE']);
|
|
|
+
|
|
|
+
|
|
|
+ $route_sql='select * from(SELECT RF_ID,to_char(RF_DATE,\'yyyy-mm-dd hh24:mi:ss\') RF_DATE FROM DSSC2.W_DW_RF_RECORD WHERE RF_FLAGID =\''.$val['RFID_SN'].'\' ORDER BY RF_DATE DESC )where rownum < 2';
|
|
|
+
|
|
|
+
|
|
|
+ $stid = oci_parse($conn, $route_sql);
|
|
|
+ oci_define_by_name($stid, 'RF_ID', $val['mac']);
|
|
|
+ oci_define_by_name($stid, 'RF_DATE', $val['online_time']);
|
|
|
+ oci_execute($stid);
|
|
|
+ oci_fetch($stid);
|
|
|
+ oci_free_statement($stid);
|
|
|
+ $staion_info =Db::table('stations')->where('mac',$val['mac'])->find();
|
|
|
+ if($staion_info){
|
|
|
+ $wgsLoc = \algorithm\Geometry::gcj02ToWgs84((float)$staion_info['latitude'],(float)$staion_info['longitude']);
|
|
|
+ $val['longitude']=$wgsLoc['lng'];
|
|
|
+ $val['latitude']=$wgsLoc['lat'];
|
|
|
+ $val['address']=$staion_info['name'];
|
|
|
+ }else{
|
|
|
+ $val['longitude']='';
|
|
|
+ $val['latitude']='';
|
|
|
+ $val['address']='';
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ $response=[
|
|
|
+ 'code'=>10000,
|
|
|
+ 'message'=>'查询成功',
|
|
|
+ 'count'=>$count,
|
|
|
+ 'data'=>$rows,
|
|
|
+ 'current'=>isset($param['page'])?(int)$param['page']:1,
|
|
|
+ 'limit'=>isset($param['limit'])?(int)$param['limit']:10,
|
|
|
+ ];
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
public function getRfidTagsList(Request $request) {
|
|
|
$param=$request->param();
|
|
|
//联表条件o.rfid_id = s.id and o.owner_id = r.id
|