|
@@ -32,6 +32,7 @@ class MaterialBoxService
|
|
|
{
|
|
{
|
|
|
$id = 0;
|
|
$id = 0;
|
|
|
while (true){
|
|
while (true){
|
|
|
|
|
+ //检测WAS
|
|
|
$boxes = MaterialBox::query()->select('id',"code")
|
|
$boxes = MaterialBox::query()->select('id',"code")
|
|
|
->whereNotIn("id",$blacklist)
|
|
->whereNotIn("id",$blacklist)
|
|
|
->where("id",">",$id)->where("code","like","IDE%")
|
|
->where("id",">",$id)->where("code","like","IDE%")
|
|
@@ -41,11 +42,19 @@ class MaterialBoxService
|
|
|
if ($modelId)$boxes->where("material_box_model_id",$modelId);
|
|
if ($modelId)$boxes->where("material_box_model_id",$modelId);
|
|
|
$boxes = $boxes->get();
|
|
$boxes = $boxes->get();
|
|
|
if ($boxes->count()==0)break;
|
|
if ($boxes->count()==0)break;
|
|
|
|
|
+ //检测海柔的有效料箱
|
|
|
$haiBoxes = DB::connection("mysql_haiRobotics")->table("ks_bin")
|
|
$haiBoxes = DB::connection("mysql_haiRobotics")->table("ks_bin")
|
|
|
->where("status",1)->whereIn("ks_bin_code",array_column($boxes->toArray(),"code"))->get();
|
|
->where("status",1)->whereIn("ks_bin_code",array_column($boxes->toArray(),"code"))->get();
|
|
|
if ($haiBoxes->count()==0)continue;
|
|
if ($haiBoxes->count()==0)continue;
|
|
|
$haiBoxes->each(function ($haiBox)use(&$codes){$codes[$haiBox->ks_bin_code] = true;});
|
|
$haiBoxes->each(function ($haiBox)use(&$codes){$codes[$haiBox->ks_bin_code] = true;});
|
|
|
foreach ($boxes as $index=>$box)if (!isset($codes[$box->code]))$boxes->splice($index,1);
|
|
foreach ($boxes as $index=>$box)if (!isset($codes[$box->code]))$boxes->splice($index,1);
|
|
|
|
|
+ //剔除有任务待处理的料箱
|
|
|
|
|
+ $haiBoxes = DB::connection("mysql_haiRobotics_ess")->table("ks_ess_task_detail")
|
|
|
|
|
+ ->whereIn("bin_code",array_column($boxes->toArray(),"code"))
|
|
|
|
|
+ ->whereNotIn("status",[0,4])->get();
|
|
|
|
|
+ $haiBoxes->each(function ($haiBox)use(&$notCodes){$notCodes[$haiBox->bin_code] = true;});
|
|
|
|
|
+ foreach ($boxes as $index=>$box)if (isset($notCodes[$box->code]))$boxes->splice($index,1);
|
|
|
|
|
+ //检测FLUX
|
|
|
$ides = [];
|
|
$ides = [];
|
|
|
$str = "(";
|
|
$str = "(";
|
|
|
for ($i=0;$i<count($boxes)-1;$i++){
|
|
for ($i=0;$i<count($boxes)-1;$i++){
|