|
@@ -13,6 +13,13 @@ use think\facade\Db;
|
|
|
|
|
|
class CopySupplier extends Command
|
|
|
{
|
|
|
+ private $_delaway=["供应商发货","公司自提"];
|
|
|
+ private $_applyway=["正式供应商","临时供应商"];
|
|
|
+ private $_source=["客户提供","供应商","公司开发"];
|
|
|
+ private $_cat=["生产厂家","代理商","经销商","分销商","电商平台"];
|
|
|
+ private $_level=["生产厂家","一级代理","二级代理"];
|
|
|
+ private $_payway=["现结","月清","双月请"];
|
|
|
+ private $_catpay=["个人独私企业","合伙企业","有限责任公司","供应商","股份有限责任公司","有限责任公司(自然人独资)","有限责任公司(自然人独资或控股)","村级集体经济组织","股份有限公司"];
|
|
|
protected function configure()
|
|
|
{
|
|
|
// 指令配置
|
|
@@ -24,6 +31,7 @@ class CopySupplier extends Command
|
|
|
{
|
|
|
$supplier= Cache::store("redis")->handler()->rpop("companycopy");
|
|
|
if($supplier==false) return;
|
|
|
+ $supplier =json_decode($supplier,true);
|
|
|
if($supplier['type']==1){
|
|
|
$this->checkcompany($supplier);
|
|
|
}
|
|
@@ -104,31 +112,32 @@ class CopySupplier extends Command
|
|
|
}
|
|
|
|
|
|
private function checkSupplier($supplier){
|
|
|
- $comp= Db::name("supplier_info")->where(["companyNo"=>$supplier["companyNo"],"is_del"=>0])->findOrEmpty();
|
|
|
+ $comp= Db::name("supplier_info")->where(["code"=>$supplier["code"]])->findOrEmpty();
|
|
|
+ var_dump($supplier);
|
|
|
if(empty($comp)){
|
|
|
$data= [
|
|
|
'name' => $supplier['name'],
|
|
|
'code' => $supplier['code'],
|
|
|
- 'source' => $supplier['source'],
|
|
|
+ 'source' => $this->_source[$supplier['source']]??$this->_source[0],
|
|
|
'contector' => $supplier['contactor'],
|
|
|
'post' => $supplier['position'],
|
|
|
- 'type' => $supplier['type'],
|
|
|
- 'nature' => $supplier['supplier_type'],
|
|
|
+ 'type' => 1,
|
|
|
+ 'nature' => $supplier['nature'],
|
|
|
'corporation' => $supplier['legaler'],
|
|
|
'registertime' => $supplier['registertime'],
|
|
|
- 'capital' => $supplier['capital'],
|
|
|
- 'supplier_type' => $supplier['supplier_type'],
|
|
|
- 'pay_method' => $supplier['pay_type'],
|
|
|
+ 'capital' => $supplier['capital']??"",
|
|
|
+ 'supplier_type' => $this->_cat[$supplier['supplier_type']]??"",
|
|
|
+ 'pay_method' => $this->_payway[$supplier['pay_type']],
|
|
|
'paydays' => $supplier['pay_day'],
|
|
|
'mobile' => $supplier['mobile'],
|
|
|
'address' => $supplier['addr'],
|
|
|
'return_ticket' => $supplier['ticket_type'],
|
|
|
- 'delivery' => $supplier['delivery_way'],
|
|
|
+ 'delivery' => $this->_delaway[$supplier['delivery_way']]??"",
|
|
|
'status' => $supplier['status'],
|
|
|
'addtime' => $supplier['addtime'],
|
|
|
'updatetime' => $supplier['updatetime'],
|
|
|
'registercode' => $supplier['registercode'],
|
|
|
- 'level' => $supplier['level'],
|
|
|
+ 'level' => $this->_level[$supplier['level']]??"",
|
|
|
'product_category' => $supplier['product_category'],
|
|
|
'license_img' => $supplier['license_img']
|
|
|
|
|
@@ -136,29 +145,27 @@ class CopySupplier extends Command
|
|
|
}else{
|
|
|
$datas = [
|
|
|
'name' => $supplier['name'],
|
|
|
- 'code' => $supplier['code'],
|
|
|
'source' => $supplier['source'],
|
|
|
'contector' => $supplier['contactor'],
|
|
|
'post' => $supplier['position'],
|
|
|
- 'type' => $supplier['type'],
|
|
|
- 'nature' => $supplier['supplier_type'],
|
|
|
+
|
|
|
+ 'nature' => $supplier['nature'],
|
|
|
'corporation' => $supplier['legaler'],
|
|
|
'registertime' => $supplier['registertime'],
|
|
|
- 'capital' => $supplier['capital'],
|
|
|
- 'supplier_type' => $supplier['supplier_type'],
|
|
|
- 'pay_method' => $supplier['pay_type'],
|
|
|
- 'paydays' => $supplier['pay_day'],
|
|
|
+ 'capital' => $supplier['capital']??"",
|
|
|
+ 'supplier_type' => $this->_cat[$supplier['supplier_type']]??"",
|
|
|
+ 'pay_method' => $this->_payway[$supplier['pay_type']],
|
|
|
+ 'paydays' => $supplier['pay_day']??"0",
|
|
|
'mobile' => $supplier['mobile'],
|
|
|
'address' => $supplier['addr'],
|
|
|
'return_ticket' => $supplier['ticket_type'],
|
|
|
- 'delivery' => $supplier['delivery_way'],
|
|
|
+ 'delivery' => $this->_delaway[$supplier['delivery_way']]??"",
|
|
|
'status' => $supplier['status'],
|
|
|
'addtime' => $supplier['addtime'],
|
|
|
'updatetime' => $supplier['updatetime'],
|
|
|
'registercode' => $supplier['registercode'],
|
|
|
- 'level' => $supplier['level'],
|
|
|
+ 'level' => $this->_level[$supplier['level']]??"",
|
|
|
'product_category' => $supplier['product_category'],
|
|
|
- 'license_img' => $supplier['license_img']
|
|
|
|
|
|
];
|
|
|
$data=array_merge($comp,$datas);
|