lihaiMiddleOffice/app/psi/controller/WarehouseOrderController.php

95 lines
2.2 KiB
PHP

<?php
namespace app\psi\controller;
use app\admin\controller\BaseAdminController;
use app\psi\lists\WarehouseOrderLists;
use app\psi\logic\WarehouseOrderLogic;
use app\psi\validate\WarehouseOrderValidate;
/**
* PsiWarehouseOrder控制器
* Class WarehouseOrderController
* @package app\psi\controller
*/
class WarehouseOrderController extends BaseAdminController
{
/**
* @notes 获取列表
* @return \think\response\Json
* @author admin
* @date 2025/03/10 11:08
*/
public function lists()
{
return $this->dataLists(new WarehouseOrderLists());
}
/**
* @notes 添加
* @return \think\response\Json
* @author admin
* @date 2025/03/10 11:08
*/
public function add()
{
$params = (new WarehouseOrderValidate())->post()->goCheck('add');
$result = WarehouseOrderLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(WarehouseOrderLogic::getError());
}
/**
* @notes 编辑
* @return \think\response\Json
* @author admin
* @date 2025/03/10 11:08
*/
public function edit()
{
$params = (new WarehouseOrderValidate())->post()->goCheck('edit');
$result = WarehouseOrderLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(WarehouseOrderLogic::getError());
}
/**
* @notes 删除
* @return \think\response\Json
* @author admin
* @date 2025/03/10 11:08
*/
public function delete()
{
$params = (new WarehouseOrderValidate())->post()->goCheck('delete');
WarehouseOrderLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取详情
* @return \think\response\Json
* @author admin
* @date 2025/03/10 11:08
*/
public function detail()
{
$params = (new WarehouseOrderValidate())->goCheck('detail');
$result = WarehouseOrderLogic::detail($params);
return $this->data($result);
}
}