TestCommand.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Mail\ExampleEmail;
  4. use App\Models\Factoring;
  5. use App\Models\FactoringContract;
  6. use App\Models\FactoringContractFile;
  7. use App\Models\FactoringProperty;
  8. use App\Models\Firm;
  9. use App\Models\IndentNum;
  10. use App\Models\Member;
  11. use App\Models\MemberSeal;
  12. use App\Models\SignContract;
  13. use App\Models\SignMember;
  14. use App\Models\SignRecord;
  15. use App\Models\SignSeal;
  16. use App\Models\SignSealAuth;
  17. use App\Servers\ESign\comm\EsignLogHelper;
  18. use App\Servers\ESign\ESignContractServer;
  19. use App\Servers\ESign\ESignFirmServer;
  20. use App\Servers\ESign\ESignServer;
  21. use App\Servers\Financing\ContractServer;
  22. use App\Servers\Financing\FinancingServer;
  23. use App\Servers\Firm\FirmServer;
  24. use App\Servers\System\EmailServer;
  25. use App\Servers\System\JobServer;
  26. use App\Servers\System\RedisDataServer;
  27. use App\Servers\System\SmsServer;
  28. use App\Servers\Wps\ExcelServer;
  29. use App\Servers\Wps\PdfServer;
  30. use App\Servers\Wps\WordServer;
  31. use App\Servers\Wps\WpsServer;
  32. use Illuminate\Console\Command;
  33. use Illuminate\Support\Facades\Log;
  34. use Illuminate\Support\Facades\Storage;
  35. class TestCommand extends Command
  36. {
  37. /**
  38. * The name and signature of the console command.
  39. *
  40. * @var string
  41. */
  42. protected $signature = 'test';
  43. /**
  44. * The console command description.
  45. *
  46. * @var string
  47. */
  48. protected $description = '测试命令';
  49. /**
  50. * Create a new command instance.
  51. *
  52. * @return void
  53. */
  54. public function __construct()
  55. {
  56. parent::__construct();
  57. }
  58. /**
  59. * Execute the console command.
  60. *
  61. * @return int
  62. */
  63. public function handle()
  64. {
  65. $result = ESignContractServer::creatServer()->downloadFileUrl('2160ab8b01b4444384e48d4e72135584');
  66. dd($result);
  67. // [{"keyword":"甲方:重庆振合网商业管理有限公司(公章)","auth_type":"ORG","id_no":"f09ba6fd02ed416690800c539ec4488a"},{"keyword":"乙方(盖章):","auth_type":"PSN","id_no":"337834e20a344e8b83c5fe115d230578"}]
  68. $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"}}}';
  69. $data = json_decode($json,true);
  70. if ($data['action'] == 'SIGN_MISSON_COMPLETE'){
  71. // file_put_contents('sign_misson_complete.txt', json_encode($data));
  72. //合同签署
  73. $signFlowStatus = $data['signResult'];
  74. $signFlowId = $data['signFlowId'];
  75. $organization = isset($data['organization']) ? $data['organization'] : '';
  76. $operator = $data['operator'];
  77. if (!empty($signFlowId)){
  78. $sign = SignContract::where('flow_id',$signFlowId)->first();
  79. $sign_id = $sign->{'id'};
  80. if (!empty($operator)){
  81. $psnId = $operator['psnId'];
  82. SignRecord::where('sign_id',$sign_id)->where('authType','PSN')->where('id_no',$psnId)->update(['status'=>$signFlowStatus]);
  83. }
  84. if (!empty($organization)){
  85. $orgId = $organization['orgId'];
  86. SignRecord::where('sign_id',$sign_id)->where('authType','ORG')->where('id_no',$orgId)->update(['status'=>$signFlowStatus]);
  87. }
  88. }
  89. }
  90. dd(111);
  91. // $file_id = '0a1feb9ddf3f4da198ec0bb7d0c3225a';
  92. // $file_status = ESignContractServer::creatServer()->getFileStatus($file_id);
  93. // dd($file_status);
  94. // $psnId= 'd1bca85014164a88b896159c799223f9';
  95. // JobServer::creatServer()->createMemberSealJob($psnId);
  96. // //获取企业内部使用签章列表
  97. //// ESignServer::creatServer()->internalAuthInfo(1,$psnId);
  98. //// ESignServer::creatServer()->psnsealListInfo(1,$psnId);
  99. //// ESignServer::creatServer()->createOrgsealsbyTemplate(1,$psnId);
  100. // dd(11111);
  101. // //查询是否有合同章
  102. // $sealItem=MemberSeal::where('m_id',1)->first();
  103. // if(empty($sealItem)){
  104. // //无合同印章执行创建流程
  105. // ESignServer::creatServer()->createOrgsealsbyTemplate(1,$psnId);
  106. // }
  107. // dd(11111);
  108. // JobServer::creatServer()->createMemberSealJob($psnId);
  109. // dd(111);
  110. // dd(11111);
  111. // $file_path = 'storage/contract/测试.docx';
  112. $file_path = 'storage/contract/20250521/测试模板.docx';
  113. $json = '{"name": "江雨","text":"测试一下","phone":"13012341234"}';
  114. $file = WordServer::creatServer()->replaceWordText($file_path,'123.docx',$json);
  115. dd($file);
  116. // ESignContractServer::creatServer()->setContractContract(111,11);
  117. // dd(111);
  118. $content='尊敬的,您有待认证信息,点击认证 ';
  119. $r = SmsServer::creatServer()->sendContent('18323851679',$content);
  120. dd($r);
  121. $Res = ESignServer::creatServer()->personsidentityinfo(1,18323851679,'江雨',500221200002194310);
  122. dd($Res);
  123. }
  124. }