|
@@ -70,14 +70,31 @@ class AssetServerService extends Service
|
|
|
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 pdUpdate($data,$param){
|
|
|
+ if(! isset($data['tourism_inventory_a'])) return [false, '盘点单抬头数据不能为空'];
|
|
|
+ if(! isset($data['tourism_inventory_a']['id'])) return [false, '盘点单抬头数据ID不能为空'];
|
|
|
+ if(! isset($data['tourism_inventory_dtl_b'])) return [false, '盘点单明细数据不能为空'];
|
|
|
+
|
|
|
+ $url = config("asset.updatePd");
|
|
|
+
|
|
|
+ $post = [
|
|
|
+ 'tourism_inventory_a' => $data['tourism_inventory_a'],
|
|
|
+ 'tourism_inventory_dtl_b' => $data['tourism_inventory_dtl_b'],
|
|
|
+ ];
|
|
|
+
|
|
|
+ list($status,$result) = $this->post_helper($url,$post,$param['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']];
|
|
|
+
|
|
|
+
|
|
|
+ return [true, ''];
|
|
|
+ }
|
|
|
+
|
|
|
public function post_helper($url, $data, $header = [], $timeout = 20){
|
|
|
Log::channel('apiLog')->info('资产盘点POST', ["api" => $url , "param" => $data ,"header" => $header]);
|
|
|
|