fixed
This commit is contained in:
parent
c0a17ba17c
commit
3ef0794361
@ -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\TaskHandlingThreeLevelReviewLists;
|
||||||
|
use app\adminapi\logic\TaskHandlingThreeLevelReviewLogic;
|
||||||
|
use app\adminapi\validate\TaskHandlingThreeLevelReviewValidate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TaskHandlingThreeLevelReview控制器
|
||||||
|
* Class TaskHandlingThreeLevelReviewController
|
||||||
|
* @package app\adminapi\controller
|
||||||
|
*/
|
||||||
|
class TaskHandlingThreeLevelReviewController extends BaseAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取列表
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
return $this->dataLists(new TaskHandlingThreeLevelReviewLists());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$params = (new TaskHandlingThreeLevelReviewValidate())->post()->goCheck('add');
|
||||||
|
$result = TaskHandlingThreeLevelReviewLogic::add($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('添加成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(TaskHandlingThreeLevelReviewLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function edit()
|
||||||
|
{
|
||||||
|
$params = (new TaskHandlingThreeLevelReviewValidate())->post()->goCheck('edit');
|
||||||
|
$result = TaskHandlingThreeLevelReviewLogic::edit($params);
|
||||||
|
if (true === $result) {
|
||||||
|
return $this->success('编辑成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
return $this->fail(TaskHandlingThreeLevelReviewLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$params = (new TaskHandlingThreeLevelReviewValidate())->post()->goCheck('delete');
|
||||||
|
TaskHandlingThreeLevelReviewLogic::delete($params);
|
||||||
|
return $this->success('删除成功', [], 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取详情
|
||||||
|
* @return \think\response\Json
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$params = (new TaskHandlingThreeLevelReviewValidate())->goCheck('detail');
|
||||||
|
$result = TaskHandlingThreeLevelReviewLogic::detail($params);
|
||||||
|
return $this->data($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
77
app/adminapi/lists/TaskHandlingThreeLevelReviewLists.php
Normal file
77
app/adminapi/lists/TaskHandlingThreeLevelReviewLists.php
Normal file
@ -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\TaskHandlingThreeLevelReview;
|
||||||
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TaskHandlingThreeLevelReview列表
|
||||||
|
* Class TaskHandlingThreeLevelReviewLists
|
||||||
|
* @package app\adminapi\lists
|
||||||
|
*/
|
||||||
|
class TaskHandlingThreeLevelReviewLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 设置搜索条件
|
||||||
|
* @return \string[][]
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function setSearch(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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:18
|
||||||
|
*/
|
||||||
|
public function lists(): array
|
||||||
|
{
|
||||||
|
return TaskHandlingThreeLevelReview::where($this->searchWhere)
|
||||||
|
->field(['id', 'dataid', 'num', 'project', 'project_num', 'task', 'processes', 'rtype', 'zType', 'engineer', 'head', 'examine', 'one', 'two', 'three', 'apptime', 'level', 'area', 'type', 'use', 'construction', 'ask', 'according', 'clbc', 'ssje', 'gcshd', 'hzhj', 'rg', 'xmhd', 'bmhd', 'shbhd', 'kaigong', 'jungong', 'bz'])
|
||||||
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
|
->order(['id' => 'desc'])
|
||||||
|
->select()
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取数量
|
||||||
|
* @return int
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
return TaskHandlingThreeLevelReview::where($this->searchWhere)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
178
app/adminapi/logic/TaskHandlingThreeLevelReviewLogic.php
Normal file
178
app/adminapi/logic/TaskHandlingThreeLevelReviewLogic.php
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
<?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\TaskHandlingThreeLevelReview;
|
||||||
|
use app\common\logic\BaseLogic;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TaskHandlingThreeLevelReview逻辑
|
||||||
|
* Class TaskHandlingThreeLevelReviewLogic
|
||||||
|
* @package app\adminapi\logic
|
||||||
|
*/
|
||||||
|
class TaskHandlingThreeLevelReviewLogic extends BaseLogic
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加
|
||||||
|
* @param array $params
|
||||||
|
* @return bool
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public static function add(array $params): bool
|
||||||
|
{
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
TaskHandlingThreeLevelReview::create([
|
||||||
|
'dataid' => $params['dataid'],
|
||||||
|
'num' => $params['num'],
|
||||||
|
'project' => $params['project'],
|
||||||
|
'project_num' => $params['project_num'],
|
||||||
|
'task' => $params['task'],
|
||||||
|
'processes' => $params['processes'],
|
||||||
|
'rtype' => $params['rtype'],
|
||||||
|
'zType' => $params['zType'],
|
||||||
|
'engineer' => $params['engineer'],
|
||||||
|
'head' => $params['head'],
|
||||||
|
'examine' => $params['examine'],
|
||||||
|
'one' => $params['one'],
|
||||||
|
'two' => $params['two'],
|
||||||
|
'three' => $params['three'],
|
||||||
|
'apptime' => $params['apptime'],
|
||||||
|
'level' => $params['level'],
|
||||||
|
'area' => $params['area'],
|
||||||
|
'type' => $params['type'],
|
||||||
|
'use' => $params['use'],
|
||||||
|
'construction' => $params['construction'],
|
||||||
|
'ask' => $params['ask'],
|
||||||
|
'according' => $params['according'],
|
||||||
|
'clbc' => $params['clbc'],
|
||||||
|
'ssje' => $params['ssje'],
|
||||||
|
'gcshd' => $params['gcshd'],
|
||||||
|
'hzhj' => $params['hzhj'],
|
||||||
|
'rg' => $params['rg'],
|
||||||
|
'xmhd' => $params['xmhd'],
|
||||||
|
'bmhd' => $params['bmhd'],
|
||||||
|
'shbhd' => $params['shbhd'],
|
||||||
|
'kaigong' => $params['kaigong'],
|
||||||
|
'jungong' => $params['jungong'],
|
||||||
|
'bz' => $params['bz'],
|
||||||
|
'result_file' => $params['result_file'],
|
||||||
|
'master_annex' => $params['master_annex'],
|
||||||
|
'bm_annex' => $params['bm_annex'],
|
||||||
|
'shb_annex' => $params['shb_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/22 17:18
|
||||||
|
*/
|
||||||
|
public static function edit(array $params): bool
|
||||||
|
{
|
||||||
|
Db::startTrans();
|
||||||
|
try {
|
||||||
|
TaskHandlingThreeLevelReview::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'],
|
||||||
|
'rtype' => $params['rtype'],
|
||||||
|
'zType' => $params['zType'],
|
||||||
|
'engineer' => $params['engineer'],
|
||||||
|
'head' => $params['head'],
|
||||||
|
'examine' => $params['examine'],
|
||||||
|
'one' => $params['one'],
|
||||||
|
'two' => $params['two'],
|
||||||
|
'three' => $params['three'],
|
||||||
|
'apptime' => $params['apptime'],
|
||||||
|
'level' => $params['level'],
|
||||||
|
'area' => $params['area'],
|
||||||
|
'type' => $params['type'],
|
||||||
|
'use' => $params['use'],
|
||||||
|
'construction' => $params['construction'],
|
||||||
|
'ask' => $params['ask'],
|
||||||
|
'according' => $params['according'],
|
||||||
|
'clbc' => $params['clbc'],
|
||||||
|
'ssje' => $params['ssje'],
|
||||||
|
'gcshd' => $params['gcshd'],
|
||||||
|
'hzhj' => $params['hzhj'],
|
||||||
|
'rg' => $params['rg'],
|
||||||
|
'xmhd' => $params['xmhd'],
|
||||||
|
'bmhd' => $params['bmhd'],
|
||||||
|
'shbhd' => $params['shbhd'],
|
||||||
|
'kaigong' => $params['kaigong'],
|
||||||
|
'jungong' => $params['jungong'],
|
||||||
|
'bz' => $params['bz'],
|
||||||
|
'result_file' => $params['result_file'],
|
||||||
|
'master_annex' => $params['master_annex'],
|
||||||
|
'bm_annex' => $params['bm_annex'],
|
||||||
|
'shb_annex' => $params['shb_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/22 17:18
|
||||||
|
*/
|
||||||
|
public static function delete(array $params): bool
|
||||||
|
{
|
||||||
|
return TaskHandlingThreeLevelReview::destroy($params['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 获取详情
|
||||||
|
* @param $params
|
||||||
|
* @return array
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public static function detail($params): array
|
||||||
|
{
|
||||||
|
return TaskHandlingThreeLevelReview::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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TaskHandlingThreeLevelReview验证器
|
||||||
|
* Class TaskHandlingThreeLevelReviewValidate
|
||||||
|
* @package app\adminapi\validate
|
||||||
|
*/
|
||||||
|
class TaskHandlingThreeLevelReviewValidate extends BaseValidate
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置校验规则
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
'id' => 'require',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数描述
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
protected $field = [
|
||||||
|
'id' => 'id',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 添加场景
|
||||||
|
* @return TaskHandlingThreeLevelReviewValidate
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function sceneAdd()
|
||||||
|
{
|
||||||
|
return $this->remove('id', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 编辑场景
|
||||||
|
* @return TaskHandlingThreeLevelReviewValidate
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function sceneEdit()
|
||||||
|
{
|
||||||
|
return $this->only(['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 删除场景
|
||||||
|
* @return TaskHandlingThreeLevelReviewValidate
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function sceneDelete()
|
||||||
|
{
|
||||||
|
return $this->only(['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 详情场景
|
||||||
|
* @return TaskHandlingThreeLevelReviewValidate
|
||||||
|
* @author likeadmin
|
||||||
|
* @date 2024/02/22 17:18
|
||||||
|
*/
|
||||||
|
public function sceneDetail()
|
||||||
|
{
|
||||||
|
return $this->only(['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
34
app/common/model/TaskHandlingThreeLevelReview.php
Normal file
34
app/common/model/TaskHandlingThreeLevelReview.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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TaskHandlingThreeLevelReview模型
|
||||||
|
* Class TaskHandlingThreeLevelReview
|
||||||
|
* @package app\common\model
|
||||||
|
*/
|
||||||
|
class TaskHandlingThreeLevelReview extends BaseModel
|
||||||
|
{
|
||||||
|
use SoftDelete;
|
||||||
|
protected $name = 'task_handling_three_level_review';
|
||||||
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user