DelayAnalysisController.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Http\Controllers\ResponseController;
  4. use App\Http\Controllers\EncryptionController;
  5. use App\Http\Controllers\ResourcesController;
  6. use Illuminate\Http\Request;
  7. use Illuminate\Support\Carbon;
  8. use Illuminate\Support\Facades\DB;
  9. use Illuminate\Support\Facades\Validator;
  10. class DelayAnalysisController extends Controller
  11. {
  12. private $responseController;
  13. private $encController;
  14. private $resourcesController;
  15. public function __construct(){
  16. $this->responseController = new ResponseController();
  17. $this->encController = new EncryptionController();
  18. $this->resourcesController = new ResourcesController();
  19. }
  20. public function registerDelayAnalysis() {
  21. }
  22. public function getDelayAnalysis($line) {
  23. try {
  24. $getDelayAnalysis = DB::table('S002V01TANRE')
  25. ->where('ANRE_NULI', '=', $line)
  26. ->join('S002V01TORCO', 'ORCO_NUOR', '=', 'ANRE_NUOR')
  27. ->join('S002V01TPROV', 'PROV_NUPR', '=', 'ORCO_NUPR')
  28. ->join('S002V01TREFI', 'REFI_CORF', '=', 'PROV_CORF')
  29. ->get([
  30. 'ANRE_IDAR',
  31. 'ANRE_NUOR',
  32. 'ANRE_DESC',
  33. 'ANRE_TIPO',
  34. 'ANRE_FEEN',
  35. 'ANRE_ESTA',
  36. 'ANRE_USRE',
  37. 'ANRE_FERE',
  38. 'ANRE_USMO',
  39. 'ANRE_FEMO',
  40. 'ORCO_NUOR',
  41. 'ORCO_NUPR',
  42. 'ORCO_NUDE',
  43. 'ORCO_MONE',
  44. 'ORCO_COST',
  45. 'ORCO_PROY',
  46. 'PROV_NUPR',
  47. 'PROV_NOCO',
  48. 'PROV_NOMB',
  49. 'PROV_APPA',
  50. 'PROV_APMA',
  51. 'PROV_CORR',
  52. 'PROV_LAD1',
  53. 'PROV_TEL1',
  54. 'PROV_LAD2',
  55. 'PROV_TEL2',
  56. 'PROV_XRFC',
  57. 'PROV_XTAX',
  58. 'REFI_CORF',
  59. 'REFI_DESC',
  60. 'PROV_TIPO',
  61. 'PROV_SIWE',
  62. 'PROV_MEPA',
  63. ]);
  64. } catch (\Throwable $th) {
  65. return $this->responseController->makeResponse(true, "ERR_DELAY_ANALYSIS_GET000: Ocurrió un error al momento de obtener los registros", $th->getMessage(), 500);
  66. }
  67. return $this->responseController->makeResponse(false, "ÉXITO: Consulta Exitosa", $getDelayAnalysis);
  68. }
  69. }