cqpCow 1 năm trước cách đây
mục cha
commit
a2818fc21d
1 tập tin đã thay đổi với 27 bổ sung27 xóa
  1. 27 27
      app/Service/ConstructionService.php

+ 27 - 27
app/Service/ConstructionService.php

@@ -534,8 +534,8 @@ class ConstructionService extends Service
 //            if(empty($data['construction_contact'])) return [false,'联系方式不能为空'];
 //            if(empty($data['address1']) || empty($data['address2'])) return [false,'地址不能为空'];
         }
-        //校验排班
-        if(empty($data['schedule_id']) ||empty($data['day_stamp']) || empty($data['day_start_stamp']) || empty($data['day_end_stamp'])) return [false,'排班时间信息不能为空'];
+        //校验排班 todo
+//        if(empty($data['schedule_id']) ||empty($data['day_stamp']) || empty($data['day_start_stamp']) || empty($data['day_end_stamp'])) return [false,'排班时间信息不能为空'];
 
         //所属部门 以及  顶级部门
         if(empty($data['depart_id'])) {
@@ -595,16 +595,16 @@ class ConstructionService extends Service
                 ->exists();
             if($bool) return [false,'合同:' . $sale['order_number'] . '在' . $start_time . '——' . $end_time . '已下施工单'];
 
-            $schedule = ScheduleInfo::where('del_time',0)
-                ->where('day',$data['day_stamp'])
-                ->where('start_time',$data['day_start_stamp'])
-                ->where('end_time',$data['day_end_stamp'])
-                ->where('is_use',ScheduleInfo::not_use)
-                ->first();
-            if(! empty($schedule)) return [false,'该时间段排班已满或不存在!'];
-            $data['schedule_info_id'] = $schedule->id;
-            list($status,$msg) = $this->limitingSendRequestBackg(ScheduleInfo::limit_key . $schedule->id);
-            if(! $status) return [false,'操作频繁,请稍等!'];
+//            $schedule = ScheduleInfo::where('del_time',0)
+//                ->where('day',$data['day_stamp'])
+//                ->where('start_time',$data['day_start_stamp'])
+//                ->where('end_time',$data['day_end_stamp'])
+//                ->where('is_use',ScheduleInfo::not_use)
+//                ->first();
+//            if(! empty($schedule)) return [false,'该时间段排班已满或不存在!'];
+//            $data['schedule_info_id'] = $schedule->id;
+//            list($status,$msg) = $this->limitingSendRequestBackg(ScheduleInfo::limit_key . $schedule->id);
+//            if(! $status) return [false,'操作频繁,请稍等!'];
         }else{
             if(empty($data['id'])) return [false,'ID不能为空'];
             $bool = Construction::where('del_time',0)
@@ -615,21 +615,21 @@ class ConstructionService extends Service
                 ->exists();
             if($bool)  return [false,'合同:' . $sale['order_number'] . '在' . $start_time . '——' . $end_time . '已下施工单'];
 
-            $construction = Construction::where('id',$data['id'])->first();
-            if(empty($construction)) return [false,'施工单不存在或已被删除'];
-            $construction = $construction->toArray();
-            if($construction['day_stamp'] != $data['day_stamp'] || $construction['day_start_stamp'] != $data['day_start_stamp'] && $construction['day_end_stamp'] != $data['day_end_stamp']) {
-                $schedule = ScheduleInfo::where('del_time',0)
-                    ->where('day',$data['day_stamp'])
-                    ->where('start_time',$data['day_start_stamp'])
-                    ->where('end_time',$data['day_end_stamp'])
-                    ->where('is_use',ScheduleInfo::not_use)
-                    ->first();
-                if(! empty($schedule)) return [false,'该时间段排班已满或不存在!'];
-                $data['schedule_info_id'] = $schedule->id;
-                list($status,$msg) = $this->limitingSendRequestBackg(ScheduleInfo::limit_key . $schedule->id);
-                if(! $status) return [false,'操作频繁,请稍等!'];
-            }
+//            $construction = Construction::where('id',$data['id'])->first();
+//            if(empty($construction)) return [false,'施工单不存在或已被删除'];
+//            $construction = $construction->toArray();
+//            if($construction['day_stamp'] != $data['day_stamp'] || $construction['day_start_stamp'] != $data['day_start_stamp'] && $construction['day_end_stamp'] != $data['day_end_stamp']) {
+//                $schedule = ScheduleInfo::where('del_time',0)
+//                    ->where('day',$data['day_stamp'])
+//                    ->where('start_time',$data['day_start_stamp'])
+//                    ->where('end_time',$data['day_end_stamp'])
+//                    ->where('is_use',ScheduleInfo::not_use)
+//                    ->first();
+//                if(! empty($schedule)) return [false,'该时间段排班已满或不存在!'];
+//                $data['schedule_info_id'] = $schedule->id;
+//                list($status,$msg) = $this->limitingSendRequestBackg(ScheduleInfo::limit_key . $schedule->id);
+//                if(! $status) return [false,'操作频繁,请稍等!'];
+//            }
         }
 
         return [true, [$product_submit, $product_save]];