cqpCow 1 年之前
父節點
當前提交
eb203dac61

+ 7 - 35
app/Http/Controllers/Api/BoxController.php

@@ -10,15 +10,8 @@ use Illuminate\Http\Request;
 
 class BoxController extends BaseController
 {
-
-
-
-
-
     public function boxIn(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->boxIn($request->all());
 
@@ -27,13 +20,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
 
     public function transportBoxIn(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->transportBoxIn($request->all());
 
@@ -42,13 +32,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
 
     public function boxDetail(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->boxDetail($request->all());
 
@@ -57,12 +44,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
+
     public function boxProductList(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->boxProductList($request->all());
 
@@ -71,12 +56,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
+
     public function boxOrderDetail(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->boxOrderDetail($request->all());
 
@@ -85,12 +68,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
+
     public function boxOrderDetailByTop(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->boxOrderDetailByTop($request->all());
 
@@ -99,12 +80,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
+
     public function boxOrderDetailByOrderNo(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->boxOrderDetailByOrderNo($request->all());
 
@@ -113,13 +92,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
 
     public function boxOrderGroup(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->boxOrderGroup($request->all());
 
@@ -128,12 +104,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
+
     public function transportNo(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->transportNo($request->all());
 
@@ -142,12 +116,10 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
+
     public function delBoxDetail(Request $request)
     {
-
-
         $service = new BoxService();
         list($status,$data) = $service->delBoxDetail($request->all());
 
@@ -156,7 +128,6 @@ class BoxController extends BaseController
         }else{
             return $this->json_return(201,$data);
         }
-
     }
 
     public function boxAdd(Request $request)
@@ -194,6 +165,7 @@ class BoxController extends BaseController
             return $this->json_return(201,$data);
         }
     }
+
     public function transportDetail(Request $request)
     {
         $service = new BoxService();

+ 0 - 12
app/Service/Box/BoxHookService.php

@@ -57,15 +57,7 @@ class BoxHookService extends Service
         return [true,$box];
     }
 
-
-    /**
-     * @param $box
-     * @param $data
-     * @return mixed
-     */
-
     public function dealBox($box,$data){
-
         $box->order_no = $data['order_no'];
         $box->out_order_no = $data['out_order_no'];
 //        $box->top_id = $data['top_id'];
@@ -78,9 +70,7 @@ class BoxHookService extends Service
         $box->top_order_no = $data['top_order_no'];
         $box->shipment_order_no = isset($data['shipment_order_no'])? $data['shipment_order_no'] : '';
 
-
         return [true,$box];
-
     }
 
 
@@ -138,11 +128,9 @@ class BoxHookService extends Service
                 'ext_5' => isset($v['ext_5']) ? $v['ext_5'] : '',
                 'team_id' => isset($v['team_id']) ? $v['team_id'] : '',
                 'shipment_order_no' => isset($v['shipment_order_no']) ? $v['shipment_order_no'] : '',
-
             ];
         }
 
-
         return [true,$insert];
     }
 

+ 11 - 27
app/Service/Box/BoxService.php

@@ -74,9 +74,6 @@ class BoxService extends Service
         $data = $data['param'];
         $key_list = [];
         foreach ($data as $v) {
-
-
-
             if($v['id'] < 0)  $sale_ids[] = -$v['id'];
             else $ids[] = $v['id'];
             if($v['id'] < 0) $v['id'] = -$v['id'];
@@ -102,8 +99,7 @@ class BoxService extends Service
             $product_list = OrdersProduct::wherein('id', $ids)->get()->toArray();
             $sale_product_list = SaleOrdersProduct::wherein('id', $sale_ids)->get()->toArray();
             $box_insert = [];
-                foreach ($product_list as $v) {
-
+            foreach ($product_list as $v) {
                 $num_list = $key_list[$v['id']];
                 $total = $num_list['total'];
                 $detail = $num_list['detail'];
@@ -112,10 +108,10 @@ class BoxService extends Service
                 if ($total > $un_box_num) return [false, $v['product_title'] . '数量不足'];
 
                 $ext_1 = $v['product_no'];//产品编号
-                $ext_2 = $v['technology_material']; //工艺材质
-                $ext_3 = $v['technology_name'];//工艺名称
-                $ext_4 = $v['wood_name'];//木皮
-                $ext_5 = $v['process_mark'];//工艺备注
+                $ext_2 = $v['technology_material']; //工艺材质 废弃
+                $ext_3 = $v['technology_name'];//工艺名称 改为颜色
+                $ext_4 = $v['wood_name'];//木皮 废弃
+                $ext_5 = $v['process_mark'];//工艺备注 废弃
                 $out_order_no = $insert['out_order_no'] = $v['out_order_no'];
                 $top_id = $v['sale_orders_product_id'];
                 foreach ($detail as $vv){
@@ -131,10 +127,8 @@ class BoxService extends Service
                         'box_type' => 1,
                         'team_id' => $team_id,
                         'shipment_order_no' => $transport_no,
-
                     ];
 
-
                 }
                 SaleOrdersProduct::where('id',$v['sale_orders_product_id'])->update([
                     'box_num' => DB::raw('box_num + '.$total),
@@ -142,10 +136,6 @@ class BoxService extends Service
                 OrdersProduct::where('id',$v['id'])->update([
                     'box_num' => DB::raw('box_num + '.$total),
                 ]);
-
-
-
-
             }
             foreach ($sale_product_list as $v) {
                 $box_type = 0;
@@ -162,10 +152,10 @@ class BoxService extends Service
                 if ($total > $un_box_num) return [false, $v['product_title'] . '数量不足'];
 
                 $ext_1 = $v['product_no'];//产品编号
-                $ext_2 = $v['technology_material']; //工艺材质
-                $ext_3 = $v['technology_name'];//工艺名称
-                $ext_4 = $v['wood_name'];//木皮
-                $ext_5 = $v['process_mark'];//工艺备注
+                $ext_2 = $v['technology_material']; //工艺材质 废弃
+                $ext_3 = $v['technology_name'];//工艺名称 改为颜色
+                $ext_4 = $v['wood_name'];//木皮 废弃
+                $ext_5 = $v['process_mark'];//工艺备注 废弃
                 $out_order_no = $insert['out_order_no'] = $v['out_order_no'];
                 $top_id = $v['id'];
                 foreach ($detail as $vv){
@@ -181,19 +171,14 @@ class BoxService extends Service
                         'box_type' => $box_type,
                         'team_id' => $team_id,
                         'shipment_order_no' => $transport_no,
-
                     ];
-
-
                 }
+
                 SaleOrdersProduct::where('id',$v['id'])->update([
                     'box_num' => DB::raw('box_num + '.$total),
                 ]);
-
-
-
-
             }
+
             $insert['detail'] = $box_insert;
             $insert['top_order_no'] = $top_order_no;
             $insert['order_no'] = $box_no;
@@ -209,7 +194,6 @@ class BoxService extends Service
             DB::commit();
             return [true,''];
         }catch (\Exception $e){
-
             DB::rollBack();
             return [false,$e->getLine().':'.$e->getMessage()];
         }

+ 4 - 4
app/Service/DispatchService.php

@@ -227,7 +227,7 @@ class DispatchService extends Service
         if(! $status) return [false, $msg];
 
         $model = OrdersProduct::where('del_time',0)
-            ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','production_time','production_no','status','crt_id','dispatch_complete_quantity')
+            ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','production_time','production_no','status','crt_id','dispatch_complete_quantity','pre_shipment_time')
             ->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]])
             ->whereIn('id',$msg)
             ->orderBy('id','desc');
@@ -248,6 +248,7 @@ class DispatchService extends Service
         if(! empty($data['out_crt_man'])) $model->where('out_crt_man', 'LIKE', '%'.$data['out_crt_man'].'%');
         if(! empty($data['out_checker_time'][0]) && ! empty($data['out_checker_time'][1])) $model->whereBetween('out_checker_time',[$data['out_checker_time'][0],$data['out_checker_time'][1]]);
         if(! empty($data['production_time'][0]) && ! empty($data['production_time'][1])) $model->whereBetween('production_time',[$data['production_time'][0],$data['production_time'][1]]);
+        if(! empty($data['pre_shipment_time'][0]) && ! empty($data['pre_shipment_time'][1])) $model->whereBetween('pre_shipment_time',[$data['pre_shipment_time'][0],$data['pre_shipment_time'][1]]);
         if(isset($data['status'])) $model->where('status',$data['status']);
         if(isset($data['is_create'])) {
             if($data['is_create']){
@@ -269,7 +270,6 @@ class DispatchService extends Service
         $bool = $this->is_same_month($data['out_order_no_time'][0],$data['out_order_no_time'][1]);
         if(! $bool) return [false,'制单日期必须同月!'];
 
-
         $time = date("Ymd",$data['out_order_no_time'][0]);
         $process_model = new OrdersProductProcess(['channel' => $time]);
         if(! $process_model->is_table_isset()) return [true, []];//不存在process子表 返回空数据
@@ -294,7 +294,7 @@ class DispatchService extends Service
         if(! isset($data['is_split'])) return [false,'是否拆分标识不能为空!'];
 
         $result = OrdersProduct::whereIn('id',$data['id'])
-            ->select('id as order_product_id','sale_orders_product_id','order_no','table_header_mark','product_no','product_title','product_size','product_unit','production_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','sale_orders_product_id','out_order_no_time','price','customer_name','out_order_no','customer_no')
+            ->select('id as order_product_id','sale_orders_product_id','order_no','table_header_mark','product_no','product_title','product_size','product_unit','production_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','sale_orders_product_id','out_order_no_time','price','customer_name','out_order_no','customer_no','pre_shipment_time')
             ->orderBy('id','desc')
             ->get()->toArray();
         $result_map = array_column($result,null,'order_product_id');
@@ -339,6 +339,7 @@ class DispatchService extends Service
             $data['data'][$key]['out_order_no_time'] = $value['out_order_no_time'] ? date('Y-m-d',$value['out_order_no_time']) : '';
             $data['data'][$key]['out_checker_time'] = $value['out_checker_time'] ? date('Y-m-d',$value['out_checker_time']) : '';
             $data['data'][$key]['production_time'] = $value['production_time'] ? date('Y-m-d',$value['production_time']) : '';
+            $data['data'][$key]['pre_shipment_time'] = $value['pre_shipment_time'] ? date('Y-m-d',$value['pre_shipment_time']) : '';
             $data['data'][$key]['dispatch_quantity'] = $map[$value['id']] ?? 0;
             $data['data'][$key]['not_dispatch_quantity'] = $value['production_quantity'] - ($map[$value['id']] ?? 0);
             $data['data'][$key]['order_product_man'] = $emp_map[$value['crt_id']] ?? '';
@@ -536,7 +537,6 @@ class DispatchService extends Service
     public function fillDispatchMobileOrderList($data){
         if(empty($data)) return $data;
 
-
         foreach ($data as $key => $value){
             $data[$key]['un_finished_quantity'] = $value['dispatch_quantity'] - $value['finished_num'] - $value['waste_num'];
         }

+ 7 - 7
app/Service/FyyOrderService.php

@@ -60,7 +60,7 @@ class FyyOrderService extends Service
             $args = '';
             if(! empty($return_stock_detail)){
                 foreach ($return_stock_detail as $value){
-                    $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}' and wood_name = '{$value['wood_name']}') OR ";
+                    $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}') OR ";
                 }
                 $args = rtrim($args,'OR ');
                 SaleOrdersProductStockDetail::where('del_time',0)
@@ -101,7 +101,7 @@ class FyyOrderService extends Service
 
     public function orderList($data){
         $model = SaleOrdersProduct::where('del_time',0)
-            ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','box_num','finished_num','shipment_num')
+            ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','box_num','finished_num','shipment_num','pre_shipment_time')
             ->orderBy('crt_time','desc')
             ->orderBy('id','asc');
 
@@ -132,6 +132,7 @@ class FyyOrderService extends Service
         if(! empty($data['out_crt_man'])) $model->where('out_crt_man', 'LIKE', '%'.$data['out_crt_man'].'%');
         if(! empty($data['out_checker_time'][0]) && ! empty($data['out_checker_time'][1])) $model->whereBetween('out_checker_time',[$data['out_checker_time'][0],$data['out_checker_time'][1]]);
         if(! empty($data['out_order_no_time'][0]) && ! empty($data['out_order_no_time'][1])) $model->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]]);
+        if(! empty($data['pre_shipment_time'][0]) && ! empty($data['pre_shipment_time'][1])) $model->whereBetween('pre_shipment_time',[$data['pre_shipment_time'][0],$data['pre_shipment_time'][1]]);
         if(isset($data['status'])) $model->where('status',$data['status']);
         if(isset($data['is_create'])) {
             if($data['is_create']){
@@ -168,7 +169,6 @@ class FyyOrderService extends Service
         return [true, $list];
     }
 
-
     public function fillData($data){
         if(empty($data['data'])) return $data;
 
@@ -197,6 +197,7 @@ class FyyOrderService extends Service
             $data['data'][$key]['sub'] = $detail_map[$keys] ?? [];
             $data['data'][$key]['out_order_no_time'] = $value['out_order_no_time'] ? date('Y-m-d',$value['out_order_no_time']) : '';
             $data['data'][$key]['out_checker_time'] = $value['out_checker_time'] ? date('Y-m-d',$value['out_checker_time']) : '';
+            $data['data'][$key]['pre_shipment_time'] = $value['pre_shipment_time'] ? date('Y-m-d',$value['pre_shipment_time']) : '';
             $data['data'][$key]['product_quantity_on_hand'] = $detailMap[$keys] ?? 0;
             if($value['production_quantity'] >= $value['order_quantity']){
                 $data['data'][$key]['is_create'] = 1;
@@ -231,7 +232,7 @@ class FyyOrderService extends Service
         try {
             $args = '';
             foreach ($return_product as $value){
-                $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}' and wood_name = '{$value['wood_name']}') OR ";
+                $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}') OR ";
             }
             $args = rtrim($args,'OR ');
             SaleOrdersProductStockDetail::where('del_time',0)
@@ -246,7 +247,7 @@ class FyyOrderService extends Service
             return [false,$exception->getMessage()];
         }
 
-        return [true,''];
+        return [true, ''];
     }
 
     public function fyySaveOutOrder($data,$user){
@@ -406,13 +407,12 @@ class FyyOrderService extends Service
                         'cdlcode' => $value['cdlcode'],
                         'product_no' => $value['cinvcode'],//产品编码
                         'product_title' => $value['product_title'],
-                        'product_size' => $value['product_size'],
+                        'product_size' => $value['product_size'] ?? "",
                         'technology_name' => $cfree1 ?? '',
                         'wood_name' => $cfree2 ?? '',
                         'num' => $n,
                         'technology_material' => $value['technology_material'] ?? '',
                         'process_mark' => $value['process_mark'] ?? '',
-                        'product_size' => $value['product_size'] ?? ''
                     ];
                 }
 

+ 11 - 5
app/Service/FyySqlServerService.php

@@ -105,7 +105,7 @@ class FyySqlServerService extends Service
             ->leftJoin('SO_SODetails as b', 'b.cSOCode', 'a.cSOCode')
             ->whereBetween('a.dDate', [$start, $end])
             ->whereNotNull('a.cVerifier')
-            ->select('a.cSOCode as out_order_no', 'a.dDate as out_order_no_time', 'a.cCusCode as customer_no', 'a.cCusName as customer_name', 'a.cMemo as table_header_mark', 'a.cMaker as out_crt_man', 'a.cVerifier as out_checker_man', 'a.dverifydate as out_checker_time', 'b.cInvCode as product_no', 'b.iQuantity as order_quantity', 'b.cDefine28 as technology_material', 'b.cFree1 as technology_name', 'b.cFree2 as wood_name', 'b.cDefine30 as process_mark', 'b.cMemo as table_body_mark', 'b.iTaxUnitPrice as price');
+            ->select('a.cSOCode as out_order_no', 'a.dDate as out_order_no_time', 'a.cCusCode as customer_no', 'a.cCusName as customer_name', 'a.cMemo as table_header_mark', 'a.cMaker as out_crt_man', 'a.cVerifier as out_checker_man', 'a.dverifydate as out_checker_time', 'b.cInvCode as product_no', 'b.iQuantity as order_quantity', 'b.cDefine28 as technology_material', 'b.cFree1 as technology_name', 'b.cFree2 as wood_name', 'b.cDefine30 as process_mark', 'b.cMemo as table_body_mark', 'b.iTaxUnitPrice as price','b.dPreDate as pre_shipment_time');
 
         if (!empty($data['out_order_no'])) $model->where('a.cSOCode', 'LIKE', '%' . $data['out_order_no'] . '%');
         if (!empty($data['customer_no'])) $model->where('a.cCusCode', 'LIKE', '%' . $data['customer_no'] . '%');
@@ -118,6 +118,11 @@ class FyySqlServerService extends Service
             $end1 = date('Y-m-d H:i:s.000', $data['out_checker_time'][1]);
             $model->whereBetween('a.dverifydate', [$start1, $end1]);
         }
