From dbc3a7d26df18f5cad1bca9b2aed30dabc3380f1 Mon Sep 17 00:00:00 2001 From: weiz Date: Fri, 10 Nov 2023 17:04:24 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=90=88=E5=90=8C=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/company/CompanyController.php | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 app/adminapi/controller/company/CompanyController.php diff --git a/app/adminapi/controller/company/CompanyController.php b/app/adminapi/controller/company/CompanyController.php new file mode 100644 index 00000000..05e21a8b --- /dev/null +++ b/app/adminapi/controller/company/CompanyController.php @@ -0,0 +1,178 @@ +request->get(['page_no','page_size','company_name','area_name','street_name','area_manager','company_type','is_contract']); + $result = curl_post(env('project.worker_domain').'/middleapi/company/lists',$params,[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + 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('id不能为空'); + } + $result = curl_post(env('project.worker_domain').'/middleapi/company/detail',$params,[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //删除公司 + public function delete(): Json + { + $params=$this->request->post(['id']); + if(empty($params['id'])){ + return $this->fail('缺少必要参数'); + } + $result = curl_post(env('project.worker_domain').'/middleapi/company/delete',$params,[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //添加公司 + public function create(): Json + { + $params=$this->request->post(); + if(empty($params['company_name']) || empty($params['organization_code']) || empty($params['company_type']) || empty($params['master_name']) || empty($params['master_phone'])){ + return $this->fail('缺少必要参数'); + } + $result = curl_post(env('project.worker_domain').'/middleapi/company/create',http_build_query($params),[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //修改公司 + public function edit(): Json + { + $params=$this->request->post(); + if(empty($params['id']) || empty($params['company_name']) || empty($params['organization_code']) || empty($params['company_type']) || empty($params['master_name']) || empty($params['master_phone'])){ + return $this->fail('缺少必要参数'); + } + $result = curl_post(env('project.worker_domain').'/middleapi/company/edit',http_build_query($params),[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //公司认证 + public function enterpriseCertification(): Json + { + $params=$this->request->post(['id']); + if(empty($params['id'])){ + return $this->fail('id不能为空'); + } + $result = curl_post(env('project.worker_domain').'/middleapi/company/enterpriseCertification',$params,[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //生成合同 + public function generateContract(): Json + { + $params=$this->request->post(['id','party_a','contract_type']); + if(empty($params['id']) || empty($params['party_a']) || empty($params['contract_type'])){ + return $this->fail('缺少必要参数'); + } + $result = curl_post(env('project.worker_domain').'/middleapi/company/generateContract',$params,[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //下属公司 + public function subsidiaryCompany(): Json + { + $params=$this->request->get(['id','page_no','page_size']); + if(empty($params['id'])){ + return $this->fail('缺少必要参数'); + } + $result = curl_post(env('project.worker_domain').'/middleapi/company/subsidiaryCompany',$params,[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //公司类型 + public function companyType(): Json + { + $result = curl_post(env('project.worker_domain').'/middleapi/company/companyType',[],[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //合同类型 + public function contractType(): Json + { + $result = curl_post(env('project.worker_domain').'/middleapi/company/contractType',[],[ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + } \ No newline at end of file From 5bb069e1a2d7b7870b0268559559e768276392a6 Mon Sep 17 00:00:00 2001 From: weiz Date: Sat, 11 Nov 2023 09:34:43 +0800 Subject: [PATCH 2/7] fixed --- .../controller/company/CompanyController.php | 65 ++++++------------- 1 file changed, 20 insertions(+), 45 deletions(-) diff --git a/app/adminapi/controller/company/CompanyController.php b/app/adminapi/controller/company/CompanyController.php index 05e21a8b..9151a68a 100644 --- a/app/adminapi/controller/company/CompanyController.php +++ b/app/adminapi/controller/company/CompanyController.php @@ -7,15 +7,22 @@ class CompanyController 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','area_name','street_name','area_manager','company_type','is_contract']); - $result = curl_post(env('project.worker_domain').'/middleapi/company/lists',$params,[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/lists',$params,$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } @@ -29,11 +36,7 @@ if(empty($params['id'])){ return $this->fail('id不能为空'); } - $result = curl_post(env('project.worker_domain').'/middleapi/company/detail',$params,[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/detail',$params,$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } @@ -65,11 +68,7 @@ if(empty($params['company_name']) || empty($params['organization_code']) || empty($params['company_type']) || empty($params['master_name']) || empty($params['master_phone'])){ return $this->fail('缺少必要参数'); } - $result = curl_post(env('project.worker_domain').'/middleapi/company/create',http_build_query($params),[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/create',http_build_query($params),$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } @@ -83,11 +82,7 @@ if(empty($params['id']) || empty($params['company_name']) || empty($params['organization_code']) || empty($params['company_type']) || empty($params['master_name']) || empty($params['master_phone'])){ return $this->fail('缺少必要参数'); } - $result = curl_post(env('project.worker_domain').'/middleapi/company/edit',http_build_query($params),[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/edit',http_build_query($params),$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } @@ -101,11 +96,7 @@ if(empty($params['id'])){ return $this->fail('id不能为空'); } - $result = curl_post(env('project.worker_domain').'/middleapi/company/enterpriseCertification',$params,[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/enterpriseCertification',$params,$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } @@ -119,11 +110,7 @@ if(empty($params['id']) || empty($params['party_a']) || empty($params['contract_type'])){ return $this->fail('缺少必要参数'); } - $result = curl_post(env('project.worker_domain').'/middleapi/company/generateContract',$params,[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/generateContract',$params,$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } @@ -137,11 +124,7 @@ if(empty($params['id'])){ return $this->fail('缺少必要参数'); } - $result = curl_post(env('project.worker_domain').'/middleapi/company/subsidiaryCompany',$params,[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/subsidiaryCompany',$params,$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } @@ -151,11 +134,7 @@ //公司类型 public function companyType(): Json { - $result = curl_post(env('project.worker_domain').'/middleapi/company/companyType',[],[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/companyType',[],$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } @@ -165,11 +144,7 @@ //合同类型 public function contractType(): Json { - $result = curl_post(env('project.worker_domain').'/middleapi/company/contractType',[],[ - "appid:".env('app.app_id'), - "timestamp:".time(), - "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) - ]); + $result = curl_post(env('project.worker_domain').'/middleapi/company/contractType',[],$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } From a9eeab3456629a4733c0df85fde8fe7da8c1724c Mon Sep 17 00:00:00 2001 From: weiz Date: Sat, 11 Nov 2023 11:00:06 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E6=88=B7?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/company/MerchantController.php | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/adminapi/controller/company/MerchantController.php diff --git a/app/adminapi/controller/company/MerchantController.php b/app/adminapi/controller/company/MerchantController.php new file mode 100644 index 00000000..3f3163ea --- /dev/null +++ b/app/adminapi/controller/company/MerchantController.php @@ -0,0 +1,53 @@ +reqHeader = [ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]; + } + + //商户档案列表 + public function merchantRecordLists(): Json + { + $params = $this->request->get(['page_no','page_size','merchant_name','master_name','master_phone']); + $result = curl_post(env('project.worker_domain').'/middleapi/merchant/merchantRecordLists',$params,$this->reqHeader); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //商户认证列表 + public function merchantAuthLists(): Json + { + $params = $this->request->get(['page_no','page_size','merchant_name','organization_code','master_name']); + $result = curl_post(env('project.worker_domain').'/middleapi/merchant/merchantAuthLists',$params,$this->reqHeader); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //商户申请列表 + public function merchantApplyLists(): Json + { + $params = $this->request->get(['page_no','page_size','check_status','type']); + $result = curl_post(env('project.worker_domain').'/middleapi/merchant/merchantApplyLists',$params,$this->reqHeader); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + } \ No newline at end of file From 541ed7fced5c2d260a3de0e02f2c46c2830e9c05 Mon Sep 17 00:00:00 2001 From: weiz Date: Sat, 11 Nov 2023 14:19:26 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97=E5=95=86=E6=9C=BA=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=AD=90=E6=A8=A1=E5=9D=97=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../archives/ArchivesController.php | 21 +++++ .../archives/BusinessController.php | 78 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 app/adminapi/controller/archives/ArchivesController.php create mode 100644 app/adminapi/controller/archives/BusinessController.php diff --git a/app/adminapi/controller/archives/ArchivesController.php b/app/adminapi/controller/archives/ArchivesController.php new file mode 100644 index 00000000..aa1dd4a4 --- /dev/null +++ b/app/adminapi/controller/archives/ArchivesController.php @@ -0,0 +1,21 @@ +reqHeader = [ + "appid:".env('app.app_id'), + "timestamp:".time(), + "sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret')) + ]; + } + + + } \ No newline at end of file diff --git a/app/adminapi/controller/archives/BusinessController.php b/app/adminapi/controller/archives/BusinessController.php new file mode 100644 index 00000000..00649d60 --- /dev/null +++ b/app/adminapi/controller/archives/BusinessController.php @@ -0,0 +1,78 @@ +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','name','status']); + $result = curl_post(env('project.worker_domain').'/middleapi/business/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/business/detail',$params,$this->reqHeader); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //新增商机分类 + public function create(): Json + { + $params = $this->request->post(['name','pid','sort','status']); + $result = curl_post(env('project.worker_domain').'/middleapi/business/create',$params,$this->reqHeader); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //编辑商机分类 + public function edit(): Json + { + $params = $this->request->post(['id','name','pid','sort','status']); + $result = curl_post(env('project.worker_domain').'/middleapi/business/edit',$params,$this->reqHeader); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + + //删除商机分类 + public function delete(): Json + { + $params = $this->request->post(['id']); + $result = curl_post(env('project.worker_domain').'/middleapi/business/delete',$params,$this->reqHeader); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } + } \ No newline at end of file From af78fdd2b1efc8bd5a21eeabed8fba2cfd184725 Mon Sep 17 00:00:00 2001 From: weiz Date: Sat, 11 Nov 2023 15:37:30 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E5=92=8C=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../archives/ArchivesController.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/adminapi/controller/archives/ArchivesController.php b/app/adminapi/controller/archives/ArchivesController.php index aa1dd4a4..86078ddf 100644 --- a/app/adminapi/controller/archives/ArchivesController.php +++ b/app/adminapi/controller/archives/ArchivesController.php @@ -3,6 +3,7 @@ namespace app\adminapi\controller\archives; use app\adminapi\controller\BaseAdminController; + use think\response\Json; class ArchivesController extends BaseAdminController { @@ -17,5 +18,27 @@ ]; } + //档案列表 + public function lists(): Json + { + $params = $this->request->get(['page_no','page_size','name']); + $result = curl_post(env('project.worker_domain').'/middleapi/archives/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/archives/detail',$params,$this->reqHeader); + if($result['code'] == 0){ + return $this->fail($result['msg']); + } + return json($result); + } } \ No newline at end of file From f371cf65618db1424e6cb148ee4f20c6b0c13975 Mon Sep 17 00:00:00 2001 From: weiz Date: Mon, 13 Nov 2023 11:53:37 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=89=E8=BD=AE?= =?UTF-8?q?=E8=BD=A6=E5=90=88=E5=90=8C=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract/VehicleContractController.php | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 app/adminapi/controller/contract/VehicleContractController.php diff --git a/app/adminapi/controller/contract/VehicleContractController.php b/app/adminapi/controller/contract/VehicleContractController.php new file mode 100644 index 00000000..d47ea76b --- /dev/null +++ b/app/adminapi/controller/contract/VehicleContractController.php @@ -0,0 +1,89 @@ +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); + } + } \ No newline at end of file From 04814619de974043423d5807b1ec2393a5c45915 Mon Sep 17 00:00:00 2001 From: weiz Date: Mon, 13 Nov 2023 16:10:10 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E5=90=88=E5=90=8C=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract/CompanyContractController.php | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 app/adminapi/controller/contract/CompanyContractController.php diff --git a/app/adminapi/controller/contract/CompanyContractController.php b/app/adminapi/controller/contract/CompanyContractController.php new file mode 100644 index 00000000..19f9692a --- /dev/null +++ b/app/adminapi/controller/contract/CompanyContractController.php @@ -0,0 +1,101 @@ +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); + } + } \ No newline at end of file