'0','msg'=>'error']); } if ($data['action'] == 'AUTH_PASS'){//实名认证通过通知 $authFlowId = $data['authFlowId']; if ($data['authType'] == 'PSN'){ $psnId = $data['psnInfo']['psnId']; //更新数据 $info = Member::where('authType','PSN') ->where('authFlowId',$authFlowId) ->update(['realnameStatus'=>1,'psnId'=>$psnId]); }elseif ($data['authType'] == 'ORG'){ $orgId = $data['organization']['orgId']; $orgName = $data['organization']['orgName']; //更新数据 $info = Firm::where('authType','ORG') ->where('firm_name',$orgName) ->where('realnameStatus',0) ->update(['realnameStatus'=>1,'orgId'=>$orgId]); } }elseif ($data['action'] == 'AUTHORIZE_FINISH'){//授权通知 $authFlowId = $data['authFlowId']; $psnId = $data['psnId']; $orgId = $data['orgId'] ?? ''; $authorizedInfo = json_encode($data['authorizedInfo']); if($orgId){ Firm::where('authFlowId',$authFlowId)->update(['authorizeUserInfo'=>1,'realnameStatus'=>1,'orgId'=>$orgId,'authorizedInfo'=>$authorizedInfo]); //检测系统内部的企业印章信息 // JobServer::creatServer()->createFirmSealJob($orgId); }else{ Member::where('authFlowId',$authFlowId)->update(['authorizeUserInfo'=>1,'realnameStatus'=>1,'psnId'=>$psnId,'authorizedInfo'=>$authorizedInfo]); //检测系统内部的企业印章信息 // JobServer::creatServer()->createMemberSealJob($psnId); } }elseif ($data['action'] == 'AUTHORIZE_CHANGE'){ //授权变更通知 }elseif ($data['action'] == 'SIGN_FLOW_COMPLETE'){ //合同签署 $signFlowStatus = $data['signFlowStatus']; $signFlowId = $data['signFlowId']; SignContract::where('flow_id',$signFlowId)->update(['status'=>$signFlowStatus]); }elseif ($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) && empty($organization)){//个人签署回调没有$organization信息 $psnId = $operator['psnId']; // SignRecord::where('sign_id',$sign_id)->where('authType','PSN')->where('id_no',$psnId)->update(['status'=>$signFlowStatus]); SignRecord::where('sign_id',$sign_id)->where('authType','PSN')->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]); SignRecord::where('sign_id',$sign_id)->where('authType','ORG')->update(['status'=>$signFlowStatus]); } } }elseif ($data['action']=='SEAL_AUTH_SIGN'){ // SealServer::creatServer()->sealNotify($data['authStatus'],$data['sealAuthBizId']); } return json_encode(['code'=>'200','msg'=>'success']); } }