panghu hai 1 ano
pai
achega
e5461486e9

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

@@ -65,6 +65,7 @@ class TestCommand extends Command
     public function handle()
     {
         $file_path = 'storage/contract/测试.docx';
+
         $json = '{"name": "江雨","text":"测试一下","phone":"13012341234"}';
         $file = WordServer::creatServer()->replaceWordText($file_path,'123.docx',$json);
         dd($file);

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

@@ -39,13 +39,19 @@ class ContractController extends AdminController
 
         $id=request()->input('id','');//id
         $name=request()->input('name','');//合同名称
+        $sign_party=request()->input('sign_party',[]);//签署区域关键词
+        $texts=request()->input('texts',[]);//乙方方签署区域关键词
         if (empty($name)) return $this->apiResponseError('请填写合同名称');
         if (mb_strlen($name) > 100) return $this->apiResponseError('合同名称最大100');
+        if (empty($sign_party)) return $this->apiResponseError('请填写签署区信息');
 
         $file =request()->file('file','');//文件
         if (empty($file)){
             return $this->apiResponseError('请选择文件');
         }
+        if (empty($texts)){
+            return $this->apiResponseError('请填写变量');
+        }
 
         //检查合同名称是否存在
         $info = Contract::where('name',$name)->where('is_del',0)->select(['id'])->first();
@@ -59,7 +65,7 @@ class ContractController extends AdminController
 
 
 
-        $data = compact('name','contracts_file');
+        $data = compact('name','contracts_file','sign_party','texts');
 
         if(empty($id)){//不存在id就创建
 
@@ -79,6 +85,23 @@ class ContractController extends AdminController
         }
     }
 
