diff --git a/app/adminapi/controller/project/ProjectAlarmSetController.php b/app/adminapi/controller/project/ProjectAlarmSetController.php new file mode 100644 index 000000000..762487d7b --- /dev/null +++ b/app/adminapi/controller/project/ProjectAlarmSetController.php @@ -0,0 +1,108 @@ +dataLists(new ProjectAlarmSetLists()); + } + + + /** + * @notes 添加项目预警设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function add() + { + $params = (new ProjectAlarmSetValidate())->post()->goCheck('add'); + $result = ProjectAlarmSetLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ProjectAlarmSetLogic::getError()); + } + + + /** + * @notes 编辑项目预警设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function edit() + { + $params = (new ProjectAlarmSetValidate())->post()->goCheck('edit'); + $result = ProjectAlarmSetLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ProjectAlarmSetLogic::getError()); + } + + + /** + * @notes 删除项目预警设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function delete() + { + $params = (new ProjectAlarmSetValidate())->post()->goCheck('delete'); + ProjectAlarmSetLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目预警设置详情 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function detail() + { + $params = (new ProjectAlarmSetValidate())->goCheck('detail'); + $result = ProjectAlarmSetLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/project/ProjectDocumentSetController.php b/app/adminapi/controller/project/ProjectDocumentSetController.php new file mode 100644 index 000000000..364a7f64a --- /dev/null +++ b/app/adminapi/controller/project/ProjectDocumentSetController.php @@ -0,0 +1,108 @@ +dataLists(new ProjectDocumentSetLists()); + } + + + /** + * @notes 添加项目文档设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function add() + { + $params = (new ProjectDocumentSetValidate())->post()->goCheck('add'); + $result = ProjectDocumentSetLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ProjectDocumentSetLogic::getError()); + } + + + /** + * @notes 编辑项目文档设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function edit() + { + $params = (new ProjectDocumentSetValidate())->post()->goCheck('edit'); + $result = ProjectDocumentSetLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ProjectDocumentSetLogic::getError()); + } + + + /** + * @notes 删除项目文档设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function delete() + { + $params = (new ProjectDocumentSetValidate())->post()->goCheck('delete'); + ProjectDocumentSetLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目文档设置详情 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function detail() + { + $params = (new ProjectDocumentSetValidate())->goCheck('detail'); + $result = ProjectDocumentSetLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/controller/project/ProjectProfitSetController.php b/app/adminapi/controller/project/ProjectProfitSetController.php new file mode 100644 index 000000000..0b2032d41 --- /dev/null +++ b/app/adminapi/controller/project/ProjectProfitSetController.php @@ -0,0 +1,108 @@ +dataLists(new ProjectProfitSetLists()); + } + + + /** + * @notes 添加项目利润设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function add() + { + $params = (new ProjectProfitSetValidate())->post()->goCheck('add'); + $result = ProjectProfitSetLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(ProjectProfitSetLogic::getError()); + } + + + /** + * @notes 编辑项目利润设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function edit() + { + $params = (new ProjectProfitSetValidate())->post()->goCheck('edit'); + $result = ProjectProfitSetLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(ProjectProfitSetLogic::getError()); + } + + + /** + * @notes 删除项目利润设置 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function delete() + { + $params = (new ProjectProfitSetValidate())->post()->goCheck('delete'); + ProjectProfitSetLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取项目利润设置详情 + * @return \think\response\Json + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function detail() + { + $params = (new ProjectProfitSetValidate())->goCheck('detail'); + $result = ProjectProfitSetLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/adminapi/lists/project/ProjectAlarmSetLists.php b/app/adminapi/lists/project/ProjectAlarmSetLists.php new file mode 100644 index 000000000..98b7203a9 --- /dev/null +++ b/app/adminapi/lists/project/ProjectAlarmSetLists.php @@ -0,0 +1,93 @@ +request->param(); + $where = []; + if(isset($params['project_name']) && $params['project_name'] != ''){ + $projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id'); + $where[] = ['project_id','in',$projectIds]; + } + return ProjectAlarmSet::where($this->searchWhere)->where($where) + ->field(['id', 'project_id', 'material_budget_expenditure_ratio', 'labour_budget_expenditure_ratio', 'cost_budget_expenditure_ratio', 'subcontract_budget_expenditure_ratio']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($item){ + $project = Project::field('name,project_code')->where('id',$item['project_id'])->findOrEmpty(); + $item['project_name'] = $project['name']; + $item['project_code'] = $project['project_code']; + return $item; + }) + ->toArray(); + } + + + /** + * @notes 获取项目预警设置数量 + * @return int + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function count(): int + { + $params = $this->request->param(); + $where = []; + if(isset($params['project_name']) && $params['project_name'] != ''){ + $projectIds = Project::where('name','like','%'.$params['project_name'].'%')->column('id'); + $where[] = ['project_id','in',$projectIds]; + } + return ProjectAlarmSet::where($this->searchWhere)->where($where)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/project/ProjectDocumentSetLists.php b/app/adminapi/lists/project/ProjectDocumentSetLists.php new file mode 100644 index 000000000..ecba3bca2 --- /dev/null +++ b/app/adminapi/lists/project/ProjectDocumentSetLists.php @@ -0,0 +1,95 @@ + ['is_upload'], + '%like%' => ['large_category', 'middle_category', 'small_category', 'name'], + ]; + } + + + /** + * @notes 获取项目文档设置列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function lists(): array + { + $params = $this->request->param(); + $where = []; + if(isset($params['project_type_name']) && $params['project_type_name'] != ''){ + $projectTypeIds = ProjectTypeSet::where('name','like','%'.$params['project_type_name'].'%')->column('id'); + $where[] = ['project_type_id','in',$projectTypeIds]; + } + return ProjectDocumentSet::where($this->searchWhere)->where($where) + ->field(['id', 'project_type_id', 'large_category', 'middle_category', 'small_category', 'name', 'describe', 'is_upload', 'sort']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($item){ + $projectType = ProjectTypeSet::field('name')->where('id',$item['project_type_id'])->findOrEmpty(); + $item['project_type_name'] = $projectType['name']; + return $item; + }) + ->toArray(); + } + + + /** + * @notes 获取项目文档设置数量 + * @return int + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function count(): int + { + $params = $this->request->param(); + $where = []; + if(isset($params['project_type_name']) && $params['project_type_name'] != ''){ + $projectTypeIds = ProjectTypeSet::where('name','like','%'.$params['project_type_name'].'%')->column('id'); + $where[] = ['project_type_id','in',$projectTypeIds]; + } + return ProjectDocumentSet::where($this->searchWhere)->where($where)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/lists/project/ProjectProfitSetLists.php b/app/adminapi/lists/project/ProjectProfitSetLists.php new file mode 100644 index 000000000..59b9cbe8f --- /dev/null +++ b/app/adminapi/lists/project/ProjectProfitSetLists.php @@ -0,0 +1,94 @@ + ['profit_rate'], + ]; + } + + + /** + * @notes 获取项目利润设置列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function lists(): array + { + $params = $this->request->param(); + $where = []; + if(isset($params['project_type_name']) && $params['project_type_name'] != ''){ + $projectTypeIds = ProjectTypeSet::where('name','like','%'.$params['project_type_name'].'%')->column('id'); + $where[] = ['project_type_id','in',$projectTypeIds]; + } + return ProjectProfitSet::where($this->searchWhere)->where($where) + ->field(['id', 'project_type_id', 'profit_rate', 'remark']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($item){ + $projectType = ProjectTypeSet::field('name')->where('id',$item['project_type_id'])->findOrEmpty(); + $item['project_type_name'] = $projectType['name']; + return $item; + }) + ->toArray(); + } + + + /** + * @notes 获取项目利润设置数量 + * @return int + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function count(): int + { + $params = $this->request->param(); + $where = []; + if(isset($params['project_type_name']) && $params['project_type_name'] != ''){ + $projectTypeIds = ProjectTypeSet::where('name','like','%'.$params['project_type_name'].'%')->column('id'); + $where[] = ['project_type_id','in',$projectTypeIds]; + } + return ProjectProfitSet::where($this->searchWhere)->where($where)->count(); + } + +} \ No newline at end of file diff --git a/app/adminapi/logic/project/ProjectAlarmSetLogic.php b/app/adminapi/logic/project/ProjectAlarmSetLogic.php new file mode 100644 index 000000000..1231d032e --- /dev/null +++ b/app/adminapi/logic/project/ProjectAlarmSetLogic.php @@ -0,0 +1,117 @@ + $params['project_id'], + 'material_budget_expenditure_ratio' => $params['material_budget_expenditure_ratio'], + 'labour_budget_expenditure_ratio' => $params['labour_budget_expenditure_ratio'], + 'cost_budget_expenditure_ratio' => $params['cost_budget_expenditure_ratio'], + 'subcontract_budget_expenditure_ratio' => $params['subcontract_budget_expenditure_ratio'], + ]); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 编辑项目预警设置 + * @param array $params + * @return bool + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ProjectAlarmSet::where('id', $params['id'])->update([ + 'project_id' => $params['project_id'], + 'material_budget_expenditure_ratio' => $params['material_budget_expenditure_ratio'], + 'labour_budget_expenditure_ratio' => $params['labour_budget_expenditure_ratio'], + 'cost_budget_expenditure_ratio' => $params['cost_budget_expenditure_ratio'], + 'subcontract_budget_expenditure_ratio' => $params['subcontract_budget_expenditure_ratio'], + ]); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除项目预警设置 + * @param array $params + * @return bool + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public static function delete(array $params): bool + { + return ProjectAlarmSet::destroy($params['id']); + } + + + /** + * @notes 获取项目预警设置详情 + * @param $params + * @return array + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public static function detail($params): array + { + $data = ProjectAlarmSet::field('id,project_id,material_budget_expenditure_ratio,labour_budget_expenditure_ratio,cost_budget_expenditure_ratio,subcontract_budget_expenditure_ratio')->findOrEmpty($params['id'])->toArray(); + $project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty(); + $data['project_name'] = $project['name']; + $data['project_code'] = $project['project_code']; + return $data; + } +} \ No newline at end of file diff --git a/app/adminapi/logic/project/ProjectDocumentSetLogic.php b/app/adminapi/logic/project/ProjectDocumentSetLogic.php new file mode 100644 index 000000000..38435578d --- /dev/null +++ b/app/adminapi/logic/project/ProjectDocumentSetLogic.php @@ -0,0 +1,122 @@ + $params['project_type_id'], + 'large_category' => $params['large_category'], + 'middle_category' => $params['middle_category'], + 'small_category' => $params['small_category'], + 'name' => $params['name'], + 'describe' => $params['describe'], + 'is_upload' => $params['is_upload'], + 'sort' => $params['sort'], + ]); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 编辑项目文档设置 + * @param array $params + * @return bool + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ProjectDocumentSet::where('id', $params['id'])->update([ + 'project_type_id' => $params['project_type_id'], + 'large_category' => $params['large_category'], + 'middle_category' => $params['middle_category'], + 'small_category' => $params['small_category'], + 'name' => $params['name'], + 'describe' => $params['describe'], + 'is_upload' => $params['is_upload'], + 'sort' => $params['sort'], + ]); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除项目文档设置 + * @param array $params + * @return bool + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public static function delete(array $params): bool + { + return ProjectDocumentSet::destroy($params['id']); + } + + + /** + * @notes 获取项目文档设置详情 + * @param $params + * @return array + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public static function detail($params): array + { + $data = ProjectDocumentSet::field('id,project_type_id,large_category,middle_category,small_category,name,describe,is_upload,sort')->findOrEmpty($params['id'])->toArray(); + $projectType = ProjectTypeSet::field('name')->where('id',$data['project_type_id'])->findOrEmpty(); + $data['project_type_name'] = $projectType['name']; + return $data; + } +} \ No newline at end of file diff --git a/app/adminapi/logic/project/ProjectProfitSetLogic.php b/app/adminapi/logic/project/ProjectProfitSetLogic.php new file mode 100644 index 000000000..5dad1121c --- /dev/null +++ b/app/adminapi/logic/project/ProjectProfitSetLogic.php @@ -0,0 +1,113 @@ + $params['project_type_id'], + 'profit_rate' => $params['profit_rate'], + 'remark' => $params['remark'], + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 编辑项目利润设置 + * @param array $params + * @return bool + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + ProjectProfitSet::where('id', $params['id'])->update([ + 'project_type_id' => $params['project_type_id'], + 'profit_rate' => $params['profit_rate'], + 'remark' => $params['remark'], + ]); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除项目利润设置 + * @param array $params + * @return bool + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public static function delete(array $params): bool + { + return ProjectProfitSet::destroy($params['id']); + } + + + /** + * @notes 获取项目利润设置详情 + * @param $params + * @return array + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public static function detail($params): array + { + $data = ProjectProfitSet::field('id,project_type_id,profit_rate,remark')->findOrEmpty($params['id'])->toArray(); + $projectType = ProjectTypeSet::field('name')->where('id',$data['project_type_id'])->findOrEmpty(); + $data['project_type_name'] = $projectType['name']; + return $data; + } +} \ No newline at end of file diff --git a/app/adminapi/validate/project/ProjectAlarmSetValidate.php b/app/adminapi/validate/project/ProjectAlarmSetValidate.php new file mode 100644 index 000000000..cf6b5f8be --- /dev/null +++ b/app/adminapi/validate/project/ProjectAlarmSetValidate.php @@ -0,0 +1,130 @@ + 'require|checkData', + 'project_id' => 'require|checkProject', + 'material_budget_expenditure_ratio' => 'float|egt:0', + 'labour_budget_expenditure_ratio' => 'float|egt:0', + 'cost_budget_expenditure_ratio' => 'float|egt:0', + 'subcontract_budget_expenditure_ratio' => 'float|egt:0', + ]; + + protected $message = [ + 'project_id.require' => '请选择项目', + 'material_budget_expenditure_ratio.float' => '材料预算花费比例必须是数字', + 'material_budget_expenditure_ratio.egt' => '材料预算花费比例必须大于等于0', + 'labour_budget_expenditure_ratio.float' => '人工预算花费比例必须是数字', + 'labour_budget_expenditure_ratio.egt' => '人工预算花费比例必须大于等于0', + 'cost_budget_expenditure_ratio.float' => '费用预算花费比例必须是数字', + 'cost_budget_expenditure_ratio.egt' => '费用预算花费比例必须大于等于0', + 'subcontract_budget_expenditure_ratio.float' => '分包预算花费比例必须是数字', + 'subcontract_budget_expenditure_ratio.egt' => '分包预算花费比例必须大于等于0', + ]; + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_id' => '项目id', + + ]; + + + /** + * @notes 添加场景 + * @return ProjectAlarmSetValidate + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return ProjectAlarmSetValidate + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return ProjectAlarmSetValidate + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ProjectAlarmSetValidate + * @author likeadmin + * @date 2023/12/14 16:24 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ProjectAlarmSet::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProject($value): bool|string + { + $data = Project::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '项目不存在'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/project/ProjectDocumentSetValidate.php b/app/adminapi/validate/project/ProjectDocumentSetValidate.php new file mode 100644 index 000000000..4bdcd1ef4 --- /dev/null +++ b/app/adminapi/validate/project/ProjectDocumentSetValidate.php @@ -0,0 +1,137 @@ + 'require|checkProjectDoc', + 'project_type_id' => 'require|checkProjectType', + 'large_category' => 'require', + 'middle_category' => 'require', + 'name' => 'require', + 'is_upload' => 'require|in:1,2', + 'sort' => 'require|integer', + ]; + + protected $message = [ + 'id.require' => '缺少必要参数', + 'project_type_id.require' => '请选择项目类型', + 'large_category.require' => '请填写文档大类', + 'middle_category.require' => '请填写文档中类', + 'name.require' => '请填写文档名称', + 'is_upload.require' => '请选择是否必传', + 'is_upload.in' => '是否必传选项数据值错误', + 'sort.require' => '请填写排序码', + 'sort.integer' => '排序码数据格式错误', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_type_id' => '项目类型id', + 'large_category' => '文档大类', + 'middle_category' => '文档中类', + 'name' => '文档名称', + 'is_upload' => '必传 1-是 2-否', + 'sort' => '排序号', + + ]; + + + /** + * @notes 添加场景 + * @return ProjectDocumentSetValidate + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return ProjectDocumentSetValidate + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return ProjectDocumentSetValidate + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ProjectDocumentSetValidate + * @author likeadmin + * @date 2023/12/14 14:26 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkProjectDoc($value): bool|string + { + $data = ProjectDocumentSet::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProjectType($value): bool|string + { + $data = ProjectTypeSet::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '项目类型不存在'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/adminapi/validate/project/ProjectProfitSetValidate.php b/app/adminapi/validate/project/ProjectProfitSetValidate.php new file mode 100644 index 000000000..bc09c806e --- /dev/null +++ b/app/adminapi/validate/project/ProjectProfitSetValidate.php @@ -0,0 +1,124 @@ + 'require|checkData', + 'project_type_id' => 'require|checkProjectType', + 'profit_rate' => 'require|float|egt:0', + ]; + + protected $message = [ + 'id.require' => '缺少必要参数', + 'project_type_id.require' => '请选择项目类型', + 'profit_rate.require' => '请填写最低利润率', + 'profit_rate.float' => '最低利润率必须是数字', + 'profit_rate.egt' => '最低利润率必须大于等于0', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'project_type_id' => '项目类型id', + 'profit_rate' => '最低利润率', + ]; + + + /** + * @notes 添加场景 + * @return ProjectProfitSetValidate + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function sceneAdd() + { + return $this->remove('id',true); + } + + + /** + * @notes 编辑场景 + * @return ProjectProfitSetValidate + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function sceneEdit() + {} + + + /** + * @notes 删除场景 + * @return ProjectProfitSetValidate + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return ProjectProfitSetValidate + * @author likeadmin + * @date 2023/12/14 15:39 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + + public function checkData($value): bool|string + { + $data = ProjectProfitSet::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '数据不存在'; + } + return true; + } + + public function checkProjectType($value): bool|string + { + $data = ProjectTypeSet::where('id',$value)->findOrEmpty(); + if($data->isEmpty()){ + return '项目类型不存在'; + } + return true; + } + +} \ No newline at end of file diff --git a/app/common/model/project/ProjectAlarmSet.php b/app/common/model/project/ProjectAlarmSet.php new file mode 100644 index 000000000..5366e9f10 --- /dev/null +++ b/app/common/model/project/ProjectAlarmSet.php @@ -0,0 +1,34 @@ +