From 3d29228886adcc22f22e11ea9fcf1af1df28205b Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Thu, 7 Mar 2024 17:40:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManageCompanyContactsController.php | 108 ++++++++++ .../manage_basic/ManageCompanyController.php | 111 ++++++++++ .../manage_basic/ManageProjectController.php | 111 ++++++++++ .../ManageAcceptDocController.php | 108 ++++++++++ .../ManageSendDocController.php | 108 ++++++++++ .../ManageEngineeringChangesController.php | 108 ++++++++++ .../ManageMeteredPaymentController.php | 108 ++++++++++ .../ManageMonthlyProgressReportController.php | 108 ++++++++++ .../ManageCompanyContactsLists.php | 77 +++++++ .../lists/manage_basic/ManageCompanyLists.php | 83 ++++++++ .../lists/manage_basic/ManageProjectLists.php | 86 ++++++++ .../ManageAcceptDocLists.php | 96 +++++++++ .../ManageSendDocLists.php | 96 +++++++++ .../ManageEngineeringChangesLists.php | 82 +++++++ .../ManageMeteredPaymentLists.php | 100 +++++++++ .../ManageMonthlyProgressReportLists.php | 96 +++++++++ .../ManageCompanyContactsLogic.php | 117 ++++++++++ .../logic/manage_basic/ManageCompanyLogic.php | 165 +++++++++++++++ .../logic/manage_basic/ManageProjectLogic.php | 195 +++++++++++++++++ .../ManageAcceptDocLogic.php | 127 +++++++++++ .../ManageSendDocLogic.php | 125 +++++++++++ .../ManageEngineeringChangesLogic.php | 124 +++++++++++ .../ManageMeteredPaymentLogic.php | 121 +++++++++++ .../ManageMonthlyProgressReportLogic.php | 124 +++++++++++ .../ManageCompanyContactsValidate.php | 125 +++++++++++ .../manage_basic/ManageCompanyValidate.php | 151 +++++++++++++ .../manage_basic/ManageProjectValidate.php | 200 ++++++++++++++++++ .../ManageAcceptDocValidate.php | 137 ++++++++++++ .../ManageSendDocValidate.php | 136 ++++++++++++ .../ManageEngineeringChangesValidate.php | 134 ++++++++++++ .../ManageMeteredPaymentValidate.php | 127 +++++++++++ .../ManageMonthlyProgressReportValidate.php | 144 +++++++++++++ .../model/manage_basic/ManageCompany.php | 38 ++++ .../manage_basic/ManageCompanyContacts.php | 34 +++ .../model/manage_basic/ManageProject.php | 83 ++++++++ .../manage_communication/ManageAcceptDoc.php | 47 ++++ .../manage_communication/ManageSendDoc.php | 42 ++++ .../ManageEngineeringChanges.php | 42 ++++ .../manage_invest/ManageMeteredPayment.php | 37 ++++ .../ManageMonthlyProgressReport.php | 49 +++++ 40 files changed, 4210 insertions(+) create mode 100644 app/adminapi/controller/manage_basic/ManageCompanyContactsController.php create mode 100644 app/adminapi/controller/manage_basic/ManageCompanyController.php create mode 100644 app/adminapi/controller/manage_basic/ManageProjectController.php create mode 100644 app/adminapi/controller/manage_communication/ManageAcceptDocController.php create mode 100644 app/adminapi/controller/manage_communication/ManageSendDocController.php create mode 100644 app/adminapi/controller/manage_invest/ManageEngineeringChangesController.php create mode 100644 app/adminapi/controller/manage_invest/ManageMeteredPaymentController.php create mode 100644 app/adminapi/controller/manage_progress/ManageMonthlyProgressReportController.php create mode 100644 app/adminapi/lists/manage_basic/ManageCompanyContactsLists.php create mode 100644 app/adminapi/lists/manage_basic/ManageCompanyLists.php create mode 100644 app/adminapi/lists/manage_basic/ManageProjectLists.php create mode 100644 app/adminapi/lists/manage_communication/ManageAcceptDocLists.php create mode 100644 app/adminapi/lists/manage_communication/ManageSendDocLists.php create mode 100644 app/adminapi/lists/manage_invest/ManageEngineeringChangesLists.php create mode 100644 app/adminapi/lists/manage_invest/ManageMeteredPaymentLists.php create mode 100644 app/adminapi/lists/manage_progress/ManageMonthlyProgressReportLists.php create mode 100644 app/adminapi/logic/manage_basic/ManageCompanyContactsLogic.php create mode 100644 app/adminapi/logic/manage_basic/ManageCompanyLogic.php create mode 100644 app/adminapi/logic/manage_basic/ManageProjectLogic.php create mode 100644 app/adminapi/logic/manage_communication/ManageAcceptDocLogic.php create mode 100644 app/adminapi/logic/manage_communication/ManageSendDocLogic.php create mode 100644 app/adminapi/logic/manage_invest/ManageEngineeringChangesLogic.php create mode 100644 app/adminapi/logic/manage_invest/ManageMeteredPaymentLogic.php create mode 100644 app/adminapi/logic/manage_progress/ManageMonthlyProgressReportLogic.php create mode 100644 app/adminapi/validate/manage_basic/ManageCompanyContactsValidate.php create mode 100644 app/adminapi/validate/manage_basic/ManageCompanyValidate.php create mode 100644 app/adminapi/validate/manage_basic/ManageProjectValidate.php create mode 100644 app/adminapi/validate/manage_communication/ManageAcceptDocValidate.php create mode 100644 app/adminapi/validate/manage_communication/ManageSendDocValidate.php create mode 100644 app/adminapi/validate/manage_invest/ManageEngineeringChangesValidate.php create mode 100644 app/adminapi/validate/manage_invest/ManageMeteredPaymentValidate.php create mode 100644 app/adminapi/validate/manage_progress/ManageMonthlyProgressReportValidate.php create mode 100644 app/common/model/manage_basic/ManageCompany.php create mode 100644 app/common/model/manage_basic/ManageCompanyContacts.php create mode 100644 app/common/model/manage_basic/ManageProject.php create mode 100644 app/common/model/manage_communication/ManageAcceptDoc.php create mode 100644 app/common/model/manage_communication/ManageSendDoc.php create mode 100644 app/common/model/manage_invest/ManageEngineeringChanges.php create mode 100644 app/common/model/manage_invest/ManageMeteredPayment.php create mode 100644 app/common/model/manage_progress/ManageMonthlyProgressReport.php diff --git a/app/adminapi/controller/manage_basic/ManageCompanyContactsController.php b/app/adminapi/controller/manage_basic/ManageCompanyContactsController.php new file mode 100644 index 000000000..29d33e631 --- /dev/null +++ b/app/adminapi/controller/manage_basic/ManageCompanyContactsController.php @@ -0,0 +1,108 @@ +dataLists(new ManageCompanyContactsLists()); + } + + + /** + * @notes 添加项目管理--参建单位联系人 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function add() + { + $params = (new ManageCompanyContactsValidate())->post()->goCheck('add'); + $result = ManageCompanyContactsLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ManageCompanyContactsLogic::getError()); + } + + + /** + * @notes 编辑项目管理--参建单位联系人 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function edit() + { + $params = (new ManageCompanyContactsValidate())->post()->goCheck('edit'); + $result = ManageCompanyContactsLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ManageCompanyContactsLogic::getError()); + } + + + /** + * @notes 删除项目管理--参建单位联系人 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function delete() + { + $params = (new ManageCompanyContactsValidate())->post()->goCheck('delete'); + ManageCompanyContactsLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目管理--参建单位联系人详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function detail() + { + $params = (new ManageCompanyContactsValidate())->goCheck('detail'); + $result = ManageCompanyContactsLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/manage_basic/ManageCompanyController.php b/app/adminapi/controller/manage_basic/ManageCompanyController.php new file mode 100644 index 000000000..a1c155b07 --- /dev/null +++ b/app/adminapi/controller/manage_basic/ManageCompanyController.php @@ -0,0 +1,111 @@ +dataLists(new ManageCompanyLists()); + } + + + /** + * @notes 添加项目管理--参建单位 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function add() + { + $params = (new ManageCompanyValidate())->post()->goCheck('add'); + $result = ManageCompanyLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ManageCompanyLogic::getError()); + } + + + /** + * @notes 编辑项目管理--参建单位 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function edit() + { + $params = (new ManageCompanyValidate())->post()->goCheck('edit'); + $result = ManageCompanyLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ManageCompanyLogic::getError()); + } + + + /** + * @notes 删除项目管理--参建单位 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function delete() + { + $params = (new ManageCompanyValidate())->post()->goCheck('delete'); + $result = ManageCompanyLogic::delete($params); + if (true === $result) { + return $this->success('删除成功', [], 1, 1); + } + return $this->fail(ManageCompanyLogic::getError()); + } + + + /** + * @notes 获取项目管理--参建单位详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function detail() + { + $params = (new ManageCompanyValidate())->goCheck('detail'); + $result = ManageCompanyLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/manage_basic/ManageProjectController.php b/app/adminapi/controller/manage_basic/ManageProjectController.php new file mode 100644 index 000000000..05385ae64 --- /dev/null +++ b/app/adminapi/controller/manage_basic/ManageProjectController.php @@ -0,0 +1,111 @@ +dataLists(new ManageProjectLists()); + } + + + /** + * @notes 添加项目管理--项目信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function add() + { + $params = (new ManageProjectValidate())->post()->goCheck('add'); + $result = ManageProjectLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ManageProjectLogic::getError()); + } + + + /** + * @notes 编辑项目管理--项目信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function edit() + { + $params = (new ManageProjectValidate())->post()->goCheck('edit'); + $result = ManageProjectLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ManageProjectLogic::getError()); + } + + + /** + * @notes 删除项目管理--项目信息 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function delete() + { + $params = (new ManageProjectValidate())->post()->goCheck('delete'); + $result = ManageProjectLogic::delete($params); + if (true === $result) { + return $this->success('删除成功', [], 1, 1); + } + return $this->fail(ManageProjectLogic::getError()); + } + + + /** + * @notes 获取项目管理--项目信息详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function detail() + { + $params = (new ManageProjectValidate())->goCheck('detail'); + $result = ManageProjectLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/manage_communication/ManageAcceptDocController.php b/app/adminapi/controller/manage_communication/ManageAcceptDocController.php new file mode 100644 index 000000000..23e48de3d --- /dev/null +++ b/app/adminapi/controller/manage_communication/ManageAcceptDocController.php @@ -0,0 +1,108 @@ +dataLists(new ManageAcceptDocLists()); + } + + + /** + * @notes 添加项目管理--收文管理 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function add() + { + $params = (new ManageAcceptDocValidate())->post()->goCheck('add'); + $result = ManageAcceptDocLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ManageAcceptDocLogic::getError()); + } + + + /** + * @notes 编辑项目管理--收文管理 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function edit() + { + $params = (new ManageAcceptDocValidate())->post()->goCheck('edit'); + $result = ManageAcceptDocLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ManageAcceptDocLogic::getError()); + } + + + /** + * @notes 删除项目管理--收文管理 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function delete() + { + $params = (new ManageAcceptDocValidate())->post()->goCheck('delete'); + ManageAcceptDocLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目管理--收文管理详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function detail() + { + $params = (new ManageAcceptDocValidate())->goCheck('detail'); + $result = ManageAcceptDocLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/manage_communication/ManageSendDocController.php b/app/adminapi/controller/manage_communication/ManageSendDocController.php new file mode 100644 index 000000000..e35c0ad2d --- /dev/null +++ b/app/adminapi/controller/manage_communication/ManageSendDocController.php @@ -0,0 +1,108 @@ +dataLists(new ManageSendDocLists()); + } + + + /** + * @notes 添加项目管理--发文管理 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function add() + { + $params = (new ManageSendDocValidate())->post()->goCheck('add'); + $result = ManageSendDocLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ManageSendDocLogic::getError()); + } + + + /** + * @notes 编辑项目管理--发文管理 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function edit() + { + $params = (new ManageSendDocValidate())->post()->goCheck('edit'); + $result = ManageSendDocLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ManageSendDocLogic::getError()); + } + + + /** + * @notes 删除项目管理--发文管理 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function delete() + { + $params = (new ManageSendDocValidate())->post()->goCheck('delete'); + ManageSendDocLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目管理--发文管理详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function detail() + { + $params = (new ManageSendDocValidate())->goCheck('detail'); + $result = ManageSendDocLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/manage_invest/ManageEngineeringChangesController.php b/app/adminapi/controller/manage_invest/ManageEngineeringChangesController.php new file mode 100644 index 000000000..ce677031b --- /dev/null +++ b/app/adminapi/controller/manage_invest/ManageEngineeringChangesController.php @@ -0,0 +1,108 @@ +dataLists(new ManageEngineeringChangesLists()); + } + + + /** + * @notes 添加项目管理--工程变更 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function add() + { + $params = (new ManageEngineeringChangesValidate())->post()->goCheck('add'); + $result = ManageEngineeringChangesLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ManageEngineeringChangesLogic::getError()); + } + + + /** + * @notes 编辑项目管理--工程变更 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function edit() + { + $params = (new ManageEngineeringChangesValidate())->post()->goCheck('edit'); + $result = ManageEngineeringChangesLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ManageEngineeringChangesLogic::getError()); + } + + + /** + * @notes 删除项目管理--工程变更 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function delete() + { + $params = (new ManageEngineeringChangesValidate())->post()->goCheck('delete'); + ManageEngineeringChangesLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目管理--工程变更详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function detail() + { + $params = (new ManageEngineeringChangesValidate())->goCheck('detail'); + $result = ManageEngineeringChangesLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/manage_invest/ManageMeteredPaymentController.php b/app/adminapi/controller/manage_invest/ManageMeteredPaymentController.php new file mode 100644 index 000000000..0623467a9 --- /dev/null +++ b/app/adminapi/controller/manage_invest/ManageMeteredPaymentController.php @@ -0,0 +1,108 @@ +dataLists(new ManageMeteredPaymentLists()); + } + + + /** + * @notes 添加项目管理--计量支付 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function add() + { + $params = (new ManageMeteredPaymentValidate())->post()->goCheck('add'); + $result = ManageMeteredPaymentLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ManageMeteredPaymentLogic::getError()); + } + + + /** + * @notes 编辑项目管理--计量支付 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function edit() + { + $params = (new ManageMeteredPaymentValidate())->post()->goCheck('edit'); + $result = ManageMeteredPaymentLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ManageMeteredPaymentLogic::getError()); + } + + + /** + * @notes 删除项目管理--计量支付 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function delete() + { + $params = (new ManageMeteredPaymentValidate())->post()->goCheck('delete'); + ManageMeteredPaymentLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目管理--计量支付详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function detail() + { + $params = (new ManageMeteredPaymentValidate())->goCheck('detail'); + $result = ManageMeteredPaymentLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/manage_progress/ManageMonthlyProgressReportController.php b/app/adminapi/controller/manage_progress/ManageMonthlyProgressReportController.php new file mode 100644 index 000000000..367eb7614 --- /dev/null +++ b/app/adminapi/controller/manage_progress/ManageMonthlyProgressReportController.php @@ -0,0 +1,108 @@ +dataLists(new ManageMonthlyProgressReportLists()); + } + + + /** + * @notes 添加项目管理--工程进度月报 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function add() + { + $params = (new ManageMonthlyProgressReportValidate())->post()->goCheck('add'); + $result = ManageMonthlyProgressReportLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ManageMonthlyProgressReportLogic::getError()); + } + + + /** + * @notes 编辑项目管理--工程进度月报 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function edit() + { + $params = (new ManageMonthlyProgressReportValidate())->post()->goCheck('edit'); + $result = ManageMonthlyProgressReportLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ManageMonthlyProgressReportLogic::getError()); + } + + + /** + * @notes 删除项目管理--工程进度月报 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function delete() + { + $params = (new ManageMonthlyProgressReportValidate())->post()->goCheck('delete'); + ManageMonthlyProgressReportLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目管理--工程进度月报详情 + * @return \think\response\Json + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function detail() + { + $params = (new ManageMonthlyProgressReportValidate())->goCheck('detail'); + $result = ManageMonthlyProgressReportLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/lists/manage_basic/ManageCompanyContactsLists.php b/app/adminapi/lists/manage_basic/ManageCompanyContactsLists.php new file mode 100644 index 000000000..abce98d4b --- /dev/null +++ b/app/adminapi/lists/manage_basic/ManageCompanyContactsLists.php @@ -0,0 +1,77 @@ + ['company_id'], + ]; + } + + + /** + * @notes 获取项目管理--参建单位联系人列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function lists(): array + { + return ManageCompanyContacts::where($this->searchWhere) + ->field(['id', 'company_id', 'name', 'duties', 'telephone', 'mobile', 'email', 'fax']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取项目管理--参建单位联系人数量 + * @return int + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function count(): int + { + return ManageCompanyContacts::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/manage_basic/ManageCompanyLists.php b/app/adminapi/lists/manage_basic/ManageCompanyLists.php new file mode 100644 index 000000000..b6b71e5c9 --- /dev/null +++ b/app/adminapi/lists/manage_basic/ManageCompanyLists.php @@ -0,0 +1,83 @@ + ['project_id', 'type'], + '%like%' => ['name', 'qualification_grade', 'telephone'], + ]; + } + + + /** + * @notes 获取项目管理--参建单位列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function lists(): array + { + return ManageCompany::where($this->searchWhere) + ->field(['id', 'project_id', 'name', 'type', 'qualification_grade', 'telephone', 'duty']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['type_text'] = $data->type_text; + }) + ->toArray(); + } + + + /** + * @notes 获取项目管理--参建单位数量 + * @return int + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function count(): int + { + return ManageCompany::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/manage_basic/ManageProjectLists.php b/app/adminapi/lists/manage_basic/ManageProjectLists.php new file mode 100644 index 000000000..bf4ce52e3 --- /dev/null +++ b/app/adminapi/lists/manage_basic/ManageProjectLists.php @@ -0,0 +1,86 @@ + ['nature', 'industry', 'build_area', 'project_level', 'engineering_status'], + '%like%' => ['project_name', 'project_code'], + ]; + } + + + /** + * @notes 获取项目管理--项目信息列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function lists(): array + { + return ManageProject::where($this->searchWhere) + ->field(['id', 'project_name', 'project_code', 'nature', 'industry', 'build_area', 'project_level', 'total_investment', 'engineering_status', 'implementation_department', 'supervision_department', 'project_manager']) + ->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->engineering_status_text; + //todo 计算累计进度 + $data['progress'] = 0; + }) + ->toArray(); + } + + + /** + * @notes 获取项目管理--项目信息数量 + * @return int + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function count(): int + { + return ManageProject::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/manage_communication/ManageAcceptDocLists.php b/app/adminapi/lists/manage_communication/ManageAcceptDocLists.php new file mode 100644 index 000000000..84af576c4 --- /dev/null +++ b/app/adminapi/lists/manage_communication/ManageAcceptDocLists.php @@ -0,0 +1,96 @@ + ['project_id'], + '%like%' => ['send_company', 'accept_user'], + ]; + } + + + /** + * @notes 获取项目管理--收文管理列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function lists(): array + { + $params = $this->request->get(); + $condition = []; + if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ + if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ + $condition[] = ['send_date','between',[strtotime($params['start_date'].' 00:00:00'),strtotime($params['end_date'].' 23:59:59')]]; + } + } + return ManageAcceptDoc::where($this->searchWhere)->where($condition) + ->field(['id', 'project_id', 'abstract', 'send_company', 'send_date', 'accept_user', 'accept_date']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + }) + ->toArray(); + } + + + /** + * @notes 获取项目管理--收文管理数量 + * @return int + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function count(): int + { + $params = $this->request->get(); + $condition = []; + if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ + if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ + $condition[] = ['date','between',[strtotime($params['start_date'].' 00:00:00'),strtotime($params['end_date'].' 23:59:59')]]; + } + } + return ManageAcceptDoc::where($this->searchWhere)->where($condition)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/manage_communication/ManageSendDocLists.php b/app/adminapi/lists/manage_communication/ManageSendDocLists.php new file mode 100644 index 000000000..407357a15 --- /dev/null +++ b/app/adminapi/lists/manage_communication/ManageSendDocLists.php @@ -0,0 +1,96 @@ + ['project_id'], + '%like%' => ['code', 'send_user', 'accept_user'], + ]; + } + + + /** + * @notes 获取项目管理--发文管理列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function lists(): array + { + $params = $this->request->get(); + $condition = []; + if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ + if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ + $condition[] = ['send_date','between',[strtotime($params['start_date'].' 00:00:00'),strtotime($params['end_date'].' 23:59:59')]]; + } + } + return ManageSendDoc::where($this->searchWhere)->where($condition) + ->field(['id', 'project_id', 'code', 'abstract', 'send_date', 'send_company', 'send_user', 'accept_user', 'remark']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + }) + ->toArray(); + } + + + /** + * @notes 获取项目管理--发文管理数量 + * @return int + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function count(): int + { + $params = $this->request->get(); + $condition = []; + if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ + if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ + $condition[] = ['send_date','between',[strtotime($params['start_date'].' 00:00:00'),strtotime($params['end_date'].' 23:59:59')]]; + } + } + return ManageSendDoc::where($this->searchWhere)->where($condition)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/manage_invest/ManageEngineeringChangesLists.php b/app/adminapi/lists/manage_invest/ManageEngineeringChangesLists.php new file mode 100644 index 000000000..f2ddf228b --- /dev/null +++ b/app/adminapi/lists/manage_invest/ManageEngineeringChangesLists.php @@ -0,0 +1,82 @@ + ['project_id'], + '%like%' => ['code', 'drawing_number'], + ]; + } + + + /** + * @notes 获取项目管理--工程变更列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function lists(): array + { + return ManageEngineeringChanges::where($this->searchWhere) + ->field(['id', 'project_id', 'code', 'date', 'position', 'drawing_number', 'overview', 'sign_info']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + }) + ->toArray(); + } + + + /** + * @notes 获取项目管理--工程变更数量 + * @return int + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function count(): int + { + return ManageEngineeringChanges::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/manage_invest/ManageMeteredPaymentLists.php b/app/adminapi/lists/manage_invest/ManageMeteredPaymentLists.php new file mode 100644 index 000000000..a7c552b5a --- /dev/null +++ b/app/adminapi/lists/manage_invest/ManageMeteredPaymentLists.php @@ -0,0 +1,100 @@ + ['project_id'], + '%like%' => ['create_user'], + ]; + } + + + /** + * @notes 获取项目管理--计量支付列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function lists(): array + { + $params = $this->request->get(); + $condition = []; + if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ + if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ + $condition[] = ['date','between',[strtotime($params['start_date']),strtotime($params['end_date'])]]; + } + } + return ManageMeteredPayment::where($this->searchWhere)->where($condition) + ->field(['id', 'project_id', 'date', 'month_amount', 'month_pay', 'create_user']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + //累计完成 + $data['total_amount'] = ManageMeteredPayment::where('project_id',$data['project_id'])->sum('month_amount'); + //累计支付 + $data['total_pay'] = ManageMeteredPayment::where('project_id',$data['project_id'])->sum('month_pay'); + }) + ->toArray(); + } + + + /** + * @notes 获取项目管理--计量支付数量 + * @return int + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function count(): int + { + $params = $this->request->get(); + $condition = []; + if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ + if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ + $condition[] = ['date','between',[strtotime($params['start_date']),strtotime($params['end_date'])]]; + } + } + return ManageMeteredPayment::where($this->searchWhere)->where($condition)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/manage_progress/ManageMonthlyProgressReportLists.php b/app/adminapi/lists/manage_progress/ManageMonthlyProgressReportLists.php new file mode 100644 index 000000000..1ace1fdc9 --- /dev/null +++ b/app/adminapi/lists/manage_progress/ManageMonthlyProgressReportLists.php @@ -0,0 +1,96 @@ + ['project_id'], + ]; + } + + + /** + * @notes 获取项目管理--工程进度月报列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function lists(): array + { + $params = $this->request->get(); + $condition = []; + if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ + if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ + $condition[] = ['date','between',[strtotime($params['start_date']),strtotime($params['end_date'])]]; + } + } + return ManageMonthlyProgressReport::where($this->searchWhere)->where($condition) + ->field(['id', 'project_id', 'date', 'progress', 'status', 'problem', 'desc', 'remark']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['status_text'] = $data->status_text; + }) + ->toArray(); + } + + + /** + * @notes 获取项目管理--工程进度月报数量 + * @return int + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function count(): int + { + $params = $this->request->get(); + $condition = []; + if(isset($params['start_date']) && $params['start_date'] != '' && isset($params['end_date']) && $params['end_date'] != ''){ + if(strtotime($params['end_date']) - strtotime($params['start_date']) >= 0){ + $condition[] = ['date','between',[strtotime($params['start_date']),strtotime($params['end_date'])]]; + } + } + return ManageMonthlyProgressReport::where($this->searchWhere)->where($condition)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/logic/manage_basic/ManageCompanyContactsLogic.php b/app/adminapi/logic/manage_basic/ManageCompanyContactsLogic.php new file mode 100644 index 000000000..261f9211a --- /dev/null +++ b/app/adminapi/logic/manage_basic/ManageCompanyContactsLogic.php @@ -0,0 +1,117 @@ + $params['company_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/03/07 11:50 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ManageCompanyContacts::where('id', $params['id'])->update([ + 'company_id' => $params['company_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/03/07 11:50 + */ + public static function delete(array $params): bool + { + return ManageCompanyContacts::destroy($params['id']); + } + + + /** + * @notes 获取项目管理--参建单位联系人详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public static function detail($params): array + { + return ManageCompanyContacts::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id'])->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/manage_basic/ManageCompanyLogic.php b/app/adminapi/logic/manage_basic/ManageCompanyLogic.php new file mode 100644 index 000000000..510bd8a2f --- /dev/null +++ b/app/adminapi/logic/manage_basic/ManageCompanyLogic.php @@ -0,0 +1,165 @@ + $params['project_id'], + 'name' => $params['name'], + 'type' => $params['type'], + 'qualification_grade' => $params['qualification_grade'] ?? '', + 'telephone' => $params['telephone'] ?? '', + 'duty' => $params['duty'] ?? '' + ]); + if(!empty($params['contacts'])){ + foreach($params['contacts'] as $v){ + ManageCompanyContacts::create([ + 'company_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/03/07 11:50 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ManageCompany::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'name' => $params['name'], + 'type' => $params['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'])) { + ManageCompanyContacts::where('id', $v['id'])->update([ + 'company_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 { + ManageCompanyContacts::create([ + 'company_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/03/07 11:50 + */ + public static function delete(array $params): bool + { + $contact = ManageCompanyContacts::where('company_id',$params['id'])->findOrEmpty(); + if(!$contact->isEmpty()){ + self::setError('该数据下存在联系人信息,须删除联系人信息'); + return false; + } + return ManageCompany::destroy($params['id']); + } + + + /** + * @notes 获取项目管理--参建单位详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public static function detail($params): array + { + $data = ManageCompany::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['type_text'] = $data->type_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/manage_basic/ManageProjectLogic.php b/app/adminapi/logic/manage_basic/ManageProjectLogic.php new file mode 100644 index 000000000..470a18388 --- /dev/null +++ b/app/adminapi/logic/manage_basic/ManageProjectLogic.php @@ -0,0 +1,195 @@ + $params['project_name'], + 'project_code' => data_unique_code('XM'), + 'nature' => $params['nature'], + 'industry' => $params['industry'], + 'build_unit' => $params['build_unit'] ?? '', + 'build_area' => $params['build_area'], + 'address' => $params['address'] ?? '', + 'project_level' => $params['project_level'], + 'total_investment' => $params['total_investment'], + 'engineering_status' => $params['engineering_status'], + 'contract_content' => $params['contract_content'] ?? '', + 'project_overview' => $params['project_overview'] ?? '', + 'project_requirements' => $params['project_requirements'] ?? '', + '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, + '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, + 'implementation_department' => $params['implementation_department'] ?? '', + 'supervision_department' => $params['supervision_department'] ?? '', + 'project_manager' => $params['project_manager'], + 'initiation_date' => !empty($params['initiation_date']) ? strtotime($params['initiation_date']) : 0, + 'project_leader' => $params['project_leader'] ?? '', + 'project_department' => $params['project_department'] ?? '', + 'remark' => $params['remark'] ?? '', + 'contract' => $params['contract'] ?? '', + 'part_a_unit' => $params['part_a_unit'] ?? '', + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'create_user' => $params['create_user'], + 'create_time' => !empty($params['create_time']) ? strtotime($params['actual_end_date']) : 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/03/07 10:49 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ManageProject::where('id', $params['id'])->update([ + 'project_name' => $params['project_name'], + 'nature' => $params['nature'], + 'industry' => $params['industry'], + 'build_unit' => $params['build_unit'] ?? '', + 'build_area' => $params['build_area'], + 'address' => $params['address'] ?? '', + 'project_level' => $params['project_level'], + 'total_investment' => $params['total_investment'], + 'engineering_status' => $params['engineering_status'], + 'contract_content' => $params['contract_content'] ?? '', + 'project_overview' => $params['project_overview'] ?? '', + 'project_requirements' => $params['project_requirements'] ?? '', + '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, + '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, + 'implementation_department' => $params['implementation_department'] ?? '', + 'supervision_department' => $params['supervision_department'] ?? '', + 'project_manager' => $params['project_manager'], + 'initiation_date' => !empty($params['initiation_date']) ? strtotime($params['initiation_date']) : 0, + 'project_leader' => $params['project_leader'] ?? '', + 'project_department' => $params['project_department'] ?? '', + 'remark' => $params['remark'] ?? '', + 'contract' => $params['contract'] ?? '', + 'part_a_unit' => $params['part_a_unit'] ?? '', + 'annex' => $params['annex'] ? json_encode($params['annex']) : null, + 'create_user' => $params['create_user'], + 'create_time' => !empty($params['create_time']) ? strtotime($params['actual_end_date']) : time(), + '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/03/07 10:49 + */ + public static function delete(array $params): bool + { + //获取参建单位 + $company = ManageCompany::where('project_id',$params['id'])->findOrEmpty(); + if(!$company->isEmpty()){ + self::setError('该数据下存在参建单位信息,须删除参建单位信息'); + return false; + } + //获取计量支付信息 + $metered_payment = ManageMeteredPayment::where('project_id',$params['id'])->findOrEmpty(); + if(!$metered_payment->isEmpty()){ + self::setError('该数据下存在计量支付信息,须删除计量支付信息'); + return false; + } + //获取工程变更信息 + $engineering_changes = ManageEngineeringChanges::where('project_id',$params['id'])->findOrEmpty(); + if(!$engineering_changes->isEmpty()){ + self::setError('该数据下存在工程变更信息,须删除工程变更信息'); + return false; + } + //获取工程进度月报信息 + $progress_report = ManageMonthlyProgressReport::where('project_id',$params['id'])->findOrEmpty(); + if(!$progress_report->isEmpty()){ + self::setError('该数据下存在进度月报信息,须删除进度月报信息'); + return false; + } + //todo + return ManageProject::destroy($params['id']); + } + + + /** + * @notes 获取项目管理--项目信息详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public static function detail($params): array + { + $data = ManageProject::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $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/logic/manage_communication/ManageAcceptDocLogic.php b/app/adminapi/logic/manage_communication/ManageAcceptDocLogic.php new file mode 100644 index 000000000..b89f342a2 --- /dev/null +++ b/app/adminapi/logic/manage_communication/ManageAcceptDocLogic.php @@ -0,0 +1,127 @@ + $params['project_id'], + 'code' => $params['code'] ?? '', + 'abstract' => $params['abstract'], + 'send_company' => $params['send_company'], + 'send_date' => !empty($params['send_date']) ? strtotime($params['send_date']) : 0, + 'accept_user' => $params['accept_user'] ?? '', + 'accept_date' => !empty($params['accept_date']) ? strtotime($params['accept_date']) : 0, + 'read_user' => $params['read_user'] ?? '', + '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/03/07 16:46 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ManageAcceptDoc::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'code' => $params['code'] ?? '', + 'abstract' => $params['abstract'], + 'send_company' => $params['send_company'], + 'send_date' => !empty($params['send_date']) ? strtotime($params['send_date']) : 0, + 'accept_user' => $params['accept_user'] ?? '', + 'accept_date' => !empty($params['accept_date']) ? strtotime($params['accept_date']) : 0, + 'read_user' => $params['read_user'] ?? '', + '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/03/07 16:46 + */ + public static function delete(array $params): bool + { + return ManageAcceptDoc::destroy($params['id']); + } + + + /** + * @notes 获取项目管理--收文管理详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public static function detail($params): array + { + $data = ManageAcceptDoc::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/manage_communication/ManageSendDocLogic.php b/app/adminapi/logic/manage_communication/ManageSendDocLogic.php new file mode 100644 index 000000000..04322c03d --- /dev/null +++ b/app/adminapi/logic/manage_communication/ManageSendDocLogic.php @@ -0,0 +1,125 @@ + $params['project_id'], + 'code' => $params['code'] ?? '', + 'abstract' => $params['abstract'], + 'send_date' => !empty($params['send_date']) ? strtotime($params['send_date']) : 0, + 'send_company' => $params['send_company'], + 'send_user' => $params['send_user'], + 'accept_user' => $params['accept_user'] ?? '', + '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/03/07 17:15 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ManageSendDoc::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'code' => $params['code'] ?? '', + 'abstract' => $params['abstract'], + 'send_date' => !empty($params['send_date']) ? strtotime($params['send_date']) : 0, + 'send_company' => $params['send_company'], + 'send_user' => $params['send_user'], + 'accept_user' => $params['accept_user'] ?? '', + '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/03/07 17:15 + */ + public static function delete(array $params): bool + { + return ManageSendDoc::destroy($params['id']); + } + + + /** + * @notes 获取项目管理--发文管理详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public static function detail($params): array + { + $data = ManageSendDoc::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/manage_invest/ManageEngineeringChangesLogic.php b/app/adminapi/logic/manage_invest/ManageEngineeringChangesLogic.php new file mode 100644 index 000000000..dc8eac997 --- /dev/null +++ b/app/adminapi/logic/manage_invest/ManageEngineeringChangesLogic.php @@ -0,0 +1,124 @@ + $params['project_id'], + 'code' => data_unique_code('GCBG'), + 'date' => !empty($params['date']) ? strtotime($params['date']) : 0, + 'position' => $params['position'], + 'drawing_number' => $params['drawing_number'] ?? '', + 'overview' => $params['overview'] ?? '', + 'sign_info' => $params['sign_info'] ?? '', + '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/03/07 15:21 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ManageEngineeringChanges::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'date' => !empty($params['date']) ? strtotime($params['date']) : 0, + 'position' => $params['position'], + 'drawing_number' => $params['drawing_number'] ?? '', + 'overview' => $params['overview'] ?? '', + 'sign_info' => $params['sign_info'] ?? '', + '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/03/07 15:21 + */ + public static function delete(array $params): bool + { + return ManageEngineeringChanges::destroy($params['id']); + } + + + /** + * @notes 获取项目管理--工程变更详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public static function detail($params): array + { + $data = ManageEngineeringChanges::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/manage_invest/ManageMeteredPaymentLogic.php b/app/adminapi/logic/manage_invest/ManageMeteredPaymentLogic.php new file mode 100644 index 000000000..eb5f6c15d --- /dev/null +++ b/app/adminapi/logic/manage_invest/ManageMeteredPaymentLogic.php @@ -0,0 +1,121 @@ + $params['project_id'], + 'date' => !empty($params['date']) ? strtotime($params['date']) : 0, + 'month_amount' => $params['month_amount'], + 'month_pay' => $params['month_pay'], + 'remark' => $params['remark'] ?? '', + 'create_user' => $params['create_user'], + 'create_time' => !empty($params['create_time']) ? strtotime($params['create_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/03/07 14:27 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ManageMeteredPayment::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'date' => !empty($params['date']) ? strtotime($params['date']) : 0, + 'month_amount' => $params['month_amount'], + 'month_pay' => $params['month_pay'], + 'remark' => $params['remark'] ?? '', + 'create_user' => $params['create_user'], + 'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : time(), + '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/03/07 14:27 + */ + public static function delete(array $params): bool + { + return ManageMeteredPayment::destroy($params['id']); + } + + + /** + * @notes 获取项目管理--计量支付详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public static function detail($params): array + { + $data = ManageMeteredPayment::withoutField('update_time,delete_time')->findOrEmpty($params['id']); + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/logic/manage_progress/ManageMonthlyProgressReportLogic.php b/app/adminapi/logic/manage_progress/ManageMonthlyProgressReportLogic.php new file mode 100644 index 000000000..cf7d78e02 --- /dev/null +++ b/app/adminapi/logic/manage_progress/ManageMonthlyProgressReportLogic.php @@ -0,0 +1,124 @@ + $params['project_id'], + 'date' => !empty($params['date']) ? strtotime($params['date']) : 0, + 'progress' => $params['progress'], + 'status' => $params['status'], + 'problem' => $params['problem'] ?? '', + 'desc' => $params['desc'] ?? '', + 'remark' => $params['remark'] ?? '', + 'annex' => $params['annex'] ? json_encode($params['annex']) : null + ]); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 编辑项目管理--工程进度月报 + * @param array $params + * @return bool + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ManageMonthlyProgressReport::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'date' => !empty($params['date']) ? strtotime($params['date']) : 0, + 'progress' => $params['progress'], + 'status' => $params['status'], + 'problem' => $params['problem'] ?? '', + 'desc' => $params['desc'] ?? '', + '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/03/07 15:57 + */ + public static function delete(array $params): bool + { + return ManageMonthlyProgressReport::destroy($params['id']); + } + + + /** + * @notes 获取项目管理--工程进度月报详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public static function detail($params): array + { + $data = ManageMonthlyProgressReport::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); + $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['project_name']; + $data['status_text'] = $data->status_text; + return $data->toArray(); + } +} \ No newline at end of file diff --git a/app/adminapi/validate/manage_basic/ManageCompanyContactsValidate.php b/app/adminapi/validate/manage_basic/ManageCompanyContactsValidate.php new file mode 100644 index 000000000..cd6045259 --- /dev/null +++ b/app/adminapi/validate/manage_basic/ManageCompanyContactsValidate.php @@ -0,0 +1,125 @@ + 'require|checkData', + 'company_id' => 'require|checkCompany', + 'name' => 'require', + 'mobile' => 'mobile', + 'email' => 'email', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'company_id' => '单位id', + 'name' => '姓名', + 'duties' => '职务', + 'telephone' => '办公电话', + 'mobile' => '手机号码', + 'email' => '电子邮箱', + 'fax' => '传真', + ]; + + + /** + * @notes 添加场景 + * @return ManageCompanyContactsValidate + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function sceneAdd() + { + return $this->only(['company_id','name','duties','telephone','mobile','email','fax']); + } + + + /** + * @notes 编辑场景 + * @return ManageCompanyContactsValidate + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function sceneEdit() + { + return $this->only(['id','company_id','name','duties','telephone','mobile','email','fax']); + } + + + /** + * @notes 删除场景 + * @return ManageCompanyContactsValidate + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ManageCompanyContactsValidate + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ManageCompanyContacts::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkCompany($value): bool|string + { + $data = ManageCompany::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '单位信息不存在'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/manage_basic/ManageCompanyValidate.php b/app/adminapi/validate/manage_basic/ManageCompanyValidate.php new file mode 100644 index 000000000..4ecc92f10 --- /dev/null +++ b/app/adminapi/validate/manage_basic/ManageCompanyValidate.php @@ -0,0 +1,151 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'name' => 'require', + 'type' => 'require|checkType', + 'contacts' => 'checkContacts' + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'name' => '单位名称', + 'type' => '单位类别', + 'qualification_grade' => '资质等级', + 'telephone' => '联系电话', + 'duty' => '责任范围', + ]; + + + /** + * @notes 添加场景 + * @return ManageCompanyValidate + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function sceneAdd() + { + return $this->only(['project_id','name','type','qualification_grade','telephone','duty','contacts']); + } + + + /** + * @notes 编辑场景 + * @return ManageCompanyValidate + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function sceneEdit() + { + return $this->only(['id','project_id','name','type','qualification_grade','telephone','duty','contacts']); + } + + + /** + * @notes 删除场景 + * @return ManageCompanyValidate + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ManageCompanyValidate + * @author likeadmin + * @date 2024/03/07 11:50 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ManageCompany::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value): bool|string + { + $data = ManageProject::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '项目信息不存在'; + } + return true; + } + + public function checkType($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 = ManageCompanyContacts::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/manage_basic/ManageProjectValidate.php b/app/adminapi/validate/manage_basic/ManageProjectValidate.php new file mode 100644 index 000000000..f96f05597 --- /dev/null +++ b/app/adminapi/validate/manage_basic/ManageProjectValidate.php @@ -0,0 +1,200 @@ + 'require|checkData', + 'project_name' => 'require', + 'nature' => 'require|checkNature', + 'industry' => 'require|checkIndustry', + 'build_area' => 'require|checkBuildArea', + 'project_level' => 'require|checkProjectLevel', + 'total_investment' => 'require|float|gt:0', + 'engineering_status' => 'require|checkEngineeringStatus', + 'planned_start_date' => 'dateFormat:Y-m-d', + 'planned_end_date' => 'dateFormat:Y-m-d', + 'actual_start_date' => 'dateFormat:Y-m-d', + 'actual_end_date' => 'dateFormat:Y-m-d', + 'project_manager' => 'require', + 'initiation_date' => 'dateFormat:Y-m-d', + 'create_user' => 'require', + 'create_time' => 'require|dateFormat:Y-m-d H:i:s', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_name' => '项目名称', + 'project_code' => '项目编号', + 'nature' => '性质', + 'industry' => '行业', + 'build_unit' => '建设单位', + 'build_area' => '建设区域', + 'address' => '项目地址', + 'project_level' => '项目级别', + 'total_investment' => '总投资(万元)', + 'engineering_status' => '工程状态', + 'contract_content' => '合同服务内容', + 'project_overview' => '项目概况', + 'project_requirements' => '项目要求', + 'planned_start_date' => '计划开工日期', + 'planned_end_date' => '计划竣工日期', + 'actual_start_date' => '实际开工日期', + 'actual_end_date' => '实际竣工日期', + 'implementation_department' => '实施部门', + 'supervision_department' => '监管部门', + 'project_manager' => '项目经理', + 'initiation_date' => '立项日期', + 'project_leader' => '项目负责人', + 'project_department' => '项目部', + 'remark' => '备注', + 'contract' => '关联合同', + 'part_a_unit' => '甲方单位', + 'create_user' => '创建人', + 'create_time' => '创建时间', + ]; + + + /** + * @notes 添加场景 + * @return ManageProjectValidate + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return ManageProjectValidate + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return ManageProjectValidate + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ManageProjectValidate + * @author likeadmin + * @date 2024/03/07 10:49 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ManageProject::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/adminapi/validate/manage_communication/ManageAcceptDocValidate.php b/app/adminapi/validate/manage_communication/ManageAcceptDocValidate.php new file mode 100644 index 000000000..a471611ef --- /dev/null +++ b/app/adminapi/validate/manage_communication/ManageAcceptDocValidate.php @@ -0,0 +1,137 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'abstract' => 'require', + 'send_company' => 'require', + 'send_date' => 'require|dateFormat:Y-m-d', + 'accept_date' => 'dateFormat:Y-m-d', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'code' => '编号', + 'abstract' => '内容摘要', + 'send_company' => '发文单位', + 'send_date' => '发文日期', + 'accept_user' => '收文人', + 'accept_date' => '收文日期', + 'read_user' => '传阅人', + 'remark' => '备注', + ]; + + + /** + * @notes 添加场景 + * @return ManageAcceptDocValidate + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function sceneAdd() + { + return $this->only(['project_id','code','abstract','send_company','send_date','accept_user','accept_date','read_user','remark','annex']); + } + + + /** + * @notes 编辑场景 + * @return ManageAcceptDocValidate + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function sceneEdit() + { + return $this->only(['id','project_id','code','abstract','send_company','send_date','accept_user','accept_date','read_user','remark','annex']); + } + + + /** + * @notes 删除场景 + * @return ManageAcceptDocValidate + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ManageAcceptDocValidate + * @author likeadmin + * @date 2024/03/07 16:46 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ManageAcceptDoc::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value): bool|string + { + $data = ManageProject::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/manage_communication/ManageSendDocValidate.php b/app/adminapi/validate/manage_communication/ManageSendDocValidate.php new file mode 100644 index 000000000..f64ab56d0 --- /dev/null +++ b/app/adminapi/validate/manage_communication/ManageSendDocValidate.php @@ -0,0 +1,136 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'abstract' => 'require', + 'send_date' => 'require|dateFormat:Y-m-d', + 'send_company' => 'require', + 'send_user' => 'require', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'code' => '编号', + 'abstract' => '内容摘要', + 'send_date' => '发文日期', + 'send_company' => '发文单位', + 'send_user' => '发文人', + 'accept_user' => '签收人', + 'remark' => '备注', + ]; + + + /** + * @notes 添加场景 + * @return ManageSendDocValidate + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function sceneAdd() + { + return $this->only(['project_id','code','abstract','send_date','send_company','send_user','accept_user','remark','annex']); + } + + + /** + * @notes 编辑场景 + * @return ManageSendDocValidate + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function sceneEdit() + { + return $this->only(['id','project_id','code','abstract','send_date','send_company','send_user','accept_user','remark','annex']); + } + + + /** + * @notes 删除场景 + * @return ManageSendDocValidate + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ManageSendDocValidate + * @author likeadmin + * @date 2024/03/07 17:15 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ManageSendDoc::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value): bool|string + { + $data = ManageProject::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/manage_invest/ManageEngineeringChangesValidate.php b/app/adminapi/validate/manage_invest/ManageEngineeringChangesValidate.php new file mode 100644 index 000000000..95702151e --- /dev/null +++ b/app/adminapi/validate/manage_invest/ManageEngineeringChangesValidate.php @@ -0,0 +1,134 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'date' => 'require|dateFormat:Y-m-d', + 'position' => 'require', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'code' => '编号', + 'date' => '变更日期', + 'position' => '变更及洽商部位', + 'drawing_number' => '图纸号', + 'overview' => '变更及洽商概述', + 'sign_info' => '监理签认情况', + 'remark' => '备注', + ]; + + + /** + * @notes 添加场景 + * @return ManageEngineeringChangesValidate + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function sceneAdd() + { + return $this->only(['project_id','date','position','drawing_number','overview','sign_info','remark','annex']); + } + + + /** + * @notes 编辑场景 + * @return ManageEngineeringChangesValidate + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function sceneEdit() + { + return $this->only(['id','project_id','date','position','drawing_number','overview','sign_info','remark','annex']); + } + + + /** + * @notes 删除场景 + * @return ManageEngineeringChangesValidate + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ManageEngineeringChangesValidate + * @author likeadmin + * @date 2024/03/07 15:21 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ManageEngineeringChanges::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value): bool|string + { + $data = ManageProject::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/manage_invest/ManageMeteredPaymentValidate.php b/app/adminapi/validate/manage_invest/ManageMeteredPaymentValidate.php new file mode 100644 index 000000000..0f3299c6e --- /dev/null +++ b/app/adminapi/validate/manage_invest/ManageMeteredPaymentValidate.php @@ -0,0 +1,127 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'date' => 'require|dateFormat:Y-m', + 'month_amount' => 'require|float|gt:0', + 'month_pay' => 'require|float|gt:0', + 'create_user' => 'require', + 'create_time' => 'require|dateFormat:Y-m-d H:i:s', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'date' => '年月', + 'month_amount' => '本月完成(万元)', + 'month_pay' => '本月支付(万元)', + 'remark' => '备注', + 'create_user' => '填报人', + 'create_time' => '填报时间', + ]; + + + /** + * @notes 添加场景 + * @return ManageMeteredPaymentValidate + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function sceneAdd() + { + return $this->only(['project_id','date','month_amount','month_pay','remark','create_user','create_time']); + } + + + /** + * @notes 编辑场景 + * @return ManageMeteredPaymentValidate + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function sceneEdit() + { + return $this->only(['id','project_id','date','month_amount','month_pay','remark','create_user','create_time']); + } + + + /** + * @notes 删除场景 + * @return ManageMeteredPaymentValidate + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ManageMeteredPaymentValidate + * @author likeadmin + * @date 2024/03/07 14:27 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ManageMeteredPayment::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value): bool|string + { + $data = ManageProject::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '项目信息不存在'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/manage_progress/ManageMonthlyProgressReportValidate.php b/app/adminapi/validate/manage_progress/ManageMonthlyProgressReportValidate.php new file mode 100644 index 000000000..5929a9b13 --- /dev/null +++ b/app/adminapi/validate/manage_progress/ManageMonthlyProgressReportValidate.php @@ -0,0 +1,144 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'date' => 'require|dateFormat:Y-m', + 'progress' => 'require|float', + 'status' => 'require|checkStatus', + 'annex' => 'checkAnnex', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + 'date' => '年月', + 'progress' => '累计工程进度', + 'status' => '工程状态', + 'problem' => '存在问题', + 'desc' => '进度描述', + 'remark' => '备注', + ]; + + + /** + * @notes 添加场景 + * @return ManageMonthlyProgressReportValidate + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function sceneAdd() + { + return $this->only(['project_id','date','progress','status','problem','desc','remark','annex']); + } + + + /** + * @notes 编辑场景 + * @return ManageMonthlyProgressReportValidate + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function sceneEdit() + { + return $this->only(['id','project_id','date','progress','status','problem','desc','remark','annex']); + } + + + /** + * @notes 删除场景 + * @return ManageMonthlyProgressReportValidate + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ManageMonthlyProgressReportValidate + * @author likeadmin + * @date 2024/03/07 15:57 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ManageMonthlyProgressReport::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value): bool|string + { + $data = ManageProject::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '项目信息不存在'; + } + return true; + } + + public function checkStatus($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/manage_basic/ManageCompany.php b/app/common/model/manage_basic/ManageCompany.php new file mode 100644 index 000000000..211624629 --- /dev/null +++ b/app/common/model/manage_basic/ManageCompany.php @@ -0,0 +1,38 @@ +column('name','value'); + return !empty($data['type']) ? $dict[$data['type']] : ''; + } +} \ No newline at end of file diff --git a/app/common/model/manage_basic/ManageCompanyContacts.php b/app/common/model/manage_basic/ManageCompanyContacts.php new file mode 100644 index 000000000..75b816069 --- /dev/null +++ b/app/common/model/manage_basic/ManageCompanyContacts.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 diff --git a/app/common/model/manage_communication/ManageAcceptDoc.php b/app/common/model/manage_communication/ManageAcceptDoc.php new file mode 100644 index 000000000..956434ab6 --- /dev/null +++ b/app/common/model/manage_communication/ManageAcceptDoc.php @@ -0,0 +1,47 @@ +column('name','value'); + return !empty($data['status']) ? $dict[$data['status']] : ''; + } + + public function getDateAttr($value): string + { + return !empty($value) ? date('Y-m', $value) : ''; + } + + public function getAnnexAttr($value) + { + return !empty($value) ? json_decode($value,true) : ''; + } + +} \ No newline at end of file