|
@@ -30,46 +30,62 @@ class TaskValidate extends Validate
|
|
|
];
|
|
|
|
|
|
protected $message = [
|
|
|
- 'id.require'=>['0' => 200000, '1'=>'传参错误'],
|
|
|
- 'id.integer'=>['0' => 200001, '1'=>'传参错误'],
|
|
|
- 'id.gt'=>['0' => 200002, '1'=>'传参错误'],
|
|
|
+ 'id' => [
|
|
|
+ 'require'=>['0' => 200000, '1'=>'传参错误'],
|
|
|
+ 'integer'=>['0' => 200001, '1'=>'传参错误'],
|
|
|
+ 'gt'=>['0' => 200002, '1'=>'传参错误'],
|
|
|
+ ],
|
|
|
+ 'pageNum' => [
|
|
|
+ 'require'=>['0' => 200100, '1'=>'页码不能为空'],
|
|
|
+ 'integer'=>['0' => 200101, '1'=>'页码必须为整数'],
|
|
|
+ 'gt'=>['0' => 200102, '1'=>'页码必须大于0'],
|
|
|
+ ],
|
|
|
+ 'pageSize' => [
|
|
|
+ 'require'=>['0' => 200200, '1'=>'每页显示数量不能为空'],
|
|
|
+ 'integer'=>['0' => 200201, '1'=>'每页显示数量必须为整数'],
|
|
|
+ 'gt'=>['0' => 200202, '1'=>'每页显示数量必须大于0'],
|
|
|
+ ],
|
|
|
+ 'task_class' => [
|
|
|
+ 'require' => ['0' => 200300, '1' => '任务类别不能为空'],//任务列表:例行监测 专项监测
|
|
|
+ 'in' => ['0' => 200301, '1' => '任务类别错误'],
|
|
|
+ ],
|
|
|
+ 'year' => [
|
|
|
+ 'require'=>['0' => 200400, '1'=>'任务年度不能为空'],//年度
|
|
|
+ 'date'=>['0' => 200401, '1'=>'任务年度格式错误'],
|
|
|
+ ],
|
|
|
+ 'ispublic' => [
|
|
|
+ 'require'=>['0' => 200500, '1'=>'任务状态不能为空'],//任务状态:0:未发布,1:执行中,2:已结束未完成,3:已结束已完成
|
|
|
+ 'in'=>['0' => 200501, '1'=>'任务状态选择错误'],
|
|
|
+ ],
|
|
|
+ 'starttime' => [
|
|
|
+ 'require'=>['0' => 200600, '1'=>'任务开始时间不能为空'],//任务开始时间
|
|
|
+ 'in'=>['0' => 200601, '1'=>'任务开始时间格式错误'],
|
|
|
+ ],
|
|
|
+ 'endtime' => [
|
|
|
+ 'require'=>['0' => 200600, '1'=>'任务结束时间不能为空'],//任务结束时间
|
|
|
+ 'in'=>['0' => 200601, '1'=>'任务结束时间格式错误'],
|
|
|
+ ],
|
|
|
+ 'task_name' => [
|
|
|
+ 'require'=>['0' => 200800, '1'=>'任务名称不能为空'],//任务名称
|
|
|
+ 'chsDash'=>['0' => 200801, '1'=>'任务名称只能是汉字、字母、数字和下划线_及破折号-'],//任务名称
|
|
|
+ 'length'=>['0' => 200802, '1'=>'任务名称长度在4至50个字符之间'],//任务名称
|
|
|
+ ],
|
|
|
+ 'level' => [
|
|
|
+ 'require'=>['0' => 200900, '1'=>'任务优先级不能为空'],//任务优先级,0:一般,1:紧急,2:特急
|
|
|
+ 'in'=>['0' => 200901, '1'=>'任务优先级格式错误'],//任务优先级,0:一般,1:紧急,2:特急
|
|
|
+ ],
|
|
|
+ 'batch' => [
|
|
|
+ 'require'=>['0' => 201000, '1'=>'批次不能为空'],//批次,一季度,二季度,三季度,四季度
|
|
|
+ 'in'=>['0' => 201000, '1'=>'批次格式错误'],
|
|
|
+ ],
|
|
|
+
|
|
|
+ 'main_unit' => [
|
|
|
+ 'require' => ['0' => 201200, '1' => '牵头单位不能为空'],//牵头单位
|
|
|
+ ],
|
|
|
+
|
|
|
+ // 'releaser.require'=>['0' => 201100, '1'=>'发布单位不能为空'], //发布单位/
|
|
|
+ //'releaser.in'=>['0' => 201101, '1'=>'发布单位禁止填写'], //发布单位/
|
|
|
|
|
|
- 'pageNum.require'=>['0' => 200100, '1'=>'页码不能为空'],
|
|
|
- 'pageNum.integer'=>['0' => 200101, '1'=>'页码必须为整数'],
|
|
|
- 'pageNum.gt'=>['0' => 200102, '1'=>'页码必须大于0'],
|
|
|
-
|
|
|
- 'pageSize.require'=>['0' => 200200, '1'=>'每页显示数量不能为空'],
|
|
|
- 'pageSize.integer'=>['0' => 200201, '1'=>'每页显示数量必须为整数'],
|
|
|
- 'pageSize.gt'=>['0' => 200202, '1'=>'每页显示数量必须大于0'],
|
|
|
-
|
|
|
- 'task_class.require'=>['0' => 200300, '1'=>'任务类别不能为空'],//任务列表:例行监测 专项监测
|
|
|
- 'task_class.in'=>['0' => 200301, '1'=>'任务类别错误'],//任务列表:例行监测 专项监测
|
|
|
-
|
|
|
- 'year.require'=>['0' => 200400, '1'=>'任务年度不能为空'],//年度
|
|
|
- 'year.date'=>['0' => 200401, '1'=>'任务年度格式错误'],//年度
|
|
|
-
|
|
|
- 'ispublic.require'=>['0' => 200500, '1'=>'任务状态不能为空'],//任务状态:0:未发布,1:执行中,2:已结束未完成,3:已结束已完成
|
|
|
- 'ispublic.in'=>['0' => 200501, '1'=>'任务状态选择错误'],//任务状态:0:未发布,1:执行中,2:已结束未完成,3:已结束已完成
|
|
|
-
|
|
|
- 'starttime.require'=>['0' => 200600, '1'=>'任务开始时间不能为空'],//任务开始时间
|
|
|
- 'starttime.date'=>['0' => 200601, '1'=>'任务开始时间格式错误'],//任务开始时间
|
|
|
- 'endtime.require'=>['0' => 200700, '1'=>'任务结束时间不能为空'],//任务结束时间
|
|
|
- 'endtime.date'=>['0' => 200701, '1'=>'任务结束时间格式错误'],//任务结束时间
|
|
|
-
|
|
|
- 'task_name.require'=>['0' => 200800, '1'=>'任务名称不能为空'],//任务名称
|
|
|
- 'task_name.chsDash'=>['0' => 200801, '1'=>'任务名称只能是汉字、字母、数字和下划线_及破折号-'],//任务名称
|
|
|
- 'task_name.length'=>['0' => 200802, '1'=>'任务名称长度在4至50个字符之间'],//任务名称
|
|
|
-
|
|
|
- 'level.require'=>['0' => 200900, '1'=>'任务优先级不能为空'],//任务优先级,0:一般,1:紧急,2:特急
|
|
|
- 'level.in'=>['0' => 200901, '1'=>'任务优先级格式错误'],//任务优先级,0:一般,1:紧急,2:特急
|
|
|
-
|
|
|
- 'batch.require'=>['0' => 201000, '1'=>'批次不能为空'],//批次,第一季度,第二季度,第三季度,第四季度
|
|
|
- 'batch.in'=>['0' => 201000, '1'=>'批次格式错误'],//批次,第一季度,第二季度,第三季度,第四季度
|
|
|
-
|
|
|
- // 'releaser.require'=>['0' => 201100, '1'=>'发布单位不能为空'], //发布单位//todo 固定好的,禁止修改,不需要传参
|
|
|
- //'releaser.in'=>['0' => 201101, '1'=>'发布单位禁止填写'], //发布单位//todo 固定好的,禁止修改,不需要传参
|
|
|
-
|
|
|
- 'main_unit.require'=>['0' => 201200, '1'=>'牵头单位不能为空'],//牵头单位
|
|
|
//'filenum.require'=>['0' => 201300, '1'=>'文件号不能为空'],//文件号---选填
|
|
|
//'log.require'=>['0' => 201400, '1'=>'备注不能为空'],//备注---选填
|
|
|
//'file_url.require'=>['0' => 201500, '1'=>'附件地址不能为空'],//附件地址
|
|
@@ -77,8 +93,8 @@ class TaskValidate extends Validate
|
|
|
];
|
|
|
|
|
|
|
|
|
- // getTaskList 验证场景定义
|
|
|
- public function sceneGetTaskList()
|
|
|
+ // 监管端 获取任务列表 验证场景定义
|
|
|
+ public function sceneSelectJgTaskList()
|
|
|
{
|
|
|
return $this->only(['task_class','pageNum','pageSize','year' ,'ispublic','starttime','endtime'])
|
|
|
->remove('year', 'require')
|
|
@@ -87,20 +103,33 @@ class TaskValidate extends Validate
|
|
|
->remove('endtime', 'require');
|
|
|
}
|
|
|
|
|
|
- public function sceneAddTaskItem()
|
|
|
+ //监管端 添加任务 验证场景定义
|
|
|
+ public function sceneAddJgTaskItem()
|
|
|
{
|
|
|
return $this->only(['task_name', 'level', 'year', 'batch', 'starttime', 'endtime', 'filenum', 'task_class', 'ispublic', 'main_unit']);
|
|
|
}
|
|
|
|
|
|
- public function sceneEditTaskUpdateInfo()
|
|
|
+ // 牵头单位 获取任务列表 验证场景定义
|
|
|
+ public function sceneSelectQtTaskList()
|
|
|
{
|
|
|
- return $this->only(['id','ispublic']);
|
|
|
+ return $this->only(['task_class', 'task_name', 'year', 'ispublic', 'starttime', 'endtime', 'pageNum', 'pageSize'])
|
|
|
+ ->remove('task_name', 'require|length')
|
|
|
+ ->remove('year', 'require')
|
|
|
+ ->remove('ispublic', 'require')
|
|
|
+ ->remove('starttime', 'require')
|
|
|
+ ->remove('endtime', 'require');
|
|
|
}
|
|
|
|
|
|
- protected $scene =[
|
|
|
- //'getTaskList' => ['task_class','pageNum','year' ],
|
|
|
- //'addTaskItem' => ['task_name','level','year','batch','starttime','endtime','filenum','log','file_name','file_url','releaser','task_class','ispublic','main_unit'],
|
|
|
+ public function sceneGetTaskInfo()
|
|
|
+ {
|
|
|
+ return $this->only(['pageNum', 'pageSize', 'task_id'])
|
|
|
+ ->remove('pageSize', 'require');
|
|
|
+ }
|
|
|
|
|
|
- ];
|
|
|
+ //牵头单位 发布任务 验证场景定义
|
|
|
+ public function sceneQtRelease()
|
|
|
+ {
|
|
|
+ return $this->only['task_id'];
|
|
|
+ }
|
|
|
|
|
|
}
|