| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <?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\SignContract;
- use App\Models\SignMember;
- use App\Models\SignRecord;
- 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()
- {
- // [{"keyword":"甲方:重庆振合网商业管理有限公司(公章)","auth_type":"ORG","id_no":"f09ba6fd02ed416690800c539ec4488a"},{"keyword":"乙方(盖章):","auth_type":"PSN","id_no":"337834e20a344e8b83c5fe115d230578"}]
- $json = '{"action":"SIGN_MISSON_COMPLETE","timestamp":1749624805377,"signFlowId":"4abe45e1e76c4ca4a1df7c23a3ef9545","signOrder":1,"operateTime":1749624805000,"signResult":2,"resultDescription":"\u7b7e\u7f72\u5b8c\u6210","operator":{"psnId":"8e1a90f1a0b8409790ead3e342564090","psnAccount":{"accountMobile":"13512343341"}}}';
- $data = json_decode($json,true);
- if ($data['action'] == 'SIGN_MISSON_COMPLETE'){
- // file_put_contents('sign_misson_complete.txt', json_encode($data));
- //合同签署
- $signFlowStatus = $data['signResult'];
- $signFlowId = $data['signFlowId'];
- $organization = isset($data['organization']) ? $data['organization'] : '';
- $operator = $data['operator'];
- if (!empty($signFlowId)){
- $sign = SignContract::where('flow_id',$signFlowId)->first();
- $sign_id = $sign->{'id'};
- if (!empty($operator)){
- $psnId = $operator['psnId'];
- SignRecord::where('sign_id',$sign_id)->where('authType','PSN')->where('id_no',$psnId)->update(['status'=>$signFlowStatus]);
- }
- if (!empty($organization)){
- $orgId = $organization['orgId'];
- SignRecord::where('sign_id',$sign_id)->where('authType','ORG')->where('id_no',$orgId)->update(['status'=>$signFlowStatus]);
- }
- }
- }
- dd(111);
- // $file_id = '0a1feb9ddf3f4da198ec0bb7d0c3225a';
- // $file_status = ESignContractServer::creatServer()->getFileStatus($file_id);
- // dd($file_status);
- // $psnId= 'd1bca85014164a88b896159c799223f9';
- // JobServer::creatServer()->createMemberSealJob($psnId);
- // //获取企业内部使用签章列表
- //// 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/20250521/测试模板.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);
- }
- }
|