|
@@ -88,7 +88,7 @@ class JRFIDServerService extends Service
|
|
|
|
|
|
$rsaService = new RsaEncryptionService();
|
|
|
$dataToEncrypt = [
|
|
|
- 'id' => [$data['id']],
|
|
|
+ 'id' => $data['id'],
|
|
|
'type' => $data['type'],
|
|
|
];
|
|
|
$encryptedData = $rsaService->encrypt(json_encode($dataToEncrypt));
|
|
@@ -98,14 +98,60 @@ class JRFIDServerService extends Service
|
|
|
'body' => $encryptedData,
|
|
|
];
|
|
|
|
|
|
- list($status,$result) = $this->post_helper($url,json_encode($post),['Content-Type:application/json']);
|
|
|
+ list($status,$result) = $this->post_helper($url,json_encode($post),['Content-Type:application/json'],62);
|
|
|
if(! $status) return [false, $result];
|
|
|
|
|
|
if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
|
|
|
+ if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
|
|
|
+
|
|
|
+// $return = $this->clearPrintData($data, $result);
|
|
|
|
|
|
return [true, $result];
|
|
|
}
|
|
|
|
|
|
+ public function clearPrintData($data,$result){
|
|
|
+ //分页参数
|
|
|
+ $size = $data['size'] ?? 10;
|
|
|
+ $number = $data['number'] ?? 1;
|
|
|
+
|
|
|
+ if(empty($result['furn_pro_flow_dt_a'])) return [];
|
|
|
+ $furn_pro_flow_dt_a = $result['furn_pro_flow_dt_a'];
|
|
|
+
|
|
|
+ //排序
|
|
|
+ usort($furn_pro_flow_dt_a, function($a, $b) {
|
|
|
+ return $b['id'] - $a['id'];
|
|
|
+ });
|
|
|
+
|
|
|
+ //总数
|
|
|
+ $total = count($furn_pro_flow_dt_a);
|
|
|
+ // 计算总页数
|
|
|
+ $totalPages = ceil($total / $size);
|
|
|
+ // 确保请求的页码在有效范围内
|
|
|
+ $page = $number;
|
|
|
+ // 计算当前页的起始索引
|
|
|
+ $offset = ($page - 1) * $size;
|
|
|
+ //切片数据以获取当前页的数据
|
|
|
+ $currentPageData = array_slice($furn_pro_flow_dt_a, $offset, $size);
|
|
|
+
|
|
|
+ if(empty($currentPageData)) return [];
|
|
|
+ unset($result['furn_pro_flow_dt_a']);
|
|
|
+
|
|
|
+ foreach ($furn_pro_flow_dt_a as $key => $value){
|
|
|
+ foreach ($result['furn_pro_flow_dt_assem'] as $v1){
|
|
|
+ if($v1['main_table_id'] == $value['id']){
|
|
|
+ foreach ($result['furn_pro_flow_dt_comp'] as $v2){
|
|
|
+ if($v2['main_table_id'] == $v1['id']) {dd(22);
|
|
|
+ $v1['furn_pro_flow_dt_comp'][] = $v2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $furn_pro_flow_dt_a[$key]['furn_pro_flow_dt_assem'][] = $v1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dd($furn_pro_flow_dt_a, 1);
|
|
|
+ }
|
|
|
+
|
|
|
public function getTeam($data,$param){
|
|
|
if(empty($data['site'])) return [false, '站点不能为空'];
|
|
|
|
|
@@ -115,15 +161,54 @@ class JRFIDServerService extends Service
|
|
|
'field' => 'site',
|
|
|
'option' => 'LIKE_ANYWHERE',
|
|
|
'values' => [$data['site']]
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'field' => 'is_used',
|
|
|
+ 'option' => 'IN',
|
|
|
+ 'values' => ['1']
|
|
|
]
|
|
|
];
|
|
|
+ $post['size'] = $data['size'] ?? 6;
|
|
|
+ $post['number'] = ($data['number'] ?? 1) - 1;
|
|
|
|
|
|
list($status,$result) = $this->post_helper($url,json_encode($post),$param['header']);
|
|
|
if(! $status) return [false, $result];
|
|
|
|
|
|
if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
|
|
|
|
|
|
- return [true, $result['content'] ?? []];
|
|
|
+ return [true, $result];
|
|
|
+ }
|
|
|
+
|
|
|
+ public function completionOrders($data,$param){
|
|
|
+ if(empty($data['exe_pro_flow_dtl_sub_c'])) return [false, '数据不能为空'];
|
|
|
+
|
|
|
+ $url = config("j_rfid.completion_orders");
|
|
|
+ $post['data'] = [
|
|
|
+ 'exe_pro_flow_dtl_sub_c' => $data['exe_pro_flow_dtl_sub_c'],
|
|
|
+ ];
|
|
|
+
|
|
|
+ list($status,$result) = $this->post_helper($url,json_encode($post), $param['header']);
|
|
|
+ if(! $status) return [false, $result];
|
|
|
+
|
|
|
+ if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
|
|
|
+
|
|
|
+ return [true, $result];
|
|
|
+ }
|
|
|
+
|
|
|
+ public function qualityOrders($data,$param){
|
|
|
+ if(empty($data['exe_pro_flow_dtl_sub_c'])) return [false, '数据不能为空'];
|
|
|
+
|
|
|
+ $url = config("j_rfid.quality_orders");
|
|
|
+ $post['data'] = [
|
|
|
+ 'exe_pro_flow_dtl_sub_c' => $data['exe_pro_flow_dtl_sub_c'],
|
|
|
+ ];
|
|
|
+
|
|
|
+ list($status,$result) = $this->post_helper($url,json_encode($post), $param['header']);
|
|
|
+ if(! $status) return [false, $result];
|
|
|
+
|
|
|
+ if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
|
|
|
+
|
|
|
+ return [true, $result];
|
|
|
}
|
|
|
|
|
|
public function post_helper($url, $data, $header = [], $timeout = 20){
|