瀏覽代碼

no message

panghu 1 年之前
父節點
當前提交
ba6166d31d

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

@@ -65,12 +65,26 @@ class TestCommand extends Command
      */
     public function handle()
     {
+
+        $psnId= 'd1bca85014164a88b896159c799223f9';
+        //获取企业内部使用签章列表
+        ESignServer::creatServer()->internalAuthInfo(1,$psnId);
+        //查询是否有合同章
+        $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';
-//
-//        $json = '{"name": "江雨","text":"测试一下","phone":"13012341234"}';
-//        $file = WordServer::creatServer()->replaceWordText($file_path,'123.docx',$json);
-//        dd($file);
+        $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);
 

+ 3 - 1
app/Http/Controllers/AdminApi/ContractController.php

@@ -53,6 +53,8 @@ class ContractController extends AdminController
             return $this->apiResponseError('请填写变量');
         }
 
+        $wordData = file_get_contents($file_url);
+
         //检查合同名称是否存在
         $info = Contract::where('name',$name)->where('is_del',0)->select(['id'])->first();
         if (!empty($info)) {
@@ -66,7 +68,7 @@ class ContractController extends AdminController
         $file_path = 'storage/contract/'.date('Ymd').'/';
         CommonServer::creatServer()->creatDir($file_path);
         $path=public_path($file_path);
-        file_put_contents($path . $file_name,$file_url);
+        file_put_contents($path . $file_name,$wordData);
 
         $contracts_file = $file_path.$file_name;
 

+ 1 - 1
app/Http/Controllers/AdminApi/SignContractController.php

@@ -96,7 +96,7 @@ class SignContractController extends AdminController
         }
 
         $list = SignContract::where($where)
-            ->select(['id','contracts_no','status','contracts_id','created_at'])
+            ->select(['id','contract_no','status','contract_id','created_at'])
             ->paginate(10);
 
         foreach ($list as $key => $value) {

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

@@ -196,6 +196,7 @@ class ESignServer
         //发起接口请求
         $response = EsignHttpHelper::doCommHttp($config['eSignHost'], $apiaddr, $requestType, $signAndBuildSignAndJsonHeader, "");
         $ret=json_decode($response->getBody(),true);
+//        dd($ret);
         if(isset($ret['code']) && $ret['code']==0){
             //存入签章信息
             $this->setMemberSealList($mId,$ret['data']['seals'],1);