超管后台 - 添加项目新增分组
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace app\superadmin\controller\company;
|
namespace app\superadmin\controller\company;
|
||||||
|
|
||||||
|
use app\api\controller\DeviceController;
|
||||||
use app\common\model\Company as CompanyModel;
|
use app\common\model\Company as CompanyModel;
|
||||||
use app\common\model\User as UsersModel;
|
use app\common\model\User as UsersModel;
|
||||||
use app\superadmin\controller\BaseController;
|
use app\superadmin\controller\BaseController;
|
||||||
@@ -105,6 +106,23 @@ class CreateCompanyController extends BaseController
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备创建分组
|
||||||
|
*
|
||||||
|
* @param array $params
|
||||||
|
* @return void
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
protected function s2CreateDeviceGroup(array $params): void
|
||||||
|
{
|
||||||
|
$respon = (new DeviceController())->createGroup($params, true);
|
||||||
|
$respon = json_decode($respon, true);
|
||||||
|
|
||||||
|
if ($respon['code'] != 200) {
|
||||||
|
throw new \Exception('设备分组添加错误', 210 . $respon['code']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* S2 部分
|
* S2 部分
|
||||||
*
|
*
|
||||||
@@ -120,6 +138,9 @@ class CreateCompanyController extends BaseController
|
|||||||
throw new \Exception('S2返参异常', 210402);
|
throw new \Exception('S2返参异常', 210402);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设备创建分组
|
||||||
|
$this->s2CreateDeviceGroup(['groupName' => $params['name']]);
|
||||||
|
|
||||||
return array_merge($params, [
|
return array_merge($params, [
|
||||||
'companyId' => $department['departmentId'],
|
'companyId' => $department['departmentId'],
|
||||||
's2_accountId' => $department['id'],
|
's2_accountId' => $department['id'],
|
||||||
|
|||||||
Reference in New Issue
Block a user