likang пре 2 година
родитељ
комит
d02d1feadf

+ 3 - 0
catch/hydraulic/controller/HydEquipment.php

@@ -69,6 +69,9 @@ class HydEquipment extends CatchController
         'check_status'=>$data['check_status'],
         // 状态
         'status'=>$data['status'],
+        'address'=>$data['address'],
+        'longitude'=>$data['longitude'],
+        'latitude'=>$data['latitude']
         ];
         Db::startTrans();
         try{

+ 13 - 1
catch/map/controller/RouteMap.php

@@ -10,6 +10,7 @@ use Aliyun\OTS\OTSClient;
 
 use catchAdmin\hydraulic\model\Hydraulic as deviceModel;
 use catchAdmin\fences\model\Fences as fencesModel;
+use catchAdmin\hydraulic\model\HydEquipment;
 use think\facade\Db;
 use think\facade\Env;
 class RouteMap extends CatchController
@@ -56,7 +57,18 @@ class RouteMap extends CatchController
         // var_dump($list);
         return CatchResponse::success($list);
     }
-    
+    /**
+     * @Descripttion: 工具柜列表
+     * @name: likang
+     * @param {Request} $request
+     * @return {*}
+     */    
+    public function queryWorkBoxMap(Request $request)
+    {
+        $hy = new HydEquipment();
+        return CatchResponse::paginate($hy->getList());
+
+    }
     /**
      *
      * @time  2021年05月24日

+ 2 - 0
catch/map/route.php

@@ -22,6 +22,8 @@ $router->group(function () use ($router){
 	$router->get('map/queryLocationList', '\catchAdmin\map\controller\RouteMap@queryLocationList');
 	$router->get('map/queryAlarmLocationList', '\catchAdmin\map\controller\RouteMap@queryAlarmLocationList');
 	$router->get('map/queryFenceList', '\catchAdmin\map\controller\RouteMap@queryFenceList');
+	//获取工具柜地图
+	$router->get('map/queryWorkBoxMap', '\catchAdmin\map\controller\RouteMap@queryWorkBoxMap');
 	
 	$router->get('map/queryBuildingInfo', '\catchAdmin\map\controller\RouteMap@queryBuildingInfo');
 

+ 69 - 0
catch/worklocation/controller/Workplan.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace catchAdmin\worklocation\controller;
+
+use catcher\base\CatchRequest as Request;
+use catcher\CatchResponse;
+use catcher\base\CatchController;
+use catchAdmin\worklocation\model\Workplan as workplanModel;
+
+class Workplan extends CatchController
+{
+    protected $workplanModel;
+    
+    public function __construct(WorkplanModel $workplanModel)
+    {
+        $this->workplanModel = $workplanModel;
+    }
+    
+    /**
+     * 列表
+     * @time 2022年06月28日 09:51
+     * @param Request $request 
+     */
+    public function index(Request $request) : \think\Response
+    {
+        return CatchResponse::paginate($this->workplanModel->getList());
+    }
+    
+    /**
+     * 保存信息
+     * @time 2022年06月28日 09:51
+     * @param Request $request 
+     */
+    public function save(Request $request) : \think\Response
+    {
+        return CatchResponse::success($this->workplanModel->storeBy($request->post()));
+    }
+    
+    /**
+     * 读取
+     * @time 2022年06月28日 09:51
+     * @param $id 
+     */
+    public function read($id) : \think\Response
+    {
+        return CatchResponse::success($this->workplanModel->findBy($id));
+    }
+    
+    /**
+     * 更新
+     * @time 2022年06月28日 09:51
+     * @param Request $request 
+     * @param $id
+     */
+    public function update(Request $request, $id) : \think\Response
+    {
+        return CatchResponse::success($this->workplanModel->updateBy($id, $request->post()));
+    }
+    
+    /**
+     * 删除
+     * @time 2022年06月28日 09:51
+     * @param $id
+     */
+    public function delete($id) : \think\Response
+    {
+        return CatchResponse::success($this->workplanModel->deleteBy($id));
+    }
+}

+ 47 - 0
catch/worklocation/database/migrations/20220628095201_work_plan.php

@@ -0,0 +1,47 @@
+<?php
+
+use think\migration\Migrator;
+use think\migration\db\Column;
+use Phinx\Db\Adapter\MysqlAdapter;
+
+class WorkPlan extends Migrator
+{
+    /**
+     * Change Method.
+     *
+     * Write your reversible migrations using this method.
+     *
+     * More information on writing migrations is available here:
+     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
+     *
+     * The following commands can be used in this method and Phinx will
+     * automatically reverse them when rolling back:
+     *
+     *    createTable
+     *    renameTable
+     *    addColumn
+     *    renameColumn
+     *    addIndex
+     *    addForeignKey
+     *
+     * Remember to call "create()" or "update()" and NOT "save()" when working
+     * with the Table class.
+     */
+    public function change()
+    {
+        $table = $this->table('work_plan', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '计划表' ,'id' => 'id','signed' => true ,'primary_key' => ['id']]);
+        $table->addColumn('wind_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '风场id',])
+			->addColumn('fan_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '风机id',])
+			->addColumn('work_sign', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '工作位置',])
+			->addColumn('parts_sign', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '部件类型',])
+			->addColumn('boit_type_sign', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '螺栓型号',])
+			->addColumn('plan_name', 'string', ['limit' => 255,'null' => true,'signed' => true,'comment' => '计划名称',])
+			->addColumn('info', 'string', ['limit' => 255,'null' => true,'signed' => true,'comment' => '详情',])
+			->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => true,'signed' => true,'comment' => '状态  1 启用,-1 失效',])
+			->addColumn('creator_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建人ID',])
+			->addColumn('created_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '创建时间',])
+			->addColumn('updated_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '更新时间',])
+			->addColumn('deleted_at', 'integer', ['limit' => MysqlAdapter::INT_REGULAR,'null' => false,'default' => 0,'signed' => false,'comment' => '软删除',])
+            ->create();
+    }
+}

+ 39 - 0
catch/worklocation/model/Workplan.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace catchAdmin\worklocation\model;
+
+use catcher\base\CatchModel as Model;
+
+class Workplan extends Model
+{
+    // 表名
+    public $name = 'work_plan';
+    // 数据库字段映射
+    public $field = array(
+        'id',
+        // 风场id
+        'wind_id',
+        // 风机id
+        'fan_id',
+        // 工作位置
+        'work_sign',
+        // 部件类型
+        'parts_sign',
+        // 螺栓型号
+        'boit_type_sign',
+        // 计划名称
+        'plan_name',
+        // 详情
+        'info',
+        // 状态  1 启用,-1 失效
+        'status',
+        // 创建人ID
+        'creator_id',
+        // 创建时间
+        'created_at',
+        // 更新时间
+        'updated_at',
+        // 软删除
+        'deleted_at',
+    );
+}

+ 3 - 2
catch/worklocation/route.php

@@ -13,11 +13,12 @@
 $router->group(function () use ($router){
 	// workLocation路由
 	$router->resource('worklocation', '\catchAdmin\worklocation\controller\WorkLocation');
+		// workplan路由
+	 $router->resource('workplan', '\catchAdmin\worklocation\controller\workplan');
 })->middleware('auth');
 //维保记录统计图标
 $router->group('WorkLocationChart', function () use ($router){
     //维保记录 
     $router->get('total','\catchAdmin\worklocation\controller\WorkLocation@getTotal'); 
     
-})->middleware('auth');
-
+})->middleware('auth');