Ver Fonte

no message

panghu há 1 ano atrás
pai
commit
61fc8a099e

+ 75 - 0
app/Console/Commands/SignContractCommand.php

@@ -0,0 +1,75 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Models\SignContract;
+use App\Servers\ESign\ESignContractServer;
+use Illuminate\Console\Command;
+
+/**
+ * 合同签署任务
+ * Class SignContractCommand
+ * @package App\Console\Commands
+ */
+class SignContractCommand extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'sign:contract';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = '合同签署任务';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return mixed
+     */
+    public function handle()
+    {
+        $this->info('发起合同签署检查');
+        //获取所有文件待转的记录
+        $list = SignContract::where('status',0)->where('is_del',0)->get();
+
+        foreach ($list as $value){
+            $sign_id = $value->{'id'};
+            $file_id = $value->{'file_id'};
+            $sign_json = $value->{'sign_json'};
+            $file_path = $value->{'local_file'};
+            // 获取所有信息
+            $pathInfo = pathinfo($file_path);
+            $file_name = $pathInfo['filename'];
+
+            //获取文件状态
+            $file_status = ESignContractServer::creatServer()->getFileStatus($value->{'file_id'});
+            if(!in_array($file_status,[2,5])){
+                continue;
+            }
+            //发起合同签署
+            $result = ESignContractServer::creatServer()->setContractContract($sign_id,$file_id,$sign_json,$file_name);
+            if ($result['code'] == 0){
+                SignContract::where('id',$sign_id)->where('is_del',0)->update(['status'=>10,'msg'=>$result['msg']]);
+            }
+        }
+
+        $this->info('合同签署发起完成');
+        return true;
+    }
+}

+ 104 - 0
app/Console/Commands/TestCommand.php

@@ -0,0 +1,104 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Mail\ExampleEmail;
+use App\Models\Factoring;
+use App\Models\FactoringContract;
+use App\Models\FactoringContractFile;
+use App\Models\FactoringProperty;
+use App\Models\Firm;
+use App\Models\IndentNum;
+use App\Models\Member;
+use App\Models\MemberSeal;
+use App\Models\SignMember;
+use App\Models\SignSeal;
+use App\Models\SignSealAuth;
+use App\Servers\ESign\comm\EsignLogHelper;
+use App\Servers\ESign\ESignContractServer;
+use App\Servers\ESign\ESignFirmServer;
+use App\Servers\ESign\ESignServer;
+use App\Servers\Financing\ContractServer;
+use App\Servers\Financing\FinancingServer;
+use App\Servers\Firm\FirmServer;
+use App\Servers\System\EmailServer;
+use App\Servers\System\JobServer;
+use App\Servers\System\RedisDataServer;
+use App\Servers\System\SmsServer;
+use App\Servers\Wps\ExcelServer;
+use App\Servers\Wps\PdfServer;
+use App\Servers\Wps\WordServer;
+use App\Servers\Wps\WpsServer;
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Facades\Storage;
+
+class TestCommand extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'test';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = '测试命令';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+//        $file_id = '0a1feb9ddf3f4da198ec0bb7d0c3225a';
+//        $file_status = ESignContractServer::creatServer()->getFileStatus($file_id);
+//        dd($file_status);
+
+        $psnId= 'd1bca85014164a88b896159c799223f9';
+        //获取企业内部使用签章列表
+        ESignServer::creatServer()->internalAuthInfo(1,$psnId);
+//        ESignServer::creatServer()->psnsealListInfo(1,$psnId);
+//        ESignServer::creatServer()->createOrgsealsbyTemplate(1,$psnId);
+        dd(11111);
+        //查询是否有合同章
+        $sealItem=MemberSeal::where('m_id',1)->first();
+        if(empty($sealItem)){
+            //无合同印章执行创建流程
+            ESignServer::creatServer()->createOrgsealsbyTemplate(1,$psnId);
+        }
+        dd(11111);
+        JobServer::creatServer()->createMemberSealJob($psnId);
+        dd(111);
+//        dd(11111);
+//        $file_path = 'storage/contract/测试.docx';
+        $file_path = 'storage/contract/20250520/测试模板.docx';
+
+        $json = '{"name": "江雨","text":"测试一下","phone":"13012341234"}';
+        $file = WordServer::creatServer()->replaceWordText($file_path,'123.docx',$json);
+        dd($file);
+//        ESignContractServer::creatServer()->setContractContract(111,11);
+//        dd(111);
+
+        $content='尊敬的,您有待认证信息,点击认证 ';
+        $r = SmsServer::creatServer()->sendContent('18323851679',$content);
+        dd($r);
+        $Res = ESignServer::creatServer()->personsidentityinfo(1,18323851679,'江雨',500221200002194310);
+        dd($Res);
+    }
+}

