commit
de91da0904
@ -193,13 +193,23 @@ class CompanyController extends BaseAdminController
|
||||
'business_license' => 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/561f8202305171526091317.png', //$qualification['business_license'],
|
||||
'master_name' => $company['master_name'],
|
||||
'master_email' => $company['master_email'],
|
||||
'master_phone' => $company['master_phone'],
|
||||
'master_id_card' => $company['master_id_card'],
|
||||
'id' => $company['id'],
|
||||
];
|
||||
$res = app(JunziqianController::class)->EnterpriseCertification($data);
|
||||
if ($res->success == true) {
|
||||
Db::name('company')->where('id', $params['id'])->update(['master_email' => $res->data,'is_authentication'=>1]);
|
||||
return $this->success('认证成功',[],1, 1);
|
||||
// return $this->success('系统认证中,请稍后刷新页面查看', ['email' => $res->data], 1, 1);
|
||||
$email = substr(uniqid(),2,5).$res->data;
|
||||
// 企业人脸上传
|
||||
// $company['master_email'] = $email; // 法人邮箱
|
||||
// $faceCreateRe = CompanyLogic::originationFaceCreate($company);
|
||||
// if ($faceCreateRe !== true) {
|
||||
// return $this->fail($faceCreateRe);
|
||||
// }
|
||||
// 修改法人邮箱
|
||||
Db::name('company')->where('id', $params['id'])->update(['master_email' => $email]);
|
||||
// return $this->success('认证成功',[],1, 1);
|
||||
return $this->success('系统认证中,请稍后刷新页面查看', ['email' => $res->data], 1, 1);
|
||||
} else {
|
||||
return $this->fail($res->msg);
|
||||
}
|
||||
@ -220,6 +230,8 @@ class CompanyController extends BaseAdminController
|
||||
'business_license' => 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/561f8202305171526091317.png', //$qualification['business_license'],
|
||||
'master_name' => $company['master_name'],
|
||||
'master_email' => $company['master_email'],
|
||||
'master_phone' => $company['master_phone'],
|
||||
'master_id_card' => $company['master_id_card'],
|
||||
];
|
||||
$res = app(JunziqianController::class)->organizationReapply($data);
|
||||
if ($res->success == true) {
|
||||
@ -236,33 +248,17 @@ class CompanyController extends BaseAdminController
|
||||
{
|
||||
$params = (new CompanyValidate())->goCheck('detail');
|
||||
$company = Db::name('company')->where('id', $params['id'])->find();
|
||||
// 公司数据合法性校验
|
||||
$this->companyCheck($company);
|
||||
|
||||
$data = [
|
||||
'company_name' => $company['company_name'],
|
||||
'organization_code' => $company['organization_code'],
|
||||
'master_name' => $company['master_name'],
|
||||
'master_id_card' => $company['master_id_card'],
|
||||
'master_email' => $company['master_email'],
|
||||
'master_phone' => $company['master_phone'],
|
||||
'id' => $company['id'],
|
||||
];
|
||||
$res = app(JunziqianController::class)->organizationFaceCreate($data);
|
||||
if ($res->success == true && !empty($res->data)) {
|
||||
return $this->success('成功',["faceCreateUrl"=>$res->data],1, 1);
|
||||
$re = CompanyLogic::originationFaceCreate($company);
|
||||
if ($re === true) {
|
||||
return $this->success('成功',[],1, 1);
|
||||
} else {
|
||||
return $this->fail($res->msg);
|
||||
return $this->fail($re);
|
||||
}
|
||||
|
||||
}
|
||||
private function companyCheck($company) {
|
||||
if (empty($company)) {
|
||||
return $this->fail("公司不存在");
|
||||
}
|
||||
if (empty($company['master_face'])) {
|
||||
return $this->fail("未上传主联系人头像信息,无法上传企业人脸");
|
||||
}
|
||||
if(empty($company['master_id_card'])) {
|
||||
return $this->fail("主联系人证件号为空,无法上传企业人脸");
|
||||
}
|
||||
|
@ -44,8 +44,17 @@ class VehicleContractController extends BaseAdminController
|
||||
'status' => 1,
|
||||
'cars_info' => $params['cars']
|
||||
]);
|
||||
VehicleContract::where('id', $params['id'])->update(['file' => $params['file'],'cars_info' => $params['cars'],'status'=>1]);
|
||||
}else{
|
||||
//更新物流系统
|
||||
curl_post(env('project.logistic_domain').'/api/contractUpdate',[],[
|
||||
'id' => $vehicle_contract['contract_logistic_id'],
|
||||
'file' => $params['file'],
|
||||
'status' => 1,
|
||||
]);
|
||||
VehicleContract::where('id', $params['id'])->update(['file' => $params['file'],'status'=>1]);
|
||||
}
|
||||
VehicleContract::where('id', $params['id'])->update(['file' => $params['file'],'cars_info' => $params['cars'],'status'=>1]);
|
||||
|
||||
}catch (\Exception $e){
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ use app\common\model\task_scheduling\TaskScheduling;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\Company;
|
||||
use think\db\Where;
|
||||
|
||||
/**
|
||||
* 任务公司排期列表
|
||||
@ -39,7 +40,7 @@ class TaskSchedulingLists extends BaseAdminDataLists implements ListsSearchInter
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['create_user_id', 'company_id', 'company_type', 'status'],
|
||||
'=' => ['company_type', 'status'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -55,20 +56,24 @@ class TaskSchedulingLists extends BaseAdminDataLists implements ListsSearchInter
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
if(isset($params['company_id']) && $params['company_id']!=''){
|
||||
$arr= Company::where('company_name','like','%'.$params['company_id'].'%')->column('id');
|
||||
if($arr){
|
||||
$where[]=['party_a|party_b','in',$arr];
|
||||
}
|
||||
}
|
||||
if(isset($params['create_user_id']) && $params['create_user_id']!=''){
|
||||
$arr= Admin::where('name','like','%'.$params['create_user_id'].'%')->column('id');
|
||||
if($arr){
|
||||
$where[]=['area_manager','in',$arr];
|
||||
}
|
||||
}
|
||||
$params = $this->request->param();
|
||||
$where = [];
|
||||
if (isset($params['company_id']) && $params['company_id'] != '') {
|
||||
$arr = Company::where('company_name', 'like', '%' . $params['company_id'] . '%')->column('id');
|
||||
if ($arr) {
|
||||
$where[] = ['company_id', 'in', $arr];
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->adminInfo['root'] != 1) {
|
||||
$arr = Company::where('area_manager', $this->adminId)->column('id');
|
||||
if ($arr) {
|
||||
$where[] = ['company_id', 'in', $arr];
|
||||
}
|
||||
}
|
||||
return TaskScheduling::where($this->searchWhere)
|
||||
->with(['admin','company','company_type'])
|
||||
->where($where)
|
||||
->with(['admin', 'company', 'company_type'])
|
||||
// ->field(['id', 'create_user_id', 'company_id', 'company_type', 'status'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
@ -87,5 +92,4 @@ class TaskSchedulingLists extends BaseAdminDataLists implements ListsSearchInter
|
||||
{
|
||||
return TaskScheduling::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class CeshiController extends BaseApiController
|
||||
|
||||
// TaskTemplate::where('id',109)->update(['transaction_pool'=>bcadd($transaction_pool,$day_money,2)]);
|
||||
// }
|
||||
$all=TaskSchedulingPlan::where('id',928)->with(['template_info','scheduling'])->select()->toArray();
|
||||
$all=TaskSchedulingPlan::where('id',943)->with(['template_info','scheduling'])->select()->toArray();
|
||||
foreach($all as $k=>$v){
|
||||
queue(TaskInformationJob::class,$v);
|
||||
}
|
||||
@ -50,7 +50,7 @@ return true;
|
||||
$plan_all = TaskScheduling::where('id',119)->with('company_info')->select()->toArray();
|
||||
$plan_ids = [];
|
||||
foreach ($plan_all as $k => $v) {
|
||||
$all = TaskTemplate::where('id', 118)->where('task_scheduling', $v['id'])->limit(30)->select()->toArray();
|
||||
$all = TaskTemplate::where('id', 116)->where('task_scheduling', $v['id'])->limit(30)->select()->toArray();
|
||||
$plan_ids[] = $v['id'];
|
||||
if ($all) {
|
||||
$plan_all[$k]['template'] = $all;
|
||||
|
@ -19,7 +19,7 @@ class HetongController extends BaseApiController
|
||||
{
|
||||
|
||||
|
||||
public array $notNeedLogin = ['url','info'];
|
||||
public array $notNeedLogin = ['url','info', 'toFaceCreate'];
|
||||
|
||||
public function url()
|
||||
{
|
||||
@ -55,4 +55,20 @@ class HetongController extends BaseApiController
|
||||
}
|
||||
return '<style type="text/css"> * { padding: 0; margin: 0; } div { padding: 4px 48px; } a { color: #2E5CD5; cursor: pointer; text-decoration: none } a:hover { text-decoration: underline; } body { background: #fff; font-family: "Century Gothic", "Microsoft yahei"; color: #333; font-size: 18px; } h1 { font-size: 100px; font-weight: normal; margin-bottom: 12px; } p { line-height: 1.6em; font-size: 42px } </style> <div style="padding: 24px 48px;"> <h1>:) </h1> <p></p> </div>';
|
||||
}
|
||||
|
||||
// 用户做人脸识别时,作跳板的短信链接
|
||||
public function toFaceCreate()
|
||||
{
|
||||
$id = Request()->get('id');
|
||||
$msg='地址不存在';
|
||||
if ($id) {
|
||||
$find = Db::name('company')->where('id', $id)->find();
|
||||
if ($find && $find['face_create_url']) {
|
||||
return redirect($find['face_create_url']);
|
||||
} else {
|
||||
$msg='参数错误';
|
||||
}
|
||||
}
|
||||
return '<style type="text/css"> * { padding: 0; margin: 0; } div { padding: 4px 48px; } a { color: #2E5CD5; cursor: pointer; text-decoration: none } a:hover { text-decoration: underline; } body { background: #fff; font-family: "Century Gothic", "Microsoft yahei"; color: #333; font-size: 18px; } h1 { font-size: 100px; font-weight: normal; margin-bottom: 12px; } p { line-height: 1.6em; font-size: 42px } </style> <div style="padding: 24px 48px;"> <h1>:) </h1> <p>'.$msg.'</p> </div>';
|
||||
}
|
||||
}
|
||||
|
@ -250,6 +250,7 @@ class IndexController extends BaseApiController
|
||||
$vehicle = json_decode($contract['cars_info'], true);
|
||||
$curl_res = curl_post(env('project.logistic_domain').'/api/addSelfCar', [], [
|
||||
'license' => $vehicle['license'],
|
||||
'pic' => $vehicle['pic'],
|
||||
'company_id' => $contract['company_a_id'],
|
||||
'company_name' => $contract['company_a_name'],
|
||||
'company_user' => $contract['company_a_user'],
|
||||
@ -424,12 +425,16 @@ class IndexController extends BaseApiController
|
||||
public function notifyAuthentication()
|
||||
{
|
||||
$parmas = Request()->param();
|
||||
Log::info('认证回调:'.$parmas);
|
||||
Log::info(['认证回调:',$parmas]);
|
||||
try {
|
||||
if ($parmas) {
|
||||
$data=json_decode($parmas['data'],true);
|
||||
if($data['status']==1){
|
||||
Company::where('id', $parmas['id'])->update(['is_authentication' => 1]);
|
||||
}
|
||||
if($data['status']==2){
|
||||
Company::where('id', $parmas['id'])->update(['is_authentication' => 2]);
|
||||
// 记录认证失败原因
|
||||
Db::name('company_authentication_fail_log')->insert(['company_id'=>$parmas['id'],'fail_reason'=>$data['msg']]);
|
||||
}
|
||||
return json(['success' => true, 'msg' => '成功']);
|
||||
}
|
||||
|
@ -77,6 +77,8 @@ class JunziqianController extends BaseApiController
|
||||
$request->organizationRegNo = $data['organization_code'];
|
||||
$request->organizationRegImg = $data['business_license']; //new CURLFile('D:/tmp/test.png',null,"test.png");
|
||||
$request->legalName = $data["master_name"]; //法人
|
||||
$request->legalIdentityCard = $data["master_id_card"]; // 法人身份证 签约时人脸识别需要
|
||||
$request->legalMobile = $data["master_phone"]; // 法人手机号 预留 签约时短信验证需要
|
||||
if (isset($data['master_email'])) {
|
||||
$request->emailOrMobile = $data['master_email']; //邮箱
|
||||
}
|
||||
@ -99,6 +101,8 @@ class JunziqianController extends BaseApiController
|
||||
$request->organizationRegNo = $data['organization_code'];
|
||||
$request->organizationRegImg = $data['business_license']; //new CURLFile('D:/tmp/test.png',null,"test.png");
|
||||
$request->legalName = $data["master_name"]; //法人
|
||||
$request->legalIdentityCard = $data["master_id_card"]; // 法人身份证 签约时人脸识别需要
|
||||
$request->legalMobile = $data["master_phone"]; // 法人手机号 预留 短信验证需要
|
||||
$request->emailOrMobile = $data['master_email']; //邮箱
|
||||
//发起创建企业请求
|
||||
$response = $requestUtils->doPost("/v2/user/organizationReapply", $request);
|
||||
@ -143,6 +147,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'];
|
||||
@ -166,7 +171,6 @@ class JunziqianController extends BaseApiController
|
||||
$request-> legalPersonName = $data['master_name'];
|
||||
$request-> legalIdentityCard = $data['master_id_card'];//法人证件号
|
||||
$request-> legalMobile = $data['master_phone'];
|
||||
$request-> facePerType = 1; // 1代理人
|
||||
$request-> faceAgantIdenName = $data['master_name'];
|
||||
$request-> faceAgantIdenCard = $data['master_id_card'];
|
||||
$request-> backUrl = env('url.url_prefix').'/mobile'; // 做完人脸识别后,指定跳转到供销系统mobile首页
|
||||
|
@ -21,6 +21,7 @@ use app\api\validate\SetUserInfoValidate;
|
||||
use app\api\validate\UserValidate;
|
||||
use app\common\logic\contract\ContractLogic;
|
||||
use app\common\model\contract\Contract;
|
||||
use app\common\model\user\User;
|
||||
use Common;
|
||||
use think\facade\Db;
|
||||
|
||||
@ -209,4 +210,14 @@ class UserController extends BaseApiController
|
||||
return $this->fail(ContractLogic::getError());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公司以设置的小队
|
||||
*/
|
||||
public function company_brigade(){
|
||||
$company_id=$this->userInfo['company_id'];
|
||||
$res=User::where('company_id',$company_id)->where('is_captain',1)->column('brigade');
|
||||
return $this->success('发送成功', $res);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ class VehicleController extends BaseApiController
|
||||
if($checkNum['code'] == 0){
|
||||
return $this->fail($checkNum['msg']);
|
||||
}
|
||||
dump($checkNum);die;
|
||||
//查找乙方公司信息
|
||||
$party_b = Company::field('id,company_name,organization_code,master_name,master_phone,master_email,company_type')->where('id',$this->userInfo['company_id'])->find();
|
||||
if(empty($party_b)) {
|
||||
@ -205,7 +204,15 @@ class VehicleController extends BaseApiController
|
||||
return $this->fail('请求类型错误');
|
||||
}
|
||||
//获取参数
|
||||
$license = $this->request->post('license');
|
||||
$params = $this->request->post(['type','license','pic']);
|
||||
if(!isset($params['type'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
if($params['type'] == 1){
|
||||
if(empty($params['license']) || empty($params['pic'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
}
|
||||
//获取当前公司信息
|
||||
$party_b = Company::field('id,company_name,master_name,master_phone,master_email,is_contract,organization_code,company_type')->where('id',$this->userInfo['company_id'])->find();
|
||||
if(empty($party_b)){
|
||||
@ -234,6 +241,13 @@ class VehicleController extends BaseApiController
|
||||
if(!empty($vehicleContract)){
|
||||
return $this->fail('请勿重复申请');
|
||||
}
|
||||
if($params['type'] == 1){
|
||||
$cars_info = json_encode(['license'=>$params['license'],'pic'=>$params['pic']]);
|
||||
$car_type = 1;
|
||||
}else{
|
||||
$cars_info = null;
|
||||
$car_type = 0;
|
||||
}
|
||||
//设置数据
|
||||
$data = [
|
||||
'contract_logistic_id' => 0,
|
||||
@ -250,9 +264,9 @@ class VehicleController extends BaseApiController
|
||||
'company_b_user' => $party_b['master_name'],
|
||||
'company_b_phone' => $party_b['master_phone'],
|
||||
'company_b_email' => $party_b['master_email'],
|
||||
'cars_info' => isset($license) ? json_encode(['license'=>$license]) : null,
|
||||
'cars_info' => $cars_info,
|
||||
'num' => 1,
|
||||
'type' => isset($license) ? 1 : 0,
|
||||
'type' => $car_type,
|
||||
'status' => -1,
|
||||
'create_time' => time(),
|
||||
'update_time' => time()
|
||||
|
@ -40,6 +40,8 @@ class NoticeEnum
|
||||
const FCHT = 106;
|
||||
const WQTZ = 107;
|
||||
|
||||
const FACE_CREATE = 108;
|
||||
|
||||
|
||||
/**
|
||||
* 验证码场景
|
||||
@ -95,6 +97,7 @@ class NoticeEnum
|
||||
self::WQ => '网签短信',
|
||||
self::FCHT => '废除合同',
|
||||
self::WQTZ => '网签通知',
|
||||
self::FACE_CREATE => '人脸识别上传通知',
|
||||
];
|
||||
|
||||
if ($flag) {
|
||||
@ -129,6 +132,7 @@ class NoticeEnum
|
||||
'FCHT'=>self::FCHT,
|
||||
|
||||
'WQTZ'=>self::WQTZ,
|
||||
'FACE_CREATE'=>self::FACE_CREATE,
|
||||
];
|
||||
return $scene[$tag] ?? '';
|
||||
}
|
||||
|
@ -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,12 @@ class CompanyLogic extends BaseLogic
|
||||
// if (!empty($exist)) {
|
||||
// throw new ValidateException('该账号已经注册过企业');
|
||||
// }
|
||||
|
||||
// 手机号不能重复
|
||||
$companyInfo = Company::where(['master_phone'=>$params['master_phone']])->find();
|
||||
if (!empty($companyInfo)) {
|
||||
throw new Exception('手机号已存在');
|
||||
}
|
||||
$arr=[
|
||||
'company_name' => $params['company_name'],
|
||||
'organization_code' => $params['organization_code'],
|
||||
@ -66,7 +73,7 @@ class CompanyLogic extends BaseLogic
|
||||
'address' => $params['address'],
|
||||
'company_type' => $params['company_type'],
|
||||
'master_name' => $params['master_name'],
|
||||
'master_id_card' => $params['id_card'], // 主联系人证件号
|
||||
'master_id_card' => $params['id_card'], // 主联系人证件号 todo DDL 新增字段
|
||||
'master_position' => $params['master_position'],
|
||||
'master_phone' => $params['master_phone'],
|
||||
'master_email' => $params['master_email'],
|
||||
@ -115,7 +122,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=[
|
||||
@ -124,6 +131,9 @@ class CompanyLogic extends BaseLogic
|
||||
'company_type'=>$params['company_type'],
|
||||
];
|
||||
TaskScheduling::create($scheduling);
|
||||
|
||||
// 企业人脸校验上传
|
||||
// self::originationFaceCreate($data);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
@ -133,6 +143,58 @@ class CompanyLogic extends BaseLogic
|
||||
}
|
||||
}
|
||||
|
||||
public static function originationFaceCreate($data)
|
||||
{
|
||||
// 人脸识别校验上传
|
||||
$organizationFaceCreateData = [
|
||||
'company_name' => $data['company_name'],
|
||||
'organization_code' => $data['organization_code'],
|
||||
'master_name' => $data['master_name'],
|
||||
'master_id_card' => $data['master_id_card'],
|
||||
'master_email' => $data['master_email'],
|
||||
'master_phone' => $data['master_phone'],
|
||||
'id' => $data['id'],
|
||||
];
|
||||
|
||||
// 公司数据合法性校验
|
||||
$checkCompany = self::companyCheck($organizationFaceCreateData);
|
||||
if ($checkCompany !== true){
|
||||
return $checkCompany;
|
||||
}
|
||||
|
||||
$res = app(JunziqianController::class)->organizationFaceCreate($data);
|
||||
if ($res->success == true && !empty($res->data)) {
|
||||
// 保存人脸识别地址 todo 新增字段的DDL
|
||||
Company::where('id',$data['id'])->update(['face_create_url'=>$res->data]);
|
||||
// 发送短信给法人
|
||||
$sms = [
|
||||
'mobile' => $data['master_phone'],
|
||||
'name' => $data['master_name'],
|
||||
'code' => 'api/Hetong/toFaceCreate?id=' . $data['id'],
|
||||
'scene' => 'FACE_CREATE',
|
||||
'type' => ''
|
||||
];
|
||||
$smsRes = SmsLogic::contractUrl($sms);
|
||||
if ($smsRes != true) {
|
||||
return SmsLogic::getError();
|
||||
}
|
||||
} else {
|
||||
return $res->msg;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private static function companyCheck($company) {
|
||||
if (empty($company)) {
|
||||
return self::setError("公司不存在");
|
||||
}
|
||||
if(empty($company['master_id_card'])) {
|
||||
return self::setError("主联系人身份证为空,无法进行人脸识别");
|
||||
}
|
||||
if(empty($company['master_email'])) {
|
||||
return self::setError("主联系人邮箱为空,无法进行人脸识别");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑
|
||||
@ -145,6 +207,12 @@ class CompanyLogic extends BaseLogic
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
// 手机号不能重复
|
||||
$companyInfo = Company::where(['master_phone'=>$params['master_phone']])->where('id','<>',$params['id'])->find();
|
||||
if (!empty($companyInfo)) {
|
||||
Db::rollback();
|
||||
throw new Exception('手机号已存在');
|
||||
}
|
||||
$arr=[
|
||||
'company_name' => $params['company_name'],
|
||||
'organization_code' => $params['organization_code'],
|
||||
|
@ -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'];
|
||||
|
@ -75,12 +75,13 @@ class TaskLogic extends BaseLogic
|
||||
{
|
||||
try {
|
||||
if ($v['types'] == 3) {
|
||||
$task = Task::where('template_id', $v['id'])->find();
|
||||
if ($task) {
|
||||
Task::where('template_id', $v['id'])->update(['start_time' => $task['start_time'] + 86400, 'end_time' => $task['end_time'] + 86400]);
|
||||
TaskTemplate::where('id', $v['id'])->inc('day_count')->update();
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
// $task = Task::where('template_id', $v['id'])->find();
|
||||
// if ($task) {
|
||||
// Task::where('template_id', $v['id'])->update(['start_time' => strtotime($task['start_time']) + 86400, 'end_time' => strtotime($task['end_time']) + 86400]);
|
||||
// TaskTemplate::where('id', $v['id'])->inc('day_count')->update();
|
||||
// return true;
|
||||
// }
|
||||
}
|
||||
$time = strtotime(date('Y-m-d'));
|
||||
$TaskSchedulingPlan_data = [
|
||||
@ -177,7 +178,7 @@ class TaskLogic extends BaseLogic
|
||||
TaskTemplate::where('id', $v['id'])->inc('day_count')->update();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Log::error('定时任务添加失败'.$e->getMessage().'line'.$e->getLine());
|
||||
Log::error('定时任务添加失败'.$e->getMessage().'。line:'.$e->getLine());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ class TaskInformationJob
|
||||
if ($data['template_info']['information_count'] < $data['template_info']['information_day_count']) {
|
||||
Log::info('信息更新任务,信息更新未达到要求:' . json_encode($data));
|
||||
Task::where('id', $data['task_id'])->update(['status' => 5]);
|
||||
TaskTemplate::where('id',$data['template_id'])->update(['information_count'=>$data['template_info']['information_day_count']]);
|
||||
return false;
|
||||
}
|
||||
$name = '小组队长';
|
||||
@ -83,7 +84,7 @@ class TaskInformationJob
|
||||
}elseif
|
||||
//入股任务
|
||||
($data['template_info']['type'] == 35){
|
||||
$task_35 = Task::where('id', $data['task_id'])->field('director_uid,status,money')->with('director_info')->find();
|
||||
$task_35 = Task::where('id', $data['task_id'])->field('director_uid,status,money,start_time,end_time')->with('director_info')->find();
|
||||
if($task_35){
|
||||
$day= $data['template_info']['stage_day_one'] + $data['template_info']['stage_day_two'];
|
||||
if($task_35['status']==3 && $data['template_info']['day_count']<=$day){
|
||||
@ -93,9 +94,8 @@ class TaskInformationJob
|
||||
$arr['company_account_type'] = 2;
|
||||
}else{
|
||||
if($data['template_info']['day_count']<=$day){
|
||||
$time = strtotime(date('Y-m-d'));
|
||||
Task::where('id', $data['task_id'])->update(['create_time' => $time,'end_time' => $time + 86399,'start_time'=>$time,'end_time'=> $time + 86399]);
|
||||
return false;
|
||||
Task::where('id', $data['task_id'])->update(['create_time' => $task_35['start_time']+86400,'update_time' =>time(),'start_time'=>$task_35['start_time']+86400,'end_time'=> strtotime($task_35['end_time']) + 86400]);
|
||||
return false;
|
||||
}
|
||||
if($data['template_info']['day_count']>$day){
|
||||
Task::where('id', $data['task_id'])->update(['status' =>5]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user