Exemple #1
0
        public object Roomis(FoWoSoft.Data.Model.WorkFlowExecute.Execute execute)
        {
            var meetInfo = new FoWoSoft.Platform.MeetInfo().GetByTemp3(execute.InstanceID);

            if (meetInfo == null)
            {
                return(null);
            }
            string roomisId = meetInfo.temp1;//会议id;

            // var meetMsg = $" 您申请的会议名称:{meetInfo.temp2};会议地址:{meetInfo.MeetName},";

            if (WebForm.Common.Tools.CheckBack(execute.ExecuteType, execute.StepID))

            {
                put_reject(roomisId, execute.Sender.Account);

                // 申请失败:您申请的会议名称:***;会议地址:****,审核结果:没有通过:审核人:****;审核意见:****
                var msg = string.Format(DuanxinService.DuanxinSendMsg3, meetInfo.temp2, meetInfo.MeetName, execute.Sender.Name, execute.Comment);
                //$" 申请失败:{meetMsg}审核结果:没有通过:审核人:{execute.Sender.Name},审核意见:{execute.Comment}";
                //20180110短信发送
                // duanxinService.smsSend(execute.Sender.Account, msg);
                //发给审请人
                duanxinService.Sendapplication(execute.InstanceID, msg);
            }
            else if (execute.ExecuteType == FoWoSoft.Data.Model.WorkFlowExecute.EnumType.ExecuteType.Completed)
            {
                var tasks        = new FoWoSoft.Platform.WorkFlowTask().GetAll();
                var installTasks = tasks.Where(s => s.InstanceID.ToString().Equals(execute.InstanceID, StringComparison.OrdinalIgnoreCase) && s.Status == 0);


                string remarks = execute.Comment;
                put_approve(roomisId, execute.Sender.Account, remarks);
                //申请成功:您申请的会议名称:***;会议地址:****,已审核完毕,可以使用。
                var msg = string.Format(DuanxinService.DuanxinSendMsg2, meetInfo.temp2, meetInfo.MeetName);
                //var msg = $"申请成功:{meetMsg}已审核完毕,可以使用。" ;
                //20180110短信发送
                //anxinService.smsSend(execute.Sender.Account, msg+ "请查看");
                //发给审请人
                duanxinService.Sendapplication(execute.InstanceID, msg);
            }
            else
            {
                SendStep(roomisId, execute.InstanceID, meetInfo);
            }
            return(1);
        }
Exemple #2
0
 public void backEnd(FoWoSoft.Data.Model.WorkFlowExecute.Execute execute)
 {
     if (WebForm.Common.Tools.CheckBack(execute.ExecuteType, execute.StepID))
     {
         var taskall      = new FoWoSoft.Platform.WorkFlowTask().GetAll();
         var installTasks = taskall.Where(s => s.InstanceID.ToString().Equals(execute.InstanceID, StringComparison.OrdinalIgnoreCase));
         foreach (var item in installTasks)
         {
             if (item.Status < 2)
             {
                 new FoWoSoft.Platform.WorkFlowTask().Completed(item.ID);
             }
         }
         Response.Write("<script type=\"text/javascript\">top.getTaskCount();top.mainTab.closeTab();</script>");
         Response.End();
     }
 }
Exemple #3
0
        /// <summary>
        /// 每一步的会议审核
        /// </summary>
        /// <param name="eventId"></param>
        /// <param name="apperot"></param>
        /// <returns></returns>
        public static string SendStep(string eventId, string install)
        {
            var tasks        = new FoWoSoft.Platform.WorkFlowTask().GetAll();
            var installTasks = tasks.Where(s => s.InstanceID.ToString().Equals(install, StringComparison.OrdinalIgnoreCase)).OrderByDescending(s => s.Sort).Take(2);

            string[] remarks = new string[] { "待处理", "打开", "中间完成", "退回", "他人已处理", "他人已退回" };
            foreach (var item in installTasks)
            {
                var    approver = new FoWoSoft.Platform.Users().Get(item.ReceiveID).Account;
                var    remark   = (item.Status > -1 && item.Status < 6) ? remarks[item.Status] : "";
                string data     = JsonConvert.SerializeObject(new
                {
                    approver = approver,
                    status   = "PENDING",
                    remarks  = remark
                });
                string address = "api/booking/events/{0}/approval";
                Put_Roomis(eventId, address, data);
            }
            return("1");
        }