+    /**
+     * 获取项目详情
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getContractInfo()
+    {
+        $id = request()->input('id','');//获取需要删除的id
+        if(empty($id)) return $this->apiResponseError('缺少必要参数');
+
+        $info = Contract::where('id',$id)->first();
+        if (empty($info)) {
+            return $this->apiResponseError('没有找到该记录');
+        }
+
+        return $this->apiResponseSuccess('成功',$info);
+    }
+
     /**
      * 删除
      * @return \Illuminate\Http\JsonResponse

+ 17 - 0
app/Http/Controllers/AdminApi/FirmController.php

@@ -85,4 +85,21 @@ class FirmController extends AdminController
         }
     }
 
+    /**
+     * 获取详情
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getFirmInfo()
+    {
+        $id = request()->input('id','');//获取需要删除的id
+        if(empty($id)) return $this->apiResponseError('缺少必要参数');
+
+        $info = Firm::where('id',$id)->first();
+        if (empty($info)) {
+            return $this->apiResponseError('没有找到该记录');
+        }
+
+        return $this->apiResponseSuccess('成功',$info);
+    }
+
 }

+ 16 - 0
app/Http/Controllers/AdminApi/MemberController.php

@@ -75,4 +75,20 @@ class MemberController extends AdminController
         }
     }
 
+    /**
+     * 获取详情
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getMemberInfo()
+    {
+        $id = request()->input('id','');//获取需要删除的id
+        if(empty($id)) return $this->apiResponseError('缺少必要参数');
+
+        $info = Member::where('id',$id)->first();
+        if (empty($info)) {
+            return $this->apiResponseError('没有找到该记录');
+        }
+
+        return $this->apiResponseSuccess('成功',$info);
+    }
 }

+ 116 - 0
app/Http/Controllers/AdminApi/SignContractController.php

@@ -0,0 +1,116 @@
+<?php
+
+namespace App\Http\Controllers\AdminApi;
+
+use App\Http\Controllers\AdminController;
+use App\Models\Contract;
+use App\Models\Firm;
+use App\Models\Member;
+use App\Servers\ESign\ESignContractServer;
+use App\Servers\Wps\WordServer;
+
+class SignContractController extends AdminController
+{
+
+    /**
+     * 获取项目合同
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getContractList()
+    {
+
+        $search=request()->input('search');
+
+        $where = [['is_del',0]];
+        if(!empty($search)){
+            $where[] = ['name','like','%'.$search.'%'];
+        }
+
+        $list = Contract::where($where)
+            ->select(['id','name','texts','sign_party'])
+            ->paginate(10);
+        return $this->apiResponseSuccess('获取列表成功', [
+            'items' => $list->items(),
+            'total' => $list->total(),
+            'limit' => 10,
+        ]);
+    }
+
+    /**
+     * 获取机构列表
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getFirmList(){
+
+        $search=request()->input('search');
+
+        $where = [['is_del',0], ['realnameStatus',1], ['authorizeUserInfo',1]];
+        if(!empty($search)){
+            $where[] = ['firm_name','like','%'.$search.'%'];
+        }
+
+        $list = Firm::where($where)
+            ->select(['id','firm_name','license_number','legal_name','orgId','realnameStatus','authorizeUserInfo','created_at'])
+            ->paginate(10);
+        return $this->apiResponseSuccess('获取列表成功', [
+            'items' => $list->items(),
+            'total' => $list->total(),
+            'limit' => 10,
+        ]);
+    }
+
+    /**
+     * 获取用户列表
+     * @return \Illuminate\Http\JsonResponse
+     */
+    function getMemberList(){
+        $search=request()->input('search');
+
+        $where = [['is_del',0], ['realnameStatus',1], ['authorizeUserInfo',1]];
+        if(!empty($search)){
+            $where[] = ['name','like','%'.$search.'%'];
+        }
+
+        $list = Member::where($where)
+            ->select(['id','name','phone','id_number','psnId','realnameStatus','authorizeUserInfo','created_at'])
+            ->paginate(10);
+        return $this->apiResponseSuccess('获取列表成功', [
+            'items' => $list->items(),
+            'total' => $list->total(),
+            'limit' => 10,
+        ]);
+    }
+
+    function createSignContract()
+    {
+        $contract_id=request()->input('contract_id');//合同id
+        $contract_no=request()->input('contract_no');//合同编号
+        $text_json=request()->input('textsJson');//替换文本json
+        $sign_json=request()->input('signJson');//签署区域信息
+        if(empty($contract_id)){
+            return $this->apiResponseError('请选择合同');
+        }
+        if(empty($textsJson)){
+            return $this->apiResponseError('请填写合同信息');
+        }
+        if(empty($signJson)){
+            return $this->apiResponseError('请选择签署信息');
+        }
+        //获取合同信息
+        $contract = Contract::where(['id'=>$contract_id])->first();
+        if (empty($contract)){
+            return $this->apiResponseError('合同不存在');
+        }
+        //替换合同信息
+        $file_path = $contract->{'contracts_file'};
+        // 获取所有信息
+        $pathInfo = pathinfo($file_path);
+        $file_name = $pathInfo['filename'].$contract_no.'.'.$pathInfo['extension'];
+        //替换合同信息
+        $local_file = WordServer::creatServer()->replaceWordText($file_path,$file_name,$textsJson);
+        //上传文件到e签宝并获得文件id
+        $file_id = ESignContractServer::creatServer()->fileUploadUrl($local_file);
+
+        $data = compact('contract_id','contract_no','file_id','text_json','sign_json','local_file');
+    }
+}

+ 4 - 0
app/Models/Contract.php

@@ -24,6 +24,10 @@ class Contract extends Model
      */
     protected $table = 'contracts';
 
+    protected $casts=[
+        'texts' => 'array',
+    ];
+
     /**
      * 为数组 / JSON 序列化准备日期。
      *

+ 38 - 0
app/Models/SignContract.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Models;
+
+use DateTimeInterface;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * App\Models\Contract
+ *
+ * @mixin \Eloquent
+ */
+class SignContract extends Model
+{
+    use HasFactory;
+    protected $guarded = ['id', 'updated_at', 'created_at'];
+
+
+    /**
+     * The table associated with the model.
+     *
+     * @var string
+     */
+    protected $table = 'sign_contracts';
+
+
+    /**
+     * 为数组 / JSON 序列化准备日期。
+     *
+     * @param \DateTimeInterface $date
+     * @return string
+     */
+    protected function serializeDate(DateTimeInterface $date)
+    {
+        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
+    }
+}

+ 13 - 372
app/Servers/ESign/ESignContractServer.php

@@ -5,23 +5,12 @@ namespace App\Servers\ESign;
 
 
 
