Exemplo n.º 1
0
        public void SetUseinfoTest()
        {
            var webservice = new EduWebService();
            var id         = "20121102";
            var mobile     = "";
            var result     = webservice.SetUseinfo(id, mobile);

            Assert.AreEqual("添加成功", result.Rows[0][0]);
        }
Exemplo n.º 2
0
        public void GetUseinfoTest()
        {
            var webservice = new EduWebService();
            var id         = "20121102";
            //var id = "20171001";
            // var result = webservice.GetUseinfo(id);
            var mobile = webservice.GetMobile(id);

            //Assert.AreEqual("", result.Rows[0]["mobile"]);
            Assert.IsNull(mobile);
            //Assert.Fail();
        }
Exemplo n.º 3
0
        public FoWoSoft.Data.Model.Users CreateNewUser(string userid)
        {
            var user = new FoWoSoft.Platform.Users().GetByAccount(userid);

            if (user != null)
            {
                return(user);
            }

            //根据UserId获取从远程用户信息
            var userInfoEdu = new EduWebService().GetUser(userid);

            if (userInfoEdu == null)
            {
                return(null);
            }
            //更新用户信息
            user = new FoWoSoft.Data.Model.Users()
            {
                Account  = userid,
                ID       = Guid.NewGuid(),
                Name     = userInfoEdu.XM,
                Status   = 0,
                Password = "******",
                Sort     = 1,
                Note     = ""
            };

            new FoWoSoft.Platform.Users().Add(user);
            //创建组织关系
            var guidId = new FoWoSoft.Platform.Guid_id().Get(userInfoEdu.BMBH);

            new FoWoSoft.Platform.UsersRelation().Add(new FoWoSoft.Data.Model.UsersRelation()
            {
                OrganizeID = guidId.GuidId,
                UserID     = user.ID,
                Sort       = 1,
                IsMain     = 1
            });
            //更新组织下人员的个数
            new FoWoSoft.Platform.Organize().UpdateChildsLength(guidId.GuidId);
            //创建用户角色
            new FoWoSoft.Platform.UsersRole().Add(new FoWoSoft.Data.Model.UsersRole()
            {
                RoleID    = Guid.Parse("0CF2ABB1-5F90-4FB3-8FA9-B53628B92879"),
                MemberID  = user.ID,
                IsDefault = true
            });
            return(user);
        }
Exemplo n.º 4
0
        public void CreateUser(string number1)
        {
            var users = new EduWebService().GetAllUserByDPCODE(number1);

            FoWoSoft.Platform.Log.Add1(users.Rows.Count.ToString(), number1, FoWoSoft.Platform.Log.Types.其它分类);

            if (users.Columns.Count > 1 && users.Rows.Count > 0)
            {
                for (int j = 0; j < users.Rows.Count; j++)
                {
                    CreateNewUser(users.Rows[j][0].ToString());
                }
            }
        }
Exemplo n.º 5
0
        //发送短信sms
        public void smsSend(string account, string msg)
        {
            FoWoSoft.Platform.Log.Add1($"发送短信前账号1:{account},信息:{msg}", msg, FoWoSoft.Platform.Log.Types.其它分类);

            //根据UserId获取从远程用户信息
            var telephone = new EduWebService().GetMobile(account);

            if (string.IsNullOrWhiteSpace(telephone))
            {
                return;
            }

            var result = ecnuweb.WaitSMSSend(telephone, msg);

            FoWoSoft.Platform.Log.Add1($"{telephone}发送短信:{msg},结果:{result}", msg, FoWoSoft.Platform.Log.Types.其它分类);
        }
Exemplo n.º 6
0
        public void CreateNewTempTestMeet(FoWoSoft.Data.Model.MeetInfo meetInfot)
        {
            MeetInfoModel meetInfo = meetInfot as MeetInfoModel;
            string        testMeetid;

            meetInfoService.RoomisUpdate(meetInfo, out testMeetid);
            var tempmeet = Common.Tools.MeetInfoToTempTestMeet(meetInfo, testMeetid);

            new FoWoSoft.Platform.TempTestMeet().RoomisAdd(tempmeet);

            var aplicatUser = new FoWoSoft.Platform.Users().GetByAccount(meetInfo.ApplicatId);
            var adminUser   = new FoWoSoft.Platform.Users().GetByAccount(meetInfo.AdminId);
            var task        = new FoWoSoft.Data.Model.WorkFlowTask
            {
                InstanceID = testMeetid,
                Title      = meetInfo.temp2,

                SenderID    = aplicatUser.ID,
                SenderName  = aplicatUser.Name,
                ReceiveID   = adminUser.ID,
                ReceiveName = adminUser.Name
            };

            new FoWoSoft.Platform.WorkFlowTask().RoomisCreate(task);
            //由***部门,***(人名),申请的会议名称为:****会议申请,需要您审核。
            var userInfoEdu = new EduWebService().GetUser(meetInfo.ApplicatId);

            if (userInfoEdu != null)
            {
                // var meetMsgProgress = $"由{userInfoEdu.BMMC}部门,{userInfoEdu.XM}(人名),申请的会议名称为:{meetInfo.temp2},";
                // var msg = $"{meetMsgProgress}会议申请,需要您审核。";
                var msg = string.Format(DuanxinService.DuanxinSendMsg4, userInfoEdu.BMMC, userInfoEdu.XM, meetInfo.temp2);


                //20180110短信发送
                new DuanxinService().smsSend(meetInfo.AdminId, msg);
            }
        }
Exemplo n.º 7
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");
        }