|
|
@@ -401,7 +401,7 @@ Class CommodityService
|
|
|
$create_key = config('sync.commodity_sync.cache_prefix.create');
|
|
|
/** @var OracleBasSkuService $oracleBasSkuService */
|
|
|
$oracleBasSkuService = app(OracleBasSkuService::class);
|
|
|
- $last_time = $this->getAsnLastSyncAt($created_at, 'create');
|
|
|
+ $last_time = $this->getCommodityLastSyncAt($created_at, 'create');
|
|
|
$basSkus = $oracleBasSkuService->getWmsCreatedCommodities($last_time);
|
|
|
$last_time = $basSkus->first()['addtime'];
|
|
|
$last_records = $basSkus->where('addtime', $last_time);
|
|
|
@@ -409,7 +409,7 @@ Class CommodityService
|
|
|
$this->syncCreateCommodity($basSkus);
|
|
|
$this->deleteCacheKey($create_set, $create_keys);
|
|
|
$this->setLastRecordsByRedis($create_key, $create_set, $create_keys, $last_records);
|
|
|
- $this->setAsnLastSyncAt($created_at, $last_time);
|
|
|
+ $this->setCommodityLastSyncAt($created_at, $last_time);
|
|
|
}
|
|
|
|
|
|
public function syncCommodityUpdated()
|
|
|
@@ -420,7 +420,7 @@ Class CommodityService
|
|
|
$update_key = config('sync.commodity_sync.cache_prefix.update');
|
|
|
/** @var OracleBasSkuService $oracleBasSkuService */
|
|
|
$oracleBasSkuService = app(OracleBasSkuService::class);
|
|
|
- $last_time = $this->getAsnLastSyncAt($updated_at, 'update');
|
|
|
+ $last_time = $this->getCommodityLastSyncAt($updated_at, 'update');
|
|
|
$basSkus = $oracleBasSkuService->getWmsUpdatedCommodities($last_time);
|
|
|
$last_time = $basSkus->first()['edittime'];
|
|
|
$last_records = $basSkus->where('edittime', $last_time);
|
|
|
@@ -428,7 +428,7 @@ Class CommodityService
|
|
|
$this->syncUpdateCommodity($basSkus);
|
|
|
$this->deleteCacheKey($update_set, $update_keys);
|
|
|
$this->setLastRecordsByRedis($update_key, $update_set, $update_keys, $last_records);
|
|
|
- $this->setAsnLastSyncAt($updated_at, $last_time);
|
|
|
+ $this->setCommodityLastSyncAt($updated_at, $last_time);
|
|
|
}
|
|
|
|
|
|
public function syncCreateCommodity($addBasSkus)
|
|
|
@@ -658,7 +658,7 @@ Class CommodityService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function getAsnLastSyncAt($key, $type)
|
|
|
+ public function getCommodityLastSyncAt($key, $type)
|
|
|
{
|
|
|
$last_time = ValueStore::query()->where('name', $key)->value('value');
|
|
|
if ($last_time) return $last_time;
|
|
|
@@ -672,7 +672,7 @@ Class CommodityService
|
|
|
return Carbon::now()->subSeconds(65);
|
|
|
}
|
|
|
|
|
|
- public function setAsnLastSyncAt($key, $last_time)
|
|
|
+ public function setCommodityLastSyncAt($key, $last_time)
|
|
|
{
|
|
|
$asnLastSyncAt = ValueStore::query()->updateOrCreate([
|
|
|
'name' => $key,
|