Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
681087341d
@ -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,14 @@ 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'],'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());
|
||||
}
|
||||
@ -131,8 +141,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 +172,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 +237,18 @@ class VehicleContractController extends BaseAdminController
|
||||
if(empty($id)){
|
||||
$this->fail('参数错误');
|
||||
}
|
||||
$data = VehicleContract::where('id',$id)->find();
|
||||
$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());
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
@ -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'],
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -74,13 +74,16 @@ class TaskLogic extends BaseLogic
|
||||
public static function CronAdd(array $v, $datas): bool
|
||||
{
|
||||
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();
|
||||
TaskTemplate::where('id', $v['id'])->inc('information_day_count', 5)->update();
|
||||
return true;
|
||||
}
|
||||
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;
|
||||
// }
|
||||
}
|
||||
$time = strtotime(date('Y-m-d'));
|
||||
$TaskSchedulingPlan_data = [
|
||||
@ -177,7 +180,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,8 +94,7 @@ 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]);
|
||||
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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user