Merge pull request '新增三轮车合同管理接口' (#30) from zhangwei into dev
Reviewed-on: #30
This commit is contained in:
commit
248fd6d57a
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace app\adminapi\controller\contract;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use think\response\Json;
|
||||
|
||||
class VehicleContractController extends BaseAdminController
|
||||
{
|
||||
protected array $reqHeader = [];
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
$this->reqHeader = [
|
||||
"appid:".env('app.app_id'),
|
||||
"timestamp:".time(),
|
||||
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
|
||||
];
|
||||
}
|
||||
|
||||
//三轮车合同列表
|
||||
public function lists(): Json
|
||||
{
|
||||
$params = $this->request->get(['page_no','page_size','company_name','contract_no','status']);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/vehicle/lists',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//三轮车合同详情
|
||||
public function detail(): Json
|
||||
{
|
||||
$params = $this->request->get(['id']);
|
||||
if(empty($params['id'])){
|
||||
return $this->fail('参数错误');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/vehicle/detail',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//上传三轮车合同
|
||||
public function uploadContract(): Json
|
||||
{
|
||||
$params = $this->request->post(['id','file','cars']);
|
||||
if(empty($params['id']) || empty($params['file'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/vehicle/uploadContract',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//发起三轮车合同
|
||||
public function initiatingContract(): Json
|
||||
{
|
||||
//获取参数
|
||||
$params = $this->request->post(['id']);
|
||||
if(empty($params['id'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/vehicle/initiatingContract',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//重新发送三轮车合同短信
|
||||
public function sendSmsAgain(): Json
|
||||
{
|
||||
//获取参数
|
||||
$params = $this->request->post(['id']);
|
||||
if(empty($params['id'])){
|
||||
return $this->fail('参数错误');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/vehicle/sendSmsAgain',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue