提交 1635964b authored 作者: qhz's avatar qhz

【开发】代码优化

上级 b8275540
...@@ -10,6 +10,8 @@ trait orderOutTrait ...@@ -10,6 +10,8 @@ trait orderOutTrait
public $product = []; public $product = [];
public $update_code_sn = []; public $update_code_sn = [];
public $wait_logistics_code = []; public $wait_logistics_code = [];
public $default_product = [];
public $out_complete = [];
protected function outWarehousing($data) protected function outWarehousing($data)
{ {
...@@ -22,12 +24,8 @@ trait orderOutTrait ...@@ -22,12 +24,8 @@ trait orderOutTrait
$diff = array_diff($out_sn, $erp_out); $diff = array_diff($out_sn, $erp_out);
if ($this->brandId == Erp::ERP_SYNC_OUT_PRODUCT_DESIGNATED){ // 过滤前置处理
$default_product = $this->getProductByIdAsc($this->brandId); $this->jstOut(['out_sn' => $out_sn, 'data' => $data]);
if(!$default_product){
throw new \Exception("请先添加一个单规格商品brandId:".$this->brandId);
}
}
foreach($data as $v) { foreach($data as $v) {
$continue = $this->OutSpecialParameterHandler(['data' => $v, 'diff' => $diff]); $continue = $this->OutSpecialParameterHandler(['data' => $v, 'diff' => $diff]);
...@@ -44,6 +42,34 @@ trait orderOutTrait ...@@ -44,6 +42,34 @@ trait orderOutTrait
} }
// 过滤前置处理
public function jstOutPreProcessing($args)
{
$out_sn = $args['out_sn'];
$data = $args['data'];
if($this->brandId == Erp::ERP_SYNC_OUT_PRODUCT_DESIGNATED){
$this->default_product = $this->getProductByIdAsc($this->brandId);
if(!$this->default_product){
throw new \Exception("请先添加一个单规格商品brandId:".$this->brandId);
}
}
if (isset($this->config['customized_config']['out_code']) && $this->config['customized_config']['out_code'] == 1){
//校验出库单是否已完成
$this->out_complete = OutWarehousing::query()->where('brand_id', $this->brandId)
->whereIn('out_warehousing_sn', $out_sn)
->where('out_warehousing_status',3)
->pluck('out_warehousing_sn')
->toArray();
}
if (isset($this->config['customized_config']['factory_logistics_out']) && $this->config['customized_config']['factory_logistics_out'] == 1){
$l_ids = array_column($data, 'l_id');
//青丛,在产线先采集了码跟快递单号,快递单号作为了出库单号写入出库码表跟出库产品表,这里写入主表
$this->wait = $this->waitOut($l_ids);
}
}
// 原始出库单数据格式 // 原始出库单数据格式
protected function jstOutWarehousingAttribute($data, $io_source_type = 1) protected function jstOutWarehousingAttribute($data, $io_source_type = 1)
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论