|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
namespace app\command;
|
|
|
|
|
|
-use app\admin\model\ComonOrder;use think\console\Command;
|
|
|
+use app\admin\model\ComonOrder;use app\admin\model\OrderCategory;use think\console\Command;
|
|
|
use think\console\Input;
|
|
|
use think\console\Output;
|
|
|
use think\Exception;
|
|
@@ -49,6 +49,11 @@ class handleCxData extends command
|
|
|
$output->writeln("[$date]:{$result['id']}数据解析失败");
|
|
|
continue;
|
|
|
}
|
|
|
+ if(isset($data['inv_cat_info']) && !empty($data['inv_cat_info'])){
|
|
|
+ $orderCode= $result['order_type']==1?$data['orderCode']:$data['cgdNo'];
|
|
|
+ OrderCategory::checkInfo($orderCode,$result['order_type'],$data['inv_cat_info']);
|
|
|
+ }
|
|
|
+
|
|
|
$qrd_insert_data=$wait_insert_data=$cgd_insert_data=[];
|
|
|
$data['cat_name']=is_array($data['cat_name']) ? $data['cat_name'] : json_decode($data['cat_name'],true);
|
|
|
if ($result['order_type'] == 1) {
|
|
@@ -93,6 +98,7 @@ class handleCxData extends command
|
|
|
'ownerName'=>$data['apply_name'] ,//销售员,
|
|
|
'ownerid'=>$data['apply_id'] ,//销售员id,
|
|
|
'department'=>$data['depart'] ,//部门,
|
|
|
+ 'open_type'=>$data['open_type'] ,//开模类型',
|
|
|
'manager'=>$data['manager']??'',
|
|
|
'managerid'=>$data['managerid']??0,
|
|
|
'createdTime'=>$data['addtime'] ,//销售单创建时间,
|
|
@@ -104,8 +110,9 @@ class handleCxData extends command
|
|
|
'customerName'=>$data['customer_name'] ,//客户名称,
|
|
|
'poCode'=>$data['poNo'] ,//po编号,
|
|
|
"is_comon"=>ComonOrder::is_common($data['orderCode']),
|
|
|
- 'platName'=>$data['platform_id'] ,//平台名称,
|
|
|
+ 'platName'=>$data['platform_name']??'',//平台名称,
|
|
|
'platform_type' => $data['platform_type']??'0',//平台名称,
|
|
|
+ 'platform_id'=>$data['platform_id']??0,//平台id,'
|
|
|
'workCode'=>$data['workNo'] ,//业务编号,
|
|
|
'zxCode'=>$data['zxNo'] ,//咨询单编号,
|
|
|
'goodNo'=>$data['good_code'] ,//商品编号,
|
|
@@ -184,11 +191,15 @@ class handleCxData extends command
|
|
|
'workCode'=>$data['workNo'] ,//业务编号,
|
|
|
'zxCode'=>$data['zxNo'] ,//咨询单编号,
|
|
|
'goodMaterial'=>'' ,//商品材质,
|
|
|
+ 'open_type'=>$data['open_type'] ,//开模类型',
|
|
|
'is_comon'=>ComonOrder::is_common($data['orderCode']),
|
|
|
'goodUnit'=>$data['unit'] ,//商品单位,
|
|
|
'goodDesc'=>$data['cost_desc'] ,//工艺说明,
|
|
|
'goodType'=>$data['good_type'] ,//商品类型,
|
|
|
'goodModel'=>'' ,//商品型号,
|
|
|
+ 'platName'=>$data['platform_name']??'',//平台名称,
|
|
|
+ 'platform_type' => $data['platform_type']??'0',//平台名称,
|
|
|
+ 'platform_id'=>$data['platform_id']??0,//平台id,'
|
|
|
'companyNo'=>$data['supplierNo'] ,//业务企业编号,
|
|
|
'companyName'=>$data['supplier_name'] ,//业务企业名称,
|
|
|
'customerNo'=>$data['customer_code'] ,//客户编号,
|
|
@@ -235,8 +246,9 @@ class handleCxData extends command
|
|
|
'customerNo'=>$data['customer_code'] ,//客户编号,
|
|
|
'customerName'=>$data['customer_name'] ,//客户名称,
|
|
|
'poCode'=>$data['poNo'] ,//po编号,
|
|
|
- 'platName'=>$data['platform_id'] ,//平台名称,
|
|
|
+ 'platName'=>$data['platform_name']??'',//平台名称,
|
|
|
'platform_type' => $data['platform_type']??'0',//平台名称,
|
|
|
+ 'platform_id'=>$data['platform_id']??0,//平台id,'
|
|
|
'workCode'=>$data['workNo'] ,//业务编号,
|
|
|
'zxCode'=>$data['zxNo'] ,//咨询单编号,
|
|
|
'goodNo'=>$data['good_code'] ,//商品编号,
|
|
@@ -267,6 +279,7 @@ class handleCxData extends command
|
|
|
'total_plan_price'=>$data['total_origin_price_plan'] ,//成本总额,
|
|
|
'sendNum'=>$data['send_num'] ,//已发货数量,
|
|
|
'wsendNum'=>$data['wsend_num'] ,//未发货数量,
|
|
|
+ 'open_type'=>$data['open_type'] ,//开模类型',
|
|
|
'apay_fee'=>0 ,//已付款,
|
|
|
'pay_fee'=>0 ,//付款中
|
|
|
'wpay_fee'=>$data['total_price'] ,//未付款,
|
|
@@ -304,7 +317,8 @@ class handleCxData extends command
|
|
|
(['qrdSend'=>$data['send_status']]);
|
|
|
}
|
|
|
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
//已存在
|
|
|
$data['total_fee']=round($data['total_fee'],2) - $data['th_fee'] - $data['diff_fee'];
|
|
|
$exitReport=Db::name('report_code')->where('cgdNo' , $data['cgdNo'])->findOrEmpty();
|
|
@@ -343,6 +357,8 @@ class handleCxData extends command
|
|
|
'cgdSource'=>$data['order_source'] ,//采购单来源',
|
|
|
'companyNo'=>$data['companyNo'] ,//业务公司编号',
|
|
|
'companyName'=>$data['companyName'] ,//业务公司',
|
|
|
+ 'platform_name'=>$data['platform_name']??'',//平台名称,
|
|
|
+ 'platform_id'=>$data['platform_id']??0,//平台id,'
|
|
|
'is_comon'=>isset($data['mainCode'])?2: ComonOrder::is_common($data['cgdNo']),
|
|
|
'cgdTime'=>$data['addtime'] ,//采购下单时间',
|
|
|
'bkCode'=>$data['bkcode'] ,//备库单编号',
|
|
@@ -403,6 +419,7 @@ class handleCxData extends command
|
|
|
'diff_fee'=>$data['diff_fee'] ,//工差金额',
|
|
|
'thNum'=>$data['th_num'] ,//退货数量',
|
|
|
'th_fee'=>$data['th_fee'] ,//退货金额',
|
|
|
+ "open_type"=>$data['open_type'] ,//开模类型',
|
|
|
'check_rate'=>'' ,//修正后的税率',
|
|
|
'is_del'=>0 ,
|
|
|
'addtime'=>$date ,
|
|
@@ -437,10 +454,13 @@ class handleCxData extends command
|
|
|
'goodModel'=>'' ,//商品型号',
|
|
|
'is_comon'=>isset($data['mainCode'])?2: ComonOrder::is_common($data['cgdNo']),
|
|
|
'goodMaterial'=>'' ,//商品材质',
|
|
|
+ 'open_type'=>$data['open_type'] ,//开模类型',
|
|
|
'goodUnit'=>$data['unit'] ,//商品单位',
|
|
|
'goodDesc'=>$data['cost_desc'] ,//工艺说明',
|
|
|
'metalsType'=>$data['noble_metal'] ,//贵金属种类',
|
|
|
'weight'=>$data['weight'] ,//商品重量',
|
|
|
+ 'platform_name'=>$data['platform_name']??'',//平台名称,
|
|
|
+ 'platform_id'=>$data['platform_id']??0,//平台id,'
|
|
|
'is_diff'=>$data['is_diff'] ,//是否有工差',
|
|
|
'deliveryDay'=>$data['delivery_day'] ,//物流天数',
|
|
|
'workDay'=>$data['lead_time'] ,//产品工期',
|
|
@@ -497,6 +517,9 @@ class handleCxData extends command
|
|
|
'goodType'=>$data['good_type'] ,//商品类型',
|
|
|
'goodBrand'=>$data['brand'] ,//商品品牌',
|
|
|
'goodModel'=>'' ,//商品型号',
|
|
|
+ 'open_type'=>$data['open_type'] ,//开模类型',
|
|
|
+ 'platform_name'=>$data['platform_name']??'',//平台名称,
|
|
|
+ 'platform_id'=>$data['platform_id']??0,//平台id,'
|
|
|
'is_comon'=>isset($data['mainCode'])?2: ComonOrder::is_common($data['cgdNo']),
|
|
|
'firstCat'=>$data['cat_name'][0]['cat_name'] ?? "" ,//商品一级分类',
|
|
|
'secCat'=>!isset($data['cat_name'][1]) ? '' : $data['cat_name'][1]['cat_name'] ,//二级分类,
|