Example #1
0
        public IActionResult GetDisposerInfo(int id)
        {
            DataAccess.TASM_SUPPORT_DISPOSER_Da manager = new DataAccess.TASM_SUPPORT_DISPOSER_Da();
            TASM_SUPPORT_DISPOSER model = manager.CurrentDb.GetById(id);

            return(SuccessResult(model));
        }
Example #2
0
        public bool Create(AddDisposerModel model)
        {
            DataAccess.TASM_SUPPORT_DISPOSER_Da disposer_manager = new DataAccess.TASM_SUPPORT_DISPOSER_Da();

            try
            {
                Logger.LogInformation("=========创建技术处理=========");

                disposer_manager.Db.BeginTran();

                int disposerId = 0;

                //1.创建技术人员处理表信息
                if (!InsertDisposer(disposer_manager, model, ref disposerId))
                {
                    Logger.LogInformation("创建技术人员处理信息失败");
                    this.Msg = "创建技术人员处理信息失败!";
                    disposer_manager.Db.RollbackTran();
                    return(false);
                }


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

                if (!InsertHistory(model, supportModel, model.NEXTUSER, model.SUPPORTSTATUS, disposerId))
                {
                    this.Msg = "创建操作历史失败!";
                    Logger.LogInformation("创建操作历史失败");
                    disposer_manager.Db.RollbackTran();
                    return(false);
                }



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



                //4,修改工单表的memberid,memberid为处理表的主键id 此处有先后顺序
                if (!UpdateSupport(supportModel, support_manager, model.NEXTUSER, model.SUPPORTSTATUS, disposerId))
                {
                    this.Msg = "修改工单信息失败!";
                    Logger.LogInformation("修改工单信息失败");
                    disposer_manager.Db.RollbackTran();
                    return(false);
                }


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



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


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

                disposer_manager.Db.CommitTran();

                return(true);
            }
            catch (Exception e)
            {
                Logger.LogInformation("" + e);
                disposer_manager.Db.RollbackTran();
                this.Msg = "处理失败!";
                return(false);
            }
        }