Merge branch 'master' of https://gitea.lihaink.cn/mkm/TaskSystem into mkm
This commit is contained in:
commit
dadab9f08e
@ -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("主联系人证件号为空,无法上传企业人脸");
|
||||
}
|
||||
|
@ -12,15 +12,24 @@ class VehicleContractController extends BaseAdminController
|
||||
//风控中心上传合同
|
||||
public function uploadContract() {
|
||||
//获取参数
|
||||
$params = $this->request->post(['id','file']);
|
||||
$params = $this->request->post(['id','file','cars']);
|
||||
if(empty($params['id']) || empty($params['file'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
//获取合同信息
|
||||
$vehicle_contract = VehicleContract::where('id',$params['id'])->find();
|
||||
if(empty($vehicle_contract)){
|
||||
$vehicle_contract = VehicleContract::where('id',$params['id'])->findOrEmpty();
|
||||
if($vehicle_contract->isEmpty()){
|
||||
return $this->fail('合同信息错误');
|
||||
}
|
||||
if($vehicle_contract['type']==0 && $vehicle_contract['contract_logistic_id'] != 0){
|
||||
if(empty($params['cars'])){
|
||||
return $this->fail('缺少必要参数cars');
|
||||
}
|
||||
$cars = json_decode($params['cars'],true);
|
||||
if(empty($cars)){
|
||||
return $this->fail('参数cars无效');
|
||||
}
|
||||
}
|
||||
if($vehicle_contract['status'] != 0){
|
||||
return $this->fail('合同状态错误');
|
||||
}
|
||||
@ -29,13 +38,23 @@ class VehicleContractController extends BaseAdminController
|
||||
//判断合同类型
|
||||
if(!empty($vehicle_contract['contract_logistic_id'])){
|
||||
//更新物流系统
|
||||
curl_post(env('project.logistic_domain').'/api/updateContract',[],[
|
||||
curl_post(env('project.logistic_domain').'/api/contractUpdate',[],[
|
||||
'id' => $vehicle_contract['contract_logistic_id'],
|
||||
'file' => $params['file'],
|
||||
'status' => 1
|
||||
'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'],'status'=>1]);
|
||||
|
||||
}catch (\Exception $e){
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
@ -131,8 +150,8 @@ class VehicleContractController extends BaseAdminController
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
//获取数据
|
||||
$contract = VehicleContract::where('id',$params['id'])->find();
|
||||
if(empty($contract)){
|
||||
$contract = VehicleContract::where('id',$params['id'])->findOrEmpty();
|
||||
if($contract->isEmpty()){
|
||||
return $this->fail('数据不存在');
|
||||
}
|
||||
if($contract['status'] != 1){
|
||||
@ -162,8 +181,8 @@ class VehicleContractController extends BaseAdminController
|
||||
|
||||
public function sendSms($id,$title) {
|
||||
//获取合同数据
|
||||
$contract = VehicleContract::where('id',$id)->find();
|
||||
if ($contract && !$contract->isEmpty() && $contract['file'] != '') {
|
||||
$contract = VehicleContract::where('id',$id)->findOrEmpty();
|
||||
if (!$contract->isEmpty() && $contract['file'] != '') {
|
||||
//发送短信
|
||||
$data = [
|
||||
//甲方
|
||||
@ -227,8 +246,18 @@ class VehicleContractController extends BaseAdminController
|
||||
if(empty($id)){
|
||||
$this->fail('参数错误');
|
||||
}
|
||||
$data = VehicleContract::where('id',$id)->find();
|
||||
$data['cars_info'] = json_decode($data['cars_info'],true);
|
||||
$data = VehicleContract::where('id',$id)->findOrEmpty();
|
||||
if($data->isEmpty()){
|
||||
return $this->fail('未查找到数据');
|
||||
}
|
||||
//判断合同类型
|
||||
if($data['type'] == 0 && $data['contract_logistic_id'] != 0){
|
||||
//获取平台车辆
|
||||
$carList = curl_get(env('project.logistic_domain').'/api/getAvailableVehicles');
|
||||
$data['car_list'] = $carList&&$carList['code']==1 ? $carList['data'] : [];
|
||||
}else{
|
||||
$data['cars_info'] = json_decode($data['cars_info'],true);
|
||||
}
|
||||
return $this->success('success',$data->toArray());
|
||||
}
|
||||
}
|
@ -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'],
|
||||
@ -428,8 +429,12 @@ class IndexController extends BaseApiController
|
||||
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);
|
||||
@ -167,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首页
|
||||
|
@ -67,7 +67,7 @@ class TaskController extends BaseApiController
|
||||
$find['transaction_pool']=$transaction_pool;
|
||||
}
|
||||
$res[$k]['extend']['transaction'] = $find;
|
||||
Task::where('id',$item['id'])->update(['extend'=>json_encode(['transaction'=>$find],true)]);
|
||||
// Task::where('id',$item['id'])->update(['extend'=>json_encode(['transaction'=>$find],true)]);
|
||||
} else {
|
||||
$res[$k]['extend']['transaction'] = '';
|
||||
}
|
||||
|
@ -33,6 +33,14 @@ class VehicleController extends BaseApiController
|
||||
if($params['num'] > $doubleRentCar ){
|
||||
return $this->fail('数量超过可再租车辆数');
|
||||
}
|
||||
//判断物流车辆
|
||||
$checkNum = curl_post(env('project.logistic_domain').'/api/checkCarNum',[],['num'=>$params['num']]);
|
||||
if($checkNum == null){
|
||||
return $this->fail('检查车辆数量错误');
|
||||
}
|
||||
if($checkNum['code'] == 0){
|
||||
return $this->fail($checkNum['msg']);
|
||||
}
|
||||
//查找乙方公司信息
|
||||
$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)) {
|
||||
@ -196,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)){
|
||||
@ -225,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,
|
||||
@ -241,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] ?? '';
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ class CompanyLogic extends BaseLogic
|
||||
// 手机号不能重复
|
||||
$companyInfo = Company::where(['master_phone'=>$params['master_phone']])->find();
|
||||
if (!empty($companyInfo)) {
|
||||
Db::rollback();
|
||||
throw new Exception('手机号已存在');
|
||||
}
|
||||
$arr=[
|
||||
@ -74,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'],
|
||||
@ -132,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) {
|
||||
@ -141,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 编辑
|
||||
@ -154,7 +208,7 @@ class CompanyLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
// 手机号不能重复
|
||||
$companyInfo = Company::where(['master_phone'=>$params['master_phone']])->find();
|
||||
$companyInfo = Company::where(['master_phone'=>$params['master_phone']])->where('id','<>',$params['id'])->find();
|
||||
if (!empty($companyInfo)) {
|
||||
Db::rollback();
|
||||
throw new Exception('手机号已存在');
|
||||
|
@ -76,14 +76,14 @@ class TaskLogic extends BaseLogic
|
||||
try {
|
||||
$v['day_count']=$v['day_count']+1;
|
||||
if ($v['types'] == 3) {
|
||||
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;
|
||||
// }
|
||||
$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;
|
||||
}
|
||||
}
|
||||
$v['day_count']=$v['day_count']+1;
|
||||
$time = strtotime(date('Y-m-d'));
|
||||
$TaskSchedulingPlan_data = [
|
||||
'create_user_id' => 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user