+        if (!empty($data['pre_shipment_time'][0]) && !empty($data['pre_shipment_time'][1])) {
+            $start1 = date('Y-m-d H:i:s.000', $data['pre_shipment_time'][0]);
+            $end1 = date('Y-m-d H:i:s.000', $data['pre_shipment_time'][1]);
+            $model->whereBetween('b.dPreDate', [$start1, $end1]);
+        }
 
         $result = $model->get()->toArray();
         if (empty($result)) return [false, '暂无数据,更新结束!', ''];
@@ -151,8 +156,8 @@ class FyySqlServerService extends Service
         foreach ($result as $value) {
             $product = $value->product_no;
             $technology_name = $value->technology_name ?? '';
-            $wood_name = $value->wood_name ?? '';
-            $args .= "(a.cInvCode = '{$product}' and a.cFree1 = '{$technology_name}' and a.cFree2 = '{$wood_name}') OR ";
+//            $wood_name = $value->wood_name ?? '';
+            $args .= "(a.cInvCode = '{$product}' and a.cFree1 = '{$technology_name}') OR ";
         }
         $args = rtrim($args, 'OR ');
 
@@ -181,6 +186,7 @@ class FyySqlServerService extends Service
             $keys = $value->product_no . $value->technology_name . $value->wood_name;
             $result[$key]->out_order_no_time = $value->out_order_no_time ? strtotime($value->out_order_no_time) : 0;
             $result[$key]->out_checker_time = $value->out_checker_time ? strtotime($value->out_checker_time) : 0;
