cqp 3 bulan lalu
induk
melakukan
fe3962b7ab
46 mengubah file dengan 1 tambahan dan 6351 penghapusan
  1. 0 129
      app/Http/Controllers/Api/AssetController.php
  2. 0 21
      app/Http/Controllers/Api/ImportController.php
  3. 0 426
      app/Http/Controllers/Api/JRFIDController.php
  4. 0 33
      app/Http/Controllers/Api/JobController.php
  5. 0 30
      app/Http/Controllers/Api/LoginController.php
  6. 0 56
      app/Http/Controllers/Api/MayCurController.php
  7. 0 69
      app/Http/Controllers/Api/ReportFormsController.php
  8. 0 109
      app/Http/Controllers/Api/TestController.php
  9. 0 65
      app/Http/Controllers/Api/ThirdController.php
  10. 0 5
      app/Http/Kernel.php
  11. 0 30
      app/Http/Middleware/CheckAssetLogin.php
  12. 0 17
      app/Http/Middleware/CheckForMaintenanceMode.php
  13. 0 29
      app/Http/Middleware/CheckJRFIDLogin.php
  14. 0 54
      app/Http/Middleware/CheckLogin.php
  15. 0 61
      app/Http/Middleware/CheckToken.php
  16. 0 49
      app/Http/Middleware/CheckU8.php
  17. 1 3
      app/Http/Middleware/RequestLog.php
  18. 0 63
      app/Http/Middleware/U8Deal.php
  19. 0 163
      app/Jobs/ManDeviceJobHc.php
  20. 0 168
      app/Jobs/ManDeviceJobJLWM.php
  21. 0 168
      app/Jobs/ManDeviceJobLf.php
  22. 0 14
      app/Model/LfDevice.php
  23. 0 14
      app/Model/MiddleData.php
  24. 0 24
      app/Model/RecordTable.php
  25. 0 34
      app/Model/SystemL.php
  26. 0 47
      app/Providers/RouteServiceProvider.php
  27. 0 412
      app/Service/AssetServerService.php
  28. 0 153
      app/Service/ClearDataService.php
  29. 0 413
      app/Service/ImportService.php
  30. 0 1458
      app/Service/JRFIDServerService.php
  31. 0 586
      app/Service/MayCurServerService.php
  32. 0 174
      app/Service/MayCurVouchersServerService.php
  33. 0 104
      app/Service/ReportFormsService.php
  34. 0 173
      app/Service/RsaEncryptionService.php
  35. 0 578
      app/Service/TestService.php
  36. 0 62
      app/Service/TokenService.php
  37. 0 68
      app/Service/Weixin/WeixinService.php
  38. 0 30
      config/asset.php
  39. 0 8
      config/ip.php
  40. 0 86
      config/j_rfid.php
  41. 0 50
      config/maycur.php
  42. 0 16
      config/u.php
  43. 0 33
      routes/asset.php
  44. 0 24
      routes/maycur.php
  45. 0 16
      routes/web.php
  46. 0 26
      routes/weixin.php

+ 0 - 129
app/Http/Controllers/Api/AssetController.php

@@ -1,129 +0,0 @@
-<?php
-namespace App\Http\Controllers\Api;
-
-use App\Service\AssetServerService;
-use Illuminate\Http\Request;
-
-class AssetController extends BaseController
-{
-    public function getSite(Request $request){
-        list($bool, $data) = (new AssetServerService())->getSite($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function pdList(Request $request){
-        list($bool, $data) = (new AssetServerService())->pdList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function pdDetail(Request $request){
-        list($bool, $data) = (new AssetServerService())->pdDetail($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function pdUpdate(Request $request){
-        list($bool, $data) = (new AssetServerService())->pdUpdate($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function createFixedBorrow(Request $request){
-        list($bool, $data) = (new AssetServerService())->createFixedBorrow($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function baseFixedQuery(Request $request){
-        list($bool, $data) = (new AssetServerService())->baseFixedQuery($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function createFixedReturn(Request $request){
-        list($bool, $data) = (new AssetServerService())->createFixedReturn($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function manList(Request $request){
-        list($bool, $data) = (new AssetServerService())->manList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function bmList(Request $request){
-        list($bool, $data) = (new AssetServerService())->bmList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function fbList(Request $request){
-        list($bool, $data) = (new AssetServerService())->fbList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function tourismBaseFixedBorrowList(Request $request){
-        list($bool, $data) = (new AssetServerService())->tourismBaseFixedBorrowList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-}

+ 0 - 21
app/Http/Controllers/Api/ImportController.php

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

+ 0 - 426
app/Http/Controllers/Api/JRFIDController.php

@@ -1,426 +0,0 @@
-<?php
-namespace App\Http\Controllers\Api;
-
-use App\Service\JRFIDServerService;
-use Illuminate\Http\Request;
-
-class JRFIDController extends BaseController
-{
-    public function getSite(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getSite($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getSite2(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getSite2($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getFlowByProduce(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getFlowByProduce($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getProduceByContract(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getProduceByContract($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getPrintData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getPrintData($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getPrintData2(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getPrintData2($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getTeam(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getTeam($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getDepart(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getDepart($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getProcedureClass(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getProcedureClass($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function furnProduceScheduleList(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->furnProduceScheduleList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function completionOrders(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->completionOrders($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function scanScreenCompleted(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->scanScreenCompleted($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenGetDispatchDtData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenGetDispatchDtData($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function qualityOrders(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->qualityOrders($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenPrint(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenPrint($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenPrintSepData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenPrintSepData($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenGetSepData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenGetSepData($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getContractDrawRoom(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getContractDrawRoom($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getDispatchContractDrawRoom(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getDispatchContractDrawRoom($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenGetProFlow(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenGetProFlow($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenSend(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenSend($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenAutoCreateDispatch(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenAutoCreateDispatch($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenReceipt(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenReceipt($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenPackage(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenPackage($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenGetPackageData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenGetPackageData($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenGetProDtData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenGetProDtData($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenGetPackageAssem(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenGetPackageAssem($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenGetPackageAssemData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenGetPackageAssemData($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function furnSeparateOrderDtAssemList(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->furnSeparateOrderDtAssemList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenPackageBySepAssem(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenPackageBySepAssem($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function sendAndReceiptList(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->sendAndReceiptList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function sendOrderDtAssemList(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->sendOrderDtAssemList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function packageList(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->packageList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function furnSeparateOrderCompList(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->furnSeparateOrderCompList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function furnSeparateOrderDtCompList(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->furnSeparateOrderDtCompList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function furnSendOrderDtCompList(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->furnSendOrderDtCompList($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function getWorkshopData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->getWorkshopData($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function screenGetSendData(Request $request){
-        list($bool, $data) = (new JRFIDServerService())->screenGetSendData($request->all(),$request->common_param);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            if($bool === 0) return $this->json_return(401,$data);
-            return $this->json_return(201,$data);
-        }
-    }
-}

+ 0 - 33
app/Http/Controllers/Api/JobController.php

@@ -1,33 +0,0 @@
-<?php
-
-namespace App\Http\Controllers\Api;
-
-use App\Jobs\ManDeviceJobHc;
-use App\Jobs\ManDeviceJobJLWM;
-use App\Jobs\ManDeviceJobLf;
-use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Redis;
-
-class JobController extends BaseController
-{
-    //有人云(朗峰)
-    public function processDataJobAddDeviceManLf(Request $request){
-
-        dispatch(new ManDeviceJobLf($request->all()))->onQueue('man_device_lf');
-
-        echo $request->get('verify');die;
-    }
-
-    public function processDataJobAddDeviceManHc(Request $request){
-
-        dispatch(new ManDeviceJobHc($request->all()))->onQueue('man_device_hc');
-
-        echo $request->get('verify');die;
-    }
-
-    public function processDataJobAddDeviceManJLWM(Request $request){
-        dispatch(new ManDeviceJobJLWM($request->all()))->onQueue('man_device_jlwm');
-
-        echo $request->get('verify');die;
-    }
-}

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

@@ -1,30 +0,0 @@
-<?php
-namespace App\Http\Controllers\Api;
-
-use App\Service\AssetServerService;
-use App\Service\JRFIDServerService;
-use Illuminate\Http\Request;
-
-//登录
-class LoginController extends BaseController
-{
-    public function login(Request $request){
-        $data = $request->only("name","password","rememberMe");
-        list($bool, $msg) = (new JRFIDServerService())->loginRule($data);
-        if($bool){
-            return $this->json_return(200,'',$msg);
-        }else{
-            return $this->json_return(201,$msg);
-        }
-    }
-
-    public function assetlogin(Request $request){
-        $data = $request->only("name","password");
-        list($bool, $msg) = (new AssetServerService())->loginRule($data);
-        if($bool){
-            return $this->json_return(200,'',$msg);
-        }else{
-            return $this->json_return(201,$msg);
-        }
-    }
-}

+ 0 - 56
app/Http/Controllers/Api/MayCurController.php

@@ -1,56 +0,0 @@
-<?php
-namespace App\Http\Controllers\Api;
-
-use App\Service\MayCurServerService;
-use App\Service\MayCurVouchersServerService;
-use Illuminate\Http\Request;
-
-class MayCurController extends BaseController
-{
-    public function getToken(Request $request){
-        list($bool, $data) = (new MayCurServerService())->getToken();
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function reimburse(Request $request){
-        list($bool, $data) = (new MayCurServerService())->reimburse($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function loan(Request $request){
-        list($bool, $data) = (new MayCurServerService())->loan($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function voucher(Request $request){
-        $data = $request->all();
-
-        list($bool, $data) = (new MayCurVouchersServerService($data))->voucher($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function saveOaData(Request $request){
-        $data = (new MayCurServerService())->saveOaData($request->all(),$request->header());
-        return $data;
-    }
-}

File diff ditekan karena terlalu besar
+ 0 - 69
app/Http/Controllers/Api/ReportFormsController.php


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

@@ -3,120 +3,11 @@
 namespace App\Http\Controllers\Api;
 
 use App\Service\qyWechatService;
-use App\Service\TestService;
 use Illuminate\Http\Request;
 use Illuminate\Support\Str;
 
 class TestController extends BaseController
 {
-    public function testdwy(Request $request){
-        list($bool, $data) = (new TestService())->testdwy($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function testdwyget(Request $request){
-        list($bool, $data) = (new TestService())->testdwyget($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function testdwyput(Request $request){
-        list($bool, $data) = (new TestService())->testdwyput($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function test(){
-        dd(env("maycur_appcode"),env("maycur_appsercet"),getenv("maycur_appcode"),getenv("maycur_appsercet"));
-    }
-
-    public function salesOrderGet(Request $request){
-        $common_array = $request->common_param;
-        list($bool, $data) = (new TestService())->salesOrderGet($request->all(),$common_array);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function materialAddU8(Request $request){
-        $common_array = $request->common_param;
-        list($bool, $data) = (new TestService())->materialAddU8($request->all(), $common_array);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function productInAddU8(Request $request){
-        $common_array = $request->common_param;
-        list($bool, $data) = (new TestService())->ProductInAddU8($request->all(), $common_array);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function dispatchAddU8(Request $request){
-        $common_array = $request->common_param;
-        list($bool, $data) = (new TestService())->DispatchAddU8($request->all(), $common_array);
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    public function recordList(Request $request){
-        list($bool, $data) = (new TestService())->recordList($request->all());
-
-        if($bool){
-            return $this->json_return(200,'',$data);
-        }else{
-            return $this->json_return(201,$data);
-        }
-    }
-
-    // 仓库档案 http://localhost:8060/api/WareHouse/Get  ?CodeorName=0501 为空返回所有数据
-    // 部门档案 http://localhost:8060/api/Department/Get ?CodeorName=0501 为空返回所有数据
-    // 人员档案 http://localhost:8060/api/Person/Get     ?CodeorName=00043&bPsnPerson=1(是否业务员)  为空返回所有数据
-    // 客户分类 http://localhost:8060/api/Customer/GetCustomerClass  ?cCCCode=01 为空返回所有数据
-    // 客户档案 http://localhost:8060/api/Customer/GetCustomerClass  ?cCCCode=01 为空返回所有数据
-    // 存货分类 http://localhost:8060/api/Inventory/GetInventoryClass  ?CodeorName=0101 为空返回所有
-    // 存货档案 http://localhost:8060/api/System/SqlQuery
-    //{
-    //	"customSQLFileName": "U8SQL",
-    //	"customSQLPath": "U8API/Inventory/Get",
-    //	"paramObj": {
-    //		"@pagesize": 25,
-    //		"@codeorname": "0301",
-    //		"@where": "AND cInvCode = 'BB01' AND cInvName  like '%交换机%'",
-    //		"@version": "7098847"
-    //	}
-    //}
-    // 计量单位 http://localhost:8060/api/Inventory/GetComputationUnit  ?CodeorName=0502  为空返回所有数据
-
-
     public function getSignatures(Request $request)
     {
         $data = $request->all();

+ 0 - 65
app/Http/Controllers/Api/ThirdController.php

@@ -1,65 +0,0 @@
-<?php
-namespace App\Http\Controllers\Api;
-
-use Illuminate\Http\Request;
-
-class ThirdController extends BaseController
-{
-    //临时方法,生成pdf文件,打水印
-    public function pdfLogo(Request $request){
-        $data = $request->all();
-        if(!isset($data['title'])) return $this->returnMsg('单据名称必填');
-        if(!isset($data['year'])) return $this->returnMsg('年份必填');
-        if(!isset($data['month'])) return $this->returnMsg('月份必填');
-        if(!isset($data['day'])) return $this->returnMsg('当前日期必填');
-        if(!isset($data['depart'])) return $this->returnMsg('部门必填');
-        if(!isset($data['name'])) return $this->returnMsg('姓名必填');
-        if(!isset($data['work'])) return $this->returnMsg('岗位必填');
-        if(!isset($data['oa_list'])) return $this->returnMsg('审批人必填');
-        if(!isset($data['detail'])) return $this->returnMsg('明细必填');
-        if(!isset($data['logo_url'])) return $this->returnMsg('印章必填');
-
-        return ['status'=>200,'msg'=>'','data'=>[
-            'pdf'=>'https://hxy.qingyaokeji.com/418078322674.pdf'
-        ]];
-    }
-
-    public function returnMsg($text){
-        return ['status'=>201,'msg'=>$text,'data'=>[]];
-    }
-    public function pdfData(){
-        $data = [
-            'title' => '费用报销单',
-            'year' => '2024',
-            'month' => '07',
-            'day' => '05',
-            'depart' => '部门',
-            'name' => '姓名',
-            'work' => '岗位',
-            'logo_url' => '印章地址',
-            'oa_list' => [
-                [
-                    'sort_name' => '主管',
-                    'name' => '主管名称',
-                ],[
-                    'sort_name' => '会计',
-                    'name' => '会计名称',
-                ],
-            ],
-           'detail' => [
-               [
-                   'date' => '2024-07-06',
-                   'project' => '项目',
-                   'type' => '类别',
-                   'invoice_total' => '发票张数',
-                   'amount' => '金额',
-                   'remark' => '备注',
-               ]
-           ]
-        ];
-
-        return $data;
-    }
-
-
-}

+ 0 - 5
app/Http/Kernel.php

@@ -63,11 +63,6 @@ class Kernel extends HttpKernel
         'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
         'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
         'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
-        'checkLogin' => \App\Http\Middleware\CheckLogin::class,
-        'CheckJRFIDLogin' => \App\Http\Middleware\CheckJRFIDLogin::class,
-        'CheckAssetLogin' => \App\Http\Middleware\CheckAssetLogin::class,
-        'CheckU8' => \App\Http\Middleware\CheckU8::class,
-        'U8Deal' => \App\Http\Middleware\U8Deal::class,
     ];
 
     /**

+ 0 - 30
app/Http/Middleware/CheckAssetLogin.php

@@ -1,30 +0,0 @@
-<?php
-
-namespace App\Http\Middleware;
-
-use App\Service\EmployeeService;
-use App\Service\JRFIDServerService;
-use Closure;
-
-class CheckAssetLogin
-{
-    const account = "admin";
-    const password = "admin,,bpm";
-
-    /**
-     * Handle an incoming request.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \Closure  $next
-     * @return mixed
-     */
-    public function handle($request, Closure $next)
-    {
-        $base = base64_encode(Self::account . ':' . Self::password);
-        $token = "Basic " . $base;
-        $data['header'] = ["Authorization: {$token}",'Content-Type:application/json'];
-
-        $request->common_param = $data;
-        return $next($request);
-    }
-}

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

@@ -1,17 +0,0 @@
-<?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 = [
-        //
-    ];
-}

+ 0 - 29
app/Http/Middleware/CheckJRFIDLogin.php

@@ -1,29 +0,0 @@
-<?php
-
-namespace App\Http\Middleware;
-
-use App\Service\EmployeeService;
-use App\Service\JRFIDServerService;
-use Closure;
-
-class CheckJRFIDLogin
-{
-    /**
-     * 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(empty($token)) return response()->json(['code'=>401,'msg'=>'缺少登录凭证','data'=>null]);
-        if(strpos($token, "Bearer ") === false) $token = "Bearer " . $token;
-        $data['token'] = $token;
-        $data['header'] = ["Authorization: {$token}",'Content-Type:application/json'];
-
-        $request->common_param = $data;
-        return $next($request);
-    }
-}

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

@@ -1,54 +0,0 @@
-<?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);
-    }
-}

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

@@ -1,61 +0,0 @@
-<?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);
-
-    }
-
-
-
-
-}

+ 0 - 49
app/Http/Middleware/CheckU8.php

@@ -1,49 +0,0 @@
-<?php
-
-namespace App\Http\Middleware;
-
-use Closure;
-use Illuminate\Http\Request;
-
-class CheckU8
-{
-    /**
-     * Handle an incoming request.
-     *
-     * @param  Request  $request
-     * @param Closure $next
-     * @return mixed
-     */
-    public function handle($request, Closure $next)
-    {
-        $site = $request->header('Site');
-        if(empty($site)) return response()->json(['code'=>201,'msg'=>'缺少站点信息','data'=>null]);
-
-        $zt = $request->header('Zt');
-        if(empty($zt)) return response()->json(['code'=>201,'msg'=>'缺少账套信息','data'=>null]);
-
-        if($zt == "1"){
-            $database = "UFDATA_001_2025";
-        }elseif($zt == "2"){
-            $database = "UFDATA_999_2025";
-        }else{
-            return response()->json(['code'=>201,'msg'=>'账套信息错误','data'=>null]);
-        }
-        $title = $site . "(" . $database . ")";
-        $config = config("u");
-        if(! isset($config[$site])) return response()->json(['code'=>201,'msg'=>'站点:' . $site . '暂未配置,请联系管理员','data'=>null]);
-        $site_array = $config[$site];
-        if(empty($site_array['api_host'])) return response()->json(['code'=>201,'msg'=>'站点:' . $site . '下用友对外域名暂未配置,请联系管理员','data'=>null]);
-        if(empty($site_array['api_port'])) return response()->json(['code'=>201,'msg'=>'站点:' . $site . '下用友对外域名端口暂未配置,请联系管理员','data'=>null]);
-
-        $request->common_param = [
-            'site' => $site,
-            'api_host' => $site_array['api_host'],
-            'api_port' => $site_array['api_port'],
-            'database' => $database,
-            'title' => $title
-        ];
-
-        return $next($request);
-    }
-}

+ 1 - 3
app/Http/Middleware/RequestLog.php

@@ -31,9 +31,7 @@ class RequestLog
             $ip = '0.0.0.0';
         }
         $params = $request->all();
-        if($request->path() != 'api/man_device_lf' && $request->path() != 'api/man_device_hc'){
-            Log::channel('request')->info('request', ['param'=>$params,'ip' => $ip,'uri'=>$request->path()]);
-        }
+        Log::channel('request')->info('request', ['param'=>$params,'ip' => $ip,'uri'=>$request->path()]);
 
         return $next($request);
     }

+ 0 - 63
app/Http/Middleware/U8Deal.php

@@ -1,63 +0,0 @@
-<?php
-namespace App\Http\Middleware;
-
-use App\Model\RecordTable;
-use Closure;
-use Illuminate\Http\Request;
-use Symfony\Component\HttpFoundation\Response;
-
-class U8Deal
-{
-    /**
-     * Handle an incoming request.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \Closure  $next
-     * @return mixed
-     */
-    public function handle(Request $request, Closure $next)
-    {
-        // 在这里可以添加请求前的操作,但通常我们只关心请求后的操作。
-        return $next($request);
-    }
-
-    /**
-     * Handle the request termination.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \Illuminate\Http\Response  $response
-     * @return void
-     */
-    public function terminate(Request $request, Response $response)
-    {
-        $return = json_decode($response->content(),true);
-
-        if(isset($return['code'])){
-            $site = $request->header('Site');
-            $path = $request->path();
-            $type = 0;
-            if($path == "api/materialAddU8"){
-                $type = RecordTable::type_one;
-            }elseif ($path == "api/productInAddU8"){
-                $type = RecordTable::type_two;
-            }elseif ($path == "api/dispatchAddU8"){
-                $type = RecordTable::type_three;
-            }
-            $return_data = null;
-
-            if (!empty($return['data']) && is_array($return['data'])) {
-                $return_data = json_encode($return['data'], JSON_UNESCAPED_UNICODE);
-            } else {
-                $return_data = json_encode(new \stdClass()); // "{}"
-            }
-            RecordTable::insert([
-               'msg' => $return['msg'] ?? "",
-               'data' => json_encode($request->all()),
-               'crt_time' => time(),
-               'type' => $type,
-               'return_data' => $return_data,
-               'site' => $site,
-            ]);
-        }
-    }
-}

+ 0 - 163
app/Jobs/ManDeviceJobHc.php

@@ -1,163 +0,0 @@
-<?php
-
-namespace App\Jobs;
-
-use App\Service\ClearDataService;
-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\Log;
-use Symfony\Component\Console\Output\OutputInterface;
-
-class ManDeviceJobHc implements ShouldQueue
-{
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
-
-    protected $data;
-    protected $url;
-
-    /**
-     * Create a new job instance.
-     *
-     * @return void
-     */
-    public function __construct($data)
-    {
-        $this->data = $data;
-        $this->url = config('ip.zslf');
-    }
-
-    public function handle()
-    {
-        try {
-            if (empty($this->data['data'])) return;
-
-            $deviceId = $this->data['data']['deviceId'];
-            $dataPoints = $this->data['data']['dataPoints'] ?? [];
-
-            if ($this->data['type'] == "dataPoint") {
-                $redisKey = 'buffer:hengchang_data';
-                $batchSize = 500;
-
-                // 1. 整理数据并推入 Redis 列表
-                $records = [];
-                foreach ($dataPoints as $value) {
-                    if (empty($value['value'])) continue;
-
-                    $records[] = json_encode([
-                        'machine_code' => $deviceId . $value['dataPointId'],
-                        'param_value'   => floatval($value['value']),
-                        'time'    => $this->getNowDay()
-                    ]);
-                }
-
-                if (!empty($records)) {
-                    // 批量推入 Redis
-                    \Illuminate\Support\Facades\Redis::rpush($redisKey, ...$records);
-
-                    // 【核心修改点】:每次写入数据都重置 Key 的过期时间为 30 分钟 (1800秒)
-                    // 只要持续有数据进来,这个 Key 就一直有效
-                    // 如果超过 30 分钟没新数据进来(设备关机/下班),Redis 自动删除该 Key
-                    \Illuminate\Support\Facades\Redis::expire($redisKey, 1800);
-                }
-
-                // 2. 检查 Redis 里的总条数
-                $currentCount = \Illuminate\Support\Facades\Redis::llen($redisKey);
-
-                // 3. 达到 500 条,执行批量发送
-                if ($currentCount >= $batchSize) {
-                    $this->processBatchSend($redisKey, $batchSize);
-                }
-            }
-        } catch (\Exception $exception) {
-            Log::channel('apiLog')->info('hc开始位置异常', ["param" => $exception->getMessage()]);
-            // 发生异常时可以根据需要选择是否 delete 或 release
-            $this->delete();
-        }
-    }
-
-    /**
-     * 批量处理发送逻辑
-     */
-    protected function processBatchSend($redisKey, $batchSize)
-    {
-        // 原子化弹出 500 条数据
-        $rawRecords = \Illuminate\Support\Facades\Redis::pipeline(function ($pipe) use ($redisKey, $batchSize) {
-            for ($i = 0; $i < $batchSize; $i++) {
-                $pipe->lpop($redisKey);
-            }
-        });
-
-        $batchData = array_values(array_map(fn($item) => json_decode($item, true), array_filter($rawRecords)));
-
-        if (empty($batchData)) return;
-
-        list($status,$msg) = $this->sendToDeviceBatch($batchData);
-        if(! $status) echo $msg;
-    }
-
-    public function sendToDeviceBatch($data){
-        list($status,$token) = ClearDataService::getTokenHc();
-        if(! $status) return [false, $token];
-
-        $url = $this->url . "api/module-data/hc_device_machine_record/hc_device_machine_record/diy/create_data";
-        $post = [
-            'data' => [
-                'device_machine_record' => $data
-            ]
-        ];
-        $header = ["Authorization: Bearer {$token}","Content-Type:application/json","Site:HCLT"];
-
-        $curl = curl_init();
-        curl_setopt_array($curl, array(
-            CURLOPT_URL => $url,
-            CURLOPT_RETURNTRANSFER => true,
-            CURLOPT_ENCODING => '',
-            CURLOPT_MAXREDIRS => 10,
-            CURLOPT_TIMEOUT => 15,
-            CURLOPT_FOLLOWLOCATION => true,
-            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-            CURLOPT_CUSTOMREQUEST => 'POST',
-            CURLOPT_POSTFIELDS => json_encode($post),
-            CURLOPT_SSL_VERIFYPEER => false,
-            CURLOPT_HTTPHEADER => $header,
-        ));
-        $response = curl_exec($curl);
-        if ($response === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($curl);
-            // 获取错误信息
-            $errorMessage = curl_error($curl);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-            Log::channel('apiLog')->info('hc写入数据', ["param" => $message]);
-        }
-        curl_close($curl);
-
-        $res = json_decode($response,true);
-        if(! isset($res['status'])){//报错了
-            Log::channel('apiLog')->info('hc写入数据返回错误', ["param" => $response]);
-        }
-
-        return [true, ''];
-    }
-
-    protected function echoMessage(OutputInterface $output)
-    {
-        $output->writeln($this->data);
-    }
-
-    function getNowDay(){
-        // 获取当前时间
-        $currentDateTime = new \DateTime();
-
-        // 设置时区为 PRC
-        $currentDateTime->setTimezone(new \DateTimeZone('UTC'));
-
-        // 格式化时间为 "2023-09-21T16:00:00.000Z" 的格式
-        $formattedDateTime = $currentDateTime->format('Y-m-d\TH:i:s.000\Z');
-
-        return $formattedDateTime;
-    }
-}

+ 0 - 168
app/Jobs/ManDeviceJobJLWM.php

@@ -1,168 +0,0 @@
-<?php
-
-namespace App\Jobs;
-
-use App\Service\ClearDataService;
-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\Log;
-use Symfony\Component\Console\Output\OutputInterface;
-
-class ManDeviceJobJLWM implements ShouldQueue
-{
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
-
-    protected $data;
-    protected $url;
-
-    /**
-     * Create a new job instance.
-     *
-     * @return void
-     */
-    public function __construct($data)
-    {
-        $this->data = $data;
-        $this->url = config('ip.zslf');
-    }
-
-    /**
-     * Execute the job.
-     *
-     * @return void
-     */
-    public function handle()
-    {
-        try {
-            if (empty($this->data['data'])) return;
-
-            $deviceId = $this->data['data']['deviceId'];
-            $dataPoints = $this->data['data']['dataPoints'] ?? [];
-
-            if ($this->data['type'] == "dataPoint") {
-                $redisKey = 'buffer:jialiwumei_data';
-                $batchSize = 10;
-
-                // 1. 整理数据并推入 Redis 列表
-                $records = [];
-                foreach ($dataPoints as $value) {
-                    if (empty($value['value'])) continue;
-
-                    $records[] = json_encode([
-                        'machine_code' => $deviceId . $value['dataPointId'],
-                        'param_value'   => floatval($value['value']),
-                        'time'    => $this->getNowDay()
-                    ]);
-                }
-
-                if (!empty($records)) {
-                    // 批量推入 Redis
-                    \Illuminate\Support\Facades\Redis::rpush($redisKey, ...$records);
-
-                    // 【核心修改点】:每次写入数据都重置 Key 的过期时间为 30 分钟 (1800秒)
-                    // 只要持续有数据进来,这个 Key 就一直有效
-                    // 如果超过 30 分钟没新数据进来(设备关机/下班),Redis 自动删除该 Key
-                    \Illuminate\Support\Facades\Redis::expire($redisKey, 1800);
-                }
-
-                // 2. 检查 Redis 里的总条数
-                $currentCount = \Illuminate\Support\Facades\Redis::llen($redisKey);
-
-                // 3. 达到 500 条,执行批量发送
-
-                if ($currentCount >= $batchSize) {
-                    $this->processBatchSend($redisKey, $batchSize);
-                }
-            }
-        } catch (\Exception $exception) {
-            Log::channel('apiLog')->info('jlwm开始位置', ["param" => $exception->getMessage()]);
-            $this->delete();
-        }
-    }
-
-    /**
-     * 批量处理发送逻辑
-     */
-    protected function processBatchSend($redisKey, $batchSize)
-    {
-        // 原子化弹出 500 条数据
-        $rawRecords = \Illuminate\Support\Facades\Redis::pipeline(function ($pipe) use ($redisKey, $batchSize) {
-            for ($i = 0; $i < $batchSize; $i++) {
-                $pipe->lpop($redisKey);
-            }
-        });
-
-        $batchData = array_values(array_map(fn($item) => json_decode($item, true), array_filter($rawRecords)));
-
-        if (empty($batchData)) return;
-
-        list($status,$msg) = $this->sendToDeviceBatch($batchData);
-        if(! $status) echo $msg;
-    }
-
-    public function sendToDeviceBatch($data){
-        list($status,$token) = ClearDataService::getTokenJLWM();
-        if(! $status) return [false, $token];
-
-        $url = $this->url . "api/module-data/jlwm_device_machine_record/jlwm_device_machine_record/diy/create_data";
-        $post = [
-            'data' => [
-                'device_machine_record' => $data
-            ]
-        ];
-        $header = ["Authorization: Bearer {$token}","Content-Type:application/json","Site:JLWM"];
-
-        $curl = curl_init();
-        curl_setopt_array($curl, array(
-            CURLOPT_URL => $url,
-            CURLOPT_RETURNTRANSFER => true,
-            CURLOPT_ENCODING => '',
-            CURLOPT_MAXREDIRS => 10,
-            CURLOPT_TIMEOUT => 15,
-            CURLOPT_FOLLOWLOCATION => true,
-            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-            CURLOPT_CUSTOMREQUEST => 'POST',
-            CURLOPT_POSTFIELDS => json_encode($post),
-            CURLOPT_SSL_VERIFYPEER => false,
-            CURLOPT_HTTPHEADER => $header,
-        ));
-        $response = curl_exec($curl);
-        if ($response === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($curl);
-            // 获取错误信息
-            $errorMessage = curl_error($curl);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-            Log::channel('apiLog')->info('jlwm写入数据', ["param" => $message]);
-        }
-        curl_close($curl);
-
-        $res = json_decode($response,true);
-        if(! isset($res['status'])){//报错了
-            Log::channel('apiLog')->info('jlwm写入数据返回错误', ["param" => $response]);
-        }
-
-        return [true, ''];
-    }
-
-    protected function echoMessage(OutputInterface $output)
-    {
-        $output->writeln($this->data);
-    }
-
-    function getNowDay(){
-        // 获取当前时间
-        $currentDateTime = new \DateTime();
-
-        // 设置时区为 PRC
-        $currentDateTime->setTimezone(new \DateTimeZone('UTC'));
-
-        // 格式化时间为 "2023-09-21T16:00:00.000Z" 的格式
-        $formattedDateTime = $currentDateTime->format('Y-m-d\TH:i:s.000\Z');
-
-        return $formattedDateTime;
-    }
-}

+ 0 - 168
app/Jobs/ManDeviceJobLf.php

@@ -1,168 +0,0 @@
-<?php
-
-namespace App\Jobs;
-
-use App\Service\ClearDataService;
-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\Log;
-use Symfony\Component\Console\Output\OutputInterface;
-
-class ManDeviceJobLf implements ShouldQueue
-{
-    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
-
-    protected $data;
-    protected $url;
-
-    /**
-     * Create a new job instance.
-     *
-     * @return void
-     */
-    public function __construct($data)
-    {
-        $this->data = $data;
-        $this->url = config('ip.zslfip');
-    }
-
-    /**
-     * Execute the job.
-     *
-     * @return void
-     */
-    public function handle()
-    {
-        try {
-            if (empty($this->data['data'])) return;
-
-            $deviceId = $this->data['data']['deviceId'];
-            $dataPoints = $this->data['data']['dataPoints'] ?? [];
-
-            if ($this->data['type'] == "dataPoint") {
-                $redisKey = 'buffer:langfeng_data';
-                $batchSize = 500;
-
-                // 1. 整理数据并推入 Redis 列表
-                $records = [];
-                foreach ($dataPoints as $value) {
-                    if (empty($value['value'])) continue;
-
-                    $records[] = json_encode([
-                        'machine_code' => $deviceId . $value['dataPointId'],
-                        'param_value'   => floatval($value['value']),
-                        'time'    => $this->getNowDay()
-                    ]);
-                }
-
-                if (!empty($records)) {
-                    // 批量推入 Redis
-                    \Illuminate\Support\Facades\Redis::rpush($redisKey, ...$records);
-
-                    // 【核心修改点】:每次写入数据都重置 Key 的过期时间为 30 分钟 (1800秒)
-                    // 只要持续有数据进来,这个 Key 就一直有效
-                    // 如果超过 30 分钟没新数据进来(设备关机/下班),Redis 自动删除该 Key
-                    \Illuminate\Support\Facades\Redis::expire($redisKey, 1800);
-                }
-
-                // 2. 检查 Redis 里的总条数
-                $currentCount = \Illuminate\Support\Facades\Redis::llen($redisKey);
-
-                // 3. 达到 500 条,执行批量发送
-
-                if ($currentCount >= $batchSize) {
-                    $this->processBatchSend($redisKey, $batchSize);
-                }
-            }
-        } catch (\Exception $exception) {
-            Log::channel('apiLog')->info('lf开始位置', ["param" => $exception->getMessage()]);
-            $this->delete();
-        }
-    }
-
-    /**
-     * 批量处理发送逻辑
-     */
-    protected function processBatchSend($redisKey, $batchSize)
-    {
-        // 原子化弹出 500 条数据
-        $rawRecords = \Illuminate\Support\Facades\Redis::pipeline(function ($pipe) use ($redisKey, $batchSize) {
-            for ($i = 0; $i < $batchSize; $i++) {
-                $pipe->lpop($redisKey);
-            }
-        });
-
-        $batchData = array_values(array_map(fn($item) => json_decode($item, true), array_filter($rawRecords)));
-
-        if (empty($batchData)) return;
-
-        list($status,$msg) = $this->sendToDeviceBatch($batchData);
-        if(! $status) echo $msg;
-    }
-
-    public function sendToDeviceBatch($data){
-        list($status,$token) = ClearDataService::getTokenLf();
-        if(! $status) return [false, $token];
-
-        $url = $this->url . "api/module-data/device_machine_record/device_machine_record/diy/create_single_data";
-        $post = [
-            'data' => [
-                'device_machine_record' => $data
-            ]
-        ];
-        $header = ["Authorization: Bearer {$token}","Content-Type:application/json","Site:LFMY"];
-
-        $curl = curl_init();
-        curl_setopt_array($curl, array(
-            CURLOPT_URL => $url,
-            CURLOPT_RETURNTRANSFER => true,
-            CURLOPT_ENCODING => '',
-            CURLOPT_MAXREDIRS => 10,
-            CURLOPT_TIMEOUT => 15,
-            CURLOPT_FOLLOWLOCATION => true,
-            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-            CURLOPT_CUSTOMREQUEST => 'POST',
-            CURLOPT_POSTFIELDS => json_encode($post),
-            CURLOPT_SSL_VERIFYPEER => false,
-            CURLOPT_HTTPHEADER => $header,
-        ));
-        $response = curl_exec($curl);
-        if ($response === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($curl);
-            // 获取错误信息
-            $errorMessage = curl_error($curl);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-            Log::channel('apiLog')->info('lf写入数据', ["param" => $message]);
-        }
-        curl_close($curl);
-
-        $res = json_decode($response,true);
-        if(! isset($res['status'])){//报错了
-            Log::channel('apiLog')->info('lf写入数据返回错误', ["param" => $response]);
-        }
-
-        return [true, ''];
-    }
-
-    protected function echoMessage(OutputInterface $output)
-    {
-        $output->writeln($this->data);
-    }
-
-    function getNowDay(){
-        // 获取当前时间
-        $currentDateTime = new \DateTime();
-
-// 设置时区为 PRC
-        $currentDateTime->setTimezone(new \DateTimeZone('UTC'));
-
-// 格式化时间为 "2023-09-21T16:00:00.000Z" 的格式
-        $formattedDateTime = $currentDateTime->format('Y-m-d\TH:i:s.000\Z');
-
-        return $formattedDateTime;
-    }
-}

+ 0 - 14
app/Model/LfDevice.php

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

+ 0 - 14
app/Model/MiddleData.php

@@ -1,14 +0,0 @@
-<?php
-
-namespace App\Model;
-
-use Illuminate\Database\Eloquent\Model;
-
-class MiddleData extends Model
-{
-    protected $table = "middle_data";
-    const CREATED_AT = null;
-    const UPDATED_AT = null;
-    protected $dateFormat = 'U';
-    protected $guarded = [];
-}

+ 0 - 24
app/Model/RecordTable.php

@@ -1,24 +0,0 @@
-<?php
-
-namespace App\Model;
-
-use Illuminate\Database\Eloquent\Model;
-
-class RecordTable extends Model
-{
-    protected $table = "record_table"; //指定表
-    const CREATED_AT = null;
-    const UPDATED_AT = null;
-    protected $dateFormat = 'U';
-    protected $guarded = [];
-
-    const type_one = 1;
-    const type_two = 2;
-    const type_three = 3;
-
-    public static $type = [
-        self::type_one => "领料申请单",
-        self::type_two => "产成品入库单",
-        self::type_three => "发货单",
-    ];
-}

+ 0 - 34
app/Model/SystemL.php

@@ -1,34 +0,0 @@
-<?php
-
-namespace App\Model;
-
-use Illuminate\Database\Eloquent\Model;
-
-class SystemL extends Model
-{
-    protected $table = "system_L"; //指定表
-    const CREATED_AT = null;
-    const UPDATED_AT = null;
-    protected $dateFormat = 'U';
-
-    const run = '压机上升'; //  运行时间/次数
-    const work = '小车前进'; // 工作时间/次数  不用了
-    const stop = '急停'; // 故障时间/次数
-    const standBy = '压机下降';// 待机时间/次数
-
-    public static $device = [
-        "涂胶一号机" => "01401424070300010036",
-        "涂胶二号机" => "01401424070300009843",
-        "涂胶三号机" => "01401424070300009708",
-        "清边一号机" => "01401424070300009271",
-        "清边二号机" => "01401424070300009160",
-        "热压一号机" => "01401424070300009371",
-        "热压二号机" => "01401424070300008948",
-    ];
-
-    public static $device_point_id_1 = [
-        self::run => '15262427',
-        self::stop => '15262429',
-        self::standBy => '15262428',
-    ];
-}

+ 0 - 47
app/Providers/RouteServiceProvider.php

@@ -43,29 +43,6 @@ class RouteServiceProvider extends ServiceProvider
     public function map()
     {
         $this->mapApiRoutes();
-
-        $this->mapWebRoutes();
-
-        $this->mapWeixinRoutes();
-
-        $this->mapAssetApiRoutes();
-
-        $this->mapMaycurRoutes();
-        //
-    }
-
-    /**
-     * Define the "web" routes for the application.
-     *
-     * These routes all receive session state, CSRF protection, etc.
-     *
-     * @return void
-     */
-    protected function mapWebRoutes()
-    {
-        Route::middleware('web')
-             ->namespace($this->namespace)
-             ->group(base_path('routes/web.php'));
     }
 
     /**
@@ -82,28 +59,4 @@ class RouteServiceProvider extends ServiceProvider
              ->namespace($this->namespace)
              ->group(base_path('routes/api.php'));
     }
-
-    protected function mapAssetApiRoutes()
-    {
-        Route::prefix('assetapi')
-            ->middleware('api')
-            ->namespace($this->namespace)
-            ->group(base_path('routes/asset.php'));
-    }
-
-    protected function mapWeixinRoutes()
-    {
-        Route::prefix('wxapi')
-            ->middleware('api')
-            ->namespace($this->namespace)
-            ->group(base_path('routes/weixin.php'));
-    }
-
-    protected function mapMaycurRoutes()
-    {
-        Route::prefix('maycur')
-            ->middleware('api')
-            ->namespace($this->namespace)
-            ->group(base_path('routes/maycur.php'));
-    }
 }

+ 0 - 412
app/Service/AssetServerService.php

@@ -1,412 +0,0 @@
-<?php
-
-namespace App\Service;
-
-
-use Illuminate\Support\Facades\Log;
-
-class AssetServerService extends Service
-{
-    public function loginRule($data){
-        if(empty($data['name'])) return [false, '请输入账号!'];
-        if(empty($data['password'])) return [false, '请输入密码!'];
-
-        return [true, ''];
-
-        list($status, $msg) = $this->getToken($data);
-        if(! $status) return [false, $msg];
-
-        return [true, ['data' => $msg]];
-    }
-
-    public function getToken($data){
-        $account = $data['name'];
-        $password = $data['password'];
-
-        $url = config("asset.login");
-        $post = [
-            "name" => $account,
-            "password" => $password,
-            "rememberMe" => true
-        ];
-        $header = ['Content-Type:application/json'];
-        list($status, $result) = $this->post_helper($url,$post, $header);
-        if(! $status) return [$status, $result];
-
-        //登录失败
-        if(! empty($result['errorMessage'])) return [false, $result['errorMessage']];
-
-        return [true, $result];
-    }
-
-    public function pdList($data,$param){
-        $url = config("asset.pdList");
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function pdDetail($data,$param){
-        if(empty($data['id'])) return [false, '请选择盘点单!'];
-        $url = config("asset.pdDetail");
-
-        $url .= $data['id'];
-        list($status,$result) = $this->get_helper($url,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        return [true, $result];
-    }
-
-    public function pdUpdate($data,$param){
-        if(! isset($data['tourism_inventory_a'])) return [false, '盘点单抬头数据不能为空'];
-        if(! isset($data['tourism_inventory_a']['id'])) return [false, '盘点单抬头数据ID不能为空'];
-        if(! isset($data['tourism_inventory_dtl_b'])) return [false, '盘点单明细数据不能为空'];
-
-        $url = config("asset.updatePd");
-
-        $post = [
-            'tourism_inventory_a' => $data['tourism_inventory_a'],
-            'tourism_inventory_dtl_b' => $data['tourism_inventory_dtl_b'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function createFixedBorrow($data,$param){
-        if(empty($data['id'])) return [false, 'ID不能为空'];
-        if(empty($data['ssbm']) || empty($data['ssbm_show'])) return [false, '部门不能为空'];
-        if(empty($data['ssfb']) || empty($data['ssfb_show'])) return [false, '分部不能为空'];
-        if(empty($data['borrow_days'])) return [false, '租借天数不能为空'];
-//        if(empty($data['borrow_start_date']) || empty($data['borrow_start_date_lt'])) return [false, '借用开始不能为空'];
-//        if(empty($data['borrow_end_date']) || empty($data['borrow_end_date_lt'])) return [false, '借用结束不能为空'];
-        list($borrow_start_date_lt,$borrow_start_date) = $this->getE8AndUTC();
-        $borrow_end_date = date("Y-m-d H:i:s", strtotime("+{$data['borrow_days']} days", strtotime($borrow_start_date)));
-        list($borrow_end_date_lt,$borrow_end_date) = $this->getE8AndUTC($borrow_end_date);
-        if(empty($data['borrow_person']) || empty($data['borrow_person_show'])) return [false, '借用人不能为空'];
-
-        $url = config("asset.create_fixed_borrow");
-
-        $post = [
-            'id' => $data['id'],
-            'ssbm' => $data['ssbm'],
-            'ssbm_show' => $data['ssbm_show'],
-            'ssfb' => $data['ssfb'],
-            'ssfb_show' => $data['ssfb_show'],
-            'borrow_start_date' => $borrow_start_date,
-            'borrow_start_date_lt' => $borrow_start_date_lt,
-            'borrow_end_date' => $borrow_end_date,
-            'borrow_end_date_lt' => $borrow_end_date_lt,
-            'borrow_person' => $data['borrow_person'],
-            'borrow_person_show' => $data['borrow_person_show'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function baseFixedQuery($data,$param){
-        $url = config("asset.base_fixed_query");
-
-        if(! empty($data['id'])) {
-            $post['rules'] = [
-                [
-                    'field' => 'id',
-                    'option' => 'IN',
-                    'values' => $data['id']
-                ],
-            ];
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function createFixedReturn($data,$param){
-        if(empty($data['id'])) return [false, 'ID不能为空'];
-        if(empty($data['ssbm']) || empty($data['ssbm_show'])) return [false, '部门不能为空'];
-        if(empty($data['ssfb']) || empty($data['ssfb_show'])) return [false, '分部不能为空'];
-        list($return_date_lt,$return_date) = $this->getE8AndUTC();
-//        if(empty($data['return_date']) || empty($data['return_date_lt'])) return [false, '归还开始不能为空'];
-        if(empty($data['return_person']) || empty($data['return_person_show'])) return [false, '归还人不能为空'];
-
-        $url = config("asset.create_fixed_return");
-        $post = [
-            'id' => $data['id'],
-            'ssbm' => $data['ssbm'],
-            'ssbm_show' => $data['ssbm_show'],
-            'ssfb' => $data['ssfb'],
-            'ssfb_show' => $data['ssfb_show'],
-            'return_date' => $return_date,
-            'return_date_lt' => $return_date_lt,
-            'return_person' => $data['return_person'],
-            'return_person_show' => $data['return_person_show'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function manList($data,$param){
-        $url = config("asset.manList");
-
-        $size = $data['size'] ?? 10;
-        $number = ($data['number'] ?? 1) - 1;
-
-        $url .= '&page=' . $number . '&size=' . $size;
-        if(! empty($data['title'])) $url .= '&propertyNames=name&propertyValues=' . urlencode($data['title']);
-        list($status,$result) = $this->get_helper($url,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        return [true, $result];
-    }
-
-    public function bmList($data,$param){
-        $url = config("asset.bmList");
-        $size = $data['size'] ?? 10;
-        $number = ($data['number'] ?? 1) - 1;
-        $url .= 'page=' . $number . '&size=' . $size;
-        if(! empty($data['title'])) $url .= '&propertyNames=name&propertyValues=' . urlencode($data['title']);
-
-        list($status,$result) = $this->get_helper($url,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        return [true, $result];
-    }
-
-    public function fbList($data,$param){
-        $url = config("asset.fbList");
-
-        if(! empty($data['id']) || ! empty($data['title'])) {
-            $rules = [];
-            if(! empty($data['id'])) {
-                $rules[] = [
-                    'field' => 'id',
-                    'option' => 'IN',
-                    'values' => $data['id']
-                ];
-            }
-            if(! empty($data['title'])) {
-                $rules[] = [
-                    'field' => 'name',
-                    'option' => 'LIKE_ANYWHERE',
-                    'values' => [$data['title']]
-                ];
-            }
-            $post['rules'] = $rules;
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function tourismBaseFixedBorrowList($data,$param){
-        $url = config("asset.tourism_base_fixed_borrow_list");
-
-        if(! empty($data['id']) || ! empty($data['status'])) {
-            $rules = [];
-            if(! empty($data['id'])) {
-                $rules[] = [
-                    'field' => 'base_fixed_id',
-                    'option' => 'IN',
-                    'values' => $data['id']
-                ];
-            }
-            if(! empty($data['status'])) {
-                $rules[] = [
-                    'field' => 'status',
-                    'option' => 'IN',
-                    'values' => [$data['status']]
-                ];
-            }
-            $post['rules'] = $rules;
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function getE8AndUTC($dateTimeString = ""){
-        $eastEightTimeZone = new \DateTimeZone('Asia/Shanghai'); // 东八区时区
-        $utcTimeZone = new \DateTimeZone('UTC'); // UTC时区
-
-        // 假设的东八区时间,没有毫秒部分
-        if(! $dateTimeString) $dateTimeString = date("Y-m-d H:i:s");
-        $milliseconds = '000'; // 假设的毫秒值
-
-        // 创建DateTime对象并设置时区为东八区
-        $dateTime = new \DateTime($dateTimeString, $eastEightTimeZone);
-
-        // 将DateTime对象转换为UTC时区
-        $dateTime->setTimezone($utcTimeZone);
-
-        // 格式化DateTime对象为ISO 8601格式,并添加毫秒部分
-        $formattedDate = $dateTime->format('Y-m-d\TH:i:s') . '.' . str_pad($milliseconds, 3, '0', STR_PAD_LEFT) . 'Z';
-
-        return [$dateTimeString,$formattedDate];
-    }
-
-    public function post_helper($url, $data, $header = [], $timeout = 20){
-        Log::channel('apiLog')->info('资产盘点POST', ["api" => $url , "param" => $data ,"header" => $header]);
-
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_ENCODING, '');
-        curl_setopt($ch, CURLOPT_POST, 1);
-        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
-
-        if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-
-            Log::channel('apiLog')->info('资产盘点POST结果', ["message" => $message]);
-            return [false, $message];
-        }
-        curl_close($ch);
-
-        $return = json_decode($r, true);
-        Log::channel('apiLog')->info('资产盘点POST结果', ["message" => $return]);
-
-        if(! empty($return['message']) && $return['message'] == 'error.unAuthorized') return [0, '登录凭证已失效或者不正确'];
-
-        return [true, $return];
-    }
-
-    public function get_helper($url,$header=[],$timeout = 20){
-        Log::channel('apiLog')->info('资产盘点GET', ["api" => $url ,"header" => $header]);
-        $ch = curl_init();
-        curl_setopt_array($ch, array(
-            CURLOPT_URL => $url,
-            CURLOPT_RETURNTRANSFER => true,
-            CURLOPT_ENCODING => '',
-            CURLOPT_MAXREDIRS => 10,
-            CURLOPT_TIMEOUT => $timeout,
-            CURLOPT_FOLLOWLOCATION => true,
-            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-            CURLOPT_CUSTOMREQUEST => 'GET',
-            CURLOPT_SSL_VERIFYPEER => false,
-            CURLOPT_HTTPHEADER => $header,
-        ));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-            Log::channel('apiLog')->info('资产盘点GET', ["message" => $message]);
-            return [false, $message];
-        }
-
-        curl_close($ch);
-
-        $return = json_decode($r, true);
-        Log::channel('apiLog')->info('资产盘点GET', ["message" => $return]);
-
-        if(! empty($return['message']) && $return['message'] == 'error.unAuthorized') return [0, '登录凭证已失效或者不正常'];
-
-        return [true, $return];
-    }
-}

+ 0 - 153
app/Service/ClearDataService.php

@@ -1,153 +0,0 @@
-<?php
-
-namespace App\Service;
-
-use Illuminate\Support\Facades\Log;
-use Illuminate\Support\Facades\Redis;
-
-class ClearDataService extends Service
-{
-    public static function getTokenLf(){
-        $token_key = 'lf_device_token';
-        $token = Redis::get($token_key);
-        if(! $token){
-            $url = config('ip.zslf');
-            $post = array("name" => "LFMY001","password"=>"12345678","rememberMe"=>true);
-            $header = ['Content-Type:application/json'];
-            $curl = curl_init();
-            curl_setopt_array($curl, array(
-                CURLOPT_URL => $url . 'jbl/api/mes/login',
-                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_SSL_VERIFYPEER => false,
-                CURLOPT_POSTFIELDS => json_encode($post),
-                CURLOPT_HTTPHEADER =>  $header,
-            ));
-            $response = curl_exec($curl);
-            if ($response === false) {
-                // 获取错误号
-                $errorNumber = curl_errno($curl);
-                // 获取错误信息
-                $errorMessage = curl_error($curl);
-                $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-                Log::channel('apiLog')->info('lf获取token curl', ["param" => $message]);
-            }
-
-            curl_close($curl);
-            $result = json_decode($response,true);
-            if(empty($result['token'])) {
-                Log::channel('apiLog')->info('lf获取token curl', ["param" => $response]);
-                return [false,''];
-            }else{
-                $token = $result['token'];
-                $expire_time = 1728000; //20天
-                Redis::set($token_key,$token);
-                Redis::expire($token_key, $expire_time);
-                return [true,$token];
-            }
-        }
-
-        return [true,$token];
-    }
-
-    public static function getTokenHc(){
-        $token_key = 'hc_device_token';
-        $token = Redis::get($token_key);
-        if(! $token){
-            $url = config('ip.zslf');
-            $post = array("name" => "hcltdemo","password"=>"12345678","rememberMe"=>true);
-            $header = ['Content-Type:application/json'];
-            $curl = curl_init();
-            curl_setopt_array($curl, array(
-                CURLOPT_URL => $url . 'jbl/api/mes/login',
-                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_SSL_VERIFYPEER => false,
-                CURLOPT_POSTFIELDS => json_encode($post),
-                CURLOPT_HTTPHEADER =>  $header,
-            ));
-            $response = curl_exec($curl);
-            if ($response === false) {
-                // 获取错误号
-                $errorNumber = curl_errno($curl);
-                // 获取错误信息
-                $errorMessage = curl_error($curl);
-                $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-                Log::channel('apiLog')->info('hc获取token curl', ["param" => $message]);
-            }
-
-            curl_close($curl);
-            $result = json_decode($response,true);
-            if(empty($result['token'])) {
-                Log::channel('apiLog')->info('hc获取token', ["param" => $response]);
-                return [false, ''];
-            }else{
-                $token = $result['token'];
-                $expire_time = 1728000; //20天
-                Redis::set($token_key,$token);
-                Redis::expire($token_key, $expire_time);
-                return [true,$token];
-            }
-        }
-
-        return [true,$token];
-    }
-
-    public static function getTokenJLWM(){
-        $token_key = 'jlwm_device_token';
-        $token = Redis::get($token_key);
-        if(! $token){
-            $url = config('ip.zslf');
-            $post = array("name" => "jlwmdemo","password"=>"12345678","rememberMe"=>true);
-            $header = ['Content-Type:application/json'];
-            $curl = curl_init();
-            curl_setopt_array($curl, array(
-                CURLOPT_URL => $url . 'jbl/api/mes/login',
-                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_SSL_VERIFYPEER => false,
-                CURLOPT_POSTFIELDS => json_encode($post),
-                CURLOPT_HTTPHEADER =>  $header,
-            ));
-            $response = curl_exec($curl);
-            if ($response === false) {
-                // 获取错误号
-                $errorNumber = curl_errno($curl);
-                // 获取错误信息
-                $errorMessage = curl_error($curl);
-                $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-                Log::channel('apiLog')->info('jlwm获取token curl', ["param" => $message]);
-            }
-
-            curl_close($curl);
-            $result = json_decode($response,true);
-            if(empty($result['token'])) {
-                Log::channel('apiLog')->info('jlwm获取token', ["param" => $response]);
-                return [false, ''];
-            }else{
-                $token = $result['token'];
-                $expire_time = 1728000; //20天
-                Redis::set($token_key,$token);
-                Redis::expire($token_key, $expire_time);
-                return [true,$token];
-            }
-        }
-
-        return [true,$token];
-    }
-}

+ 0 - 413
app/Service/ImportService.php

@@ -1,413 +0,0 @@
-<?php
-
-namespace App\Service;
-
-use App\Exports\TableHeadExport;
-use App\Import\Import;
-use App\Import\ImportAll;
-use App\Model\BasicType;
-use App\Model\Customer;
-use App\Model\CustomerInfo;
-use App\Model\Depart;
-use App\Model\Employee;
-use App\Model\Product;
-use App\Model\ProductCategory;
-use App\Model\ProductPriceDetail;
-use App\Model\SalesOrder;
-use App\Model\SalesOrderInfo;
-use App\Model\SalesOrderProductInfo;
-use Illuminate\Support\Facades\DB;
-use Illuminate\Support\Facades\Log;
-use Illuminate\Support\Facades\Storage;
-use Maatwebsite\Excel\Facades\Excel;
-use PhpOffice\PhpSpreadsheet\IOFactory;
-use PhpOffice\PhpSpreadsheet\Shared\Date;
-
-class ImportService extends Service
-{
-    const tmp_dir = 'upload_occ';
-
-    const string = '/api/getFile/';
-
-    const file_one = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
-    const file_two = 'application/zip';
-    const file_three = 'application/octet-stream';
-    const file_array = [
-        self::file_one,
-        self::file_two,
-        self::file_three,
-    ];
-
-    //文件类型
-    const FILE_TYPE = [
-        'txt',
-        'jpg',
-        'png',
-        'gif',
-        'jpeg',
-        'zip',
-        'rar',
-        'xlsx',
-        'xls'
-    ];
-
-    //导入入口
-    public function import($data){
-//        //不超时
-//        ini_set('max_execution_time', 0);
-//        //内存设置
-//        ini_set('memory_limit', -1);
-//        $reader = IOFactory::createReader('Xlsx');
-//        $reader->setReadDataOnly(true); // 只读取有数据的单元格
-//        $spreadsheet = $reader->load($data['file']);
-//        dd($spreadsheet);
-//        // 创建一个Reader对象
-//        $reader = IOFactory::createReader('Xlsx'); // 根据你的文件格式选择合适的reader
-//
-//// 加载Excel文件
-//        $spreadsheet = $reader->load($data['file']);
-//
-//// 获取第一个工作表
-//        $worksheet = $spreadsheet->getActiveSheet();
-//
-//// 获取总行数
-//        $totalRows = $worksheet->getHighestRow();dd($totalRows);
-        if(empty($data['file'])) return [false,'导入文件不能为空'];
-
-        try {
-           $this->uploadFile($data['file']);
-        }catch (\Throwable $exception) {
-            return [false, $exception->getMessage() . ' (Code: ' . $exception->getCode() . ', Line: ' . $exception->getLine() . ')'];
-        }
-
-        return [true, ''];
-    }
-
-    public function uploadFile($file){
-        if(empty($file)) return [false, '请上传文件'];
-        // 获取文件相关信息
-        $ext = $file->getClientOriginalExtension();     // 扩展名
-        $realPath = $file->getRealPath();   //临时文件的绝对路径
-
-        $ext = strtolower($ext);
-        if (! in_array($ext, self::FILE_TYPE)){
-            $str = '文件格式为:';
-            foreach (self::FILE_TYPE as $value){
-                $str.= $value . ' ' ;
-            }
-            return [false, $str];
-        }
-
-        $date = date("Y-m-d");
-        //文件名
-        $file_name = date("Ymd").time().rand(1000,9999);
-        $filename =  $file_name.'.' . $ext;
-
-        $dir = self::tmp_dir . '/' . $date . '/' . $filename;
-        Storage::disk('public')->put($dir, file_get_contents($realPath));
-
-        return [true, self::string . $filename];
-    }
-
-    public function getFileData($data){
-        if(empty($data['url'])) return [false, '文件路径不能为空'];
-
-        try {
-            // 发送 HTTP 请求获取文件内容
-            $response = file_get_contents($data['url']);
-        } catch (\Throwable $exception) {
-            if (str_contains($exception->getMessage(), 'failed to open stream')) return [false, "URL链接已失效"];
-            return [false, $exception->getMessage()];
-        }
-        if ($response === false) return [false, '文件获取失败'];
-
-        // 创建一个临时文件资源
-        $tempFile = tempnam(sys_get_temp_dir(), 'download_');
-        file_put_contents($tempFile, $response);
-
-        // 判断文件类型
-        $fileInfo = finfo_open(FILEINFO_MIME_TYPE);
-        $mimeType = finfo_file($fileInfo, $tempFile);
-        finfo_close($fileInfo);
-        if(! in_array($mimeType, self::file_array)) return [false, '文件类型目前暂时支持zip|xlsx'];
-
-        // 根据文件类型处理
-        if ($mimeType === self::file_one) {
-            // 处理单个XLSX文件
-            list($status,$result) = $this->processXlsxFile($tempFile);
-            if (! $status) return [false, $result];
-
-            return [true, ['content' => [$result], 'type' => 'xlsx']];
-        } elseif ($mimeType === self::file_two) {
-            // 创建 ZipArchive 对象
-            $zip = new \ZipArchive();
-            if ($zip->open($tempFile) !== true) {
-                // 删除临时文件
-                unlink($tempFile);
-                return [false, '无法打开ZIP文件'];
-            }
-
-            // 初始化一个数组来存储所有XLSX文件的数据
-            $allFilesData = [];
-
-            // 遍历ZIP文件中的每一个文件
-            for ($i = 0; $i < $zip->numFiles; $i++) {
-                $filename = $zip->getNameIndex($i);
-
-                if (pathinfo($filename, PATHINFO_EXTENSION) === 'xlsx') {// 检查是否为XLSX文件
-                    // 提取文件到临时位置
-//                    $tempXlsxFile = tempnam(sys_get_temp_dir(), 'xlsx_');
-
-                    $tempDir = sys_get_temp_dir() . '/extracted_' . uniqid();
-                    mkdir($tempDir, 0777, true);
-
-                    // 提取文件到临时位置
-                    if ($zip->extractTo($tempDir, [$filename]) === false) {
-                        $this->deleteDirectory($tempDir);
-//                        Log::channel('apiLog')->info('断点1', ["message" => $filename]);
-                        continue; // 跳过提取失败的文件
-                    }
-
-                    // 递归查找提取的XLSX文件
-                    $extractedFile = $this->findXlsxFile($tempDir, basename($filename));
-
-                    // 获取提取出的文件的实际路径
-//                    $extractedFile = sys_get_temp_dir() . '/' . basename($filename);
-
-                    // 检查临时文件是否存在
-                    if (! file_exists($extractedFile)){
-                        $this->deleteDirectory($tempDir);
-//                        Log::channel('apiLog')->info('断点2', ["message" => $extractedFile]);
-                        continue;
-                    }
-
-                    // 重命名提取出的文件为临时文件
-                    $tempXlsxFile = tempnam(sys_get_temp_dir(), 'xlsx_');
-                    if (! rename($extractedFile, $tempXlsxFile)) {
-                        $this->deleteDirectory($tempDir);
-//                        Log::channel('apiLog')->info('断点5', ["message" => "重命名文件失败: " . $extractedFile]);
-                        continue;
-                    }
-
-//                    // 重命名提取出的文件为临时文件
-//                    if (! rename($extractedFile, $tempXlsxFile)) {
-//                        Log::channel('apiLog')->info('断点3', ["message" => $tempXlsxFile]);
-//                        continue;
-//                    }
-
-                    list($status,$xlsxData) = $this->processXlsxFile($tempXlsxFile);
-                    if (! $status) {
-                        $this->deleteDirectory($tempDir);
-                        return [false, $xlsxData];
-                    }
-
-                    // 将当前XLSX文件的数据添加到所有文件的数据数组中
-                    $xlsxData['filename'] = $filename;
-                    $allFilesData[] = $xlsxData;
-
-                    $this->deleteDirectory($tempDir);
-                }
-            }
-
-            // 关闭 ZIP 文件
-            $zip->close();
-
-            // 删除临时 ZIP 文件
-            unlink($tempFile);
-
-            return [true, ["content" => $allFilesData, 'type' => 'zip']];
-        } elseif ($mimeType === self::file_three){
-            // 处理单个XLSX文件
-            list($status,$result) = $this->processXlsxFile($tempFile);
-            if (! $status) return [false, $result];
-
-            return [true, ['content' => [$result], 'type' => 'xlsx']];
-        }else {
-            // 删除临时文件
-            unlink($tempFile);
-            return [false, '不支持的文件类型'];
-        }
-    }
-
-    // 递归删除目录及其所有内容
-    function deleteDirectory($dir) {
-        if (! is_dir($dir)) {
-            return;
-        }
-
-        $files = array_diff(scandir($dir), array('.', '..'));
-        foreach ($files as $file) {
-            $path = $dir . DIRECTORY_SEPARATOR . $file;
-            if (is_dir($path)) {
-                $this->deleteDirectory($path);
-            } else {
-                unlink($path);
-            }
-        }
-        rmdir($dir);
-    }
-
-    // 递归查找XLSX文件
-    function findXlsxFile($dir, $filename) {
-        $iterator = new \RecursiveDirectoryIterator($dir);
-        $files = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);
-
-        foreach ($files as $file) {
-            if ($file->isFile() && $file->getFilename() === $filename) {
-                return $file->getPathname();
-            }
-        }
-
-        return null;
-    }
-
-    // 定义一个函数来处理XLSX文件
-    function processXlsxFile($filename) {
-        try {
-            if (is_file($filename)) {
-                chmod($filename, 0777);
-            }
-
-            // 使用 PhpSpreadsheet 读取文件
-            $reader = IOFactory::createReader('Xlsx');
-            $spreadsheet = $reader->load($filename);
-
-            // 初始化一个数组来存储所有工作表的数据
-            $allSheetData = [];
-
-            // 遍历所有工作表
-            foreach ($spreadsheet->getWorksheetIterator() as $worksheet) {
-                $sheetData = [];
-                foreach ($worksheet->getRowIterator() as $row) {
-                    $cellIterator = $row->getCellIterator();
-                    $cellIterator->setIterateOnlyExistingCells(false); // 循环所有单元格,即使它未设置
-                    $rowData = [];
-
-                    foreach ($cellIterator as $cell) {
-                        // 判断单元格是否为日期
-                        if (Date::isDateTime($cell)) {
-                            // 将日期转换为 Y-m-d 格式
-                            $formattedDate = Date::excelToDateTimeObject($cell->getValue())->format('Y-m-d');
-                            $rowData[] = $formattedDate;
-                        } else {
-                            // 获取单元格的格式化值
-                            $rowData[] = trim($cell->getFormattedValue());
-                        }
-
-//                        $cellData = $cell->getFormattedValue();
-//                        if(! empty($cellData)) $cellData = $this->convertToYMD($cellData);
-//                        $rowData[] = $cellData;
-                    }
-
-                    // 判断该行是否是“全空行”:所有单元格都为空字符串或 null
-                    if (! empty(array_filter($rowData, function($v) { return $v !== '' && $v !== null; }))) {
-                        $sheetData[] = $rowData; // 不是空行才添加进去
-                    }
-//                    $sheetData[] = $rowData;
-                }
-
-                // 将当前工作表的数据添加到总数据数组中
-                $allSheetData[$worksheet->getTitle()] = $sheetData;
-            }
-            // 删除临时文件
-            unlink($filename);
-
-            return [true, $allSheetData];
-
-        } catch (\Throwable $e) {
-            // 删除临时文件
-            unlink($filename);
-            return [false, "处理文件 {$filename} 时发生错误: " . $e->getMessage()];
-        }
-    }
-
-    public function convertToYMD($date)
-    {
-        // 定义一些常见的日期格式
-        $formats = [
-            'Y-m-d', // 2023-10-17
-            'Y/m/d', // 2023/10/17
-            'd-m-Y', // 17-10-2023
-            'd/m/Y', // 17/10/2023
-            'm-d-Y', // 10-17-2023
-            'm/d/Y', // 10/17/2023
-//            'Ymd',   // 20231017
-//            'dmy',   // 17102023
-//            'dmY',   // 17102023
-//            'dMY',   // 17102023
-//            'Ymd',   // 20231017
-//            'Ydm',   // 20231017
-//            'YDM',   // 20231017
-//            'YDm',   // 20231017
-        ];
-
-        // 尝试使用每个格式解析日期
-        foreach ($formats as $format) {
-            $dateTime = \DateTime::createFromFormat($format, $date);
-            if ($dateTime && $dateTime->format($format) === $date) {
-                // 成功解析日期,返回转换后的 Y-m-d 格式
-                return $dateTime->format('Y-m-d');
-            }
-        }
-
-        // 如果所有格式都未能解析日期,则返回原字符串
-        return $date;
-    }
-
-    public function getFileData1($data){
-        if(empty($data['url'])) return [false, '文件路径不能为空'];
-
-        try{
-            // 发送 HTTP 请求获取文件内容
-            $response = file_get_contents($data['url']);
-        }catch (\Throwable $exception){
-            return [false, $exception->getMessage()];
-        }
-        if ($response === false) return [false, '文件获取失败'];
-
-        // 创建一个临时文件资源
-        $tempFile = tempnam(sys_get_temp_dir(), 'xlsx_');
-        file_put_contents($tempFile, $response);
-
-        // 使用 phpspreadsheet 读取文件
-        try {
-            // 创建一个 Xlsx 读取器
-            $reader = IOFactory::createReader('Xlsx');
-
-            // 加载临时文件
-            $spreadsheet = $reader->load($tempFile);
-
-            // 初始化一个数组来存储所有工作表的数据
-            $allSheetData = [];
-
-            // 遍历所有工作表
-            foreach ($spreadsheet->getWorksheetIterator() as $worksheet) {
-                $sheetData = [];
-                foreach ($worksheet->getRowIterator() as $row) {
-                    $cellIterator = $row->getCellIterator();
-                    $cellIterator->setIterateOnlyExistingCells(false); // Loop all cells, even if it is not set
-                    $rowData = [];
-
-                    foreach ($cellIterator as $cell) {
-                        $rowData[] = $cell->getValue();
-                    }
-
-                    $sheetData[] = $rowData;
-                }
-
-                // 将当前工作表的数据添加到总数据数组中
-                $allSheetData[$worksheet->getTitle()] = $sheetData;
-            }
-
-            // 删除临时文件
-            unlink($tempFile);
-        } catch (\Exception $e) {
-            // 删除临时文件
-            unlink($tempFile);
-            return [false, $e->getMessage()];
-        }
-
-        return [true , $allSheetData];
-    }
-}
-

+ 0 - 1458
app/Service/JRFIDServerService.php

@@ -1,1458 +0,0 @@
-<?php
-
-namespace App\Service;
-
-
-use Illuminate\Support\Facades\Log;
-
-class JRFIDServerService extends Service
-{
-    public function loginRule($data){
-        if(empty($data['name'])) return [false, '请输入账号!'];
-        if(empty($data['password'])) return [false, '请输入密码!'];
-
-        list($status, $msg) = $this->getToken($data);
-        if(! $status) return [false, $msg];
-
-        return [true, ['data' => $msg]];
-    }
-
-    public function getToken($data){
-        $account = $data['name'];
-        $password = $data['password'];
-
-        $url = config("j_rfid.login");
-        $post = [
-            "name" => $account,
-            "password" => $password,
-            "rememberMe" => true
-        ];
-        $header = ['Content-Type:application/json'];
-        list($status, $result) = $this->post_helper($url,$post, $header);
-        if(! $status) return [$status, $result];
-
-        //登录失败
-        if(! empty($result['errorMessage'])) return [false, $result['errorMessage']];
-
-        return [true, $result];
-    }
-
-    public function getSite($data){
-        $url = config("j_rfid.site");
-        list($status,$result) = $this->get_helper($url);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['errorMessage'])) return [false, $result['errorMessage']];
-
-        return [true, $result];
-    }
-
-    public function getSite2($data,$param){
-        $url = config("j_rfid.site2");
-
-        $header = ["Authorization: {$param['token']}"];
-        list($status,$result) = $this->get_helper($url,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['errorMessage'])) return [false, $result['errorMessage']];
-
-        return [true, $result];
-    }
-
-    public function getFlowByProduce($data,$param){
-        if(empty($data['produce_no'])) return [false, '订单号不能为空'];
-        if(empty($data['site'])) return [false, '站点不能为空'];
-
-        $url = config("j_rfid.get_flow_by_produce");
-        $post = [
-            'produce_no' => $data['produce_no'],
-            'site' => $data['site'],
-        ];
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        return [true, $result['data']];
-    }
-
-    public function getProduceByContract($data,$param){
-        if(empty($data['contract_no'])) return [false, '合同不能为空'];
-        if(empty($data['site'])) return [false, '站点不能为空'];
-
-        $url = config("j_rfid.get_produce_by_contract");
-        $post = [
-            'contract_no' => $data['contract_no'],
-            'site' => $data['site'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        return [true, $result['data']];
-    }
-
-    public function getPrintData($data){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, '打印数据类型不能为空'];
-
-        $size = $data['size'] ?? 9;
-        $number = $data['number'] ?? 1;
-
-        $rsaService = new RsaEncryptionService();
-        $dataToEncrypt = [
-            'id' => $data['id'],
-            'type' => $data['type'],
-            'size' => $size,
-            'number' => $number,
-        ];
-        $this->recKSort($dataToEncrypt);
-
-        //加密
-        $encryptedData = $rsaService->encrypt2($dataToEncrypt);
-//
-//        $return2 = $rsaService->decrypt2($return);
-//dd($return,$return2);
-//        $aa = $rsaService->aesDecrypt($aes);
-//        dd($aes,$aa);
-//
-//        list($status, $encryptedData) = $rsaService->encrypt($dataToEncrypt);
-//        if(! $status) return [false, $encryptedData];
-
-        $url = config("j_rfid.get_print_data");
-
-        Log::channel('apiLog')->info('工装云POST:源数据', ["api" => $url , "param" => $dataToEncrypt]);
-
-        $post = [
-            'body' => $encryptedData,
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,['Content-Type:application/json']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['furn_pro_flow_dt_a'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function getPrintData2($data){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, '打印数据类型不能为空'];
-
-        $size = $data['size'] ?? 9;
-        $number = $data['number'] ?? 1;
-
-        $rsaService = new RsaEncryptionService();
-        $dataToEncrypt = [
-            'id' => $data['id'],
-            'type' => $data['type'],
-            'size' => $size,
-            'number' => $number,
-        ];
-        $this->recKSort($dataToEncrypt);
-
-        //加密
-        $encryptedData = $rsaService->encrypt2($dataToEncrypt);
-
-        $url = config("j_rfid.get_sep_order_dt_data");
-
-        Log::channel('apiLog')->info('工装云POST:源数据', ["api" => $url , "param" => $dataToEncrypt]);
-
-        $post = [
-            'body' => $encryptedData,
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,['Content-Type:application/json']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['furn_sep_order_dt_prod'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    // 关联数组排序,递归
-    public function recKSort(&$arr)
-    {
-        $kstring = true;
-        foreach ($arr as $k => &$v) {
-            if (!is_string($k)) {
-                $kstring = false;
-            }
-            if (is_array($v)) {
-                $this->recKSort($v);
-            }
-        }
-        if ($kstring) {
-            ksort($arr);
-        }
-    }
-
-    public function getTeam($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.get_team");
-        $post['rules'] = [
-            [
-                'field' => 'site',
-                'option' => 'LIKE_ANYWHERE',
-                'values' => [$data['site']]
-            ],
-            [
-                'field' => 'is_used',
-                'option' => 'IN',
-                'values' => ['1']
-            ]
-        ];
-        if(isset($data['department_code'])) {
-            $post['rules'] = array_merge($post['rules'], [[
-                'field' => 'department_code',
-                'option' => 'IN',
-                'values' => [$data['department_code']]
-            ]]);
-        }
-
-        $post['size'] = $data['size'] ?? 6;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function getDepart($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.get_depart");
-        $post['rules'] = [
-            [
-                'field' => 'is_used',
-                'option' => 'IN',
-                'values' => ['1']
-            ]
-        ];
-        $post['size'] = $data['size'] ?? 6;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function getProcedureClass($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.get_procedure_class");
-        $post['rules'] = [
-            [
-                'field' => 'is_used',
-                'option' => 'IN',
-                'values' => ['1']
-            ]
-        ];
-        $post['size'] = $data['size'] ?? 6;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function furnProduceScheduleList($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.furn_produce_schedule_list");
-
-        $sorts = [];
-        if(empty($data['sorts'])) {
-            //默认
-            $sorts = [
-                [
-                    "property" => "exe_produce_order_a.order_date",
-                    "direction" => "DESC",
-                    "sortOrderNumber" => 2
-                ]
-            ];
-        }
-
-        $post = [
-            "direction" => $data['direction'] ?? "DESC", //排序
-            "property" =>  $data['direction'] ?? "id", // 排序
-            "sorts" => $sorts
-        ];
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-        $post['rules'] = $data['rules'] ?? [];
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function completionOrders($data,$param){
-        if(empty($data['screenDataList'])) return [false, '完工数据不能为空'];
-        if(empty($data['site'])) return [false, '站点信息不能为空'];
-
-        list($date,$utc_date) = $this->getE8AndUTC();
-        foreach ($data['screenDataList'] as $key => $value){
-            if(empty($value['id']) || ! isset($value['type'])) return [false, '完工数据不能为空'];
-            $data['screenDataList'][$key]['completed_teams_group'] = $data['completed_teams_group'] ?? "";
-            $data['screenDataList'][$key]['completed_teams_group_show'] = $data['completed_teams_group_show'] ?? "";
-            $data['screenDataList'][$key]['completed_date'] = $utc_date;
-            $data['screenDataList'][$key]['completed_date_lt'] = $date;
-            $data['screenDataList'][$key]['procedure_code'] = $data['procedure_code'] ?? [];
-            $data['screenDataList'][$key]['site'] = $data['site'] ?? "";
-            $data['screenDataList'][$key]['data_type'] = "manual";
-            $data['screenDataList'][$key]['data_type_show'] = "手工新建";
-        }
-
-        $url = config("j_rfid.completion_orders");
-        $post = [
-            'screenDataList' => $data['screenDataList'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post, $param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function scanScreenCompleted($data,$param){
-        if(empty($data['screenDataList'])) return [false, '完工数据不能为空'];
-        if(empty($data['site'])) return [false, '站点信息不能为空'];
-
-        list($date,$utc_date) = $this->getE8AndUTC();
-        foreach ($data['screenDataList'] as $key => $value){
-            if(empty($value['id']) || ! isset($value['type'])) return [false, '完工数据不能为空'];
-            $data['screenDataList'][$key]['completed_teams_group'] = $data['completed_teams_group'] ?? "";
-            $data['screenDataList'][$key]['completed_teams_group_show'] = $data['completed_teams_group_show'] ?? "";
-            $data['screenDataList'][$key]['completed_date'] = $utc_date;
-            $data['screenDataList'][$key]['completed_date_lt'] = $date;
-            $data['screenDataList'][$key]['data_type'] = "manual";
-            $data['screenDataList'][$key]['data_type_show'] = "手工新建";
-            $data['screenDataList'][$key]['site'] = $data['site'] ?? "";
-        }
-
-        $url = config("j_rfid.scanScreenCompleted");
-        $post = [
-            'screenDataList' => $data['screenDataList'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post, $param['header'], 300);
-        if(! $status) return [$status, $result];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function qualityOrders($data,$param){
-        if(empty($data['screenDataList'])) return [false, '质检数据不能为空'];
-        if(empty($data['site'])) return [false, '站点信息不能为空'];
-
-        list($date,$utc_date) = $this->getE8AndUTC();
-        foreach ($data['screenDataList'] as $key => $value){
-            if(empty($value['id']) || ! isset($value['type'])) return [false, '质检数据不能为空'];
-            $data['screenDataList'][$key]['qualified_teams_group'] = $data['qualified_teams_group'] ?? "";
-            $data['screenDataList'][$key]['qualified_teams_group_show'] = $data['qualified_teams_group_show'] ?? "";
-            $data['screenDataList'][$key]['qualified_date'] = $utc_date;
-            $data['screenDataList'][$key]['qualified_date_lt'] = $date;
-            $data['screenDataList'][$key]['procedure_code'] = $data['procedure_code'] ?? [];
-            $data['screenDataList'][$key]['site'] = $data['site'] ?? "";
-        }
-
-        $url = config("j_rfid.quality_orders");
-        $post = [
-            'screenDataList' => $data['screenDataList'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post, $param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function screenPrint($data){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-
-        $rsaService = new RsaEncryptionService();
-        $dataToEncrypt = [
-            'id' => $data['id'],
-            'type' => $data['type']
-        ];
-        $this->recKSort($dataToEncrypt);
-
-        //加密
-        $encryptedData = $rsaService->encrypt2($dataToEncrypt);
-
-//        list($status, $encryptedData) = $rsaService->encrypt($dataToEncrypt);
-//        if(! $status) return [false, $encryptedData];
-
-        $url = config("j_rfid.screen_print");
-
-        Log::channel('apiLog')->info('工装云POST:源数据', ["api" => $url , "param" => $dataToEncrypt]);
-
-        $post = [
-            'body' => $encryptedData,
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,['Content-Type:application/json']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        return [true, ''];
-    }
-
-    public function screenPrintSepData($data){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-
-        $rsaService = new RsaEncryptionService();
-        $dataToEncrypt = [
-            'id' => $data['id'],
-            'type' => $data['type']
-        ];
-        $this->recKSort($dataToEncrypt);
-
-        //加密
-        $encryptedData = $rsaService->encrypt2($dataToEncrypt);
-
-        $url = config("j_rfid.screen_print_sep_data");
-
-        Log::channel('apiLog')->info('工装云POST:源数据', ["api" => $url , "param" => $dataToEncrypt]);
-
-        $post = [
-            'body' => $encryptedData,
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,['Content-Type:application/json']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        return [true, ''];
-    }
-
-    public function getE8AndUTC(){
-        $eastEightTimeZone = new \DateTimeZone('Asia/Shanghai'); // 东八区时区
-        $utcTimeZone = new \DateTimeZone('UTC'); // UTC时区
-
-        // 假设的东八区时间,没有毫秒部分
-        $dateTimeString = date("Y-m-d H:i:s");
-        $milliseconds = '000'; // 假设的毫秒值
-
-        // 创建DateTime对象并设置时区为东八区
-        $dateTime = new \DateTime($dateTimeString, $eastEightTimeZone);
-
-        // 将DateTime对象转换为UTC时区
-        $dateTime->setTimezone($utcTimeZone);
-
-        // 格式化DateTime对象为ISO 8601格式,并添加毫秒部分
-        $formattedDate = $dateTime->format('Y-m-d\TH:i:s') . '.' . str_pad($milliseconds, 3, '0', STR_PAD_LEFT) . 'Z';
-
-        return [$dateTimeString,$formattedDate];
-    }
-
-    public function getContractDrawRoom($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-        $post['site'] = $data['site'];
-        $post['type'] = $data['type'];
-
-        $url = config("j_rfid.get_contract_draw_room");
-        if(isset($data['contract_no'])) $post['contract_no'] = $data['contract_no'];
-        if(isset($data['room_no'])) $post['room_no'] = $data['room_no'];
-        if(isset($data['drawing_no'])) $post['drawing_no'] = $data['drawing_no'];
-        if(isset($data['procedure_calss'])) $post['procedure_calss'] = $data['procedure_calss'];
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = $data['number'] ?? 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result['data']];
-    }
-
-    public function screenGetProFlow($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        if(empty($data['contract_no'])) return [false, '合同不能为空'];
-        if(empty($data['drawing_no'])) return [false, '图号不能为空'];
-        if(empty($data['room_no'])) return [false, '房间号不能为空'];
-
-        $url = config("j_rfid.screen_get_pro_flow");
-
-        $post = [
-            'site' => $data['site'],
-            'contract_no' => $data['contract_no'],
-            'drawing_no' => $data['drawing_no'],
-            'room_no' => $data['room_no'],
-        ];
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = $data['number'] ?? 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result['data']];
-    }
-
-    public function getDispatchContractDrawRoom($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-        $post['site'] = $data['site'];
-        $post['type'] = $data['type'];
-
-        $url = config("j_rfid.get_dispatch_contract_draw_room");
-        if(isset($data['contract_no'])) $post['contract_no'] = $data['contract_no'];
-        if(isset($data['room_no'])) $post['room_no'] = $data['room_no'];
-        if(isset($data['drawing_no'])) $post['drawing_no'] = $data['drawing_no'];
-        if(isset($data['procedure_calss'])) $post['procedure_calss'] = $data['procedure_calss'];
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = $data['number'] ?? 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result['data']];
-    }
-
-    public function screenSend($data,$param){
-        if(empty($data['screenDataList'])) return [false, '收发货数据不能为空'];
-        if(empty($data['site']) || empty($data['site_show'])) return [false, '站点信息不能为空'];
-        list($date,$utc_date) = $this->getE8AndUTC();
-        foreach ($data['screenDataList'] as $key => $value){
-            if(empty($value['id']) || ! isset($value['type'])) return [false, '收发货数据不能为空'];
-            $data['screenDataList'][$key]['delivery_teams_group'] = $data['delivery_teams_group'];
-            $data['screenDataList'][$key]['delivery_teams_group_show'] = $data['delivery_teams_group_show'];
-            $data['screenDataList'][$key]['delivery_date'] = $utc_date;
-            $data['screenDataList'][$key]['delivery_date_lt'] = $date;
-            $data['screenDataList'][$key]['site'] = $data['site'];
-            $data['screenDataList'][$key]['site_show'] = $data['site_show'];
-        }
-
-        $url = config("j_rfid.screen_send");
-        $post = [
-            'screenDataList' => $data['screenDataList'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function screenReceipt($data,$param){
-        if(empty($data['screenDataList'])) return [false, '发货数据不能为空'];
-        if(empty($data['site']) || empty($data['site_show'])) return [false, '站点信息不能为空'];
-        list($date,$utc_date) = $this->getE8AndUTC();
-        foreach ($data['screenDataList'] as $key => $value){
-            if(empty($value['id']) || ! isset($value['type'])) return [false, '发货数据不能为空'];
-//            $data['screenDataList'][$key]['delivery_teams_group'] = $data['delivery_teams_group'];
-//            $data['screenDataList'][$key]['delivery_teams_group_show'] = $data['delivery_teams_group_show'];
-            $data['screenDataList'][$key]['receipt_date'] = $utc_date;
-            $data['screenDataList'][$key]['receipt_date_lt'] = $date;
-            $data['screenDataList'][$key]['site'] = $data['site'];
-            $data['screenDataList'][$key]['site_show'] = $data['site_show'];
-        }
-
-        $url = config("j_rfid.screenReceipt");
-        $post = [
-            'screenDataList' => $data['screenDataList'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function screenPackage($data,$param){
-        if(empty($data['screenDataList'])) return [false, '包装数据不能为空'];
-        if(empty($data['site']) || empty($data['site_show'])) return [false, '站点信息不能为空'];
-        list($date,$utc_date) = $this->getE8AndUTC();
-        foreach ($data['screenDataList'] as $key => $value){
-            if(empty($value['id']) || ! isset($value['type'])) return [false, '包装数据不能为空'];
-            $data['screenDataList'][$key]['package_teams_group'] = $data['package_teams_group'];
-            $data['screenDataList'][$key]['package_teams_group_show'] = $data['package_teams_group_show'];
-            $data['screenDataList'][$key]['package_date'] = $utc_date;
-            $data['screenDataList'][$key]['package_date_lt'] = $date;
-            $data['screenDataList'][$key]['site'] = $data['site'];
-            $data['screenDataList'][$key]['site_show'] = $data['site_show'];
-        }
-
-        $url = config("j_rfid.screen_package");
-        $post = [
-            'screenDataList' => $data['screenDataList'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ['box_no' => $result['data'] ?? [], 'package_date' => $date]];
-    }
-
-    public function screenGetPackageData($data,$param){
-        if(empty($data['site'])) return [false, '站点信息不能为空'];
-        if(empty($data['contract_no'])) return [false, '合同不能为空'];
-//        if(empty($data['drawing_no'])) return [false, '图号不能为空'];
-//        if(empty($data['room_no'])) return [false, '房间号不能为空'];
-
-        $size = $data['size'] ?? 10;
-        $number = $data['number'] ?? 1;
-
-        $url = config("j_rfid.screen_get_package_data");
-        $post = [
-            'site' => $data['site'],
-            'contract_no' => $data['contract_no'],
-            'drawing_no' => $data['drawing_no'] ?? "",
-            'room_no' => $data['room_no'] ?? "",
-            'size' => $size,
-            'number' => $number,
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result['data']];
-    }
-
-    public function screenGetProDtData($data,$param){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-//        if(empty($data['contract_no'])) return [false, '合同不能为空'];
-//        if(empty($data['drawing_no'])) return [false, '图号不能为空'];
-
-        $url = config("j_rfid.screenGetProDtData");
-        $post = [
-            'id' => $data['id'],
-            'type' => $data['type'],
-            'contract_no' => $data['contract_no'] ?? null,
-            'drawing_no' => $data['drawing_no'] ?? null,
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['furn_pro_flow_dt_a'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function screenGetPackageAssem($data,$param){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-        if(empty($data['site'])) return [false, '站点不能为空'];
-
-        $url = config("j_rfid.screenGetPackageAssem");
-        $post = [
-            'id' => $data['id'],
-            'type' => $data['type'],
-            'site' => $data['site'],
-            'contract_no' => $data['contract_no'] ?? ""
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['assembly_list'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        foreach ($result['assembly_list'] as $key => $value){
-            foreach ($value['package_assembly_list'] as $kk => $vv){
-                $result['assembly_list'][$key]['package_assembly_list'][$kk]['package_date'] = $this->changeDateToDateMin($vv['package_date']);
-            }
-        }
-
-        return [true, $result['assembly_list']];
-    }
-
-    public function screenGetPackageAssemData($data,$param){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        if(empty($data['contract_no'])) return [false, '合同不能为空'];
-
-        $url = config("j_rfid.screenGetPackageAssemData");
-        $post = [
-            'id' => $data['id'],
-            'type' => $data['type'],
-            'site' => $data['site'],
-            'contract_no' => $data['contract_no'] ?? ""
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['assembly_list'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        foreach ($result['assembly_list'] as $key => $value){
-            foreach ($value['package_assembly_list'] as $kk => $vv){
-                $result['assembly_list'][$key]['package_assembly_list'][$kk]['package_date'] = $this->changeDateToDateMin($vv['package_date']);
-            }
-        }
-
-        return [true, $result['assembly_list']];
-    }
-
-    public function screenGetDispatchDtData($data,$param){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-
-        $url = config("j_rfid.screen_get_dispatch_dt_data");
-        $post = [
-            'id' => $data['id'],
-            'type' => $data['type'],
-            'contract_no' => $data['contract_no'] ?? null,
-            'drawing_no' => $data['drawing_no'] ?? null,
-            'procedure' => $data['procedure'] ?? null,
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['furn_dispatch_product_dt'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function furnSeparateOrderDtAssemList($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        if(empty($data['id'])) return [false, '芯片|组件数据不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.furn_separate_order_dt_assem_list");
-
-        $post['rules'] = [
-            [
-                'field' => 'id',
-                'option' => 'IN',
-                'values' => $data['id']
-            ],
-        ];
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function screenPackageBySepAssem($data,$param){
-        if(empty($data['screenDataList'])) return [false, '包装数据不能为空'];
-        if(empty($data['site']) || empty($data['site_show'])) return [false, '站点信息不能为空'];
-        list($date,$utc_date) = $this->getE8AndUTC();
-        foreach ($data['screenDataList'] as $key => $value){
-            if(empty($value['id']) || ! isset($value['type'])) return [false, '包装数据不能为空'];
-            $data['screenDataList'][$key]['package_teams_group'] = $data['package_teams_group'];
-            $data['screenDataList'][$key]['package_teams_group_show'] = $data['package_teams_group_show'];
-            $data['screenDataList'][$key]['package_date'] = $utc_date;
-            $data['screenDataList'][$key]['package_date_lt'] = $date;
-            $data['screenDataList'][$key]['site'] = $data['site'];
-            $data['screenDataList'][$key]['site_show'] = $data['site_show'];
-        }
-
-        $url = config("j_rfid.screen_package_by_sep_assem");
-        $post = [
-            'screenDataList' => $data['screenDataList'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ['box_no' => $result['data'] ?? [], 'package_date' => $date]];
-    }
-
-    public function sendAndReceiptList($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.sendAndReceiptList");
-
-        if(! empty($data['contract_no']) || ! empty($data['no']) || ! empty($data['drawing_no'])) {
-            $rules = [];
-            if(! empty($data['contract_no'])) {
-                $rules[] = [
-                    'field' => 'contract_no',
-                    'option' => 'IN',
-                    'values' => $data['contract_no']
-                ];
-            }
-            if(! empty($data['no'])) {
-                $rules[] = [
-                    'field' => 'no',
-                    'option' => 'LIKE_ANYWHERE',
-                    'values' => $data['no']
-                ];
-            }
-            if(! empty($data['drawing_no'])) {
-                $rules[] = [
-                    'field' => 'drawing_no',
-                    'option' => 'IN',
-                    'values' => $data['drawing_no']
-                ];
-            }
-            $post['rules'] = $rules;
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function sendOrderDtAssemList($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.sendOrderDtAssemList");
-
-        if(! empty($data['send_id']) || ! empty($data['sep_dt_assem_id']) || ! empty($data['contract_no'])) {
-            $rules = [];
-            if(! empty($data['send_id'])) {
-                $rules[] = [
-                    'field' => 'furn_send_prod_dt.send_id',
-                    'option' => 'IN',
-                    'values' => $data['send_id']
-                ];
-            }
-            if(! empty($data['sep_dt_assem_id'])) {
-                $rules[] = [
-                    'field' => 'sep_dt_assem_id',
-                    'option' => 'IN',
-                    'values' => $data['sep_dt_assem_id']
-                ];
-            }
-            if(! empty($data['contract_no'])) {
-                $rules[] = [
-                    'field' => 'furn_send_prod_dt.contract_no',
-                    'option' => 'NOT_IN',
-                    'values' => $data['contract_no']
-                ];
-            }
-            $post['rules'] = $rules;
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function packageList($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.packageList");
-
-        if(! empty($data['drawing_no']) || ! empty($data['contract_no'])) {
-            $rules = [];
-            if(! empty($data['drawing_no'])) {
-                $rules[] = [
-                    'field' => 'drawing_no',
-                    'option' => 'IN',
-                    'values' => $data['drawing_no']
-                ];
-            }
-            if(! empty($data['contract_no'])) {
-                $rules[] = [
-                    'field' => 'contract_no',
-                    'option' => 'IN',
-                    'values' => $data['contract_no']
-                ];
-            }
-            $post['rules'] = $rules;
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function screenAutoCreateDispatch($data,$param){
-        if(empty($data['type'])) return [false, '类型不能为空'];
-        if(empty($data['id'])) return [false, 'ID不能为空'];
-        if(empty($data['contract_no'])) return [false, '合同号不能为空'];
-        if(empty($data['drawing_no'])) return [false, '图号不能为空'];
-        if(empty($data['procedure'])) return [false, '工序不能为空'];
-        foreach ($data['procedure'] as $value){
-            if(empty($value)) return [false, '工序不能为空'];
-        }
-
-        $post = [
-            'type' => $data['type'],
-            'id' => $data['id'],
-            'contract_no' => $data['contract_no'],
-            'drawing_no' => $data['drawing_no'],
-            'procedure' => $data['procedure'],
-        ];
-        $url = config("j_rfid.screenAutoCreateDispatch");
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, ''];
-    }
-
-    public function screenGetSepData($data,$param){
-        if(empty($data['id'])) return [false, '数据ID不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-
-        $url = config("j_rfid.screenGetSepData");
-        $post = [
-            'id' => $data['id'],
-            'type' => $data['type'],
-        ];
-
-        list($status,$result) = $this->post_helper($url,$post,$param['header']);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['furn_sep_order_dt_assem_list'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function furnSeparateOrderCompList($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.furnSeparateOrderCompList");
-
-        if(! empty($data['drawing_no']) || ! empty($data['contract_no']) || ! empty($data['region']) || ! empty($data['room_no']) || ! empty($data['assembly_name']) || ! empty($data['component'])) {
-            $rules = [];
-            if(! empty($data['drawing_no'])) {
-                $rules[] = [
-                    'field' => 'exe_sep_order_a.drawing_no',
-                    'option' => 'IN',
-                    'values' => $data['drawing_no']
-                ];
-            }
-            if(! empty($data['contract_no'])) {
-                $rules[] = [
-                    'field' => 'exe_sep_order_a.contract_no',
-                    'option' => 'IN',
-                    'values' => $data['contract_no']
-                ];
-            }
-            if(! empty($data['region'])) {
-                $rules[] = [
-                    'field' => 'exe_sep_order_a.region',
-                    'option' => 'IN',
-                    'values' => $data['region']
-                ];
-            }
-            if(! empty($data['room_no'])) {
-                $rules[] = [
-                    'field' => 'exe_sep_order_dtl_b.room',
-                    'option' => 'IN',
-                    'values' => $data['room_no']
-                ];
-            }
-            if(! empty($data['assembly_name'])) {
-                $rules[] = [
-                    'field' => 'exe_sep_order_dtl_b.assembly_name',
-                    'option' => 'IN',
-                    'values' => $data['assembly_name']
-                ];
-            }
-            if(! empty($data['component'])) {
-                $rules[] = [
-                    'field' => 'component',
-                    'option' => 'IN',
-                    'values' => $data['component']
-                ];
-            }
-
-            $post['rules'] = $rules;
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function furnSeparateOrderDtCompList($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.furnSeparateOrderDtCompList");
-
-        if(! empty($data['drawing_no']) || ! empty($data['contract_no']) || ! empty($data['region']) || ! empty($data['room_no']) || ! empty($data['assembly_name']) || ! empty($data['component'])) {
-            $rules = [];
-            if(! empty($data['drawing_no'])) {
-                $rules[] = [
-                    'field' => 'furn_sep_order_dt_prod.drawing_no',
-                    'option' => 'IN',
-                    'values' => $data['drawing_no']
-                ];
-            }
-            if(! empty($data['contract_no'])) {
-                $rules[] = [
-                    'field' => 'furn_sep_order_dt_prod.contact_no',
-                    'option' => 'IN',
-                    'values' => $data['contract_no']
-                ];
-            }
-            if(! empty($data['region'])) {
-                $rules[] = [
-                    'field' => 'furn_sep_order_dt_prod.region',
-                    'option' => 'IN',
-                    'values' => $data['region']
-                ];
-            }
-            if(! empty($data['room_no'])) {
-                $rules[] = [
-                    'field' => 'furn_sep_order_dt_assem.room_no',
-                    'option' => 'IN',
-                    'values' => $data['room_no']
-                ];
-            }
-            if(! empty($data['assembly_name'])) {
-                $rules[] = [
-                    'field' => 'furn_sep_order_dt_assem.assembly_name',
-                    'option' => 'IN',
-                    'values' => $data['assembly_name']
-                ];
-            }
-            if(! empty($data['component'])) {
-                $rules[] = [
-                    'field' => 'component',
-                    'option' => 'IN',
-                    'values' => $data['component']
-                ];
-            }
-
-            $post['rules'] = $rules;
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function getWorkshopData($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-
-        $url = config("j_rfid.getWorkshopData");
-
-        if(! empty($data['drawing_no'])) $post['drawing_no'] = $data['drawing_no'];
-        if(! empty($data['contract_no'])) $post['contract_no'] = $data['contract_no'];
-        if(! empty($data['region'])) $post['region'] = $data['region'];
-        if(! empty($data['room_no'])) $post['room_no'] = $data['room_no'];
-        if(! empty($data['assembly_name'])) $post['assembly_name'] = $data['assembly_name'];
-        if(! empty($data['component'])) $post['component'] = $data['component'];
-
-        $post['type'] = $data['type'];
-        $post['site'] = $data['site'];
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = $data['number'] ?? 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result['data']];
-    }
-
-    public function screenGetSendData($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        if(empty($data['type'])) return [false, 'TYPE不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-
-        $url = config("j_rfid.screenGetSendData");
-
-        if(! empty($data['drawing_no'])) $post['drawing_no'] = $data['drawing_no'];
-        if(! empty($data['contract_no'])) $post['contract_no'] = $data['contract_no'];
-        if(! empty($data['region'])) $post['region'] = $data['region'];
-        if(! empty($data['room_no'])) $post['room_no'] = $data['room_no'];
-        if(! empty($data['assembly_name'])) $post['assembly_name'] = $data['assembly_name'];
-        if(! empty($data['component'])) $post['component'] = $data['component'];
-        if(! empty($data['send_no'])) $post['send_no'] = $data['send_no'];
-
-        $post['type'] = $data['type'];
-        $post['site'] = $data['site'];
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = $data['number'] ?? 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['message']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['success'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result['data']];
-    }
-
-    public function furnSendOrderDtCompList($data,$param){
-        if(empty($data['site'])) return [false, '站点不能为空'];
-        $header = array_merge($param['header'], ['site:'. $data['site']]);
-        $url = config("j_rfid.furnSendOrderDtCompList");
-
-        if(! empty($data['drawing_no']) || ! empty($data['contract_no']) || ! empty($data['region']) || ! empty($data['room_no']) || ! empty($data['assembly_name']) || ! empty($data['component'])) {
-            $rules = [];
-            if(! empty($data['drawing_no'])) {
-                $rules[] = [
-                    'field' => 'furn_send_assem_dt.drawing_no',
-                    'option' => 'IN',
-                    'values' => $data['drawing_no']
-                ];
-            }
-            if(! empty($data['contract_no'])) {
-                $rules[] = [
-                    'field' => 'furn_send_prod_dt.contact_no',
-                    'option' => 'IN',
-                    'values' => $data['contract_no']
-                ];
-            }
-            if(! empty($data['region'])) {
-                $rules[] = [
-                    'field' => 'furn_send_assem_dt.region',
-                    'option' => 'IN',
-                    'values' => $data['region']
-                ];
-            }
-            if(! empty($data['room_no'])) {
-                $rules[] = [
-                    'field' => 'furn_send_assem_dt.room_no',
-                    'option' => 'IN',
-                    'values' => $data['room_no']
-                ];
-            }
-            if(! empty($data['assembly_name'])) {
-                $rules[] = [
-                    'field' => 'furn_send_assem_dt.assembly_name',
-                    'option' => 'IN',
-                    'values' => $data['assembly_name']
-                ];
-            }
-            if(! empty($data['component'])) {
-                $rules[] = [
-                    'field' => 'component',
-                    'option' => 'IN',
-                    'values' => $data['component']
-                ];
-            }
-
-            $post['rules'] = $rules;
-        }
-
-        $post['size'] = $data['size'] ?? 10;
-        $post['number'] = ($data['number'] ?? 1) - 1;
-
-        list($status,$result) = $this->post_helper($url,$post,$header);
-        if(! $status) return [$status, $result];
-
-        if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
-        if(! empty($result['type']) && $result['type'] == 'errorVm') return [false, $result['message']];
-
-        if(! isset($result['content'])) {
-            $error = $result[0]['message'] ?? "操作失败,请刷新页面";
-            return [false, $error];
-        }
-
-        return [true, $result];
-    }
-
-    public function post_helper($url, $data, $header = [], $timeout = 20){
-        Log::channel('apiLog')->info('工装云POST', ["api" => $url , "param" => $data ,"header" => $header]);
-
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_ENCODING, '');
-        curl_setopt($ch, CURLOPT_POST, 1);
-        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
-
-        if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-
-            Log::channel('apiLog')->info('工装云POST结果', ["message" => $message]);
-            return [false, $message];
-        }
-        curl_close($ch);
-
-        $return = json_decode($r, true);
-        Log::channel('apiLog')->info('工装云POST结果', ["message" => $return]);
-
-        if(! empty($return['message']) && $return['message'] == 'error.unAuthorized') return [0, '登录凭证已失效或者不正确'];
-
-        return [true, $return];
-    }
-
-    public function get_helper($url,$header=[],$timeout = 20){
-        $ch = curl_init();
-        curl_setopt_array($ch, array(
-            CURLOPT_URL => $url,
-            CURLOPT_RETURNTRANSFER => true,
-            CURLOPT_ENCODING => '',
-            CURLOPT_MAXREDIRS => 10,
-            CURLOPT_TIMEOUT => $timeout,
-            CURLOPT_FOLLOWLOCATION => true,
-            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-            CURLOPT_CUSTOMREQUEST => 'GET',
-            CURLOPT_SSL_VERIFYPEER => false,
-            CURLOPT_HTTPHEADER => $header,
-        ));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-            Log::channel('apiLog')->info('工装云GET', ["message" => $message]);
-            return [false, $message];
-        }
-
-        curl_close($ch);
-
-        $return = json_decode($r, true);
-        Log::channel('apiLog')->info('工装云GET', ["message" => $return]);
-
-        if(! empty($return['message']) && $return['message'] == 'error.unAuthorized') return [0, '登录凭证已失效或者不正常'];
-
-        return [true, $return];
-    }
-}

+ 0 - 586
app/Service/MayCurServerService.php

@@ -1,586 +0,0 @@
-<?php
-
-namespace App\Service;
-
-
-use Illuminate\Support\Facades\Log;
-use Illuminate\Support\Facades\Redis;
-
-class MayCurServerService extends Service
-{
-    protected $param = "";
-    protected $domain_url = "";
-    protected $head = null;
-
-    public function __construct()
-    {
-        $this->param = config("maycur");
-        $this->domain_url = $this->param['dd_url'];
-    }
-
-    public function getToken(){
-        //每刻所有配置
-        $url_array = $this->param;
-
-        //redis 存储的token
-        $key = $this->domain_url . $url_array['login_redis_topic'];
-        $token = Redis::get($key);
-        if(! empty($token)) {
-            $this->head = json_decode($token,true);
-            return [true, ''];
-        }
-
-        //获取token的参数
-        $appcode = env('maycur_appcode');
-        $appsercet = env('maycur_appsercet');
-        if(empty($appcode) || empty($appsercet)) return [false, '每刻鉴权认证参数不能为空'];
-
-        //组织获取参数
-        $url = $this->domain_url . $url_array['login'];
-        $time = microtime(true);
-        $timeStamp = intval($time * 1000);
-        //生成secret
-        $secret = $this->getSecret($appcode, $appsercet, $timeStamp);
-
-        $post = [
-            "secret" => $secret,
-            "appCode" => $appcode,
-            "timestamp" => $timeStamp
-        ];
-        $header = ['Content-Type:application/json'];
-        list($status, $result) = $this->post_helper($url,$post, $header);
-        if(! $status) return [$status, $result];
-        if(isset($result['code']) && $result['code'] != 'ACK') return [false, $result['message'] ?? '鉴权失败,请联系开发者'];
-
-        $token_array = [
-            'tokenId:' . $result['data']['tokenId'],
-            'entCode:' . $result['data']['entCode'],
-        ];
-        $this->head = $token_array;
-
-        Redis::setex($key, $url_array['login_expire_time'], json_encode($token_array));
-
-        return [true, ''];
-    }
-
-    private function getSecret($appCode, $appSecret, $timeStamp) {
-        // 拼接字符串并计算 SHA-256 哈希值
-        $stringToHash = $appSecret . ":" . $appCode . ":" . $timeStamp;
-        $hashedString = hash('sha256', $stringToHash);
-
-        return $hashedString;
-    }
-
-    public function reimburse($data){
-       //校验
-       list($status, $msg) = $this->reimburseRule($data);
-       if(! $status) return [false, $msg];
-       //获取token
-       list($status, $token) = $this->getToken();
-       if(! $status) return [false, $token];
-
-       $header = $this->head;
-       //每刻所有配置
-       $url_array = $this->param;
-       //组织获取参数
-       $url = $this->domain_url . $url_array['reimburse'];
-       $header = array_merge(['Content-Type:application/json'], $header);
-       list($status, $result) = $this->post_helper($url,$msg, $header);
-       if(! $status) return [$status, $result];
-       if(isset($result['code']) && $result['code'] != 'ACK') return [false, $result['message']];
-
-       //组织返回数据
-       if(empty($result['data'])) return [true, ['list' => null, 'hasNextPage' => false]];
-
-       //获取报销单详情填充
-       list($status, $return) = $this->reimburseDetailGet($result['data']);
-       if(! $status) return [false, $return];
-
-       if(! empty($return['list'])){
-           list($status,$msg) = $this->tradingPartner($return);
-           if(! $status) return [false, $msg];
-
-           foreach ($return['list'] as $key => $value){
-               $return['list'][$key]['tradingPartnerBizCodeType'] = $msg[$value['tradingPartnerBizCode']] ?? [];
-           }
-       }
-
-       return [true, $return];
-    }
-
-    public function reimburseRule($data){
-        if(empty($data['settledAtStart']) || empty($data['settledAtEnd'])) return [false, '单据的支付时间不能为空'];
-        $settledAtStart = strtotime($data['settledAtStart'] . '00:00:00');
-        $settledAtEnd = strtotime($data['settledAtEnd'] . '23:59:59');
-        if(empty($settledAtStart)) return [false, '单据的支付时间格式错误'];
-        if(empty($settledAtEnd)) return [false, '单据的支付时间格式错误'];
-        $formCodes = [];
-        if(! empty($data['formCodes'])) $formCodes = array_filter($data['formCodes']);
-        $formStatus = "";
-        if(! empty($data['formStatus'])) $formStatus = $data['formStatus'];
-        $legalEntityBizCodes = [];
-        if(! empty($data['legalEntityBizCodes'])) $legalEntityBizCodes = $data['legalEntityBizCodes'];
-
-        $pageNo = 1;
-        $pageSize = 10;
-        if(! empty($data['pageNo'])) $pageNo = $data['pageNo'];
-        if(! empty($data['pageSize'])) {
-            if($data['pageSize'] >= 10) {
-                $pageSize = 10;
-            }else{
-                $pageSize = $data['pageSize'];
-            }
-        }
-
-        $return = [
-            'settledAtStart' => $settledAtStart * 1000,
-            'settledAtEnd' => $settledAtEnd * 1000,
-            'pageNo' => $pageNo,
-            'pageSize' => $pageSize,
-            'formStatus' => $formStatus,
-            "legalEntityBizCodes" => $legalEntityBizCodes,
-            "formCodes" => $formCodes,
-        ];
-
-        return [true, $return];
-    }
-
-    public function reimburseDetailGet($list){
-        if(empty($list['list'])) return [true, $list];
-
-        list($status,$departList) = $this->department();
-        if(! $status) return [false, $departList];
-
-        $return = [];
-        foreach ($list['list'] as $key => $value){
-            list($status, $msg) = $this->reimburseDetail($value);
-            if(! $status) return [false, $msg];
-            $parent = $this->findParent($departList,$value['departmentBizCode']);
-            $parent = array_reverse($parent);
-            $res = [];
-            foreach ($parent as $value){
-                $tmp2['code'] = $value['businessCode'];
-                $tmp2['value'] = $value['name'];
-                $res[] = $tmp2;
-            }
-            $msg['departmentList'] = $res;
-            $return[] = $msg;
-        }
-
-        return [true, ['list' => $return, 'hasNextPage' => $list['hasNextPage']]];
-    }
-
-    // 辅助函数用于递归查找父节点
-    function findParent($data, $businessCode) {
-        // 存储结果的数组
-        $result = [];
-
-        foreach ($data as $item) {
-            if ($item['businessCode'] == $businessCode) {
-                // 找到了当前节点的父节点
-                if ($item['parentBizCode'] != '') {
-                    // 添加父节点到结果数组
-                    $result[] = $item;
-                    // 继续递归查找父节点的父节点
-                    $result = array_merge($result, $this->findParent($data, $item['parentBizCode']));
-                }
-                break; // 找到后退出循环
-            }
-        }
-
-        return $result;
-    }
-
-    function findChildren($data, $businessCode) {
-        // 存储结果的数组
-        $result = [];
-
-        // 遍历数据,寻找匹配的子元素
-        foreach ($data as $item) {
-            if ($item['parentBizCode'] == $businessCode) {
-                // 如果找到了子元素,则将其添加到结果数组中
-                $result[] = $item;
-                // 递归查找该子元素的所有子元素
-                $children = $this->findChildren($data, $item['businessCode']);
-                if (!empty($children)) {
-                    // 将找到的子元素合并到结果数组中
-                    $result = array_merge($result, $children);
-                }
-            }
-        }
-
-        return $result;
-    }
-
-    public function reimburseDetail($data){
-        if(empty($data['formCode'])) return [false, ["报销单详情请求缺失formCode"]];
-
-        $post = [
-            "formCode"=> $data['formCode'],
-            "enablePayeeInfo"=> false,
-            "enablePayerInfo"=> false,
-            "enableAssociatedForms"=> false,
-            "enableTravelRouteList"=> false,
-            "enableCreditInfo"=> false,
-            "enableExpenseList"=> true,//
-            "enableInvoiceList"=> true,//
-            "enableExpenseAllocationList"=> true,//
-            "enableTravelPartnerInfo"=> false,
-            "enableAttachments"=> false,
-            "enableCapitalPlanPaymentLog"=> false
-        ];
-
-        $header = $this->head;
-        //每刻所有配置
-        $url_array = $this->param;
-        //组织获取参数
-        $url = $this->domain_url . $url_array['reimburseDetail'];
-        $header = array_merge(['Content-Type:application/json'], $header);
-        list($status, $result) = $this->post_helper($url,$post, $header);
-        if(! $status) return [$status, $result];
-        if(isset($result['code']) && $result['code'] != 'ACK') return [false, $result['message']];
-
-        return [true, $result['data'] ?? []];
-    }
-
-    public function loan($data){
-        //校验
-        list($status, $msg) = $this->loanRule($data);
-        if(! $status) return [false, $msg];
-        //获取token
-        list($status, $token) = $this->getToken();
-        if(! $status) return [false, $token];
-
-        $header = $this->head;
-        //每刻所有配置
-        $url_array = $this->param;
-        //组织获取参数
-        $url = $this->domain_url . $url_array['loan'];
-        $header = array_merge(['Content-Type:application/json'], $header);
-        list($status, $result) = $this->post_helper($url,$msg, $header);
-        if(! $status) return [$status, $result];
-        if(isset($result['code']) && $result['code'] != 'ACK') return [false, $result['message']];
-
-        //组织返回数据
-        if(empty($result['data'])) return [true, ['list' => null, 'hasNextPage' => false]];
-
-        //获取报销单详情填充
-        list($status, $return) = $this->loanDetailGet($result['data']);
-        if(! $status) return [false, $return];
-
-        if(! empty($return['list'])){
-            list($status,$msg) = $this->tradingPartner($return);
-            if(! $status) return [false, $msg];
-
-            foreach ($return['list'] as $key => $value){
-                $return['list'][$key]['tradingPartnerBizCodeType'] = $msg[$value['tradingPartnerBizCode']] ?? [];
-            }
-        }
-
-        return [true, $return];
-    }
-
-    public function loanRule($data){
-        if(empty($data['settledAtStart']) || empty($data['settledAtEnd'])) return [false, '单据的支付时间不能为空'];
-        $settledAtStart = strtotime($data['settledAtStart'] . '00:00:00');
-        $settledAtEnd = strtotime($data['settledAtEnd'] . '23:59:59');
-        if(empty($settledAtStart)) return [false, '单据的支付时间格式错误'];
-        if(empty($settledAtEnd)) return [false, '单据的支付时间格式错误'];
-        $formCodes = [];
-        if(! empty($data['formCodes'])) $formCodes = array_filter($data['formCodes']);
-        $formStatus = "";
-        if(! empty($data['formStatus'])) $formStatus = $data['formStatus'];
-        $legalEntityBizCodes = [];
-        if(! empty($data['legalEntityBizCodes'])) $legalEntityBizCodes = $data['legalEntityBizCodes'];
-
-        $pageNo = 1;
-        $pageSize = 10;
-        if(! empty($data['pageNo'])) $pageNo = $data['pageNo'];
-        if(! empty($data['pageSize'])) {
-            if($data['pageSize'] >= 10) {
-                $pageSize = 10;
-            }else{
-                $pageSize = $data['pageSize'];
-            }
-        }
-
-        $return = [
-            'settledAtStart' => $settledAtStart * 1000,
-            'settledAtEnd' => $settledAtEnd * 1000,
-            'pageNo' => $pageNo,
-            'pageSize' => $pageSize,
-            'formStatus' => $formStatus,
-            "legalEntityBizCodes" => $legalEntityBizCodes,
-            "formCodes" => $formCodes,
-        ];
-
-        return [true, $return];
-    }
-
-    public function loanDetailGet($list){
-        if(empty($list['list'])) return [true, $list];
-
-        list($status,$departList) = $this->department();
-        if(! $status) return [false, $departList];
-
-        $return = [];
-        foreach ($list['list'] as $value){
-            list($status, $msg) = $this->loanDetail($value);
-            if(! $status) return [false, $msg];
-
-            $parent = $this->findParent($departList,$value['departmentBizCode']);
-            $parent = array_reverse($parent);
-            $res = [];
-            foreach ($parent as $value){
-                $tmp2['code'] = $value['businessCode'];
-                $tmp2['value'] = $value['name'];
-                $res[] = $tmp2;
-            }
-            $msg['departmentList'] = $res;
-
-            $return[] = $msg;
-        }
-
-        return [true, ['list' => $return, 'hasNextPage' => $list['hasNextPage']]];
-    }
-
-    public function loanDetail($data){
-        if(empty($data['formCode'])) return [false, ["借款单详情请求缺失formCode"]];
-
-        $header = $this->head;
-        //每刻所有配置
-        $url_array = $this->param;
-        //组织获取参数
-        $url = $this->domain_url . $url_array['loanDetail'] . $data['formCode'];
-        $header = array_merge(['Content-Type:application/json'], $header);
-        list($status, $result) = $this->get_helper($url,$header);
-        if(! $status) return [$status, $result];
-        if(isset($result['code']) && $result['code'] != 'ACK') return [false, $result['message']];
-
-        return [true, $result['data'] ?? []];
-    }
-
-    public function tradingPartner($data){
-        if(empty($data['list'])) return [true, []];
-        $bizCodes = array_values(array_filter(array_unique(array_column($data['list'], 'tradingPartnerBizCode'))));
-        if(empty($bizCodes)) return [true, []];
-
-        $post = [
-            'bizCodes' => $bizCodes,
-        ];
-
-        //获取token
-        list($status, $token) = $this->getToken();
-        if(! $status) return [false, $token];
-
-        $header = $this->head;
-        //每刻所有配置
-        $url_array = $this->param;
-        //组织获取参数
-        $url = $this->domain_url . $url_array['tradingPartner'];
-        $header = array_merge(['Content-Type:application/json'], $header);
-
-        list($status, $result) = $this->post_helper($url,$post, $header);
-        if(! $status) return [$status, $result];
-        if(isset($result['code']) && $result['code'] != 'ACK') return [false, $result['message']];
-
-        $map = array_column($result['data']['list'], 'partnerType','bizCode');
-        return [true, $map];
-    }
-
-    public function department(){
-        //获取token
-        list($status, $token) = $this->getToken();
-        if(! $status) return [false, $token];
-
-        $header = $this->head;
-        //每刻所有配置
-        $url_array = $this->param;
-        //组织获取参数
-        $url = $this->domain_url . $url_array['department'];
-        $header = array_merge(['Content-Type:application/json'], $header);
-
-        $return = [];
-        $offset = 1;
-        $count = 100;
-        do {
-            $post = [
-                'pageNo' => $offset,
-                'pageSize' => $count,
-            ];
-
-            list($status, $result) = $this->post_helper($url,$post, $header);
-            if(! $status) return [$status, $result];
-            if(isset($result['code']) && $result['code'] != 'ACK') return [false, $result['message']];
-
-            if(! empty($result['data']['list'])){
-                foreach ($result['data']['list'] as $value){
-                    $return[] = [
-                        'name' => $value['name'],
-                        'businessCode' => $value['businessCode'],
-                        'parentBizCode' => $value['parentBizCode'],
-//                        'fullName' => $value['fullName']
-                    ];
-                }
-            }
-
-            $next = $result['data']['hasNextPage'];
-
-            // 更新 offset
-            $offset += 1;
-
-        } while ($next);
-
-        return [true, $return];
-    }
-
-    //保存到oa
-    public function saveOaData($data, $header){
-        $return = [
-            'status' => 'error',
-            'success' => false,
-            'message' => "",
-            'data' => null,
-        ];
-
-        //失败
-        if(empty($data)) {
-            $return['message'] = '请求参数不能为空';
-            return $return;
-        }
-
-        $url = "https://gzy.qingyaokeji.com/api/module-data/voucher_oa_pay/voucher_oa_pay/diy/save_oa_data";
-        $post = $data;
-        $auth = $header['authorization'][0] ?? "";
-        $header = array_merge(['Content-Type:application/json'], ['Authorization: ' . $auth]);
-        list($status, $result) = $this->post_helper1($url,$post, $header);
-        if(! $status) {
-            //失败
-            $return['message'] = $result;
-            return $return;
-        }
-        if(isset($result['message']) && isset($result['type']) && $result['type'] === 'errorVm') {
-            //失败
-            $return['message'] = $result['description'];
-            return $return;
-        }
-        if(! empty($result) && ! empty($result[0]['message'])){
-            //失败
-            $return['message'] = $result[0]['message'];
-            return $return;
-        }
-
-        //成功
-        if(isset($result['success']) && $result['success'] == true) return $result;
-
-        $return['message'] = "异常错误,请联系开发工程师";
-        return $return;
-    }
-
-    public function post_helper($url, $data, $header = [], $timeout = 20){
-        Log::channel('apiMcLog')->info('每刻POST', ["api" => $url , "param" => $data ,"header" => $header]);
-
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_ENCODING, '');
-        curl_setopt($ch, CURLOPT_POST, 1);
-        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
-
-        if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-
-            Log::channel('apiMcLog')->info('每刻POST结果', ["message" => $message]);
-            return [false, $message];
-        }
-        curl_close($ch);
-
-        $return = json_decode($r, true);
-        Log::channel('apiMcLog')->info('每刻POST结果', ["message" => $return]);
-
-        return [true, $return];
-    }
-
-    public function get_helper($url,$header=[],$timeout = 20){
-        Log::channel('apiMcLog')->info('每刻GET', ["api" => $url ,"header" => $header]);
-        $ch = curl_init();
-        curl_setopt_array($ch, array(
-            CURLOPT_URL => $url,
-            CURLOPT_RETURNTRANSFER => true,
-            CURLOPT_ENCODING => '',
-            CURLOPT_MAXREDIRS => 10,
-            CURLOPT_TIMEOUT => $timeout,
-            CURLOPT_FOLLOWLOCATION => true,
-            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-            CURLOPT_CUSTOMREQUEST => 'GET',
-            CURLOPT_SSL_VERIFYPEER => false,
-            CURLOPT_HTTPHEADER => $header,
-        ));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-            Log::channel('apiMcLog')->info('每刻GET', ["message" => $message]);
-            return [false, $message];
-        }
-
-        curl_close($ch);
-
-        $return = json_decode($r, true);
-        Log::channel('apiMcLog')->info('每刻GET', ["message" => $return]);
-
-        return [true, $return];
-    }
-
-    public function post_helper1($url, $data, $header = [], $timeout = 20){
-        Log::channel('apiMcLog')->info('每刻POST', ["api" => $url , "param" => $data ,"header" => $header]);
-
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_ENCODING, '');
-        curl_setopt($ch, CURLOPT_POST, 1);
-        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
-
-        if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-
-            Log::channel('apiMcLog')->info('每刻POST结果', ["message" => $message]);
-            return [false, $message];
-        }
-        // 获取HTTP状态码
-        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-
-        curl_close($ch);
-        if($httpCode == 401) return [false, '登陆凭证错误,请检查'];
-
-        $return = json_decode($r, true);
-        Log::channel('apiMcLog')->info('每刻POST结果', ["message" => $return]);
-
-        return [true, $return];
-    }
-}

+ 0 - 174
app/Service/MayCurVouchersServerService.php

@@ -1,174 +0,0 @@
-<?php
-
-namespace App\Service;
-
-
-use Illuminate\Support\Facades\Log;
-use Illuminate\Support\Facades\Redis;
-
-class MayCurVouchersServerService extends Service
-{
-    protected $param = "";
-    protected $domain_url = "";
-    protected $is_formal_vouch = false;
-    protected $head = null;
-
-    public function __construct($data)
-    {
-        $param = config("maycur");
-        if(isset($data['is_voucher']) && ! $data['is_voucher']){ // 测试
-            $this->param = $param['voucher_cs'] ?? [];
-            $this->domain_url = $this->param['ip'] ?? "";
-        }else{
-            $this->param = $param['voucher_zs'] ?? [];
-            $this->domain_url = $this->param['ip'] ?? "";
-            $this->is_formal_vouch = true;
-        }
-    }
-
-    private function getSecret($appCode, $appSecret, $timeStamp) {
-        // 拼接字符串并计算 SHA-256 哈希值
-        $stringToHash = $appSecret . ":" . $appCode . ":" . $timeStamp;
-        $hashedString = hash('sha256', $stringToHash);
-
-        return $hashedString;
-    }
-
-    public function getToken(){
-        //每刻所有配置
-        $url_array = $this->param;
-
-        //环境
-        $is_voucher_formal = $this->is_formal_vouch;
-        $name = $is_voucher_formal ? "每刻凭证正试环境" : "每刻凭证测试环境";
-
-        //redis 存储的token
-        $key = $this->domain_url . $url_array['login_expire_time'];
-        $token = Redis::get($key);
-        if(! empty($token)) {
-            $this->head = json_decode($token,true);
-            return [true, ''];
-        }
-
-        //获取token的参数
-        $appcode = $url_array['appkey'];
-        $appsercet = $url_array['appsecret'];
-        if(empty($appcode) || empty($appsercet)) return [false, $name . '鉴权认证参数不能为空'];
-
-        //组织获取参数
-        $url = $this->domain_url . $url_array['login'];
-        $time = microtime(true);
-        $timeStamp = intval($time * 1000);
-        //生成secret
-        $secret = $this->getSecret($appcode, $appsercet, $timeStamp);
-
-        $post = [
-            "secretToken" => $secret,
-            "userCode" => $appcode,
-            "timestamp" => $timeStamp
-        ];
-        $header = ['Content-Type:application/json'];
-        list($status, $result) = $this->post_helper($url,$post, $header);
-        if(! $status) return [$status, $result];
-        if(isset($result['code']) && $result['code'] != '200') return [false, $result['errMsg'] ?? $name . '鉴权失败,请联系开发者'];
-
-        $token_array = [
-            'Authorization:Bearer ' . $result['data']['token'],
-        ];
-        $this->head = $token_array;
-
-        Redis::setex($key, $url_array['login_expire_time'], json_encode($token_array));
-
-        return [true, ''];
-    }
-
-    public function voucher($data){
-        if(empty($data['body'])) return [false, '凭证同步入参请放入body内'];
-        //获取token
-        list($status, $token) = $this->getToken();
-        if(! $status) return [false, $token];
-
-        $header = $this->head;
-        //每刻所有配置
-        $url_array = $this->param;
-        //组织获取参数
-        $url = $this->domain_url . $url_array['voucher_insert'];
-        $post = $data['body'] ?? [];
-        $header = array_merge(['Content-Type:application/json'], $header);
-        list($status, $result) = $this->post_helper($url,$post, $header);
-        if(! $status) return [$status, $result];
-        if(isset($result['code']) && $result['code'] == 1) return [false, $result['errData'][0]['errorMsg'] ?? ""];
-        if(isset($result['code']) && $result['code'] != 0 && ! empty($result['errMsg'])) return [false, $result['errMsg']];
-
-        return [true, ''];
-    }
-
-    public function post_helper($url, $data, $header = [], $timeout = 20){
-        Log::channel('apiMcLog')->info('每刻凭证POST', ["api" => $url , "param" => $data ,"header" => $header]);
-
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_ENCODING, '');
-        curl_setopt($ch, CURLOPT_POST, 1);
-        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
-
-        if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-
-            Log::channel('apiMcLog')->info('每刻凭证POST结果', ["message" => $message]);
-            return [false, $message];
-        }
-        curl_close($ch);
-
-        $return = json_decode($r, true);
-        Log::channel('apiMcLog')->info('每刻凭证POST结果', ["message" => $return]);
-
-        return [true, $return];
-    }
-
-    public function get_helper($url,$header=[],$timeout = 20){
-        Log::channel('apiMcLog')->info('每刻凭证GET', ["api" => $url ,"header" => $header]);
-        $ch = curl_init();
-        curl_setopt_array($ch, array(
-            CURLOPT_URL => $url,
-            CURLOPT_RETURNTRANSFER => true,
-            CURLOPT_ENCODING => '',
-            CURLOPT_MAXREDIRS => 10,
-            CURLOPT_TIMEOUT => $timeout,
-            CURLOPT_FOLLOWLOCATION => true,
-            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-            CURLOPT_CUSTOMREQUEST => 'GET',
-            CURLOPT_SSL_VERIFYPEER => false,
-            CURLOPT_HTTPHEADER => $header,
-        ));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-            Log::channel('apiMcLog')->info('每刻凭证GET', ["message" => $message]);
-            return [false, $message];
-        }
-
-        curl_close($ch);
-
-        $return = json_decode($r, true);
-        Log::channel('apiMcLog')->info('每刻凭证GET', ["message" => $return]);
-
-        return [true, $return];
-    }
-}

+ 0 - 104
app/Service/ReportFormsService.php

@@ -1,104 +0,0 @@
-<?php
-
-namespace App\Service;
-
-use App\Model\SystemL;
-
-/**
- * 设备相关设置报表
- * Class ReportFormsService
- * @package App\Service
- */
-class ReportFormsService extends Service
-{
-    /**
-     * 数据分析图
-     * @param $data
-     * @return array
-     */
-    public function deviceStatisticsReportChart($data){
-        if(empty($data['time'][0]) || empty($data['time'][1])) return [false, '时间必须选择!'];
-
-        $day = $this->returnDays($data['time'], false);
-        if($day > 31) return [false, '查询时间仅支持范围区间在31天内'];
-
-        $return = [];
-        foreach (SystemL::$device as $key => $value){
-            $list = [];
-            for ($i = $data['time'][0]; $i <= $data['time'][1]; $i+= 86400){
-                $tmp['time'] = date("Y-m-d", $i);
-                $tmp['num'] = mt_rand(1100, 1200);
-                $list[] = $tmp;
-            }
-            $return[] = [
-                "title" => $key,
-                "list" => $list
-            ];
-        }
-
-        return [true, $return];
-    }
-
-    /**
-     * 数据OEE分析图
-     * @param $data
-     * @return array
-     */
-    public function deviceStatisticsReportOEEChart($data){
-        if(empty($data['time'][0]) || empty($data['time'][1])) return [false, '时间必须选择!'];
-
-        $day = $this->returnDays($data['time'], false);
-        if($day > 10) return [false, '查询时间仅支持范围区间在10天内'];
-
-        $return = [];
-        foreach (SystemL::$device as $key => $value){
-            $list = [];
-            for ($i = $data['time'][0]; $i <= $data['time'][1]; $i+= 86400){
-                $tmp['time'] = date("Y-m-d", $i);
-                $tmp['num'] = $this->getRandomFloat(35);
-                $list[] = $tmp;
-            }
-            $return[] = [
-                "title" => $key,
-                "list" => $list
-            ];
-        }
-
-
-        return [true, $return];
-    }
-
-    function getRandomFloat($min = 40, $max = 43) {
-        // 生成一个在[0, 100)范围内的随机整数(乘以100是为了扩大范围,便于计算)
-        $randomInt = mt_rand(0, 99);
-        // 将随机整数转换为浮点数,并乘以范围(45-40),然后加上最小值40
-        $randomFloat = ($randomInt / 100) * ($max - $min) + $min;
-        // 返回两位小数
-        return round($randomFloat, 2);
-    }
-
-    /**
-     * 用于计算时间
-     * @param $minute
-     * @return string
-     */
-    public function calTimeReturnMin($minute){
-        return number_format($minute * 1.5 / 60,2);
-    }
-
-    function returnDays($time = [], $is_mirco_time = true){
-
-        // 示例时间戳
-        $timestamp1 = $time[0];
-        $timestamp2 = $time[1];
-
-        // 计算时间差
-        $difference = abs($timestamp2 - $timestamp1);
-
-        // 将时间差转换为天数
-        $days = floor($difference / (60 * 60 * 24));
-        if($is_mirco_time) $days = $days / 1000;
-
-        return $days;
-    }
-}

+ 0 - 173
app/Service/RsaEncryptionService.php

@@ -1,173 +0,0 @@
-<?php
-
-namespace App\Service;
-
-class RsaEncryptionService extends Service
-{
-//    public function encrypt($data)
-//    {
-//        //公钥文件位于 storage/app/public/rsa/public.pem
-//        $publicKeyPath = storage_path('app/public/rsa/public.pem');
-//        $publicKey = openssl_pkey_get_public(file_get_contents($publicKeyPath));
-//
-//        openssl_public_encrypt($data, $encrypted, $publicKey);
-//        return base64_encode($encrypted);
-//    }
-
-    public function encrypt($data){
-        $data = json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); // 重新序列化,确保所有key按字典序排序
-
-        // 公钥文件位于 storage/app/public/rsa/public.pem
-        $publicKeyPath = storage_path('app/public/rsa/public.pem');
-
-        // 确保文件存在
-        if (!file_exists($publicKeyPath)) return [false , '公钥不存在'];
-
-        // 读取公钥文件的内容
-        $publicKeyContent = file_get_contents($publicKeyPath);
-        if ($publicKeyContent === false) return [false , '公钥文件读取失败'];
-
-        // 获取公钥资源
-        $publicKey = openssl_pkey_get_public($publicKeyContent);
-        if (! $publicKey) {
-            $error = openssl_error_string();
-            if ($error !== false) {
-                return [false , '公钥文件加载失败:' . $error];
-            } else {
-                return [false , '公钥文件加载失败'];
-            }
-        }
-
-        // 假设 $publicKey 是你已经获取的公钥资源
-//        $keyDetails = openssl_pkey_get_details($publicKey);
-//        $keyBits = $keyDetails['bits'];
-
-        // PKCS#1 v1.5 填充的最大数据长度
-//        $maxDataLengthPkcs1 = floor($keyBits / 8) - 11;
-
-        // OAEP 填充的最大数据长度
-//        $maxDataLengthOaep = floor($keyBits / 8) - 42;
-
-//        echo "For PKCS#1 v1.5 padding, the maximum data length is: {$maxDataLengthPkcs1} bytes.\n";
-//        echo "For OAEP padding, the maximum data length is: {$maxDataLengthOaep} bytes.\n";
-
-
-        if (! openssl_public_encrypt($data, $encrypted, $publicKey)) {
-            $error = openssl_error_string();
-            if ($error !== false) {
-                return [false , '加密失败:' . $error];
-            } else {
-                return [false , '加密失败'];
-            }
-        }
-
-        // 返回base64编码的加密数据
-        return [true, base64_encode($encrypted)];
-    }
-
-    function encrypt2($data) {
-        // 公钥文件
-        $publicKeyString = storage_path('app/public/rsa/public.pem');
-        // 读取公钥文件内容
-        $publicKeyString = file_get_contents($publicKeyString);
-
-        //加密的数据
-        $plainText = json_encode($data);
-
-        // 生成随机AES密钥以进行对称加密
-        $aesKey = openssl_random_pseudo_bytes(16); // AES-128
-
-        // 使用AES加密明文
-        $ivlen = openssl_cipher_iv_length('aes-128-cbc');
-        $iv = openssl_random_pseudo_bytes($ivlen);
-        $encryptedBytes = openssl_encrypt($plainText, 'aes-128-cbc', $aesKey, OPENSSL_RAW_DATA, $iv);
-
-        // 使用RSA加密AES密钥
-        $resource = openssl_pkey_get_public($publicKeyString);
-        openssl_public_encrypt($aesKey, $encryptedAESKey, $resource);
-
-        // 组合AES密钥和加密的消息
-        $encryptedAESKeyStr = base64_encode($encryptedAESKey);
-        $encryptedMessageStr = base64_encode($iv . $encryptedBytes);
-
-        //AES的密钥 : 传递的参数
-        return $encryptedAESKeyStr . ":" . $encryptedMessageStr;
-    }
-
-    function decrypt2($encryptedText) {
-        // 密钥文件
-        $privateKeyString = storage_path('app/public/rsa/private.pem');
-        // 读取密钥文件内容
-        $privateKeyString = file_get_contents($privateKeyString);
-
-        // 将输入分成加密的AES密钥和加密的消息两部分
-        list($encryptedAESKeyStr, $encryptedMessageStr) = explode(":", $encryptedText, 2);
-        if (!isset($encryptedAESKeyStr) || !isset($encryptedMessageStr)) {
-            throw new \Exception("无效的输入格式");
-        }
-
-        // 使用RSA私钥解密AES密钥
-        $resource = openssl_pkey_get_private($privateKeyString);
-        $encryptedAESKey = base64_decode($encryptedAESKeyStr);
-        openssl_private_decrypt($encryptedAESKey, $decryptedAESKey, $resource);
-
-        // 使用AES解密消息
-        $ivlen = openssl_cipher_iv_length('aes-128-cbc');
-        $encryptedMessage = base64_decode($encryptedMessageStr);
-        $iv = substr($encryptedMessage, 0, $ivlen);
-        $ciphertext = substr($encryptedMessage, $ivlen);
-
-        $plaintext = openssl_decrypt($ciphertext, 'aes-128-cbc', $decryptedAESKey, OPENSSL_RAW_DATA, $iv);
-
-        return $plaintext;
-    }
-
-    // 加密函数
-    function aesEncrypt($data) {
-        $data = json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); // 重新序列化,确保所有key按字典序排序
-
-        // 密钥文件
-        $key = storage_path('app/public/rsa/public.pem');
-
-        // 读取密钥文件内容
-        $key = file_get_contents($key);
-
-        // 生成一个随机的初始化向量(IV)
-        $ivSize = openssl_cipher_iv_length('aes-256-cbc');
-        $iv = openssl_random_pseudo_bytes($ivSize);
-
-        // 加密数据
-        $encrypted = openssl_encrypt($data, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);
-        if ($encrypted === false) return [false, '加密失败'];
-
-        // 将 IV 和加密后的数据一起返回,以便解密时使用
-        return [true, base64_encode($iv) . ":" . base64_encode($encrypted)];
-    }
-
-    // 解密函数
-    function aesDecrypt($data) {
-        // 公钥文件位于 storage/app/public/rsa/public.pem
-        $key = storage_path('app/public/rsa/public.pem');
-
-        // 读取密钥文件内容
-        $key = file_get_contents($key);
-
-        // 分割字符串,去除冒号
-        list($ivPart, $encryptedPart) = explode(':', $data, 2);
-        $ivPart = base64_decode($ivPart);
-        $encryptedPart = base64_decode($encryptedPart);
-
-        // 获取 IV 和加密后的数据
-        $ivSize = openssl_cipher_iv_length('aes-256-cbc');
-        $iv = substr($ivPart, 0, $ivSize);
-        $encrypted = $encryptedPart;
-
-        // 解密数据
-        $decrypted = openssl_decrypt($encrypted, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);
-        if ($decrypted === false) {
-            throw new \Exception('Decryption failed.');
-        }
-
-        return $decrypted;
-    }
-}

+ 0 - 578
app/Service/TestService.php

@@ -1,578 +0,0 @@
-<?php
-
-namespace App\Service;
-
-use App\Model\RecordTable;
-use Illuminate\Support\Facades\Cache;
-use Illuminate\Support\Facades\Config;
-use Illuminate\Support\Facades\DB;
-use Illuminate\Support\Facades\Log;
-
-class TestService extends Service
-{
-    public function testdwy($data){
-        if(empty($data['url']) || empty($data['post']) || empty($data['header'])) return [false,'API请求参数不能为空'];
-        $url = $data['url'];
-//        $oldUrl = config('ip.zslf');
-//        $newUrl = config('ip.zslfip');
-//        $url = str_replace($oldUrl, $newUrl, $url);
-
-        $post = $data['post'];
-        $header = $data['header'];
-
-        $json = json_encode($post);
-        $json = str_replace('"workflowSearchBean":[]','"workflowSearchBean":{}',$json);
-        $json = str_replace('"loginBindingParameters":[]','"loginBindingParameters":{}',$json);
-
-        list($status, $result) = $this->post_helper($url,$json, $header, 40,'LFMY');
-        if(! $status) return [false, $result];
-
-        return [true, $result];
-    }
-
-    public function testdwyget($data){
-        if(empty($data['url']) || empty($data['header'])) return [false,'API请求参数不能为空'];
-
-        $url = $data['url'];
-//        $oldUrl = config('ip.zslf');
-//        $newUrl = config('ip.zslfip');
-//        $url = str_replace($oldUrl, $newUrl, $url);
-
-        $header = $data['header'];
-
-        list($status,$result) = $this->get_helper($url,$header);
-        if(! $status) return [false, $result];
-
-        return [true, $result];
-    }
-
-    public function testdwyput($data){
-        if(empty($data['url']) || empty($data['post']) || empty($data['header'])) return [false,'API请求参数不能为空'];
-
-        $url = $data['url'];
-//        $oldUrl = config('ip.zslf');
-//        $newUrl = config('ip.zslfip');
-//        $url = str_replace($oldUrl, $newUrl, $url);
-
-        $post = $data['post'];
-        $header = $data['header'];
-
-        $json = json_encode($post);
-        $json = str_replace('"workflowSearchBean":{}','"workflowSearchBean":[]',json_encode($post));
-        $json = str_replace('"workflowSearchBean":[]','"workflowSearchBean":{}',json_encode($post));
-
-        list($status, $result) = $this->put_helper($url,$json, $header,40);
-        if(! $status) return [false, $result];
-
-        return [true, $result];
-    }
-
-    //-----------------------------------朗峰u8-----
-    public function getToken($common_array){
-        list($status, $msg) = $this->SetU8($common_array);
-        if(! $status) return [false , $msg];
-        $host = $msg;
-        $key = "lf_u8_long_token_demo_" . $common_array['site'] . '_' . $common_array['database'];
-        if(! Cache::has($key)){
-            $url = $host . "/api/System/GetToken";
-            $date = date("Y-m-d");
-            $json = [
-                "U8DbName"=> $common_array['database'],
-                "sUserId"=> "demo",
-                "sPassword"=> "DEMO",
-                "LoginDateTime"=> $date,
-                "bPersist"=> true
-            ];
-            $header = ['Content-Type:application/json'];
-            list($status, $result) = $this->post_helper($url,json_encode($json), $header, 30, $common_array['title'] . "获取token");
-            if(! $status) return [false, $result];
-            if(! isset($result['code'])) return [false, '获取用友登录信息失败,请重新操作'];
-            if($result['code'] != 0) return [false, $result['msg']];
-
-            $token = $result['data']['Token'] ?? "";
-
-            Cache::forever($key, $token);
-        }else{
-            $token = Cache::get($key);
-        }
-
-        return [true, [$host, $token]];
-    }
-
-    public function salesOrderGet($data, $common_array){
-        list($status, $msg) = $this->getToken($common_array);
-        if(! $status) return [false, $msg];
-        list($host, $token) = $msg;
-
-        $today = (new \DateTime())->setTime(0, 0, 0)->format('Y-m-d H:i:s') . '.000';
-        $fourDaysAgo = (new \DateTime())->sub(new \DateInterval('P4D'))->setTime(0, 0, 0)->format('Y-m-d H:i:s') . '.000';
-
-        $page = $data['pageSize'] ?? 10;
-        $version = $data['version'] ?? 0;
-        $start_time = $data['start_time'] ?? $today;
-        $end_time = $data['end_time'] ?? $today;
-        $order_number = $data['order_number'] ?? '';
-
-        $header = ["Authorization: {$token}",'Content-Type:application/json'];
-        $url = $host . "/api/System/SqlQuery";
-        $json = [
-            'customSQLFileName' => "U8SQL",
-            'customSQLPath' => 'U8API/SO_SOMain/Get',
-            'paramObj' => [
-                "@pagesize" => $page,
-                "@where" => "AND m.dDate >= '$start_time' AND m.dDate <= '$end_time'",
-                "@code" => $order_number,
-                "@version" => $version,
-            ]
-        ];
-        $json = json_encode($json);
-
-        list($status, $result) = $this->post_helper($url,$json, $header, 60, $common_array['title'] . '获取销售订单');
-        if(! $status) return [false, $result];
-
-        if(! isset($result['code'])) return [false, '拉取销售订单失败,请重新拉取'];
-        if($result['code'] != 0) return [false, $result['msg']];
-        if(empty($result['data'])) return [true, []];
-
-        $r_data = $result['data'];
-        $return = $this->returnOrders($common_array, $r_data, $msg);
-
-        return [true, $return];
-    }
-
-    private function returnOrders($common_array, $r_data, $msg){
-        $site = $common_array['site'];
-        $title = $common_array['title'];
-        $return = [];
-        if($site == 'LFMY'){
-            foreach ($r_data as $value){
-                list($status, $detail) = $this->getSalesDetail($value, $msg, $title);
-                if(! $status) return [false, $detail];
-                $return_detail = [];
-                $total_qty = $money = 0;
-                foreach ($detail as $d_value){
-                    $return_detail[] = [
-                        'item_no' => $d_value['irowno'],
-                        'material_code' => $d_value['cinvcode'],
-                        'brand_name' => $d_value['cdefine28'] ?? '',
-                        'safe' => $d_value['cdefine29'] ?? '',
-                        'decor' => $d_value['cdefine30'] ?? '',
-                        'craft_type_code' => $d_value['cdefine31'] ?? '',
-                        'decor_b' => $d_value['cdefine32'] ?? '',
-                        'craft_type_code_b' => $d_value['cdefine33'] ?? '',
-                        'unit' => $d_value['cinvm_unit'],
-                        'price' => $d_value['itaxunitprice'] ?? 0,
-                        'not_tax_price' => $d_value['itaxunitprice'] ?? 0,
-                        'tax_price' => $d_value['itaxunitprice'] ?? 0,
-                        'qty' => $d_value['iquantity'],
-                        'money' => $d_value['isum'] ?? 0,
-                        'tax_amount' => $d_value['isum'] ?? 0,
-                        'total_tax_amount' => $d_value['isum'] ?? 0,
-                        'tax_rate' => $d_value['itaxrate'] ?? 0,
-                        'expected_delivery_date' => date('Y-m-d',strtotime($d_value['dpredate'])),
-                        'remark' => $d_value['cmemo'] ?? '',
-                    ];
-                    $t = $d_value['isum'] ?? 0;
-                    $total_qty = bcadd($total_qty,$d_value['iquantity'],3);
-                    $money = bcadd($money,$t,3);
-                }
-
-                $return[] = [
-                    'no' => $value['csocode'],
-                    'order_date' => date("Y-m-d",strtotime($value['ddate'])),
-                    'customer' => $value['ccuscode'] ?? '',
-                    'salesman' => $value['cpersoncode'] ?? '',
-                    'sale_department' => $value['cdepcode'] ?? '',
-                    'total_qty' => $total_qty,
-                    'total_money' => $money,
-                    'remark' => $value['cmemo'] ?? '',
-                    'version' => $value['version'],
-                    'detail' => $return_detail,
-                ];
-            }
-        }elseif ($site == 'HCLT'){
-            foreach ($r_data as $value){
-                list($status, $detail) = $this->getSalesDetail($value, $msg, $title);
-                if(! $status) return [false, $detail];
-                $return_detail = [];
-                $total_qty = $money = 0;
-                foreach ($detail as $d_value){
-                    $return_detail[] = [
-                        'material_code' => $d_value['cinvcode'] ?? '',
-                        'specs' => $d_value['cinvstd'] ?? '',
-                        'unit' => $d_value['cinvm_unit'] ?? '',
-                        'qty' => $d_value['iquantity'],
-                        'not_tax_price' => $d_value['iunitprice'] ?? 0,
-                        'tax_price' => $d_value['itaxunitprice'] ?? 0,
-                        'not_tax_amount' => $d_value['imoney'] ?? 0,
-                        'tax_amount' => $d_value['itax'] ?? 0,
-                        'total_tax_amount' => $d_value['isum'] ?? 0,
-                        'tax_rate' => $d_value['itaxrate'] ?? 0,
-                        'expected_delivery_date' => date('Y-m-d',strtotime($d_value['dpredate'])),
-                        'customer_brand' => $d_value['cfree1'] ?? '',
-                        'color' => $d_value['cfree2'] ?? '',
-                        'plan_no' => $d_value['cdefine22'] ?? '',
-                        'contract_no' => $d_value['cdefine23'] ?? '',
-                        'technical_require' => $d_value['cdefine28'] ?? '',
-                        'quality_require' => $d_value['cdefine29'] ?? '',
-                        'package_require' => $d_value['cdefine30'] ?? '',
-                        'shipping_mark' => $d_value['cdefine31'] ?? '',
-                    ];
-                    $t = $d_value['isum'] ?? 0;
-                    $total_qty = bcadd($total_qty,$d_value['iquantity'],3);
-                    $money = bcadd($money,$t,3);
-                }
-
-                $return[] = [
-                    'no' => $value['csocode'],
-                    'order_date' => date("Y-m-d",strtotime($value['ddate'])),
-                    'customer' => $value['ccuscode'] ?? '',
-                    'salesman' => $value['cpersoncode'] ?? '',
-                    'sale_department' => $value['cdepcode'] ?? '',
-                    'total_qty' => $total_qty,
-                    'total_money' => $money,
-                    'remark' => $value['cmemo'] ?? '',
-                    'version' => $value['version'],
-                    'detail' => $return_detail,
-                ];
-            }
-        }elseif ($site == 'JLWM'){
-            foreach ($r_data as $value){
-                list($status, $detail) = $this->getSalesDetail($value, $msg, $title);
-                if(! $status) return [false, $detail];
-                $return_detail = [];
-                $total_qty = $money = 0;
-                foreach ($detail as $d_value){
-                    $return_detail[] = [
-                        'material_code' => $d_value['cinvcode'] ?? '',
-                        'contract_no' => $d_value['cdefine23'] ?? '',
-                        'specs' => $d_value['cinvstd'] ?? '',
-                        'unit' => $d_value['cinvm_unit'] ?? '',
-                        'qty' => $d_value['iquantity'] ?? '',
-                        'not_tax_price' => $d_value['iunitprice'] ?? 0,
-                        'tax_price' => $d_value['itaxunitprice'] ?? 0,
-                        'not_tax_amount' => $d_value['imoney'] ?? 0,
-                        'tax_amount' => $d_value['itax'] ?? 0,
-                        'total_tax_amount' => $d_value['isum'] ?? 0,
-                        'tax_rate' => $d_value['itaxrate'] ?? 0,
-                        'expected_delivery_date' => date('Y-m-d',strtotime($d_value['dpredate'])),
-                        'customer_model' => $d_value['cfree4'] ?? '',
-                        'length' => $d_value['cfree1'] ?? '',
-                        'width' => $d_value['cfree2'] ?? '',
-                        'thickness' => $d_value['cfree3'] ?? '',
-                        'color_or_model' => $d_value['cdefine28'] ?? '',
-                    ];
-                    $t = $d_value['isum'] ?? 0;
-                    $total_qty = bcadd($total_qty,$d_value['iquantity'],3);
-                    $money = bcadd($money,$t,3);
-                }
-
-                $return[] = [
-                    'no' => $value['csocode'],
-                    'order_date' => date("Y-m-d",strtotime($value['ddate'])),
-                    'customer' => $value['ccuscode'] ?? '',
-                    'salesman' => $value['cpersoncode'] ?? '',
-                    'sale_department' => $value['cdepcode'] ?? '',
-                    'total_qty' => $total_qty,
-                    'total_money' => $money,
-                    'remark' => $value['cmemo'] ?? '',
-                    'version' => $value['version'],
-                    'detail' => $return_detail,
-                ];
-            }
-        }
-
-        return $return;
-    }
-
-    private function SetU8($common_array){
-//        $api_host = env('API_HOST');
-//        if(empty($api_host)) return [false, '用友对外域名不存在'];
-//        $api_port = env('API_PORT');
-//        if(empty($api_port)) return [false, '用友对外域名端口不存在'];
-        $api_host = $common_array['api_host'];
-        $api_port = $common_array['api_port'];
-
-        //映射ip是否通畅
-        $bool = $this->isDomainAvailable($api_host);
-        if(! $bool) return [false, '用友对外域名不可达'];
-        $host = $api_host . ":" . $api_port;
-
-        return [true, $host];
-    }
-
-    private function getSalesDetail($sale_order, $msg, $title){
-        list($host, $token) = $msg;
-
-        $header = ["Authorization: {$token}",'Content-Type:application/json'];;
-        $url = $host . "/api/System/SqlQuery2";
-        $json = [
-            "customSQLFileName"=> "U8SQL",
-            "customSQLPath"=> "U8API/SO_SOMain/GetWithDetail",
-            "paramObj"=> [
-                "@code"=> $sale_order["csocode"]
-            ]
-        ];
-        list($status, $result) = $this->post_helper($url, json_encode($json), $header, 30, $title . '获取销售订单详情');
-        if(! $status) return [false, $result];
-        if(! isset($result['code'])) return [false, '拉取销售订单详情失败,请重新拉取'];
-        if($result['code'] != 0) return [false, $result['msg']];
-        
-        return [true, $result['data']['DataTable1']];
-    }
-
-    public function materialAddU8($data,$common_array){
-        list($status, $msg) = $this->getToken($common_array);
-        if(! $status) return [false, $msg];
-        list($host, $token) = $msg;
-
-        $title = $common_array['title'];
-        if(empty($data['iHead'])) return [false, '领料单表头信息不能为空'];
-        if(empty($data['iBody'])) return [false, '领料单表体信息不能为空'];
-
-        $header = ["Authorization: {$token}",'Content-Type:application/json'];
-        $url = $host . "/api/MaterialRequest/Add";
-        $json[] = [
-            "Inum" => "MaterialRequest",
-            "data" =>[
-                "iHead" => $data['iHead'],
-                "iBody" => $data['iBody'],
-            ],
-        ];
-        $json_str = json_encode($json);
-
-        list($status, $result) = $this->post_helper($url, $json_str, $header, 60, $title . '生成领料申请单');
-        if(! $status) return [false, $result];
-        if(! isset($result['code'])) return [false, '生成领料申请单失败,请重新操作'];
-        if($result['code'] != 0) return [false, $result['msg']];
-
-        return [true, $result['data']];
-    }
-
-    public function productInAddU8($data,$common_array){
-        list($status, $msg) = $this->getToken($common_array);
-        if(! $status) return [false, $msg];
-        list($host, $token) = $msg;
-
-        $title = $common_array['title'];
-        if(empty($data['iHead'])) return [false, '产成品入库单单表头信息不能为空'];
-        if(empty($data['iBody'])) return [false, '产成品入库单表体信息不能为空'];
-
-        $header = ["Authorization: {$token}",'Content-Type:application/json'];;
-        $url = $host . "/api/ProductIn/Add";
-        $json[] = [
-            "Inum" => "ProductIn",
-            "data" =>[
-                "iHead" => $data['iHead'],
-                "iBody" => $data['iBody'],
-            ],
-        ];
-
-        list($status, $result) = $this->post_helper($url, json_encode($json), $header, 60, $title . '生成产成品入库单');
-        if(! $status) return [false, $result];
-        if(! isset($result['code'])) return [false, '生成产成品入库单失败,请重新操作'];
-        if($result['code'] != 0) return [false, $result['msg']];
-
-        return [true, $result['data']];
-    }
-
-    public function dispatchAddU8($data,$common_array){
-        list($status, $msg) = $this->getToken($common_array);
-        if(! $status) return [false, $msg];
-        list($host, $token) = $msg;
-
-        $title = $common_array['title'];
-
-        if(empty($data['iHead'])) return [false, '发货单单表头信息不能为空'];
-        if(empty($data['iBody'])) return [false, '发货单表体信息不能为空'];
-
-        foreach ($data['iBody'] as $key => $value){
-            $data['iBody'][$key] = $this->fillYonyouDispatchDetail($value);
-        }
-
-        $header = ["Authorization: {$token}",'Content-Type:application/json'];;
-        $url = $host . "/api/Dispatch/Add";
-        $json[] = [
-            "Inum" => "DispatchList",
-            "data" =>[
-                "iHead" => $data['iHead'],
-                "iBody" => $data['iBody'],
-            ]
-        ];
-
-        list($status, $result) = $this->post_helper($url, json_encode($json), $header, 60, $title . '生成发货单');
-        if(! $status) return [false, $result];
-        if(! isset($result['code'])) return [false, '生成发货单失败,请重新操作'];
-        if($result['code'] != 0) return [false, $result['msg']];
-
-        return [true, $result['data']];
-    }
-
-    public function recordList($data){
-        $model = RecordTable::where('del_time',0)
-            ->select('msg','data','type','crt_time','return_data')
-            ->orderBy('id','desc');
-
-        if(! empty($data['crt_time'][0]) && ! empty($data['crt_time'][1])) $model->whereBetween('crt_time',[$data['crt_time'][0],$data['crt_time'][1]]);
-        if(! empty($data['type'])) $model->where('type',$data['type']);
-        if(! empty($data['site'])) $model->where('site',$data['site']);
-
-        $list = $this->limit($model,'',$data);
-        $list = $this->fillData($list);
-
-        return [true,$list];
-    }
-
-    private function fillData($data){
-        if(empty($data['data'])) return $data;
-
-        foreach ($data['data'] as $key => $value){
-            $data['data'][$key]['crt_time'] = $value['crt_time'] ? date('Y-m-d H:i:s',$value['crt_time']) : '';
-            $data['data'][$key]['type_name'] = RecordTable::$type[$value['type']] ?? '';
-        }
-
-        return $data;
-    }
-    /**
-     * 补全用友发货单子表金额字段(含换算率)
-     * 输入示例:
-     * [
-     *   'iQuantity'     => 1,     // 输入单位数量
-     *   'iunitprice'    => 10,    // 无税单价(按主计量单位)
-     *   'iTaxRate'      => 0,     // 税率
-     *   'iInvExchRate'  => 12     // 换算率(1箱=12个)
-     * ]
-     */
-    function fillYonyouDispatchDetail(array $item)
-    {
-        $qty       = floatval($item['iQuantity']);
-        $price     = floatval($item['iunitprice']);
-        $rate      = floatval($item['iTaxRate']);
-        $exchRate  = floatval($item['iInvExchRate']);
-
-        // 实际参与金额计算的基本数量(用友内部用这个)
-        $qtyBase = $qty * $exchRate;
-
-        // 税率
-        $taxRate = $rate / 100;
-
-        // 原币(人民币)
-        $imoney = round($qtyBase * $price, 2);
-        $itax   = round($imoney * $taxRate, 2);
-        $iSum   = round($imoney + $itax, 2);
-
-        $itaxunitprice = round($price * (1 + $taxRate), 6);
-
-        // 本币 = 原币
-        return array_merge($item, [
-            'imoney'          => $imoney,
-            'itax'            => $itax,
-            'iSum'            => $iSum,
-            'itaxunitprice'   => $itaxunitprice,
-            'idiscount'       => 0,
-            'inatunitprice'   => $price,
-            'inatmoney'       => $imoney,
-            'inattax'         => $itax,
-            'inatsum'         => $iSum,
-            'inatdiscount'    => 0,
-        ]);
-    }
-
-    //-----------------------------------朗峰u8-----
-    public function post_helper($url, $data, $header = [], $timeout = 20, $title = ""){
-        Log::channel('apiLog')->info($title . 'POST', ["api" => $url , "param" => json_decode($data,true) ,"header" => $header]);
-
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_ENCODING, '');
-        curl_setopt($ch, CURLOPT_POST, 1);
-        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
-
-        if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-
-            Log::channel('apiLog')->info($title . 'POST结果', ["message" => $message ]);
-            return [false, $message];
-        }
-        curl_close($ch);
-
-        Log::channel('apiLog')->info($title . 'POST结果', ["message" => json_decode($r, true) ]);
-        return [true, json_decode($r, true)];
-    }
-
-    public function get_helper($url,$header=[],$timeout = 20){
-        $ch = curl_init();
-        curl_setopt_array($ch, array(
-            CURLOPT_URL => $url,
-            CURLOPT_RETURNTRANSFER => true,
-            CURLOPT_ENCODING => '',
-            CURLOPT_MAXREDIRS => 10,
-            CURLOPT_TIMEOUT => $timeout,
-            CURLOPT_FOLLOWLOCATION => true,
-            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-            CURLOPT_CUSTOMREQUEST => 'GET',
-            CURLOPT_SSL_VERIFYPEER => false,
-            CURLOPT_HTTPHEADER => $header,
-        ));
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-            Log::channel('apiLog')->info('朗峰GET结果', ["message" => $message]);
-            return [false, $message];
-        }
-
-        curl_close($ch);
-        Log::channel('apiLog')->info('朗峰GET结果', ["message" => json_decode($r, true)]);
-
-        return [true, json_decode($r, true)];
-    }
-
-    public function put_helper($url, $data, $header = [], $timeout = 20){
-        Log::channel('apiLog')->info('朗峰PUT', ["api" => $url , "param" => $data ,"header" => $header]);
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_ENCODING, '');
-        curl_setopt($ch, CURLOPT_POST, 1);
-        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
-
-        if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
-        $r = curl_exec($ch);
-
-        if ($r === false) {
-            // 获取错误号
-            $errorNumber = curl_errno($ch);
-            // 获取错误信息
-            $errorMessage = curl_error($ch);
-            $message = "cURL Error #{$errorNumber}: {$errorMessage}";
-
-            Log::channel('apiLog')->info('朗峰PUT结果', ["message" => $message]);
-            return [false, $message];
-        }
-        curl_close($ch);
-
-        Log::channel('apiLog')->info('朗峰PUT结果', ["message" => json_decode($r, true)]);
-
-        return [true, json_decode($r, true)];
-    }
-}

+ 0 - 62
app/Service/TokenService.php

@@ -1,62 +0,0 @@
-<?php
-
-namespace App\Service;
-
-use Firebase\JWT\JWT;
-use Firebase\JWT\Key;
-
-class TokenService
-{
-    const key = "jf2.0"; //签发人  可空
-    const validity = 8640000; //有效期
-    const error = [
-        -1 => "签名不正确",
-        -2 => "签名在某个时间点之后才能用",
-        -3 => "签名过期,重新登录",
-        -4 => "未知错误"
-    ];
-
-    /**
-     * Created by PhpStorm.
-     * User: Administrator
-     * Date: 2023/3/13
-     * Time: 16:43
-     * 获取token(登录以后)
-     */
-    public static function getToken($userId) :string{
-        $token = array(
-            "iat"=> time(), //签发时间
-            "nbf"=> time() - 1, //生效时间  (立即生效)
-            "exp"=> time() + TokenService::validity,
-            "data"=> [
-                'user_id' => $userId
-            ]
-        );
-        return JWT::encode($token,TokenService::key,"HS256");
-    }
-
-    /**
-     * Created by PhpStorm.
-     * User: Administrator
-     * Date: 2023/3/13
-     * Time: 16:52
-     * 解密token
-     */
-    public static function verifyToken($token){
-        try {
-            JWT::$leeway = 60;//当前时间减去60,把时间留点余地,同步其他服务器时间,解决nbf字段验证不通过问题
-            $decoded = JWT::decode($token,new Key(TokenService::key, "HS256")); //HS256方式,这里要和签发的时候对应
-
-            $arr = (array)$decoded;
-            return $arr['data']->user_id;
-        } catch (\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
-            return -1;
-        } catch (\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
-            return -2;
-        } catch (\Firebase\JWT\ExpiredException $e) { // token过期
-            return -3;
-        } catch (\Exception $e) { //其他错误
-            return -4;
-        }
-    }
-}

+ 0 - 68
app/Service/Weixin/WeixinService.php

@@ -1,68 +0,0 @@
-<?php
-
-namespace App\Service\Weixin;
-
-use App\Service\Service;
-use Illuminate\Support\Facades\Redis;
-
-class WeixinService extends Service
-{
-    const APPID = '';
-    const APPSECRET = '';
-    const ACCESS_URL = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s';
-    const OPENID = '';
-    const TOKEN = '';
-    const KEY = 'weixingzy';
-
-    public function getToken(){
-        $token_key = self::KEY.'_'.'token';
-        $token = Redis::get($token_key);
-        if(! $token){
-            $url = sprintf(self::ACCESS_URL,self::APPID,self::APPSECRET);
-            $res = $this->curlOpen($url);
-            $res = json_decode($res,true);
-            if(isset($res['errmsg'])) return [false,$res['errmsg']];
-            if(!isset($res['access_token'])) return [false,'request error'];
-            $token = $res['access_token'];
-            $expire_time = $res['expires_in']-300;
-            Redis::set($token_key,$token);
-            Redis::expire($token_key, $expire_time);
-            return [true,$token];
-        }
-        return [true,$token];
-    }
-
-    public function getOpenid($data){
-        if(empty($data['code'])) return [false, 'code不能为空'];
-        $code = $data['code'];
-        $url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code';
-        $url = sprintf($url,self::APPID,self::APPSECRET,$code);
-        $res = $this->curlOpen($url);
-        $res = json_decode($res,true);
-        if(!isset($res['openid'])) return [false,$res['errmsg']??'request error'];
-        $openid = $res['openid'];
-        return [true,['openid' => $openid]];
-    }
-
-    public function setWebHook($data){
-        $uri = isset($data['uri']) ? $data['uri'] : '';
-        $url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
-        $param = isset($data['param']) ? $data['param'] : '';
-        $redirect_uri = urlencode('https://t9api.qingyaokeji.com/wxapi/getUnionid?uri='.$uri.'&param='.$param);
-        $url = sprintf($url,self::APPID,$redirect_uri);
-        header("Location:".$url);exit;
-        echo 'ok';die;
-    }
-
-    public function getUnionid($data){
-        if(isset($data['code'])) {
-            list($status,$openid) = $this->getOpenid($data);
-            if(!$status) return [false,$openid];
-            $uri = $data['uri'];
-            $openid = $openid['openid'];
-            $param = isset($data['param']) ? $data['param'] : '';
-            $url = 'https://t9.qingyaokeji.com/#/wxGet?uri='.$uri.'&openid='.$openid.'&param='.$param;
-            header('Location:'.$url);exit();
-        }
-    }
-}

+ 0 - 30
config/asset.php

@@ -1,30 +0,0 @@
-<?php
-//状态码
-return [
-    //登录标识
-    'login_redis_topic' => 'ASSETLOGIN',
-    //登录过期时间
-    'login_expire_time' => 3600, // 3600
-    //登录
-    'login' => 'http://bpmjiuyunfang.net/ibl/api/login/?allowanonymous=true',
-    //盘点单列表
-    'pdList' => 'http://bpm.jiuyunfang.net/jbl/api/module-data/tourism_inventory_sheet_list/page',
-    //获取单个盘点单管理详情
-    'pdDetail' => 'http://bpm.jiuyunfang.net/jbl/api/module-data/tourism_inventory_sheet/tourism_inventory_sheet/611847814397710337/',
-    //更新盘点单
-    'updatePd' => 'http://bpm.jiuyunfang.net/jbl/api/module-data/tourism_inventory_sheet/tourism_inventory_sheet/diy/update_inventory',
-    //创建固定资产借用单
-    'create_fixed_borrow' => 'http://bpm.jiuyunfang.net/jbl/api/module-data/tourism_base_fixed_borrow/tourism_base_fixed_borrow/diy/create_fixed_borrow',
-    //固定资产查询
-    'base_fixed_query' => 'http://bpm.jiuyunfang.net/jbl/api/module-data/base_fixed_query/page',
-    //创建固定资产归还单
-    'create_fixed_return' => 'http://bpm.jiuyunfang.net/jbl/api/module-data/tourism_base_fixed_return/tourism_base_fixed_return/diy/create_fixed_return',
-    //人员查询 get
-    'manList' => 'http://bpm.jiuyunfang.net/jbl/api/person?propertyNames=user.userTypeDk&propertyNames=statusDk-notEq&propertyValues=INNER_USER&propertyValues=DEPARTURE',
-    //分部查询接口 post
-    'fbList' => 'http://bpm.jiuyunfang.net/jbl/api/module-data/company_code/page',
-    //部门 get
-    'bmList' => 'http://bpm.jiuyunfang.net/jbl/api/department?',
-    //固定资产借用单查询
-    'tourism_base_fixed_borrow_list' => 'http://bpm.jiuyunfang.net/jbl/api/module-data/tourism_base_fixed_borrow_dt_list/page ',
-];

+ 0 - 8
config/ip.php

@@ -1,8 +0,0 @@
-<?php
-//状态码
-return [
-    'cs' => 'http://121.36.142.167:7774/', //测试
-    'zs' => 'http://122.112.250.253:7774/', //正式
-    'zslf' => 'https://gzy.qingyaokeji.com/', //正式朗峰
-    'zslfip' => 'http://120.27.218.142:7784/', //正式朗峰
-];

+ 0 - 86
config/j_rfid.php

@@ -1,86 +0,0 @@
-<?php
-//状态码
-return [
-    //登录标识
-    'login_redis_topic' => 'JRFIDLOGIN',
-    //登录过期时间
-    'login_expire_time' => 3600, // 3600
-    //登录
-    'login' => 'https://gzy.qingyaokeji.com/jbl/api/mes/login',
-    //站点获取
-    'site' => 'https://gzy.qingyaokeji.com/jbl/api/site/all/ignore-action?_allow_anonymous=true',
-    //站点获取 登录后的
-    'site2' => 'https://gzy.qingyaokeji.com/api/site/get-by-login',
-    //工艺流程单查询
-    'get_flow_by_produce' => 'https://gzy.qingyaokeji.com/api/module-data/process_flow/process_flow/diy/get_flow_by_produce',
-    //生产订单查询接口
-    'get_produce_by_contract' => 'https://gzy.qingyaokeji.com/api/module-data/produce_order/produce_order/diy/get_produce_by_contract',
-    //打印数据获取接口
-    'get_print_data' => 'https://gzy.qingyaokeji.com/api/module-data/process_flow/process_flow/diy/get_process_data',
-    //查询拆单以及拆单详情分页数据
-    'get_sep_order_dt_data' => 'https://gzy.qingyaokeji.com/api/module-data/separate_order/separate_order/diy/get_sep_order_dt_data',
-    //(批量派工单—查询合同编号,图号,房间号、工序)
-    'get_dispatch_contract_draw_room' => 'https://gzy.qingyaokeji.com/api/module-data/sales_order/sales_order/diy/get_dispatch_contract_draw_room',
-    //班组查询
-    'get_team' => 'https://gzy.qingyaokeji.com/api/module-data/teams_group_list/page',
-    //部门查询
-    'get_depart' => 'https://gzy.qingyaokeji.com/api/module-data/department_list/page',
-    //工序分类查询
-    'get_procedure_class' => 'https://gzy.qingyaokeji.com/api/module-data/procedure_calss_list/page',
-    //完工
-    'completion_orders' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_completed',
-    //(扫码完工)
-    'scanScreenCompleted' => 'https://gzy.qingyaokeji.com/api/module-data/furn_dispatch_order_dt/furn_dispatch_order_dt/diy/screen_completed',
-    //(根据芯片id、type、合同号、图号、工序查询派工单及其详情数据)
-    'screen_get_dispatch_dt_data' => 'https://gzy.qingyaokeji.com/api/module-data/furn_dispatch_order_dt/furn_dispatch_order_dt/diy/screen_get_dispatch_dt_data',
-    //质检
-    'quality_orders' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_quality',
-    //打印
-    'screen_print' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_print',
-    //打印芯片—修改拆单及详情打印信息
-    'screen_print_sep_data' => 'https://gzy.qingyaokeji.com/api/module-data/furn_separate_order_dt/furn_separate_order_dt/diy/screen_print_sep_data',
-    //(查询合同号、图号、房间号)
-    'get_contract_draw_room' => 'https://gzy.qingyaokeji.com/api/module-data/sales_order/sales_order/diy/get_contract_draw_room',
-    //(根据合同号、图号、房间号查询工艺流程单数据)
-    'screen_get_pro_flow' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_get_pro_flow',
-    //收发货
-    'screen_send' => 'https://gzy.qingyaokeji.com/api/module-data/send_and_receipt/send_and_receipt/diy/screen_send',
-    //包装
-    'screen_package' => 'https://gzy.qingyaokeji.com/api/module-data/package/package/diy/screen_package',
-    //(根据合同号、图号、房间号查询包装单数据)
-    'screen_get_package_data' => 'https://gzy.qingyaokeji.com/api/module-data/package/package/diy/screen_get_package_data',
-    //(查询工艺流程单详情信息)
-    'screenGetProDtData' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_get_pro_dt_data',
-    //根据组件id、type和合同号查询工艺流程单详情数据
-    'screenGetPackageAssem' => 'https://gzy.qingyaokeji.com/api/module-data/furn_process_flow_dt/process_flow_dt/diy/screen_get_package_assem',
-    //生产进度汇总报表
-    'furn_produce_schedule_list' => 'https://gzy.qingyaokeji.com/api/module-data/furn_produce_schedule_list/page',
-    //拆单详情组件查询
-    'furn_separate_order_dt_assem_list' => 'https://gzy.qingyaokeji.com/api/module-data/furn_separate_order_dt_assem_list/page',
-    //包装—拆单详情组件
-    'screen_package_by_sep_assem' => 'https://gzy.qingyaokeji.com/api/module-data/package/package/diy/screen_package_by_sep_assem',
-    //工位屏-根据芯片查询包装单组件数据
-    'screenGetPackageAssemData' => 'https://gzy.qingyaokeji.com/api/module-data/furn_package_dt/furn_package_dt/diy/screen_get_package_assem_data',
-    //工位屏-保存收货单
-    'screenReceipt' => 'https://gzy.qingyaokeji.com/api/module-data/furn_receipt_order/furn_receipt_order/diy/screen_receipt',
-    //发货单查询列表
-    'sendAndReceiptList' => 'https://gzy.qingyaokeji.com/api/module-data/send_and_receipt_list/page',
-    //发货单详情组件列表
-    'sendOrderDtAssemList' => 'https://gzy.qingyaokeji.com/api/module-data/send_order_dt_assem_list/page',
-    //包装单列表
-    'packageList' => 'https://gzy.qingyaokeji.com/api/module-data/package_list/page',
-    //没有查询到的派工单详情数据自动生成
-    'screenAutoCreateDispatch' => 'https://gzy.qingyaokeji.com/api/module-data/furn_dispatch_order_dt/furn_dispatch_order_dt/diy/screen_auto_create_dispatch',
-    //根据芯片id查找拆单相关数据
-    'screenGetSepData' => 'https://gzy.qingyaokeji.com/api/module-data/furn_separate_order_dt/furn_separate_order_dt/diy/screen_get_sep_data',
-    //拆单产品、组件、部件查询列表
-    'furnSeparateOrderCompList' => 'https://gzy.qingyaokeji.com/api/module-data/furn_separate_order_comp_list/page',
-    //拆单详情产品、组件、部件查询列表
-    'furnSeparateOrderDtCompList' => 'https://gzy.qingyaokeji.com/api/module-data/furn_separate_order_dt_comp_list/page',
-    //查询车间数据(合同号、区域、房号、图号、组件、部件)
-    'getWorkshopData' => 'https://gzy.qingyaokeji.com/api/module-data/separate_order/separate_order/diy/get_workshop_data',
-    //查询发货数据(合同号、发货单号、房号、图号、组件、部件)
-    'screenGetSendData' => 'https://gzy.qingyaokeji.com/api/module-data/send_and_receipt/send_and_receipt/diy/screen_get_send_data',
-    //发货单详情部件列表
-    'furnSendOrderDtCompList' => 'https://gzy.qingyaokeji.com/api/module-data/furn_send_order_dt_comp_list/page ',
-];

+ 0 - 50
config/maycur.php

@@ -1,50 +0,0 @@
-<?php
-//状态码
-return [
-    //测试
-    'cs_url' => 'https://ng-uat.maycur.com',
-    //正式
-    'zs_url' => 'https://ng.maycur.com',
-    //钉钉云
-    'dd_url' => 'https://dt.maycur.com',
-    //登录标识
-    'login_redis_topic' => 'MAYCURLOGIN',
-    //登录过期时间
-    'login_expire_time' => 1750, // 1800
-    //登录
-    'login' => '/api/openapi/auth/login',
-    //报销单
-    'reimburse' => '/api/openapi/form/v2/reimburse',
-    //报销单详情
-    'reimburseDetail' => '/api/openapi/form/reimburse/detail',
-    //借款单
-    'loan' => '/api/openapi/form/v2/loan',
-    //借款单详情
-    'loanDetail' => '/api/openapi/form/loan/',
-    //往来单位
-    'tradingPartner' =>  '/api/openapi/tradingPartner/list/V2',
-    //部门
-    'department' => '/api/openapi/org/department/search/v2',
-    //每刻凭证档案测试环境
-    'voucher_cs' => [
-        'ip' => "http://47.96.72.143:18880",
-        'appkey' => "voucher",
-        'appsecret' => "wGt5VL422YETsNlPvHrhVUwW",
-        'login' => '/open/auth/login',
-        //凭证接口过期时间
-        'login_expire_time' => 1150, // 1200
-        //凭证批量同步
-        'voucher_insert' => '/open/voucher/v3/',
-    ],
-    //每刻凭证档案正式环境
-    'voucher_zs' => [
-        'ip' => "http://47.96.72.143:28080",
-        'appkey' => "pordvoucher",
-        'appsecret' => "d9TT2la0Df1Xz8CODacMqsdi",
-        'login' => '/open/auth/login',
-        //凭证接口过期时间
-        'login_expire_time' => 1150, // 1200
-        //凭证批量同步
-        'voucher_insert' => '/open/voucher/v3/',
-    ],
-];

+ 0 - 16
config/u.php

@@ -1,16 +0,0 @@
-<?php
-//状态码
-return [
-    "LFMY" => [
-        'api_host' => 'samata2924.imwork.net',
-        'api_port' => '47438',
-    ],
-    "HCLT" => [
-        'api_host' => '1ag17727201hq.vicp.fun',
-        'api_port' => '46227',
-    ],
-    "JLWM" => [
-        'api_host' => '1wz1796225me1.vicp.fun',
-        'api_port' => '42860',
-    ],
-];

+ 0 - 33
routes/asset.php

@@ -1,33 +0,0 @@
-<?php
-
-use Illuminate\Http\Request;
-
-/*
-|--------------------------------------------------------------------------
-| API Routes
-|--------------------------------------------------------------------------
-|
-| Here is where you can register API routes for your application. These
-| routes are loaded by the RouteServiceProvider within a group which
-| is assigned the "api" middleware group. Enjoy building your API!
-|
-*/
-
-Route::middleware('auth:api')->get('/user', function (Request $request) {
-    return $request->user();
-});
-
-Route::any('login', 'Api\LoginController@assetlogin');
-
-Route::group(['middleware'=> ['CheckAssetLogin']],function ($route){
-    $route->any('inventoryList', 'Api\AssetController@pdList');
-    $route->any('inventoryDetail', 'Api\AssetController@pdDetail');
-    $route->any('inventoryUpdate', 'Api\AssetController@pdUpdate');
-    $route->any('createFixedBorrow', 'Api\AssetController@createFixedBorrow');
-    $route->any('baseFixedQuery', 'Api\AssetController@baseFixedQuery');
-    $route->any('createFixedReturn', 'Api\AssetController@createFixedReturn');
-    $route->any('manList', 'Api\AssetController@manList');
-    $route->any('bmList', 'Api\AssetController@bmList');
-    $route->any('fbList', 'Api\AssetController@fbList');
-    $route->any('tourismBaseFixedBorrowList', 'Api\AssetController@tourismBaseFixedBorrowList');
-});

+ 0 - 24
routes/maycur.php

@@ -1,24 +0,0 @@
-<?php
-
-use Illuminate\Http\Request;
-
-/*
-|--------------------------------------------------------------------------
-| API Routes
-|--------------------------------------------------------------------------
-|
-| Here is where you can register API routes for your application. These
-| routes are loaded by the RouteServiceProvider within a group which
-| is assigned the "api" middleware group. Enjoy building your API!
-|
-*/
-
-Route::middleware('auth:api')->get('/user', function (Request $request) {
-    return $request->user();
-});
-
-//Route::any('getToken', 'Api\MayCurController@getToken');
-Route::any('reimburse', 'Api\MayCurController@reimburse');
-Route::any('loan', 'Api\MayCurController@loan');
-Route::any('voucher', 'Api\MayCurController@voucher');
-Route::any('saveOaData', 'Api\MayCurController@saveOaData');

+ 0 - 16
routes/web.php

@@ -1,16 +0,0 @@
-<?php
-
-/*
-|--------------------------------------------------------------------------
-| Web Routes
-|--------------------------------------------------------------------------
-|
-| Here is where you can register web routes for your application. These
-| routes are loaded by the RouteServiceProvider within a group which
-| contains the "web" middleware group. Now create something great!
-|
-*/
-
-Route::get('/', function () {
-    return view('welcome');
-});

+ 0 - 26
routes/weixin.php

@@ -1,26 +0,0 @@
-<?php
-
-/*
-|--------------------------------------------------------------------------
-| Web Routes
-|--------------------------------------------------------------------------
-|
-| Here is where you can register web routes for your application. These
-| routes are loaded by the RouteServiceProvider within a group which
-| contains the "web" middleware group. Now create something great!
-|
-*/
-
-Route::any('weixin', 'Api\WeixinController@weixin');
-Route::any('test', 'Api\WeixinController@test');
-Route::any('setWebHook', 'Api\WeixinController@setWebHook');
-Route::any('getUnionid', 'Api\WeixinController@getUnionid');
-
-Route::any('getOpenid', 'Api\WeixinController@getOpenid');
-Route::any('wxSetUser', 'Api\WeixinController@setUser');
-Route::any('wxLogin', 'Api\WeixinController@login');
-
-Route::group(['middleware'=> ['checkWeixin']],function ($route){
-    //生产进度报表
-    $route->any('furnProduceScheduleList', 'Api\JRFIDController@furnProduceScheduleList');
-});

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini