Exemplo n.º 1
0
        public IActionResult GetSiteInfo(int id)
        {
            DataAccess.TASM_SUPPORT_SITE_Da manager = new DataAccess.TASM_SUPPORT_SITE_Da();
            TASM_SUPPORT_SITE model = manager.CurrentDb.GetById(id);

            return(SuccessResult(model));
        }
Exemplo n.º 2
0
        public bool Create(AddSiteCheckModel model)
        {
            DataAccess.TASM_SUPPORT_SITE_Da manager = new DataAccess.TASM_SUPPORT_SITE_Da();

            try
            {
                manager.Db.BeginTran();


                //1,添加现场处理表数据,
                int siteId = 0;

                if (!InsertSite(model, manager, ref siteId))
                {
                    this.Msg = "创建现场处理信息失败!";
                    manager.Db.RollbackTran();
                    return(false);
                }


                //2,当前处理人员发生修改,新增一条 修改记录 history
                DataAccess.TASM_SUPPORT_Da support_manager = new DataAccess.TASM_SUPPORT_Da();
                var supportModel = support_manager.CurrentDb.GetById(model.SID);  //工单id 查询工单信息

                if (!InsertHistory(model, supportModel, siteId, 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, siteId))
                {
                    this.Msg = "修改工单状态失败!";
                    manager.Db.RollbackTran();
                    return(false);
                }

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



                //6,添加推送消息
                if (!InsertPush(model, siteId))
                {
                    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);
            }
        }