|
@@ -7,6 +7,7 @@ use Illuminate\Contracts\Support\Renderable;
|
|
|
use Illuminate\Routing\Controller;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Http\Request;
|
|
|
+use Modules\OpcData\Services\zaoquan\ZQDcsApiService;
|
|
|
|
|
|
/**
|
|
|
* 枣泉自动化——东井通风
|
|
@@ -15,6 +16,15 @@ class ZQDcsFanController extends BaseController
|
|
|
{
|
|
|
|
|
|
private $db_name='etl_zaoquan';
|
|
|
+
|
|
|
+ protected $apiService;
|
|
|
+ protected $apiUrl = 'http://zdh.zaoquan.nxjiewei.com:8011/v1/common/GetPointRealDataByPageV3';
|
|
|
+
|
|
|
+ public function __construct(ZQDcsApiService $apiService)
|
|
|
+ {
|
|
|
+ $this->apiService = $apiService;
|
|
|
+ }
|
|
|
+
|
|
|
public function getList(Request $request) {
|
|
|
$sysCode = isset($request->sys_code) ? $request->sys_code : null; // 矿分类
|
|
|
if ($sysCode == null) {
|
|
@@ -1001,17 +1011,13 @@ class ZQDcsFanController extends BaseController
|
|
|
'2008298772605953_1',
|
|
|
];
|
|
|
|
|
|
-// $inCondition = "'" . implode("','", $east_key) . "'";
|
|
|
-// // 构建 SQL 查询
|
|
|
-// $sqlStr = "select `point_id`, value from dcs_data_ventilation_east where `point_id` in ($inCondition)";
|
|
|
-//
|
|
|
-// $res = $this->executeSql($sqlStr, 1);
|
|
|
-// $baseData=[];
|
|
|
-// for ($i = 0; $i < count($res); $i++) {
|
|
|
-// $key=$res[$i]->point_id;
|
|
|
-// $val=$res[$i]->value;
|
|
|
-// $baseData[$key]=$val;
|
|
|
-// }
|
|
|
+ $dataFromGetRequest = $this->apiService->getApiData($this->apiUrl, $keys);
|
|
|
+
|
|
|
+ return $dataFromGetRequest;
|
|
|
+
|
|
|
+ // 返回 JSON 响应
|
|
|
+// return response()->json($transformedData);
|
|
|
+
|
|
|
|
|
|
$tbName = 'dcs_data_ventilation_east';
|
|
|
$baseData = $this->getBaseDataArr($tbName, $keys);
|