+            $result[$key]->pre_shipment_time = $value->pre_shipment_time ? strtotime($value->pre_shipment_time) : 0;
             $result[$key]->product_title = $messageMap[$value->product_no]->product_title ?? '';
             $result[$key]->product_size = $messageMap[$value->product_no]->product_size ?? '';
             $result[$key]->product_unit = $messageMap[$value->product_no]->product_unit ?? '';
@@ -216,13 +222,13 @@ class FyySqlServerService extends Service
         if (empty($data['id'])) return [false, '数据不能为空!', ''];
 
         $product = SaleOrdersProduct::whereIn('id', $data['id'])
-            ->select('product_no', 'technology_name', 'wood_name')
+            ->select('product_no', 'technology_name')
             ->get()->toArray();
 
         //现存量查询开始 ---组织查询条件
         $args = '';
         foreach ($product as $value) {
-            $args .= "(a.cInvCode = '{$value['product_no']}' and a.cFree1 = '{$value['technology_name']}' and a.cFree2 = '{$value['wood_name']}') OR ";
+            $args .= "(a.cInvCode = '{$value['product_no']}' and a.cFree1 = '{$value['technology_name']}') OR ";
         }
         $args = rtrim($args, 'OR ');
 

+ 5 - 3
app/Service/ProductionOrderService.php

