This commit is contained in:
unknown 2023-09-01 09:49:27 +08:00
parent c6c82d08c5
commit 42e34baa6e
3 changed files with 11 additions and 10 deletions

View File

@ -78,7 +78,6 @@ class ContractController extends BaseAdminController
"identityType" => 12, "identityType" => 12,
"master_phone" => $contract['company_b_phone'], "master_phone" => $contract['company_b_phone'],
"type"=>"party_b" "type"=>"party_b"
], ],
]; ];

View File

@ -29,13 +29,9 @@ use think\response\Json;
*/ */
class IndexController extends BaseApiController class IndexController extends BaseApiController
{ {
public array $notNeedLogin = ['index', 'config', 'policy', 'decorate','notifyUrl']; public array $notNeedLogin = ['index', 'config', 'policy', 'decorate','notifyUrl'];
private $domain = 'https://worker-task.lihaink.cn'; private $domain = 'https://worker-task.lihaink.cn';
// private $domain = 'http://www.task.local';
/** /**
* @notes 首页数据 * @notes 首页数据
@ -110,19 +106,25 @@ class IndexController extends BaseApiController
if($contract['status'] != 2){ if($contract['status'] != 2){
return json(['success' => false, 'msg' => '合同状态错误']); return json(['success' => false, 'msg' => '合同状态错误']);
} }
$vehicle = json_decode($contract['cars_info'],true);
if ($contract['signing_timer'] == 0) { if ($contract['signing_timer'] == 0) {
//更新本地合同状态 //更新本地合同状态
Contract::where('id',$contract['id'])->update(['signing_timer'=>1]); $updateLocalRes = Contract::where('id',$contract['id'])->update(['signing_timer'=>1]);
//更新远程 //更新远程
curl_post($this->domain.'/api/index/notifyVehicleContractUpdate',[],[ $updateSverRes =curl_post($this->domain.'/api/index/notifyVehicleContractUpdate',[],[
'contract_logistic_id' => $contract['id'], 'contract_logistic_id' => $contract['id'],
'signing_timer' => 1, 'signing_timer' => 1,
]); ]);
if(!$updateLocalRes || $updateSverRes['code']==0){
return json(['success' => false, 'msg' => '更新失败']);
}
}else if($contract['signing_timer'] == 1) { }else if($contract['signing_timer'] == 1) {
$vehicle = json_decode($contract['cars_info'],true);
if(empty($vehicle)){
return json(['success' => false, 'msg' => '更新失败']);
}
//更新本地合同状态 //更新本地合同状态
Contract::where('id',$params['id'])->update(['signing_timer'=>2,'status'=>3]); Contract::where('id',$params['id'])->update(['signing_timer'=>2,'status'=>3]);
//更新远程 //更新本地车辆状态
Vehicle::where('id','in',array_column($vehicle,'id'))->update(['status'=>2]); Vehicle::where('id','in',array_column($vehicle,'id'))->update(['status'=>2]);
$data = []; $data = [];
foreach($vehicle as $v){ foreach($vehicle as $v){

View File

@ -183,7 +183,7 @@ class JunziqianController extends BaseApiController
$request->serverCa = 1; //是否需要服务端云证书 $request->serverCa = 1; //是否需要服务端云证书
$request->fileType = 3; $request->fileType = 3;
$request->htmlContent = $data['content']; $request->htmlContent = $data['content'];
$request->notifyUrl = 'https://worker-task.lihaink.cn/notify_url?id=' . $id; $request->notifyUrl = $this->domain.'/api/index/notifyUrl?id='.$id;
$request->needQifengSign = 1; $request->needQifengSign = 1;
//发起PING请求 //发起PING请求