+ 60 - 0
app/Jobs/CreateFirmSealJob.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Jobs;
+
+use App\Models\Firm;
+use App\Models\FirmSeal;
+use App\Models\Member;
+use App\Servers\ESign\ESignFirmServer;
+use App\Servers\System\RedisDataServer;
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldBeUnique;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+
+class CreateFirmSealJob implements ShouldQueue
+{
+    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+
+    private $orgId;
+    /**
+     * Create a new job instance.
+     *
+     * @return void
+     */
+    public function __construct($orgId)
+    {
+       $this->orgId=  $orgId;
+    }
+
+    /**
+     * Execute the job.
+     *
+     * @return void
+     */
+    public function handle()
+    {
+        //获取企业id
+        $firm_id = Firm::where('org_id',$this->orgId)->value('id');
+        if (empty($firm_id)){
+            dump('签章生成-找不到企业');
+            return;
+        }
+        $isSelect=RedisDataServer::creatServer()->getData('firmSeal_'.$firm_id);
+        if($isSelect){
+            dump($firm_id.'签章信息已在生成中');
+            return;
+        }
+        RedisDataServer::creatServer()->setData('firmSeal_'.$firm_id,1);
+        //获取企业内部使用签章列表
+        ESignFirmServer::creatServer()->internalAuthInfo($firm_id,$this->orgId);
+        //查询是否有合同章
+        $sealItem=FirmSeal::where('firm_id',$firm_id)->where('seal_type','CONTRACT')->first();
+        if(empty($sealItem)){
+            //无合同印章执行创建流程
+            ESignFirmServer::creatServer()->createOrgsealsbyTemplate($firm_id,$this->orgId);
+        }
+    }
+}

+ 60 - 0
app/Jobs/CreateMemberSealJob.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Jobs;
+
+use App\Models\Member;
+use App\Models\MemberSeal;
+use App\Servers\ESign\ESignServer;
+use App\Servers\System\RedisDataServer;
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldBeUnique;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+
+class CreateMemberSealJob implements ShouldQueue
+{
+    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+
+    private $psnId;
+    /**
+     * Create a new job instance.
+     *
+     * @return void
+     */
+    public function __construct($psnId)
+    {
+        $this->psnId=  $psnId;
+    }
+
+    /**
+     * Execute the job.
+     *
+     * @return void
+     */
+    public function handle()
+    {
+        //获取用户id
+        $m_id = Member::where('psnId',$this->psnId)->value('id');
+        if (empty($m_id)){
+            dump('签章生成-找不到用户');
+            return;
+        }
+        $isSelect=RedisDataServer::creatServer()->getData('memberSeal_'.$m_id);
+        if($isSelect){
+            dump($m_id.'用户签章信息已在生成中');
+            return;
+        }
+        RedisDataServer::creatServer()->setData('memberSeal_'.$m_id,1);
+
+        //获取企业内部使用签章列表
+        ESignServer::creatServer()->internalAuthInfo($m_id,$this->psnId);
+        //查询是否有合同章
+        $sealItem=MemberSeal::where('m_id',$m_id)->first();
+        if(empty($sealItem)){
+            //无合同印章执行创建流程
+            ESignServer::creatServer()->createOrgsealsbyTemplate($m_id,$this->psnId);
+        }
+    }
+}

+ 9 - 0
config/baidu_orc.php

@@ -0,0 +1,9 @@
+<?php
+
+return [
+    //code码验证存储方式
+    'app_id' => env('BAI_APP_ID',''),
+    //短信有效时长(分钟)
+    'api_key' => env('BAI_API_KEY',''),
+    'secret_key' => env('BAI_SECRET_KEY',''),
+];

+ 49 - 0
config/easy_sms.php

