add:1.生成合同,甲方公司不是平台公司时,需要满足与平台公司或上级公司签过合同才能签约。2.带上签约时的验证方式为人脸识别及其阈值。3.添加或编辑公司时,主联系人手机号不能重复使用

This commit is contained in:
chenbo 2023-09-07 09:46:54 +08:00
parent becb8c8386
commit ce3c0ce52f
3 changed files with 27 additions and 9 deletions

View File

@ -143,6 +143,7 @@ class JunziqianController extends BaseApiController
$request = new ApplySignReq();
$request->contractName = $data['name'];
$request->signatories = $data['signatories']; //签约方
$request->faceThreshold = 79; // 人脸识别阀值:默认等级(1-100之间整数),建议范围(60-79)
$request->serverCa = 1; //是否需要服务端云证书
$request->fileType = 1; //合同上传方式 url
$request->url = $data['url'];

View File

@ -20,6 +20,7 @@ use app\common\logic\BaseLogic;
use app\common\model\auth\Admin;
use app\common\model\contract\Contract;
use app\common\model\user\User;
use think\Exception;
use think\exception\ValidateException;
use think\facade\Db;
use app\adminapi\validate\CompanyValidate;
@ -54,6 +55,13 @@ class CompanyLogic extends BaseLogic
// if (!empty($exist)) {
// throw new ValidateException('该账号已经注册过企业');
// }
// 手机号不能重复
$companyInfo = Company::where(['master_phone'=>$params['master_phone']])->find();
if (!empty($companyInfo)) {
Db::rollback();
throw new Exception('手机号已存在');
}
$arr=[
'company_name' => $params['company_name'],
'organization_code' => $params['organization_code'],
@ -115,7 +123,7 @@ class CompanyLogic extends BaseLogic
$admin['phone']=$params['master_phone'];
$admin['create_time']=time();
$admin['update_time']=time();
$user_id=User::strict(false)->insertGetId($admin);
$user_id = User::strict(false)->insertGetId($admin);
Company::where('id',$data['id'])->update(['admin_id'=>$admin_id,'user_id'=>$user_id]);
$scheduling=[
@ -145,6 +153,12 @@ class CompanyLogic extends BaseLogic
{
Db::startTrans();
try {
// 手机号不能重复
$companyInfo = Company::where(['master_phone'=>$params['master_phone']])->find();
if (!empty($companyInfo)) {
Db::rollback();
throw new Exception('手机号已存在');
}
$arr=[
'company_name' => $params['company_name'],
'organization_code' => $params['organization_code'],

View File

@ -203,11 +203,14 @@ class ContractLogic extends BaseLogic
//生成合同
public static function Initiate_contract($data)
{
// 校验当前甲方公司是否签过合同
// $partyAModel = Contract::where(['party_b' => $data['party_a']])->find();
// if (empty($partyAModel)) {
// return self::setError('当前甲方暂无和平台或上级公司签约,请先进行签约');
// }
// 平台公司可以直接签合同,其他类型的公司需要做过合同乙方才能签合同
$partyACompamyInfo = Company::where(['id'=>$data['party_a']])->find();
if ($partyACompamyInfo['company_type'] != 30) {
$partyAModel = Contract::where(['party_b' => $data['party_a']])->find();
if (empty($partyAModel)) {
return self::setError('当前甲方暂无和平台或上级公司签约,请先进行签约');
}
}
$model = Contract::where(['party_b' => $data['party_b'],'contract_type'=>$data['contract_type']])->find();
if (empty($model)) {
$model = new Contract();
@ -258,10 +261,10 @@ class ContractLogic extends BaseLogic
$data = [
'name' => $name . '的合同',
'signatories' => [
['fullName' => $name, 'identityType' => 12, 'identityCard' => $result['organization_code'], 'email' => $result['master_email'], 'noNeedVerify' => 1, 'signLevel' => 1],
['fullName' => $result['contract']['party_a_info']['company_name'], 'identityType' => 12, 'identityCard' => $result['contract']['party_a_info']['organization_code'], 'email' => $result['contract']['party_a_info']['master_email'], 'noNeedVerify' => 1, 'signLevel' => 1]
['fullName' => $name, 'identityType' => 12, 'identityCard' => $result['organization_code'], 'email' => $result['master_email'], 'noNeedVerify' => 1, 'authLevel'=>[11],'signLevel' => 1],
['fullName' => $result['contract']['party_a_info']['company_name'], 'identityType' => 12, 'identityCard' => $result['contract']['party_a_info']['organization_code'], 'email' => $result['contract']['party_a_info']['master_email'], 'noNeedVerify' => 1, 'authLevel'=>[11],'signLevel' => 1]
],
'url' => $result['contract']['file']
'url' => $result['contract']['file'],
];
}else{
$name=$result['nickname'];