Commit c442f56d authored by hangjun83's avatar hangjun83

乐妍

parent 41c1bc5d
......@@ -60,6 +60,9 @@ class LeyanJobCommand extends Command
$service = app(LeyanService::class);
switch($action_type){
case 'batchUpdateProduct' :
$service->batchUpdateProducts($params);
break;
case 'updateProductByCas' :
default:
$service->updateProductByCas($params);
......
......@@ -45,6 +45,6 @@ class BhuaProductService
public function getProductCasByBidToGroupByCas($bId)
{
$this->productRepository->getProductCasByBidToGroupByCas($bId);
return $this->productRepository->getProductCasByBidToGroupByCas($bId);
}
}
......@@ -33,12 +33,12 @@ class LeyanApiService extends PlatformAbstractService
* @param $product
* @return bool
*/
public function pushUpdateProductByCas($product,$token)
public function pushUpdateProductByCas($cas,$token)
{
try{
if($this->checkPlatformStatus()){
$params = [];
$params['casNo'] = $this->mergeApiMetaData($product);
$params['casNo'] = $cas;
$uri = $this->platformInfo['platform_url'].'/ProductDate/findProductDataPoolByCatalogNoOrCas';
$response = $this->getPostClient($uri,$params,null,[
......
......@@ -27,11 +27,22 @@ class LeyanService
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)
{
if(!$params['cas']) return null;
$result = $this->apiService->pushUpdateProductByCas($params,$this->getToken());
if(!$result){
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