Merge branch 'zhangwei' into yaooo

This commit is contained in:
yaooo 2023-11-14 09:27:05 +08:00
commit 64399a8fe3
6 changed files with 518 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<?php
namespace app\adminapi\controller\archives;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
class ArchivesController 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','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);
}
}

View File

@ -0,0 +1,78 @@
<?php
namespace app\adminapi\controller\archives;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
class BusinessController 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','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);
}
}

View File

@ -0,0 +1,153 @@
<?php
namespace app\adminapi\controller\company;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
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,$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('id不能为空');
}
$result = curl_post(env('project.worker_domain').'/middleapi/company/detail',$params,$this->reqHeader);
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),$this->reqHeader);
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),$this->reqHeader);
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,$this->reqHeader);
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,$this->reqHeader);
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,$this->reqHeader);
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',[],$this->reqHeader);
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',[],$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace app\adminapi\controller\company;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
class MerchantController 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 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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}