Commit df1ecafe by 杨树贤

全量同步脚本

parent 5fbf44e3
<?php
namespace App\Console\Commands;
use App\Http\Services\DataService;
use App\Http\Services\StatisticsSkuUploadService;
use App\Http\Services\SupplierService;
use App\Http\Services\SyncSupplierService;
use App\Model\SupplierChannelModel;
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
//设置供应商是否需要跟进
class SyncAllSupplierToErp extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'sync_all_supplier_to_erp';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Display an inspiring quote';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$supplierIds = SupplierChannelModel::where('is_type',0)->get();
foreach ($supplierIds as $supplierId) {
(new SyncSupplierService())->syncSupplierToErp($supplierId);
}
}
}
......@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Services\LogService;
use App\Http\Services\SupplierAuditService;
use App\Http\Services\SyncSupplierService;
use App\Http\Transformers\LogTransformer;
use App\Http\Transformers\ReceiptTransformer;
use App\Http\Validators\ReceiptValidator;
......@@ -91,6 +92,7 @@ class SupplierReceiptApiController extends Controller
$content = !empty($receipt['receipt_id']) ? '修改银行信息' : '添加银行信息';
$remark = json_encode($receipt);
$logService->AddLog($receipt['supplier_id'], LogModel::UPDATE_OPERATE, '修改供应商基本资料', $content, $remark);
(new SyncSupplierService())->syncSupplierToErp($supplierId);
$this->response(0, '操作成功');
}
$this->response(-1, '操作失败');
......
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 sign in to comment