This commit is contained in:
weiz 2024-04-22 15:49:10 +08:00
parent b5530b1177
commit cdbc08e784
10 changed files with 903 additions and 865 deletions

View File

@ -15,10 +15,10 @@
namespace app\adminapi\lists; namespace app\adminapi\lists;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface; use app\common\lists\ListsExcelInterface;
use app\common\model\DataReception;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\auth\Admin;
use app\common\model\DataReception;
/** /**
@ -60,7 +60,10 @@ class DataReceptionLists extends BaseAdminDataLists implements ListsSearchInterf
->with(['projectInfo']) ->with(['projectInfo'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()->each(function ($data) {
$head = Admin::field('name')->where('id', $data['person'])->findOrEmpty();
$data['person_name'] = $head?->name;
})
->toArray(); ->toArray();
} }

View File

@ -67,6 +67,8 @@
$project = CostProject::field('project_name,project_num,contract_id,industry,principal')->where('id', $data['project_id'])->findOrEmpty(); $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(); $contract = MarketingContract::field('contract_name')->where('id', $project['contract_id'])->findOrEmpty();
$admin = Admin::field('name')->where('id', $project['principal'])->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_name'] = $project['project_name'];
$data['project_num'] = $project['project_num']; $data['project_num'] = $project['project_num'];
$data['contract_name'] = $contract['contract_name']; $data['contract_name'] = $contract['contract_name'];

View File

@ -17,8 +17,9 @@ namespace app\adminapi\lists\project_process_management;
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface; use app\common\lists\ListsExcelInterface;
use app\common\model\project_process_management\ProjectChangeVisa;
use app\common\lists\ListsSearchInterface; 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; use app\common\model\project_process_management\ProjectChangeVisaContent;
@ -66,7 +67,10 @@ class ProjectChangeVisaLists extends BaseAdminDataLists implements ListsSearchIn
$details = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select(); $details = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select();
return $details; return $details;
}) })
->select() ->select()->each(function ($data) {
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
$data['djr_name'] = $djr?->name;
})
->toArray(); ->toArray();
} }

View File

@ -17,8 +17,9 @@ namespace app\adminapi\lists\project_process_management;
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface; use app\common\lists\ListsExcelInterface;
use app\common\model\project_process_management\ProjectRectification;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\auth\Admin;
use app\common\model\project_process_management\ProjectRectification;
/** /**
@ -60,7 +61,12 @@ class ProjectRectificationLists extends BaseAdminDataLists implements ListsSearc
->where($this->searchWhere) ->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->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(); ->toArray();
} }

View File

@ -17,8 +17,9 @@ namespace app\adminapi\lists\project_process_management;
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface; use app\common\lists\ListsExcelInterface;
use app\common\model\project_process_management\ProjectSurveySignature;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\auth\Admin;
use app\common\model\project_process_management\ProjectSurveySignature;
/** /**
@ -60,7 +61,12 @@ class ProjectSurveySignatureLists extends BaseAdminDataLists implements ListsSea
->where($this->searchWhere) ->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->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(); ->toArray();
} }

View File

@ -15,8 +15,9 @@
namespace app\adminapi\logic; namespace app\adminapi\logic;
use app\common\model\DataReception;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use app\common\model\auth\Admin;
use app\common\model\DataReception;
use think\facade\Db; use think\facade\Db;
@ -135,6 +136,8 @@ class DataReceptionLogic extends BaseLogic
$data['ssgsysjs_file'] = !empty($data['ssgsysjs_file']) ? json_decode($data['ssgsysjs_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['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) : ''; $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; return $data;
} }
} }

View File

@ -140,6 +140,8 @@
$project = CostProject::field('project_name,project_num,contract_id,industry,principal')->where('id', $data['project_id'])->findOrEmpty(); $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(); $contract = MarketingContract::field('contract_name')->where('id', $project['contract_id'])->findOrEmpty();
$admin = Admin::field('name')->where('id', $project['principal'])->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_name'] = $project['project_name'];
$data['project_num'] = $project['project_num']; $data['project_num'] = $project['project_num'];
$data['contract_name'] = $contract['contract_name']; $data['contract_name'] = $contract['contract_name'];

View File

@ -15,8 +15,9 @@
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\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 app\common\model\project_process_management\ProjectChangeVisaContent;
use think\facade\Db; use think\facade\Db;
@ -30,40 +31,6 @@ 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);
}
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/** /**
* @notes 编辑 * @notes 编辑
* @param array $params * @param array $params
@ -99,6 +66,38 @@ 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);
}
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/** /**
* @notes 删除 * @notes 删除
@ -127,9 +126,11 @@ class ProjectChangeVisaLogic extends BaseLogic
*/ */
public static function detail($params): array 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(); $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() public static function datas()

View File

@ -15,8 +15,9 @@
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 app\common\logic\BaseLogic;
use app\common\model\auth\Admin;
use app\common\model\project_process_management\ProjectRectification;
use think\facade\Db; use think\facade\Db;
@ -123,6 +124,11 @@ class ProjectRectificationLogic extends BaseLogic
*/ */
public static function detail($params): array 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();
} }
} }

View File

@ -15,8 +15,9 @@
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 app\common\logic\BaseLogic;
use app\common\model\auth\Admin;
use app\common\model\project_process_management\ProjectSurveySignature;
use think\facade\Db; use think\facade\Db;
@ -127,7 +128,11 @@ class ProjectSurveySignatureLogic extends BaseLogic
*/ */
public static function detail($params): array public static function detail($params): array
{ {
$data = ProjectSurveySignature::with(['projectInfo'])->findOrEmpty($params['id'])->toArray(); $data = ProjectSurveySignature::with(['projectInfo'])->findOrEmpty($params['id']);
return $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;
return $data->toArray();
} }
} }