Compare commits
2 Commits
f371cf6561
...
04814619de
Author | SHA1 | Date |
---|---|---|
weiz | 04814619de | |
weiz | 248fd6d57a |
|
@ -0,0 +1,101 @@
|
|||
<?php
|
||||
|
||||
namespace app\adminapi\controller\contract;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use think\response\Json;
|
||||
|
||||
class CompanyContractController 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','contract_no','contract_type','contract_status','company_name','area_manager']);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/contract/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/contract/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']);
|
||||
if(empty($params['id']) || empty($params['file'])){
|
||||
return $this->fail('参数错误');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/contract/uploadContract',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//发起合同
|
||||
public function DraftingContract(): Json
|
||||
{
|
||||
$params = $this->request->post(['id','part_b','type']);
|
||||
if(empty($params['id']) || empty($params['part_b']) || empty($params['type'])){
|
||||
return $this->fail('参数错误');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/contract/DraftingContract',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//发送短信
|
||||
public function sendSms(): Json
|
||||
{
|
||||
$params = $this->request->post(['id']);
|
||||
if(empty($params['id'])){
|
||||
return $this->fail('参数错误');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/contract/sendSms',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//下载证据包
|
||||
public function evidence(): Json
|
||||
{
|
||||
$params = $this->request->get(['id']);
|
||||
if(empty($params['id'])){
|
||||
$this->fail('参数错误');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/contract/evidence',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue