178 lines
6.0 KiB
PHP
178 lines
6.0 KiB
PHP
<?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();
|
||
}
|
||
} |