DESKTOP-70VPDLK\Administrator 5 luni în urmă
părinte
comite
d815bfd3cc

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

@@ -3,6 +3,7 @@
 namespace App\Console\Commands;
 
 use App\Mail\ExampleEmail;
+use App\Models\Contract;
 use App\Models\Factoring;
 use App\Models\FactoringContract;
 use App\Models\FactoringContractFile;
@@ -11,6 +12,7 @@ use App\Models\Firm;
 use App\Models\IndentNum;
 use App\Models\Member;
 use App\Models\MemberSeal;
+use App\Models\SignContract;
 use App\Models\SignMember;
 use App\Models\SignSeal;
 use App\Models\SignSealAuth;
@@ -66,6 +68,22 @@ class TestCommand extends Command
      */
     public function handle()
     {
+        $row=SignContract::where('id',2)->first();
+        dump('id',$row->{'contract_id'});
+        $contract = Contract::where('id',$row->{'contract_id'})->first();
+        if (empty($contract)){
+            return $this->apiResponseError('合同不存在');
+        }
+        //替换合同信息
+        $file_path = $contract->{'contracts_file'};
+        // 获取所有信息
+        $pathInfo = pathinfo($file_path);
+        $file_name = $pathInfo['filename'].$row->{'contract_no'}.'.'.$pathInfo['extension'];
+        //替换合同信息
+        $local_file = WordServer::creatServer()->replaceWordText($file_path,$file_name,json_decode($row->{'text_json'},true));
+        $file_id = ESignContractServer::creatServer()->fileUploadUrl($local_file);
+        $row->update(['file_id'=>$file_id]);
+        dd($local_file);
 //        $file_id = '0a1feb9ddf3f4da198ec0bb7d0c3225a';
 //        $file_status = ESignContractServer::creatServer()->getFileStatus($file_id);
 //        dd($file_status);

+ 1 - 0
app/Servers/ESign/ESignContractServer.php

@@ -66,6 +66,7 @@ class ESignContractServer
 
         $file_name=CommonServer::creatServer()->getFileName($file_url);
         $filePath=public_path($file_url);
+        dump($filePath);
         $contentMd5=$this->contentMd5($filePath);
         $apiaddr="/v3/files/file-upload-url";
         $requestType = HttpEmun::POST;