2023-11-14 18:12:23 +08:00
|
|
|
<?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
|
|
|
|
{
|
2023-11-14 18:22:45 +08:00
|
|
|
$params=$this->request->post();
|
2023-11-14 18:12:23 +08:00
|
|
|
$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
|
|
|
|
{
|
2023-11-14 18:22:45 +08:00
|
|
|
$params=$this->request->post(['id']);
|
2023-11-14 18:12:23 +08:00
|
|
|
$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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|