data_center/app/adminapi/controller/task/SchedulingController.php

131 lines
3.8 KiB
PHP

<?php
namespace app\adminapi\controller\task;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
class SchedulingController extends BaseAdminController
{
public function lists(): Json
{
$params=$this->request->get(['page_no','page_size','company_id']);
$result = curl_post(env('project.worker_domain').'/middleapi/task_scheduling/lists',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function editMoney(): Json
{
$params=$this->request->post(['id', 'money']);
$result = curl_post(env('project.worker_domain').'/middleapi/task_scheduling/editMoney',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function edit(): Json
{
$params=$this->request->post();
$result = curl_post(env('project.worker_domain').'/middleapi/task_scheduling/edit',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function detail(): Json
{
$params=$this->request->get(['id']);
$result = curl_post(env('project.worker_domain').'/middleapi/task_scheduling/detail',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function plan(): Json
{
$params=$this->request->get(['scheduling_id','start_time','end_time']);
$result = curl_post(env('project.worker_domain').'/middleapi/task_scheduling_plan/lists',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function template(): Json
{
$params=$this->request->get(['company_id','title']);
$result = curl_post(env('project.worker_domain').'/middleapi/task_template/lists',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function addTemplate(): Json
{
$params=$this->request->post();
$result = curl_post(env('project.worker_domain').'/middleapi/task_template/add',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function editTemplate(): Json
{
$params=$this->request->post();
$result = curl_post(env('project.worker_domain').'/middleapi/task_template/edit',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function deleteTemplate(): Json
{
$params=$this->request->post(['id']);
$result = curl_post(env('project.worker_domain').'/middleapi/task_template/delete',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function detailTemplate(): Json
{
$params=$this->request->get(['id']);
$result = curl_post(env('project.worker_domain').'/middleapi/task_template/detail',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function approve(): Json
{
$params=$this->request->get(['page_no','page_size','type', 'check_status']);
$result = curl_post(env('project.worker_domain').'/middleapi/approve/lists',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
public function auditApprove(): Json
{
$params=$this->request->post(['id','check_status','remark']);
$result = curl_post(env('project.worker_domain').'/middleapi/approve/audit',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
}