update
This commit is contained in:
parent
b5530b1177
commit
cdbc08e784
@ -12,92 +12,95 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists;
|
||||
namespace app\adminapi\lists;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\model\DataReception;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\DataReception;
|
||||
|
||||
|
||||
/**
|
||||
* DataReception列表
|
||||
* Class DataReceptionLists
|
||||
* @package app\adminapi\lists
|
||||
*/
|
||||
class DataReceptionLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
|
||||
{
|
||||
/**
|
||||
* DataReception列表
|
||||
* Class DataReceptionLists
|
||||
* @package app\adminapi\lists
|
||||
*/
|
||||
class DataReceptionLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num','person']
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num', 'person']
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return DataReception::where($this->searchWhere)
|
||||
->with(['projectInfo'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return DataReception::where($this->searchWhere)
|
||||
->with(['projectInfo'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($data) {
|
||||
$head = Admin::field('name')->where('id', $data['person'])->findOrEmpty();
|
||||
$data['person_name'] = $head?->name;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return DataReception::where($this->searchWhere)->count();
|
||||
}
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return DataReception::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '资料接收';
|
||||
}
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '资料接收';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'id',
|
||||
'num' => '单据编号',
|
||||
'project_id' => '项目id',
|
||||
'apptime' => '登记日期',
|
||||
'person' => '登记人',
|
||||
'number' => '资料份数',
|
||||
'position' => '存放位置',
|
||||
'tips' => '说明',
|
||||
];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'id',
|
||||
'num' => '单据编号',
|
||||
'project_id' => '项目id',
|
||||
'apptime' => '登记日期',
|
||||
'person' => '登记人',
|
||||
'number' => '资料份数',
|
||||
'position' => '存放位置',
|
||||
'tips' => '说明',
|
||||
];
|
||||
}
|
||||
}
|
@ -67,6 +67,8 @@
|
||||
$project = CostProject::field('project_name,project_num,contract_id,industry,principal')->where('id', $data['project_id'])->findOrEmpty();
|
||||
$contract = MarketingContract::field('contract_name')->where('id', $project['contract_id'])->findOrEmpty();
|
||||
$admin = Admin::field('name')->where('id', $project['principal'])->findOrEmpty();
|
||||
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
|
||||
$data['djr_name'] = $djr?->name;
|
||||
$data['project_name'] = $project['project_name'];
|
||||
$data['project_num'] = $project['project_num'];
|
||||
$data['contract_name'] = $contract['contract_name'];
|
||||
|
@ -12,96 +12,100 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\project_process_management;
|
||||
namespace app\adminapi\lists\project_process_management;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\model\project_process_management\ProjectChangeVisa;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\project_process_management\ProjectChangeVisaContent;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\project_process_management\ProjectChangeVisa;
|
||||
use app\common\model\project_process_management\ProjectChangeVisaContent;
|
||||
|
||||
|
||||
/**
|
||||
* ProjectChangeVisa列表
|
||||
* Class ProjectChangeVisaLists
|
||||
* @package app\adminapi\listsproject_process_management
|
||||
*/
|
||||
class ProjectChangeVisaLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
|
||||
{
|
||||
/**
|
||||
* ProjectChangeVisa列表
|
||||
* Class ProjectChangeVisaLists
|
||||
* @package app\adminapi\listsproject_process_management
|
||||
*/
|
||||
class ProjectChangeVisaLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num']
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['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 09:58
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return ProjectChangeVisa::with(['projectInfo'])
|
||||
->append(['children'])
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->withAttr('children', function ($value, $data){
|
||||
$details = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select();
|
||||
return $details;
|
||||
})
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return ProjectChangeVisa::with(['projectInfo'])
|
||||
->append(['children'])
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->withAttr('children', function ($value, $data) {
|
||||
$details = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select();
|
||||
return $details;
|
||||
})
|
||||
->select()->each(function ($data) {
|
||||
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
|
||||
$data['djr_name'] = $djr?->name;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ProjectChangeVisa::where($this->searchWhere)->count();
|
||||
}
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ProjectChangeVisa::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '项目变更签证';
|
||||
}
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '项目变更签证';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'id',
|
||||
'num' => '单据编号',
|
||||
'project_id' => '项目id',
|
||||
'djr' => '登记人',
|
||||
'apptime' => '登记日期',
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'id',
|
||||
'num' => '单据编号',
|
||||
'project_id' => '项目id',
|
||||
'djr' => '登记人',
|
||||
'apptime' => '登记日期',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -12,97 +12,103 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\project_process_management;
|
||||
namespace app\adminapi\lists\project_process_management;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\model\project_process_management\ProjectRectification;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\project_process_management\ProjectRectification;
|
||||
|
||||
|
||||
/**
|
||||
* ProjectRectification列表
|
||||
* Class ProjectRectificationLists
|
||||
* @package app\adminapi\listsproject_process_management
|
||||
*/
|
||||
class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
|
||||
{
|
||||
/**
|
||||
* ProjectRectification列表
|
||||
* Class ProjectRectificationLists
|
||||
* @package app\adminapi\listsproject_process_management
|
||||
*/
|
||||
class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num','wt_unit','xm_master','zg_master']
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num', 'wt_unit', 'xm_master', 'zg_master']
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return ProjectRectification::with(['projectInfo'])
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return ProjectRectification::with(['projectInfo'])
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($data) {
|
||||
$xmfz = Admin::field('name')->where('id', $data['xm_master'])->findOrEmpty();
|
||||
$djr = Admin::field('name')->where('id', $data['dj_person'])->findOrEmpty();
|
||||
$data['xm_master_name'] = $xmfz?->name;
|
||||
$data['dj_person_name'] = $djr?->name;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ProjectRectification::where($this->searchWhere)->count();
|
||||
}
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ProjectRectification::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '项目整改';
|
||||
}
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '项目整改';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'id',
|
||||
'num' => '单据编号',
|
||||
'project_id' => '项目id',
|
||||
'wt_unit' => '委托单位',
|
||||
'jsdw' => '建设单位',
|
||||
'bmfz' => '部门负责人',
|
||||
'xmfz' => '项目负责人',
|
||||
'riqi' => '踏勘日期',
|
||||
'people' => '踏勘人员',
|
||||
'djr' => '登记人',
|
||||
'apptime' => '登记日期',
|
||||
'content' => '踏勘内容',
|
||||
'remark' => '核实结果',
|
||||
];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'id',
|
||||
'num' => '单据编号',
|
||||
'project_id' => '项目id',
|
||||
'wt_unit' => '委托单位',
|
||||
'jsdw' => '建设单位',
|
||||
'bmfz' => '部门负责人',
|
||||
'xmfz' => '项目负责人',
|
||||
'riqi' => '踏勘日期',
|
||||
'people' => '踏勘人员',
|
||||
'djr' => '登记人',
|
||||
'apptime' => '登记日期',
|
||||
'content' => '踏勘内容',
|
||||
'remark' => '核实结果',
|
||||
];
|
||||
}
|
||||
}
|
@ -12,98 +12,104 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\project_process_management;
|
||||
namespace app\adminapi\lists\project_process_management;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\model\project_process_management\ProjectSurveySignature;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\project_process_management\ProjectSurveySignature;
|
||||
|
||||
|
||||
/**
|
||||
* ProjectSurveySignature列表
|
||||
* Class ProjectSurveySignatureLists
|
||||
* @package app\adminapi\listsproject_process_management
|
||||
*/
|
||||
class ProjectSurveySignatureLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
|
||||
{
|
||||
/**
|
||||
* ProjectSurveySignature列表
|
||||
* Class ProjectSurveySignatureLists
|
||||
* @package app\adminapi\listsproject_process_management
|
||||
*/
|
||||
class ProjectSurveySignatureLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num','wt_unit','jsdw']
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num', 'wt_unit', 'jsdw']
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return ProjectSurveySignature::with(['projectInfo'])
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
/**
|
||||
* @notes 获取列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return ProjectSurveySignature::with(['projectInfo'])
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($data) {
|
||||
$xmfz = Admin::field('name')->where('id', $data['xmfz'])->findOrEmpty();
|
||||
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
|
||||
$data['xmfz_name'] = $xmfz?->name;
|
||||
$data['djr_name'] = $djr?->name;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ProjectSurveySignature::where($this->searchWhere)->count();
|
||||
}
|
||||
/**
|
||||
* @notes 获取数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ProjectSurveySignature::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '项目踏勘会签';
|
||||
}
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '项目踏勘会签';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'id',
|
||||
'num' => '单据编号',
|
||||
'project_id' => '项目id',
|
||||
'wt_unit' => '委托单位',
|
||||
'jsdw' => '建设单位',
|
||||
'bmfz' => '部门负责人',
|
||||
'xmfz' => '项目负责人',
|
||||
'riqi' => '踏勘日期',
|
||||
'people' => '踏勘人员',
|
||||
'djr' => '登记人',
|
||||
'apptime' => '登记日期',
|
||||
'content' => '踏勘内容',
|
||||
'remark' => '核实结果',
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'id',
|
||||
'num' => '单据编号',
|
||||
'project_id' => '项目id',
|
||||
'wt_unit' => '委托单位',
|
||||
'jsdw' => '建设单位',
|
||||
'bmfz' => '部门负责人',
|
||||
'xmfz' => '项目负责人',
|
||||
'riqi' => '踏勘日期',
|
||||
'people' => '踏勘人员',
|
||||
'djr' => '登记人',
|
||||
'apptime' => '登记日期',
|
||||
'content' => '踏勘内容',
|
||||
'remark' => '核实结果',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -12,129 +12,132 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic;
|
||||
namespace app\adminapi\logic;
|
||||
|
||||
|
||||
use app\common\model\DataReception;
|
||||
use app\common\logic\BaseLogic;
|
||||
use think\facade\Db;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\DataReception;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* DataReception逻辑
|
||||
* Class DataReceptionLogic
|
||||
* @package app\adminapi\logic
|
||||
*/
|
||||
class DataReceptionLogic extends BaseLogic
|
||||
{
|
||||
/**
|
||||
* DataReception逻辑
|
||||
* Class DataReceptionLogic
|
||||
* @package app\adminapi\logic
|
||||
*/
|
||||
class DataReceptionLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
DataReception::create([
|
||||
'dataid' => generate_sn(DataReception::class, 'dataid'),
|
||||
'num' => generate_sn(DataReception::class, 'num'),
|
||||
'project_id' => $params['project_id'],
|
||||
'apptime' => $params['apptime'],
|
||||
'person' => $params['person'],
|
||||
'number' => $params['number'],
|
||||
'position' => $params['position'],
|
||||
'tips' => $params['tips'],
|
||||
'bidding_file' => $params['bidding_file'] ? json_encode($params['bidding_file']) : null,
|
||||
'zbkzj_file' => $params['zbkzj_file'] ? json_encode($params['zbkzj_file']) : null,
|
||||
'gczjht_file' => $params['gczjht_file'] ? json_encode($params['gczjht_file']) : null,
|
||||
'xmbgqzzl_file' => $params['xmbgqzzl_file'] ? json_encode($params['xmbgqzzl_file']) : null,
|
||||
'ssgsysjs_file' => $params['ssgsysjs_file'] ? json_encode($params['ssgsysjs_file']) : null,
|
||||
'wlhj_file' => $params['wlhj_file'] ? json_encode($params['wlhj_file']) : null,
|
||||
'other_file' => $params['other_file'] ? json_encode($params['other_file']) : null,
|
||||
]);
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
DataReception::create([
|
||||
'dataid' => generate_sn(DataReception::class, 'dataid'),
|
||||
'num' => generate_sn(DataReception::class, 'num'),
|
||||
'project_id' => $params['project_id'],
|
||||
'apptime' => $params['apptime'],
|
||||
'person' => $params['person'],
|
||||
'number' => $params['number'],
|
||||
'position' => $params['position'],
|
||||
'tips' => $params['tips'],
|
||||
'bidding_file' => $params['bidding_file'] ? json_encode($params['bidding_file']) : null,
|
||||
'zbkzj_file' => $params['zbkzj_file'] ? json_encode($params['zbkzj_file']) : null,
|
||||
'gczjht_file' => $params['gczjht_file'] ? json_encode($params['gczjht_file']) : null,
|
||||
'xmbgqzzl_file' => $params['xmbgqzzl_file'] ? json_encode($params['xmbgqzzl_file']) : null,
|
||||
'ssgsysjs_file' => $params['ssgsysjs_file'] ? json_encode($params['ssgsysjs_file']) : null,
|
||||
'wlhj_file' => $params['wlhj_file'] ? json_encode($params['wlhj_file']) : null,
|
||||
'other_file' => $params['other_file'] ? json_encode($params['other_file']) : null,
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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 09:21
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
DataReception::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'apptime' => $params['apptime'],
|
||||
'person' => $params['person'],
|
||||
'number' => $params['number'],
|
||||
'position' => $params['position'],
|
||||
'tips' => $params['tips'],
|
||||
'bidding_file' => $params['bidding_file'] ? json_encode($params['bidding_file']) : null,
|
||||
'zbkzj_file' => $params['zbkzj_file'] ? json_encode($params['zbkzj_file']) : null,
|
||||
'gczjht_file' => $params['gczjht_file'] ? json_encode($params['gczjht_file']) : null,
|
||||
'xmbgqzzl_file' => $params['xmbgqzzl_file'] ? json_encode($params['xmbgqzzl_file']) : null,
|
||||
'ssgsysjs_file' => $params['ssgsysjs_file'] ? json_encode($params['ssgsysjs_file']) : null,
|
||||
'wlhj_file' => $params['wlhj_file'] ? json_encode($params['wlhj_file']) : null,
|
||||
'other_file' => $params['other_file'] ? json_encode($params['other_file']) : null,
|
||||
]);
|
||||
/**
|
||||
* @notes 编辑
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
DataReception::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'apptime' => $params['apptime'],
|
||||
'person' => $params['person'],
|
||||
'number' => $params['number'],
|
||||
'position' => $params['position'],
|
||||
'tips' => $params['tips'],
|
||||
'bidding_file' => $params['bidding_file'] ? json_encode($params['bidding_file']) : null,
|
||||
'zbkzj_file' => $params['zbkzj_file'] ? json_encode($params['zbkzj_file']) : null,
|
||||
'gczjht_file' => $params['gczjht_file'] ? json_encode($params['gczjht_file']) : null,
|
||||
'xmbgqzzl_file' => $params['xmbgqzzl_file'] ? json_encode($params['xmbgqzzl_file']) : null,
|
||||
'ssgsysjs_file' => $params['ssgsysjs_file'] ? json_encode($params['ssgsysjs_file']) : null,
|
||||
'wlhj_file' => $params['wlhj_file'] ? json_encode($params['wlhj_file']) : null,
|
||||
'other_file' => $params['other_file'] ? json_encode($params['other_file']) : null,
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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 09:21
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return DataReception::destroy($params['id']);
|
||||
}
|
||||
/**
|
||||
* @notes 删除
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return DataReception::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = DataReception::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||
$data['bidding_file'] = !empty($data['bidding_file']) ? json_decode($data['bidding_file'], true) : '';
|
||||
$data['zbkzj_file'] = !empty($data['zbkzj_file']) ? json_decode($data['zbkzj_file'], true) : '';
|
||||
$data['gczjht_file'] = !empty($data['gczjht_file']) ? json_decode($data['gczjht_file'], true) : '';
|
||||
$data['xmbgqzzl_file'] = !empty($data['xmbgqzzl_file']) ? json_decode($data['xmbgqzzl_file'], true) : '';
|
||||
$data['ssgsysjs_file'] = !empty($data['ssgsysjs_file']) ? json_decode($data['ssgsysjs_file'], true) : '';
|
||||
$data['wlhj_file'] = !empty($data['wlhj_file']) ? json_decode($data['wlhj_file'], true) : '';
|
||||
$data['other_file'] = !empty($data['other_file']) ? json_decode($data['other_file'], true) : '';
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:21
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = DataReception::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||
$data['bidding_file'] = !empty($data['bidding_file']) ? json_decode($data['bidding_file'], true) : '';
|
||||
$data['zbkzj_file'] = !empty($data['zbkzj_file']) ? json_decode($data['zbkzj_file'], true) : '';
|
||||
$data['gczjht_file'] = !empty($data['gczjht_file']) ? json_decode($data['gczjht_file'], true) : '';
|
||||
$data['xmbgqzzl_file'] = !empty($data['xmbgqzzl_file']) ? json_decode($data['xmbgqzzl_file'], true) : '';
|
||||
$data['ssgsysjs_file'] = !empty($data['ssgsysjs_file']) ? json_decode($data['ssgsysjs_file'], true) : '';
|
||||
$data['wlhj_file'] = !empty($data['wlhj_file']) ? json_decode($data['wlhj_file'], true) : '';
|
||||
$data['other_file'] = !empty($data['other_file']) ? json_decode($data['other_file'], true) : '';
|
||||
$head = Admin::field('name')->where('id', $data['person'])->findOrEmpty();
|
||||
$data['person_name'] = $head?->name;
|
||||
return $data;
|
||||
}
|
||||
}
|
@ -140,6 +140,8 @@
|
||||
$project = CostProject::field('project_name,project_num,contract_id,industry,principal')->where('id', $data['project_id'])->findOrEmpty();
|
||||
$contract = MarketingContract::field('contract_name')->where('id', $project['contract_id'])->findOrEmpty();
|
||||
$admin = Admin::field('name')->where('id', $project['principal'])->findOrEmpty();
|
||||
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
|
||||
$data['djr_name'] = $djr?->name;
|
||||
$data['project_name'] = $project['project_name'];
|
||||
$data['project_num'] = $project['project_num'];
|
||||
$data['contract_name'] = $contract['contract_name'];
|
||||
|
@ -12,135 +12,136 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic\project_process_management;
|
||||
namespace app\adminapi\logic\project_process_management;
|
||||
|
||||
|
||||
use app\common\model\project_process_management\ProjectChangeVisa;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\project_process_management\ProjectChangeVisaContent;
|
||||
use think\facade\Db;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\project_process_management\ProjectChangeVisa;
|
||||
use app\common\model\project_process_management\ProjectChangeVisaContent;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* ProjectChangeVisa逻辑
|
||||
* Class ProjectChangeVisaLogic
|
||||
* @package app\adminapi\logic\project_process_management
|
||||
*/
|
||||
class ProjectChangeVisaLogic extends BaseLogic
|
||||
{
|
||||
/**
|
||||
* ProjectChangeVisa逻辑
|
||||
* Class ProjectChangeVisaLogic
|
||||
* @package app\adminapi\logic\project_process_management
|
||||
*/
|
||||
class ProjectChangeVisaLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
$projectChangeVisa = ProjectChangeVisa::create([
|
||||
'dataid' => generate_sn(ProjectChangeVisa::class, 'dataid'),
|
||||
'num' => generate_sn(ProjectChangeVisa::class, 'num'),
|
||||
'project_id' => $params['project_id'],
|
||||
'djr' => $params['djr'],
|
||||
'djrq' => $params['djrq'],
|
||||
]);
|
||||
if(!empty($params['project_change_visa_content'])){
|
||||
foreach ($params['project_change_visa_content'] as $item) {
|
||||
$item['project_change_visa_id'] = $projectChangeVisa->id;
|
||||
ProjectChangeVisaContentLogic::add($item);
|
||||
/**
|
||||
* @notes 编辑
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectChangeVisa::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'djr' => $params['djr'],
|
||||
'djrq' => $params['djrq'],
|
||||
]);
|
||||
if (!empty($params['project_change_visa_content'])) {
|
||||
foreach ($params['project_change_visa_content'] as $item) {
|
||||
if (!empty($item['id'])) {
|
||||
ProjectChangeVisaContentLogic::edit($item);
|
||||
} else {
|
||||
$item['project_change_visa_id'] = $params['id'];
|
||||
ProjectChangeVisaContentLogic::add($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
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 09:58
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectChangeVisa::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'djr' => $params['djr'],
|
||||
'djrq' => $params['djrq'],
|
||||
]);
|
||||
if(!empty($params['project_change_visa_content'])){
|
||||
foreach ($params['project_change_visa_content'] as $item) {
|
||||
if(!empty($item['id'])){
|
||||
ProjectChangeVisaContentLogic::edit($item);
|
||||
}else{
|
||||
$item['project_change_visa_id'] = $params['id'];
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
$projectChangeVisa = ProjectChangeVisa::create([
|
||||
'dataid' => generate_sn(ProjectChangeVisa::class, 'dataid'),
|
||||
'num' => generate_sn(ProjectChangeVisa::class, 'num'),
|
||||
'project_id' => $params['project_id'],
|
||||
'djr' => $params['djr'],
|
||||
'djrq' => $params['djrq'],
|
||||
]);
|
||||
if (!empty($params['project_change_visa_content'])) {
|
||||
foreach ($params['project_change_visa_content'] as $item) {
|
||||
$item['project_change_visa_id'] = $projectChangeVisa->id;
|
||||
ProjectChangeVisaContentLogic::add($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
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 09:58
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
$data = ProjectChangeVisaContent::where('project_change_visa_id','in',$params['id'])->findOrEmpty();
|
||||
if(!$data->isEmpty()){
|
||||
self::setError('此数据关联了项目变更签证明细信息,须删除项目变更签证明细信息');
|
||||
return false;
|
||||
}
|
||||
return ProjectChangeVisa::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectChangeVisa::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||
$data['project_change_visa_content'] = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select();
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function datas()
|
||||
{
|
||||
$datas = ProjectChangeVisa::field(['id', 'num'])
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
foreach ($datas as &$item) {
|
||||
$item['projectinfo'] = 'ID:' . $item['id'] . ' / 单号:' . $item['num'];
|
||||
}
|
||||
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 09:58
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
$data = ProjectChangeVisaContent::where('project_change_visa_id', 'in', $params['id'])->findOrEmpty();
|
||||
if (!$data->isEmpty()) {
|
||||
self::setError('此数据关联了项目变更签证明细信息,须删除项目变更签证明细信息');
|
||||
return false;
|
||||
}
|
||||
return ProjectChangeVisa::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 09:58
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectChangeVisa::with(['projectInfo'])->findOrEmpty($params['id']);
|
||||
$data['project_change_visa_content'] = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select();
|
||||
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
|
||||
$data['djr_name'] = $djr?->name;
|
||||
return $data->toArray();
|
||||
}
|
||||
|
||||
public static function datas()
|
||||
{
|
||||
$datas = ProjectChangeVisa::field(['id', 'num'])
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
foreach ($datas as &$item) {
|
||||
$item['projectinfo'] = 'ID:' . $item['id'] . ' / 单号:' . $item['num'];
|
||||
}
|
||||
return $datas;
|
||||
}
|
||||
return $datas;
|
||||
}
|
||||
}
|
@ -12,117 +12,123 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic\project_process_management;
|
||||
namespace app\adminapi\logic\project_process_management;
|
||||
|
||||
|
||||
use app\common\model\project_process_management\ProjectRectification;
|
||||
use app\common\logic\BaseLogic;
|
||||
use think\facade\Db;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\project_process_management\ProjectRectification;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* ProjectRectification逻辑
|
||||
* Class ProjectRectificationLogic
|
||||
* @package app\adminapi\logic\project_process_management
|
||||
*/
|
||||
class ProjectRectificationLogic extends BaseLogic
|
||||
{
|
||||
/**
|
||||
* ProjectRectification逻辑
|
||||
* Class ProjectRectificationLogic
|
||||
* @package app\adminapi\logic\project_process_management
|
||||
*/
|
||||
class ProjectRectificationLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectRectification::create([
|
||||
'dataid' => generate_sn(ProjectRectification::class, 'dataid'),
|
||||
'num' => generate_sn(ProjectRectification::class, 'num'),
|
||||
'project_id' => $params['project_id'],
|
||||
'wt_unit' => $params['wt_unit'],
|
||||
'xm_master' => $params['xm_master'],
|
||||
'zx_type' => $params['zx_type'],
|
||||
'zg_master' => $params['zg_master'],
|
||||
'dj_person' => $params['dj_person'],
|
||||
'apptime' => $params['apptime'],
|
||||
'problem' => $params['problem'],
|
||||
'deal_desc' => $params['deal_desc'],
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
]);
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectRectification::create([
|
||||
'dataid' => generate_sn(ProjectRectification::class, 'dataid'),
|
||||
'num' => generate_sn(ProjectRectification::class, 'num'),
|
||||
'project_id' => $params['project_id'],
|
||||
'wt_unit' => $params['wt_unit'],
|
||||
'xm_master' => $params['xm_master'],
|
||||
'zx_type' => $params['zx_type'],
|
||||
'zg_master' => $params['zg_master'],
|
||||
'dj_person' => $params['dj_person'],
|
||||
'apptime' => $params['apptime'],
|
||||
'problem' => $params['problem'],
|
||||
'deal_desc' => $params['deal_desc'],
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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 11:22
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectRectification::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'wt_unit' => $params['wt_unit'],
|
||||
'xm_master' => $params['xm_master'],
|
||||
'zx_type' => $params['zx_type'],
|
||||
'zg_master' => $params['zg_master'],
|
||||
'dj_person' => $params['dj_person'],
|
||||
'apptime' => $params['apptime'],
|
||||
'problem' => $params['problem'],
|
||||
'deal_desc' => $params['deal_desc'],
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
]);
|
||||
/**
|
||||
* @notes 编辑
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectRectification::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'wt_unit' => $params['wt_unit'],
|
||||
'xm_master' => $params['xm_master'],
|
||||
'zx_type' => $params['zx_type'],
|
||||
'zg_master' => $params['zg_master'],
|
||||
'dj_person' => $params['dj_person'],
|
||||
'apptime' => $params['apptime'],
|
||||
'problem' => $params['problem'],
|
||||
'deal_desc' => $params['deal_desc'],
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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 11:22
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return ProjectRectification::destroy($params['id']);
|
||||
}
|
||||
/**
|
||||
* @notes 删除
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return ProjectRectification::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return ProjectRectification::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:22
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectRectification::with(['projectInfo'])->findOrEmpty($params['id']);
|
||||
$xmfz = Admin::field('name')->where('id', $data['xm_master'])->findOrEmpty();
|
||||
$djr = Admin::field('name')->where('id', $data['dj_person'])->findOrEmpty();
|
||||
$data['xm_master_name'] = $xmfz?->name;
|
||||
$data['dj_person_name'] = $djr?->name;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -12,122 +12,127 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic\project_process_management;
|
||||
namespace app\adminapi\logic\project_process_management;
|
||||
|
||||
|
||||
use app\common\model\project_process_management\ProjectSurveySignature;
|
||||
use app\common\logic\BaseLogic;
|
||||
use think\facade\Db;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\project_process_management\ProjectSurveySignature;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* ProjectSurveySignature逻辑
|
||||
* Class ProjectSurveySignatureLogic
|
||||
* @package app\adminapi\logic\project_process_management
|
||||
*/
|
||||
class ProjectSurveySignatureLogic extends BaseLogic
|
||||
{
|
||||
/**
|
||||
* ProjectSurveySignature逻辑
|
||||
* Class ProjectSurveySignatureLogic
|
||||
* @package app\adminapi\logic\project_process_management
|
||||
*/
|
||||
class ProjectSurveySignatureLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectSurveySignature::create([
|
||||
'dataid' => generate_sn(ProjectSurveySignature::class, 'dataid'),
|
||||
'num' => generate_sn(ProjectSurveySignature::class, 'num'),
|
||||
'project_id' => $params['project_id'],
|
||||
'wt_unit' => $params['wt_unit'],
|
||||
'jsdw' => $params['jsdw'],
|
||||
'bmfz' => $params['bmfz'],
|
||||
'xmfz' => $params['xmfz'],
|
||||
'riqi' => $params['riqi'],
|
||||
'people' => $params['people'],
|
||||
'djr' => $params['djr'],
|
||||
'apptime' => $params['apptime'],
|
||||
'content' => $params['content'],
|
||||
'result' => $params['result'],
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null
|
||||
]);
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectSurveySignature::create([
|
||||
'dataid' => generate_sn(ProjectSurveySignature::class, 'dataid'),
|
||||
'num' => generate_sn(ProjectSurveySignature::class, 'num'),
|
||||
'project_id' => $params['project_id'],
|
||||
'wt_unit' => $params['wt_unit'],
|
||||
'jsdw' => $params['jsdw'],
|
||||
'bmfz' => $params['bmfz'],
|
||||
'xmfz' => $params['xmfz'],
|
||||
'riqi' => $params['riqi'],
|
||||
'people' => $params['people'],
|
||||
'djr' => $params['djr'],
|
||||
'apptime' => $params['apptime'],
|
||||
'content' => $params['content'],
|
||||
'result' => $params['result'],
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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 11:06
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectSurveySignature::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'wt_unit' => $params['wt_unit'],
|
||||
'jsdw' => $params['jsdw'],
|
||||
'bmfz' => $params['bmfz'],
|
||||
'xmfz' => $params['xmfz'],
|
||||
'riqi' => $params['riqi'],
|
||||
'people' => $params['people'],
|
||||
'djr' => $params['djr'],
|
||||
'apptime' => $params['apptime'],
|
||||
'content' => $params['content'],
|
||||
'result' => $params['result'],
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null
|
||||
]);
|
||||
/**
|
||||
* @notes 编辑
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectSurveySignature::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'wt_unit' => $params['wt_unit'],
|
||||
'jsdw' => $params['jsdw'],
|
||||
'bmfz' => $params['bmfz'],
|
||||
'xmfz' => $params['xmfz'],
|
||||
'riqi' => $params['riqi'],
|
||||
'people' => $params['people'],
|
||||
'djr' => $params['djr'],
|
||||
'apptime' => $params['apptime'],
|
||||
'content' => $params['content'],
|
||||
'result' => $params['result'],
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
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 11:06
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return ProjectSurveySignature::destroy($params['id']);
|
||||
}
|
||||
/**
|
||||
* @notes 删除
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return ProjectSurveySignature::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectSurveySignature::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @notes 获取详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/02/23 11:06
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectSurveySignature::with(['projectInfo'])->findOrEmpty($params['id']);
|
||||
$xmfz = Admin::field('name')->where('id', $data['xmfz'])->findOrEmpty();
|
||||
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
|
||||
$data['xmfz_name'] = $xmfz?->name;
|
||||
$data['djr_name'] = $djr?->name;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user