add 成果文件审定、签发
This commit is contained in:
parent
3ef0794361
commit
ab51708606
@ -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;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\ApprovalIssuanceAchievementDocumentsLists;
|
||||
use app\adminapi\logic\ApprovalIssuanceAchievementDocumentsLogic;
|
||||
use app\adminapi\validate\ApprovalIssuanceAchievementDocumentsValidate;
|
||||
|
||||
|
||||
/**
|
||||
* ApprovalIssuanceAchievementDocuments控制器
|
||||
* Class ApprovalIssuanceAchievementDocumentsController
|
||||
* @package app\adminapi\controller
|
||||
*/
|
||||
class ApprovalIssuanceAchievementDocumentsController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new ApprovalIssuanceAchievementDocumentsLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new ApprovalIssuanceAchievementDocumentsValidate())->post()->goCheck('add');
|
||||
$result = ApprovalIssuanceAchievementDocumentsLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ApprovalIssuanceAchievementDocumentsLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new ApprovalIssuanceAchievementDocumentsValidate())->post()->goCheck('edit');
|
||||
$result = ApprovalIssuanceAchievementDocumentsLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ApprovalIssuanceAchievementDocumentsLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new ApprovalIssuanceAchievementDocumentsValidate())->post()->goCheck('delete');
|
||||
ApprovalIssuanceAchievementDocumentsLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new ApprovalIssuanceAchievementDocumentsValidate())->goCheck('detail');
|
||||
$result = ApprovalIssuanceAchievementDocumentsLogic::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;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\ApprovalIssuanceAchievementDocuments;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
|
||||
/**
|
||||
* ApprovalIssuanceAchievementDocuments列表
|
||||
* Class ApprovalIssuanceAchievementDocumentsLists
|
||||
* @package app\adminapi\lists
|
||||
*/
|
||||
class ApprovalIssuanceAchievementDocumentsLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project', 'project_num'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return ApprovalIssuanceAchievementDocuments::where($this->searchWhere)
|
||||
->field(['id', 'dataid', 'num', 'project', 'project_num', 'task', 'processes', 'number', 'apptime', 'person', 'tips', 'fd_1', 'fd_2', 'fd_3'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ApprovalIssuanceAchievementDocuments::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
130
app/adminapi/logic/ApprovalIssuanceAchievementDocumentsLogic.php
Normal file
130
app/adminapi/logic/ApprovalIssuanceAchievementDocumentsLogic.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?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;
|
||||
|
||||
|
||||
use app\common\model\ApprovalIssuanceAchievementDocuments;
|
||||
use app\common\logic\BaseLogic;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* ApprovalIssuanceAchievementDocuments逻辑
|
||||
* Class ApprovalIssuanceAchievementDocumentsLogic
|
||||
* @package app\adminapi\logic
|
||||
*/
|
||||
class ApprovalIssuanceAchievementDocumentsLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ApprovalIssuanceAchievementDocuments::create([
|
||||
'dataid' => $params['dataid'],
|
||||
'num' => $params['num'],
|
||||
'project' => $params['project'],
|
||||
'project_num' => $params['project_num'],
|
||||
'task' => $params['task'],
|
||||
'processes' => $params['processes'],
|
||||
'number' => $params['number'],
|
||||
'apptime' => $params['apptime'],
|
||||
'person' => $params['person'],
|
||||
'tips' => $params['tips'],
|
||||
'fd_1' => $params['fd_1'],
|
||||
'fd_2' => $params['fd_2'],
|
||||
'fd_3' => $params['fd_3'],
|
||||
]);
|
||||
|
||||
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/22 17:57
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ApprovalIssuanceAchievementDocuments::where('id', $params['id'])->update([
|
||||
'dataid' => $params['dataid'],
|
||||
'num' => $params['num'],
|
||||
'project' => $params['project'],
|
||||
'project_num' => $params['project_num'],
|
||||
'task' => $params['task'],
|
||||
'processes' => $params['processes'],
|
||||
'number' => $params['number'],
|
||||
'apptime' => $params['apptime'],
|
||||
'person' => $params['person'],
|
||||
'tips' => $params['tips'],
|
||||
'fd_1' => $params['fd_1'],
|
||||
'fd_2' => $params['fd_2'],
|
||||
'fd_3' => $params['fd_3'],
|
||||
]);
|
||||
|
||||
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/22 17:57
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return ApprovalIssuanceAchievementDocuments::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return ApprovalIssuanceAchievementDocuments::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;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* ApprovalIssuanceAchievementDocuments验证器
|
||||
* Class ApprovalIssuanceAchievementDocumentsValidate
|
||||
* @package app\adminapi\validate
|
||||
*/
|
||||
class ApprovalIssuanceAchievementDocumentsValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return ApprovalIssuanceAchievementDocumentsValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->remove('id', true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return ApprovalIssuanceAchievementDocumentsValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return ApprovalIssuanceAchievementDocumentsValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return ApprovalIssuanceAchievementDocumentsValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/02/22 17:57
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
}
|
34
app/common/model/ApprovalIssuanceAchievementDocuments.php
Normal file
34
app/common/model/ApprovalIssuanceAchievementDocuments.php
Normal file
@ -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;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* ApprovalIssuanceAchievementDocuments模型
|
||||
* Class ApprovalIssuanceAchievementDocuments
|
||||
* @package app\common\model
|
||||
*/
|
||||
class ApprovalIssuanceAchievementDocuments extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
protected $name = 'approval_issuance_achievement_documents';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user