gogs 2 anni fa
commit
013b7905a0
100 ha cambiato i file con 6642 aggiunte e 0 eliminazioni
  1. 13 0
      .gitignore
  2. 78 0
      README.md
  3. 46 0
      app/Console/Commands/InsertCloudCommand.php
  4. 42 0
      app/Console/Kernel.php
  5. 55 0
      app/Exceptions/Handler.php
  6. 87 0
      app/Exports/CommonExport.php
  7. 133 0
      app/Exports/Exports.php
  8. 23 0
      app/Exports/MyExport.php
  9. 90 0
      app/Http/Controllers/Api/BaseController.php
  10. 104 0
      app/Http/Controllers/Api/BomController.php
  11. 161 0
      app/Http/Controllers/Api/BoxController.php
  12. 16 0
      app/Http/Controllers/Api/CloudDataController.php
  13. 38 0
      app/Http/Controllers/Api/DeleteOrderController.php
  14. 38 0
      app/Http/Controllers/Api/Device/BaseController.php
  15. 22 0
      app/Http/Controllers/Api/Device/DeviceController.php
  16. 117 0
      app/Http/Controllers/Api/DispatchController.php
  17. 357 0
      app/Http/Controllers/Api/EmployeeController.php
  18. 61 0
      app/Http/Controllers/Api/EquipmentController.php
  19. 19 0
      app/Http/Controllers/Api/ErrorOperationController.php
  20. 89 0
      app/Http/Controllers/Api/FinishedOrderController.php
  21. 155 0
      app/Http/Controllers/Api/FyyOrderController.php
  22. 64 0
      app/Http/Controllers/Api/HeaderWordController.php
  23. 61 0
      app/Http/Controllers/Api/LoginController.php
  24. 164 0
      app/Http/Controllers/Api/MaterialController.php
  25. 80 0
      app/Http/Controllers/Api/MeasureController.php
  26. 187 0
      app/Http/Controllers/Api/OaController.php
  27. 70 0
      app/Http/Controllers/Api/OrderBoxController.php
  28. 104 0
      app/Http/Controllers/Api/OrderController.php
  29. 37 0
      app/Http/Controllers/Api/OrderTagController.php
  30. 76 0
      app/Http/Controllers/Api/OrderTransportController.php
  31. 140 0
      app/Http/Controllers/Api/ProcessController.php
  32. 89 0
      app/Http/Controllers/Api/ProductController.php
  33. 97 0
      app/Http/Controllers/Api/ProductionOrderController.php
  34. 154 0
      app/Http/Controllers/Api/ReportFormsController.php
  35. 61 0
      app/Http/Controllers/Api/ScrappController.php
  36. 524 0
      app/Http/Controllers/Api/ScreenController.php
  37. 96 0
      app/Http/Controllers/Api/SysMenuController.php
  38. 74 0
      app/Http/Controllers/Api/TechnologyController.php
  39. 1048 0
      app/Http/Controllers/Api/TestController.php
  40. 40 0
      app/Http/Controllers/Auth/ConfirmPasswordController.php
  41. 22 0
      app/Http/Controllers/Auth/ForgotPasswordController.php
  42. 40 0
      app/Http/Controllers/Auth/LoginController.php
  43. 73 0
      app/Http/Controllers/Auth/RegisterController.php
  44. 30 0
      app/Http/Controllers/Auth/ResetPasswordController.php
  45. 42 0
      app/Http/Controllers/Auth/VerificationController.php
  46. 13 0
      app/Http/Controllers/Controller.php
  47. 85 0
      app/Http/Kernel.php
  48. 21 0
      app/Http/Middleware/Authenticate.php
  49. 17 0
      app/Http/Middleware/CheckForMaintenanceMode.php
  50. 54 0
      app/Http/Middleware/CheckLogin.php
  51. 61 0
      app/Http/Middleware/CheckToken.php
  52. 17 0
      app/Http/Middleware/EncryptCookies.php
  53. 27 0
      app/Http/Middleware/RedirectIfAuthenticated.php
  54. 38 0
      app/Http/Middleware/RequestLog.php
  55. 18 0
      app/Http/Middleware/TrimStrings.php
  56. 23 0
      app/Http/Middleware/TrustProxies.php
  57. 24 0
      app/Http/Middleware/VerifyCsrfToken.php
  58. 52 0
      app/Jobs/CloudDataJob.php
  59. 49 0
      app/Jobs/OrderTag.php
  60. 217 0
      app/Jobs/ProcessDataJob.php
  61. 19 0
      app/Model/BasicMaterial.php
  62. 27 0
      app/Model/BasicProcedure.php
  63. 26 0
      app/Model/BasicProcess.php
  64. 19 0
      app/Model/Bom.php
  65. 19 0
      app/Model/BomDetail.php
  66. 19 0
      app/Model/BomDetailMeasure.php
  67. 19 0
      app/Model/BomDetailRelation.php
  68. 19 0
      app/Model/BomMaterial.php
  69. 18 0
      app/Model/Box.php
  70. 69 0
      app/Model/BoxDetail.php
  71. 19 0
      app/Model/Depart.php
  72. 19 0
      app/Model/Dispatch.php
  73. 19 0
      app/Model/DispatchEmpSub.php
  74. 18 0
      app/Model/DispatchSub.php
  75. 36 0
      app/Model/Employee.php
  76. 19 0
      app/Model/EmployeeDepartPermission.php
  77. 14 0
      app/Model/EmployeeManagerDepart.php
  78. 19 0
      app/Model/EmployeeMenuPermission.php
  79. 14 0
      app/Model/EmployeeRole.php
  80. 19 0
      app/Model/EmployeeTeamPermission.php
  81. 14 0
      app/Model/Equipment.php
  82. 20 0
      app/Model/ErrorTable.php
  83. 14 0
      app/Model/FinishedOrder.php
  84. 18 0
      app/Model/FinishedOrderScrapp.php
  85. 18 0
      app/Model/FinishedOrderSub.php
  86. 19 0
      app/Model/HeaderWord.php
  87. 19 0
      app/Model/Header_ext.php
  88. 19 0
      app/Model/Header_ext_sub.php
  89. 13 0
      app/Model/InOutRecord.php
  90. 15 0
      app/Model/Inventory.php
  91. 19 0
      app/Model/Material.php
  92. 19 0
      app/Model/MaterialDetail.php
  93. 19 0
      app/Model/Measure.php
  94. 19 0
      app/Model/Oa.php
  95. 19 0
      app/Model/OaEmployee.php
  96. 19 0
      app/Model/OaEmployeeSub.php
  97. 19 0
      app/Model/OaOrder.php
  98. 19 0
      app/Model/OaOrderSub.php
  99. 19 0
      app/Model/OaOrderSubEmployee.php
  100. 19 0
      app/Model/OaSub.php

+ 13 - 0
.gitignore

@@ -0,0 +1,13 @@
+/node_modules
+/public/hot
+/public/storage
+/storage/*.key
+/vendor
+.env
+.env.backup
+.phpunit.result.cache
+Homestead.json
+Homestead.yaml
+npm-debug.log
+yarn-error.log
+.idea

+ 78 - 0
README.md

@@ -0,0 +1,78 @@
+<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
+
+<p align="center">
+<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
+<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
+<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
+<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
+</p>
+
+## About Laravel
+
+Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
+
+- [Simple, fast routing engine](https://laravel.com/docs/routing).
+- [Powerful dependency injection container](https://laravel.com/docs/container).
+- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
+- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
+- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
+- [Robust background job processing](https://laravel.com/docs/queues).
+- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
+
+Laravel is accessible, powerful, and provides tools required for large, robust applications.
+
+## Learning Laravel
+
+Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
+
+If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
+
+## Laravel Sponsors
+
+We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
+
+- **[Vehikl](https://vehikl.com/)**
+- **[Tighten Co.](https://tighten.co)**
+- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
+- **[64 Robots](https://64robots.com)**
+- **[Cubet Techno Labs](https://cubettech.com)**
+- **[Cyber-Duck](https://cyber-duck.co.uk)**
+- **[British Software Development](https://www.britishsoftware.co)**
+- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
+- **[DevSquad](https://devsquad.com)**
+- [UserInsights](https://userinsights.com)
+- [Fragrantica](https://www.fragrantica.com)
+- [SOFTonSOFA](https://softonsofa.com/)
+- [User10](https://user10.com)
+- [Soumettre.fr](https://soumettre.fr/)
+- [CodeBrisk](https://codebrisk.com)
+- [1Forge](https://1forge.com)
+- [TECPRESSO](https://tecpresso.co.jp/)
+- [Runtime Converter](http://runtimeconverter.com/)
+- [WebL'Agence](https://weblagence.com/)
+- [Invoice Ninja](https://www.invoiceninja.com)
+- [iMi digital](https://www.imi-digital.de/)
+- [Earthlink](https://www.earthlink.ro/)
+- [Steadfast Collective](https://steadfastcollective.com/)
+- [We Are The Robots Inc.](https://watr.mx/)
+- [Understand.io](https://www.understand.io/)
+- [Abdel Elrafa](https://abdelelrafa.com)
+- [Hyper Host](https://hyper.host)
+- [Appoly](https://www.appoly.co.uk)
+- [OP.GG](https://op.gg)
+
+## Contributing
+
+Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
+
+## Code of Conduct
+
+In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
+
+## Security Vulnerabilities
+
+If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
+
+## License
+
+The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

+ 46 - 0
app/Console/Commands/InsertCloudCommand.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Service\CloudDataService;
+use Illuminate\Console\Command;
+
+class InsertCloudCommand extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'command:insert_cloud';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return mixed
+     */
+    public function handle()
+    {
+        echo 'start---------------';
+        $service = new CloudDataService();
+        $service->cloudData();
+        echo 'end-------------';
+    }
+}

+ 42 - 0
app/Console/Kernel.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Console;
+
+use Illuminate\Console\Scheduling\Schedule;
+use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
+
+class Kernel extends ConsoleKernel
+{
+    /**
+     * The Artisan commands provided by your application.
+     *
+     * @var array
+     */
+    protected $commands = [
+       //
+    ];
+
+    /**
+     * Define the application's command schedule.
+     *
+     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
+     * @return void
+     */
+    protected function schedule(Schedule $schedule)
+    {
+        // $schedule->command('inspire')
+        //          ->hourly();
+    }
+
+    /**
+     * Register the commands for the application.
+     *
+     * @return void
+     */
+    protected function commands()
+    {
+        $this->load(__DIR__.'/Commands');
+
+        require base_path('routes/console.php');
+    }
+}

+ 55 - 0
app/Exceptions/Handler.php

@@ -0,0 +1,55 @@
+<?php
+
+namespace App\Exceptions;
+
+use Exception;
+use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
+
+class Handler extends ExceptionHandler
+{
+    /**
+     * A list of the exception types that are not reported.
+     *
+     * @var array
+     */
+    protected $dontReport = [
+        //
+    ];
+
+    /**
+     * A list of the inputs that are never flashed for validation exceptions.
+     *
+     * @var array
+     */
+    protected $dontFlash = [
+        'password',
+        'password_confirmation',
+    ];
+
+    /**
+     * Report or log an exception.
+     *
+     * @param  \Exception  $exception
+     * @return void
+     *
+     * @throws \Exception
+     */
+    public function report(Exception $exception)
+    {
+        parent::report($exception);
+    }
+
+    /**
+     * Render an exception into an HTTP response.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Exception  $exception
+     * @return \Symfony\Component\HttpFoundation\Response
+     *
+     * @throws \Exception
+     */
+    public function render($request, Exception $exception)
+    {
+        return parent::render($request, $exception);
+    }
+}

+ 87 - 0
app/Exports/CommonExport.php

@@ -0,0 +1,87 @@
+<?php
+
+namespace App\Exports;
+
+
+use Illuminate\Support\Collection;
+use Illuminate\Support\Facades\Redis;
+use Maatwebsite\Excel\Concerns\FromCollection;
+
+use Maatwebsite\Excel\Concerns\WithEvents;     // 自动注册事件监听器
+use Maatwebsite\Excel\Concerns\WithStrictNullComparison;    // 导出 0 原样显示,不为 null
+use Maatwebsite\Excel\Events\AfterSheet;
+
+
+
+
+class CommonExport implements FromCollection, WithEvents, WithStrictNullComparison
+{
+
+    public $data;
+
+    /**
+     * @return \Illuminate\Support\Collection
+     */
+    public function __construct($data)
+    {
+        $this->data = $data;
+    }
+
+    /**
+     * 导出数据的处理
+     * @return array
+     */
+    public function registerEvents(): array
+    {
+        //这边处理数据格式
+
+        //关于表单的合并
+        $params = $this->data['params'];
+
+        $style = [
+            AfterSheet::class => function (AfterSheet $event) use($params) {
+                $count = count($this->data);
+
+                //设置区域单元格水平居中
+                $event->sheet->getDelegate()->getStyle('A1:'.'BZ'.($count+1))->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
+
+
+                //合并相关
+                $merge = $params['merge'];
+                $event->sheet->getDelegate()->setMergeCells($merge);
+            },
+        ];
+
+        return $style;
+
+    }
+
+
+    //数组转集合
+    public function collection()
+    {
+        return new Collection($this->createData());
+    }
+    //业务代码
+    public function createData()
+    {
+        $data = $this->export();
+        return $data;
+
+    }
+
+    private function export(){
+//        var_dump($this->data);die;
+        $data = $this->data['data'];
+        $list = [];
+        foreach ($data as $v){
+            $list[] = $v;
+        }
+        return $list;
+    }
+
+
+
+
+
+}

+ 133 - 0
app/Exports/Exports.php

