ForeignHaiRoboticsService.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace App\Services;
  3. use App\MaterialBox;
  4. use App\StationTaskMaterialBox;
  5. use Illuminate\Http\Request;
  6. class ForeignHaiRoboticsService
  7. {
  8. private function makeJson_move(
  9. $modeName,
  10. $fromLocation,
  11. $toLocation,
  12. $materialBoxes,
  13. $groupId=''
  14. ,$priority=10
  15. , $isSequenced=1
  16. ){
  17. $timestampSuffix = microtime(true);
  18. $taskMode=(function()use($modeName){
  19. switch ($modeName){
  20. case '输送线入库': return 1;
  21. case '库出至输送线': return 2;
  22. case '移动位置': return 3;
  23. case '缓存架入库': return 6;
  24. default: throw new \Exception('发至海柔的移料箱请求,模式不存在');
  25. }
  26. })();
  27. $bins=$materialBoxes->map(function (MaterialBox $materialBox){
  28. return [
  29. ];
  30. });
  31. $groupId .= $timestampSuffix;
  32. $groupId .= $timestampSuffix;
  33. $json=[
  34. "taskCode" =>$taskMode,
  35. "bins"=>$bins,
  36. "groupCode"=>$groupId,
  37. "priority"=>$priority,
  38. "sequenceFlag"=>$isSequenced,
  39. ];
  40. }
  41. public function fetchGroupToLocation($toLocation,StationTaskMaterialBox $taskMaterialBoxes, $groupIdPrefix=''){
  42. }
  43. public function moveBin(){
  44. }
  45. public function markBinProcessed(){
  46. }
  47. public function taskUpdate(){
  48. }
  49. public function throwException(){
  50. }
  51. }