@@ -0,0 +1,49 @@
+<?php
+
+return [
+    //code码验证存储方式
+    'cache_type' => env('CACHE_SMS_TYPE','file'),
+    //短信有效时长(分钟)
+    'cache_time' => env('CACHE_SMS_TIME','15'),
+    //短信最短重发时间(秒)
+    'mix_time' => env('CACHE_MIX_TIME','60'),
+    //签名信息
+    'sign_text'=>env('SIGN_TEXT',''),
+    //请求超时时间
+    'timeout'=>env('SMS_TIMEOUT',''),
+    //是否开启通用验证码
+    'is_current'=>env('IS_CURRENT',false),
+    //通用验证码
+    'current_code'=>env('CURRENT_CODE','7453'),
+    //kewail平台短信配置信息
+    'kewail' => [
+        'accesskey' => env('KEWAIL_ACCESSKEY',''),
+        'secretkey' => env('KEWAIL_SECRETKEY',''),
+    ],
+    //阿里云短信配置
+    'ali' => [
+        'access_key_id' => env('ALI_ACCESS_KEY_ID',''),
+        'secretkey' => env('ALI_ACCESS_KEY',''),
+    ],
+    //企业宝短信配置
+    'qyb' => [
+        'username' => env('QYB_USERNAME',''),
+        'password' => env('QYB_PASSWORD',''),
+    ],
+    //蒲公英短信
+    'px' => [
+        'username' => env('PX_USERNAME',''),
+        'password' => env('PX_PASSWORD',''),
+        'userid' => env('PX_USERID',''),
+    ],
+    //蔚岛云短信
+    'wddz' => [
+        'username' => env('WDDZ_USERNAME',''),
+        'password' => env('WDDZ_PASSWORD',''),
+    ],
+    //短信短信
+    'dx' => [
+        'username' => env('DX_USERNAME',''),
+        'password' => env('DX_PASSWORD',''),
+    ]
+];

+ 62 - 0
config/flare.php

@@ -0,0 +1,62 @@
+<?php
+
+return [
+    /*
+    |
+    |--------------------------------------------------------------------------
+    | Flare API key
+    |--------------------------------------------------------------------------
+    |
+    | Specify Flare's API key below to enable error reporting to the service.
+    |
+    | More info: https://flareapp.io/docs/general/projects
+    |
+    */
+
+    'key' => env('FLARE_KEY'),
+
+    /*
+    |--------------------------------------------------------------------------
+    | Reporting Options
+    |--------------------------------------------------------------------------
+    |
+    | These options determine which information will be transmitted to Flare.
+    |
+    */
+
+    'reporting' => [
+        'anonymize_ips' => true,
+        'collect_git_information' => false,
+        'report_queries' => true,
+        'maximum_number_of_collected_queries' => 200,
+        'report_query_bindings' => true,
+        'report_view_data' => true,
+        'grouping_type' => null,
+        'report_logs' => true,
+        'maximum_number_of_collected_logs' => 200,
+        'censor_request_body_fields' => ['password'],
+    ],
+
+    /*
+    |--------------------------------------------------------------------------
+    | Reporting Log statements
+    |--------------------------------------------------------------------------
+    |
+    | If this setting is `false` log statements won't be sent as events to Flare,
+    | no matter which error level you specified in the Flare log channel.
+    |
+    */
+
+    'send_logs_as_events' => true,
+
+    /*
+    |--------------------------------------------------------------------------
+    | Censor request body fields
+    |--------------------------------------------------------------------------
+    |
+    | These fields will be censored from your request when sent to Flare.
+    |
+    */
+
+    'censor_request_body_fields' => ['password'],
+];

+ 65 - 0
config/sanctum.php

@@ -0,0 +1,65 @@
+<?php
+
+return [
+
+    /*
+    |--------------------------------------------------------------------------
+    | Stateful Domains
+    |--------------------------------------------------------------------------
+    |
+    | Requests from the following domains / hosts will receive stateful API
+    | authentication cookies. Typically, these should include your local
+    | and production domains which access your API via a frontend SPA.
+    |
+    */
+
+    'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
+        '%s%s',
+        'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
+        env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
+    ))),
+
+    /*
+    |--------------------------------------------------------------------------
+    | Sanctum Guards
+    |--------------------------------------------------------------------------
+    |
+    | This array contains the authentication guards that will be checked when
+    | Sanctum is trying to authenticate a request. If none of these guards
+    | are able to authenticate the request, Sanctum will use the bearer
+    | token that's present on an incoming request for authentication.
+    |
+    */
+
+    'guard' => ['web'],
+
+    /*
+    |--------------------------------------------------------------------------
+    | Expiration Minutes
+    |--------------------------------------------------------------------------
+    |
+    | This value controls the number of minutes until an issued token will be
+    | considered expired. If this value is null, personal access tokens do
+    | not expire. This won't tweak the lifetime of first-party sessions.
+    |
+    */
+
+    'expiration' => null,
+
+    /*
+    |--------------------------------------------------------------------------
+    | Sanctum Middleware
+    |--------------------------------------------------------------------------
+    |
+    | When authenticating your first-party SPA with Sanctum you may need to
+    | customize some of the middleware Sanctum uses while processing the
+    | request. You may change the middleware listed below as required.
+    |
+    */
+
+    'middleware' => [
+        'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
+        'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
+    ],
+
+];

+ 3 - 0
public/nginx.htaccess

@@ -0,0 +1,3 @@
+location / {
+    try_files $uri $uri/ /index.php?$query_string;
+}