|
|
@@ -55,7 +55,7 @@ class CacheShelfService
|
|
|
*/
|
|
|
public function lightOffTask($locCode, $PTLAction): array
|
|
|
{
|
|
|
- $station = Station::query()->with(['pendingStationTask.stationTaskMaterialBoxes.materialBox','storage'=>function(Builder $query){
|
|
|
+ $station = Station::query()->with(['pendingStationTask.stationTaskMaterialBoxes.materialBox','storage'=>function($query){
|
|
|
$query->whereNotNull("material_box_id")->orderByDesc("updated_at");
|
|
|
}])->where('code', $locCode)->first();
|
|
|
//站存在 站为缓存架2 站为蓝灯状态
|
|
|
@@ -216,6 +216,42 @@ class CacheShelfService
|
|
|
return json_decode($response->body());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 站亮灯
|
|
|
+ *
|
|
|
+ * @param string $stationCode
|
|
|
+ * @param string $color explain: 0-red 1-green 2-blue 3-yellow
|
|
|
+ * @param string $frequency explain: 0-常亮 1-一次 2-两次 3-三次 4-四次 5-五次 (均为/秒)
|
|
|
+ * @param array $info
|
|
|
+ * @return bool
|
|
|
+ */
|
|
|
+ public function lightUp(string $stationCode, string $color = '1', string $frequency = '0',array $info = []):bool
|
|
|
+ {
|
|
|
+ $default = [
|
|
|
+ "detail01" => '',
|
|
|
+ "detail02" => "",
|
|
|
+ "detail03" => "",
|
|
|
+ "qrCode" => "",
|
|
|
+ "qty00" => "",
|
|
|
+ "qty01" => 0,
|
|
|
+ "qty02" => 0,
|
|
|
+ "title" => '',
|
|
|
+ "uomDesc01" => "",
|
|
|
+ "uomDesc02" => ""
|
|
|
+ ];
|
|
|
+ foreach ($info as $key=>$item)$default[$key] = $item;
|
|
|
+
|
|
|
+ $params = [
|
|
|
+ "areaCode" => "1004",
|
|
|
+ 'locCode' => $stationCode,
|
|
|
+ 'PTLAction' => 1,
|
|
|
+ 'PTLSettings' => ['color' => $color, 'frequency' => $frequency],
|
|
|
+ "displayInfo" => $default,
|
|
|
+ ];
|
|
|
+ $response = Http::post(config('api.haiq.storage.light'), $params);
|
|
|
+ return $response->status()==200;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 控制格口灭灯
|
|
|
* @param $locCode
|