示例#1
0
        public IActionResult AddPmcOrder(AddPmcCheckModel model)
        {
            TRIGHT_USER_ROLE_Da     userroleDa = new TRIGHT_USER_ROLE_Da();
            List <TRIGHT_USER_ROLE> rolelist   = userroleDa.ListVmByUserid(User_Id);

            if (rolelist.Where(s => s.ROLEID == 2).Count() <= 0)
            {
                return(FailMessage("您不是超级管理员,没有工单处理权限"));
            }



            TASM_SUPPORT_PERSONAL_Da personalDa    = new TASM_SUPPORT_PERSONAL_Da();
            TASM_SUPPORT_PERSONAL    personalModel = personalDa.SelectByWhere(model.SID, (int)SupportendPoint.分析完成_售后内勤维护);

            model.PERSONALID = personalModel.ID;


            Facade.PmcOrderFacade facade = new PmcOrderFacade();

            if (!facade.Create(model))
            {
                return(FailMessage(facade.Msg));
            }
            return(SuccessMessage("处理成功!"));
        }
示例#2
0
        public IActionResult AddPmcOrder(AddPmcCheckModel model)
        {
            PmcOrderFacade facade = new PmcOrderFacade();

            if (facade.Create(model))
            {
                return(FailMessage("处理失败!"));
            }
            return(SuccessMessage("处理成功!"));
        }
示例#3
0
        /// <summary>
        /// 消息推送表
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sid"></param>
        /// <returns></returns>
        private bool InsertPush(AddPmcCheckModel model, int tid)
        {
            if (model.Push == null)
            {
                return(true);
            }

            TASM_SUPPORT_PUSH_Da da        = new TASM_SUPPORT_PUSH_Da();
            TASM_SUPPORT_PUSH    pushModel = new TASM_SUPPORT_PUSH()
            {
                SID        = model.SID,
                CC         = model.Push.CC,
                CONDUCTOR  = model.Push.CONDUCTOR,
                CONTENT    = model.Push.CONTENT,
                CREATETIME = DateTime.Now,
                POINT      = (int)Entites.SupportHisType.技术处理,
                STATUS     = 0,
                TID        = tid
            };

            return(da.CurrentDb.Insert(pushModel));
        }
示例#4
0
        public bool Create(AddPmcCheckModel model)
        {
            TASM_SUPPORT_PMC_Da manager = new TASM_SUPPORT_PMC_Da();

            try
            {
                manager.Db.BeginTran();

                int pmcId = 0;
                //1,添加 PMC处理表数据
                if (!InsertPmc(model, manager, ref pmcId))
                {
                    this.Msg = "创建PMC处理信息失败!";
                    manager.Db.RollbackTran();
                    return(false);
                }



                TASM_SUPPORT_Da support_manager = new TASM_SUPPORT_Da();
                var             supportModel    = support_manager.CurrentDb.GetById(model.SID); //工单id 查询工单信息

                //2,当前处理人员发生修改,新增一条 修改记录 history
                if (!InsertHistory(model, manager, supportModel, pmcId, model.SUPPORTSTATUS, model.NEXTUSER))
                {
                    this.Msg = "创建操作历史失败!";
                    manager.Db.RollbackTran();
                    return(false);
                }



                //3,新的处理人员再新增一条 处理信息(顺序不能变) 取了工单处理人,为个人处理表的创建人,顺序不能变
                if (!InsertPersonal(supportModel.CONDUCTOR, model.NEXTUSER, model.SUPPORTSTATUS, model.SID))
                {
                    this.Msg = "分发工单失败!";
                    manager.Db.RollbackTran();
                    return(false);
                }


                //4,修改工单表的状态
                if (!UpdateSupport(supportModel, support_manager, model.NEXTUSER, model.SUPPORTSTATUS, pmcId))
                {
                    this.Msg = "修改工单信息失败!";
                    manager.Db.RollbackTran();
                    return(false);
                }


                //5,修改个人信息处理表
                if (!UpdatePersonal(model.PERSONALID))
                {
                    this.Msg = "修改个人处理状态失败!";
                    manager.Db.RollbackTran();
                    return(false);
                }



                //6,添加推送消息
                if (!InsertPush(model, pmcId))
                {
                    this.Msg = "修改个人处理状态失败!";
                    manager.Db.RollbackTran();
                    return(false);
                }

                //7,发送通知
                if (!PushMessage(model.SID, support_manager))
                {
                    Logger.LogInformation("推送消息失败");
                    manager.Db.RollbackTran();
                    return(false);
                }

                manager.Db.CommitTran();

                return(true);
            }
            catch (Exception e)
            {
                manager.Db.RollbackTran();
                return(false);
            }
        }