-use App\Models\FactoringContract;
-use App\Models\FactoringContractFile;
-use App\Models\FactoringContractSign;
-use App\Models\FactoringContractText;
-use App\Models\FactoringProperty;
 use App\Models\Firm;
 use App\Models\Member;
-use App\Models\SignContract;
-use App\Models\SignFirm;
-use App\Models\SignMember;
-use App\Models\SignSeal;
 use App\Servers\ESign\comm\EsignHttpHelper;
 use App\Servers\ESign\comm\EsignLogHelper;
 use App\Servers\ESign\comm\EsignUtilHelper;
 use App\Servers\ESign\emun\HttpEmun;
-use App\Servers\Financing\ContractServer;
-use App\Servers\Financing\FinancingServer;
 use App\Servers\System\CommonServer;
 use App\Servers\System\SmsServer;
 
@@ -65,23 +54,21 @@ class ESignContractServer
 
     /**
      * 上传合同文件至E签宝
-     * @param FactoringContractFile $file
+     * @param $file_url
      * @return mixed
      */
-    function fileUploadUrl(FactoringContractFile $file){
+    function fileUploadUrl($file_url){
         $config=$this->config;
-        $file_pdf=$file->{'file_pdf'};
-        $app_url=env('APP_URL');
-        $file_pdf=str_replace($app_url,'',$file_pdf);
-        $file_name=CommonServer::creatServer()->getFileName($file_pdf);
-        $filePath=public_path($file_pdf);
+
+        $file_name=CommonServer::creatServer()->getFileName($file_url);
+        $filePath=public_path($file_url);
         $contentMd5=$this->contentMd5($filePath);
         $apiaddr="/v3/files/file-upload-url";
         $requestType = HttpEmun::POST;
         $data=[
             "contentMd5" =>$contentMd5,
             "contentType" =>"application/pdf",
-            "convertToPDF" =>false,
+            "convertToPDF" =>true,
             "fileName" =>$file_name,
             "fileSize" =>filesize($filePath)
         ];
@@ -100,11 +87,16 @@ class ESignContractServer
         $response=EsignHttpHelper::upLoadFileHttp($fileUploadUrl,$filePath,"application/pdf");
         EsignLogHelper::printMsg($response->getStatus());
         EsignLogHelper::printMsg($response->getBody());
-        $file->update(['sign_file_id'=>$fileId]);
+
         return $fileId;
     }
 
-
+    /**
+     * 获取签署文件对应关键字坐标
+     * @param $fileId
+     * @param $keywords
+     * @return array
+     */
     function getKeywordPositions($fileId,$keywords)
     {
         $config=$this->config;
@@ -131,355 +123,4 @@ class ESignContractServer
     }
 
 
-
-    function getFileStatus($fileId)
-    {
-        $config=$this->config;
-        $apiaddr="/v3/files/{$fileId}";
-        $requestType = HttpEmun::GET;
-        //生成签名验签+json体的header
-        $signAndBuildSignAndJsonHeader = EsignHttpHelper::signAndBuildSignAndJsonHeader($config['eSignAppId'], $config['eSignAppSecret'], "", $requestType, $apiaddr);
-        //发起接口请求
-//        EsignLogHelper::printMsg($signAndBuildSignAndJsonHeader);
-        $response = EsignHttpHelper::doCommHttp($config['eSignHost'], $apiaddr, $requestType, $signAndBuildSignAndJsonHeader, "");
-//        EsignLogHelper::printMsg($response->getStatus());
-//        EsignLogHelper::printMsg($response->getBody());
-        $ret=json_decode($response->getBody(),true);
-        if(isset($ret['code']) && $ret['code']==0){
-            return ['code'=>'1','msg'=>'ok','data'=>$ret['data']];
-        }else{
-            return ['code'=>'0','msg'=>$ret['message']];
-        }
-    }
-
-    /**
-     * 生成待电签记录
-     * @param $contractId
-     * @return void
-     */
-    function addSignContract($contractId)
-    {
-        $num=SignContract::where('contract_id',$contractId)->count();
-        if($num<=0){
-            SignContract::create(['contract_id'=>$contractId,'status' => 0,'file_id'=>'','msg'=>'']);
-        }
-    }
-
-    function setContractContract()
-    {
-        $list=SignContract::where('status',0)->limit(10)->get();
-        foreach ($list as $k=>$v){
-            $contract=FactoringContract::where('id',$v->{'contract_id'})->select(['id','file_no','name','status','signatory','property','factoring_id','firm_id','factor_id'])->first();
-            if(empty($contract)){
-                $v->update(['status' => 3,'msg'=>'合同信息不存在']);
-            }else{
-                $file=FactoringContractFile::where('file_no',$contract->{'file_no'})->where('type',2)->orderBy('id','desc')->select(['id','file_pdf','file_name','file_no','file_path','version'])->first();
-                if(empty($file)){
-                    sleep(1);
-                    continue;
-                }
-                if(empty($v['file_id'])){
-                    //上传E签宝文件模板
-                    $fileId=$this->fileUploadUrl($file);
-                    if(empty($fileId)){
-                        $v->update(['status' => 3,'msg'=>'合同模板上传失败']);
-                    }else{
-                        $v->update(['file_id' => $fileId,'contract_file_id'=>$file['id']]);
-                    }
-                    $file->update(['sign_file_id'=>$fileId]);
-                }else{
-                    $fileId=$v['file_id'];
-                }
-                //校验盖章区域
-                $signatory=$contract->{'signatory'};
-                $keywords=[];
-                if(in_array(1,$signatory)){
-                    $keywords[]=FactoringContractText::where('id',2)->value('custom');
-                }
-                if(in_array(5,$signatory)){
-                    $keywords[]=FactoringContractText::where('id',3)->value('custom');
-                }
-                if(empty($keywords)){
-                    $v->update(['status' => 3,'msg'=>'无需要电签']);
-                    continue;
-                }
-                $positionRet=ESignContractServer::creatServer()->getKeywordPositions($fileId,$keywords);
-                if(empty($positionRet['code'])){
-                    $v->update(['status' => 3,'msg'=>'签署区域定位失败']);
-                    continue;
-                }else{
-                    $positionData=$positionRet['data'];
-                }
-
-                $propertyIds=$contract->{'property'};
-                $propertyItem=FactoringProperty::whereIn('id',$propertyIds)->select(['id','firm_id','factor_id'])->first();
-                if(empty($propertyItem)){
-                    $v->update(['status' => 3,'msg'=>'资产信息异常']);
-                    continue;
-                }
-                $signers=[];
-                $isAuto=1;
-                $signUrl=[];
-                foreach ($positionData as $item){
-                    if(count($item['positions'])<=0){
-                        continue;
-                    }
-                    if($item['keyword']=='#转让方盖章处#'){
-                        $signType=1;
-                        $firmId=$contract['firm_id'];
-                    }else{
-                        $firmId=$contract['factor_id'];
-                        $signType=5;
-                    }
-                    $orgId=SignFirm::where('firm_id',$firmId)->value('org_id');
-                    $seal=SignSeal::where('firm_id',$firmId)->where('seal_type','CONTRACT')->select(['id','seal_id','is_auth'])->first();
-                    dump($seal);
-                    if(empty($orgId) || empty($seal)){
-                        continue;
-                    }
-                    $assignedSealId=$seal->{'seal_id'};
-                    $position=end($item['positions']);
-                    $coordinate=end($position['coordinates']);
-                    if($seal->{'is_auth'}){
-                        $sysOrgId=CommonServer::creatServer()->getConfigValue('sys_org_id');
-                        $signer=[
-                            "orgSignerInfo" => [
-                                "orgId" => $sysOrgId     //其他企业自动签署,设置orgId平台方id
-                            ],
-                            "signFields" =>[
-                                [
-                                    "fileId" =>$fileId,
-                                    "normalSignFieldConfig" => [
-                                        "autoSign" =>true,
-                                        "signFieldStyle" =>1,
-                                        "assignedSealId"=>$assignedSealId,    // 在signFields中设置 assignedSealId为授权企业印章id
-                                        "signFieldPosition" => [
-                                            "positionPage" =>$position['pageNum'].'',
-                                            "positionX" =>(int)$coordinate['positionX'],
-                                            "positionY" =>(int)$coordinate['positionY'],
-                                        ]
-                                    ]
-                                ]
-                            ],
-                            "signerType" =>1
-                        ];
-                    }else{
-                        $isAuto=0;
-                        $member=Member::where('firm_id',$firmId)->where('is_admin',1)->select(['id','phone','promissory_name','promissory_id_number'])->first();
-                        if(empty($member)){
-                            continue;
-                        }
-                        $firm=Firm::where('id',$firmId)->select(['id','firm_name','license_number'])->first();
-                        if(empty($firm)){
-                            continue;
-                        }
-                        $psnId=SignMember::where('m_id',$member->id)->value('psnId');
-                        if(empty($psnId)){
-                            continue;
-                        }
-                        //记录需要手动签署的
-                        $signUrl[]=[
-                            'promissoryName'=>$member['promissory_name'],
-                            'psnAccount'=>$member['phone'],
-                            'orgName'=>$firm->{'firm_name'},
-                            'type'=>$signType,
-                            'is_auto'=>0
-                        ];
-                        $signer=[
-                            "orgSignerInfo" => [
-                                "orgName" => $firm->{'firm_name'},
-                                'orgInfo'=>[
-                                    'orgIDCardNum'=>$firm->{'license_number'},
-                                    'orgIDCardType'=>'CRED_ORG_USCC',
-                                ],
-                                "transactorInfo"=>[
-                                    "psnAccount"=>$member['phone'],
-                                    'psnInfo'=>[
-                                        'psnIDCardNum'=>$member['promissory_id_number'],
-                                        'psnIDCardType'=>'CRED_PSN_CH_IDCARD'
-                                    ]
-                                ]
-
-                            ],
-                            "signFields" =>[
-                                [
-                                    "fileId" =>$fileId,
-                                    "normalSignFieldConfig" => [
-                                        "autoSign" =>false,
-                                        "signFieldStyle" =>1,
-                                        "assignedSealId"=>$assignedSealId,    // 在signFields中设置 assignedSealId为授权企业印章id
-                                        "signFieldPosition" => [
-                                            "positionPage" =>$position['pageNum'].'',
-                                            "positionX" =>(int)$coordinate['positionX'],
-                                            "positionY" =>(int)$coordinate['positionY'],
-                                        ]
-                                    ]
-                                ]
-                            ],
-                            "signerType" =>1
-                        ];
-                    }
-                    $signers[]=$signer;
-                }
-
-                if(empty($signers)){
-                    $v->update(['status' => 3,'msg'=>'暂无可执行电签印章']);
-                    continue;
-                }
-//                dd($signers);
-                $flowId=  $this->createByFile($fileId,$contract['name'].'.pdf',$contract['name'],$signers);
-                if($flowId){
-                    $v->update(['status' => $isAuto==1?2:1,'flow_id'=>$flowId]);
-                    if($signUrl){
-                        foreach ($signUrl as $item){
-//                        if($item['is_auto']){
-//                            FactoringContractSign::where('contract_id',$v['contract_id'])->where('signatory',$item['type'])->update(['sign_url'=>'','status' => 1]);
-//                            FinancingServer::creatServer()->signFinancingContract($v['factoring_id'],$v['id'],$item['type']);
-//                        }else{
-//
-//                        }
-                            $urlRet= $this->getSignUrl($flowId,$item['psnAccount'],$item['orgName']);
-                            if($urlRet){
-                                $content='尊敬的'.$item['promissoryName'].',您有待签署合同《'.$contract['name'].'》,点击签署 '.$urlRet;
-                                SmsServer::creatServer()->sendContent($item['psnAccount'],$content);
-                                FactoringContractSign::where('contract_id',$v['contract_id'])->where('signatory',$item['type'])->update(['sign_url'=>$urlRet]);
-                            }
-                        }
-                    }else{
-//                        $this->downloadFile($flowId);
-                        ContractServer::creatServer()->setContractFile($flowId);
-                    }
-
-                }else{
-                    $v->update(['status' => 3,'msg'=>'合同生成失败']);
-                }
-            }
-
-        }
-        return $list->count();
-    }
-
-
-
-
-    function getSignUrl($flowId,$psnAccount,$orgName){
-        EsignLogHelper::printMsg("**********获取合同文件签署链接开始**********");
-        $config=$this->config;
-
-        $apiaddr="/v3/sign-flow/%s/sign-url";
-        $apiaddr = sprintf($apiaddr,$flowId);
-        $requestType = HttpEmun::POST;
-        $data = [
-            "signFlowId" =>$flowId,
-            "clientType" =>"ALL",
-            "needLogin" =>false,
-            "operator" => [
-                "psnAccount" =>$psnAccount
-            ],
-            'organization'=>[
-                'orgName'=>$orgName
-            ],
-            "urlType" =>2
-        ];
-        $paramStr = json_encode($data);
-
-        $signAndBuildSignAndJsonHeader = EsignHttpHelper::signAndBuildSignAndJsonHeader($config['eSignAppId'], $config['eSignAppSecret'], $paramStr, $requestType, $apiaddr);
-
-        EsignLogHelper::printMsg($signAndBuildSignAndJsonHeader);
-        $response = EsignHttpHelper::doCommHttp($config['eSignHost'], $apiaddr, $requestType, $signAndBuildSignAndJsonHeader, $paramStr);
-        EsignLogHelper::printMsg($response->getStatus());
-        EsignLogHelper::printMsg($response->getBody());
-        $url= null;
-        if($response->getStatus() == 200){
-            $url =  json_decode($response->getBody())->data->shortUrl;
-            EsignLogHelper::printMsg("获取合同文件签署链接调用成功,url: ".$url);
-        }else{
-            EsignLogHelper::printMsg("获取合同文件签署链接接口调用失败,HTTP错误码".$response->getStatus());
-        }
-        EsignLogHelper::printMsg("**********获取合同文件签署链接调用结束**********");
-        return  $url;
-    }
-
-    /**
-     * 合同签署
-     * @param $fileId
-     * @return false
-     */
-    function createByFile($fileId,$fileName,$signFlowTitle,$signers)
-    {
-        EsignLogHelper::printMsg("**********基于文件发起签署调用开始**********");
-        $config=$this->config;
-        $apiaddr="/v3/sign-flow/create-by-file";
-        $requestType = HttpEmun::POST;
-
-        $data = [
-            "docs" =>[
-                [
-                    "fileId" =>$fileId,
-                    "fileName" =>$fileName
-                ]
-            ],
-            "signFlowConfig" => [
-                "signFlowTitle" =>$signFlowTitle,
-                "autoStart"=>true,
-                "autoFinish"=>true,
-                'notifyUrl'=>route('wps.esignNotify')
-            ],
-            "signers"=>$signers
-        ];
-//        dd($data);
-        $paramStr = json_encode($data);
-
-        $signAndBuildSignAndJsonHeader = EsignHttpHelper::signAndBuildSignAndJsonHeader($config['eSignAppId'], $config['eSignAppSecret'], $paramStr, $requestType, $apiaddr);
-
-        EsignLogHelper::printMsg($signAndBuildSignAndJsonHeader);
-        $response = EsignHttpHelper::doCommHttp($config['eSignHost'], $apiaddr, $requestType, $signAndBuildSignAndJsonHeader, $paramStr);
-        EsignLogHelper::printMsg($response->getStatus());
-        EsignLogHelper::printMsg($response->getBody());
-
-        $signFlowId = false;
-        if($response->getStatus() == 200){
-            $result = json_decode($response->getBody());
-            if($result->code==0){
-                $signFlowId = $result->data->signFlowId;
-                EsignLogHelper::printMsg("基于文件发起签署接口调用成功,flowId: ".$signFlowId);
-            }else{
-                EsignLogHelper::printMsg("基于文件发起签署接口调用失败,错误信息: ".$result->message);
-            }
-        }else{
-            EsignLogHelper::printMsg("基于文件发起签署接口调用失败,HTTP错误码".$response->getStatus());
-        }
-        EsignLogHelper::printMsg("**********基于文件发起签署调用结束**********");
-        return $signFlowId;
-    }
-
-
-    function downloadFile($flowId){
-        $config=$this->config;
-
-        EsignLogHelper::printMsg("**********下载已签署文件及附属材料开始**********");
-        $apiaddr="/v3/sign-flow/%s/file-download-url";
-        $apiaddr = sprintf($apiaddr,$flowId);
-        $requestType = HttpEmun::GET;
-        $paramStr = null;
-        $signAndBuildSignAndJsonHeader = EsignHttpHelper::signAndBuildSignAndJsonHeader($config['eSignAppId'], $config['eSignAppSecret'], $paramStr, $requestType, $apiaddr);
-
-        EsignLogHelper::printMsg($signAndBuildSignAndJsonHeader);
-        $response = EsignHttpHelper::doCommHttp($config['eSignHost'], $apiaddr, $requestType, $signAndBuildSignAndJsonHeader, $paramStr);
-        EsignLogHelper::printMsg($response->getStatus());
-        EsignLogHelper::printMsg($response->getBody());
-        if($response->getStatus() == 200){
-            EsignLogHelper::printMsg("下载已签署文件及附属材料调用成功: ".$response->getBody());
-            return json_decode($response->getBody(),true);
-        }else{
-            EsignLogHelper::printMsg("下载已签署文件及附属材料调用失败,HTTP错误码".$response->getStatus());
-        }
-        EsignLogHelper::printMsg("**********下载已签署文件及附属材料调用结束**********");
-        return  false;
-    }
-
-
-
-
-
 }

