作者 景龙
1 个管道 的构建 通过 耗费 29 秒

新增月检消息推送

... ... @@ -87,6 +87,19 @@ return array (
//月检乙方发起,提醒甲方领导
'check_content_add_b' => '乙方发起一个月检申请,等待您前往审批',
//月检乙方重新发起(被甲方领导驳回后),提醒甲方领导
'check_content_again_b' => '乙方重新发起一个月检申请,等待您前往审批',
//月检甲方领导确认,提醒甲乙方员工
'check_content_confirm_l' => '甲方领导已确认信息,等待完善月检单',
//月检甲方领导驳回,提醒乙方发起员工
'check_content_reject_l' => '甲方领导已驳回信息,等待您重新发起申请',
//月检乙方确认完成,提醒甲乙方领导
'check_content_finish' => '乙方验收完成,月检完成',
//甲方提交报修流程
'a_step' => ['甲方提交报修信息','乙方确认信息','乙方维修设备','乙方提交维修单','甲方验收维修结果','甲方验收完成'],
... ...
... ... @@ -88,6 +88,17 @@ class CheckController extends RestBaseController
$checkModel = new CheckModel();
$res = $checkModel->create($data);
if($res){
//极光推送
//乙方发起,提醒甲方领导
$user_ids = $common->getLeaderA($data['project_id'],'a_cid');
$content = config('site.check_content_add_b');
$registration_id = $common->getPushUsers($user_ids);
if($registration_id){
$common = new CommonController();
$title = config('site.title');
$common->pushMessage($registration_id,$content,$title);
}
$this->success('月检信息提交成功');
}else{
$this->error('失败');
... ... @@ -161,6 +172,20 @@ class CheckController extends RestBaseController
$common = new CommonController();
$field = 'id,ins_m_time,address,a_uid,remark';
$res = $common->getCheckById(['id'=>$id,'status'=>1],$field);
//极光推送
//乙方重新发起,提醒甲方领导
$project = $common->getProjectId('check',['id'=>$id],'id,project_id');
$user_ids = $common->getUserA($project['project_id'],'a_cid');
$content = config('site.check_content_again_b');
$registration_id = $common->getPushUsers($user_ids);
if($registration_id){
$common = new CommonController();
$title = config('site.title');
$common->pushMessage($registration_id,$content,$title);
}
$this->success('成功',$res);
}else{
$this->error('请求方式错误!');
... ... @@ -347,6 +372,18 @@ class CheckController extends RestBaseController
];
$res = $checkModel->where(['id'=>$data['id'],'status'=>2])->update($data1);
if($res){
//极光推送,推送甲乙方领导
$project = $common->getProjectId('check',['id'=>$data['id']],'id,project_id');
$user_ids = $common->getLeadersId($project['project_id']);
$content = config('site.check_content_finish');
$registration_id = $common->getPushUsers($user_ids);
if($registration_id){
$common = new CommonController();
$title = config('site.title');
$common->pushMessage($registration_id,$content,$title);
}
$this->success('成功');
}else{
$this->error('失败');
... ...
... ... @@ -200,6 +200,18 @@ class InformationController extends RestBaseController
$checkModel = new CheckModel();
$res = $checkModel->where(['id'=>$id,'status'=>0])->update(['a_leader'=>$this->userId,'status'=>2,'l_confirm_time'=>time()]);
if($res){
//推送
//月检,甲方领导确认,提醒甲乙方员工
$project = $common->getProjectId('check',['id'=>$id],'id,project_id');
$user_ids = $common->getStaffId($project['project_id']);
$content = config('site.check_content_confirm_l');
$registration_id = $common->getPushUsers($user_ids);
if($registration_id){
$common = new CommonController();
$title = config('site.title');
$common->pushMessage($registration_id,$content,$title);
}
$this->success('成功');
}else{
$this->error('失败');
... ... @@ -312,6 +324,18 @@ class InformationController extends RestBaseController
];
$res = $checkModel->where(['id'=>$id,'status'=>0])->update($data);
if($res){
//推送
//月检,甲方领导驳回,提醒乙方发起员工
$user_ids = $common->getUserA('check',$id);
$content = config('site.check_content_reject_l');
$registration_id = $common->getPushUsers($user_ids);
if($registration_id){
$common = new CommonController();
$title = config('site.title');
$common->pushMessage($registration_id,$content,$title);
}
$this->success('成功');
}else{
$this->error('失败');
... ...