|
@@ -915,7 +915,7 @@ class JRFIDServerService extends Service
|
|
$header = array_merge($param['header'], ['site:'. $data['site']]);
|
|
$header = array_merge($param['header'], ['site:'. $data['site']]);
|
|
$url = config("j_rfid.sendAndReceiptList");
|
|
$url = config("j_rfid.sendAndReceiptList");
|
|
|
|
|
|
- if(! empty($data['contract_no']) || ! empty($data['no'])) {
|
|
|
|
|
|
+ if(! empty($data['contract_no']) || ! empty($data['no']) || ! empty($data['drawing_no'])) {
|
|
$rules = [];
|
|
$rules = [];
|
|
if(! empty($data['contract_no'])) {
|
|
if(! empty($data['contract_no'])) {
|
|
$rules[] = [
|
|
$rules[] = [
|
|
@@ -931,6 +931,13 @@ class JRFIDServerService extends Service
|
|
'values' => $data['no']
|
|
'values' => $data['no']
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+ if(! empty($data['drawing_no'])) {
|
|
|
|
+ $rules[] = [
|
|
|
|
+ 'field' => 'drawing_no',
|
|
|
|
+ 'option' => 'IN',
|
|
|
|
+ 'values' => $data['drawing_no']
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
$post['rules'] = $rules;
|
|
$post['rules'] = $rules;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -999,6 +1006,47 @@ class JRFIDServerService extends Service
|
|
return [true, $result];
|
|
return [true, $result];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function packageList($data,$param){
|
|
|
|
+ if(empty($data['site'])) return [false, '站点不能为空'];
|
|
|
|
+ $header = array_merge($param['header'], ['site:'. $data['site']]);
|
|
|
|
+ $url = config("j_rfid.packageList");
|
|
|
|
+
|
|
|
|
+ if(! empty($data['drawing_no']) || ! empty($data['contract_no'])) {
|
|
|
|
+ $rules = [];
|
|
|
|
+ if(! empty($data['drawing_no'])) {
|
|
|
|
+ $rules[] = [
|
|
|
|
+ 'field' => 'drawing_no',
|
|
|
|
+ 'option' => 'IN',
|
|
|
|
+ 'values' => $data['drawing_no']
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ if(! empty($data['contract_no'])) {
|
|
|
|
+ $rules[] = [
|
|
|
|
+ 'field' => 'contract_no',
|
|
|
|
+ 'option' => 'IN',
|
|
|
|
+ 'values' => $data['contract_no']
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ $post['rules'] = $rules;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $post['size'] = $data['size'] ?? 10;
|
|
|
|
+ $post['number'] = ($data['number'] ?? 1) - 1;
|
|
|
|
+
|
|
|
|
+ list($status,$result) = $this->post_helper($url,$post,$header);
|
|
|
|
+ if(! $status) return [$status, $result];
|
|
|
|
+
|
|
|
|
+ if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
|
|
|
|
+ if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
|
|
|
|
+
|
|
|
|
+ if(! isset($result['content'])) {
|
|
|
|
+ $error = $result[0]['message'] ?? "操作失败,请刷新页面";
|
|
|
|
+ return [false, $error];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return [true, $result];
|
|
|
|
+ }
|
|
|
|
+
|
|
public function post_helper($url, $data, $header = [], $timeout = 20){
|
|
public function post_helper($url, $data, $header = [], $timeout = 20){
|
|
Log::channel('apiLog')->info('工装云POST', ["api" => $url , "param" => $data ,"header" => $header]);
|
|
Log::channel('apiLog')->info('工装云POST', ["api" => $url , "param" => $data ,"header" => $header]);
|
|
|
|
|