From 927b627a827a25d1b1af0ad0d5a3d27cb7643bf1 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Fri, 23 Feb 2024 17:58:24 +0800 Subject: [PATCH] new --- ...ervisionConstructionPlanningController.php | 108 ++++++++++ ...upervisionContractDisclosureController.php | 108 ++++++++++ .../SupervisionPlanningController.php | 108 ++++++++++ ...pervisionMonitoringEquipmentController.php | 108 ++++++++++ ...ionMonitoringEquipmentDetailController.php | 108 ++++++++++ ...onParticipatingUnitsContactsController.php | 108 ++++++++++ ...upervisionParticipatingUnitsController.php | 108 ++++++++++ .../SupervisionProjectController.php | 108 ++++++++++ .../SupervisionConstructionPlanningLists.php | 84 ++++++++ .../SupervisionContractDisclosureLists.php | 85 ++++++++ .../SupervisionPlanningLists.php | 86 ++++++++ ...ervisionMonitoringEquipmentDetailLists.php | 82 ++++++++ .../SupervisionMonitoringEquipmentLists.php | 82 ++++++++ ...rvisionParticipatingUnitsContactsLists.php | 85 ++++++++ .../SupervisionParticipatingUnitsLists.php | 82 ++++++++ .../SupervisionProjectLists.php | 83 ++++++++ .../SupervisionConstructionPlanningLogic.php | 119 +++++++++++ .../SupervisionContractDisclosureLogic.php | 119 +++++++++++ .../SupervisionPlanningLogic.php | 127 +++++++++++ ...ervisionMonitoringEquipmentDetailLogic.php | 114 ++++++++++ .../SupervisionMonitoringEquipmentLogic.php | 148 +++++++++++++ ...rvisionParticipatingUnitsContactsLogic.php | 121 +++++++++++ .../SupervisionParticipatingUnitsLogic.php | 159 ++++++++++++++ .../SupervisionProjectLogic.php | 166 +++++++++++++++ ...upervisionConstructionPlanningValidate.php | 126 +++++++++++ .../SupervisionContractDisclosureValidate.php | 126 +++++++++++ .../SupervisionPlanningValidate.php | 140 ++++++++++++ ...isionMonitoringEquipmentDetailValidate.php | 120 +++++++++++ ...SupervisionMonitoringEquipmentValidate.php | 151 +++++++++++++ ...sionParticipatingUnitsContactsValidate.php | 123 +++++++++++ .../SupervisionParticipatingUnitsValidate.php | 151 +++++++++++++ .../SupervisionProjectValidate.php | 199 ++++++++++++++++++ .../SupervisionConstructionPlanning.php | 37 ++++ .../SupervisionContractDisclosure.php | 37 ++++ .../SupervisionPlanning.php | 43 ++++ .../SupervisionMonitoringEquipment.php | 38 ++++ .../SupervisionMonitoringEquipmentDetail.php | 38 ++++ .../SupervisionParticipatingUnits.php | 38 ++++ .../SupervisionParticipatingUnitsContacts.php | 34 +++ .../SupervisionProject.php | 84 ++++++++ 40 files changed, 4091 insertions(+) create mode 100644 app/adminapi/controller/supervision_prepare/SupervisionConstructionPlanningController.php create mode 100644 app/adminapi/controller/supervision_prepare/SupervisionContractDisclosureController.php create mode 100644 app/adminapi/controller/supervision_prepare/SupervisionPlanningController.php create mode 100644 app/adminapi/controller/supervision_project/SupervisionMonitoringEquipmentController.php create mode 100644 app/adminapi/controller/supervision_project/SupervisionMonitoringEquipmentDetailController.php create mode 100644 app/adminapi/controller/supervision_project/SupervisionParticipatingUnitsContactsController.php create mode 100644 app/adminapi/controller/supervision_project/SupervisionParticipatingUnitsController.php create mode 100644 app/adminapi/controller/supervision_project/SupervisionProjectController.php create mode 100644 app/adminapi/lists/supervision_prepare/SupervisionConstructionPlanningLists.php create mode 100644 app/adminapi/lists/supervision_prepare/SupervisionContractDisclosureLists.php create mode 100644 app/adminapi/lists/supervision_prepare/SupervisionPlanningLists.php create mode 100644 app/adminapi/lists/supervision_project/SupervisionMonitoringEquipmentDetailLists.php create mode 100644 app/adminapi/lists/supervision_project/SupervisionMonitoringEquipmentLists.php create mode 100644 app/adminapi/lists/supervision_project/SupervisionParticipatingUnitsContactsLists.php create mode 100644 app/adminapi/lists/supervision_project/SupervisionParticipatingUnitsLists.php create mode 100644 app/adminapi/lists/supervision_project/SupervisionProjectLists.php create mode 100644 app/adminapi/logic/supervision_prepare/SupervisionConstructionPlanningLogic.php create mode 100644 app/adminapi/logic/supervision_prepare/SupervisionContractDisclosureLogic.php create mode 100644 app/adminapi/logic/supervision_prepare/SupervisionPlanningLogic.php create mode 100644 app/adminapi/logic/supervision_project/SupervisionMonitoringEquipmentDetailLogic.php create mode 100644 app/adminapi/logic/supervision_project/SupervisionMonitoringEquipmentLogic.php create mode 100644 app/adminapi/logic/supervision_project/SupervisionParticipatingUnitsContactsLogic.php create mode 100644 app/adminapi/logic/supervision_project/SupervisionParticipatingUnitsLogic.php create mode 100644 app/adminapi/logic/supervision_project/SupervisionProjectLogic.php create mode 100644 app/adminapi/validate/supervision_prepare/SupervisionConstructionPlanningValidate.php create mode 100644 app/adminapi/validate/supervision_prepare/SupervisionContractDisclosureValidate.php create mode 100644 app/adminapi/validate/supervision_prepare/SupervisionPlanningValidate.php create mode 100644 app/adminapi/validate/supervision_project/SupervisionMonitoringEquipmentDetailValidate.php create mode 100644 app/adminapi/validate/supervision_project/SupervisionMonitoringEquipmentValidate.php create mode 100644 app/adminapi/validate/supervision_project/SupervisionParticipatingUnitsContactsValidate.php create mode 100644 app/adminapi/validate/supervision_project/SupervisionParticipatingUnitsValidate.php create mode 100644 app/adminapi/validate/supervision_project/SupervisionProjectValidate.php create mode 100644 app/common/model/supervision_prepare/SupervisionConstructionPlanning.php create mode 100644 app/common/model/supervision_prepare/SupervisionContractDisclosure.php create mode 100644 app/common/model/supervision_prepare/SupervisionPlanning.php create mode 100644 app/common/model/supervision_project/SupervisionMonitoringEquipment.php create mode 100644 app/common/model/supervision_project/SupervisionMonitoringEquipmentDetail.php create mode 100644 app/common/model/supervision_project/SupervisionParticipatingUnits.php create mode 100644 app/common/model/supervision_project/SupervisionParticipatingUnitsContacts.php create mode 100644 app/common/model/supervision_project/SupervisionProject.php diff --git a/app/adminapi/controller/supervision_prepare/SupervisionConstructionPlanningController.php b/app/adminapi/controller/supervision_prepare/SupervisionConstructionPlanningController.php new file mode 100644 index 000000000..39f6c52b3 --- /dev/null +++ b/app/adminapi/controller/supervision_prepare/SupervisionConstructionPlanningController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionConstructionPlanningLists()); + } + + + /** + * @notes 添加工程监理--开工策划 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function add() + { + $params = (new SupervisionConstructionPlanningValidate())->post()->goCheck('add'); + $result = SupervisionConstructionPlanningLogic::add($params,$this->adminId); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionConstructionPlanningLogic::getError()); + } + + + /** + * @notes 编辑工程监理--开工策划 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function edit() + { + $params = (new SupervisionConstructionPlanningValidate())->post()->goCheck('edit'); + $result = SupervisionConstructionPlanningLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionConstructionPlanningLogic::getError()); + } + + + /** + * @notes 删除工程监理--开工策划 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function delete() + { + $params = (new SupervisionConstructionPlanningValidate())->post()->goCheck('delete'); + SupervisionConstructionPlanningLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--开工策划详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function detail() + { + $params = (new SupervisionConstructionPlanningValidate())->goCheck('detail'); + $result = SupervisionConstructionPlanningLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_prepare/SupervisionContractDisclosureController.php b/app/adminapi/controller/supervision_prepare/SupervisionContractDisclosureController.php new file mode 100644 index 000000000..1c81f3993 --- /dev/null +++ b/app/adminapi/controller/supervision_prepare/SupervisionContractDisclosureController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionContractDisclosureLists()); + } + + + /** + * @notes 添加工程监理--监理合同交底 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function add() + { + $params = (new SupervisionContractDisclosureValidate())->post()->goCheck('add'); + $result = SupervisionContractDisclosureLogic::add($params,$this->adminId); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionContractDisclosureLogic::getError()); + } + + + /** + * @notes 编辑工程监理--监理合同交底 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function edit() + { + $params = (new SupervisionContractDisclosureValidate())->post()->goCheck('edit'); + $result = SupervisionContractDisclosureLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionContractDisclosureLogic::getError()); + } + + + /** + * @notes 删除工程监理--监理合同交底 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function delete() + { + $params = (new SupervisionContractDisclosureValidate())->post()->goCheck('delete'); + SupervisionContractDisclosureLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--监理合同交底详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function detail() + { + $params = (new SupervisionContractDisclosureValidate())->goCheck('detail'); + $result = SupervisionContractDisclosureLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_prepare/SupervisionPlanningController.php b/app/adminapi/controller/supervision_prepare/SupervisionPlanningController.php new file mode 100644 index 000000000..a6185c385 --- /dev/null +++ b/app/adminapi/controller/supervision_prepare/SupervisionPlanningController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionPlanningLists()); + } + + + /** + * @notes 添加工程监理--监理规划 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function add() + { + $params = (new SupervisionPlanningValidate())->post()->goCheck('add'); + $result = SupervisionPlanningLogic::add($params,$this->adminId); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionPlanningLogic::getError()); + } + + + /** + * @notes 编辑工程监理--监理规划 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function edit() + { + $params = (new SupervisionPlanningValidate())->post()->goCheck('edit'); + $result = SupervisionPlanningLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionPlanningLogic::getError()); + } + + + /** + * @notes 删除工程监理--监理规划 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function delete() + { + $params = (new SupervisionPlanningValidate())->post()->goCheck('delete'); + SupervisionPlanningLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--监理规划详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function detail() + { + $params = (new SupervisionPlanningValidate())->goCheck('detail'); + $result = SupervisionPlanningLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_project/SupervisionMonitoringEquipmentController.php b/app/adminapi/controller/supervision_project/SupervisionMonitoringEquipmentController.php new file mode 100644 index 000000000..333761062 --- /dev/null +++ b/app/adminapi/controller/supervision_project/SupervisionMonitoringEquipmentController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionMonitoringEquipmentLists()); + } + + + /** + * @notes 添加工程监理--监控设备信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function add() + { + $params = (new SupervisionMonitoringEquipmentValidate())->post()->goCheck('add'); + $result = SupervisionMonitoringEquipmentLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionMonitoringEquipmentLogic::getError()); + } + + + /** + * @notes 编辑工程监理--监控设备信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function edit() + { + $params = (new SupervisionMonitoringEquipmentValidate())->post()->goCheck('edit'); + $result = SupervisionMonitoringEquipmentLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionMonitoringEquipmentLogic::getError()); + } + + + /** + * @notes 删除工程监理--监控设备信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function delete() + { + $params = (new SupervisionMonitoringEquipmentValidate())->post()->goCheck('delete'); + SupervisionMonitoringEquipmentLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--监控设备信息详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function detail() + { + $params = (new SupervisionMonitoringEquipmentValidate())->goCheck('detail'); + $result = SupervisionMonitoringEquipmentLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_project/SupervisionMonitoringEquipmentDetailController.php b/app/adminapi/controller/supervision_project/SupervisionMonitoringEquipmentDetailController.php new file mode 100644 index 000000000..bf09a2023 --- /dev/null +++ b/app/adminapi/controller/supervision_project/SupervisionMonitoringEquipmentDetailController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionMonitoringEquipmentDetailLists()); + } + + + /** + * @notes 添加工程监理--监控设备明细 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function add() + { + $params = (new SupervisionMonitoringEquipmentDetailValidate())->post()->goCheck('add'); + $result = SupervisionMonitoringEquipmentDetailLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionMonitoringEquipmentDetailLogic::getError()); + } + + + /** + * @notes 编辑工程监理--监控设备明细 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function edit() + { + $params = (new SupervisionMonitoringEquipmentDetailValidate())->post()->goCheck('edit'); + $result = SupervisionMonitoringEquipmentDetailLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionMonitoringEquipmentDetailLogic::getError()); + } + + + /** + * @notes 删除工程监理--监控设备明细 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function delete() + { + $params = (new SupervisionMonitoringEquipmentDetailValidate())->post()->goCheck('delete'); + SupervisionMonitoringEquipmentDetailLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--监控设备明细详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function detail() + { + $params = (new SupervisionMonitoringEquipmentDetailValidate())->goCheck('detail'); + $result = SupervisionMonitoringEquipmentDetailLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_project/SupervisionParticipatingUnitsContactsController.php b/app/adminapi/controller/supervision_project/SupervisionParticipatingUnitsContactsController.php new file mode 100644 index 000000000..0e7326a5e --- /dev/null +++ b/app/adminapi/controller/supervision_project/SupervisionParticipatingUnitsContactsController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionParticipatingUnitsContactsLists()); + } + + + /** + * @notes 添加工程监理--参建单位联系人 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function add() + { + $params = (new SupervisionParticipatingUnitsContactsValidate())->post()->goCheck('add'); + $result = SupervisionParticipatingUnitsContactsLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionParticipatingUnitsContactsLogic::getError()); + } + + + /** + * @notes 编辑工程监理--参建单位联系人 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function edit() + { + $params = (new SupervisionParticipatingUnitsContactsValidate())->post()->goCheck('edit'); + $result = SupervisionParticipatingUnitsContactsLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionParticipatingUnitsContactsLogic::getError()); + } + + + /** + * @notes 删除工程监理--参建单位联系人 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function delete() + { + $params = (new SupervisionParticipatingUnitsContactsValidate())->post()->goCheck('delete'); + SupervisionParticipatingUnitsContactsLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--参建单位联系人详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function detail() + { + $params = (new SupervisionParticipatingUnitsContactsValidate())->goCheck('detail'); + $result = SupervisionParticipatingUnitsContactsLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_project/SupervisionParticipatingUnitsController.php b/app/adminapi/controller/supervision_project/SupervisionParticipatingUnitsController.php new file mode 100644 index 000000000..2a0c74b21 --- /dev/null +++ b/app/adminapi/controller/supervision_project/SupervisionParticipatingUnitsController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionParticipatingUnitsLists()); + } + + + /** + * @notes 添加工程监理--参建单位 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function add() + { + $params = (new SupervisionParticipatingUnitsValidate())->post()->goCheck('add'); + $result = SupervisionParticipatingUnitsLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionParticipatingUnitsLogic::getError()); + } + + + /** + * @notes 编辑工程监理--参建单位 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function edit() + { + $params = (new SupervisionParticipatingUnitsValidate())->post()->goCheck('edit'); + $result = SupervisionParticipatingUnitsLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionParticipatingUnitsLogic::getError()); + } + + + /** + * @notes 删除工程监理--参建单位 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function delete() + { + $params = (new SupervisionParticipatingUnitsValidate())->post()->goCheck('delete'); + SupervisionParticipatingUnitsLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--参建单位详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function detail() + { + $params = (new SupervisionParticipatingUnitsValidate())->goCheck('detail'); + $result = SupervisionParticipatingUnitsLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/supervision_project/SupervisionProjectController.php b/app/adminapi/controller/supervision_project/SupervisionProjectController.php new file mode 100644 index 000000000..d0b146175 --- /dev/null +++ b/app/adminapi/controller/supervision_project/SupervisionProjectController.php @@ -0,0 +1,108 @@ +dataLists(new SupervisionProjectLists()); + } + + + /** + * @notes 添加工程监理--监理项目信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function add() + { + $params = (new SupervisionProjectValidate())->post()->goCheck('add'); + $result = SupervisionProjectLogic::add($params,$this->adminId); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SupervisionProjectLogic::getError()); + } + + + /** + * @notes 编辑工程监理--监理项目信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function edit() + { + $params = (new SupervisionProjectValidate())->post()->goCheck('edit'); + $result = SupervisionProjectLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SupervisionProjectLogic::getError()); + } + + + /** + * @notes 删除工程监理--监理项目信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function delete() + { + $params = (new SupervisionProjectValidate())->post()->goCheck('delete'); + SupervisionProjectLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取工程监理--监理项目信息详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function detail() + { + $params = (new SupervisionProjectValidate())->goCheck('detail'); + $result = SupervisionProjectLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_prepare/SupervisionConstructionPlanningLists.php b/app/adminapi/lists/supervision_prepare/SupervisionConstructionPlanningLists.php new file mode 100644 index 000000000..2d1ae6b72 --- /dev/null +++ b/app/adminapi/lists/supervision_prepare/SupervisionConstructionPlanningLists.php @@ -0,0 +1,84 @@ + ['project_id'], + '%like%' => ['doc_name'], + ]; + } + + + /** + * @notes 获取工程监理--开工策划列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function lists(): array + { + return SupervisionConstructionPlanning::withoutField('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(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['create_user_name'] = $admin['name']; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--开工策划数量 + * @return int + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function count(): int + { + return SupervisionConstructionPlanning::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_prepare/SupervisionContractDisclosureLists.php b/app/adminapi/lists/supervision_prepare/SupervisionContractDisclosureLists.php new file mode 100644 index 000000000..d5582b3e5 --- /dev/null +++ b/app/adminapi/lists/supervision_prepare/SupervisionContractDisclosureLists.php @@ -0,0 +1,85 @@ + ['project_id'], + '%like%' => ['doc_name'], + + ]; + } + + + /** + * @notes 获取工程监理--监理合同交底列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function lists(): array + { + return SupervisionContractDisclosure::withoutField('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(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['create_user_name'] = $admin['name']; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--监理合同交底数量 + * @return int + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function count(): int + { + return SupervisionContractDisclosure::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_prepare/SupervisionPlanningLists.php b/app/adminapi/lists/supervision_prepare/SupervisionPlanningLists.php new file mode 100644 index 000000000..468feea9d --- /dev/null +++ b/app/adminapi/lists/supervision_prepare/SupervisionPlanningLists.php @@ -0,0 +1,86 @@ + ['project_id', 'approval_type'], + '%like%' => ['approval_user', 'scheme_name', 'create_user'], + ]; + } + + + /** + * @notes 获取工程监理--监理规划列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function lists(): array + { + return SupervisionPlanning::withoutField('update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $project = SupervisionProject::field('project_name,project_manager')->where('id',$data['project_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['project_manager'] = $project['project_manager']; + $data['create_user_name'] = $admin['name']; + $data['approval_type_text'] = $data->approval_type_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--监理规划数量 + * @return int + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function count(): int + { + return SupervisionPlanning::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_project/SupervisionMonitoringEquipmentDetailLists.php b/app/adminapi/lists/supervision_project/SupervisionMonitoringEquipmentDetailLists.php new file mode 100644 index 000000000..2b38f71d7 --- /dev/null +++ b/app/adminapi/lists/supervision_project/SupervisionMonitoringEquipmentDetailLists.php @@ -0,0 +1,82 @@ + ['device_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/23 15:20 + */ + public function lists(): array + { + return SupervisionMonitoringEquipmentDetail::withoutField('create_time,update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $device = SupervisionMonitoringEquipment::field('device_name')->where('id',$data['device_id'])->findOrEmpty(); + $data['device_name'] = $device['device_name']; + $data['is_show_text'] = $data->is_show_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--监控设备明细数量 + * @return int + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function count(): int + { + return SupervisionMonitoringEquipmentDetail::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_project/SupervisionMonitoringEquipmentLists.php b/app/adminapi/lists/supervision_project/SupervisionMonitoringEquipmentLists.php new file mode 100644 index 000000000..a59cc1ca4 --- /dev/null +++ b/app/adminapi/lists/supervision_project/SupervisionMonitoringEquipmentLists.php @@ -0,0 +1,82 @@ + ['project_id', 'device_type', 'number'], + '%like%' => ['device_name', 'device_sn'], + ]; + } + + + /** + * @notes 获取工程监理--监控设备信息列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function lists(): array + { + return SupervisionMonitoringEquipment::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(); + $data['project_name'] = $project['project_name']; + $data['device_type_text'] = $data->device_type_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--监控设备信息数量 + * @return int + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function count(): int + { + return SupervisionMonitoringEquipment::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_project/SupervisionParticipatingUnitsContactsLists.php b/app/adminapi/lists/supervision_project/SupervisionParticipatingUnitsContactsLists.php new file mode 100644 index 000000000..d127f4e12 --- /dev/null +++ b/app/adminapi/lists/supervision_project/SupervisionParticipatingUnitsContactsLists.php @@ -0,0 +1,85 @@ + ['unit_id'], + '%like%' => ['name', 'duties', 'mobile'], + ]; + } + + + /** + * @notes 获取工程监理--参建单位联系人列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function lists(): array + { + return SupervisionParticipatingUnitsContacts::withoutField('create_time,update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $unit = SupervisionParticipatingUnits::field('project_id,unit_name,unit_type')->where('id',$data['unit_id'])->findOrEmpty(); + $project = SupervisionProject::field('project_name')->where('id',$unit['project_id'])->findOrEmpty(); + $data['unit_name'] = $unit['unit_name']; + $data['unit_type'] = $unit->unit_type_text; + $data['project_name'] = $project['project_name']; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--参建单位联系人数量 + * @return int + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function count(): int + { + return SupervisionParticipatingUnitsContacts::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_project/SupervisionParticipatingUnitsLists.php b/app/adminapi/lists/supervision_project/SupervisionParticipatingUnitsLists.php new file mode 100644 index 000000000..3bdb37d61 --- /dev/null +++ b/app/adminapi/lists/supervision_project/SupervisionParticipatingUnitsLists.php @@ -0,0 +1,82 @@ + ['project_id', 'unit_type'], + '%like%' => ['unit_name', 'qualification_grade'], + ]; + } + + + /** + * @notes 获取工程监理--参建单位列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function lists(): array + { + return SupervisionParticipatingUnits::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(); + $data['project_name'] = $project['project_name']; + $data['unit_type_text'] = $data->unit_type_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--参建单位数量 + * @return int + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function count(): int + { + return SupervisionParticipatingUnits::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/supervision_project/SupervisionProjectLists.php b/app/adminapi/lists/supervision_project/SupervisionProjectLists.php new file mode 100644 index 000000000..767b2ae00 --- /dev/null +++ b/app/adminapi/lists/supervision_project/SupervisionProjectLists.php @@ -0,0 +1,83 @@ + ['industry', 'nature', 'project_level', 'engineering_status'], + '%like%' => ['project_name', 'project_code', 'build_unit'], + ]; + } + + + /** + * @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:52 + */ + public function lists(): array + { + return SupervisionProject::withoutField('create_user,create_time,update_time,delete_time')->where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $data['industry_text'] = $data->industry_text; + $data['nature_text'] = $data->nature_text; + $data['build_area_text'] = $data->build_area_text; + $data['project_level_text'] = $data->project_level_text; + $data['engineering_status_text'] = $data->industry_text; + }) + ->toArray(); + } + + + /** + * @notes 获取工程监理--监理项目信息数量 + * @return int + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function count(): int + { + return SupervisionProject::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_prepare/SupervisionConstructionPlanningLogic.php b/app/adminapi/logic/supervision_prepare/SupervisionConstructionPlanningLogic.php new file mode 100644 index 000000000..9c5ce28a2 --- /dev/null +++ b/app/adminapi/logic/supervision_prepare/SupervisionConstructionPlanningLogic.php @@ -0,0 +1,119 @@ + $params['project_id'], + 'doc_name' => $params['doc_name'], + 'doc_desc' => $params['doc_desc'], + '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/23 17:43 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionConstructionPlanning::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'doc_name' => $params['doc_name'], + 'doc_desc' => $params['doc_desc'], + '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/23 17:43 + */ + public static function delete(array $params): bool + { + return SupervisionConstructionPlanning::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--开工策划详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public static function detail($params): array + { + $data = SupervisionConstructionPlanning::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $project = SupervisionProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['create_user_name'] = $admin['name']; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_prepare/SupervisionContractDisclosureLogic.php b/app/adminapi/logic/supervision_prepare/SupervisionContractDisclosureLogic.php new file mode 100644 index 000000000..6ca1e2ce9 --- /dev/null +++ b/app/adminapi/logic/supervision_prepare/SupervisionContractDisclosureLogic.php @@ -0,0 +1,119 @@ + $params['project_id'], + 'doc_name' => $params['doc_name'], + 'doc_desc' => $params['doc_desc'], + '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/23 17:19 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionContractDisclosure::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'doc_name' => $params['doc_name'], + 'doc_desc' => $params['doc_desc'], + '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/23 17:19 + */ + public static function delete(array $params): bool + { + return SupervisionContractDisclosure::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--监理合同交底详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public static function detail($params): array + { + $data = SupervisionContractDisclosure::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $project = SupervisionProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['create_user_name'] = $admin['name']; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_prepare/SupervisionPlanningLogic.php b/app/adminapi/logic/supervision_prepare/SupervisionPlanningLogic.php new file mode 100644 index 000000000..f5600cd8e --- /dev/null +++ b/app/adminapi/logic/supervision_prepare/SupervisionPlanningLogic.php @@ -0,0 +1,127 @@ + $params['project_id'], + 'approval_type' => $params['approval_type'], + 'approval_user' => $params['approval_user'], + 'scheme_name' => $params['scheme_name'], + 'approval_content' => $params['approval_content'], + '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/23 16:45 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionPlanning::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'approval_type' => $params['approval_type'], + 'approval_user' => $params['approval_user'], + 'scheme_name' => $params['scheme_name'], + 'approval_content' => $params['approval_content'], + '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/23 16:45 + */ + public static function delete(array $params): bool + { + return SupervisionPlanning::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--监理规划详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public static function detail($params): array + { + $data = SupervisionPlanning::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $project = SupervisionProject::field('project_name,project_manager')->where('id',$data['project_id'])->findOrEmpty(); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['project_manager'] = $project['project_manager']; + $data['create_user_name'] = $admin['name']; + $data['approval_type_text'] = $data->approval_type_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_project/SupervisionMonitoringEquipmentDetailLogic.php b/app/adminapi/logic/supervision_project/SupervisionMonitoringEquipmentDetailLogic.php new file mode 100644 index 000000000..c6d1283e8 --- /dev/null +++ b/app/adminapi/logic/supervision_project/SupervisionMonitoringEquipmentDetailLogic.php @@ -0,0 +1,114 @@ + $params['device_id'], + 'name' => $params['name'], + 'is_show' => $params['is_show'], + ]); + 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 15:20 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionMonitoringEquipmentDetail::where('id', $params['id'])->update([ + 'device_id' => $params['device_id'], + 'name' => $params['name'], + 'is_show' => $params['is_show'], + '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/23 15:20 + */ + public static function delete(array $params): bool + { + return SupervisionMonitoringEquipmentDetail::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--监控设备明细详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public static function detail($params): array + { + $data = SupervisionMonitoringEquipmentDetail::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $device = SupervisionMonitoringEquipment::field('device_name')->where('id',$data['device_id'])->findOrEmpty(); + $data['device_name'] = $device['device_name']; + $data['is_show_text'] = $data->is_show_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_project/SupervisionMonitoringEquipmentLogic.php b/app/adminapi/logic/supervision_project/SupervisionMonitoringEquipmentLogic.php new file mode 100644 index 000000000..993e9def8 --- /dev/null +++ b/app/adminapi/logic/supervision_project/SupervisionMonitoringEquipmentLogic.php @@ -0,0 +1,148 @@ + $params['project_id'], + 'device_name' => $params['device_name'], + 'device_type' => $params['device_type'], + 'device_sn' => $params['device_sn'], + 'number' => $params['number'], + 'remark' => $params['remark'], + ]); + if(!empty($params['devices'])){ + foreach($params['devices'] as $v){ + SupervisionMonitoringEquipmentDetail::create([ + 'device_id' => $res->id, + 'name' => $v['name'], + 'is_show' => $v['is_show'], + ]); + } + } + 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 15:20 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionMonitoringEquipment::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'device_name' => $params['device_name'], + 'device_type' => $params['device_type'], + 'device_sn' => $params['device_sn'], + 'number' => $params['number'], + 'remark' => $params['remark'], + 'update_time' => time(), + ]); + if(!empty($params['devices'])){ + foreach($params['devices'] as $v){ + if(!empty($v['id'])){ + SupervisionMonitoringEquipmentDetail::where('id',$v['id'])->update([ + 'device_id' => $params['id'], + 'name' => $v['name'], + 'is_show' => $v['is_show'], + 'update_time' => time(), + ]); + }else{ + SupervisionMonitoringEquipmentDetail::create([ + 'device_id' => $params['id'], + 'name' => $v['name'], + 'is_show' => $v['is_show'], + ]); + } + } + } + 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 15:20 + */ + public static function delete(array $params): bool + { + return SupervisionMonitoringEquipment::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--监控设备信息详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public static function detail($params): array + { + $data = SupervisionMonitoringEquipment::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $project = SupervisionProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['device_type_text'] = $data->device_type_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_project/SupervisionParticipatingUnitsContactsLogic.php b/app/adminapi/logic/supervision_project/SupervisionParticipatingUnitsContactsLogic.php new file mode 100644 index 000000000..c390d1111 --- /dev/null +++ b/app/adminapi/logic/supervision_project/SupervisionParticipatingUnitsContactsLogic.php @@ -0,0 +1,121 @@ + $params['unit_id'], + 'name' => $params['name'], + 'duties' => $params['duties'], + 'telephone' => $params['telephone'], + 'mobile' => $params['mobile'], + 'email' => $params['email'], + 'fax' => $params['fax'], + ]); + 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 13:40 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionParticipatingUnitsContacts::where('id', $params['id'])->update([ + 'unit_id' => $params['unit_id'], + 'name' => $params['name'], + 'duties' => $params['duties'], + 'telephone' => $params['telephone'], + 'mobile' => $params['mobile'], + 'email' => $params['email'], + 'fax' => $params['fax'], + '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/23 13:40 + */ + public static function delete(array $params): bool + { + return SupervisionParticipatingUnitsContacts::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--参建单位联系人详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public static function detail($params): array + { + $data = SupervisionParticipatingUnitsContacts::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $unit = SupervisionParticipatingUnits::field('unit_name')->where('id',$data['unit_id'])->findOrEmpty(); + $data['unit_name'] = $unit['unit_name']; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_project/SupervisionParticipatingUnitsLogic.php b/app/adminapi/logic/supervision_project/SupervisionParticipatingUnitsLogic.php new file mode 100644 index 000000000..aa7b4eba8 --- /dev/null +++ b/app/adminapi/logic/supervision_project/SupervisionParticipatingUnitsLogic.php @@ -0,0 +1,159 @@ + $params['project_id'], + 'unit_name' => $params['unit_name'], + 'unit_type' => $params['unit_type'], + 'qualification_grade' => $params['qualification_grade'], + 'telephone' => $params['telephone'], + 'duty' => $params['duty'], + ]); + if(!empty($params['contacts'])){ + foreach($params['contacts'] as $v){ + SupervisionParticipatingUnitsContacts::create([ + 'unit_id' => $res->id, + 'name' => $v['name'], + 'duties' => $v['duties'], + 'telephone' => $v['telephone'], + 'mobile' => $v['mobile'], + 'email' => $v['email'], + 'fax' => $v['fax'], + ]); + } + } + 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 13:40 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionParticipatingUnits::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'unit_name' => $params['unit_name'], + 'unit_type' => $params['unit_type'], + 'qualification_grade' => $params['qualification_grade'], + 'telephone' => $params['telephone'], + 'duty' => $params['duty'], + 'update_time' => time(), + ]); + if(!empty($params['contacts'])){ + foreach($params['contacts'] as $v){ + if(!empty($v['id'])){ + SupervisionParticipatingUnitsContacts::where('id',$v['id'])->update([ + 'unit_id' => $params['id'], + 'name' => $v['name'], + 'duties' => $v['duties'], + 'telephone' => $v['telephone'], + 'mobile' => $v['mobile'], + 'email' => $v['email'], + 'fax' => $v['fax'], + 'update_time' => time(), + ]); + }else{ + SupervisionParticipatingUnitsContacts::create([ + 'unit_id' => $params['id'], + 'name' => $v['name'], + 'duties' => $v['duties'], + 'telephone' => $v['telephone'], + 'mobile' => $v['mobile'], + 'email' => $v['email'], + 'fax' => $v['fax'], + ]); + } + } + } + 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 13:40 + */ + public static function delete(array $params): bool + { + return SupervisionParticipatingUnits::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--参建单位详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public static function detail($params): array + { + $data = SupervisionParticipatingUnits::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $project = SupervisionProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['unit_type_text'] = $data->unit_type_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/supervision_project/SupervisionProjectLogic.php b/app/adminapi/logic/supervision_project/SupervisionProjectLogic.php new file mode 100644 index 000000000..c36f7848f --- /dev/null +++ b/app/adminapi/logic/supervision_project/SupervisionProjectLogic.php @@ -0,0 +1,166 @@ + $params['project_name'], + 'project_code' => data_unique_code('JLXM'), + 'industry' => $params['industry'], + 'nature' => $params['nature'], + 'build_unit' => $params['build_unit'], + 'build_area' => $params['build_area'], + 'address' => $params['address'], + 'project_level' => $params['project_level'], + 'total_investment' => $params['total_investment'], + 'initiation_date' => $params['initiation_date'], + 'contract' => $params['contract'], + 'contract_amount' => $params['contract_amount'], + 'actual_start_date' => !empty($params['actual_start_date']) ? strtotime($params['actual_start_date']) : 0, + 'actual_end_date' => !empty($params['actual_end_date']) ? strtotime($params['actual_end_date']) : 0, + 'planned_start_date' => !empty($params['planned_start_date']) ? strtotime($params['planned_start_date']) : 0, + 'planned_end_date' => !empty($params['planned_end_date']) ? strtotime($params['planned_end_date']) : 0, + 'contract_content' => $params['contract_content'], + 'project_overview' => $params['project_overview'], + 'project_requirements' => $params['project_requirements'], + 'remark' => $params['remark'], + 'supervision_department' => $params['supervision_department'], + 'implementation_department' => $params['implementation_department'], + 'project_department' => $params['project_department'], + 'engineering_status' => $params['engineering_status'], + 'project_manager' => $params['project_manager'], + 'part_a_unit' => $params['part_a_unit'], + '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/23 09:52 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SupervisionProject::where('id', $params['id'])->update([ + 'project_name' => $params['project_name'], + 'industry' => $params['industry'], + 'nature' => $params['nature'], + 'build_unit' => $params['build_unit'], + 'build_area' => $params['build_area'], + 'address' => $params['address'], + 'project_level' => $params['project_level'], + 'total_investment' => $params['total_investment'], + 'initiation_date' => $params['initiation_date'], + 'contract' => $params['contract'], + 'contract_amount' => $params['contract_amount'], + 'actual_start_date' => !empty($params['actual_start_date']) ? strtotime($params['actual_start_date']) : 0, + 'actual_end_date' => !empty($params['actual_end_date']) ? strtotime($params['actual_end_date']) : 0, + 'planned_start_date' => !empty($params['planned_start_date']) ? strtotime($params['planned_start_date']) : 0, + 'planned_end_date' =>!empty($params['planned_end_date']) ? strtotime($params['planned_end_date']) : 0, + 'contract_content' => $params['contract_content'], + 'project_overview' => $params['project_overview'], + 'project_requirements' => $params['project_requirements'], + 'remark' => $params['remark'], + 'supervision_department' => $params['supervision_department'], + 'implementation_department' => $params['implementation_department'], + 'project_department' => $params['project_department'], + 'engineering_status' => $params['engineering_status'], + 'project_manager' => $params['project_manager'], + 'part_a_unit' => $params['part_a_unit'], + '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/23 09:52 + */ + public static function delete(array $params): bool + { + return SupervisionProject::destroy($params['id']); + } + + + /** + * @notes 获取工程监理--监理项目信息详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public static function detail($params): array + { + $data = SupervisionProject::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $admin = Admin::field('name')->where('id',$data['create_user'])->findOrEmpty(); + $data['create_user_name'] = $admin['name']; + $data['industry_text'] = $data->industry_text; + $data['nature_text'] = $data->nature_text; + $data['build_area_text'] = $data->build_area_text; + $data['project_level_text'] = $data->project_level_text; + $data['engineering_status_text'] = $data->engineering_status_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_prepare/SupervisionConstructionPlanningValidate.php b/app/adminapi/validate/supervision_prepare/SupervisionConstructionPlanningValidate.php new file mode 100644 index 000000000..c4c99bcf2 --- /dev/null +++ b/app/adminapi/validate/supervision_prepare/SupervisionConstructionPlanningValidate.php @@ -0,0 +1,126 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'doc_name' => 'require', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'doc_name' => '文档名称', + 'doc_desc' => '文档简介', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionConstructionPlanningValidate + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionConstructionPlanningValidate + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionConstructionPlanningValidate + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionConstructionPlanningValidate + * @author likeadmin + * @date 2024/02/23 17:43 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionConstructionPlanning::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 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_prepare/SupervisionContractDisclosureValidate.php b/app/adminapi/validate/supervision_prepare/SupervisionContractDisclosureValidate.php new file mode 100644 index 000000000..e471c68e0 --- /dev/null +++ b/app/adminapi/validate/supervision_prepare/SupervisionContractDisclosureValidate.php @@ -0,0 +1,126 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'doc_name' => 'require', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'doc_name' => '文档名称', + 'doc_desc' => '文档简介', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionContractDisclosureValidate + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionContractDisclosureValidate + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionContractDisclosureValidate + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionContractDisclosureValidate + * @author likeadmin + * @date 2024/02/23 17:19 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionContractDisclosure::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 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_prepare/SupervisionPlanningValidate.php b/app/adminapi/validate/supervision_prepare/SupervisionPlanningValidate.php new file mode 100644 index 000000000..304233122 --- /dev/null +++ b/app/adminapi/validate/supervision_prepare/SupervisionPlanningValidate.php @@ -0,0 +1,140 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'approval_type' => 'checkApprovalType', + 'scheme_name' => 'require', + 'approval_content' => 'require', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'approval_type' => '专项审批类型', + 'approval_user' => '评审人员', + 'scheme_name' => '方案名称', + 'approval_content' => '评审内容', + 'remark' => '备注', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionPlanningValidate + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionPlanningValidate + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionPlanningValidate + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionPlanningValidate + * @author likeadmin + * @date 2024/02/23 16:45 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionPlanning::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value){ + $data = SupervisionProject::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '项目信息不存在'; + } + return true; + } + + public function checkApprovalType($value): bool|string + { + $dict = DictData::where('type_value','supervision_planning_approval_type')->column('value'); + if(!in_array($value,$dict)){ + 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_project/SupervisionMonitoringEquipmentDetailValidate.php b/app/adminapi/validate/supervision_project/SupervisionMonitoringEquipmentDetailValidate.php new file mode 100644 index 000000000..0f0ca6ac8 --- /dev/null +++ b/app/adminapi/validate/supervision_project/SupervisionMonitoringEquipmentDetailValidate.php @@ -0,0 +1,120 @@ + 'require|checkData', + 'device_id' => 'require|checkDevice', + 'name' => 'require', + 'is_show' => 'require|in:0,1', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'device_id' => '设备信息id', + 'name' => '设备名称', + 'is_show' => '是否显示', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionMonitoringEquipmentDetailValidate + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function sceneAdd() + { + return $this->only(['device_id','name','is_show']); + } + + + /** + * @notes 编辑场景 + * @return SupervisionMonitoringEquipmentDetailValidate + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function sceneEdit() + { + return $this->only(['id','device_id','name','is_show']); + } + + + /** + * @notes 删除场景 + * @return SupervisionMonitoringEquipmentDetailValidate + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionMonitoringEquipmentDetailValidate + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionMonitoringEquipmentDetail::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkDevice($value): bool|string + { + $data = SupervisionMonitoringEquipment::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '监控设备信息不存在'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_project/SupervisionMonitoringEquipmentValidate.php b/app/adminapi/validate/supervision_project/SupervisionMonitoringEquipmentValidate.php new file mode 100644 index 000000000..4daa3f421 --- /dev/null +++ b/app/adminapi/validate/supervision_project/SupervisionMonitoringEquipmentValidate.php @@ -0,0 +1,151 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'device_name' => 'require', + 'device_type' => 'checkDeviceType', + 'devices' => 'checkDevices' + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'device_name' => '监控设备名称', + 'device_type' => '设备类型', + 'device_sn' => '设备序列号', + 'number' => '编号', + 'remark' => '备注', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionMonitoringEquipmentValidate + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionMonitoringEquipmentValidate + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionMonitoringEquipmentValidate + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionMonitoringEquipmentValidate + * @author likeadmin + * @date 2024/02/23 15:20 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionMonitoringEquipment::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 checkDeviceType($value): bool|string + { + $dict = DictData::where('type_value','device_type')->column('value'); + if(!in_array($value,$dict)){ + return '设备类型数据值无效'; + } + return true; + } + + public function checkDevices($value): bool|string + { + if(empty($value) || $value == '') return true; + if(!is_array($value)) return '设备列表数据格式错误'; + foreach($value as $k=>$v){ + if(isset($v['id']) && !empty($v['id'])){ + $data = SupervisionMonitoringEquipmentDetail::where('id',$v['id'])->findOrEmpty(); + if($data->isEmpty()){ + return '第'.($k+1).'行设备信息不存在'; + } + } + if(empty($v['name'])){ + return '第'.($k+1).'行设备名称为空'; + } + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_project/SupervisionParticipatingUnitsContactsValidate.php b/app/adminapi/validate/supervision_project/SupervisionParticipatingUnitsContactsValidate.php new file mode 100644 index 000000000..7af4cb0ef --- /dev/null +++ b/app/adminapi/validate/supervision_project/SupervisionParticipatingUnitsContactsValidate.php @@ -0,0 +1,123 @@ + 'require|checkData', + 'unit_id' => 'require|checkUnit', + 'name' => 'require', + 'mobile' => 'mobile', + 'email' => 'email', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'unit_id' => '单位id', + 'name' => '姓名', + 'duties' => '职务', + 'telephone' => '办公电话', + 'mobile' => '手机号码', + 'email' => '电子邮箱', + 'fax' => '传真', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionParticipatingUnitsContactsValidate + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionParticipatingUnitsContactsValidate + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionParticipatingUnitsContactsValidate + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionParticipatingUnitsContactsValidate + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionParticipatingUnitsContacts::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkUnit($value): bool|string + { + $data = SupervisionParticipatingUnits::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '参建单位信息不存在'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_project/SupervisionParticipatingUnitsValidate.php b/app/adminapi/validate/supervision_project/SupervisionParticipatingUnitsValidate.php new file mode 100644 index 000000000..a377d49ec --- /dev/null +++ b/app/adminapi/validate/supervision_project/SupervisionParticipatingUnitsValidate.php @@ -0,0 +1,151 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'unit_name' => 'require', + 'unit_type' => 'checkUnitType', + 'contacts' => 'checkContacts', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'unit_name' => '单位名称', + 'unit_type' => '单位类别', + 'qualification_grade' => '资质等级', + 'telephone' => '联系电话', + 'duty' => '责任范围', + ]; + + + /** + * @notes 添加场景 + * @return SupervisionParticipatingUnitsValidate + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionParticipatingUnitsValidate + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionParticipatingUnitsValidate + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionParticipatingUnitsValidate + * @author likeadmin + * @date 2024/02/23 13:40 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionParticipatingUnits::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 checkUnitType($value): bool|string + { + $dict = DictData::where('type_value','unit_type')->column('value'); + if(!in_array($value,$dict)){ + return '单位类别数据值无效'; + } + return true; + } + + public function checkContacts($value): bool|string + { + if(empty($value) || $value == '') return true; + if(!is_array($value)) return '联系人数据格式错误'; + foreach($value as $k=>$v){ + if(isset($v['id']) && !empty($v['id'])){ + $data = SupervisionParticipatingUnitsContacts::where('id',$v['id'])->findOrEmpty(); + if($data->isEmpty()){ + return '第'.($k+1).'行联系人信息不存在'; + } + } + if(empty($v['name'])){ + return '第'.($k+1).'行联系人姓名为空'; + } + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/supervision_project/SupervisionProjectValidate.php b/app/adminapi/validate/supervision_project/SupervisionProjectValidate.php new file mode 100644 index 000000000..93bab8ff3 --- /dev/null +++ b/app/adminapi/validate/supervision_project/SupervisionProjectValidate.php @@ -0,0 +1,199 @@ + 'require|checkData', + 'project_name' => 'require', + 'industry' => 'checkIndustry', + 'nature' => 'checkNature', + 'build_area' => 'checkBuildArea', + 'project_level' => 'checkProjectLevel', + 'total_investment' => 'require|float|gt:0', + 'initiation_date' => 'dateFormat:Y-m-d', + 'contract_amount' => 'float|egt:0', + 'actual_start_date' => 'dateFormat:Y-m-d', + 'actual_end_date' => 'dateFormat:Y-m-d', + 'planned_start_date' => 'dateFormat:Y-m-d', + 'planned_end_date' => 'dateFormat:Y-m-d', + 'supervision_department' => 'require', + 'engineering_status' => 'checkEngineeringStatus', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_name' => '项目名称', + 'project_code' => '项目编号', + 'industry' => '行业', + 'nature' => '性质', + 'build_unit' => '建设单位', + 'build_area' => '建设区域', + 'address' => '项目地址', + 'project_level' => '项目等级', + 'total_investment' => '总投资(万元)', + 'initiation_date' => '立项日期', + 'contract' => '关联合同', + 'contract_amount' => '合同金额', + 'actual_start_date' => '实际开工日期', + 'actual_end_date' => '实际竣工日期', + 'planned_start_date' => '计划开工日期', + 'planned_end_date' => '计划竣工日期', + 'contract_content' => '合同服务内容', + 'project_overview' => '项目概况', + 'project_requirements' => '项目要求', + 'remark' => '备注', + 'supervision_department' => '监管部门', + 'implementation_department' => '实施部门', + 'project_department' => '项目部', + 'engineering_status' => '工程状态', + 'project_manager' => '项目负责人员', + 'part_a_unit' => '甲方单位', + 'create_user' => '创建人', + + ]; + + + /** + * @notes 添加场景 + * @return SupervisionProjectValidate + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return SupervisionProjectValidate + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return SupervisionProjectValidate + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SupervisionProjectValidate + * @author likeadmin + * @date 2024/02/23 09:52 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = SupervisionProject::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkIndustry($value): bool|string + { + $dict = DictData::where('type_value','supervision_project_industry')->column('value'); + if(!in_array($value,$dict)){ + return '行业数据值无效'; + } + return true; + } + + public function checkNature($value): bool|string + { + $dict = DictData::where('type_value','supervision_project_nature')->column('value'); + if(!in_array($value,$dict)){ + return '性质数据值无效'; + } + return true; + } + + public function checkBuildArea($value): bool|string + { + $dict = DictData::where('type_value','supervision_project_build_area')->column('value'); + if(!in_array($value,$dict)){ + return '建设区域数据值无效'; + } + return true; + } + + public function checkProjectLevel($value): bool|string + { + $dict = DictData::where('type_value','supervision_project_level')->column('value'); + if(!in_array($value,$dict)){ + return '项目等级数据值无效'; + } + return true; + } + + public function checkEngineeringStatus($value): bool|string + { + $dict = DictData::where('type_value','supervision_project_status')->column('value'); + if(!in_array($value,$dict)){ + 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_prepare/SupervisionConstructionPlanning.php b/app/common/model/supervision_prepare/SupervisionConstructionPlanning.php new file mode 100644 index 000000000..c024ac361 --- /dev/null +++ b/app/common/model/supervision_prepare/SupervisionConstructionPlanning.php @@ -0,0 +1,37 @@ +column('name','value'); + return !empty($data['approval_type']) ? $dict[$data['approval_type']] : ''; + } + + public function getAnnexAttr($value) + { + return !empty($value) ? json_decode($value,true) : ''; + } +} \ No newline at end of file diff --git a/app/common/model/supervision_project/SupervisionMonitoringEquipment.php b/app/common/model/supervision_project/SupervisionMonitoringEquipment.php new file mode 100644 index 000000000..09417f93b --- /dev/null +++ b/app/common/model/supervision_project/SupervisionMonitoringEquipment.php @@ -0,0 +1,38 @@ +column('name','value'); + return !empty($data['device_type']) ? $dict[$data['device_type']] : ''; + } +} \ No newline at end of file diff --git a/app/common/model/supervision_project/SupervisionMonitoringEquipmentDetail.php b/app/common/model/supervision_project/SupervisionMonitoringEquipmentDetail.php new file mode 100644 index 000000000..7a16907b9 --- /dev/null +++ b/app/common/model/supervision_project/SupervisionMonitoringEquipmentDetail.php @@ -0,0 +1,38 @@ +'否',1=>'是']; + return $arr[$data['is_show']]; + } + +} \ No newline at end of file diff --git a/app/common/model/supervision_project/SupervisionParticipatingUnits.php b/app/common/model/supervision_project/SupervisionParticipatingUnits.php new file mode 100644 index 000000000..15ff83dec --- /dev/null +++ b/app/common/model/supervision_project/SupervisionParticipatingUnits.php @@ -0,0 +1,38 @@ +column('name','value'); + return !empty($data['unit_type']) ? $dict[$data['unit_type']] : ''; + } +} \ No newline at end of file diff --git a/app/common/model/supervision_project/SupervisionParticipatingUnitsContacts.php b/app/common/model/supervision_project/SupervisionParticipatingUnitsContacts.php new file mode 100644 index 000000000..589e4662d --- /dev/null +++ b/app/common/model/supervision_project/SupervisionParticipatingUnitsContacts.php @@ -0,0 +1,34 @@ +column('name','value'); + return !empty($data['industry']) ? $dict[$data['industry']] : ''; + } + + public function getNatureTextAttr($value,$data){ + $dict = DictData::where('type_value','supervision_project_nature')->column('name','value'); + return !empty($data['nature']) ? $dict[$data['nature']] : ''; + } + + public function getBuildAreaTextAttr($value,$data){ + $dict = DictData::where('type_value','supervision_project_build_area')->column('name','value'); + return !empty($data['build_area']) ? $dict[$data['build_area']] : ''; + } + + public function getProjectLevelTextAttr($value,$data){ + $dict = DictData::where('type_value','supervision_project_level')->column('name','value'); + return !empty($data['project_level']) ? $dict[$data['project_level']] : ''; + } + + public function getEngineeringStatusTextAttr($value,$data){ + $dict = DictData::where('type_value','supervision_project_status')->column('name','value'); + return !empty($data['engineering_status']) ? $dict[$data['engineering_status']] : ''; + } + + public function getActualStartDateAttr($value): string + { + return !empty($value) ? date('Y-m-d', $value) : ''; + } + + public function getActualEndDateAttr($value): string + { + return !empty($value) ? date('Y-m-d', $value) : ''; + } + + public function getPlannedStartDateAttr($value): string + { + return !empty($value) ? date('Y-m-d', $value) : ''; + } + + public function getPlannedEndDateAttr($value): string + { + return !empty($value) ? date('Y-m-d', $value) : ''; + } + + public function getAnnexAttr($value) + { + return !empty($value) ? json_decode($value,true) : ''; + } + +} \ No newline at end of file