@@ -138,7 +138,7 @@ class ProductionOrderService extends Service
             return [false,$e->getLine().':'.$e->getMessage()];
         }
 
-        return [true,'保存成功!'];
+        return [true, ''];
     }
 
     public function del($data){
@@ -153,7 +153,7 @@ class ProductionOrderService extends Service
 
     public function orderList($data){
         $model = OrdersProduct::where('del_time',0)
-            ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','production_time','production_no','status','sale_orders_product_id','dispatch_complete_quantity')
+            ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','production_time','production_no','status','sale_orders_product_id','dispatch_complete_quantity','pre_shipment_time')
             ->orderBy('id','desc');
 
         if(! empty($data['order_no'])) $model->where('order_no', 'LIKE', '%'.$data['order_no'].'%');
@@ -173,6 +173,7 @@ class ProductionOrderService extends Service
         if(! empty($data['out_checker_time'][0]) && ! empty($data['out_checker_time'][1])) $model->whereBetween('out_checker_time',[$data['out_checker_time'][0],$data['out_checker_time'][1]]);
         if(! empty($data['out_order_no_time'][0]) && ! empty($data['out_order_no_time'][1])) $model->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]]);
         if(! empty($data['production_time'][0]) && ! empty($data['production_time'][1])) $model->whereBetween('production_time',[$data['production_time'][0],$data['production_time'][1]]);
