|
|
|
1
|
+<?php
|
|
|
|
2
|
+/**
|
|
|
|
3
|
+ * @remark :
|
|
|
|
4
|
+ * @name :SuppliersController.php
|
|
|
|
5
|
+ * @author :lyh
|
|
|
|
6
|
+ * @method :post
|
|
|
|
7
|
+ * @time :2024/3/7 9:23
|
|
|
|
8
|
+ */
|
|
|
|
9
|
+
|
|
|
|
10
|
+namespace App\Http\Controllers\Bside\Suppliers;
|
|
|
|
11
|
+
|
|
|
|
12
|
+use App\Enums\Common\Code;
|
|
|
|
13
|
+use App\Http\Controllers\Bside\BaseController;
|
|
|
|
14
|
+use App\Models\Com\Purchaser;
|
|
|
|
15
|
+
|
|
|
|
16
|
+/**
|
|
|
|
17
|
+ * @remark :推荐采购商
|
|
|
|
18
|
+ * @name :SuppliersController
|
|
|
|
19
|
+ * @author :lyh
|
|
|
|
20
|
+ * @method :post
|
|
|
|
21
|
+ * @time :2024/3/7 9:23
|
|
|
|
22
|
+ */
|
|
|
|
23
|
+class SuppliersController extends BaseController
|
|
|
|
24
|
+{
|
|
|
|
25
|
+ public $domain = 'https://admin.hagro.cn/';
|
|
|
|
26
|
+
|
|
|
|
27
|
+ /**
|
|
|
|
28
|
+ * @remark :推荐采购商
|
|
|
|
29
|
+ * @name :recommendedPurchaser
|
|
|
|
30
|
+ * @author :lyh
|
|
|
|
31
|
+ * @method :post
|
|
|
|
32
|
+ * @time :2024/3/4 10:10
|
|
|
|
33
|
+ */
|
|
|
|
34
|
+ public function recommendedPurchaser(){
|
|
|
|
35
|
+ $purchaserModel = new Purchaser();
|
|
|
|
36
|
+ $data = [];
|
|
|
|
37
|
+ $lists = $purchaserModel->list(['project_id'=>$this->user['project_id']]);
|
|
|
|
38
|
+ if(!empty($lists)){
|
|
|
|
39
|
+ foreach ($lists as $v){
|
|
|
|
40
|
+ $resultData = json_decode($v['data']);
|
|
|
|
41
|
+ foreach ($resultData as $value){
|
|
|
|
42
|
+ $data[] = $value;
|
|
|
|
43
|
+ }
|
|
|
|
44
|
+ }
|
|
|
|
45
|
+ }
|
|
|
|
46
|
+ $this->response('success',Code::SUCCESS,$data);
|
|
|
|
47
|
+ }
|
|
|
|
48
|
+
|
|
|
|
49
|
+ /**
|
|
|
|
50
|
+ * @remark :请求黑格公共方法
|
|
|
|
51
|
+ * @name :_action
|
|
|
|
52
|
+ * @author :lyh
|
|
|
|
53
|
+ * @method :post
|
|
|
|
54
|
+ * @time :2024/3/7 9:30
|
|
|
|
55
|
+ */
|
|
|
|
56
|
+ public function _action($api_url,$action_name,$param){
|
|
|
|
57
|
+ $url = $this->domain.$api_url;
|
|
|
|
58
|
+ ksort($param);
|
|
|
|
59
|
+ $token = $action_name. '+' .date('Y-m-d'). '+' .http_build_query($param);
|
|
|
|
60
|
+ $param['token'] = md5($token);
|
|
|
|
61
|
+ $res = http_post($url,json_encode($param));
|
|
|
|
62
|
+ return $this->success($res);
|
|
|
|
63
|
+ }
|
|
|
|
64
|
+ /**
|
|
|
|
65
|
+ * @remark :按名字搜索公司
|
|
|
|
66
|
+ * @name :company_domain
|
|
|
|
67
|
+ * @author :lyh
|
|
|
|
68
|
+ * @method :post
|
|
|
|
69
|
+ * @time :2024/3/7 9:27
|
|
|
|
70
|
+ */
|
|
|
|
71
|
+ public function company_domain(){
|
|
|
|
72
|
+ $api_url = 'api/company_domain';
|
|
|
|
73
|
+ $action_name = 'company_domain';
|
|
|
|
74
|
+ $param = [
|
|
|
|
75
|
+ 'search'=>$this->param['search'],
|
|
|
|
76
|
+ ];
|
|
|
|
77
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
78
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
79
|
+ }
|
|
|
|
80
|
+
|
|
|
|
81
|
+ /**
|
|
|
|
82
|
+ * @remark :通过域名获取公司信息
|
|
|
|
83
|
+ * @name :company_detail
|
|
|
|
84
|
+ * @author :lyh
|
|
|
|
85
|
+ * @method :post
|
|
|
|
86
|
+ * @time :2024/3/7 9:46
|
|
|
|
87
|
+ */
|
|
|
|
88
|
+ public function company_detail(){
|
|
|
|
89
|
+ $api_url = 'api/company_detail';
|
|
|
|
90
|
+ $action_name = 'company_detail';
|
|
|
|
91
|
+ $param = [
|
|
|
|
92
|
+ 'domain'=>$this->param['domain'],
|
|
|
|
93
|
+ ];
|
|
|
|
94
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
95
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
96
|
+ }
|
|
|
|
97
|
+
|
|
|
|
98
|
+ /**
|
|
|
|
99
|
+ * @remark :领英决策人员
|
|
|
|
100
|
+ * @name :company_linked
|
|
|
|
101
|
+ * @author :lyh
|
|
|
|
102
|
+ * @method :post
|
|
|
|
103
|
+ * @time :2024/3/7 9:48
|
|
|
|
104
|
+ */
|
|
|
|
105
|
+ public function company_linked(){
|
|
|
|
106
|
+ $api_url = 'api/company_linked';
|
|
|
|
107
|
+ $action_name = 'company_linked';
|
|
|
|
108
|
+ $param = [
|
|
|
|
109
|
+ 'domain'=>$this->param['domain'],
|
|
|
|
110
|
+ 'keyword'=>$this->param['keyword'],
|
|
|
|
111
|
+ 'position'=>$this->param['position'],
|
|
|
|
112
|
+ 'page'=>$this->page,
|
|
|
|
113
|
+ 'page_size'=>$this->row,
|
|
|
|
114
|
+ ];
|
|
|
|
115
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
116
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
117
|
+ }
|
|
|
|
118
|
+
|
|
|
|
119
|
+ /**
|
|
|
|
120
|
+ * @remark :海关数据信息
|
|
|
|
121
|
+ * @name :trade_trend
|
|
|
|
122
|
+ * @author :lyh
|
|
|
|
123
|
+ * @method :post
|
|
|
|
124
|
+ * @time :2024/3/7 9:51
|
|
|
|
125
|
+ */
|
|
|
|
126
|
+ public function trade_trend(){
|
|
|
|
127
|
+ $api_url = 'api/trade_trend';
|
|
|
|
128
|
+ $action_name = 'trade_trend';
|
|
|
|
129
|
+ $param = [
|
|
|
|
130
|
+ 'prod_desc'=>$this->param['prod_desc'],
|
|
|
|
131
|
+ ];
|
|
|
|
132
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
133
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
134
|
+ }
|
|
|
|
135
|
+
|
|
|
|
136
|
+ /**
|
|
|
|
137
|
+ * @remark :供应商区域分布
|
|
|
|
138
|
+ * @name :supplier_area
|
|
|
|
139
|
+ * @author :lyh
|
|
|
|
140
|
+ * @method :post
|
|
|
|
141
|
+ * @time :2024/3/7 9:52
|
|
|
|
142
|
+ */
|
|
|
|
143
|
+ public function supplier_area(){
|
|
|
|
144
|
+ $api_url = 'api/supplier_area';
|
|
|
|
145
|
+ $action_name = 'supplier_area';
|
|
|
|
146
|
+ $param = [
|
|
|
|
147
|
+ 'prod_desc'=>$this->param['prod_desc'],
|
|
|
|
148
|
+ 'start_date'=>$this->param['start_date'],
|
|
|
|
149
|
+ 'end_date'=>$this->param['end_date'],
|
|
|
|
150
|
+ ];
|
|
|
|
151
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
152
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
153
|
+ }
|
|
|
|
154
|
+
|
|
|
|
155
|
+ /**
|
|
|
|
156
|
+ * @remark :贸易伙伴
|
|
|
|
157
|
+ * @name :trade_partner
|
|
|
|
158
|
+ * @author :lyh
|
|
|
|
159
|
+ * @method :post
|
|
|
|
160
|
+ * @time :2024/3/7 9:54
|
|
|
|
161
|
+ */
|
|
|
|
162
|
+ public function trade_partner(){
|
|
|
|
163
|
+ $api_url = 'api/trade_partner';
|
|
|
|
164
|
+ $action_name = 'trade_partner';
|
|
|
|
165
|
+ $param = [
|
|
|
|
166
|
+ 'com_id'=>$this->param['com_id'],
|
|
|
|
167
|
+ 'com_role'=>$this->param['com_role'],
|
|
|
|
168
|
+ ];
|
|
|
|
169
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
170
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
171
|
+ }
|
|
|
|
172
|
+
|
|
|
|
173
|
+ /**
|
|
|
|
174
|
+ * @remark :贸易明细
|
|
|
|
175
|
+ * @name :trade_detail
|
|
|
|
176
|
+ * @author :lyh
|
|
|
|
177
|
+ * @method :post
|
|
|
|
178
|
+ * @time :2024/3/7 9:55
|
|
|
|
179
|
+ */
|
|
|
|
180
|
+ public function trade_detail(){
|
|
|
|
181
|
+ $api_url = 'api/trade_detail';
|
|
|
|
182
|
+ $action_name = 'trade_detail';
|
|
|
|
183
|
+ $param = [
|
|
|
|
184
|
+ 'prod_desc'=>$this->param['prod_desc'],
|
|
|
|
185
|
+ ];
|
|
|
|
186
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
187
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
188
|
+ }
|
|
|
|
189
|
+
|
|
|
|
190
|
+ /**
|
|
|
|
191
|
+ * @remark :提单详情
|
|
|
|
192
|
+ * @name :bill_detail
|
|
|
|
193
|
+ * @author :lyh
|
|
|
|
194
|
+ * @method :post
|
|
|
|
195
|
+ * @time :2024/3/7 9:56
|
|
|
|
196
|
+ */
|
|
|
|
197
|
+ public function bill_detail(){
|
|
|
|
198
|
+ $api_url = 'api/bill_detail';
|
|
|
|
199
|
+ $action_name = 'bill_detail';
|
|
|
|
200
|
+ $param = [
|
|
|
|
201
|
+ 'prod_desc'=>$this->param['prod_desc'],
|
|
|
|
202
|
+ 'page'=>$this->page,
|
|
|
|
203
|
+ 'page_size'=>$this->row,
|
|
|
|
204
|
+ ];
|
|
|
|
205
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
206
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
207
|
+ }
|
|
|
|
208
|
+
|
|
|
|
209
|
+ /**
|
|
|
|
210
|
+ * @remark :进口产品信息
|
|
|
|
211
|
+ * @name :import_product
|
|
|
|
212
|
+ * @author :lyh
|
|
|
|
213
|
+ * @method :post
|
|
|
|
214
|
+ * @time :2024/3/7 9:59
|
|
|
|
215
|
+ */
|
|
|
|
216
|
+ public function import_product(){
|
|
|
|
217
|
+ $api_url = 'api/import_product';
|
|
|
|
218
|
+ $action_name = 'import_product';
|
|
|
|
219
|
+ $param = [
|
|
|
|
220
|
+ 'com_id'=>$this->param['com_id'],
|
|
|
|
221
|
+ 'com_role'=>$this->param['com_role'],
|
|
|
|
222
|
+ ];
|
|
|
|
223
|
+ $res = $this->_action($api_url,$action_name,$param);
|
|
|
|
224
|
+ $this->response('success',Code::SUCCESS,$res);
|
|
|
|
225
|
+ }
|
|
|
|
226
|
+} |