@@ -0,0 +1,133 @@
+<?php
+
+namespace App\Exports;
+
+
+use Illuminate\Support\Collection;
+use Illuminate\Support\Facades\Redis;
+use Maatwebsite\Excel\Concerns\FromCollection;
+
+use Maatwebsite\Excel\Concerns\WithCustomValueBinder;
+use Maatwebsite\Excel\Concerns\WithEvents;     // 自动注册事件监听器
+use Maatwebsite\Excel\Concerns\WithHeadings;
+use Maatwebsite\Excel\Concerns\WithStrictNullComparison;    // 导出 0 原样显示,不为 null
+use Maatwebsite\Excel\Events\AfterSheet;
+use PhpOffice\PhpSpreadsheet\Cell\Cell;
+use PhpOffice\PhpSpreadsheet\Cell\DataType;
+use PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder;
+
+
+class Exports extends DefaultValueBinder implements WithCustomValueBinder , FromCollection, WithEvents, WithStrictNullComparison,withHeadings
+{
+
+    /**
+     * @return \Illuminate\Support\Collection
+     */
+    public function __construct($data,$type=1,$headers)
+    {
+        $this->data = $data;
+        $this->type = $type;
+        $this->headers = $headers;
+    }
+
+    public function registerEvents(): array
+    {
+        //区分不通状态的合同导出,格式不同
+            $type = $this->type.'_set';
+            return $this->$type();
+    }
+
+    //数组转集合
+    public function collection()
+    {
+        return new Collection($this->createData());
+    }
+    //业务代码
+    public function createData()
+    {
+        $name = $this->type;
+        $data = $this->export();
+        return $data;
+
+    }
+
+    public function bindValue(Cell $cell, $value)
+    {
+        if (is_numeric($value)) {
+            $cell->setValueExplicit($value, DataType::TYPE_STRING2);
+
+            return true;
+        }
+
+        // else return default behavior
+        return parent::bindValue($cell, $value);
+    }
+
+    //use Maatwebsite\Excel\Concerns\WithColumnFormatting;
+    //use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
+//    public function columnFormats(): array
+//    {
+//        return [
+//            'F' => NumberFormat::FORMAT_NUMBER,
+//        ];
+//    }
+
+    // 自定义表头,需实现withHeadings接口
+    public function headings(): array
+    {
+        return $this->headers;
+    }
+
+    private function export(){
+        $list = [];
+        foreach ($this->data as $v){
+            $list[] = $v;
+        }
+        return $list;
+    }
+
+    private function production_order_set(){
+        return [
+            AfterSheet::class => function (AfterSheet $event) {
+                $count = count($this->data);
+
+                //设置区域单元格水平居中
+                $event->sheet->getDelegate()->getStyle('A1:'.'M'.($count+1))->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
+
+                // 定义列宽度
+                $widths = ['A' => 20, 'B' => 20, 'C' => 20, 'D' => 20, 'E' => 20, 'F' => 35, 'G' => 25, 'H' => 25, 'I' => 25, 'J' => 25];
+                foreach ($widths as $k => $v) {
+                    // 设置列宽度
+                    $event->sheet->getDelegate()->getColumnDimension($k)->setWidth($v);
+                }
+
+                $row = 2;
+                //设置字段
+                foreach ($this->data as $item) {
+                    $event->sheet->setCellValue('A'.$row, $item['production_time']);
+                    $event->sheet->setCellValue('B'.$row, $item['production_no']);
+                    $event->sheet->setCellValue('C'.$row, $item['out_order_no_time']);
+                    $event->sheet->setCellValue('D'.$row, $item['out_order_no']);
+                    $event->sheet->setCellValue('E'.$row, $item['customer_no']);
+                    $event->sheet->setCellValue('F'.$row, $item['customer_name']);
+                    $event->sheet->setCellValue('G'.$row, $item['table_header_mark']);
+                    $event->sheet->setCellValue('H'.$row, $item['product_no']);
+                    $event->sheet->setCellValue('I'.$row, $item['product_title']);
+                    $event->sheet->setCellValue('J'.$row, $item['product_size']);
+                    $event->sheet->setCellValue('K'.$row, $item['product_unit']);
+                    $event->sheet->setCellValue('L'.$row, $item['order_quantity']);
+                    $event->sheet->setCellValue('M'.$row, $item['production_quantity']);
+                    $event->sheet->setCellValue('N'.$row, $item['not_production']);
+                    $event->sheet->setCellValue('O'.$row, $item['technology_material']);
+                    $event->sheet->setCellValue('P'.$row, $item['technology_name']);
+                    $event->sheet->setCellValue('Q'.$row, $item['wood_name']);
+                    $event->sheet->setCellValue('R'.$row, $item['process_mark']);
+                    $event->sheet->setCellValue('S'.$row, $item['table_body_mark']);
+                    $event->sheet->setCellValue('T'.$row, $item['out_crt_man']);
+
+                    $row++; // 行数增加
+                }
+            },
+        ];
+    }
+}

+ 23 - 0
app/Exports/MyExport.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace App\Exports;
+
+use Maatwebsite\Excel\Facades\Excel;
+
+
+
+
+class MyExport {
+
+
+    public function commonExport($data,$path = ''){
+
+        $param = $data;
+        $export = new CommonExport($param);
+
+        Excel::store($export, $path);
+        return ['file'=>$path];
+    }
+
+
+}

+ 90 - 0
app/Http/Controllers/Api/BaseController.php

@@ -0,0 +1,90 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Http\Controllers\Controller;
+use App\Models\SystemL;
+use App\Service\DisPatchAppService;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Storage;
+
+class BaseController extends Controller
+{
+    public $user_info;
+    public function __construct()
+    {
+    }
+
+    // 返回json数据
+    protected function json_return($code=200,$msg="Success",$data=[]){
+        if(!is_array($data)&&!is_object($data)) {
+            $msg = $data;
+            $data = '';
+        }
+        if(empty($msg)) $msg = '操作成功';
+        return ['code'=>$code,'msg'=>$msg,'data'=>$data];
+    }
+
+
+    //用户行为记录,暂时放这里具体用不用后期再加
+    public function user_log($data,$user,$id,$perm_id,$remark){
+
+    }
+
+
+
+
+    //用于保存图片
+    public function save_pic(Request $request){
+        // 获取文件相关信息
+        $file = $request->file('file');
+        $ext = $file->getClientOriginalExtension();     // 扩展名
+        $realPath = $file->getRealPath();   //临时文件的绝对路径
+
+        $ext = strtolower($ext);
+        $rule = ['jpg', 'png', 'gif', "jpeg"];
+        if (!in_array($ext, $rule)) {
+            return '图片格式为jpg,png,gif';
+        }
+
+        // 上传文件
+        $file_name = time().rand(1000,9999);
+        $filename =  $file_name.'.' . $ext;
+        // 使用我们新建的uploads本地存储空间(目录)
+        Storage::disk('public')->put('pic/'.$filename, file_get_contents($realPath));
+
+        return $this->json_return(200,'上传成功' ,['url'=>'/api/pic/'.$file_name]);
+    }
+
+    public function get_pic($file_name){
+
+        if(file_exists(storage_path().'/app/public/pic/'.$file_name.'.png')){
+            $ext = 'png';
+        }elseif(file_exists(storage_path().'/app/public/pic/'.$file_name.'.jpeg')){
+            $ext = 'jpeg';
+        }elseif(file_exists(storage_path().'/app/public/pic/'.$file_name.'.jpg')){
+            $ext = 'jpg';
+        }elseif(file_exists(storage_path().'/app/public/pic/'.$file_name.'.gif')){
+            $ext = 'gif';
+        }else{
+            $ext = 'xlsx';
+//            if(file_exists(storage_path().'/app/public/pic/basic/'.$file_name.'.gif')){
+//                return response()->file(storage_path().'/app/public/pic/'.$file_name.'.'.$ext);
+//            }else{
+//                return response()->file(storage_path().'/app/public/pic/'.$file_name.'.'.$ext);
+//            }
+        }
+        return response()->file(storage_path().'/app/public/pic/'.$file_name.'.'.$ext);
+    }
+
+    public function get_basic_pic($file_name){
+        return response()->file(storage_path().'/app/public/pic/basic/'.$file_name.'.png');
+
+    }
+
+
+
+
+
+}

+ 104 - 0
app/Http/Controllers/Api/BomController.php

