Example #1
0
        public IActionResult AddDisposer(AddDisposerModel model)
        {
            //1,不是管理员不能处理。 2,查询出 根据Sid,处理人id,流程节点,处理状态,查出 Presonal 表的id,


            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;

            DisposerFacade facade = new DisposerFacade();

            if (!facade.Create(model))
            {
                return(FailMessage(facade.Msg));
            }
            return(SuccessMessage("处理成功!"));
        }
Example #2
0
        public IActionResult AddDisposer(AddDisposerModel model)
        {
            DisposerFacade facade = new DisposerFacade();

            if (!facade.Create(model))
            {
                return(FailMessage(facade.Msg));
            }
            return(SuccessMessage("处理成功!"));
        }
Example #3
0
        public IActionResult DisposerUpdate(AddDisposerModel info)
        {
            TASM_SUPPORT_DISPOSER_Da disposer = new TASM_SUPPORT_DISPOSER_Da();

            TASM_SUPPORT_HIS_Da his = new TASM_SUPPORT_HIS_Da();

            var hisModel = his.SelectBySidType(info.SID, 1);

            disposer.Db.BeginTran();

            hisModel.NEXT_USER = info.NEXTUSER;

            if (his.Db.Updateable(hisModel).ExecuteCommand() < 1)
            {
                disposer.Db.RollbackTran();
                return(FailMessage());
            }


            TASM_SUPPORT_DISPOSER model = new TASM_SUPPORT_DISPOSER()
            {
                ANALYZE     = info.ANALYZE,
                ANALYZEUSER = info.ANALYZEUSER,
                BOM         = info.BOM,
                DUTY        = info.DUTY,
                ID          = info.ID,
                ISORDER     = info.ISORDER,
                ORDERMAN    = info.ORDERMAN,
                ORDERTIME   = info.ORDERTIME,
                RESPONSIBLE = info.RESPONSIBLE,
                SID         = info.SID,
                SOLUTION    = info.SOLUTION,
                STATUS      = info.STATUS,
                CREATETIME  = info.CREATETIME,
                REMARKS     = info.REMARKS
            };


            if (disposer.Db.Updateable(model).ExecuteCommand() < 1)
            {
                disposer.Db.RollbackTran();
                return(FailMessage());
            }

            disposer.Db.CommitTran();

            return(SuccessMessage());
        }
Example #4
0
        /// <summary>
        /// 消息推送表
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sid"></param>
        /// <returns></returns>
        private bool InsertPush(AddDisposerModel 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));
        }
Example #5
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);
            }
        }