diff --git a/app/adminapi/controller/supervision_qualification_review/SupervisionConstructionManagementPersonnelController.php b/app/adminapi/controller/supervision_qualification_review/SupervisionConstructionManagementPersonnelController.php new file mode 100644 index 000000000..423b44d48 --- /dev/null +++ b/app/adminapi/controller/supervision_qualification_review/SupervisionConstructionManagementPersonnelController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionConstructionManagementPersonnelLists()); + } + + + /** + * @notes 添加工程监理--施工管理人员 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function add() + { + $params = (new SupervisionConstructionManagementPersonnelValidate())->post()->goCheck('add'); + $result = SupervisionConstructionManagementPersonnelLogic::add($params,$this->adminId); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionConstructionManagementPersonnelLogic::getError()); + } + + + /** + * @notes 编辑工程监理--施工管理人员 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function edit() + { + $params = (new SupervisionConstructionManagementPersonnelValidate())->post()->goCheck('edit'); + $result = SupervisionConstructionManagementPersonnelLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionConstructionManagementPersonnelLogic::getError()); + } + + + /** + * @notes 删除工程监理--施工管理人员 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function delete() + { + $params = (new SupervisionConstructionManagementPersonnelValidate())->post()->goCheck('delete'); + SupervisionConstructionManagementPersonnelLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--施工管理人员详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function detail() + { + $params = (new SupervisionConstructionManagementPersonnelValidate())->goCheck('detail'); + $result = SupervisionConstructionManagementPersonnelLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_qualification_review/SupervisionLargeEquipmentController.php b/app/adminapi/controller/supervision_qualification_review/SupervisionLargeEquipmentController.php new file mode 100644 index 000000000..39aea3ce1 --- /dev/null +++ b/app/adminapi/controller/supervision_qualification_review/SupervisionLargeEquipmentController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionLargeEquipmentLists()); + } + + + /** + * @notes 添加工程监理--大型设备及仪器具 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function add() + { + $params = (new SupervisionLargeEquipmentValidate())->post()->goCheck('add'); + $result = SupervisionLargeEquipmentLogic::add($params,$this->adminId); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionLargeEquipmentLogic::getError()); + } + + + /** + * @notes 编辑工程监理--大型设备及仪器具 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function edit() + { + $params = (new SupervisionLargeEquipmentValidate())->post()->goCheck('edit'); + $result = SupervisionLargeEquipmentLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionLargeEquipmentLogic::getError()); + } + + + /** + * @notes 删除工程监理--大型设备及仪器具 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function delete() + { + $params = (new SupervisionLargeEquipmentValidate())->post()->goCheck('delete'); + SupervisionLargeEquipmentLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--大型设备及仪器具详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function detail() + { + $params = (new SupervisionLargeEquipmentValidate())->goCheck('detail'); + $result = SupervisionLargeEquipmentLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsController.php b/app/adminapi/controller/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsController.php new file mode 100644 index 000000000..bd30192a5 --- /dev/null +++ b/app/adminapi/controller/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionParticipatingUnitsQualificationsLists()); + } + + + /** + * @notes 添加工程监理--参建单位资质 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function add() + { + $params = (new SupervisionParticipatingUnitsQualificationsValidate())->post()->goCheck('add'); + $result = SupervisionParticipatingUnitsQualificationsLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionParticipatingUnitsQualificationsLogic::getError()); + } + + + /** + * @notes 编辑工程监理--参建单位资质 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function edit() + { + $params = (new SupervisionParticipatingUnitsQualificationsValidate())->post()->goCheck('edit'); + $result = SupervisionParticipatingUnitsQualificationsLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionParticipatingUnitsQualificationsLogic::getError()); + } + + + /** + * @notes 删除工程监理--参建单位资质 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function delete() + { + $params = (new SupervisionParticipatingUnitsQualificationsValidate())->post()->goCheck('delete'); + SupervisionParticipatingUnitsQualificationsLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--参建单位资质详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function detail() + { + $params = (new SupervisionParticipatingUnitsQualificationsValidate())->goCheck('detail'); + $result = SupervisionParticipatingUnitsQualificationsLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_qualification_review/SupervisionSafetyManagementPersonnelController.php b/app/adminapi/controller/supervision_qualification_review/SupervisionSafetyManagementPersonnelController.php new file mode 100644 index 000000000..b3e9f9418 --- /dev/null +++ b/app/adminapi/controller/supervision_qualification_review/SupervisionSafetyManagementPersonnelController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionSafetyManagementPersonnelLists()); + } + + + /** + * @notes 添加工程监理--安全管理人员 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function add() + { + $params = (new SupervisionSafetyManagementPersonnelValidate())->post()->goCheck('add'); + $result = SupervisionSafetyManagementPersonnelLogic::add($params,$this->adminId); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionSafetyManagementPersonnelLogic::getError()); + } + + + /** + * @notes 编辑工程监理--安全管理人员 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function edit() + { + $params = (new SupervisionSafetyManagementPersonnelValidate())->post()->goCheck('edit'); + $result = SupervisionSafetyManagementPersonnelLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionSafetyManagementPersonnelLogic::getError()); + } + + + /** + * @notes 删除工程监理--安全管理人员 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function delete() + { + $params = (new SupervisionSafetyManagementPersonnelValidate())->post()->goCheck('delete'); + SupervisionSafetyManagementPersonnelLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--安全管理人员详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function detail() + { + $params = (new SupervisionSafetyManagementPersonnelValidate())->goCheck('detail'); + $result = SupervisionSafetyManagementPersonnelLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_qualification_review/SupervisionSpecialOperationPersonnelController.php b/app/adminapi/controller/supervision_qualification_review/SupervisionSpecialOperationPersonnelController.php new file mode 100644 index 000000000..26bfe80b9 --- /dev/null +++ b/app/adminapi/controller/supervision_qualification_review/SupervisionSpecialOperationPersonnelController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionSpecialOperationPersonnelLists()); + } + + + /** + * @notes 添加工程监理--特种作业人员资质 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function add() + { + $params = (new SupervisionSpecialOperationPersonnelValidate())->post()->goCheck('add'); + $result = SupervisionSpecialOperationPersonnelLogic::add($params,$this->adminId); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionSpecialOperationPersonnelLogic::getError()); + } + + + /** + * @notes 编辑工程监理--特种作业人员资质 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function edit() + { + $params = (new SupervisionSpecialOperationPersonnelValidate())->post()->goCheck('edit'); + $result = SupervisionSpecialOperationPersonnelLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionSpecialOperationPersonnelLogic::getError()); + } + + + /** + * @notes 删除工程监理--特种作业人员资质 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function delete() + { + $params = (new SupervisionSpecialOperationPersonnelValidate())->post()->goCheck('delete'); + SupervisionSpecialOperationPersonnelLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--特种作业人员资质详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function detail() + { + $params = (new SupervisionSpecialOperationPersonnelValidate())->goCheck('detail'); + $result = SupervisionSpecialOperationPersonnelLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_qualification_review/SupervisionConstructionManagementPersonnelLists.php b/app/adminapi/lists/supervision_qualification_review/SupervisionConstructionManagementPersonnelLists.php new file mode 100644 index 000000000..1e23a27d3 --- /dev/null +++ b/app/adminapi/lists/supervision_qualification_review/SupervisionConstructionManagementPersonnelLists.php @@ -0,0 +1,88 @@ + ['unit_qualification_id'], + '%like%' => ['name', 'qualification_name_one', 'qualification_name_two'], + ]; + } + + + /** + * @notes 获取工程监理--施工管理人员列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function lists(): array + { + return SupervisionConstructionManagementPersonnel::withoutField('update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $unit_qualification = SupervisionParticipatingUnitsQualifications::field('company_id')->where('id',$data['unit_qualification_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$unit_qualification['company_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['company_name'] = $company['unit_name']; + $data['create_user_name'] = $admin['name']; + $data['qualification_one_status_text'] = $data->qualification_one_status_text; + $data['qualification_two_status_text'] = $data->qualification_two_status_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--施工管理人员数量 + * @return int + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function count(): int + { + return SupervisionConstructionManagementPersonnel::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_qualification_review/SupervisionLargeEquipmentLists.php b/app/adminapi/lists/supervision_qualification_review/SupervisionLargeEquipmentLists.php new file mode 100644 index 000000000..417d610ca --- /dev/null +++ b/app/adminapi/lists/supervision_qualification_review/SupervisionLargeEquipmentLists.php @@ -0,0 +1,89 @@ + ['unit_qualification_id'], + '%like%' => ['name', 'qualification_name_one', 'qualification_name_two'], + + ]; + } + + + /** + * @notes 获取工程监理--大型设备及仪器具列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function lists(): array + { + return SupervisionLargeEquipment::withoutField('update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $unit_qualification = SupervisionParticipatingUnitsQualifications::field('company_id')->where('id',$data['unit_qualification_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$unit_qualification['company_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['company_name'] = $company['unit_name']; + $data['create_user_name'] = $admin['name']; + $data['qualification_one_status_text'] = $data->qualification_one_status_text; + $data['qualification_two_status_text'] = $data->qualification_two_status_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--大型设备及仪器具数量 + * @return int + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function count(): int + { + return SupervisionLargeEquipment::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsLists.php b/app/adminapi/lists/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsLists.php new file mode 100644 index 000000000..d0fcd99e1 --- /dev/null +++ b/app/adminapi/lists/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsLists.php @@ -0,0 +1,85 @@ + ['project_id', 'company_id'], + '%like%' => ['qualification_name', 'qualification_number'], + ]; + } + + + /** + * @notes 获取工程监理--参建单位资质列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function lists(): array + { + return SupervisionParticipatingUnitsQualifications::withoutField('create_time,update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $project = SupervisionProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$data['company_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['company_name'] = $company['unit_name']; + $data['qualification_status_text'] = $data->qualification_one_status_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--参建单位资质数量 + * @return int + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function count(): int + { + return SupervisionParticipatingUnitsQualifications::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_qualification_review/SupervisionSafetyManagementPersonnelLists.php b/app/adminapi/lists/supervision_qualification_review/SupervisionSafetyManagementPersonnelLists.php new file mode 100644 index 000000000..f6ff21d65 --- /dev/null +++ b/app/adminapi/lists/supervision_qualification_review/SupervisionSafetyManagementPersonnelLists.php @@ -0,0 +1,88 @@ + ['unit_qualification_id'], + '%like%' => ['name', 'qualification_name_one', 'qualification_name_two'], + ]; + } + + + /** + * @notes 获取工程监理--安全管理人员列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function lists(): array + { + return SupervisionSafetyManagementPersonnel::withoutField('update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $unit_qualification = SupervisionParticipatingUnitsQualifications::field('company_id')->where('id',$data['unit_qualification_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$unit_qualification['company_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['company_name'] = $company['unit_name']; + $data['create_user_name'] = $admin['name']; + $data['qualification_one_status_text'] = $data->qualification_one_status_text; + $data['qualification_two_status_text'] = $data->qualification_two_status_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--安全管理人员数量 + * @return int + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function count(): int + { + return SupervisionSafetyManagementPersonnel::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_qualification_review/SupervisionSpecialOperationPersonnelLists.php b/app/adminapi/lists/supervision_qualification_review/SupervisionSpecialOperationPersonnelLists.php new file mode 100644 index 000000000..0d84fc70d --- /dev/null +++ b/app/adminapi/lists/supervision_qualification_review/SupervisionSpecialOperationPersonnelLists.php @@ -0,0 +1,87 @@ + ['unit_qualification_id'], + '%like%' => ['name'], + ]; + } + + + /** + * @notes 获取工程监理--特种作业人员资质列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function lists(): array + { + return SupervisionSpecialOperationPersonnel::withoutField('update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $unit_qualification = SupervisionParticipatingUnitsQualifications::field('company_id')->where('id',$data['unit_qualification_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$unit_qualification['company_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['company_name'] = $company['unit_name']; + $data['create_user_name'] = $admin['name']; + $data['status_text'] = $data->status_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--特种作业人员资质数量 + * @return int + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function count(): int + { + return SupervisionSpecialOperationPersonnel::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_qualification_review/SupervisionConstructionManagementPersonnelLogic.php b/app/adminapi/logic/supervision_qualification_review/SupervisionConstructionManagementPersonnelLogic.php new file mode 100644 index 000000000..bfeee25d4 --- /dev/null +++ b/app/adminapi/logic/supervision_qualification_review/SupervisionConstructionManagementPersonnelLogic.php @@ -0,0 +1,153 @@ + $params['unit_qualification_id'], + 'name' => $params['name'], + 'id_card' => $params['id_card'], + 'technical_title' => $params['technical_title'], + 'job' => $params['job'], + 'qualification_name_one' => $params['qualification_name_one'], + 'certification_body_one' => $params['certification_body_one'], + 'qualification_number_one' => $params['qualification_number_one'], + 'get_date_one' => !empty($params['get_date_one']) ? strtotime($params['get_date_one']) : 0, + 'effective_date_one' => !empty($params['effective_date_one']) ? strtotime($params['effective_date_one']) : 0, + 'qualification_one_status' => $params['qualification_one_status'], + 'qualification_name_two' => $params['qualification_name_two'], + 'certification_body_two' => $params['certification_body_two'], + 'qualification_number_two' => $params['qualification_number_two'], + 'get_date_two' => !empty($params['get_date_two']) ? strtotime($params['get_date_two']) : 0, + 'effective_date_two' => !empty($params['effective_date_two']) ? strtotime($params['effective_date_two']) : 0, + 'qualification_two_status' => $params['qualification_two_status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'create_user' => $admin_id, + ]); + 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/26 10:33 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionConstructionManagementPersonnel::where('id', $params['id'])->update([ + 'unit_qualification_id' => $params['unit_qualification_id'], + 'name' => $params['name'], + 'id_card' => $params['id_card'], + 'technical_title' => $params['technical_title'], + 'job' => $params['job'], + 'qualification_name_one' => $params['qualification_name_one'], + 'certification_body_one' => $params['certification_body_one'], + 'qualification_number_one' => $params['qualification_number_one'], + 'get_date_one' => !empty($params['get_date_one']) ? strtotime($params['get_date_one']) : 0, + 'effective_date_one' => !empty($params['effective_date_one']) ? strtotime($params['effective_date_one']) : 0, + 'qualification_one_status' => $params['qualification_one_status'], + 'qualification_name_two' => $params['qualification_name_two'], + 'certification_body_two' => $params['certification_body_two'], + 'qualification_number_two' => $params['qualification_number_two'], + 'get_date_two' => !empty($params['get_date_two']) ? strtotime($params['get_date_two']) : 0, + 'effective_date_two' => !empty($params['effective_date_two']) ? strtotime($params['effective_date_two']) : 0, + 'qualification_two_status' => $params['qualification_two_status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'update_time' => time(), + ]); + 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/26 10:33 + */ + public static function delete(array $params): bool + { + return SupervisionConstructionManagementPersonnel::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--施工管理人员详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public static function detail($params): array + { + $data = SupervisionConstructionManagementPersonnel::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $unit_qualification = SupervisionParticipatingUnitsQualifications::field('company_id')->where('id',$data['unit_qualification_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$unit_qualification['company_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['company_name'] = $company['unit_name']; + $data['create_user_name'] = $admin['name']; + $data['qualification_one_status_text'] = $data->qualification_one_status_text; + $data['qualification_two_status_text'] = $data->qualification_two_status_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_qualification_review/SupervisionLargeEquipmentLogic.php b/app/adminapi/logic/supervision_qualification_review/SupervisionLargeEquipmentLogic.php new file mode 100644 index 000000000..ee7821fcb --- /dev/null +++ b/app/adminapi/logic/supervision_qualification_review/SupervisionLargeEquipmentLogic.php @@ -0,0 +1,147 @@ + $params['unit_qualification_id'], + 'name' => $params['name'], + 'qualification_name_one' => $params['qualification_name_one'], + 'certification_body_one' => $params['certification_body_one'], + 'qualification_number_one' => $params['qualification_number_one'], + 'get_date_one' => !empty($params['get_date_one']) ? strtotime($params['get_date_one']) : 0, + 'effective_date_one' => !empty($params['effective_date_one']) ? strtotime($params['effective_date_one']) : 0, + 'qualification_one_status' => $params['qualification_one_status'], + 'qualification_name_two' => $params['qualification_name_two'], + 'certification_body_two' => $params['certification_body_two'], + 'qualification_number_two' => $params['qualification_number_two'], + 'get_date_two' => !empty($params['get_date_two']) ? strtotime($params['get_date_two']) : 0, + 'effective_date_two' => !empty($params['effective_date_two']) ? strtotime($params['effective_date_two']) : 0, + 'qualification_two_status' => $params['qualification_two_status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'create_user' => $admin_id, + ]); + 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/26 13:51 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionLargeEquipment::where('id', $params['id'])->update([ + 'unit_qualification_id' => $params['unit_qualification_id'], + 'name' => $params['name'], + 'qualification_name_one' => $params['qualification_name_one'], + 'certification_body_one' => $params['certification_body_one'], + 'qualification_number_one' => $params['qualification_number_one'], + 'get_date_one' => !empty($params['get_date_one']) ? strtotime($params['get_date_one']) : 0, + 'effective_date_one' => !empty($params['effective_date_one']) ? strtotime($params['effective_date_one']) : 0, + 'qualification_one_status' => $params['qualification_one_status'], + 'qualification_name_two' => $params['qualification_name_two'], + 'certification_body_two' => $params['certification_body_two'], + 'qualification_number_two' => $params['qualification_number_two'], + 'get_date_two' => !empty($params['get_date_two']) ? strtotime($params['get_date_two']) : 0, + 'effective_date_two' => !empty($params['effective_date_two']) ? strtotime($params['effective_date_two']) : 0, + 'qualification_two_status' => $params['qualification_two_status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'update_time' => time(), + ]); + 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/26 13:51 + */ + public static function delete(array $params): bool + { + return SupervisionLargeEquipment::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--大型设备及仪器具详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public static function detail($params): array + { + $data = SupervisionLargeEquipment::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $unit_qualification = SupervisionParticipatingUnitsQualifications::field('company_id')->where('id',$data['unit_qualification_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$unit_qualification['company_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['company_name'] = $company['unit_name']; + $data['create_user_name'] = $admin['name']; + $data['qualification_one_status_text'] = $data->qualification_one_status_text; + $data['qualification_two_status_text'] = $data->qualification_two_status_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsLogic.php b/app/adminapi/logic/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsLogic.php new file mode 100644 index 000000000..9a666ed70 --- /dev/null +++ b/app/adminapi/logic/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsLogic.php @@ -0,0 +1,129 @@ + $params['project_id'], + 'company_id' => $params['company_id'], + 'qualification_name' => $params['qualification_name'], + 'qualification_number' => $params['qualification_number'], + 'get_date' => !empty($params['get_date']) ? strtotime($params['get_date']) : 0, + 'effective_date' => !empty($params['effective_date']) ? strtotime($params['effective_date']) : 0, + 'qualification_status' => $params['qualification_status'], + '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; + } + } + + + /** + * @notes 编辑工程监理--参建单位资质 + * @param array $params + * @return bool + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionParticipatingUnitsQualifications::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'company_id' => $params['company_id'], + 'qualification_name' => $params['qualification_name'], + 'qualification_number' => $params['qualification_number'], + 'get_date' => !empty($params['get_date']) ? strtotime($params['get_date']) : 0, + 'effective_date' => !empty($params['effective_date']) ? strtotime($params['effective_date']) : 0, + 'qualification_status' => $params['qualification_status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'update_time' => time(), + ]); + 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/26 14:03 + */ + public static function delete(array $params): bool + { + return SupervisionParticipatingUnitsQualifications::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--参建单位资质详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public static function detail($params): array + { + $data = SupervisionParticipatingUnitsQualifications::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $project = SupervisionProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$data['company_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['company_name'] = $company['unit_name']; + $data['qualification_status_text'] = $data->qualification_one_status_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_qualification_review/SupervisionSafetyManagementPersonnelLogic.php b/app/adminapi/logic/supervision_qualification_review/SupervisionSafetyManagementPersonnelLogic.php new file mode 100644 index 000000000..1d348262e --- /dev/null +++ b/app/adminapi/logic/supervision_qualification_review/SupervisionSafetyManagementPersonnelLogic.php @@ -0,0 +1,153 @@ + $params['unit_qualification_id'], + 'name' => $params['name'], + 'id_card' => $params['id_card'], + 'technical_title' => $params['technical_title'], + 'job' => $params['job'], + 'qualification_name_one' => $params['qualification_name_one'], + 'certification_body_one' => $params['certification_body_one'], + 'qualification_number_one' => $params['qualification_number_one'], + 'get_date_one' => !empty($params['get_date_one']) ? strtotime($params['get_date_one']) : 0, + 'effective_date_one' => !empty($params['effective_date_one']) ? strtotime($params['effective_date_one']) : 0, + 'qualification_one_status' => $params['qualification_one_status'], + 'qualification_name_two' => $params['qualification_name_two'], + 'certification_body_two' => $params['certification_body_two'], + 'qualification_number_two' => $params['qualification_number_two'], + 'get_date_two' => !empty($params['get_date_two']) ? strtotime($params['get_date_two']) : 0, + 'effective_date_two' => !empty($params['effective_date_two']) ? strtotime($params['effective_date_two']) : 0, + 'qualification_two_status' => $params['qualification_two_status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'create_user' => $admin_id, + ]); + 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/26 11:30 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionSafetyManagementPersonnel::where('id', $params['id'])->update([ + 'unit_qualification_id' => $params['unit_qualification_id'], + 'name' => $params['name'], + 'id_card' => $params['id_card'], + 'technical_title' => $params['technical_title'], + 'job' => $params['job'], + 'qualification_name_one' => $params['qualification_name_one'], + 'certification_body_one' => $params['certification_body_one'], + 'qualification_number_one' => $params['qualification_number_one'], + 'get_date_one' => !empty($params['get_date_one']) ? strtotime($params['get_date_one']) : 0, + 'effective_date_one' => !empty($params['effective_date_one']) ? strtotime($params['effective_date_one']) : 0, + 'qualification_one_status' => $params['qualification_one_status'], + 'qualification_name_two' => $params['qualification_name_two'], + 'certification_body_two' => $params['certification_body_two'], + 'qualification_number_two' => $params['qualification_number_two'], + 'get_date_two' => !empty($params['get_date_two']) ? strtotime($params['get_date_two']) : 0, + 'effective_date_two' => !empty($params['effective_date_two']) ? strtotime($params['effective_date_two']) : 0, + 'qualification_two_status' => $params['qualification_two_status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'update_time' => time(), + ]); + 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/26 11:30 + */ + public static function delete(array $params): bool + { + return SupervisionSafetyManagementPersonnel::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--安全管理人员详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public static function detail($params): array + { + $data = SupervisionSafetyManagementPersonnel::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $unit_qualification = SupervisionParticipatingUnitsQualifications::field('company_id')->where('id',$data['unit_qualification_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$unit_qualification['company_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['company_name'] = $company['unit_name']; + $data['create_user_name'] = $admin['name']; + $data['qualification_one_status_text'] = $data->qualification_one_status_text; + $data['qualification_two_status_text'] = $data->qualification_two_status_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_qualification_review/SupervisionSpecialOperationPersonnelLogic.php b/app/adminapi/logic/supervision_qualification_review/SupervisionSpecialOperationPersonnelLogic.php new file mode 100644 index 000000000..401794f6c --- /dev/null +++ b/app/adminapi/logic/supervision_qualification_review/SupervisionSpecialOperationPersonnelLogic.php @@ -0,0 +1,134 @@ + $params['unit_qualification_id'], + 'name' => $params['name'], + 'work_type' => $params['work_type'], + 'id_card' => $params['id_card'], + 'validity_period' => !empty($params['validity_period']) ? strtotime($params['validity_period']) : 0, + 'enter_time' => !empty($params['enter_time']) ? strtotime($params['enter_time']) : 0, + 'leave_time' => !empty($params['leave_time']) ? strtotime($params['leave_time']) : 0, + 'status' => $params['status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'create_user' => $admin_id, + ]); + 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/26 11:45 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionSpecialOperationPersonnel::where('id', $params['id'])->update([ + 'unit_qualification_id' => $params['unit_qualification_id'], + 'name' => $params['name'], + 'work_type' => $params['work_type'], + 'id_card' => $params['id_card'], + 'validity_period' => $params['validity_period'], + 'enter_time' => !empty($params['enter_time']) ? strtotime($params['enter_time']) : 0, + 'leave_time' => !empty($params['leave_time']) ? strtotime($params['leave_time']) : 0, + 'status' => $params['status'], + 'remark' => $params['remark'], + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'update_time' => time(), + ]); + 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/26 11:45 + */ + public static function delete(array $params): bool + { + return SupervisionSpecialOperationPersonnel::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--特种作业人员资质详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public static function detail($params): array + { + $data = SupervisionSpecialOperationPersonnel::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $unit_qualification = SupervisionParticipatingUnitsQualifications::field('company_id')->where('id',$data['unit_qualification_id'])->findOrEmpty(); + $company = SupervisionParticipatingUnits::field('unit_name')->where('id',$unit_qualification['company_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['company_name'] = $company['unit_name']; + $data['create_user_name'] = $admin['name']; + $data['status_text'] = $data->status_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_qualification_review/SupervisionConstructionManagementPersonnelValidate.php b/app/adminapi/validate/supervision_qualification_review/SupervisionConstructionManagementPersonnelValidate.php new file mode 100644 index 000000000..f3395997c --- /dev/null +++ b/app/adminapi/validate/supervision_qualification_review/SupervisionConstructionManagementPersonnelValidate.php @@ -0,0 +1,148 @@ + 'require|checkData', + 'unit_qualification_id' => 'require|checkUnitQualification', + 'name' => 'require', + 'id_card' => 'idCard', + 'get_date_one' => 'dateFormat:Y-m-d', + 'effective_date_one' => 'dateFormat:Y-m-d', + 'qualification_one_status' => 'in:0,1', + 'get_date_two' => 'dateFormat:Y-m-d', + 'effective_date_two' => 'dateFormat:Y-m-d', + 'qualification_two_status' => 'in:0,1', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'unit_qualification_id' => '参建单位资质id', + 'name' => '姓名', + 'id_card' => '身份证', + 'technical_title' => '技术职称', + 'job' => '岗位', + 'qualification_name_one' => '资质名称1', + 'certification_body_one' => '认证机构1', + 'qualification_number_one' => '资质编号1', + 'get_date_one' => '发证日期1', + 'effective_date_one' => '有效日期1', + 'qualification_one_status' => '资质1状态', + 'qualification_name_two' => '资质名称2', + 'certification_body_two' => '认证机构2', + 'qualification_number_two' => '资质编号2', + 'get_date_two' => '发证日期2', + 'effective_date_two' => '有效日期2', + 'qualification_two_status' => '资质2状态', + 'remark' => '备注', + 'create_user' => '创建人', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionConstructionManagementPersonnelValidate + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionConstructionManagementPersonnelValidate + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionConstructionManagementPersonnelValidate + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionConstructionManagementPersonnelValidate + * @author likeadmin + * @date 2024/02/26 10:33 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionConstructionManagementPersonnel::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkUnitQualification($value): bool|string + { + $data = SupervisionParticipatingUnitsQualifications::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '参建单位资质信息不存在'; + } + return true; + } + + public function checkAnnex($value): bool|string + { + if(!empty($value) && $value != '' && !is_array($value)){ + return '附件格式错误'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_qualification_review/SupervisionLargeEquipmentValidate.php b/app/adminapi/validate/supervision_qualification_review/SupervisionLargeEquipmentValidate.php new file mode 100644 index 000000000..99a357738 --- /dev/null +++ b/app/adminapi/validate/supervision_qualification_review/SupervisionLargeEquipmentValidate.php @@ -0,0 +1,144 @@ + 'require|checkData', + 'unit_qualification_id' => 'require|checkUnitQualification', + 'name' => 'require', + 'get_date_one' => 'dateFormat:Y-m-d', + 'effective_date_one' => 'dateFormat:Y-m-d', + 'qualification_one_status' => 'in:0,1', + 'get_date_two' => 'dateFormat:Y-m-d', + 'effective_date_two' => 'dateFormat:Y-m-d', + 'qualification_two_status' => 'in:0,1', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'unit_qualification_id' => '参建单位资质id', + 'name' => '设备名称', + 'qualification_name_one' => '资质名称1', + 'certification_body_one' => '认证机构1', + 'qualification_number_one' => '资质编号1', + 'get_date_one' => '发证日期1', + 'effective_date_one' => '有效日期1', + 'qualification_one_status' => '资质1状态', + 'qualification_name_two' => '资质名称2', + 'certification_body_two' => '认证机构2', + 'qualification_number_two' => '资质编号2', + 'get_date_two' => '发证日期2', + 'effective_date_two' => '有效日期2', + 'qualification_two_status' => '资质2状态', + 'remark' => '备注', + 'create_user' => '创建人', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionLargeEquipmentValidate + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionLargeEquipmentValidate + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionLargeEquipmentValidate + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionLargeEquipmentValidate + * @author likeadmin + * @date 2024/02/26 13:51 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionLargeEquipment::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkUnitQualification($value): bool|string + { + $data = SupervisionParticipatingUnitsQualifications::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '参建单位资质信息不存在'; + } + return true; + } + + public function checkAnnex($value): bool|string + { + if(!empty($value) && $value != '' && !is_array($value)){ + return '附件格式错误'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsValidate.php b/app/adminapi/validate/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsValidate.php new file mode 100644 index 000000000..a360eaf30 --- /dev/null +++ b/app/adminapi/validate/supervision_qualification_review/SupervisionParticipatingUnitsQualificationsValidate.php @@ -0,0 +1,144 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'company_id' => 'require|checkCompany', + 'qualification_name' => 'require', + 'get_date' => 'dateFormat:Y-m-d', + 'effective_date' => 'dateFormat:Y-m-d', + 'qualification_status' => 'in:0,1', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'company_id' => '所属单位', + 'qualification_name' => '资质名称', + 'qualification_number' => '资质编号', + 'get_date' => '发证日期', + 'effective_date' => '有效日期', + 'qualification_status' => '资质状态', + 'remark' => '备注', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionParticipatingUnitsQualificationsValidate + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionParticipatingUnitsQualificationsValidate + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionParticipatingUnitsQualificationsValidate + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionParticipatingUnitsQualificationsValidate + * @author likeadmin + * @date 2024/02/26 14:03 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionParticipatingUnitsQualifications::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value): bool|string + { + $data = SupervisionProject::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '项目信息不存在'; + } + return true; + } + + public function checkCompany($value,$rule,$data){ + $companyData = SupervisionParticipatingUnits::where('id',$value)->where('project_id',$data['project_id'])->findOrEmpty(); + if($companyData->isEmpty()){ + return '所属单位信息不存在'; + } + return true; + } + + public function checkAnnex($value): bool|string + { + if(!empty($value) && $value != '' && !is_array($value)){ + return '附件格式错误'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_qualification_review/SupervisionSafetyManagementPersonnelValidate.php b/app/adminapi/validate/supervision_qualification_review/SupervisionSafetyManagementPersonnelValidate.php new file mode 100644 index 000000000..7e79cc011 --- /dev/null +++ b/app/adminapi/validate/supervision_qualification_review/SupervisionSafetyManagementPersonnelValidate.php @@ -0,0 +1,148 @@ + 'require|checkData', + 'unit_qualification_id' => 'require|checkUnitQualification', + 'name' => 'require', + 'id_card' => 'idCard', + 'get_date_one' => 'dateFormat:Y-m-d', + 'effective_date_one' => 'dateFormat:Y-m-d', + 'qualification_one_status' => 'in:0,1', + 'get_date_two' => 'dateFormat:Y-m-d', + 'effective_date_two' => 'dateFormat:Y-m-d', + 'qualification_two_status' => 'in:0,1', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'unit_qualification_id' => '参建单位资质id', + 'name' => '姓名', + 'id_card' => '身份证', + 'technical_title' => '技术职称', + 'job' => '岗位', + 'qualification_name_one' => '资质名称1', + 'certification_body_one' => '认证机构1', + 'qualification_number_one' => '资质编号1', + 'get_date_one' => '发证日期1', + 'effective_date_one' => '有效日期1', + 'qualification_one_status' => '资质1状态', + 'qualification_name_two' => '资质名称2', + 'certification_body_two' => '认证机构2', + 'qualification_number_two' => '资质编号2', + 'get_date_two' => '发证日期2', + 'effective_date_two' => '有效日期2', + 'qualification_two_status' => '资质2状态', + 'remark' => '备注', + 'create_user' => '创建人', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionSafetyManagementPersonnelValidate + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionSafetyManagementPersonnelValidate + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionSafetyManagementPersonnelValidate + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionSafetyManagementPersonnelValidate + * @author likeadmin + * @date 2024/02/26 11:30 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionSafetyManagementPersonnel::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkUnitQualification($value): bool|string + { + $data = SupervisionParticipatingUnitsQualifications::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '参建单位资质信息不存在'; + } + return true; + } + + public function checkAnnex($value): bool|string + { + if(!empty($value) && $value != '' && !is_array($value)){ + return '附件格式错误'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_qualification_review/SupervisionSpecialOperationPersonnelValidate.php b/app/adminapi/validate/supervision_qualification_review/SupervisionSpecialOperationPersonnelValidate.php new file mode 100644 index 000000000..02ffab1ef --- /dev/null +++ b/app/adminapi/validate/supervision_qualification_review/SupervisionSpecialOperationPersonnelValidate.php @@ -0,0 +1,137 @@ + 'require|checkData', + 'unit_qualification_id' => 'require|checkUnitQualification', + 'name' => 'require', + 'id_card' => 'idCard', + 'validity_period' => 'dateFormat:Y-m-d', + 'enter_time' => 'dateFormat:Y-m-d H:i:s', + 'leave_time' => 'dateFormat:Y-m-d H:i:s', + 'status' => 'in:0,1', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'unit_qualification_id' => '参建单位资质id', + 'name' => '姓名', + 'work_type' => '工种', + 'id_card' => '身份证', + 'validity_period' => '资格有效期', + 'enter_time' => '进场时间', + 'leave_time' => '离场时间', + 'status' => '状态', + 'remark' => '备注', + 'create_user' => '创建人', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionSpecialOperationPersonnelValidate + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionSpecialOperationPersonnelValidate + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionSpecialOperationPersonnelValidate + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionSpecialOperationPersonnelValidate + * @author likeadmin + * @date 2024/02/26 11:45 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionSpecialOperationPersonnel::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkUnitQualification($value): bool|string + { + $data = SupervisionParticipatingUnitsQualifications::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '参建单位资质信息不存在'; + } + return true; + } + + public function checkAnnex($value): bool|string + { + if(!empty($value) && $value != '' && !is_array($value)){ + return '附件格式错误'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/common/model/supervision_qualification_review/SupervisionConstructionManagementPersonnel.php b/app/common/model/supervision_qualification_review/SupervisionConstructionManagementPersonnel.php new file mode 100644 index 000000000..78f6fcf59 --- /dev/null +++ b/app/common/model/supervision_qualification_review/SupervisionConstructionManagementPersonnel.php @@ -0,0 +1,67 @@ +'有效', 1=>'无效']; + return $arr[$data['qualification_one_status']]; + } + + public function getQualificationTwoStatusTextAttr($value,$data){ + $arr = [0=>'有效', 1=>'无效']; + return $arr[$data['qualification_two_status']]; + } + + public function getAnnexAttr($value) + { + return !empty($value) ? json_decode($value,true) : ''; + } +} \ No newline at end of file diff --git a/app/common/model/supervision_qualification_review/SupervisionLargeEquipment.php b/app/common/model/supervision_qualification_review/SupervisionLargeEquipment.php new file mode 100644 index 000000000..7ec0ae8cf --- /dev/null +++ b/app/common/model/supervision_qualification_review/SupervisionLargeEquipment.php @@ -0,0 +1,67 @@ +'有效', 1=>'无效']; + return $arr[$data['qualification_one_status']]; + } + + public function getQualificationTwoStatusTextAttr($value,$data){ + $arr = [0=>'有效', 1=>'无效']; + return $arr[$data['qualification_two_status']]; + } + + public function getAnnexAttr($value) + { + return !empty($value) ? json_decode($value,true) : ''; + } +} \ No newline at end of file diff --git a/app/common/model/supervision_qualification_review/SupervisionParticipatingUnitsQualifications.php b/app/common/model/supervision_qualification_review/SupervisionParticipatingUnitsQualifications.php new file mode 100644 index 000000000..ab54a0c8d --- /dev/null +++ b/app/common/model/supervision_qualification_review/SupervisionParticipatingUnitsQualifications.php @@ -0,0 +1,52 @@ +'有效', 1=>'无效']; + return $arr[$data['qualification_status']]; + } + + public function getAnnexAttr($value) + { + return !empty($value) ? json_decode($value,true) : ''; + } +} \ No newline at end of file diff --git a/app/common/model/supervision_qualification_review/SupervisionSafetyManagementPersonnel.php b/app/common/model/supervision_qualification_review/SupervisionSafetyManagementPersonnel.php new file mode 100644 index 000000000..99a1e5932 --- /dev/null +++ b/app/common/model/supervision_qualification_review/SupervisionSafetyManagementPersonnel.php @@ -0,0 +1,67 @@ +'有效', 1=>'无效']; + return $arr[$data['qualification_one_status']]; + } + + public function getQualificationTwoStatusTextAttr($value,$data){ + $arr = [0=>'有效', 1=>'无效']; + return $arr[$data['qualification_two_status']]; + } + + public function getAnnexAttr($value) + { + return !empty($value) ? json_decode($value,true) : ''; + } +} \ No newline at end of file diff --git a/app/common/model/supervision_qualification_review/SupervisionSpecialOperationPersonnel.php b/app/common/model/supervision_qualification_review/SupervisionSpecialOperationPersonnel.php new file mode 100644 index 000000000..65e747631 --- /dev/null +++ b/app/common/model/supervision_qualification_review/SupervisionSpecialOperationPersonnel.php @@ -0,0 +1,52 @@ +'有效', 1=>'无效']; + return $arr[$data['status']]; + } + + public function getAnnexAttr($value) + { + return !empty($value) ? json_decode($value,true) : ''; + } +} \ No newline at end of file