cqp 2 өдөр өмнө
parent
commit
fe88ecb629

+ 10 - 16
app/Service/LargeScreenService.php

@@ -322,7 +322,8 @@ class LargeScreenService extends Service
             } else {
                 $state_title = "已完成";
             }
-            $sales[$key]['pre_shipment_time'] = $state_title;
+            $sales[$key]['state_title'] = $state_title;
+            $sales[$key]['pre_shipment_time'] = date("Y-m-d", $value['pre_shipment_time']);
         }
         //订单看板-----------------------------------------------------
 
@@ -731,26 +732,20 @@ class LargeScreenService extends Service
                     'today_total' => 0,
                     'last_week_total' => 0,
                     'last_month_total' => 0,
-                    'today_bad_total' => 0,
-                    'last_week_bad_total' => 0,
-                    'last_month_bad_total' => 0,
                 ];
             }
 
             // 判断属于哪个时间范围
             if ($time >= $todayStart && $time <= $todayEnd) {
                 $map[$device_id]['today_total'] += $qty;
-                if($qty <= 0.2) $map[$device_id]['today_bad_total'] += $qty;
             }
 
             if ($time >= $lastWeekStart && $time <= $lastWeekEnd) {
                 $map[$device_id]['last_week_total'] += $qty;
-                if($qty <= 0.2) $map[$device_id]['last_week_bad_total'] += $qty;
             }
 
             if ($time >= $lastMonthStart && $time <= $lastMonthEnd) {
                 $map[$device_id]['last_month_total'] += $qty;
-                if($qty <= 0.2) $map[$device_id]['last_month_bad_total'] += $qty;
             }
         }
         // 1) 按设备名 -> 按日期 (Y-m-d) 聚合最小/最大时间戳
@@ -804,7 +799,7 @@ class LargeScreenService extends Service
             }
         }
 
-        $oee = $this->deviceZl($device_data,$todayStart,$todayEnd);
+        $oee = $this->deviceZl($today_data,$todayStart,$todayEnd);
         $result = [];
         foreach ($byDeviceDay as $device => $days) {
             $todayHours = $lastWeekHours = $lastMonthHours = 0.0;
@@ -943,12 +938,12 @@ class LargeScreenService extends Service
     }
 
     private function deviceZl($today_data,$todayStart,$todayEnd){
-        $key_redis = $todayStart . $todayEnd . "report";;
-        $result = Redis::get($key_redis);
-        if(! empty($result)) {
-            $list = json_decode($result, true);
-            return $list;
-        }
+//        $key_redis = $todayStart . $todayEnd . "report";;
+//        $result = Redis::get($key_redis);
+//        if(! empty($result)) {
+//            $list = json_decode($result, true);
+//            return $list;
+//        }
 
         $result = $today_data;
 
@@ -1003,7 +998,6 @@ class LargeScreenService extends Service
 
             //运行时间
             $run_time_tmp = $run_time1[$value] ?? 0;
-            $run_time_tmp = $run_time_tmp;
 
             //工作时间
             $process_time_tmp = $run_time1[$value] ?? 0;
@@ -1031,7 +1025,7 @@ class LargeScreenService extends Service
             $return[$value] = $oee;
         }
 
-        Redis::setex($key_redis, 3600, json_encode($return));
+//        Redis::setex($key_redis, 3600, json_encode($return));
 
         return $return;
     }