Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openApi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hj
openApi
Commits
ddb46597
Commit
ddb46597
authored
Nov 20, 2024
by
hj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新提交
parent
7553b9c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
54 deletions
+44
-54
server/app/Services/ThirdPlatform/Api/WuxiApiNewService.php
server/app/Services/ThirdPlatform/Api/WuxiApiNewService.php
+39
-6
server/app/Services/ThirdPlatform/WuxiLabNewService.php
server/app/Services/ThirdPlatform/WuxiLabNewService.php
+5
-48
No files found.
server/app/Services/ThirdPlatform/Api/WuxiApiNewService.php
View file @
ddb46597
...
@@ -44,19 +44,52 @@ class WuxiApiNewService extends PlatformAbstractService
...
@@ -44,19 +44,52 @@ class WuxiApiNewService extends PlatformAbstractService
* @param $token
* @param $token
* @return false|mixed|void
* @return false|mixed|void
*/
*/
public
function
pushBatchUpdatePackages
(
$
packages
,
$token
)
public
function
pushBatchUpdatePackages
(
$
updateData
,
$token
)
{
{
return
$this
->
postApi
(
'/api/v2/syncProductPackageStatus'
,
$packages
,
$token
);
$packageList
=
[];
foreach
(
$updateData
as
$packageCode
=>
$data
){
$tempData
=
[];
$tempData
[
'product_division'
]
=
'CHEMICAL'
;
$tempData
[
'productId'
]
=
$data
[
'r_code'
];
$tempData
[
'status'
]
=
$data
[
'p_status'
]
==
'1'
?
'ACTIVE'
:
'INACTIVE'
;
$tempData
[
'packageUnitDescription'
]
=
$packageCode
;
$packageList
[]
=
$tempData
;
}
return
$this
->
postApi
(
'/api/v2/syncProductPackageStatus'
,
$packageList
,
$token
);
}
}
public
function
pushBatchUpdatePrice
(
$
prices
,
$token
)
public
function
pushBatchUpdatePrice
(
$
updateData
,
$token
)
{
{
return
$this
->
postApi
(
'/api/v2/syncPackagePrice'
,
$prices
,
$token
);
$updateProductPrice
=
[];
foreach
(
$updateData
as
$product
){
$tempData
=
[];
$tempData
[
'product_division'
]
=
'CHEMICAL'
;
$tempData
[
'productId'
]
=
$product
[
'r_code'
];
$tempData
[
'packageUnitDescription'
]
=
$product
[
'p_code'
];
$tempData
[
'minPackageUnitDescription'
]
=
''
;
$tempData
[
'price'
]
=
bcmul
(
$product
[
'p_price'
],
0.5
,
2
);
$tempData
[
'discount'
]
=
'0.5'
;
$tempData
[
'inCostCurrency'
]
=
'RMB'
;
$tempData
[
'status'
]
=
$product
[
'p_status'
]
==
'1'
?
'ACTIVE'
:
'INACTIVE'
;;
$updateProductPrice
[]
=
$tempData
;
}
return
$this
->
postApi
(
'/api/v2/syncPackagePrice'
,
$updateProductPrice
,
$token
);
}
}
public
function
pushBatchUpdateStock
(
$
stock
,
$token
)
public
function
pushBatchUpdateStock
(
$
updateData
,
$token
)
{
{
return
$this
->
postApi
(
'/api/v2/syncRealTimeInventory'
,
$stock
,
$token
);
$updateProductStock
=
[];
foreach
(
$updateData
as
$product
){
$tempData
=
[];
$tempData
[
'product_division'
]
=
'CHEMICAL'
;
$tempData
[
'productId'
]
=
$product
[
'r_code'
];
$tempData
[
'packageUnitDescription'
]
=
$product
[
'p_code'
];
$tempData
[
'packageStockQuantity'
]
=
$product
[
'p_stock'
];
$tempData
[
'packageStockLocation'
]
=
'CN-SH'
;
$tempData
[
'stockStatus'
]
=
$product
[
'p_status'
]
==
'1'
?
'ACTIVE'
:
'INACTIVE'
;;
$updateProductStock
[]
=
$tempData
;
}
return
$this
->
postApi
(
'/api/v2/syncRealTimeInventory'
,
$updateProductStock
,
$token
);
}
}
/**
/**
...
...
server/app/Services/ThirdPlatform/WuxiLabNewService.php
View file @
ddb46597
...
@@ -178,47 +178,14 @@ class WuxiLabNewService
...
@@ -178,47 +178,14 @@ class WuxiLabNewService
return
false
;
return
false
;
}
}
try
{
try
{
$packageList
=
[];
$result
=
$this
->
apiService
->
pushBatchUpdatePackages
(
$updateData
[
'packageList'
],
$this
->
getToken
());
foreach
(
$updateData
[
'packageList'
]
as
$packageCode
=>
$data
){
$tempData
=
[];
$tempData
[
'product_division'
]
=
'CHEMICAL'
;
$tempData
[
'productId'
]
=
$data
[
'r_code'
];
$tempData
[
'status'
]
=
$data
[
'p_status'
]
==
'1'
?
'ACTIVE'
:
'INACTIVE'
;
$tempData
[
'packageUnitDescription'
]
=
$packageCode
;
$packageList
[]
=
$tempData
;
}
$result
=
$this
->
apiService
->
pushBatchUpdatePackages
(
$packageList
,
$this
->
getToken
());
$this
->
processApiResponse
(
$result
);
$this
->
processApiResponse
(
$result
);
$updateProductStock
=
[];
foreach
(
$updateData
[
'packageList'
]
as
$product
){
$result
=
$this
->
apiService
->
pushBatchUpdateStock
(
$updateData
[
'packageList'
],
$this
->
getToken
());
$tempData
=
[];
$tempData
[
'product_division'
]
=
'CHEMICAL'
;
$tempData
[
'productId'
]
=
$product
[
'r_code'
];
$tempData
[
'packageUnitDescription'
]
=
$product
[
'p_code'
];
$tempData
[
'packageStockQuantity'
]
=
$product
[
'p_stock'
];
$tempData
[
'packageStockLocation'
]
=
'CN-SH'
;
$tempData
[
'stockStatus'
]
=
$product
[
'p_status'
]
==
'1'
?
'ACTIVE'
:
'INACTIVE'
;;
$updateProductStock
[]
=
$tempData
;
}
$result
=
$this
->
apiService
->
pushBatchUpdateStock
(
$updateProductStock
,
$this
->
getToken
());
$this
->
processApiResponse
(
$result
);
$this
->
processApiResponse
(
$result
);
$updateProductPrice
=
[];
$result
=
$this
->
apiService
->
pushBatchUpdatePrice
(
$updateData
[
'packageList'
],
$this
->
getToken
());
foreach
(
$updateData
[
'packageList'
]
as
$product
){
$tempData
=
[];
$tempData
[
'product_division'
]
=
'CHEMICAL'
;
$tempData
[
'productId'
]
=
$product
[
'r_code'
];
$tempData
[
'packageUnitDescription'
]
=
$product
[
'p_code'
];
$tempData
[
'minPackageUnitDescription'
]
=
''
;
$tempData
[
'price'
]
=
bcmul
(
$product
[
'p_price'
],
0.5
,
2
);
$tempData
[
'discount'
]
=
'0.5'
;
$tempData
[
'inCostCurrency'
]
=
'RMB'
;
$tempData
[
'status'
]
=
$product
[
'p_status'
]
==
'1'
?
'ACTIVE'
:
'INACTIVE'
;;
$updateProductPrice
[]
=
$tempData
;
}
$result
=
$this
->
apiService
->
pushBatchUpdatePrice
(
$updateProductPrice
,
$this
->
getToken
());
$this
->
processApiResponse
(
$result
);
$this
->
processApiResponse
(
$result
);
}
catch
(
\Throwable
$exception
){
}
catch
(
\Throwable
$exception
){
...
@@ -232,17 +199,7 @@ class WuxiLabNewService
...
@@ -232,17 +199,7 @@ class WuxiLabNewService
return
false
;
return
false
;
}
}
try
{
try
{
$packageList
=
[];
$result
=
$this
->
apiService
->
pushBatchUpdatePackages
(
$updateData
[
'packageList'
],
$this
->
getToken
());
foreach
(
$updateData
[
'packageList'
]
as
$packageCode
=>
$data
){
$tempData
=
[];
$tempData
[
'product_division'
]
=
'CHEMICAL'
;
$tempData
[
'productId'
]
=
$data
[
'r_code'
];
$tempData
[
'status'
]
=
$data
[
'p_status'
]
==
'1'
?
'ACTIVE'
:
'INACTIVE'
;
$tempData
[
'packageUnitDescription'
]
=
$packageCode
;
$packageList
[]
=
$tempData
;
}
$result
=
$this
->
apiService
->
pushBatchUpdatePackages
(
$packageList
,
$this
->
getToken
());
$this
->
processApiResponse
(
$result
);
$this
->
processApiResponse
(
$result
);
}
catch
(
\Throwable
$exception
){
}
catch
(
\Throwable
$exception
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment