Просмотр исходного кода

Merge branch 'collector_11_11_liu'

rkljw 4 месяцев назад
Родитель
Сommit
ed9e3f9cf1

+ 9 - 3
.env

@@ -11,9 +11,15 @@ DB_CHARSET=utf8mb4
 DB_COLLATION=utf8mb4_unicode_ci
 DB_PREFIX=
 
-REDIS_HOST=101.254.114.211
-REDIS_AUTH=YPWWnFnNebc7427B
-REDIS_PORT=26739
+#REDIS_HOST=101.254.114.211
+#REDIS_AUTH=YPWWnFnNebc7427B
+#REDIS_PORT=26739
+#REDIS_DB=0
+
+
+REDIS_HOST=192.168.1.201
+REDIS_AUTH=
+REDIS_PORT=6379
 REDIS_DB=0
 
 AMQP_HOST=103.105.201.2

+ 39 - 3
app/Controller/CollectorController.php

@@ -11,6 +11,8 @@ use App\Tools\Result;
 use Hyperf\Validation\Contract\ValidatorFactoryInterface;
 use App\Constants\ErrorCode;
 use Hyperf\Context\Context;
+use App\Service\GatherQueueService;
+use App\Service\ImportQueueService;
 /**
  * ClassCollectorController
  * @package App\Controller
@@ -20,7 +22,10 @@ class CollectorController extends AbstractController
 {
     #[Inject]
     protected ValidatorFactoryInterface $validationFactory;
-
+    #[Inject]
+    protected GatherQueueService $Gservice;
+    #[Inject]
+    protected ImportQueueService $Iservice;
 
     /**
      * @var CollectorServiceInterface
@@ -102,14 +107,45 @@ class CollectorController extends AbstractController
 
 
     /**
+     * 采集动作
      * @return array
      */
     public function sendCrawler()
     {
+        $data = [];
+        $data['admin_user_id'] = Context::get("UserId");
+        $data['time'] = microtime();
         $requireData = $this->request->all();
-        $result = $this->collectorServiceClient->sendCrawler($requireData);
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'id'=> 'required',
+            ],
+            [
+                'id.required' => '规则id不能为空',
+            ]
+        );
+        if ($validator->fails()) {
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+//        $b  = $this->Iservice->push($data,1);
+        $data['id'] = $requireData['id'];
+        $result = $this->Gservice->push($data,3);
+        return Result::success($result);
+
+    }
 
-        return $result?Result::success($result['data']):Result::error($result['message']);
+    /**
+     * 发送请求
+     * @param $data
+     * @return array
+     */
+    public function goSendCrawler($data=[])
+    {
+        var_dump("我要开始采集了!!!");
+        $this->collectorServiceClient->sendCrawler($data);
+        return Result::success([]);
     }
 
 

+ 47 - 9
app/Controller/PublicController.php

@@ -68,7 +68,7 @@ class PublicController extends AbstractController
             if ($file == null) {
                 return Result::error("未找到上传文件");
             }
-            $data = CommonService::uploadFile($file, ['png', 'jpg', 'png', 'jpeg', 'gif', 'xls', 'xlsx', 'pdf', 'xls', 'xlsx', 'doc', 'docx', 'ppt', 'zip', 'pptx', 'mp4', 'flv'], 'image');
+            $data = CommonService::uploadFile($file, ['png', 'jpg', 'jpeg', 'gif', 'xls', 'xlsx', 'pdf', 'doc', 'docx', 'ppt', 'zip', 'pptx', 'mp4', 'flv','rar','tar'], 'image');
 
             $data['imgUrl'] = $urlN->imgUrl($data['src']);
             $data['oldFileName'] = $fileName;
