add 用章申请
This commit is contained in:
parent
48e75aae46
commit
2d6c313e11
app
adminapi
controller/project_process_management
lists/project_process_management
logic/project_process_management
validate/project_process_management
common/model/project_process_management
@ -0,0 +1,108 @@
|
||||
<?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\project_process_management;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\project_process_management\ApplyWithSealLists;
|
||||
use app\adminapi\logic\project_process_management\ApplyWithSealLogic;
|
||||
use app\adminapi\validate\project_process_management\ApplyWithSealValidate;
|
||||
|
||||
|
||||
/**
|
||||
* ApplyWithSeal控制器
|
||||
* Class ApplyWithSealController
|
||||
* @package app\adminapi\controller\project_process_management
|
||||
*/
|
||||
class ApplyWithSealController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new ApplyWithSealLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new ApplyWithSealValidate())->post()->goCheck('add');
|
||||
$result = ApplyWithSealLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ApplyWithSealLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new ApplyWithSealValidate())->post()->goCheck('edit');
|
||||
$result = ApplyWithSealLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ApplyWithSealLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new ApplyWithSealValidate())->post()->goCheck('delete');
|
||||
ApplyWithSealLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new ApplyWithSealValidate())->goCheck('detail');
|
||||
$result = ApplyWithSealLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
<?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\lists\project_process_management;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\project_process_management\ApplyWithSeal;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
* ApplyWithSeal列表
|
||||
* Class ApplyWithSealLists
|
||||
* @package app\adminapi\listsproject_process_management
|
||||
*/
|
||||
class ApplyWithSealLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['num'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return ApplyWithSeal::where($this->searchWhere)
|
||||
->field(['id', 'dataid', 'num', 'types', 'filetype', 'ridingseam', 'name', 'frequency', 'limit', 'depar', 'stampman', 'project', 'principal', 'content', 'loan', 'borrow', 'returndate', 'applicant', 'date', 'sjborrow', 'sjborrower', 'sjreturn', 'returnee', 'annex'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ApplyWithSeal::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
<?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\logic\project_process_management;
|
||||
|
||||
|
||||
use app\common\model\project_process_management\ApplyWithSeal;
|
||||
use app\common\logic\BaseLogic;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* ApplyWithSeal逻辑
|
||||
* Class ApplyWithSealLogic
|
||||
* @package app\adminapi\logic\project_process_management
|
||||
*/
|
||||
class ApplyWithSealLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ApplyWithSeal::create([
|
||||
'dataid' => $params['dataid'],
|
||||
'num' => $params['num'],
|
||||
'types' => $params['types'],
|
||||
'filetype' => $params['filetype'],
|
||||
'ridingseam' => $params['ridingseam'],
|
||||
'name' => $params['name'],
|
||||
'frequency' => $params['frequency'],
|
||||
'limit' => $params['limit'],
|
||||
'depar' => $params['depar'],
|
||||
'stampman' => $params['stampman'],
|
||||
'project' => $params['project'],
|
||||
'principal' => $params['principal'],
|
||||
'content' => $params['content'],
|
||||
'loan' => $params['loan'],
|
||||
'borrow' => $params['borrow'],
|
||||
'returndate' => $params['returndate'],
|
||||
'applicant' => $params['applicant'],
|
||||
'date' => $params['date'],
|
||||
'sjborrow' => $params['sjborrow'],
|
||||
'sjborrower' => $params['sjborrower'],
|
||||
'sjreturn' => $params['sjreturn'],
|
||||
'returnee' => $params['returnee'],
|
||||
'annex' => $params['annex'],
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ApplyWithSeal::where('id', $params['id'])->update([
|
||||
'dataid' => $params['dataid'],
|
||||
'num' => $params['num'],
|
||||
'types' => $params['types'],
|
||||
'filetype' => $params['filetype'],
|
||||
'ridingseam' => $params['ridingseam'],
|
||||
'name' => $params['name'],
|
||||
'frequency' => $params['frequency'],
|
||||
'limit' => $params['limit'],
|
||||
'depar' => $params['depar'],
|
||||
'stampman' => $params['stampman'],
|
||||
'project' => $params['project'],
|
||||
'principal' => $params['principal'],
|
||||
'content' => $params['content'],
|
||||
'loan' => $params['loan'],
|
||||
'borrow' => $params['borrow'],
|
||||
'returndate' => $params['returndate'],
|
||||
'applicant' => $params['applicant'],
|
||||
'date' => $params['date'],
|
||||
'sjborrow' => $params['sjborrow'],
|
||||
'sjborrower' => $params['sjborrower'],
|
||||
'sjreturn' => $params['sjreturn'],
|
||||
'returnee' => $params['returnee'],
|
||||
'annex' => $params['annex'],
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return ApplyWithSeal::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return ApplyWithSeal::findOrEmpty($params['id'])->toArray();
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
<?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\validate\project_process_management;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* ApplyWithSeal验证器
|
||||
* Class ApplyWithSealValidate
|
||||
* @package app\adminapi\validate\project_process_management
|
||||
*/
|
||||
class ApplyWithSealValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return ApplyWithSealValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->remove('id', true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return ApplyWithSealValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return ApplyWithSealValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return ApplyWithSealValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 15:05
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
<?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\common\model\project_process_management;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* ApplyWithSeal模型
|
||||
* Class ApplyWithSeal
|
||||
* @package app\common\model\project_process_management
|
||||
*/
|
||||
class ApplyWithSeal extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $name = 'apply_with_seal';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user