|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :SuppliersController.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:23
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Bside\Suppliers;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Http\Controllers\Bside\BaseController;
|
|
|
|
use App\Models\Com\Purchaser;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :推荐采购商
|
|
|
|
* @name :SuppliersController
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:23
|
|
|
|
*/
|
|
|
|
class SuppliersController extends BaseController
|
|
|
|
{
|
|
|
|
public $domain = 'https://admin.hagro.cn/';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :推荐采购商
|
|
|
|
* @name :recommendedPurchaser
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/4 10:10
|
|
|
|
*/
|
|
|
|
public function recommendedPurchaser(){
|
|
|
|
$purchaserModel = new Purchaser();
|
|
|
|
$data = [];
|
|
|
|
$lists = $purchaserModel->list(['project_id'=>$this->user['project_id']]);
|
|
|
|
if(!empty($lists)){
|
|
|
|
foreach ($lists as $v){
|
|
|
|
$resultData = json_decode($v['data']);
|
|
|
|
foreach ($resultData as $value){
|
|
|
|
$data[] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :请求黑格公共方法
|
|
|
|
* @name :_action
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:30
|
|
|
|
*/
|
|
|
|
public function _action($api_url,$action_name,$param){
|
|
|
|
$url = $this->domain.$api_url;
|
|
|
|
ksort($param);
|
|
|
|
$token = $action_name. '+' .date('Y-m-d'). '+' .http_build_query($param);
|
|
|
|
$param['token'] = md5($token);
|
|
|
|
$res = http_post($url,json_encode($param));
|
|
|
|
if($res['code'] != 200){
|
|
|
|
$this->response($res['message'],Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
return $this->success($res['data']);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :按名字搜索公司
|
|
|
|
* @name :company_domain
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:27
|
|
|
|
*/
|
|
|
|
public function company_domain(){
|
|
|
|
$api_url = 'api/company_domain';
|
|
|
|
$action_name = 'company_domain';
|
|
|
|
$param = [
|
|
|
|
'search'=>$this->param['search'],
|
|
|
|
];
|
|
|
|
$res = $this->_action($api_url,$action_name,$param ?? []);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :通过域名获取公司信息
|
|
|
|
* @name :company_detail
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:46
|
|
|
|
*/
|
|
|
|
public function company_detail(){
|
|
|
|
$api_url = 'api/company_detail';
|
|
|
|
$action_name = 'company_detail';
|
|
|
|
$param = [
|
|
|
|
'domain'=>$this->param['domain'],
|
|
|
|
];
|
|
|
|
$res = $this->_action($api_url,$action_name,$param);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :领英决策人员
|
|
|
|
* @name :company_linked
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:48
|
|
|
|
*/
|
|
|
|
public function company_linked(){
|
|
|
|
$api_url = 'api/company_linked';
|
|
|
|
$action_name = 'company_linked';
|
|
|
|
$param = [
|
|
|
|
'domain'=>$this->param['domain'],
|
|
|
|
'page'=>$this->page,
|
|
|
|
'page_size'=>$this->row,
|
|
|
|
];
|
|
|
|
if(isset($this->param['keyword'])){
|
|
|
|
$param['keyword'] = $this->param['keyword'];
|
|
|
|
}
|
|
|
|
if(isset($this->param['position'])){
|
|
|
|
$param['position'] = $this->param['position'];
|
|
|
|
}
|
|
|
|
$res = $this->_action($api_url,$action_name,$param);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :海关数据信息
|
|
|
|
* @name :trade_trend
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:51
|
|
|
|
*/
|
|
|
|
public function trade_trend(){
|
|
|
|
$api_url = 'api/trade_trend';
|
|
|
|
$action_name = 'trade_trend';
|
|
|
|
$param = [
|
|
|
|
'prod_desc'=>$this->param['prod_desc'] ?? '',
|
|
|
|
];
|
|
|
|
$res = $this->_action($api_url,$action_name,$param);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :供应商区域分布
|
|
|
|
* @name :supplier_area
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:52
|
|
|
|
*/
|
|
|
|
public function supplier_area(){
|
|
|
|
$api_url = 'api/supplier_area';
|
|
|
|
$action_name = 'supplier_area';
|
|
|
|
$param = [
|
|
|
|
'prod_desc'=>$this->param['prod_desc'] ?? '',
|
|
|
|
'start_date'=>$this->param['start_date'] ?? '',
|
|
|
|
'end_date'=>$this->param['end_date'] ?? '',
|
|
|
|
];
|
|
|
|
$res = $this->_action($api_url,$action_name,$param);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :贸易伙伴
|
|
|
|
* @name :trade_partner
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:54
|
|
|
|
*/
|
|
|
|
public function trade_partner(){
|
|
|
|
$api_url = 'api/trade_partner';
|
|
|
|
$action_name = 'trade_partner';
|
|
|
|
$param = [
|
|
|
|
'com_id'=>$this->param['com_id'] ?? '',
|
|
|
|
'com_role'=>$this->param['com_role'] ?? '',
|
|
|
|
];
|
|
|
|
$res = $this->_action($api_url,$action_name,$param);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :贸易明细
|
|
|
|
* @name :trade_detail
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:55
|
|
|
|
*/
|
|
|
|
public function trade_detail(){
|
|
|
|
$api_url = 'api/trade_detail';
|
|
|
|
$action_name = 'trade_detail';
|
|
|
|
$param = [
|
|
|
|
'prod_desc'=>$this->param['prod_desc'] ?? '',
|
|
|
|
];
|
|
|
|
$res = $this->_action($api_url,$action_name,$param);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :提单详情
|
|
|
|
* @name :bill_detail
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:56
|
|
|
|
*/
|
|
|
|
public function bill_detail(){
|
|
|
|
$api_url = 'api/bill_detail';
|
|
|
|
$action_name = 'bill_detail';
|
|
|
|
$param = [
|
|
|
|
'prod_desc'=>$this->param['prod_desc'] ?? '',
|
|
|
|
'page'=>$this->page,
|
|
|
|
'page_size'=>$this->row,
|
|
|
|
];
|
|
|
|
$res = $this->_action($api_url,$action_name,$param);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :进口产品信息
|
|
|
|
* @name :import_product
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/3/7 9:59
|
|
|
|
*/
|
|
|
|
public function import_product(){
|
|
|
|
$api_url = 'api/import_product';
|
|
|
|
$action_name = 'import_product';
|
|
|
|
$param = [
|
|
|
|
'com_id'=>$this->param['com_id'] ?? '',
|
|
|
|
'com_role'=>$this->param['com_role'] ?? '',
|
|
|
|
];
|
|
|
|
$res = $this->_action($api_url,$action_name,$param);
|
|
|
|
$this->response('success',Code::SUCCESS,$res);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|