Exemple #4
0
        /// <summary>
        /// 每一步的会议审核
        /// </summary>
        /// <param name="eventId"></param>
        /// <param name="apperot"></param>
        /// <returns></returns>
        public string SendStep(string eventId, string instanceid, FoWoSoft.Data.Model.MeetInfo meetInfo)
        {
            var meetMsg = $" 您申请的会议名称:{meetInfo.temp2};会议地址:{meetInfo.MeetName},";

            var userInfoEdu = new EduWebService().GetUser(meetInfo.ApplicatId);

            if (userInfoEdu == null)
            {
                return(null);
            }

            var tasks        = new FoWoSoft.Platform.WorkFlowTask().GetAll();
            var installTasks = tasks.Where(s => s.InstanceID.ToString().Equals(instanceid, StringComparison.OrdinalIgnoreCase) && s.Status == 0);

            string[] remarks = new string[] { "请审核", "打开", "中间完成", "退回", "他人已处理", "他人已退回" };
            var      n       = 0;

            foreach (var item in installTasks)
            {
                var task = tasks.FirstOrDefault(s => s.ID == item.PrevID);
                if (n == 0)//发给审请人
                {
                    if (task != null)
                    {
                        //申请过程:您申请的会议名称:***;会议地址:****,****(部门)申请通过。
                        duanxinService.Sendapplication(instanceid, string.Format(DuanxinService.DuanxinSendMsg1, meetInfo.temp2, meetInfo.MeetName, task.StepName));
                    }
                }
                n++;
                var    approver = new FoWoSoft.Platform.Users().Get(item.ReceiveID).Account;
                var    remark   = (item.Status > -1 && item.Status < 6) ? remarks[item.Status] : "";
                string data     = JsonConvert.SerializeObject(new
                {
                    approver = approver,
                    status   = "PENDING",
                    remarks  = remark
                });
                string address = "api/booking/events/{0}/approval";
                //由*** 部门,***(人名),申请的会议名称为:****会议申请,需要您审核。
                FoWoSoft.Platform.Log.Add1(string.Format("各部门({0})", item.StepName + userInfoEdu.BMMC + userInfoEdu.XM + meetInfo.temp2), data, FoWoSoft.Platform.Log.Types.其它分类);


                //20180110短信发送

                if (item.StepName == "信息办")
                {
                    //由*** 部门,***(人名),申请的会议名称为:****会议申请已通过,请确认并提供相关支持。
                    duanxinService.Sendapplication(instanceid, string.Format(DuanxinService.DuanxinSendMsg6, userInfoEdu.BMMC, userInfoEdu.XM, meetInfo.MeetName, meetInfo.temp2, meetInfo.MeetTimes));
                }
                else if (item.StepName.Contains("各部门"))
                {
                    var prevName = tasks.FirstOrDefault(s => s.ID == item.PrevID).StepName;

                    duanxinService.smsSend(approver, string.Format(DuanxinService.DuanxinSendMsg5, userInfoEdu.BMMC, userInfoEdu.XM, meetInfo.MeetName, meetInfo.temp2, meetInfo.MeetTimes, prevName));
                }
                else
                {
                    duanxinService.smsSend(approver, string.Format(DuanxinService.DuanxinSendMsg4, userInfoEdu.BMMC, userInfoEdu.XM, meetInfo.MeetName, meetInfo.temp2, meetInfo.MeetTimes));
                }

                Put_Roomis(eventId, address, data);
            }

            return("1");
        }