+ 1 - 1
app/Servers/ESign/ESignFirmServer.php

@@ -225,7 +225,7 @@ class ESignFirmServer
                     "get_org_identity_info","get_psn_identity_info","org_initiate_sign","psn_initiate_sign","manage_org_resource","manage_psn_resource","use_org_order"
                 ]
             ],
-            "notifyUrl"=>route('wps.esignNotify'),
+            "notifyUrl"=>route('notify.esignNotify'),
             "clientType"=>"ALL",
             "appScheme"=>""
         ];

+ 3 - 2
app/Servers/Wps/WordServer.php

@@ -78,8 +78,9 @@ class WordServer
             $phpWord->setValue($custom, $text);
         }
         CommonServer::creatServer()->creatDir('storage/contractComplete');
-        $phpWord->saveAs(public_path('storage/contractComplete/'.$file_name));
-        return true;
+        $new_path = 'storage/contractComplete/'.$file_name;
+        $phpWord->saveAs(public_path($new_path));
+        return $new_path;
     }
 
 

+ 1 - 0
routes/adminApi/contract.php

@@ -8,6 +8,7 @@ Route::group( ['domain' => env('APP_ADMIN_HOST'), 'prefix' => 'contract'],functi
     Route::match(['get','post'],'list', 'ContractController@getContractList')->name('adminApi.contract.list');// 列表
     Route::match(['get','post'],'save', 'ContractController@saveContract')->name('adminApi.contract.save');// 添加&编辑
     Route::match(['get','post'],'del', 'ContractController@delContract')->name('adminApi.contract.del'); //删除
+    Route::match(['get','post'],'info', 'ContractController@getContractInfo')->name('adminApi.contract.info'); //
 
 });
 

+ 1 - 0
routes/adminApi/firm.php

@@ -7,6 +7,7 @@ Route::group( ['domain' => env('APP_ADMIN_HOST'), 'prefix' => 'firm'],function($
 
     Route::match(['get','post'],'list', 'FirmController@getFirmList')->name('adminApi.firm.list');// 列表
     Route::match(['get','post'],'save', 'FirmController@saveFirm')->name('adminApi.firm.save');// 添加&编辑
+    Route::match(['get','post'],'info', 'FirmController@getFirmInfo')->name('adminApi.firm.info');//
 
 });
 

+ 1 - 0
routes/adminApi/member.php

@@ -7,6 +7,7 @@ Route::group( ['domain' => env('APP_ADMIN_HOST'), 'prefix' => 'member'],function
 
     Route::match(['get','post'],'list', 'MemberController@getMemberList')->name('adminApi.member.list');// 列表
     Route::match(['get','post'],'save', 'MemberController@saveMember')->name('adminApi.member.save');// 添加&编辑
+    Route::match(['get','post'],'info', 'MemberController@getMemberInfo')->name('adminApi.member.info');//
 
 });