Commit 237c0daf by 杨树贤

数据处理和对应关系变更

parent 1d1157cf
...@@ -17,7 +17,7 @@ class SetSupplierFollowUp extends Command ...@@ -17,7 +17,7 @@ class SetSupplierFollowUp extends Command
* *
* @var string * @var string
*/ */
protected $signature = 'set_supplier_follow_up'; protected $signature = 'data_handle';
/** /**
* The console command description. * The console command description.
...@@ -36,6 +36,6 @@ class SetSupplierFollowUp extends Command ...@@ -36,6 +36,6 @@ class SetSupplierFollowUp extends Command
//DealImageService::dealNewsImage(); //DealImageService::dealNewsImage();
//DealImageService::dealNewsImage(); //DealImageService::dealNewsImage();
//DealImageService::dealSkuDetailAndImage(); //DealImageService::dealSkuDetailAndImage();
SupplierAccountService::initYunxinAccountName(); DataService::reInitSupplierCpTime();
} }
} }
...@@ -898,4 +898,21 @@ class DataService ...@@ -898,4 +898,21 @@ class DataService
{ {
SupplierChannelModel::where('supplier_code','L0005670')->update(['group_code' => 'G003815']); SupplierChannelModel::where('supplier_code','L0005670')->update(['group_code' => 'G003815']);
} }
//重新初始化供应商的有效时间
public static function reInitSupplierCpTime()
{
$supplierList = SupplierChannelModel::select([
'supplier_id',
'supplier_code'
])->get();
foreach ($supplierList as $supplier) {
$supplierId = $supplier->supplier_id;
$supplierCode = $supplier->supplier_code;
//重新初始化供应商的有效时间
(new SupplierService())->initialCpTimeDays($supplierId, $supplierCode);
\dump('重新初始化供应商有效时间:' . $supplierId . ' ' . $supplierCode);
}
}
} }
...@@ -502,15 +502,22 @@ class SupplierService ...@@ -502,15 +502,22 @@ class SupplierService
//初始化过期天数限制 //初始化过期天数限制
public function initialCpTimeDays($supplierId, $supplierGroup) public function initialCpTimeDays($supplierId, $supplierGroup)
{ {
$cpTimeDay = 7; // 根据供应商性质设置商品有效期
$futuresCpTimeDay = 365; // 原厂:现货180天,期货180天
// 非原厂:现货7天,期货30天
if ($supplierGroup == SupplierChannelModel::SUPPLIER_GROUP_ORIGINAL) { if ($supplierGroup == SupplierChannelModel::SUPPLIER_GROUP_ORIGINAL) {
$futuresCpTimeDay = $cpTimeDay = -1; $cpTimeDay = 180;
$futuresCpTimeDay = 180;
} else {
$cpTimeDay = 7;
$futuresCpTimeDay = 30;
} }
SupplierChannelModel::where('supplier_id', $supplierId)->update([ SupplierChannelModel::where('supplier_id', $supplierId)->update([
'cp_time_day' => $cpTimeDay, 'cp_time_day' => $cpTimeDay,
'futures_cp_time_day' => $futuresCpTimeDay, 'futures_cp_time_day' => $futuresCpTimeDay,
]); ]);
$redis = new RedisModel(); $redis = new RedisModel();
$ruler = $redis->hget('supplier_sku_upload_ruler_v2', $supplierId); $ruler = $redis->hget('supplier_sku_upload_ruler_v2', $supplierId);
if ($ruler) { if ($ruler) {
......
...@@ -96,7 +96,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function () ...@@ -96,7 +96,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
}); });
Route::match(['get', 'post'], '/test', function () { Route::match(['get', 'post'], '/test', function () {
DataService::updateGroupCode(); DataService::reInitSupplierCpTime();
// DataService::initSupplierReceiptNationId(); // DataService::initSupplierReceiptNationId();
// SupplierAccountService::initYunxinAccountName(); // SupplierAccountService::initYunxinAccountName();
// DataService::syncSupplierToErp(); // DataService::syncSupplierToErp();
......
...@@ -49,12 +49,12 @@ return [ ...@@ -49,12 +49,12 @@ return [
//所在区域对应的默认签约公司id //所在区域对应的默认签约公司id
'RegionSignComMap' => [ 'RegionSignComMap' => [
2 => 1,
3 => 1,
6 => 1,
4 => 116,
1 => 105, 1 => 105,
2 => 105, 5 => '',
3 => 105,
4 => 2,
6 => 105,
5 => 105,
], ],
//1 是否接口对接 //1 是否接口对接
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
use App\Http\Services\SupplierService;
use App\Model\SupplierChannelModel;
/** /**
* PHPExcel_Chart_DataSeries * PHPExcel_Chart_DataSeries
......
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