Commit c442f56d authored by hangjun83's avatar hangjun83

乐妍

parent 41c1bc5d
...@@ -60,6 +60,9 @@ class LeyanJobCommand extends Command ...@@ -60,6 +60,9 @@ class LeyanJobCommand extends Command
$service = app(LeyanService::class); $service = app(LeyanService::class);
switch($action_type){ switch($action_type){
case 'batchUpdateProduct' :
$service->batchUpdateProducts($params);
break;
case 'updateProductByCas' : case 'updateProductByCas' :
default: default:
$service->updateProductByCas($params); $service->updateProductByCas($params);
......
...@@ -45,6 +45,6 @@ class BhuaProductService ...@@ -45,6 +45,6 @@ class BhuaProductService
public function getProductCasByBidToGroupByCas($bId) public function getProductCasByBidToGroupByCas($bId)
{ {
$this->productRepository->getProductCasByBidToGroupByCas($bId); return $this->productRepository->getProductCasByBidToGroupByCas($bId);
} }
} }
...@@ -33,12 +33,12 @@ class LeyanApiService extends PlatformAbstractService ...@@ -33,12 +33,12 @@ class LeyanApiService extends PlatformAbstractService
* @param $product * @param $product
* @return bool * @return bool
*/ */
public function pushUpdateProductByCas($product,$token) public function pushUpdateProductByCas($cas,$token)
{ {
try{ try{
if($this->checkPlatformStatus()){ if($this->checkPlatformStatus()){
$params = []; $params = [];
$params['casNo'] = $this->mergeApiMetaData($product); $params['casNo'] = $cas;
$uri = $this->platformInfo['platform_url'].'/ProductDate/findProductDataPoolByCatalogNoOrCas'; $uri = $this->platformInfo['platform_url'].'/ProductDate/findProductDataPoolByCatalogNoOrCas';
$response = $this->getPostClient($uri,$params,null,[ $response = $this->getPostClient($uri,$params,null,[
......
...@@ -27,11 +27,22 @@ class LeyanService ...@@ -27,11 +27,22 @@ class LeyanService
public function batchUpdateProducts($params = null) public function batchUpdateProducts($params = null)
{ {
app(BhuaProductService::class)->getProductCasByBidToGroupByCas(108); ini_set('memory_limit','3072M');
$casList = app(BhuaProductService::class)->getProductCasByBidToGroupByCas($params);
if($casList){
foreach($casList as $cas){
$this->apiService->pushQueue([
'params' => ['cas' => $cas],
'consumer' => __CLASS__,
'method' => 'updateProductByCas'
],'leyan');
}
}
} }
public function updateProductByCas($params) public function updateProductByCas($params)
{ {
if(!$params['cas']) return null;
$result = $this->apiService->pushUpdateProductByCas($params,$this->getToken()); $result = $this->apiService->pushUpdateProductByCas($params,$this->getToken());
if(!$result){ if(!$result){
return null; return null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment