data_center/app/adminapi/controller/contract/CompanyContractController.php

90 lines
2.6 KiB
PHP

<?php
namespace app\adminapi\controller\contract;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
class CompanyContractController extends BaseAdminController
{
//合同列表
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);
}
}