@@ -173,22 +173,18 @@ class PublicController extends AbstractController
             [
                 'title' => 'required',
                 'nature' => 'required',
-                'nature_level' => 'required',
-                'type' => 'required',
+                'nature_level0' => 'required',
                 'name' => 'required',
                 'mobile' => 'required',
                 'describe' => 'required',
-                'type_level' => 'required',
             ],
             [
                 'title.required' => '标题不能为空',
-                'nature.required' => '性质不能为空',
-                'nature_level.required' => '进度不能为空',
-                'type.required' => '类型不能为空',
+                'nature.required' => '类型不能为空',
+                'nature_level0.required' => '类型进度不能为空',
                 'name.required' => '姓名不能为空',
                 'mobile.required' => '手机号码不能为空',
                 'describe.required' => '详细说明不能为空',
-                'type_level.required' => '类型进度不能为空',
             ]
         );
         if ($validator->fails()) {
@@ -242,11 +238,15 @@ class PublicController extends AbstractController
 
         $requireData = $this->request->all();
         $requireData['user_id'] = Context::get("UserId");
-        var_dump("用户id:", Context::get("UserId"));
         if (isset($requireData['is_admin']) && !empty($requireData['is_admin'])) {
             unset($requireData['user_id']);
         }
         $result = $this->publicServiceClient->getLetterOfComplaint($requireData);
+        if($result['code']==200){
+            foreach ($result['data']['rows']as $key=>$val){
+                $result['data']['rows'][$key]['created_at'] = date("Y-m-d",strtotime($val['created_at']));
+            }
+        }
         return $result ? Result::success($result['data']) : Result::error($result['message']);
     }
 
@@ -293,11 +293,49 @@ class PublicController extends AbstractController
     public function getLetterType()
     {
         $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'type' => 'required',
+            ],
+            [
+                'type.required' => '类型不能为空',
+            ]
+        );
+        if ($validator->fails()) {
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
         $result = $this->publicServiceClient->getLetterType($requireData);
         $rep = PublicData::buildMenuTree($result['data']);
         return $rep ? Result::success($rep) : Result::error("查询失败");
     }
 
+    /**
+     * @return array
+     */
+    public function getLetterTypeChildren()
+    {
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+            $requireData,
+            [
+                'type' => 'required',
+                'pid' => 'required',
+            ],
+            [
+                'type.required' => '类型不能为空',
+                'pid.required' => 'PID不能为空',
+            ]
+        );
+        if ($validator->fails()) {
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        $result = $this->publicServiceClient->getLetterType($requireData);
+        return $result['code']==200 ? Result::success($result['data']) : Result::error("查询失败");
+    }
+
     public function downloadFile(RequestInterface $request, ResponseInterface $response)
     {
         //验证是否有传参数

+ 39 - 0
app/Job/GatherExampleJob.php

@@ -0,0 +1,39 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Job;
+
+use Hyperf\AsyncQueue\Job;
+use App\Controller\CollectorController;
+/**
+ * @Job(name="default")
+ */
+class GatherExampleJob extends Job
+{
+    public $params;
+
+    /**
+     * 任务执行失败后的重试次数,即最大执行次数为 $maxAttempts+1 次
+     */
+    protected int $maxAttempts = 2;
+
+    public function __construct($params)
+    {
+        // 这里最好是普通数据,不要使用携带 IO 的对象,比如 PDO 对象
+        $this->params = $params;
+    }
+
+
+    public function handle()
+    {
+        try {
+            var_dump("消费者");
+            $collector = new CollectorController();
+            $result = $collector->goSendCrawler($this->params);
+            var_dump("消费消息队列:",$this->params,$result);
+        }catch (\Exception $e){
+            var_dump($e->getMessage());
+        }
+    }
+}

+ 35 - 0
app/Job/ImportExampleJob.php

@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Job;
+use Hyperf\AsyncQueue\Job;
+use App\Controller\CollectorController;
+class ImportExampleJob extends Job
+{
+
+    public $params;
+    /**
+     * 任务执行失败后的重试次数,即最大执行次数为 $maxAttempts+1 次
+     */
+    protected int $maxAttempts = 3;
+
+    public function __construct($params)
+    {
+        // 这里最好是普通数据,不要使用携带 IO 的对象,比如 PDO 对象
+        $this->params = $params;
+    }
+    public function handle()
+    {
+        try {
+            //冯蕊自己修改
+            $collector = new CollectorController();
+            $result = $collector->goSendCrawler($this->params);
+            var_dump("消费消息队列:",$this->params,$result);
+        }catch (\Exception $e){
+            var_dump($e->getMessage());
+        }
+
+    }
+
+}

+ 3 - 2
app/Middleware/Auth/FooMiddleware.php

@@ -37,7 +37,8 @@ class FooMiddleware implements MiddlewareInterface
 
         $header = $request->getHeaders();
         try {
-            if($header &&  isset($header['token']) && $header['token'][0]!='null' && isset($header['token'][0])){
+            if($header &&  isset($header['token']) && $header['token'][0]!='null' && $header['token'][0]!='' && isset($header['token'][0])){
+                var_dump("token类型:",$header['token'][0]);
                 $ver = $this->JWT->getClaimsByToken($header['token'][0]);
                 $tokenTime =  $this->JWT->getTokenDynamicCacheTime($header['token'][0]);
                 if($tokenTime==0){
@@ -66,7 +67,7 @@ class FooMiddleware implements MiddlewareInterface
             }
 
         }catch (\Exception $e){
-            var_dump("错误消息:",$e->getMessage(),$e->getCode());
+            var_dump("错误消息1:",$e->getMessage(),$e->getCode());
             return $this->response->json(
                 [
                     'code' => $e->getCode(),

+ 14 - 0
app/Process/AsyncQueueConsumer.php

@@ -0,0 +1,14 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Process;
+
+use Hyperf\AsyncQueue\Process\ConsumerProcess;
+use Hyperf\Process\Annotation\Process;
+#[Process]
+class AsyncQueueConsumer extends ConsumerProcess
+{
+    protected string $queue = 'import';
+
+}

+ 34 - 0
app/Service/GatherQueueService.php

@@ -0,0 +1,34 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Service;
+
+use App\Job\GatherExampleJob;
+use Hyperf\AsyncQueue\Driver\DriverFactory;
+use Hyperf\AsyncQueue\Driver\DriverInterface;
+/**
+ * @Job(name="default")
+ */
+class GatherQueueService
+{
+    protected DriverInterface $driver;
+
+    public function __construct(DriverFactory $driverFactory)
+    {
+        $this->driver = $driverFactory->get('default');
+    }
+
+    /**
+     * 生产消息.
+     * @param $params 数据
+     * @param int $delay 延时时间 单位秒
+     */
+    public function push($params, int $delay = 0): bool
+    {
+        // 这里的 `ExampleJob` 会被序列化存到 Redis 中,所以内部变量最好只传入普通数据
+        // 同理,如果内部使用了注解 @Value 会把对应对象一起序列化,导致消息体变大。
+        // 所以这里也不推荐使用 `make` 方法来创建 `Job` 对象。
+        return $this->driver->push(new GatherExampleJob($params), $delay);
+    }
+}

+ 32 - 0
app/Service/ImportQueueService.php

@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Service;
+
+use App\Job\ImportExampleJob;
+use Hyperf\AsyncQueue\Driver\DriverFactory;
+use Hyperf\AsyncQueue\Driver\DriverInterface;
+
+class ImportQueueService
+{
+    protected DriverInterface $driver;
+
+    public function __construct(DriverFactory $driverFactory)
+    {
+        $this->driver = $driverFactory->get('import');
+    }
+
+    /**
+     * 生产消息.
+     * @param $params 数据
+     * @param int $delay 延时时间 单位秒
+     */
+    public function push($params, int $delay = 0): bool
+    {
+        // 这里的 `ExampleJob` 会被序列化存到 Redis 中,所以内部变量最好只传入普通数据
+        // 同理,如果内部使用了注解 @Value 会把对应对象一起序列化,导致消息体变大。
+        // 所以这里也不推荐使用 `make` 方法来创建 `Job` 对象。
+        return $this->driver->push(new ImportExampleJob($params), $delay);
+    }
+}

+ 2 - 1
composer.json

@@ -17,6 +17,7 @@
         "doctrine/annotations": "^2.0",
         "easyswoole/verifycode": "3.x",
         "hyperf/amqp": "^3.1",
+        "hyperf/async-queue": "^3.1",
         "hyperf/cache": "~3.1.0",
         "hyperf/command": "^3.1",
         "hyperf/config": "~3.1.0",
@@ -34,7 +35,7 @@
         "hyperf/memory": "~3.1.0",
         "hyperf/nacos": "^3.1",
         "hyperf/process": "~3.1.0",
-        "hyperf/redis": "~3.1.0",
+        "hyperf/redis": "^3.1",
         "hyperf/rpc-client": "^3.1",
         "hyperf/rpc-server": "*",
         "hyperf/service-governance": "^3.1",

+ 148 - 69
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "e71f383836139c57d31eb8084467a897",
+    "content-hash": "408b8e53c4a0d313ed75355b91296895",
     "packages": [
         {
             "name": "carbonphp/carbon-doctrine-types",
@@ -1182,6 +1182,83 @@
             ],
             "time": "2024-09-25T02:54:12+00:00"
         },
+        {
+            "name": "hyperf/async-queue",
+            "version": "v3.1.42",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/async-queue.git",
+                "reference": "1cd25666ac1e1f23c9eab6be642e86802a96307b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/hyperf/async-queue/zipball/1cd25666ac1e1f23c9eab6be642e86802a96307b",
+                "reference": "1cd25666ac1e1f23c9eab6be642e86802a96307b",
+                "shasum": ""
+            },
+            "require": {
+                "hyperf/codec": "~3.1.0",
+                "hyperf/collection": "~3.1.0",
+                "hyperf/command": "~3.1.0",
+                "hyperf/contract": "~3.1.0",
+                "hyperf/support": "~3.1.0",
+                "hyperf/utils": "~3.1.0",
+                "php": ">=8.1",
+                "psr/container": "^1.0 || ^2.0",
+                "psr/event-dispatcher": "^1.0"
+            },
+            "suggest": {
+                "hyperf/di": "Required to use annotations.",
+                "hyperf/event": "Required to dispatch a event.",
+                "hyperf/logger": "Required to use QueueHandleListener.",
+                "hyperf/process": "Auto register the consumer process for server."
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.1-dev"
+                },
+                "hyperf": {
+                    "config": "Hyperf\\AsyncQueue\\ConfigProvider"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/Functions.php"
+                ],
+                "psr-4": {
+                    "Hyperf\\AsyncQueue\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "description": "A async queue component for hyperf.",
+            "homepage": "https://hyperf.io",
+            "keywords": [
+                "async-queue",
+                "hyperf",
+                "php"
+            ],
+            "support": {
+                "docs": "https://hyperf.wiki",
+                "issues": "https://github.com/hyperf/hyperf/issues",
+                "pull-request": "https://github.com/hyperf/hyperf/pulls",
+                "source": "https://github.com/hyperf/hyperf"
+            },
+            "funding": [
+                {
+                    "url": "https://hyperf.wiki/#/zh-cn/donate",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://opencollective.com/hyperf",
+                    "type": "open_collective"
+                }
+            ],
+            "time": "2024-09-25T02:54:12+00:00"
+        },
         {
             "name": "hyperf/cache",
             "version": "v3.1.43",
@@ -1384,16 +1461,16 @@
         },
         {
             "name": "hyperf/collection",
-            "version": "v3.1.44",
+            "version": "v3.1.45",
             "source": {
                 "type": "git",
                 "url": "https://github.com/hyperf/collection.git",
-                "reference": "7098171d93653aaa4c52183f39437dbf1219986f"
+                "reference": "884b2b84e4f33481f7c4ac8822c5cc854b43582d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/hyperf/collection/zipball/7098171d93653aaa4c52183f39437dbf1219986f",
-                "reference": "7098171d93653aaa4c52183f39437dbf1219986f",
+                "url": "https://api.github.com/repos/hyperf/collection/zipball/884b2b84e4f33481f7c4ac8822c5cc854b43582d",
+                "reference": "884b2b84e4f33481f7c4ac8822c5cc854b43582d",
                 "shasum": ""
             },
             "require": {
@@ -1445,7 +1522,7 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2024-10-23T10:12:23+00:00"
+            "time": "2024-11-14T02:27:55+00:00"
         },
         {
             "name": "hyperf/command",
@@ -2170,16 +2247,16 @@
         },
         {
             "name": "hyperf/database",
-            "version": "v3.1.44",
+            "version": "v3.1.45",
             "source": {
                 "type": "git",
                 "url": "https://github.com/hyperf/database.git",
-                "reference": "c0a9eb335c8f7c0b58fd1b300631d4aa593037a1"
+                "reference": "6632bbd7a118416cfecfc80fe0f85c650aa0941e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/hyperf/database/zipball/c0a9eb335c8f7c0b58fd1b300631d4aa593037a1",
-                "reference": "c0a9eb335c8f7c0b58fd1b300631d4aa593037a1",
+                "url": "https://api.github.com/repos/hyperf/database/zipball/6632bbd7a118416cfecfc80fe0f85c650aa0941e",
+                "reference": "6632bbd7a118416cfecfc80fe0f85c650aa0941e",
                 "shasum": ""
             },
             "require": {
@@ -2239,7 +2316,7 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2024-10-11T10:25:57+00:00"
+            "time": "2024-11-11T05:55:47+00:00"
         },
         {
             "name": "hyperf/db-connection",
@@ -4916,16 +4993,16 @@
         },
         {
             "name": "jetbrains/phpstorm-attributes",
-            "version": "1.1",
+            "version": "1.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/JetBrains/phpstorm-attributes.git",
-                "reference": "22fb28d679deceedba8366dbae65cc8ebfc17e26"
+                "reference": "64de815a4509c29e00d5e3474087fd24c171afc2"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/JetBrains/phpstorm-attributes/zipball/22fb28d679deceedba8366dbae65cc8ebfc17e26",
-                "reference": "22fb28d679deceedba8366dbae65cc8ebfc17e26",
+                "url": "https://api.github.com/repos/JetBrains/phpstorm-attributes/zipball/64de815a4509c29e00d5e3474087fd24c171afc2",
+                "reference": "64de815a4509c29e00d5e3474087fd24c171afc2",
                 "shasum": ""
             },
             "type": "library",
@@ -4952,9 +5029,9 @@
             ],
             "support": {
                 "issues": "https://youtrack.jetbrains.com/newIssue?project=WI",
-                "source": "https://github.com/JetBrains/phpstorm-attributes/tree/1.1"
+                "source": "https://github.com/JetBrains/phpstorm-attributes/tree/1.2"
             },
-            "time": "2023-09-01T08:50:25+00:00"
+            "time": "2024-10-11T10:46:19+00:00"
         },
         {
             "name": "laminas/laminas-mime",
@@ -5291,16 +5368,16 @@
         },
         {
             "name": "monolog/monolog",
-            "version": "3.7.0",
+            "version": "3.8.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Seldaek/monolog.git",
-                "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8"
+                "reference": "32e515fdc02cdafbe4593e30a9350d486b125b67"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f4393b648b78a5408747de94fca38beb5f7e9ef8",
-                "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8",
+                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/32e515fdc02cdafbe4593e30a9350d486b125b67",
+                "reference": "32e515fdc02cdafbe4593e30a9350d486b125b67",
                 "shasum": ""
             },
             "require": {
@@ -5320,12 +5397,14 @@
                 "guzzlehttp/psr7": "^2.2",
                 "mongodb/mongodb": "^1.8",
                 "php-amqplib/php-amqplib": "~2.4 || ^3",
-                "phpstan/phpstan": "^1.9",
-                "phpstan/phpstan-deprecation-rules": "^1.0",
-                "phpstan/phpstan-strict-rules": "^1.4",
-                "phpunit/phpunit": "^10.5.17",
+                "php-console/php-console": "^3.1.8",
+                "phpstan/phpstan": "^2",
+                "phpstan/phpstan-deprecation-rules": "^2",
+                "phpstan/phpstan-strict-rules": "^2",
+                "phpunit/phpunit": "^10.5.17 || ^11.0.7",
                 "predis/predis": "^1.1 || ^2",
-                "ruflin/elastica": "^7",
+                "rollbar/rollbar": "^4.0",
+                "ruflin/elastica": "^7 || ^8",
                 "symfony/mailer": "^5.4 || ^6",
                 "symfony/mime": "^5.4 || ^6"
             },
@@ -5376,7 +5455,7 @@
             ],
             "support": {
                 "issues": "https://github.com/Seldaek/monolog/issues",
-                "source": "https://github.com/Seldaek/monolog/tree/3.7.0"
+                "source": "https://github.com/Seldaek/monolog/tree/3.8.0"
             },
             "funding": [
                 {
@@ -5388,7 +5467,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2024-06-28T09:40:51+00:00"
+            "time": "2024-11-12T13:57:08+00:00"
         },
         {
             "name": "nesbot/carbon",
@@ -6808,16 +6887,16 @@
         },
         {
             "name": "symfony/console",
-            "version": "v6.4.14",
+            "version": "v6.4.15",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
-                "reference": "897c2441ed4eec8a8a2c37b943427d24dba3f26b"
+                "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/897c2441ed4eec8a8a2c37b943427d24dba3f26b",
-                "reference": "897c2441ed4eec8a8a2c37b943427d24dba3f26b",
+                "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd",
+                "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd",
                 "shasum": ""
             },
             "require": {
@@ -6882,7 +6961,7 @@
                 "terminal"
             ],
             "support": {
-                "source": "https://github.com/symfony/console/tree/v6.4.14"
+                "source": "https://github.com/symfony/console/tree/v6.4.15"
             },
             "funding": [
                 {
@@ -6898,7 +6977,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2024-11-05T15:34:40+00:00"
+            "time": "2024-11-06T14:19:14+00:00"
         },
         {
             "name": "symfony/deprecation-contracts",
@@ -7597,16 +7676,16 @@
         },
         {
             "name": "symfony/string",
-            "version": "v6.4.13",
+            "version": "v6.4.15",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/string.git",
-                "reference": "38371c60c71c72b3d64d8d76f6b1bb81a2cc3627"
+                "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/string/zipball/38371c60c71c72b3d64d8d76f6b1bb81a2cc3627",
-                "reference": "38371c60c71c72b3d64d8d76f6b1bb81a2cc3627",
+                "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",
+                "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f",
                 "shasum": ""
             },
             "require": {
@@ -7663,7 +7742,7 @@
                 "utf8"
             ],
             "support": {
-                "source": "https://github.com/symfony/string/tree/v6.4.13"
+                "source": "https://github.com/symfony/string/tree/v6.4.15"
             },
             "funding": [
                 {
@@ -7679,7 +7758,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2024-09-25T14:18:03+00:00"
+            "time": "2024-11-13T13:31:12+00:00"
         },
         {
             "name": "symfony/translation",
@@ -8006,16 +8085,16 @@
         },
         {
             "name": "composer/pcre",
-            "version": "3.3.1",
+            "version": "3.3.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/pcre.git",
-                "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4"
+                "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4",
-                "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4",
+                "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+                "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
                 "shasum": ""
             },
             "require": {
@@ -8025,8 +8104,8 @@
                 "phpstan/phpstan": "<1.11.10"
             },
             "require-dev": {
-                "phpstan/phpstan": "^1.11.10",
-                "phpstan/phpstan-strict-rules": "^1.1",
+                "phpstan/phpstan": "^1.12 || ^2",
+                "phpstan/phpstan-strict-rules": "^1 || ^2",
                 "phpunit/phpunit": "^8 || ^9"
             },
             "type": "library",
@@ -8065,7 +8144,7 @@
             ],
             "support": {
                 "issues": "https://github.com/composer/pcre/issues",
-                "source": "https://github.com/composer/pcre/tree/3.3.1"
+                "source": "https://github.com/composer/pcre/tree/3.3.2"
             },
             "funding": [
                 {
@@ -8081,7 +8160,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2024-08-27T18:44:43+00:00"
+            "time": "2024-11-12T16:29:46+00:00"
         },
         {
             "name": "composer/semver",
@@ -8960,16 +9039,16 @@
         },
         {
             "name": "phpstan/phpstan",
-            "version": "1.12.9",
+            "version": "1.12.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpstan/phpstan.git",
-                "reference": "ceb937fb39a92deabc02d20709cf14b2c452502c"
+                "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ceb937fb39a92deabc02d20709cf14b2c452502c",
-                "reference": "ceb937fb39a92deabc02d20709cf14b2c452502c",
+                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d1fc20a962a91be578bcfe7cf939e6e1a2ff733",
+                "reference": "0d1fc20a962a91be578bcfe7cf939e6e1a2ff733",
                 "shasum": ""
             },
             "require": {
@@ -9014,7 +9093,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2024-11-10T17:10:04+00:00"
+            "time": "2024-11-17T14:08:01+00:00"
         },
         {
             "name": "phpunit/php-code-coverage",
@@ -11140,16 +11219,16 @@
         },
         {
             "name": "symfony/http-foundation",
-            "version": "v6.4.14",
+            "version": "v6.4.15",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/http-foundation.git",
-                "reference": "ba020a321a95519303a3f09ec2824d34d601c388"
+                "reference": "9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ba020a321a95519303a3f09ec2824d34d601c388",
-                "reference": "ba020a321a95519303a3f09ec2824d34d601c388",
+                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6",
+                "reference": "9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6",
                 "shasum": ""
             },
             "require": {
@@ -11159,12 +11238,12 @@
                 "symfony/polyfill-php83": "^1.27"
             },
             "conflict": {
-                "symfony/cache": "<6.3"
+                "symfony/cache": "<6.4.12|>=7.0,<7.1.5"
             },
             "require-dev": {
                 "doctrine/dbal": "^2.13.1|^3|^4",
                 "predis/predis": "^1.1|^2.0",
-                "symfony/cache": "^6.3|^7.0",
+                "symfony/cache": "^6.4.12|^7.1.5",
                 "symfony/dependency-injection": "^5.4|^6.0|^7.0",
                 "symfony/expression-language": "^5.4|^6.0|^7.0",
                 "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0",
@@ -11197,7 +11276,7 @@
             "description": "Defines an object-oriented layer for the HTTP specification",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/http-foundation/tree/v6.4.14"
+                "source": "https://github.com/symfony/http-foundation/tree/v6.4.15"
             },
             "funding": [
                 {
@@ -11213,7 +11292,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2024-11-05T16:39:55+00:00"
+            "time": "2024-11-08T16:09:24+00:00"
         },
         {
             "name": "symfony/options-resolver",
@@ -11436,16 +11515,16 @@
         },
         {
             "name": "symfony/process",
-            "version": "v6.4.14",
+            "version": "v6.4.15",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/process.git",
-                "reference": "25214adbb0996d18112548de20c281be9f27279f"
+                "reference": "3cb242f059c14ae08591c5c4087d1fe443564392"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/process/zipball/25214adbb0996d18112548de20c281be9f27279f",
-                "reference": "25214adbb0996d18112548de20c281be9f27279f",
+                "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392",
+                "reference": "3cb242f059c14ae08591c5c4087d1fe443564392",
                 "shasum": ""
             },
             "require": {
@@ -11477,7 +11556,7 @@
             "description": "Executes commands in sub-processes",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/process/tree/v6.4.14"
+                "source": "https://github.com/symfony/process/tree/v6.4.15"
             },
             "funding": [
                 {
@@ -11493,7 +11572,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2024-11-06T09:25:01+00:00"
+            "time": "2024-11-06T14:19:14+00:00"
         },
         {
             "name": "symfony/stopwatch",
@@ -11640,12 +11719,12 @@
     ],
     "aliases": [],
     "minimum-stability": "dev",
-    "stability-flags": {},
+    "stability-flags": [],
     "prefer-stable": true,
     "prefer-lowest": false,
     "platform": {
         "php": ">=8.1"
     },
-    "platform-dev": {},
+    "platform-dev": [],
     "plugin-api-version": "2.6.0"
 }

+ 2 - 0
config/api/public.php

@@ -31,6 +31,8 @@ Router::addGroup(
         Router::post('/delLetterOfComplaint', [PublicController::class, 'delLetterOfComplaint']);
         //获取类型
         Router::get('/getLetterType', [PublicController::class, 'getLetterType']);
+        //获取子类型
+        Router::get('/getLetterTypeChildren', [PublicController::class, 'getLetterTypeChildren']);
         //下载文件
         Router::addRoute(['GET', 'POST'],'/downloadFile', [PublicController::class, 'downloadFile']);
         //检测是否已经被审核

+ 44 - 0
config/autoload/async_queue.php

@@ -0,0 +1,44 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * This file is part of Hyperf.
+ *
+ * @link     https://www.hyperf.io
+ * @document https://hyperf.wiki
+ * @contact  group@hyperf.io
+ * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
+ */
+use Hyperf\AsyncQueue\Driver\RedisDriver;
+
+return [
+    'default' => [
+        'driver' => RedisDriver::class,
+        'redis' => [
+            'pool' => 'default',
+        ],
+        'channel' => '{gatherList}',
+        'timeout' => 2,
+        'retry_seconds' => 5,
+        'handle_timeout' => 10,
+        'processes' => 1,
+        'concurrent' => [
+            'limit' => 10,
+        ],
+        'max_messages' => 0,
+    ],
+    'import' => [
+        'driver' => RedisDriver::class,
+        'redis' => [
+            'pool' => 'default'
+        ],
+        'channel' => '{importList}',
+        'timeout' => 2,
+        'retry_seconds' => 5,
+        'handle_timeout' => 10,
+        'processes' => 1,
+        'concurrent' => [
+            'limit' => 5,
+        ],
+    ],
+];

+ 1 - 0
config/autoload/processes.php

@@ -10,4 +10,5 @@ declare(strict_types=1);
  * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
  */
 return [
+    Hyperf\AsyncQueue\Process\ConsumerProcess::class, //异步消费进程
 ];