@@ -0,0 +1,104 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\BomService;
+use Illuminate\Http\Request;
+
+
+class BomController extends BaseController
+{
+
+
+
+
+
+    public function add(Request $request)
+    {
+
+
+        $service = new BomService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->add($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function edit(Request $request)
+    {
+
+
+        $service = new BomService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function del(Request $request)
+    {
+
+
+        $service = new BomService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function bomList(Request $request)
+    {
+
+
+        $service = new BomService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->bomList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function bomDetail(Request $request)
+    {
+
+
+        $service = new BomService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->bomDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+}

+ 161 - 0
app/Http/Controllers/Api/BoxController.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\Box\BoxService;
+use App\Service\Oa\OaService;
+use Illuminate\Http\Request;
+
+
+class BoxController extends BaseController
+{
+
+
+
+
+
+    public function boxIn(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->boxIn($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function transportBoxIn(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->transportBoxIn($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function boxDetail(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->boxDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+    public function boxProductList(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->boxProductList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+    public function boxOrderDetail(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->boxOrderDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+    public function boxOrderDetailByTop(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->boxOrderDetailByTop($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+    public function boxOrderDetailByOrderNo(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->boxOrderDetailByOrderNo($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function boxOrderGroup(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->boxOrderGroup($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+    public function transportNo(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->transportNo($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+    public function delBoxDetail(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->delBoxDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+}

+ 16 - 0
app/Http/Controllers/Api/CloudDataController.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Jobs\CloudDataJob;
+use App\Jobs\ProcessDataJob;
+use App\Service\CloudDataService;
+use Illuminate\Http\Request;
+
+//有人云
+class CloudDataController extends BaseController
+{
+    public function getCloudData(Request $request){
+        CloudDataJob::dispatch([])->onQueue('cloud_has_man');
+    }
+}

+ 38 - 0
app/Http/Controllers/Api/DeleteOrderController.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\DeleteOrderService;
+use Illuminate\Http\Request;
+use Symfony\Component\Process\Process;
+
+
+class DeleteOrderController extends BaseController
+{
+    public function del(Request $request)
+    {
+        $service = new DeleteOrderService();
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function test(){
+        ini_set('default_charset', 'UTF-8');
+        $process = Process::fromShellCommandline('php D:\phpstudy_pro\WWW\cs.php');
+        //$process->run();//等待外部命令执行完毕
+        $process->start();
+        dump("直接输出222不等待!");
+
+        if ($process->isSuccessful()) {
+            dump($process->getOutput() . '1');
+        } else {
+            dump($process->getErrorOutput() . '2');
+        }dump(1);die;
+    }
+}

+ 38 - 0
app/Http/Controllers/Api/Device/BaseController.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Http\Controllers\Api\Device;
+
+use App\Http\Controllers\Controller;
+
+class BaseController extends Controller
+{
+    public $user_info;
+    public function __construct()
+    {
+    }
+
+    // 返回json数据
+    protected function json_return($code=200,$msg="Success",$data=[]){
+        if(!is_array($data)&&!is_object($data)) {
+            $msg = $data;
+            $data = '';
+        }
+        if(empty($msg)) $msg = '操作成功';
+        return ['code'=>$code,'msg'=>$msg,'data'=>$data];
+    }
+
+
+    //用户行为记录,暂时放这里具体用不用后期再加
+    public function user_log($data,$user,$id,$perm_id,$remark){
+
+    }
+
+
+
+
+
+
+
+
+
+}

+ 22 - 0
app/Http/Controllers/Api/Device/DeviceController.php

@@ -0,0 +1,22 @@
+<?php
+namespace App\Http\Controllers\Api\Device;
+
+use App\Service\Device\DeviceService;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
+
+
+class DeviceController extends BaseController
+{
+    public function deviceList(Request $request){
+        $service = new DeviceService();
+        list($status,$data) = $service->deviceList();
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+}

+ 117 - 0
app/Http/Controllers/Api/DispatchController.php

@@ -0,0 +1,117 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\DispatchService;
+use Illuminate\Http\Request;
+
+
+class DispatchController extends BaseController
+{
+    public function add(Request $request)
+    {
+        $service = new DispatchService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->add($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function edit(Request $request)
+    {
+        $service = new DispatchService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function del(Request $request)
+    {
+        $service = new DispatchService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+
+    public function orderList(Request $request)
+    {
+        $service = new DispatchService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+
+    public function orderDetail(Request $request)
+    {
+        $service = new DispatchService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function dispatchOrderList(Request $request)
+    {
+        $service = new DispatchService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->dispatchOrderList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function dispatchMobileOrderList(Request $request)
+    {
+        $service = new DispatchService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->dispatchMobileOrderList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function dispatchMobileOrderDetailsList(Request $request)
+    {
+        $service = new DispatchService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->dispatchMobileOrderDetailsList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 357 - 0
app/Http/Controllers/Api/EmployeeController.php

@@ -0,0 +1,357 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\EmployeeService;
+use App\Service\SysMenuService;
+use Illuminate\Http\Request;
+
+
+class EmployeeController extends BaseController
+{
+
+
+
+
+
+    public function employeeEdit(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->userData->toArray();
+        list($status,$data) = $service->employeeEdit($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function employeeAdd(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->userData->toArray();
+        list($status,$data) = $service->employeeAdd($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function employeeDel(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->employeeDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function employeeList(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->employeeList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+    public function roleEdit(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->roleEdit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function roleAdd(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->roleAdd($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function roleDel(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->roleDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function roleList(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->roleList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+    public function departEdit(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->departEdit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function departAdd(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->departAdd($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function departDel(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->departDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function departList(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->departList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function teamEdit(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->teamEdit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function teamAdd(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->teamAdd($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function teamDel(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->teamDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function teamList(Request $request)
+    {
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->teamList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function teamDetail(Request $request)
+    {
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->teamDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+
+    public function employeeDepart(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->employeeDepart($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+    public function employeeTeam(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->employeeTeam($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+    public function employeeRole(Request $request)
+    {
+
+
+        $service = new EmployeeService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->employeeRole($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+}

+ 61 - 0
app/Http/Controllers/Api/EquipmentController.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Service\EquipmentService;
+use Illuminate\Http\Request;
+
+class EquipmentController extends BaseController
+{
+    public function equipmentList(Request $request)
+    {
+        $service = new EquipmentService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->equipmentList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function equipmentEdit(Request $request)
+    {
+        $service = new EquipmentService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->equipmentEdit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function equipmentAdd(Request $request)
+    {
+        $service = new EquipmentService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->equipmentAdd($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function equipmentDel(Request $request)
+    {
+        $service = new EquipmentService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->equipmentDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 19 - 0
app/Http/Controllers/Api/ErrorOperationController.php

@@ -0,0 +1,19 @@
+<?php
+namespace App\Http\Controllers\Api;
+
+use App\Service\ErrorOperationService;
+use Illuminate\Http\Request;
+
+class ErrorOperationController extends BaseController
+{
+    public function errorList(Request $request){
+        $service = new ErrorOperationService();
+        list($status,$data) = $service->errorList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 89 - 0
app/Http/Controllers/Api/FinishedOrderController.php

@@ -0,0 +1,89 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\FinishedOrderService;
+use Illuminate\Http\Request;
+
+
+class FinishedOrderController extends BaseController
+{
+    public function add(Request $request)
+    {
+        $service = new FinishedOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->add($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function edit(Request $request)
+    {
+        $service = new FinishedOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function del(Request $request)
+    {
+        $service = new FinishedOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function orderList(Request $request)
+    {
+        $service = new FinishedOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+
+    public function orderDetail(Request $request)
+    {
+        $service = new FinishedOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function mobileAdd(Request $request){
+        $service = new FinishedOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->mobileAdd($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 155 - 0
app/Http/Controllers/Api/FyyOrderController.php

@@ -0,0 +1,155 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\FyyOrderService;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Redis;
+
+
+class FyyOrderController extends BaseController
+{
+    public function setFyy(Request $request)
+    {
+        $data = $request->all();
+
+        $array = [
+            'sqlserver_host' => $data['host'] ?? '',
+            'sqlserver_port' => $data['port'] ?? 0,
+            'sqlserver_zt' => $data['zt'] ?? '',
+            'sqlserver_account' => $data['account'] ?? '',
+            'sqlserver_password' => $data['password'] ?? '',
+            'sqlserver_host_api' => $data['host_api'] ?? '',
+        ];
+        Redis::set('fyy_sql_server',json_encode($array));
+        Redis::expire('fyy_sql_server', 86400);
+        dump('ok');die;
+    }
+
+    public function fyySaveOutOrder(Request $request)
+    {
+        $service = new FyyOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->fyySaveOutOrder($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function add(Request $request)
+    {
+        $service = new FyyOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->add($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function edit(Request $request)
+    {
+        $service = new FyyOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function del(Request $request)
+    {
+        $service = new FyyOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function orderList(Request $request)
+    {
+        $service = new FyyOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function orderDetail(Request $request)
+    {
+        $service = new FyyOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function fyyRefreshOnHandQuantity(Request $request){
+        $service = new FyyOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->fyyRefreshOnHandQuantity($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function orderMobileList(Request $request)
+    {
+        $service = new FyyOrderService();
+        list($status,$data) = $service->orderMobileList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function getShipmentOrder(Request $request){
+        $service = new FyyOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->getShipmentOrder($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function getOutOrderNum(Request $request){
+        $service = new FyyOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->getOutOrderNum($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 64 - 0
app/Http/Controllers/Api/HeaderWordController.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\HeaderWord\HeaderWordHookService;
+use App\Service\ProcessService;
+use Illuminate\Http\Request;
+
+
+class HeaderWordController extends BaseController
+{
+    public function getHeaderWord(Request $request)
+    {
+
+
+        $service =  HeaderWordHookService::getInstance();
+        $data = $request->all();
+        list($status,$data) = $service->getHeaderWord($data);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function getHeaderSettings(Request $request){
+        $service =  HeaderWordHookService::getInstance();
+        $data = $request->all();
+        list($status,$data) = $service->getHeaderSettings($data);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function add(Request $request){
+        $service =  HeaderWordHookService::getInstance();
+        $data = $request->all();
+        list($status,$data) = $service->add($data);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function detail(Request $request){
+        $service =  HeaderWordHookService::getInstance();
+        $data = $request->all();
+        list($status,$data) = $service->detail($data);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 61 - 0
app/Http/Controllers/Api/LoginController.php

@@ -0,0 +1,61 @@
+<?php
+namespace App\Http\Controllers\Api;
+
+use App\Service\EmployeeService;
+use App\Service\TokenService;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Facades\Redis;
+
+//登录
+class LoginController extends BaseController
+{
+    const MOBILE = '[mobile]';// 手机端
+    const PERSONAL_COMPUTER = '[personalComputer]';// 电脑端
+
+    public static $port = [
+        self::MOBILE => '',
+        self::PERSONAL_COMPUTER => '',
+    ];
+
+    public function login(Request $request){
+        $data = $request->only("account","password");
+
+        //登录
+
+        $result = (new EmployeeService())->loginRule($data);
+        list($bool, $return) = $result;
+        if(! $bool) return $this->json_return(201,'',$return);
+
+        //生成token
+        $jwtToken = TokenService::getToken($return['id']);
+        $jwtToken = self::PERSONAL_COMPUTER . $jwtToken;
+
+        return $this->json_return(200,'', ['token' => $jwtToken, 'emp_name'=>$return['name']]);
+    }
+
+    public function loginMobile(Request $request){
+        $data = $request->only("account","password");
+
+        //登录
+        $result = (new EmployeeService())->loginRule($data);
+        list($bool, $return) = $result;
+        if(! $bool) return $this->json_return(201,'',$return);
+
+        //生成token
+        $jwtToken = TokenService::getToken($return['id']);
+        $jwtToken = self::MOBILE . $jwtToken;
+
+        return $this->json_return(200,'', ['token' => $jwtToken, 'emp_name'=>$return['name']]);
+    }
+
+    //设置账套缓存
+    private function setSqlServer($data,$user_id){
+        $array = [
+            'sqlserver_zt' => $data['sqlserver_zt'] ?? '',
+        ];
+        $key = 'fyy_sql_server' . $user_id;
+        Redis::set($key,json_encode($array));
+        Redis::expire($key, 86400);
+    }
+}

+ 164 - 0
app/Http/Controllers/Api/MaterialController.php

@@ -0,0 +1,164 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\MaterialService;
+use App\Service\MeasureService;
+use App\Service\SysMenuService;
+use Illuminate\Http\Request;
+
+
+class MaterialController extends BaseController
+{
+
+
+
+
+
+    public function basicMaterialList(Request $request)
+    {
+
+
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->basicMaterialList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function basicMaterialEdit(Request $request)
+    {
+
+
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->basicMaterialEdit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function basicMaterialDel(Request $request)
+    {
+
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->basicMaterialDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function basicMaterialAdd(Request $request)
+    {
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->basicMaterialAdd($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function materialList(Request $request)
+    {
+
+
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->materialList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }    public function materialDetail(Request $request)
+    {
+
+
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->materialDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function materialEdit(Request $request)
+    {
+
+
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->materialEdit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function materialDel(Request $request)
+    {
+
+
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->materialDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function materialAdd(Request $request)
+    {
+
+
+        $service = new MaterialService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->materialAdd($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+}

+ 80 - 0
app/Http/Controllers/Api/MeasureController.php

@@ -0,0 +1,80 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\MeasureService;
+use Illuminate\Http\Request;
+
+
+class MeasureController extends BaseController
+{
+    public function add(Request $request)
+    {
+        $service = new MeasureService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->add($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function edit(Request $request)
+    {
+
+
+        $service = new MeasureService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function del(Request $request)
+    {
+
+
+        $service = new MeasureService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function measureList(Request $request)
+    {
+
+
+        $service = new MeasureService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->measureList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+}

+ 187 - 0
app/Http/Controllers/Api/OaController.php

@@ -0,0 +1,187 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\Oa\OaService;
+use Illuminate\Http\Request;
+
+
+class OaController extends BaseController
+{
+
+
+
+
+
+    public function oaList(Request $request)
+    {
+
+
+        $service = new OaService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->oaList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function oaDetail(Request $request)
+    {
+
+
+        $service = new OaService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->oaDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function oaAdd(Request $request)
+    {
+
+
+        $service = new OaService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->oaAdd($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function oaEdit(Request $request)
+    {
+
+
+        $service = new OaService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->oaEdit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function oaDel(Request $request)
+    {
+
+
+        $service = new OaService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->oaDel($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function createOaOrder(Request $request)
+    {
+
+
+        $service = new OaService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->createOaOrder($request->all());
+
+        if($status){
+            return $this->json_return($status,'',$data);
+        }else{
+            return $this->json_return(400,$data);
+        }
+
+    }
+
+
+
+    public function oaOrderList(Request $request)
+    {
+
+
+        $service = new OaService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->oaOrderList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+    public function oaOrderDetail(Request $request)
+    {
+
+
+        $service = new OaService();
+        $user = $request->userData->toArray();
+        list($status,$data) = $service->oaOrderDetail($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+    public function oaCheck(Request $request)
+    {
+
+        $service = new OaService();
+        $user = $request->userData->toArray();
+        list($status,$data) = $service->oaCheck($request->all(),$user);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function oaSubType(Request $request)
+    {
+
+
+        $service = new OaService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->oaSubType($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+
+
+
+
+
+
+
+}

+ 70 - 0
app/Http/Controllers/Api/OrderBoxController.php

@@ -0,0 +1,70 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\Order\OrderBoxService;
+use App\Service\Order\OrderTagService;
+use App\Service\OrderService;
+use Illuminate\Http\Request;
+
+
+class OrderBoxController extends BaseController
+{
+
+
+
+
+
+    public function boxDetail(Request $request)
+    {
+
+
+        $service = new OrderBoxService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->box_detail($request->all()['order_no']);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function boxIn(Request $request)
+    {
+
+
+        $service = new OrderBoxService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->box_in($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function boxOut(Request $request)
+    {
+
+
+        $service = new OrderBoxService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->box_out($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+}

+ 104 - 0
app/Http/Controllers/Api/OrderController.php

@@ -0,0 +1,104 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\OrderService;
+use Illuminate\Http\Request;
+
+
+class OrderController extends BaseController
+{
+
+
+
+
+
+    public function add(Request $request)
+    {
+
+
+        $service = new OrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->add($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function edit(Request $request)
+    {
+
+
+        $service = new OrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function del(Request $request)
+    {
+
+
+        $service = new OrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function OrderList(Request $request)
+    {
+
+
+        $service = new OrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->OrderList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function orderDetail(Request $request)
+    {
+
+
+        $service = new OrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+}

+ 37 - 0
app/Http/Controllers/Api/OrderTagController.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\Order\OrderTagService;
+use App\Service\OrderService;
+use Illuminate\Http\Request;
+
+
+class OrderTagController extends BaseController
+{
+
+
+
+
+
+    public function tagDetail(Request $request)
+    {
+
+
+        $service = new OrderTagService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->getOrderTag($request->all()['order_no']);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+}

+ 76 - 0
app/Http/Controllers/Api/OrderTransportController.php

@@ -0,0 +1,76 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\Order\OrderTagService;
+use App\Service\Order\OrderTransportService;
+use App\Service\OrderService;
+use Illuminate\Http\Request;
+
+
+class OrderTransportController extends BaseController
+{
+
+
+
+
+
+    public function transportDetail(Request $request)
+    {
+
+
+        $service = new OrderTransportService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->transportDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+    public function boxTransport(Request $request)
+    {
+
+
+        $service = new OrderTransportService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->boxTransport($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+    public function transportConfirm(Request $request)
+    {
+
+
+        $service = new OrderTransportService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->transportConfirm($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+
+
+}

+ 140 - 0
app/Http/Controllers/Api/ProcessController.php

@@ -0,0 +1,140 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\ProcessService;
+use Illuminate\Http\Request;
+
+
+class ProcessController extends BaseController
+{
+    public function basicProcessList(Request $request)
+    {
+
+
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->basicProcessList($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function basicProcessEdit(Request $request)
+    {
+
+
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->basicProcessEdit($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function basicProcessAdd(Request $request)
+    {
+
+
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->basicProcessAdd($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function basicProcessDel(Request $request)
+    {
+
+
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->basicProcessDel($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+    public function processList(Request $request)
+    {
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->processList($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function processEdit(Request $request)
+    {
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->processEdit($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function processAdd(Request $request)
+    {
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->processAdd($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function processDel(Request $request)
+    {
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->processDel($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function processDetail(Request $request)
+    {
+        $service = new ProcessService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->processDetail($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 89 - 0
app/Http/Controllers/Api/ProductController.php

@@ -0,0 +1,89 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\MeasureService;
+use App\Service\ProductService;
+use App\Service\SysMenuService;
+use Illuminate\Http\Request;
+
+
+class ProductController extends BaseController
+{
+
+
+
+
+
+    public function add(Request $request)
+    {
+
+
+        $service = new ProductService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->add($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function edit(Request $request)
+    {
+
+
+        $service = new ProductService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function del(Request $request)
+    {
+
+
+        $service = new ProductService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function productList(Request $request)
+    {
+
+
+        $service = new ProductService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->productList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+
+
+}

+ 97 - 0
app/Http/Controllers/Api/ProductionOrderController.php

@@ -0,0 +1,97 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\ProductionOrderService;
+use Illuminate\Http\Request;
+
+
+class ProductionOrderController extends BaseController
+{
+    public function add(Request $request)
+    {
+        $service = new ProductionOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->add($request->all(),$userData);
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function edit(Request $request)
+    {
+        $service = new ProductionOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function del(Request $request)
+    {
+        $service = new ProductionOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+
+    public function orderList(Request $request)
+    {
+        $service = new ProductionOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+
+    public function orderDetail(Request $request)
+    {
+        $service = new ProductionOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->orderDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function productionExport(Request $request)
+    {
+        $service = new ProductionOrderService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->productionExport($request->all());
+
+        if($status){
+            return $this->json_return(200,'',['file'=>$data]);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //获取文件的位置
+    public function getItemFile($file_name){
+        $path = storage_path() . "/app/public/productionOrder/".$file_name;
+        return response()->file($path)->deleteFileAfterSend(true);
+    }
+}

+ 154 - 0
app/Http/Controllers/Api/ReportFormsController.php

@@ -0,0 +1,154 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Model\SystemL;
+use App\Service\ReportFormsService;
+use Illuminate\Http\Request;
+
+class ReportFormsController extends BaseController
+{
+    //生产进度
+    public function productionReport(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->productionReport($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //班组
+    public function teamReport(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->teamReport($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //班组 详情
+    public function teamReportDetail(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->teamReportDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //不良品
+    public function badGoodsReport(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->badGoodsReport($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //不良品 详情
+    public function badGoodsReportDetail(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->badGoodsReportDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //不良品原因
+    public function badGoodsReasonReport(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->badGoodsReasonReport($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //不良品原因详情
+    public function badGoodsReasonReportDetail(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->badGoodsReasonReportDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function deviceList(Request $request){
+        $device = SystemL::$device;
+        $data = [];
+        foreach ($device as $k => $v){
+            $data[] = [
+                'device_name' => $k,
+                'device_no' => $v
+            ];
+        }
+        return $this->json_return(200,'',$data);
+    }
+
+    //设备统计报表
+    public function deviceStatisticsReport(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->deviceStatisticsReport($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //设备统计报表详情
+    public function deviceStatisticsReportDetail(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->deviceStatisticsReportDetail($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //设备统计报表
+    public function deviceStatisticsReportChart(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->deviceStatisticsReportChart($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    //设备统计OEE报表
+    public function deviceStatisticsReportOEEChart(Request $request){
+        $service = new ReportFormsService();
+        list($status,$data) = $service->deviceStatisticsReportOEEChart($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 61 - 0
app/Http/Controllers/Api/ScrappController.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Service\ScrappService;
+use Illuminate\Http\Request;
+
+class ScrappController extends BaseController
+{
+    public function scrappList(Request $request)
+    {
+        $service = new ScrappService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->scrappList($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function scrappEdit(Request $request)
+    {
+        $service = new ScrappService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->scrappEdit($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function scrappAdd(Request $request)
+    {
+        $service = new ScrappService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->scrappAdd($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function scrappDel(Request $request)
+    {
+        $service = new ScrappService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->scrappDel($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 524 - 0
app/Http/Controllers/Api/ScreenController.php

@@ -0,0 +1,524 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Model\Box;
+use App\Model\BoxDetail;
+use App\Model\DispatchSub;
+use App\Model\OrdersProductProcess;
+use App\Model\Process;
+use App\Model\SaleOrdersProduct;
+use App\Model\SystemL;
+use App\Service\ReportFormsService;
+use Carbon\Carbon;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\DB;
+
+/**
+ * 大屏数据展示
+ * Class ScreenController
+ * @package App\Http\Controllers\Api
+ */
+class ScreenController extends BaseController
+{
+    /**
+     * 产值数据全览
+     * @param Request $request
+     * @return array
+     */
+    public function output_value(Request $request){
+        $currentYear = Carbon::now()->year;
+        $lastYear = $currentYear - 1;
+        $currentMonth = Carbon::now()->month;
+
+        $totalValueAllTime = SaleOrdersProduct::where('del_time',0)->sum('finished_num');
+        $totalValueLastYear = SaleOrdersProduct::where('del_time',0)->whereRaw("YEAR(FROM_UNIXTIME(crt_time)) = $lastYear")->sum('finished_num');
+        $totalValueCurrentYearMonth = SaleOrdersProduct::where('del_time',0)->whereRaw("YEAR(FROM_UNIXTIME(crt_time)) = $currentYear AND MONTH(FROM_UNIXTIME(crt_time)) = $currentMonth")->sum('finished_num');
+
+        return $this->json_return(200,'',['total_time'=>$totalValueAllTime, 'total_last_year'=>$totalValueLastYear, 'total_current_month'=>$totalValueCurrentYearMonth]);
+    }
+
+    /**
+     * 项目进度
+     * @param Request $request
+     * @return array
+     */
+    public function order_process1(Request $request) {
+        $result = SaleOrdersProduct::where('del_time',0)
+            ->select(DB::raw('sum(order_quantity) as total'), DB::raw('sum(finished_num) as finished_num'),'out_order_no as Code','customer_name as CustomerName')
+            ->groupBy('out_order_no')
+            ->get()->toArray();
+
+        if(! empty($result)){
+            foreach ($result as $key => $value){
+                $result[$key]['rate'] = number_format($value['finished_num'] / $value['total'],2) * 100;
+                unset($result[$key]['total']);
+                unset($result[$key]['finished_num']);
+            }
+            $rate = array_column($result, 'rate'); // 提取列作为排序依据
+            array_multisort($rate, SORT_DESC,$result);
+        }
+
+        return $this->json_return(200,'',$result);
+    }
+
+    /**
+     * 历史项目 在手项目
+     * @param Request $request
+     * @return array
+     */
+    public function project_region(Request $request){
+        $all = SaleOrdersProduct::where('del_time',0)
+            ->whereColumn('order_quantity','=','finished_num')
+            ->select('out_order_no')
+            ->groupBy('out_order_no')
+            ->get()
+            ->toArray();
+        $all = array_column($all,'out_order_no');
+
+        $not_all = SaleOrdersProduct::where('del_time',0)
+            ->whereColumn('order_quantity','<>','finished_num')
+            ->select('out_order_no')
+            ->groupBy('out_order_no')
+            ->get()
+            ->toArray();
+        $not_all = array_column($not_all,'out_order_no');
+        $all = array_diff($all, $not_all);
+
+        $arr = [
+            "all_num" => count($all),
+            "num" => count($not_all),
+        ];
+        return $this->json_return(200,'',$arr);
+    }
+
+    /**
+     * 本月质量
+     * @param Request $request
+     * @return array
+     */
+    public function output_value_month1(Request $request){
+        $date = date('Ymd',time());
+
+        $startDate = strtotime(date('Y-m-01 00:00:00', time()));
+        $endDate = strtotime(date('Y-m-t 23:59:59', time()));
+        //工序-----------------------------
+        $model = new OrdersProductProcess(['channel' => $date]);//当前季度的数据
+        $data = $model->where('del_time',0)
+            ->where('status',4)
+            ->select('crt_time')
+            ->where('crt_time','>=',$startDate)
+            ->where('crt_time','<=',$endDate)
+            ->get()->toArray();
+
+        $return = [];
+        if(! empty($data)){
+            foreach ($data as $value){
+                $crt_time = date('Y-m-d',$value['crt_time']);
+                if(isset($return[$crt_time])){
+                    $return[$crt_time]['num'] += 1;
+                }else{
+                    $return[$crt_time] = [
+                        'num' => 1,
+                        'value' => $crt_time
+                    ];
+                }
+            }
+        }
+        $return = array_values($return);
+        return $this->json_return(200,'',$return);
+    }
+
+    /**
+     * 产量趋势图
+     * @param Request $request
+     * @return array
+     */
+    public function output_value_efficiency1(Request $request){
+        // 获取当前时间戳
+        $currentTimestamp = time();
+        // 输出过去两周的起止时间(包括当前日期)
+        $timestamp = strtotime("-13 days", $currentTimestamp);
+        $startOfDay = strtotime(date('Y-m-d 00:00:00', $timestamp));
+        $endOfDay = strtotime(date('Y-m-d 23:59:59', $currentTimestamp));
+
+        $box = Box::where('del_time',0)
+            ->where('crt_time','>=',$startOfDay)
+            ->where('crt_time','<=',$endOfDay)
+            ->select('crt_time','top_order_no','order_no')
+            ->orderBy('crt_time','desc')
+            ->get()->toArray();
+        $result = [];
+        if(! empty($box)){
+            foreach ($box as $value){
+                $model = new BoxDetail(['channel' => $value['top_order_no']]);
+                $map = $model->where('del_time',0)
+                    ->where('order_no',$value['order_no'])
+                    ->select('order_no',DB::raw('sum(num) as num'))
+                    ->groupBy('order_no')
+                    ->pluck('num','order_no')
+                    ->toArray();
+                $output = $map[$value['order_no']] ?? 0;
+                $times = date('Y-m-d',$value['crt_time']);
+                if(isset($result[$times])){
+                    $result[$times]['output'] += $output;
+                }else{
+                    $result[$times] = [
+                        'time' => $times,
+                        'output' => $output
+                    ];
+                }
+            }
+        }
+        $result = array_values($result);
+        return $this->json_return(200,'',$result);
+    }
+
+    //产量趋势图(完工)
+    public function output_value_efficiency(Request $request){
+        // 获取当前时间
+        $date = date('Ymd',time());
+        $model = new OrdersProductProcess(['channel' => $date]);//当前季度的数据
+
+        $data = $model->where('del_time',0)
+            ->where('status',2)
+            ->select('finished_time')
+            ->get()->toArray();
+        $result = [];
+        if(! empty($data)){
+            foreach ($data as $value){
+                $time = date('Y-m-d',$value['finished_time']);
+                if(isset($result[$time])){
+                    $result[$time]['output'] += 1;
+                }else{
+                    $result[$time] = [
+                        'time' => $time,
+                        'output' =>  1
+                    ];
+                }
+            }
+            ksort($result);
+        }
+        $result = array_values($result);
+        return $this->json_return(200,'',$result);
+    }
+
+    /**
+     * 工序负荷全览
+     * @param Request $request
+     * @return array
+     */
+    public function capacity(Request $request){
+        $date = date('Ymd',time());
+
+        //工序-----------------------------
+        $model = new OrdersProductProcess(['channel' => $date]);//当前季度的数据
+        $data = $model->where('del_time',0)
+            ->where('status',2)
+            ->select('finished_time')
+            ->orderBy('finished_time','desc')
+            ->get()->toArray();
+
+        $return = [];
+        if(! empty($data)){
+            foreach ($data as $value){
+                $finished_time = date('Ymd',$value['finished_time']);
+                if(isset($return[$finished_time])){
+                    $return[$finished_time] += 1;
+                }else{
+                    $return[$finished_time] = 1;
+                }
+            }
+        }
+        $maxValue = empty($return) ? 0 : max($return);
+        $today = $return[$date] ?? 0;
+        $rate = $maxValue ? intval($today/$maxValue * 100) : 0;
+        //工序-----------------------------
+
+        //包装-----------------------------
+        $model = new BoxDetail(['channel' => $date]);//当前季度的数据
+        $data = $model->where('del_time',0)
+            ->select('crt_time','num')
+            ->get()->toArray();
+
+        $return = [];
+        if(! empty($data)){
+            foreach ($data as $value){
+                $crt_time = date('Ymd',$value['crt_time']);
+                if(isset($return[$crt_time])){
+                    $return[$crt_time] += $value['num'];
+                }else{
+                    $return[$crt_time] = $value['num'];
+                }
+            }
+        }
+        $maxValue = empty($return) ? 0 : max($return);
+        $today = $return[$date] ?? 0;
+        $rate2 = $maxValue ? intval($today/$maxValue*100) : 0;
+        //包装-----------------------------
+
+        $arr = [
+            [
+                [
+                    "title"=> "压贴",
+                    "rate"=> $rate
+                ],
+                [
+                    "title"=> "包装",
+                    "rate"=> $rate2
+                ]
+            ],
+        ];
+        return $this->json_return(200,'',['data' => $arr]);
+
+    }
+
+    /**
+     * 设备信息
+     * @param Request $request
+     * @return array
+     */
+    public function product_num(Request $request){
+        //数据模型
+        $models = [];
+        foreach (SystemL::$device as $k => $v){
+            $models[$k] = [
+                "machine_day_num"=> 0,
+                "machine_month_num"=> 0,
+                "machine_week_num"=> 0,
+                "break_day_num"=> 0,
+                "break_month_num"=> 0,
+                "break_week_num"=> 0,
+                "start_time"=> '',
+                "day_num"=> 0,
+                "week_num"=> 0,
+                "month_num"=> 0,
+                "rate"=> 0
+            ];
+        }
+
+        //当天的开始与结束时间戳
+        $timestamp_today_start = strtotime(date("Y-m-d 00:00:00",time()));
+        $timestamp_today_end = strtotime(date("Y-m-d 23:59:59",time()));
+
+        //查询当日
+        $today = SystemL::where('time','>=',$timestamp_today_start * 1000)
+            ->where('time','<=',$timestamp_today_end * 1000)
+            ->select('device_name','data_point_name','time')
+            ->whereIn('data_point_name',[SystemL::run,SystemL::work,SystemL::stop,SystemL::standBy])
+            ->get()->toArray();
+        //组织当日数据
+        $this->fillData($today,1,$models);
+
+        //上周时间
+        $previousWeekStartDate = Carbon::now()->subWeek()->startOfWeek();
+        $previousWeekEndDate = Carbon::now()->subWeek()->endOfWeek();
+        //上周开始结束日期
+        $start_week = $previousWeekStartDate->toDateString();
+        $end_week = $previousWeekEndDate->toDateString();
+        $last_week_key = $start_week . $end_week;
+        list($status, $return_last_week) = $this->getRedisData($last_week_key);
+        if(! $status){
+            $previousWeekStartTimeStamp = $previousWeekStartDate->timestamp * 1000;
+            $previousWeekEndTimeStamp = $previousWeekEndDate->timestamp * 1000;
+            //获取上周数据
+            $list_week = SystemL::where('time','>=',$previousWeekStartTimeStamp)
+                ->where('time','<=',$previousWeekEndTimeStamp)
+                ->select('device_name','data_point_name')
+                ->whereIn('data_point_name',[SystemL::run,SystemL::work,SystemL::stop,SystemL::standBy])
+                ->get()->toArray();
+            //组织上周数据
+            $this->fillData($list_week,2,$models);
+            //缓存
+            Cache::put($last_week_key,json_encode($list_week),86400);
+        }else{
+            //有缓存 填充数据 组织上周数据
+            $this->fillData($return_last_week,2,$models);
+        }
+
+        //上月时间
+        $previousMonthStartDate = Carbon::now()->subMonth()->startOfMonth();
+        $previousMonthEndDate = Carbon::now()->subMonth()->endOfMonth();
+        //上月开始结束日期
+        $start_month = $previousMonthStartDate->toDateString();
+        $end_month = $previousMonthEndDate->toDateString();
+        $last_month_key = $start_month . $end_month;
+        list($status, $return_last_month) = $this->getRedisData($last_month_key);
+        if(! $status){
+            $previousMonthStartTimeStamp = $previousMonthStartDate->timestamp * 1000;
+            $previousMonthEndTimeStamp = $previousMonthEndDate->timestamp * 1000;
+            //获取上月数据
+            $list_month = SystemL::where('time','>=',$previousMonthStartTimeStamp)
+                ->where('time','<=',$previousMonthEndTimeStamp)
+                ->select('device_name','data_point_name')
+                ->whereIn('data_point_name',[SystemL::run,SystemL::work,SystemL::stop,SystemL::standBy])
+                ->get()->toArray();
+            //组织上月数据
+            $this->fillData($list_month,3,$models);
+            //缓存
+            Cache::put($last_month_key,json_encode($list_month),86400);
+        }else{
+            //有缓存 填充数据 组织上周数据
+            $this->fillData($return_last_month,3,$models);
+        }
+
+        $return = [];
+        foreach ($models as $key => $value){
+            $value['device_name'] = $key;
+            $return[] = $value;
+        }
+
+        return $this->json_return(200,'',$return);
+    }
+
+    //在制工单
+    public function work_order(Request $request){
+        // 获取当前时间戳
+        $currentTimestamp = time();
+        $timestamp = strtotime("-3 months", $currentTimestamp);
+        $startOfDay = strtotime(date('Y-m-d 00:00:00', $timestamp));
+        $endOfDay = strtotime(date('Y-m-d 23:59:59', $currentTimestamp));
+
+        $result = DispatchSub::where('del_time',0)
+            ->where('crt_time',">=", $startOfDay)
+            ->where('crt_time',"<=", $endOfDay)
+            ->whereColumn('dispatch_quantity','>','finished_num')
+            ->select('dispatch_no as order_no','process_id','product_title','dispatch_quantity as product_num','finished_num as finish_num')
+            ->get()->toArray();
+        if(! empty($result)){
+            $process_id = array_unique(array_column($result,'process_id'));
+            $processMap = Process::whereIn('id',$process_id)
+                ->pluck('title','id')
+                ->toArray();
+            foreach ($result as $key => $value){
+                $result[$key]['procedure'] = $processMap[$value['process_id']] ?? '';
+            }
+        }
+
+        return $this->json_return(200,'',$result);
+    }
+
+    /**
+     * 待加工
+     * @param Request $request
+     * @return array
+     */
+    public function nu_work_order(Request $request){
+        // 获取当前时间戳
+        $currentTimestamp = time();
+        $startOfDay = strtotime(date('Y-m-d 00:00:00', $currentTimestamp));
+
+        $result = DispatchSub::where('del_time',0)
+            ->where('dispatch_time_start',">=", $startOfDay)
+            ->where('finished_num',0)
+            ->select('dispatch_no as order_no','product_title','dispatch_quantity as product_num','process_id')
+            ->get()->toArray();
+
+        if(! empty($result)){
+            $process_id = array_unique(array_column($result,'process_id'));
+            $processMap = Process::whereIn('id',$process_id)
+                ->pluck('title','id')
+                ->toArray();
+            foreach ($result as $key => $value){
+                $result[$key]['procedure'] = $processMap[$value['process_id']] ?? '';
+            }
+        }
+
+        return $this->json_return(200,'',$result);
+    }
+
+    //获取缓存
+    public function getRedisData($cacheKey){
+        if(Cache::has($cacheKey)){
+            return [true,json_decode(Cache::get($cacheKey),true)];
+        }
+
+        return [false, []];
+    }
+
+    /**
+     * 数据填充
+     * @param $list
+     * @param $type
+     * @param $models
+     */
+    public function fillData($list,$type,&$models){
+        if(empty($list)) return;
+
+        $run_time = $process_time = $fault = $start_time = [];
+        foreach ($list as $value){
+            if($type == 1 && ! isset($start_time[$value['device_name']])){
+                $start_time_tmp = date("Y-m-d H:i:s", $value['time'] / 1000);
+                $start_time[$value['device_name']] = $start_time_tmp;
+            }
+            if($value['data_point_name'] == SystemL::run || $value['data_point_name'] == SystemL::standBy){
+                //运行次数
+                if(isset($run_time[$value['device_name']])){
+                    $run_time[$value['device_name']] += 1;
+                }else{
+                    $run_time[$value['device_name']] = 1;
+                }
+            }
+            if($value['data_point_name'] == SystemL::standBy){
+                //工作次数
+                if(isset($process_time[$value['device_name']])){
+                    $process_time[$value['device_name']] += 1;
+                }else{
+                    $process_time[$value['device_name']] = 1;
+                }
+            }
+            if($value['data_point_name'] == SystemL::stop){
+                //故障次数
+                if(isset($fault[$value['device_name']])){
+                    $fault[$value['device_name']] += 1;
+                }else{
+                    $fault[$value['device_name']] = 1;
+                }
+            }
+        }
+        foreach (SystemL::$device as $key => $value){
+            //运行次数
+            $run_num = $run_time[$key] ?? 0;
+            //工作次数
+            $process_num  = $process_time[$key] ?? 0;
+            //故障次数
+            $fault_tmp = $fault[$key] ?? 0;
+
+            //运行时间
+            $run_time_tmp = (new ReportFormsService())->calTimeReturnMin($run_num);
+            //工作时间
+            $process_time_tmp = (new ReportFormsService())->calTimeReturnMin($process_num);
+            //故障时间
+            $fault_time_tmp = (new ReportFormsService())->calTimeReturnMin($fault_tmp);
+
+            //计划运行时间 工作时间 - 计划停机 (没有计划停机)
+            //实际运行时间  计划运行时间 -故障停机 - 设备调整(没有设备调整
+            $true_process_time = $process_time_tmp - $fault_time_tmp;
+            //有效率 实际/计划运行 时间
+            $efficient = $process_time_tmp > 0  ? number_format($true_process_time / $process_time_tmp,2) : 0;
+            //表现性 加工数量/实际运行时间
+            $expressive = $true_process_time > 0 ? number_format($process_num / $true_process_time,2) : 0;
+            //质量指数 加工数量- 废品数量 / 加工数量
+            $quality_index = $process_num > 0 ? number_format(($process_num - $fault_tmp) / $process_num,2) : 0;
+            //OEE
+            $oee = number_format($efficient * $expressive * $quality_index,2);
+
+            if($type == 1){
+                $models[$key]['machine_day_num'] = $run_num;
+                $models[$key]['day_num'] = $process_num;
+                $models[$key]['break_day_num'] = $fault_tmp;
+                $models[$key]['rate'] = $oee;
+                $models[$key]['start_time'] = $start_time[$key] ?? '暂未开机';
+            }elseif($type == 2){
+                $models[$key]['machine_week_num'] = $run_num;
+                $models[$key]['week_num'] = $process_num;
+                $models[$key]['break_week_num'] = $fault_tmp;
+            }elseif($type == 3){
+                $models[$key]['machine_month_num'] = $run_num;
+                $models[$key]['month_num'] = $process_num;
+                $models[$key]['break_month_num'] = $fault_tmp;
+            }
+        }
+    }
+}

+ 96 - 0
app/Http/Controllers/Api/SysMenuController.php

@@ -0,0 +1,96 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Service\SysMenuService;
+use Illuminate\Http\Request;
+
+
+class SysMenuController extends BaseController
+{
+
+
+
+
+
+    public function add(Request $request)
+    {
+
+
+        $service = new SysMenuService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->add($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function edit(Request $request)
+    {
+
+
+        $service = new SysMenuService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->edit($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function del(Request $request)
+    {
+
+
+        $service = new SysMenuService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->del($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function menuList(Request $request)
+    {
+
+
+        $service = new SysMenuService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->menuList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
+
+
+    public function menuMove(Request $request){
+        $service = new SysMenuService();
+        list($status,$data) = $service->menuMove($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+}

+ 74 - 0
app/Http/Controllers/Api/TechnologyController.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Service\TechnologyService;
+use Illuminate\Http\Request;
+
+class TechnologyController extends BaseController
+{
+    public function technologyList(Request $request)
+    {
+        $service = new TechnologyService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->technologyList($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function technologyEdit(Request $request)
+    {
+        $service = new TechnologyService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->technologyEdit($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function technologyAdd(Request $request)
+    {
+        $service = new TechnologyService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->technologyAdd($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function technologyDel(Request $request)
+    {
+        $service = new TechnologyService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->technologyDel($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+
+    public function technologyCopy(Request $request)
+    {
+        $service = new TechnologyService();
+        $user = $request->get('auth');
+        list($status,$data) = $service->technologyCopy($request->all(),$request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
+}

+ 1048 - 0
app/Http/Controllers/Api/TestController.php

@@ -0,0 +1,1048 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+
+use App\Model\BoxDetail;
+use App\Service\FinishedOrderService;
+use App\Service\MeasureService;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+
+
+class TestController extends BaseController
+{
+
+    public function tt(){
+        die('123132');
+    }
+
+    public function aa(){
+        $data = [
+            'out_order_no' => 'test123',
+            'top_id' => '1',
+            'ext_1' => '1',
+            'ext_2' => '2',
+            'ext_3' => '3',
+            'ext_4' => '4',
+            'ext_5' => '5',
+            'detail' => [
+                [
+                    'top_id' => '1',
+                    'code' => '001',
+                    'title' => '产品名称',
+                    'ext_1' => '1',
+                    'ext_2' => '2',
+                    'ext_3' => '3',
+                    'ext_4' => '4',
+                    'ext_5' => '5',
+                ],[
+                    'top_id' => '2',
+                    'code' => '002',
+                    'title' => '产品名称1',
+                    'ext_1' => '11',
+                    'ext_2' => '22',
+                    'ext_3' => '33',
+                    'ext_4' => '44',
+                    'ext_5' => '55',
+                ],
+            ],
+        ];
+
+
+        var_dump(json_encode($data));die;
+        $service = BoxHookService::getInstance();
+
+        list($status,$msg) = $service->boxInsert($data);
+        var_dump($status);
+        var_dump($msg);
+    }
+
+//    public function aa(){
+//        $service = BoxHookService::getInstance();
+//
+//        list($status,$msg) = $service->boxDetail(['order_no'=>'202306130543108902']);
+//        var_dump($status);
+//        var_dump($msg);
+//    }
+
+
+public function testData(Request $request){
+        $arr = ['title' => json_encode($request->all()),
+            'crt_time' => date('Y-m-d H:i:s')
+        ];
+        DB::table('test_shebei')->insert($arr);
+//        DB::table('test_shebei')->insert(['title' => '2223354']);
+}
+
+
+public function order_process1(Request $request) {
+    $arr = [
+        0 => ['Code' => "SO202307270001", 'CustomerName' => "金华市金东区方氏防火建材经营部", 'rate' => 55],
+        1 => ['Code' => "SO202307270002", 'CustomerName' => "岳阳耀东翔建筑材料有限公司", 'rate' => 20],
+        2 => ['Code' => "SO202307270003", 'CustomerName' => "森泓(内蒙古)建材有限公司", 'rate' => 99],
+        3 => ['Code' => "SO202307270004", 'CustomerName' => "重庆渝人实业有限公司", 'rate' => 65],
+        4 => ['Code' => "SO202307270005", 'CustomerName' => "九龙坡区优源木业销售中心", 'rate' => 37],
+        5 => ['Code' => "SO202307270006", 'CustomerName' => "湖北嘉宜木业有限公司", 'rate' => 16],
+        6 => ['Code' => "SO202307270007", 'CustomerName' => "中牟县国威家居建材商行", 'rate' => 44],
+        7 => ['Code' => "SO202307270008", 'CustomerName' => "绵阳市森元高科林业有限公司", 'rate' => 66],
+        8 => ['Code' => "SO202307270009", 'CustomerName' => "红花岗区美梦晨建材经营部", 'rate' => 22],
+        9 => ['Code' => "SO202307270010", 'CustomerName' => "茅箭区火车站鸿发装饰部", 'rate' => 15],
+        10 => ['Code' => "SO202307270011", 'CustomerName' => "郯城县王钦红建材五金店", 'rate' => 80],
+        11 => ['Code' => "SO202307270012", 'CustomerName' => "合肥麦凯森新材料科技有限公司", 'rate' => 15],
+        12 => ['Code' => "SO202307270013", 'CustomerName' => "湖北旺百福建材有限公司", 'rate' => 78],
+        13 => ['Code' => "SO202307270014", 'CustomerName' => "义乌市鼎泰建材有限公司", 'rate' => 15],
+        14 => ['Code' => "SO202307270015", 'CustomerName' => "平舆县艾力熊板材销售店", 'rate' => 40],
+        15 => ['Code' => "SO202307270016", 'CustomerName' => "杭州德兔装饰材料有限公司", 'rate' => 14],
+        16 => ['Code' => "SO202307270017", 'CustomerName' => "徐州美尔娜装饰材料有限公司", 'rate' => 88],
+        17 => ['Code' => "SO202307270018", 'CustomerName' => "合肥市包河区郭玉春建材经营部", 'rate' => 84],
+        18 => ['Code' => "SO202307270019", 'CustomerName' => "深圳雅匠新材料科技有限公司", 'rate' => 82],
+        19 => ['Code' => "SO202307270020", 'CustomerName' => "乌鲁木齐市米东区信和建材商行", 'rate' => 72],
+    ];
+    return $this->json_return(200,'',$arr);
+}
+
+
+public function project_region(Request $request){
+    $arr = [
+        "all_num" => 2373,
+        "num" => 188,
+    ];
+    return $this->json_return(200,'',$arr);
+}
+
+public function output_value_month1(Request $request){
+        $arr = [
+            [
+                "value"=> "2023-01-01",
+                "num"=> "20"
+            ],
+            [
+                "value"=> "2023-01-02",
+                "num"=> "40"
+            ],
+            [
+                "value"=> "2023-01-03",
+                "num"=> "35"
+            ],
+            [
+                "value"=> "2023-01-04",
+                "num"=> "15"
+            ],
+            [
+                "value"=> "2023-01-05",
+                "num"=> "40",
+            ]
+        ];
+    return $this->json_return(200,'',$arr);
+}
+
+public function output_value_efficiency(Request $request){
+   $arr = [
+       [
+           "time"=> "2023-01-01",
+           "output"=> "0"
+       ],
+       [
+           "time"=> "2023-01-02",
+           "output"=> "0"
+       ],
+       [
+           "time"=> "2023-01-03",
+           "output"=> "2711"
+       ],
+       [
+           "time"=> "2023-01-04",
+           "output"=> "2239"
+       ],
+       [
+           "time"=> "2023-01-05",
+           "output"=> "1101"
+       ]
+   ];
+    return $this->json_return(200,'',$arr);
+}
+
+public function capacity(Request $request){
+    $arr = [
+        [
+            [
+                "title"=> "压贴",
+                "rate"=> "70"
+            ],
+            [
+                "title"=> "包装",
+                "rate"=> "50"
+            ]
+        ],
+    ];
+    return $this->json_return(200,'',['data' => $arr]);
+
+}
+
+
+
+public function product_num(Request $request){
+    $arr = [
+        [
+            "machine_day_num"=> "4903.69",
+            "machine_month_num"=> "139.64",
+            "machine_week_num"=> "47.21",
+            "break_day_num"=> "0",
+            "break_month_num"=> "10",
+            "break_week_num"=> "3",
+            "start_time"=> date("Y-m-d H:i:s",time()),
+            "day_num"=> "766",
+            "week_num"=> "4598",
+            "month_num"=> "14489",
+            "rate"=> "72"
+        ],
+        [
+            "machine_day_num"=> "469591.19",
+            "machine_month_num"=> "107.03",
+            "machine_week_num"=> "35.23",
+            "break_day_num"=> 0,
+            "break_month_num"=> "210",
+            "break_week_num"=> "18",
+            "start_time"=> date("Y-m-d H:i:s",time()),
+            "day_num"=> 0,
+            "week_num"=> "2353",
+            "month_num"=> "6255",
+            "rate"=> 0
+        ],
+        [
+            "machine_day_num"=> "0",
+            "machine_month_num"=> "14.02",
+            "machine_week_num"=> "6.88",
+            "break_day_num"=> "0",
+            "break_month_num"=> "0",
+            "break_week_num"=> "0",
+            "start_time"=> date("Y-m-d H:i:s",time()),
+            "day_num"=> "0",
+            "week_num"=> "494",
+            "month_num"=> "3058",
+            "rate"=> "0"
+        ],
+        [
+            "machine_day_num"=> "4903.77",
+            "machine_month_num"=> "149.14",
+            "machine_week_num"=> "56.72",
+            "break_day_num"=> "0",
+            "break_month_num"=> "0",
+            "break_week_num"=> "0",
+            "start_time"=> date("Y-m-d H:i:s",time()),
+            "day_num"=> "626",
+            "week_num"=> "4460",
+            "month_num"=> "13034",
+            "rate"=> "48"
+        ]
+    ];
+    return $this->json_return(200,'',$arr);
+}
+
+public function work_order(Request $request){
+    $arr = [
+        "K23070127_1_8"=>[
+        "order_no"=>"SO202307270001",
+    "product_title"=>"大王椰600经典型E0全桉-免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_5"=>[
+        "order_no"=>"SO202307270002",
+    "product_title"=>"大王椰600经典型E0全桉-免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_41"=>[
+        "order_no"=>"SO202307270003",
+    "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_40"=>[
+        "order_no"=>"SO202307270004",
+    "product_title"=>"大王椰1700金装型ENF香杉木-智能生态免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_12"=>[
+        "order_no"=>"SO202307270005",
+    "product_title"=>"大王椰900尊贵型E0-家具专用背板BW",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_3"=>[
+        "order_no"=>"SO202307270006",
+    "product_title"=>"家具A6森芯背板E0商标使用费",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_46"=>[
+        "order_no"=>"SO202307270007",
+    "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>12,
+    "finish_num"=>0
+  ],
+  "K23070127_1_43"=>[
+        "order_no"=>"SO202307270008",
+    "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>12,
+    "finish_num"=>0
+  ],
+  "K23070127_1_39"=>[
+        "order_no"=>"SO202307270009",
+    "product_title"=>"大王椰1800尊贵型ENF指接芯香杉木-智能生态免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>12,
+    "finish_num"=>0
+  ],
+  "K23070127_1_36"=>[
+        "order_no"=>"SO202307270010",
+    "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
+    "procedure"=>"压贴",
+    "product_num"=>12,
+    "finish_num"=>0
+  ],
+  "K23070127_1_37"=>[
+        "order_no"=>"SO202307270011",
+    "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
+    "procedure"=>"压贴",
+    "product_num"=>12,
+    "finish_num"=>0
+  ],
+  "K23070127_1_33"=>[
+        "order_no"=>"SO202307270012",
+    "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
+    "procedure"=>"压贴",
+    "product_num"=>12,
+    "finish_num"=>0
+  ],
+  "K23070127_1_11"=>[
+        "order_no"=>"SO202307270013",
+    "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
+    "procedure"=>"压贴",
+    "product_num"=>12,
+    "finish_num"=>0
+  ],
+  "K23070127_1_28"=>[
+        "order_no"=>"SO202307270014",
+    "product_title"=>"大王椰1800尊贵型E0-家具柜门板PLW",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_27"=>[
+        "order_no"=>"SO202307270015",
+    "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_26"=>[
+        "order_no"=>"SO202307270016",
+    "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],
+  "K23070127_1_24"=>[
+        "order_no"=>"SO202307270017",
+    "product_title"=>"大王椰700尊贵型E0全桉-免漆板W",
+    "procedure"=>"压贴",
+    "product_num"=>6,
+    "finish_num"=>0
+  ],"K23070127_1_34"=>[
+            "order_no"=>"SO202307270018",
+            "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>61,
+            "finish_num"=>0
+        ],
+        "K23070127_1_55"=>[
+            "order_no"=>"SO202307270019",
+            "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_22"=>[
+            "order_no"=>"SO202307270020",
+            "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_31"=>[
+            "order_no"=>"SO202307270021",
+            "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_54"=>[
+            "order_no"=>"SO202307270022",
+            "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+    ];
+
+    return $this->json_return(200,'',$arr);
+}
+
+public function nu_work_order(Request $request){
+    $arr = [
+        "K23070127_1_8"=>[
+            "order_no"=>"SO202307270001",
+            "product_title"=>"大王椰600经典型E0全桉-免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_5"=>[
+            "order_no"=>"SO202307270002",
+            "product_title"=>"大王椰600经典型E0全桉-免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_41"=>[
+            "order_no"=>"SO202307270003",
+            "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_40"=>[
+            "order_no"=>"SO202307270004",
+            "product_title"=>"大王椰1700金装型ENF香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_12"=>[
+            "order_no"=>"SO202307270005",
+            "product_title"=>"大王椰900尊贵型E0-家具专用背板BW",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_3"=>[
+            "order_no"=>"SO202307270006",
+            "product_title"=>"家具A6森芯背板E0商标使用费",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_46"=>[
+            "order_no"=>"SO202307270007",
+            "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_43"=>[
+            "order_no"=>"SO202307270008",
+            "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_39"=>[
+            "order_no"=>"SO202307270009",
+            "product_title"=>"大王椰1800尊贵型ENF指接芯香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_36"=>[
+            "order_no"=>"SO202307270010",
+            "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_37"=>[
+            "order_no"=>"SO202307270011",
+            "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_33"=>[
+            "order_no"=>"SO202307270012",
+            "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_11"=>[
+            "order_no"=>"SO202307270013",
+            "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_28"=>[
+            "order_no"=>"SO202307270014",
+            "product_title"=>"大王椰1800尊贵型E0-家具柜门板PLW",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_27"=>[
+            "order_no"=>"SO202307270015",
+            "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_26"=>[
+            "order_no"=>"SO202307270016",
+            "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_24"=>[
+            "order_no"=>"SO202307270017",
+            "product_title"=>"大王椰700尊贵型E0全桉-免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_34"=>[
+            "order_no"=>"SO202307270018",
+            "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>61,
+            "finish_num"=>0
+        ],
+        "K23070127_1_55"=>[
+            "order_no"=>"SO202307270019",
+            "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
+            "procedure"=>"压贴",
+            "product_num"=>6,
+            "finish_num"=>0
+        ],
+        "K23070127_1_22"=>[
+            "order_no"=>"SO202307270020",
+            "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_31"=>[
+            "order_no"=>"SO202307270021",
+            "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+        "K23070127_1_54"=>[
+            "order_no"=>"SO202307270022",
+            "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
+            "procedure"=>"压贴",
+            "product_num"=>12,
+            "finish_num"=>0
+        ],
+    ];
+    return $this->json_return(200,'',$arr);
+}
+
+
+//    public function product_num(Request $request){
+//        $arr = [
+//            [
+//                "machine_day_num"=> "5.69",
+//                "machine_month_num"=> "139.64",
+//                "machine_week_num"=> "47.21",
+//                "break_day_num"=> "0",
+//                "break_month_num"=> "10",
+//                "break_week_num"=> "3",
+//                "start_time"=> date("Y-m-d H:i:s",time()),
+//                "day_num"=> "766",
+//                "week_num"=> "4598",
+//                "month_num"=> "14489",
+//                "rate"=> "72"
+//            ],
+//            [
+//                "machine_day_num"=> "4.19",
+//                "machine_month_num"=> "107.03",
+//                "machine_week_num"=> "35.23",
+//                "break_day_num"=> 0,
+//                "break_month_num"=> "210",
+//                "break_week_num"=> "18",
+//                "start_time"=> date("Y-m-d H:i:s",time()),
+//                "day_num"=> 0,
+//                "week_num"=> "2353",
+//                "month_num"=> "6255",
+//                "rate"=> 0
+//            ],
+//            [
+//                "machine_day_num"=> "0",
+//                "machine_month_num"=> "14.02",
+//                "machine_week_num"=> "6.88",
+//                "break_day_num"=> "0",
+//                "break_month_num"=> "0",
+//                "break_week_num"=> "0",
+//                "start_time"=> date("Y-m-d H:i:s",time()),
+//                "day_num"=> "0",
+//                "week_num"=> "494",
+//                "month_num"=> "3058",
+//                "rate"=> "0"
+//            ],
+//            [
+//                "machine_day_num"=> "4.77",
+//                "machine_month_num"=> "149.14",
+//                "machine_week_num"=> "56.72",
+//                "break_day_num"=> "0",
+//                "break_month_num"=> "0",
+//                "break_week_num"=> "0",
+//                "start_time"=> date("Y-m-d H:i:s",time()),
+//                "day_num"=> "626",
+//                "week_num"=> "4460",
+//                "month_num"=> "13034",
+//                "rate"=> "48"
+//            ]
+//        ];
+//        return $this->json_return(200,'',$arr);
+//    }
+//
+//    public function work_order(Request $request){
+//        $arr = [
+//            "K23070127_1_8"=>[
+//                "order_no"=>"SO202307270001",
+//                "product_title"=>"银梨4号 AH68491-3油 科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_5"=>[
+//                "order_no"=>"SO202307270002",
+//                "product_title"=>"K4001K 科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_41"=>[
+//                "order_no"=>"SO202307270003",
+//                "product_title"=>"尤加利 AH53386-2-科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_40"=>[
+//                "order_no"=>"SO202307270004",
+//                "product_title"=>"混油橡木-2  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_12"=>[
+//                "order_no"=>"SO202307270005",
+//                "product_title"=>"混油胡桃-2  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_3"=>[
+//                "order_no"=>"SO202307270006",
+//                "product_title"=>"混油胡桃-3  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_46"=>[
+//                "order_no"=>"SO202307270007",
+//                "product_title"=>"科技木2号科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_43"=>[
+//                "order_no"=>"SO202307270008",
+//                "product_title"=>"YC 71310-2油 半透胡桃3号  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_39"=>[
+//                "order_no"=>"SO202307270009",
+//                "product_title"=>"科技木2号科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_36"=>[
+//                "order_no"=>"SO202307270010",
+//                "product_title"=>"90167-6橡木色1号  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_37"=>[
+//                "order_no"=>"SO202307270011",
+//                "product_title"=>"YC 71310-2油 半透胡桃3号  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_33"=>[
+//                "order_no"=>"SO202307270012",
+//                "product_title"=>"6293-70 科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_11"=>[
+//                "order_no"=>"SO202307270013",
+//                "product_title"=>"时光流离-6  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_28"=>[
+//                "order_no"=>"SO202307270014",
+//                "product_title"=>"风调雨顺  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_27"=>[
+//                "order_no"=>"SO202307270015",
+//                "product_title"=>"科技木3号科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_26"=>[
+//                "order_no"=>"SO202307270016",
+//                "product_title"=>"诗和远方-科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_24"=>[
+//                "order_no"=>"SO202307270017",
+//                "product_title"=>"88036-1Y 银梨1007-7 -科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],"K23070127_1_34"=>[
+//                "order_no"=>"SO202307270018",
+//                "product_title"=>"天使白小浮雕 -科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>61,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_55"=>[
+//                "order_no"=>"SO202307270019",
+//                "product_title"=>"YC 71310-2油 半透胡桃3号  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_22"=>[
+//                "order_no"=>"SO202307270020",
+//                "product_title"=>"烟熏橡木 科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_31"=>[
+//                "order_no"=>"SO202307270021",
+//                "product_title"=>"博尔诺胡桃-科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_54"=>[
+//                "order_no"=>"SO202307270022",
+//                "product_title"=>"整装1号-科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//        ];
+//
+//        return $this->json_return(200,'',$arr);
+//    }
+//
+//    public function nu_work_order(Request $request){
+//        $arr = [
+//            "K23070127_1_8"=>[
+//                "order_no"=>"SO202307270001",
+//                "product_title"=>"银梨4号 AH68491-3油 科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_5"=>[
+//                "order_no"=>"SO202307270002",
+//                "product_title"=>"K4001K 科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_41"=>[
+//                "order_no"=>"SO202307270003",
+//                "product_title"=>"尤加利 AH53386-2-科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_40"=>[
+//                "order_no"=>"SO202307270004",
+//                "product_title"=>"混油橡木-2  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_12"=>[
+//                "order_no"=>"SO202307270005",
+//                "product_title"=>"混油胡桃-2  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_3"=>[
+//                "order_no"=>"SO202307270006",
+//                "product_title"=>"混油胡桃-3  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_46"=>[
+//                "order_no"=>"SO202307270007",
+//                "product_title"=>"科技木2号科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_43"=>[
+//                "order_no"=>"SO202307270008",
+//                "product_title"=>"YC 71310-2油 半透胡桃3号  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_39"=>[
+//                "order_no"=>"SO202307270009",
+//                "product_title"=>"科技木2号科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_36"=>[
+//                "order_no"=>"SO202307270010",
+//                "product_title"=>"90167-6橡木色1号  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_37"=>[
+//                "order_no"=>"SO202307270011",
+//                "product_title"=>"YC 71310-2油 半透胡桃3号  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_33"=>[
+//                "order_no"=>"SO202307270012",
+//                "product_title"=>"6293-70 科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_11"=>[
+//                "order_no"=>"SO202307270013",
+//                "product_title"=>"时光流离-6  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_28"=>[
+//                "order_no"=>"SO202307270014",
+//                "product_title"=>"风调雨顺  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_27"=>[
+//                "order_no"=>"SO202307270015",
+//                "product_title"=>"科技木3号科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_26"=>[
+//                "order_no"=>"SO202307270016",
+//                "product_title"=>"诗和远方-科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_24"=>[
+//                "order_no"=>"SO202307270017",
+//                "product_title"=>"88036-1Y 银梨1007-7 -科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],"K23070127_1_34"=>[
+//                "order_no"=>"SO202307270018",
+//                "product_title"=>"天使白小浮雕 -科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>61,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_55"=>[
+//                "order_no"=>"SO202307270019",
+//                "product_title"=>"YC 71310-2油 半透胡桃3号  科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>6,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_22"=>[
+//                "order_no"=>"SO202307270020",
+//                "product_title"=>"烟熏橡木 科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_31"=>[
+//                "order_no"=>"SO202307270021",
+//                "product_title"=>"博尔诺胡桃-科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//            "K23070127_1_54"=>[
+//                "order_no"=>"SO202307270022",
+//                "product_title"=>"整装1号-科技木皮",
+//                "procedure"=>"压贴",
+//                "product_num"=>12,
+//                "finish_num"=>0
+//            ],
+//        ];
+//        return $this->json_return(200,'',$arr);
+//    }
+
+public function testaa(Request $request){
+    $data = $request->all();
+
+    $url = $data['url'];
+    $post = $data['post'];
+    $header = $data['header'];
+
+    $curl = curl_init();
+    $json = str_replace('"workflowSearchBean":{}','"workflowSearchBean":[]',json_encode($post));
+    $json = str_replace('"workflowSearchBean":[]','"workflowSearchBean":{}',json_encode($post));
+    file_put_contents('1.txt',$json);
+    curl_setopt_array($curl, array(
+        CURLOPT_URL => $url,
+        CURLOPT_RETURNTRANSFER => true,
+        CURLOPT_ENCODING => '',
+        CURLOPT_MAXREDIRS => 10,
+        CURLOPT_TIMEOUT => 0,
+        CURLOPT_FOLLOWLOCATION => true,
+        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
+        CURLOPT_CUSTOMREQUEST => 'POST',
+        CURLOPT_POSTFIELDS => $json,
+        CURLOPT_HTTPHEADER => $header,
+    ));
+    $response = curl_exec($curl);
+    curl_close($curl);
+    return $this->json_return(200,'',json_decode($response,true));
+}
+
+public function testa(Request $request){
+        $data = $request->all();
+
+        $url = $data['url'];
+        $header = $data['header'];
+
+        $curl = curl_init();
+
+        curl_setopt_array($curl, array(
+            CURLOPT_URL => $url,
+            CURLOPT_RETURNTRANSFER => true,
+            CURLOPT_ENCODING => '',
+            CURLOPT_MAXREDIRS => 10,
+            CURLOPT_TIMEOUT => 0,
+            CURLOPT_FOLLOWLOCATION => true,
+            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
+            CURLOPT_CUSTOMREQUEST => 'GET',
+            CURLOPT_HTTPHEADER => $header,
+        ));
+        $response = curl_exec($curl);
+        curl_close($curl);
+        return $this->json_return(200,'',json_decode($response,true));
+    }
+
+public function testaa1(Request $request){
+        $curl = curl_init();
+
+        curl_setopt_array($curl, array(
+            CURLOPT_URL => 'http://121.36.142.167:7774/jbl/api/module-data/team_list/page',
+            CURLOPT_RETURNTRANSFER => true,
+            CURLOPT_ENCODING => '',
+            CURLOPT_MAXREDIRS => 10,
+            CURLOPT_TIMEOUT => 0,
+            CURLOPT_FOLLOWLOCATION => true,
+            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
+            CURLOPT_CUSTOMREQUEST => 'POST',
+            CURLOPT_POSTFIELDS =>'{"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"team","developmentSystemId":null,"debugFlag":true}',
+            CURLOPT_HTTPHEADER => array(
+                'Content-Sign: 88cb27fd67215452422c18f3ed71028e',
+                'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MTUwODMxfQ.1_Adx5tdReisZdgyyQfBjU4VCXzGDKNiztJ-WjPlZ3bG0EQHzcKZs7Pi0yk2xxQn1XWp0dNVHqUPbTMpkEU1aA',
+                'Content-Type: application/json',
+            ),
+        ));
+
+        $response = curl_exec($curl);
+
+        curl_close($curl);
+        echo $response;
+    }
+
+public function testapp(){
+        $curl=curl_init();
+
+        curl_setopt_array($curl,array(
+            CURLOPT_URL=>'http://121.36.142.167:7774/jbl/api/module-data/dispatch_orders/page',
+CURLOPT_RETURNTRANSFER=>true,
+CURLOPT_ENCODING=>'',
+CURLOPT_MAXREDIRS=>10,
+CURLOPT_TIMEOUT=>0,
+CURLOPT_FOLLOWLOCATION=>true,
+CURLOPT_HTTP_VERSION=>CURL_HTTP_VERSION_1_1,
+CURLOPT_CUSTOMREQUEST=>'POST',
+CURLOPT_POSTFIELDS=>'{"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[{"field":"dispatch_orders.dispatch_no","option":"LIKE_ANYWHERE","values":["PG2023081400027"]},{"field":"product_no","option":"LIKE_ANYWHERE","values":["BC030101000001"]}],"size":15,"specialConditions":[],"workflowSearchBean":{},"dynamicFormCode":"dispatch_orders","dynamicFormTable":null,"ignoreField":true,"developmentSystemId":null,"debugFlag":true}',
+CURLOPT_HTTPHEADER=>array(
+            'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A',
+'Content-Type:application/json',
+),
+));
+
+$response=curl_exec($curl);
+
+curl_close($curl);
+dump(json_decode($response,true));die;
+
+        $str = '{"result":[{"id":121,"finished_num":0,"dispatch_quantity":100,"out_order_no_time":"1691683200","process_id":9,"dispatch_no":"20230811001","order_product_id":119,"sale_orders_product_id":4499,"order_no":"2023081116917417502029","product_no":"00031412","product_title":"\u65b0\u897f\u5170\u677e","price":"10.0000000000","customer_name":"\u6c5f\u897f\u5fb7\u514b\u65af\u8bfa\uff08\u4e0a\u6d77\u5ba6\u821f\u53a8\u5177\u6709\u9650\u516c\u53f8\uff09"}],"data":{"id":[121],"quantity":["10"],"team_id":[68],"equipment_id":[8],"waste":[[]],"finish_id":[0]}}';
+        $data = json_decode($str,true);
+        list($status,$msg) =  (new FinishedOrderService())->addInJob($data['result'],$data['data']);
+        dump($msg);die;
+    }
+}

+ 40 - 0
app/Http/Controllers/Auth/ConfirmPasswordController.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace App\Http\Controllers\Auth;
+
+use App\Http\Controllers\Controller;
+use App\Providers\RouteServiceProvider;
+use Illuminate\Foundation\Auth\ConfirmsPasswords;
+
+class ConfirmPasswordController extends Controller
+{
+    /*
+    |--------------------------------------------------------------------------
+    | Confirm Password Controller
+    |--------------------------------------------------------------------------
+    |
+    | This controller is responsible for handling password confirmations and
+    | uses a simple trait to include the behavior. You're free to explore
+    | this trait and override any functions that require customization.
+    |
+    */
+
+    use ConfirmsPasswords;
+
+    /**
+     * Where to redirect users when the intended url fails.
+     *
+     * @var string
+     */
+    protected $redirectTo = RouteServiceProvider::HOME;
+
+    /**
+     * Create a new controller instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        $this->middleware('auth');
+    }
+}

+ 22 - 0
app/Http/Controllers/Auth/ForgotPasswordController.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace App\Http\Controllers\Auth;
+
+use App\Http\Controllers\Controller;
+use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
+
+class ForgotPasswordController extends Controller
+{
+    /*
+    |--------------------------------------------------------------------------
+    | Password Reset Controller
+    |--------------------------------------------------------------------------
+    |
+    | This controller is responsible for handling password reset emails and
+    | includes a trait which assists in sending these notifications from
+    | your application to your users. Feel free to explore this trait.
+    |
+    */
+
+    use SendsPasswordResetEmails;
+}

+ 40 - 0
app/Http/Controllers/Auth/LoginController.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace App\Http\Controllers\Auth;
+
+use App\Http\Controllers\Controller;
+use App\Providers\RouteServiceProvider;
+use Illuminate\Foundation\Auth\AuthenticatesUsers;
+
+class LoginController extends Controller
+{
+    /*
+    |--------------------------------------------------------------------------
+    | Login Controller
+    |--------------------------------------------------------------------------
+    |
+    | This controller handles authenticating users for the application and
+    | redirecting them to your home screen. The controller uses a trait
+    | to conveniently provide its functionality to your applications.
+    |
+    */
+
+    use AuthenticatesUsers;
+
+    /**
+     * Where to redirect users after login.
+     *
+     * @var string
+     */
+    protected $redirectTo = RouteServiceProvider::HOME;
+
+    /**
+     * Create a new controller instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        $this->middleware('guest')->except('logout');
+    }
+}

+ 73 - 0
app/Http/Controllers/Auth/RegisterController.php

@@ -0,0 +1,73 @@
+<?php
+
+namespace App\Http\Controllers\Auth;
+
+use App\Http\Controllers\Controller;
+use App\Providers\RouteServiceProvider;
+use App\User;
+use Illuminate\Foundation\Auth\RegistersUsers;
+use Illuminate\Support\Facades\Hash;
+use Illuminate\Support\Facades\Validator;
+
+class RegisterController extends Controller
+{
+    /*
+    |--------------------------------------------------------------------------
+    | Register Controller
+    |--------------------------------------------------------------------------
+    |
+    | This controller handles the registration of new users as well as their
+    | validation and creation. By default this controller uses a trait to
+    | provide this functionality without requiring any additional code.
+    |
+    */
+
+    use RegistersUsers;
+
+    /**
+     * Where to redirect users after registration.
+     *
+     * @var string
+     */
+    protected $redirectTo = RouteServiceProvider::HOME;
+
+    /**
+     * Create a new controller instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        $this->middleware('guest');
+    }
+
+    /**
+     * Get a validator for an incoming registration request.
+     *
+     * @param  array  $data
+     * @return \Illuminate\Contracts\Validation\Validator
+     */
+    protected function validator(array $data)
+    {
+        return Validator::make($data, [
+            'name' => ['required', 'string', 'max:255'],
+            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
+            'password' => ['required', 'string', 'min:8', 'confirmed'],
+        ]);
+    }
+
+    /**
+     * Create a new user instance after a valid registration.
+     *
+     * @param  array  $data
+     * @return \App\User
+     */
+    protected function create(array $data)
+    {
+        return User::create([
+            'name' => $data['name'],
+            'email' => $data['email'],
+            'password' => Hash::make($data['password']),
+        ]);
+    }
+}

+ 30 - 0
app/Http/Controllers/Auth/ResetPasswordController.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Controllers\Auth;
+
+use App\Http\Controllers\Controller;
+use App\Providers\RouteServiceProvider;
+use Illuminate\Foundation\Auth\ResetsPasswords;
+
+class ResetPasswordController extends Controller
+{
+    /*
+    |--------------------------------------------------------------------------
+    | Password Reset Controller
+    |--------------------------------------------------------------------------
+    |
+    | This controller is responsible for handling password reset requests
+    | and uses a simple trait to include this behavior. You're free to
+    | explore this trait and override any methods you wish to tweak.
+    |
+    */
+
+    use ResetsPasswords;
+
+    /**
+     * Where to redirect users after resetting their password.
+     *
+     * @var string
+     */
+    protected $redirectTo = RouteServiceProvider::HOME;
+}

+ 42 - 0
app/Http/Controllers/Auth/VerificationController.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Http\Controllers\Auth;
+
+use App\Http\Controllers\Controller;
+use App\Providers\RouteServiceProvider;
+use Illuminate\Foundation\Auth\VerifiesEmails;
+
+class VerificationController extends Controller
+{
+    /*
+    |--------------------------------------------------------------------------
+    | Email Verification Controller
+    |--------------------------------------------------------------------------
+    |
+    | This controller is responsible for handling email verification for any
+    | user that recently registered with the application. Emails may also
+    | be re-sent if the user didn't receive the original email message.
+    |
+    */
+
+    use VerifiesEmails;
+
+    /**
+     * Where to redirect users after verification.
+     *
+     * @var string
+     */
+    protected $redirectTo = RouteServiceProvider::HOME;
+
+    /**
+     * Create a new controller instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        $this->middleware('auth');
+        $this->middleware('signed')->only('verify');
+        $this->middleware('throttle:6,1')->only('verify', 'resend');
+    }
+}

+ 13 - 0
app/Http/Controllers/Controller.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
+use Illuminate\Foundation\Bus\DispatchesJobs;
+use Illuminate\Foundation\Validation\ValidatesRequests;
+use Illuminate\Routing\Controller as BaseController;
+
+class Controller extends BaseController
+{
+    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+}

+ 85 - 0
app/Http/Kernel.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\Http;
+
+use Illuminate\Foundation\Http\Kernel as HttpKernel;
+
+class Kernel extends HttpKernel
+{
+    /**
+     * The application's global HTTP middleware stack.
+     *
+     * These middleware are run during every request to your application.
+     *
+     * @var array
+     */
+    protected $middleware = [
+        \App\Http\Middleware\TrustProxies::class,
+        \App\Http\Middleware\CheckForMaintenanceMode::class,
+        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
+        \App\Http\Middleware\TrimStrings::class,
+        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
+        \Fruitcake\Cors\HandleCors::class,
+        \App\Http\Middleware\RequestLog::class,
+    ];
+
+    /**
+     * The application's route middleware groups.
+     *
+     * @var array
+     */
+    protected $middlewareGroups = [
+        'web' => [
+            \App\Http\Middleware\EncryptCookies::class,
+            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
+            \Illuminate\Session\Middleware\StartSession::class,
+            // \Illuminate\Session\Middleware\AuthenticateSession::class,
+            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
+            \App\Http\Middleware\VerifyCsrfToken::class,
+            \Illuminate\Routing\Middleware\SubstituteBindings::class,
+        ],
+
+        'api' => [
+            'throttle:180,1',
+            \Illuminate\Routing\Middleware\SubstituteBindings::class,
+        ],
+    ];
+
+    /**
+     * The application's route middleware.
+     *
+     * These middleware may be assigned to groups or used individually.
+     *
+     * @var array
+     */
+    protected $routeMiddleware = [
+        'auth' => \App\Http\Middleware\Authenticate::class,
+        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
+        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
+        'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
+        'can' => \Illuminate\Auth\Middleware\Authorize::class,
+        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
+        'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
+        'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
+        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
+        'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
+        'checkLogin' => \App\Http\Middleware\CheckLogin::class,
+    ];
+
+    /**
+     * The priority-sorted list of middleware.
+     *
+     * This forces non-global middleware to always be in the given order.
+     *
+     * @var array
+     */
+    protected $middlewarePriority = [
+        \Illuminate\Session\Middleware\StartSession::class,
+        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
+        \App\Http\Middleware\Authenticate::class,
+        \Illuminate\Routing\Middleware\ThrottleRequests::class,
+        \Illuminate\Session\Middleware\AuthenticateSession::class,
+        \Illuminate\Routing\Middleware\SubstituteBindings::class,
+        \Illuminate\Auth\Middleware\Authorize::class,
+    ];
+}

+ 21 - 0
app/Http/Middleware/Authenticate.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Auth\Middleware\Authenticate as Middleware;
+
+class Authenticate extends Middleware
+{
+    /**
+     * Get the path the user should be redirected to when they are not authenticated.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @return string|null
+     */
+    protected function redirectTo($request)
+    {
+        if (! $request->expectsJson()) {
+            return route('login');
+        }
+    }
+}

+ 17 - 0
app/Http/Middleware/CheckForMaintenanceMode.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
+
+class CheckForMaintenanceMode extends Middleware
+{
+    /**
+     * The URIs that should be reachable while maintenance mode is enabled.
+     *
+     * @var array
+     */
+    protected $except = [
+        //
+    ];
+}

+ 54 - 0
app/Http/Middleware/CheckLogin.php

@@ -0,0 +1,54 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use App\Http\Controllers\Api\LoginController;
+use App\Service\EmployeeService;
+use Closure;
+use App\Service\TokenService;
+
+class CheckLogin
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        $token=$request->header('Authorization');
+        if (!isset($token)){
+            return  response()->json(['code'=>1,'msg'=>'缺少token','data'=>null]);
+        }
+
+        //登录来源前缀清除
+        foreach (LoginController::$port as $key => $value){
+            if (strpos($token,$key) !== false) {
+                $token = str_replace($key, $value, $token);
+                break;
+            }
+        }
+
+        //校验token
+        $result = TokenService::verifyToken($token);
+        if ($result < 0){
+            return response()->json(['code'=>1,'msg'=>TokenService::error[$result],'data'=>null]);
+        }
+
+        //校验用户
+        $checkResult = EmployeeService::checkUser($result);
+        list($state, $data) = $checkResult;
+        if(! $state) return response()->json(['code'=>1,'msg'=>$data,'data'=>null]);
+
+        //人员角色
+        $data['role'] = EmployeeService::getPersonRole($result);
+        //部门权限
+        $data['rule_depart'] = EmployeeService::getPersonDepart($result);
+        //写入user信息
+        $request->userData = $data;
+
+        return $next($request);
+    }
+}

+ 61 - 0
app/Http/Middleware/CheckToken.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
+use Closure;
+use \Illuminate\Http\Request;
+use Illuminate\Support\Facades\Cache;
+
+class CheckToken extends Middleware
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @return mixed
+     */
+    public function handle(Request $request, Closure $next)
+    {
+        $params = $request->all();
+        if(isset($params['token'])){
+            $cacheKey = $params['token'];
+            if(Cache::has($cacheKey)){
+                $num = Cache::get($cacheKey);
+                if($num >= 10){
+                    $json=[
+                        'code'=>300,
+                        'errorMessages' => 'Too many request,please wait a moment',
+                        'success' =>false,
+                    ];
+                }else{
+                    $num++;
+                    Cache::add($cacheKey,$num,3);
+
+                    return $next($request);
+
+                }
+
+
+                return response()->json($json);
+            }else{
+                Cache::add($cacheKey,1,3);
+            }
+
+        }
+
+        $json=[
+            'code'=>300,
+            'errorMessages' => 'illegal access',
+            'success' =>false,
+        ];
+
+        return response()->json($json);
+
+    }
+
+
+
+
+}

+ 17 - 0
app/Http/Middleware/EncryptCookies.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
+
+class EncryptCookies extends Middleware
+{
+    /**
+     * The names of the cookies that should not be encrypted.
+     *
+     * @var array
+     */
+    protected $except = [
+        //
+    ];
+}

+ 27 - 0
app/Http/Middleware/RedirectIfAuthenticated.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use App\Providers\RouteServiceProvider;
+use Closure;
+use Illuminate\Support\Facades\Auth;
+
+class RedirectIfAuthenticated
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @param  string|null  $guard
+     * @return mixed
+     */
+    public function handle($request, Closure $next, $guard = null)
+    {
+        if (Auth::guard($guard)->check()) {
+            return redirect(RouteServiceProvider::HOME);
+        }
+
+        return $next($request);
+    }
+}

+ 38 - 0
app/Http/Middleware/RequestLog.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+use Illuminate\Support\Facades\Log;
+
+class RequestLog
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        if (getenv('HTTP_CLIENT_IP')) {
+            $ip = getenv('HTTP_CLIENT_IP');
+        }
+        elseif (getenv('HTTP_X_REAL_IP')) {
+            $ip = getenv('HTTP_X_REAL_IP');
+        } elseif (getenv('HTTP_X_FORWARDED_FOR')) {
+            $ip = getenv('HTTP_X_FORWARDED_FOR');
+            $ips = explode(',', $ip);
+            $ip = $ips[0];
+        } elseif (getenv('REMOTE_ADDR')) {
+            $ip = getenv('REMOTE_ADDR');
+        } else {
+            $ip = '0.0.0.0';
+        }
+        $params = $request->all();
+        Log::channel('request')->info('request', ['param'=>json_encode($params),'ip' => $ip,'uri'=>$request->path()]);
+
+        return $next($request);
+    }
+}

+ 18 - 0
app/Http/Middleware/TrimStrings.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
+
+class TrimStrings extends Middleware
+{
+    /**
+     * The names of the attributes that should not be trimmed.
+     *
+     * @var array
+     */
+    protected $except = [
+        'password',
+        'password_confirmation',
+    ];
+}

+ 23 - 0
app/Http/Middleware/TrustProxies.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Fideloper\Proxy\TrustProxies as Middleware;
+use Illuminate\Http\Request;
+
+class TrustProxies extends Middleware
+{
+    /**
+     * The trusted proxies for this application.
+     *
+     * @var array|string
+     */
+    protected $proxies;
+
+    /**
+     * The headers that should be used to detect proxies.
+     *
+     * @var int
+     */
+    protected $headers = Request::HEADER_X_FORWARDED_ALL;
+}

+ 24 - 0
app/Http/Middleware/VerifyCsrfToken.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
+
+class VerifyCsrfToken extends Middleware
+{
+    /**
+     * Indicates whether the XSRF-TOKEN cookie should be set on the response.
+     *
+     * @var bool
+     */
+    protected $addHttpCookie = true;
+
+    /**
+     * The URIs that should be excluded from CSRF verification.
+     *
+     * @var array
+     */
+    protected $except = [
+        //
+    ];
+}

+ 52 - 0
app/Jobs/CloudDataJob.php

@@ -0,0 +1,52 @@
+<?php
+
+namespace App\Jobs;
+
+use App\Service\CloudDataService;
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+use Symfony\Component\Console\Output\ConsoleOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class CloudDataJob implements ShouldQueue
+{
+    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+
+    protected $data;
+
+    /**
+     * Create a new job instance.
+     *
+     * @return void
+     */
+    public function __construct($data)
+    {
+        $this->data = $data;
+    }
+
+    /**
+     * Execute the job.
+     *
+     * @return void
+     */
+    public function handle()
+    {
+        $this->settle();
+
+        //输出信息 测试
+        $this->echoMessage(new ConsoleOutput());
+    }
+
+    private function settle(){
+        $service = new CloudDataService();
+        $service->cloudData();
+    }
+
+    protected function echoMessage(OutputInterface $output)
+    {
+        $output->writeln($this->data);
+    }
+}

+ 49 - 0
app/Jobs/OrderTag.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Jobs;
+
+use App\Service\Order\OrderTagService;
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+use Illuminate\Support\Facades\DB;
+
+class OrderTag implements ShouldQueue
+{
+    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+
+    protected $order_no;
+    /**
+     * Create a new job instance.
+     *
+     * @return void
+     */
+    public function __construct($order_no)
+    {
+        //
+        $this->order_no = $order_no;
+    }
+
+    /**
+     * Execute the job.
+     *
+     * @return void
+     */
+    public function handle()
+    {
+        //生成芯片数据更新订单产品部件信息
+        $service = new OrderTagService();
+        DB::beginTransaction();
+        try{
+            $service = $service->setTag($this->order_no);
+            DB::commit();
+        }catch (\Exception $e){
+            DB::rollBack();
+
+            $this->dispatch($this->order_no);
+        }
+
+    }
+}

+ 217 - 0
app/Jobs/ProcessDataJob.php

@@ -0,0 +1,217 @@
+<?php
+
+namespace App\Jobs;
+
+use App\Model\Box;
+use App\Model\DispatchSub;
+use App\Model\ErrorTable;
+use App\Service\FinishedOrderService;
+use App\Service\FyyOrderService;
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Redis;
+use MongoDB\Driver\Exception\Exception;
+use Symfony\Component\Console\Output\ConsoleOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class ProcessDataJob implements ShouldQueue
+{
+    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+
+    //队列名称
+    const job_one = 'finished_operation';//完工
+    const job_two = 'box_operation';//包装
+
+    protected $data;
+    protected $user;
+    protected $type;
+
+    //1 代表产成品入库  2 销售出库单  3 代表产成品入库手机端  4 销售出库单
+    protected $function = [
+        1 => 'U8Rdrecord10Save',
+        2 => 'U8Rdrecord32Save',
+        3 => 'U8Rdrecord10SaveMobile'
+    ];
+
+    //数据回退 标记了的单据数据状态改为0
+    protected $function_reback = [
+        1 => 'reBackOne',
+        2 => 'reBackTwo',
+        3 => 'reBackThree',
+    ];
+
+    protected $jobs = [
+        1 => self::job_one,
+        2 => self::job_two,
+        3 => self::job_one,
+    ];
+
+    /**
+     * Create a new job instance.
+     *  $data = [
+            'result' => $msg, //查询结果
+            'data' => $data, //用户提交的参数
+        ];
+     * $user 提交用户的信息
+     * $type //1 代表产成品入库(完工操作)  2 销售出库单(包装单扫描出库)
+     *
+     * @return void
+     */
+    public function __construct($data, $user = [], $type)
+    {
+        $this->data = $data;
+        $this->user = $user ?? [];
+        $this->type = $type;
+    }
+
+    /**
+     *
+     * file_put_contents('charge.txt',"标记位置退出".PHP_EOL,8);
+     * Execute the job.
+     *
+     * @return void
+     */
+    public function handle()
+    {
+        try {
+            $function = $this->function[$this->type] ?? '';//调用方法 入库
+            $function_back = $this->function_reback[$this->type] ?? '';//数据回退方法
+            if(empty($function))  return;
+
+            list($status,$msg) = $this->$function();
+
+            if(! $status) $this->errorSettle($msg);
+        } catch (\Exception $e) {
+            $this->$function_back();
+            $this->recordErrorTable($e->getFile() . $e->getMessage() . $e->getLine());
+        }
+
+        //输出信息
+        $this->echoMessage(new ConsoleOutput());
+    }
+
+    protected function echoMessage(OutputInterface $output)
+    {
+        //输出消息
+        $output->writeln(json_encode($this->data));
+    }
+
+    //产成品入库
+    private function U8Rdrecord10Save(){
+        $service = new FinishedOrderService();
+        //标记
+        list($status,$msg) = $service->addInJob($this->data['result'],$this->data['data'],$this->user);
+        return [$status,$msg];
+    }
+
+    //产成品入库手机端
+    private function U8Rdrecord10SaveMobile(){
+        $service = new FinishedOrderService();
+        //标记
+        list($status,$msg) = $service->addMobileInJob($this->data['result'],$this->data['data'],$this->data['quantity_count'],$this->user);
+        return [$status,$msg];
+    }
+
+    //产成品入库 相关数据回退
+    private function reBackOne(){
+        //数据回退
+        $data = $this->data['data'];
+
+        $database = $this->settleDatabase();
+
+        // 连接到指定数据库连接
+        DB::connection($database)->table('dispatch_sub')
+            ->whereIn('id',$data['id'])
+            ->update(['job_status' => 0]);
+    }
+
+    //产成品入库 相关数据回退
+    private function reBackThree(){
+        //数据回退
+        $data = $this->data['data'];
+
+        $database = $this->settleDatabase();
+
+        // 连接到指定数据库连接
+        DB::connection($database)->table('dispatch_sub')
+            ->whereIn('id',array_column($data,'id'))
+            ->update(['job_status' => 0]);
+    }
+
+    //销售单出库
+    private function U8Rdrecord32Save(){
+        $service = new FyyOrderService();
+        list($status,$msg) = $service->addInJob($this->data['result'],$this->data['data'],$this->user);
+        return [$status,$msg];
+    }
+
+    //销售单出库 相关数据回退
+    private function reBackTwo(){
+        //数据回退
+        $data = $this->data['data'];
+
+        $database = $this->settleDatabase();
+
+        // 连接到指定数据库连接
+        DB::connection($database)->table('box')
+            ->whereIn('order_no',$data['order_no'])
+            ->update(['state' => 0]);
+    }
+
+    private function errorSettle($msg){
+        $redis = Redis::connection();
+
+        $order_failures_key = md5(json_encode($this->data));
+
+        // 从Redis中获取失败计数
+        $failureCount = $redis->hIncrBy('order_failures', $order_failures_key, 1);
+
+        //队列名
+        $job = $this->jobs[$this->type];
+
+        if ($failureCount < 1) {
+            // 将任务重新放回队列
+            self::dispatch($this->data,$this->user,$this->type)->onQueue($job)->delay(now()->addSeconds(2));
+        } else {
+            // 删除失败计数
+            $redis->hDel('order_failures', $order_failures_key);
+
+            //数据回退
+            $function_back = $this->function_reback[$this->type] ?? '';
+            $this->$function_back();
+
+            //记录错误
+            $this->recordErrorTable($msg);
+        }
+    }
+
+    private function recordErrorTable($msg){
+        $database = $this->settleDatabase();
+
+        // 连接到指定数据库连接
+        DB::connection($database)->table('error_table')->insert([
+            'msg' => $msg,
+            'data' => json_encode($this->data),
+            'user_id' => $this->user['id'],
+            'user_operation_time' => $this->user['operate_time'],
+            'type' => $this->type
+        ]);
+    }
+
+    public function failed($exception)
+    {
+        // 记录失败错误信息到日志或其他媒介
+        $errorMessage = $exception->getFile() . $exception->getMessage() . $exception->getLine();
+        $this->recordErrorTable($errorMessage);
+    }
+
+    public function settleDatabase(){
+        $zt = $this->user['zt'] ?? '';
+
+        return (new FinishedOrderService())->getConnectionName($zt);
+    }
+}

+ 19 - 0
app/Model/BasicMaterial.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 物料分类
+ * Class Unit
+ * @package App\Models
+ */
+class BasicMaterial extends Model
+{
+    protected $table = "basic_material"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 27 - 0
app/Model/BasicProcedure.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+use PhpParser\Builder;
+
+/**
+ * 工艺属性
+ * Class Unit
+ * @package App\Models
+ */
+class BasicProcedure extends Model
+{
+    protected $table = "basic_procedure"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+
+    public function scopeWhereUnDel($query,$name='')
+    {
+        if(empty($name)) return $query->where('del_time', '=', 0);
+        else return $query->where($name, '=', 0);
+    }
+}
+

+ 26 - 0
app/Model/BasicProcess.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 工艺属性
+ * Class Unit
+ * @package App\Models
+ */
+class BasicProcess extends Model
+{
+    protected $table = "basic_process"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+
+    public function scopeWhereUnDel($query,$name='')
+    {
+        if(empty($name)) return $query->where('del_time', '=', 0);
+        else return $query->where($name, '=', 0);
+    }
+}
+

+ 19 - 0
app/Model/Bom.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * bom
+ * Class Unit
+ * @package App\Models
+ */
+class Bom extends Model
+{
+    protected $table = "bom"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/BomDetail.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * bom
+ * Class Unit
+ * @package App\Models
+ */
+class BomDetail extends Model
+{
+    protected $table = "bom_detail"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/BomDetailMeasure.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * bom
+ * Class Unit
+ * @package App\Models
+ */
+class BomDetailMeasure extends Model
+{
+    protected $table = "bom_detail_measure"; //指定表
+    const CREATED_AT = null;
+    const UPDATED_AT = null;
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/BomDetailRelation.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * bom
+ * Class Unit
+ * @package App\Models
+ */
+class BomDetailRelation extends Model
+{
+    protected $table = "bom_detail_relation"; //指定表
+    const CREATED_AT = null;
+    const UPDATED_AT = null;
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/BomMaterial.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * bom
+ * Class Unit
+ * @package App\Models
+ */
+class BomMaterial extends Model
+{
+    protected $table = "bom_material"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 18 - 0
app/Model/Box.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class Box extends Model
+{
+    protected $table = "box"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+}

+ 69 - 0
app/Model/BoxDetail.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Schema;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class BoxDetail extends Model
+{
+    public $table = "box_detail"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+    protected $guarded = [];
+
+    public $month = [
+        1 => '01_03',
+        2 => '01_03',
+        3 => '01_03',
+        4 => '04_06',
+        5 => '04_06',
+        6 => '04_06',
+        7 => '07_09',
+        8 => '07_09',
+        9 => '07_09',
+        10 => '10_12',
+        11 => '10_12',
+        12 => '10_12',
+    ];
+
+    public function __construct(array $attributes = [])
+    {
+        parent::__construct($attributes);
+        if (isset($attributes['channel']) && $attributes['channel'] > 0) {
+            $channel = $attributes['channel'];
+            $month = (int)substr($channel,4,2);
+            $channel = substr($channel,0,4).$this->month[$month];
+            $this->setTableById($channel);
+        }
+    }
+
+
+    /**
+     * @param $channel
+     */
+    // 动态指定数据表
+    public function setTableById($channel)
+    {
+        if ($channel > 0) {
+            $tb = $this->table.'_' . (string)$channel;
+            $this->createTable($tb);
+            $this->setTable($tb);
+        }
+
+    }
+
+    public function createTable($channel){
+//        $table_name = 'box_detail_' . (string)$channel;
+        if(!Schema::hasTable($channel)){
+            DB::update('create table '.$channel.' like box_detail');
+        }
+    }
+}

+ 19 - 0
app/Model/Depart.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 部门管理
+ * Class Unit
+ * @package App\Models
+ */
+class Depart extends Model
+{
+    protected $table = "depart"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+    const RULE_DEPART = "ALL";
+}

+ 19 - 0
app/Model/Dispatch.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class Dispatch extends Model
+{
+    protected $table = "dispatch"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/DispatchEmpSub.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class DispatchEmpSub extends Model
+{
+    protected $table = "dispatch_emp_sub"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 18 - 0
app/Model/DispatchSub.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class DispatchSub extends Model
+{
+    protected $table = "dispatch_sub"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+}

+ 36 - 0
app/Model/Employee.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 菜单管理
+ * Class Unit
+ * @package App\Models
+ */
+class Employee extends Model
+{
+    protected $table = "employee"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+    const USE = 1;
+    const NOT_USE = 2;
+    const IS_ADMIN = 1;
+    const IS_NOT_ADMIN = 0;
+    const SPECIAL_ADMIN = 1;
+    const IS_TECHNICAL = [
+        0 => '否',
+        1 => '是'
+    ];
+
+    //人员状态
+    const STATUS_ONE = 1;
+    const STATUS_TWO = 2;
+
+    const STATUS = [
+        1 => '正常',
+        2 => '停用'
+    ];
+}

+ 19 - 0
app/Model/EmployeeDepartPermission.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 菜单管理
+ * Class Unit
+ * @package App\Models
+ */
+class EmployeeDepartPermission extends Model
+{
+    protected $table = "employee_depart_permission"; //指定表
+    const CREATED_AT = null;
+    const UPDATED_AT = null;
+    protected $dateFormat = 'U';
+
+}

+ 14 - 0
app/Model/EmployeeManagerDepart.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+class EmployeeManagerDepart extends Model
+{
+    protected $table = "employee_manager_depart"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/EmployeeMenuPermission.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 菜单管理
+ * Class Unit
+ * @package App\Models
+ */
+class EmployeeMenuPermission extends Model
+{
+    protected $table = "employee_menu_permission"; //指定表
+    const CREATED_AT = null;
+    const UPDATED_AT = null;
+    protected $dateFormat = 'U';
+
+}

+ 14 - 0
app/Model/EmployeeRole.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+class EmployeeRole extends Model
+{
+    protected $table = "employee_role"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/EmployeeTeamPermission.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 菜单管理
+ * Class Unit
+ * @package App\Models
+ */
+class EmployeeTeamPermission extends Model
+{
+    protected $table = "employee_team_permission"; //指定表
+    const CREATED_AT = null;
+    const UPDATED_AT = null;
+    protected $dateFormat = 'U';
+
+}

+ 14 - 0
app/Model/Equipment.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Equipment extends Model
+{
+    protected $table = "equipment"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+}
+

+ 20 - 0
app/Model/ErrorTable.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+
+class ErrorTable extends Model
+{
+    protected $table = "error_table"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+    public static $type = [
+        1 => '完工操作:PC',
+        2 => '包装单扫描出库操作:MOBILE',
+        3 => '完工操作:MOBILE',
+    ];
+}

+ 14 - 0
app/Model/FinishedOrder.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+class FinishedOrder extends Model
+{
+    protected $table = "finished_order"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 18 - 0
app/Model/FinishedOrderScrapp.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class FinishedOrderScrapp extends Model
+{
+    protected $table = "finished_order_scrapp"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+}

+ 18 - 0
app/Model/FinishedOrderSub.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class FinishedOrderSub extends Model
+{
+    protected $table = "finished_order_sub"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+}

+ 19 - 0
app/Model/HeaderWord.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class HeaderWord extends Model
+{
+    protected $table = "header_word"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/Header_ext.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class Header_ext extends Model
+{
+    protected $table = "header_ext"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/Header_ext_sub.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class Header_ext_sub extends Model
+{
+    protected $table = "header_ext_sub"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 13 - 0
app/Model/InOutRecord.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+class InOutRecord extends Model
+{
+    protected $table = "in_out_record"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+}

+ 15 - 0
app/Model/Inventory.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+//库存
+class Inventory extends Model
+{
+    protected $table = "inventory"; //指定表
+    const CREATED_AT = null;
+    const UPDATED_AT = null;
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/Material.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 物料
+ * Class Unit
+ * @package App\Models
+ */
+class Material extends Model
+{
+    protected $table = "material"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/MaterialDetail.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 物料
+ * Class Unit
+ * @package App\Models
+ */
+class MaterialDetail extends Model
+{
+    protected $table = "material_detail"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/Measure.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * 测量字段
+ * Class Unit
+ * @package App\Models
+ */
+class Measure extends Model
+{
+    protected $table = "measure"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/Oa.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class Oa extends Model
+{
+    protected $table = "oa"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/OaEmployee.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class OaEmployee extends Model
+{
+    protected $table = "oa_employee"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/OaEmployeeSub.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class OaEmployeeSub extends Model
+{
+    protected $table = "oa_employee_sub"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/OaOrder.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class OaOrder extends Model
+{
+    protected $table = "oa_order"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/OaOrderSub.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class OaOrderSub extends Model
+{
+    protected $table = "oa_order_sub"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/OaOrderSubEmployee.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class OaOrderSubEmployee extends Model
+{
+    protected $table = "oa_order_sub_employee"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

+ 19 - 0
app/Model/OaSub.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ *
+ * Class Unit
+ * @package App\Models
+ */
+class OaSub extends Model
+{
+    protected $table = "oa_sub"; //指定表
+    const CREATED_AT = 'crt_time';
+    const UPDATED_AT = 'upd_time';
+    protected $dateFormat = 'U';
+
+}

Some files were not shown because too many files changed in this diff