|
@@ -15,7 +15,7 @@ use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
use think\facade\Env;
|
|
|
use think\facade\Db;
|
|
|
use PDO;
|
|
|
-
|
|
|
+use think\facade\Cache;
|
|
|
class Station extends CatchController
|
|
|
{
|
|
|
// protected $stationModel;
|
|
@@ -80,11 +80,20 @@ class Station extends CatchController
|
|
|
*/
|
|
|
public function getAllList(Request $request)
|
|
|
{
|
|
|
+ $list=Cache::get('stationList');
|
|
|
+ if($list){
|
|
|
+ return [
|
|
|
+ 'code'=>10000,
|
|
|
+ 'message'=>'查询成功',
|
|
|
+ 'data'=>$list,
|
|
|
+ ];
|
|
|
+
|
|
|
+ }
|
|
|
$cond=[
|
|
|
'_string'=>'a.DEVICE_CODE = r.DEVICE_CODE',
|
|
|
];
|
|
|
$cond['page']=1;
|
|
|
- $cond['limit']=3000;
|
|
|
+ $cond['limit']=30000;
|
|
|
$conn = null;
|
|
|
$tableName='(SELECT * FROM DSSC2.ADM_DEV ORDER BY ID DESC) a,DSSC2.ADM_DEV_RFID_CHN r';
|
|
|
$field='a.ID,a.IS_ONLINE,a.LOGIN_NAME,a.DEVICE_CODE,a.DEVICE_NAME,a.OWNER_CODE,to_char(a.UPDATE_DATE,\'yyyy-mm-dd hh24:mi:ss\') UPDATE_DATE,r.GPS_X,r.GPS_Y';
|
|
@@ -112,16 +121,17 @@ class Station extends CatchController
|
|
|
$rows=[];
|
|
|
while($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
|
|
|
if($row['GPS_Y'] && $row['GPS_X']){
|
|
|
- $wgsLoc = \algorithm\Geometry::wgsTOgcj((float)$row['GPS_Y'],(float)$row['GPS_X']);
|
|
|
- $lngLat = \algorithm\Geometry::convertGcj02ToBd09($wgsLoc['lat'],$wgsLoc['lng']);
|
|
|
- $row['GPS_X']=$lngLat['lng'];
|
|
|
- $row['GPS_Y']=$lngLat['lat'];
|
|
|
+ // $wgsLoc = \algorithm\Geometry::wgsTOgcj((float)$row['GPS_Y'],(float)$row['GPS_X']);
|
|
|
+ // $lngLat = \algorithm\Geometry::convertGcj02ToBd09($wgsLoc['lat'],$wgsLoc['lng']);
|
|
|
+ // $row['GPS_X']=$lngLat['lng'];
|
|
|
+ // $row['GPS_Y']=$lngLat['lat'];
|
|
|
$rows[]=$row;
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
oci_free_statement($stid);
|
|
|
+ Cache::set('stationList', $rows, 300);
|
|
|
$response=[
|
|
|
'code'=>10000,
|
|
|
'message'=>'查询成功',
|