120 lines
3.8 KiB
PHP
120 lines
3.8 KiB
PHP
|
<?php
|
|||
|
// +----------------------------------------------------------------------
|
|||
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
|||
|
// +----------------------------------------------------------------------
|
|||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
|||
|
// | 开源版本可自由商用,可去除界面版权logo
|
|||
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
|||
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
|||
|
// | 访问官网:https://www.likeadmin.cn
|
|||
|
// | likeadmin团队 版权所有 拥有最终解释权
|
|||
|
// +----------------------------------------------------------------------
|
|||
|
// | author: likeadminTeam
|
|||
|
// +----------------------------------------------------------------------
|
|||
|
|
|||
|
|
|||
|
namespace app\adminapi\controller\task_scheduling_plan;
|
|||
|
|
|||
|
|
|||
|
use app\adminapi\controller\BaseAdminController;
|
|||
|
use app\adminapi\lists\task_scheduling_plan\TaskSchedulingPlanLists;
|
|||
|
use app\common\logic\task_scheduling_plan\TaskSchedulingPlanLogic;
|
|||
|
use app\adminapi\validate\task_scheduling_plan\TaskSchedulingPlanValidate;
|
|||
|
use app\common\logic\task\TaskLogic;
|
|||
|
use app\common\logic\task_template\TaskTemplateLogic;
|
|||
|
use app\common\model\task_scheduling_plan\TaskSchedulingPlan;
|
|||
|
|
|||
|
/**
|
|||
|
* 任务排期日历控制器
|
|||
|
* Class TaskSchedulingPlanController
|
|||
|
* @package app\adminapi\controller\task_scheduling_plan
|
|||
|
*/
|
|||
|
class TaskSchedulingPlanController extends BaseAdminController
|
|||
|
{
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @notes 获取任务排期日历列表
|
|||
|
* @return \think\response\Json
|
|||
|
* @author likeadmin
|
|||
|
* @date 2023/08/08 10:34
|
|||
|
*/
|
|||
|
public function lists()
|
|||
|
{
|
|||
|
return $this->dataLists(new TaskSchedulingPlanLists());
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @notes 添加任务排期日历
|
|||
|
* @return \think\response\Json
|
|||
|
* @author likeadmin
|
|||
|
* @date 2023/08/08 10:34
|
|||
|
*/
|
|||
|
public function add()
|
|||
|
{
|
|||
|
$params = (new TaskSchedulingPlanValidate())->post()->goCheck('add');
|
|||
|
$params['create_user_id']=$this->adminId;
|
|||
|
$time=strtotime($params['start_time']);
|
|||
|
$params['start_time']=$time;
|
|||
|
$params['end_time']=strtotime($params['end_time'])+86399;
|
|||
|
$result = TaskSchedulingPlanLogic::add($params);
|
|||
|
if (true === $result) {
|
|||
|
return $this->success('添加成功', [], 1, 1);
|
|||
|
}
|
|||
|
return $this->fail(TaskSchedulingPlanLogic::getError());
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @notes 编辑任务排期日历
|
|||
|
* @return \think\response\Json
|
|||
|
* @author likeadmin
|
|||
|
* @date 2023/08/08 10:34
|
|||
|
*/
|
|||
|
public function edit()
|
|||
|
{
|
|||
|
$params = (new TaskSchedulingPlanValidate())->post()->goCheck('edit');
|
|||
|
$time=strtotime($params['start_time']);
|
|||
|
$params['start_time']=$time;
|
|||
|
$params['end_time']=strtotime($params['end_time'])+86399;
|
|||
|
$result = TaskSchedulingPlanLogic::edit($params);
|
|||
|
if (true === $result) {
|
|||
|
return $this->success('编辑成功', [], 1, 1);
|
|||
|
}
|
|||
|
return $this->fail(TaskSchedulingPlanLogic::getError());
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @notes 删除任务排期日历
|
|||
|
* @return \think\response\Json
|
|||
|
* @author likeadmin
|
|||
|
* @date 2023/08/08 10:34
|
|||
|
*/
|
|||
|
public function delete()
|
|||
|
{
|
|||
|
$params = (new TaskSchedulingPlanValidate())->post()->goCheck('delete');
|
|||
|
$find=TaskSchedulingPlan::where('id',$params['id'])->find();
|
|||
|
TaskSchedulingPlanLogic::delete($params);
|
|||
|
$data['id']=$find['task_id'];
|
|||
|
TaskLogic::delete($data);
|
|||
|
return $this->success('删除成功', [], 1, 1);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @notes 获取任务排期日历详情
|
|||
|
* @return \think\response\Json
|
|||
|
* @author likeadmin
|
|||
|
* @date 2023/08/08 10:34
|
|||
|
*/
|
|||
|
public function detail()
|
|||
|
{
|
|||
|
$params = (new TaskSchedulingPlanValidate())->goCheck('detail');
|
|||
|
$result = TaskSchedulingPlanLogic::detail($params);
|
|||
|
return $this->data($result);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|