update
This commit is contained in:
parent
b5530b1177
commit
cdbc08e784
@ -12,22 +12,22 @@
|
||||
// | 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
|
||||
{
|
||||
class DataReceptionLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -40,7 +40,7 @@ class DataReceptionLists extends BaseAdminDataLists implements ListsSearchInterf
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num','person']
|
||||
'%like%' => ['num', 'person']
|
||||
];
|
||||
}
|
||||
|
||||
@ -60,7 +60,10 @@ class DataReceptionLists extends BaseAdminDataLists implements ListsSearchInterf
|
||||
->with(['projectInfo'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->select()->each(function ($data) {
|
||||
$head = Admin::field('name')->where('id', $data['person'])->findOrEmpty();
|
||||
$data['person_name'] = $head?->name;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
@ -100,4 +103,4 @@ class DataReceptionLists extends BaseAdminDataLists implements ListsSearchInterf
|
||||
'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,23 +12,24 @@
|
||||
// | 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
|
||||
{
|
||||
class ProjectChangeVisaLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -62,11 +63,14 @@ class ProjectChangeVisaLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->withAttr('children', function ($value, $data){
|
||||
->withAttr('children', function ($value, $data) {
|
||||
$details = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select();
|
||||
return $details;
|
||||
})
|
||||
->select()
|
||||
->select()->each(function ($data) {
|
||||
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
|
||||
$data['djr_name'] = $djr?->name;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
@ -104,4 +108,4 @@ class ProjectChangeVisaLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -12,22 +12,23 @@
|
||||
// | 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
|
||||
{
|
||||
class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -40,7 +41,7 @@ class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearc
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num','wt_unit','xm_master','zg_master']
|
||||
'%like%' => ['num', 'wt_unit', 'xm_master', 'zg_master']
|
||||
];
|
||||
}
|
||||
|
||||
@ -60,7 +61,12 @@ class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearc
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->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();
|
||||
}
|
||||
|
||||
@ -105,4 +111,4 @@ class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearc
|
||||
'remark' => '核实结果',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
@ -12,22 +12,23 @@
|
||||
// | 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
|
||||
{
|
||||
class ProjectSurveySignatureLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -40,7 +41,7 @@ class ProjectSurveySignatureLists extends BaseAdminDataLists implements ListsSea
|
||||
{
|
||||
return [
|
||||
'=' => ['project_id'],
|
||||
'%like%' => ['num','wt_unit','jsdw']
|
||||
'%like%' => ['num', 'wt_unit', 'jsdw']
|
||||
];
|
||||
}
|
||||
|
||||
@ -60,7 +61,12 @@ class ProjectSurveySignatureLists extends BaseAdminDataLists implements ListsSea
|
||||
->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->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();
|
||||
}
|
||||
|
||||
@ -106,4 +112,4 @@ class ProjectSurveySignatureLists extends BaseAdminDataLists implements ListsSea
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -12,21 +12,22 @@
|
||||
// | 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
|
||||
{
|
||||
class DataReceptionLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -135,6 +136,8 @@ class DataReceptionLogic extends BaseLogic
|
||||
$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,24 +12,60 @@
|
||||
// | 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
|
||||
{
|
||||
class ProjectChangeVisaLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加
|
||||
* @param array $params
|
||||
@ -48,7 +84,7 @@ class ProjectChangeVisaLogic extends BaseLogic
|
||||
'djr' => $params['djr'],
|
||||
'djrq' => $params['djrq'],
|
||||
]);
|
||||
if(!empty($params['project_change_visa_content'])){
|
||||
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);
|
||||
@ -63,43 +99,6 @@ class ProjectChangeVisaLogic extends BaseLogic
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除
|
||||
* @param array $params
|
||||
@ -109,8 +108,8 @@ class ProjectChangeVisaLogic extends BaseLogic
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
$data = ProjectChangeVisaContent::where('project_change_visa_id','in',$params['id'])->findOrEmpty();
|
||||
if(!$data->isEmpty()){
|
||||
$data = ProjectChangeVisaContent::where('project_change_visa_id', 'in', $params['id'])->findOrEmpty();
|
||||
if (!$data->isEmpty()) {
|
||||
self::setError('此数据关联了项目变更签证明细信息,须删除项目变更签证明细信息');
|
||||
return false;
|
||||
}
|
||||
@ -127,9 +126,11 @@ class ProjectChangeVisaLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectChangeVisa::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||
$data = ProjectChangeVisa::with(['projectInfo'])->findOrEmpty($params['id']);
|
||||
$data['project_change_visa_content'] = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select();
|
||||
return $data;
|
||||
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
|
||||
$data['djr_name'] = $djr?->name;
|
||||
return $data->toArray();
|
||||
}
|
||||
|
||||
public static function datas()
|
||||
@ -143,4 +144,4 @@ class ProjectChangeVisaLogic extends BaseLogic
|
||||
}
|
||||
return $datas;
|
||||
}
|
||||
}
|
||||
}
|
@ -12,21 +12,22 @@
|
||||
// | 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
|
||||
{
|
||||
class ProjectRectificationLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -123,6 +124,11 @@ class ProjectRectificationLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
return ProjectRectification::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||
$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,21 +12,22 @@
|
||||
// | 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
|
||||
{
|
||||
class ProjectSurveySignatureLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -127,7 +128,11 @@ class ProjectSurveySignatureLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectSurveySignature::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
|
||||
return $data;
|
||||
$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