+        if(! empty($data['pre_shipment_time'][0]) && ! empty($data['pre_shipment_time'][1])) $model->whereBetween('pre_shipment_time',[$data['pre_shipment_time'][0],$data['pre_shipment_time'][1]]);
         if(isset($data['status'])) $model->where('status',$data['status']);
         if(isset($data['is_create'])) {
             if($data['is_create']){
@@ -198,7 +199,7 @@ class ProductionOrderService extends Service
             $map[$value] = $data['quantity'][$key];
         }
         $result = SaleOrdersProduct::whereIn('id',$data['id'])
-            ->select('id as sale_orders_product_id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','price')
+            ->select('id as sale_orders_product_id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','price','pre_shipment_time')
             ->orderBy('id','asc')
             ->get()->toArray();
 
@@ -221,6 +222,7 @@ class ProductionOrderService extends Service
             $data['data'][$key]['out_order_no_time'] = $value['out_order_no_time'] ? date('Y-m-d',$value['out_order_no_time']) : '';
             $data['data'][$key]['out_checker_time'] = $value['out_checker_time'] ? date('Y-m-d',$value['out_checker_time']) : '';
             $data['data'][$key]['production_time'] = $value['production_time'] ? date('Y-m-d',$value['production_time']) : '';
+            $data['data'][$key]['pre_shipment_time'] = $value['pre_shipment_time'] ? date('Y-m-d',$value['pre_shipment_time']) : '';
             $data['data'][$key]['not_production'] = $value['order_quantity'] - ($production_map[$value['sale_orders_product_id']] ?? 0);
             if($value['dispatch_complete_quantity'] >= $value['production_quantity']){
                 $data['data'][$key]['is_create'] = 1;