96 lines
2.5 KiB
PHP
96 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\inventory_warehouse;
|
|
|
|
|
|
use app\admin\controller\BaseAdminController;
|
|
use app\admin\lists\inventory_warehouse\InventoryWarehouseLists;
|
|
use app\admin\logic\inventory_warehouse\InventoryWarehouseLogic;
|
|
use app\admin\validate\inventory_warehouse\InventoryWarehouseValidate;
|
|
|
|
|
|
/**
|
|
* 仓库盘存控制器
|
|
* Class InventoryWarehouseController
|
|
* @package app\admin\controller\inventory_warehouse
|
|
*/
|
|
class InventoryWarehouseController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 获取仓库盘存列表
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/02/14 17:24
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new InventoryWarehouseLists());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加仓库盘存
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/02/14 17:24
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new InventoryWarehouseValidate())->post()->goCheck('add');
|
|
$result = InventoryWarehouseLogic::add($params);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(InventoryWarehouseLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑仓库盘存
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/02/14 17:24
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new InventoryWarehouseValidate())->post()->goCheck('edit');
|
|
$params['admin_id']=$this->adminId;
|
|
$result = InventoryWarehouseLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(InventoryWarehouseLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除仓库盘存
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/02/14 17:24
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = (new InventoryWarehouseValidate())->post()->goCheck('delete');
|
|
InventoryWarehouseLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
/**
|
|
* @notes 门店盘存核准
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2025/02/14 11:46
|
|
*/
|
|
public function enter_nums()
|
|
{
|
|
$params = $this->request->post();
|
|
$params['warehouse_id']=1;
|
|
$result = InventoryWarehouseLogic::enterNums($params);
|
|
if (true === $result) {
|
|
return $this->success('核准成功', [], 1, 1);
|
|
}
|
|
}
|
|
} |