Ejemplo n.º 1
0
        public IActionResult AddPrincipalCheck(AddPrincipalCheckModel 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.PrincipalFacade facade = new PrincipalFacade();

            if (!facade.Create(model))
            {
                return(FailMessage(facade.Msg));
            }
            return(SuccessMessage("处理成功!"));
        }
Ejemplo n.º 2
0
        public IActionResult AddSiteCheck(AddSiteCheckModel 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.分析完成_现场整改);


            if (personalModel != null)
            {
                model.PERSONALID = personalModel.ID;    //找上一步有可能是分析完成, 也有可能是内勤维护完成(PMC)
            }
            else
            {
                personalModel    = personalDa.SelectByWhere(model.SID, (int)SupportendPoint.售后内勤维护完成_现场整改);
                model.PERSONALID = personalModel.ID;
            }


            Facade.SiteCheckFacade facade = new SiteCheckFacade();
            if (!facade.Create(model))
            {
                return(FailMessage(facade.Msg));
            }
            return(SuccessMessage("处理成功!"));
        }
Ejemplo n.º 3
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("处理成功!"));
        }
Ejemplo n.º 4
0
        public IActionResult UpdatePersernalStatus(UpdatePersnalStatusModel model)
        {
            TASM_SUPPORT_PERSONAL_Da da = new TASM_SUPPORT_PERSONAL_Da();

            TASM_SUPPORT_PERSONAL persnalmodel = da.CurrentDb.GetById(model.id);

            persnalmodel.STATUS = model.status;

            if (!da.CurrentDb.Update(persnalmodel))
            {
                return(FailMessage("请求失败!"));
            }
            return(SuccessMessage("处理成功"));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 新增个人信息处理表
        /// </summary>
        /// <param name="cid">创建人,也就是本张工单的处理人,不是整个工单的创建人</param>
        /// <param name="did">处理人,也就是 下一个处理人,</param>
        /// <param name="tid">流程节点,走到哪个环节了</param>
        /// <param name="sid">工单id</param>
        /// <returns></returns>
        private bool InsertPersonal(int cid, int did, int tid, int sid)
        {
            TASM_SUPPORT_PERSONAL_Da da            = new TASM_SUPPORT_PERSONAL_Da();
            TASM_SUPPORT_PERSONAL    psersonlModel = new TASM_SUPPORT_PERSONAL()
            {
                CID        = cid,
                CREATETIME = DateTime.Now,
                DID        = did,
                SID        = sid,
                STATUS     = 0,
                TID        = tid
            };

            return(da.CurrentDb.Insert(psersonlModel));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 个人处理信息表
        /// </summary>
        /// <param name="model"></param>
        /// <param name="sid"></param>
        /// <returns></returns>
        private bool InsertPersonal(TASM_SUPPORT model, int sid)
        {
            TASM_SUPPORT_PERSONAL_Da da            = new TASM_SUPPORT_PERSONAL_Da();
            TASM_SUPPORT_PERSONAL    psersonlModel = new TASM_SUPPORT_PERSONAL()
            {
                CID        = model.CREATOR,
                CREATETIME = DateTime.Now,
                DID        = model.CONDUCTOR,
                SID        = sid,
                STATUS     = 0,
                TID        = model.STATUS
            };

            return(da.CurrentDb.Insert(psersonlModel));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 创建负责人审核
        /// </summary>
        /// <param name="supportModel"></param>
        /// <param name="item"></param>
        /// <param name="sid"></param>
        /// <returns></returns>
        private bool CreatePrincipal(TASM_SUPPORT supportModel, ExcelModel item, int sid)
        {
            try
            {
                logger.Info("===创建审核开始===!");

                DataAccess.TASM_SUPPORT_PRINCIPAL_Da supportPrincipal = new TASM_SUPPORT_PRINCIPAL_Da();
                TASM_SUPPORT_PRINCIPAL princalModel = new TASM_SUPPORT_PRINCIPAL();

                princalModel.CHECKUSER  = item.CheckName;
                princalModel.CREATETIME = DateTime.Now;
                princalModel.ENDDATE    = ConventDateTime(item.FinishDate);
                princalModel.RESULT     = item.CheckResult;
                princalModel.SID        = sid;
                princalModel.STATUS     = 0;
                princalModel.REMARKS    = "导入数据";


                int prId = supportPrincipal.Db.Insertable(princalModel).ExecuteReturnIdentity();



                TASM_SUPPORT_HIS_Da supportHis      = new TASM_SUPPORT_HIS_Da();
                TASM_SUPPORT_HIS    supportHisModel = new TASM_SUPPORT_HIS();

                supportHisModel.SID         = sid;
                supportHisModel.PRE_USER    = supportModel.CONDUCTOR;         //上一处理人
                supportHisModel.NEXT_USER   = supportModel.CONDUCTOR;         //下一处理人
                supportHisModel.PRE_STATUS  = item.IsPmcPoint == "是" ? 2 : 1; //上一状态,订单初始创建,为0
                supportHisModel.NEXT_STATUS = 4;                              //下一状态,订单初始创建 下一状态为 现场处理,状态0,此处创建订单不做为状态,默认创建 和 创建后未处理状态都是0
                supportHisModel.TYPE        = 4;                              //类型,也代表着是哪个表的数据 初始为0
                supportHisModel.TID         = prId;                           //数据id 根据type 那张表,看是哪一条数据。
                supportHisModel.REMARKS     = "现场已处理,等待审核导入数据";
                supportHisModel.CREATETIME  = DateTime.Now;
                supportHis.Db.Insertable(supportHisModel);
                logger.Info("插入历史表,审核处理完成");



                TASM_SUPPORT_PERSONAL_Da supportPersonal = new TASM_SUPPORT_PERSONAL_Da();
                TASM_SUPPORT_PERSONAL    personalModel   = new TASM_SUPPORT_PERSONAL();

                personalModel.CID        = supportModel.CONDUCTOR;
                personalModel.DID        = supportModel.CONDUCTOR;
                personalModel.CREATETIME = DateTime.Now;
                personalModel.SID        = sid;
                personalModel.STATUS     = 2;
                personalModel.TID        = 4;
                personalModel.CREATETIME = DateTime.Now;
                personalModel.REMARKS    = "数据导入";

                supportPersonal.Db.Insertable(personalModel);

                logger.Info("插入个人处理表,审核处理完成");



                logger.Info("===创建审核结束===!");

                return(true);
            }
            catch (Exception ex)
            {
                logger.Error("创建审核失败" + ex);
                return(false);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 现场处理
        /// </summary>
        /// <returns></returns>
        private bool CreateSiteCheck(TASM_SUPPORT supportModel, ExcelModel item, int sid)
        {
            try
            {
                logger.Info("===创建现场处理开始===!");
                TASM_SUPPORT_SITE_Da supportSite = new TASM_SUPPORT_SITE_Da();

                TASM_SUPPORT_SITE siteMode = new TASM_SUPPORT_SITE();

                siteMode.CREATETIME  = DateTime.Now;
                siteMode.DESCRIPTION = item.Description;
                siteMode.ENDDATE     = ConventDateTime(item.EndDate);
                siteMode.REAMRKS     = "导入数据";

                int siteId = supportSite.Db.Insertable(siteMode).ExecuteReturnIdentity();



                TASM_SUPPORT_HIS_Da supportHis      = new TASM_SUPPORT_HIS_Da();
                TASM_SUPPORT_HIS    supportHisModel = new TASM_SUPPORT_HIS();

                supportHisModel.SID         = sid;
                supportHisModel.PRE_USER    = supportModel.CONDUCTOR;         //上一处理人
                supportHisModel.NEXT_USER   = supportModel.CONDUCTOR;         //下一处理人
                supportHisModel.PRE_STATUS  = item.IsPmcPoint == "是" ? 2 : 1; //上一状态,订单初始创建,为0
                supportHisModel.NEXT_STATUS = 3;                              //下一状态,订单初始创建 下一状态为 现场处理,状态0,此处创建订单不做为状态,默认创建 和 创建后未处理状态都是0
                supportHisModel.TYPE        = 3;                              //类型,也代表着是哪个表的数据 初始为0
                supportHisModel.TID         = siteId;                         //数据id 根据type 那张表,看是哪一条数据。
                supportHisModel.REMARKS     = "现场已处理,等待审核导入数据";
                supportHisModel.CREATETIME  = DateTime.Now;
                supportHis.Db.Insertable(supportHisModel);
                logger.Info("插入历史表,现场处理完成");



                TASM_SUPPORT_PERSONAL_Da supportPersonal = new TASM_SUPPORT_PERSONAL_Da();
                TASM_SUPPORT_PERSONAL    personalModel   = new TASM_SUPPORT_PERSONAL();

                personalModel.CID        = supportModel.CONDUCTOR;
                personalModel.DID        = supportModel.CONDUCTOR;
                personalModel.CREATETIME = DateTime.Now;
                personalModel.SID        = sid;
                personalModel.STATUS     = 2;
                personalModel.TID        = 3;
                personalModel.CREATETIME = DateTime.Now;
                personalModel.REMARKS    = "数据导入";

                supportPersonal.Db.Insertable(personalModel);

                logger.Info("插入个人处理表,现场处理完成");



                logger.Info("===创建现场处理结束===!");

                return(true);
            }
            catch (Exception ex)
            {
                logger.Error("创建现场处理失败" + ex);
                return(false);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// PMC处理
        /// </summary>
        /// <param name="supportModel"></param>
        /// <param name="item"></param>
        /// <param name="sid"></param>
        /// <returns></returns>
        private bool CreatePmcOrder(TASM_SUPPORT supportModel, ExcelModel item, int sid)
        {
            try
            {
                logger.Info("===创建PMC处理开始===!");
                DataAccess.TASM_SUPPORT_PMC_Da supportPmcOrder = new TASM_SUPPORT_PMC_Da();

                TASM_SUPPORT_PMC pmcModel = new TASM_SUPPORT_PMC();
                pmcModel.BOOKNO     = item.BookNo;
                pmcModel.DELIVERY   = ConventDateTime(item.Delivery);
                pmcModel.SENDDATE   = ConventDateTime(item.SendDate);
                pmcModel.SENDNO     = item.SendNo;
                pmcModel.CONSIGNEE  = item.Consignee;
                pmcModel.STATUS     = 0;
                pmcModel.CREATETIME = DateTime.Now;
                pmcModel.REMARKS    = "导入数据";

                int pmcid = supportPmcOrder.Db.Insertable(pmcModel).ExecuteReturnIdentity();

                logger.Info("插入PMC处理表,处理完成");


                TASM_SUPPORT_HIS_Da supportHis      = new TASM_SUPPORT_HIS_Da();
                TASM_SUPPORT_HIS    supportHisModel = new TASM_SUPPORT_HIS();

                supportHisModel.SID         = sid;
                supportHisModel.PRE_USER    = supportModel.CONDUCTOR; //上一处理人
                supportHisModel.NEXT_USER   = supportModel.CONDUCTOR; //下一处理人
                supportHisModel.PRE_STATUS  = 1;                      //上一状态,订单初始创建,为0
                supportHisModel.NEXT_STATUS = 2;                      //下一状态,订单初始创建 下一状态为 现场处理,状态0,此处创建订单不做为状态,默认创建 和 创建后未处理状态都是0
                supportHisModel.TYPE        = 2;                      //类型,也代表着是哪个表的数据 初始为0
                supportHisModel.TID         = pmcid;                  //数据id 根据type 那张表,看是哪一条数据。
                supportHisModel.REMARKS     = "PMC已处理,等待现场处理,导入数据";
                supportHisModel.CREATETIME  = DateTime.Now;
                supportHis.Db.Insertable(supportHisModel);
                logger.Info("插入历史表,PMC处理完成");



                TASM_SUPPORT_PERSONAL_Da supportPersonal = new TASM_SUPPORT_PERSONAL_Da();
                TASM_SUPPORT_PERSONAL    personalModel   = new TASM_SUPPORT_PERSONAL();

                personalModel.CID        = supportModel.CONDUCTOR;
                personalModel.DID        = supportModel.CONDUCTOR;
                personalModel.CREATETIME = DateTime.Now;
                personalModel.SID        = sid;
                personalModel.STATUS     = 2;
                personalModel.TID        = 2;
                personalModel.CREATETIME = DateTime.Now;
                personalModel.REMARKS    = "数据导入";

                supportPersonal.Db.Insertable(personalModel);

                logger.Info("插入个人处理表,PMC处理完成");



                logger.Info("===创建PMC处理结束===!");
                return(true);
            }
            catch (Exception ex)
            {
                logger.Error("创建Pmc失败" + ex);
                return(false);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 技术处理
        /// </summary>
        /// <param name="supportModel"></param>
        /// <param name="item"></param>
        /// <param name="sid"></param>
        /// <param name="disid"></param>
        /// <returns></returns>
        private bool CreateDisposer(TASM_SUPPORT supportModel, ExcelModel item, int sid)
        {
            try
            {
                logger.Info("===创建现场处理开始===!");

                //step3 现场处理表

                TASM_SUPPORT_DISPOSER_Da supportDisposer = new TASM_SUPPORT_DISPOSER_Da();
                TASM_SUPPORT_DISPOSER    disposerModel   = new TASM_SUPPORT_DISPOSER();


                disposerModel.SID         = sid;
                disposerModel.ANALYZEUSER = GetUserIdByName(item.AnalyzeUserName);
                disposerModel.ANALYZE     = item.Analyze;
                disposerModel.SOLUTION    = item.Solution;
                disposerModel.STATUS      = 0;
                disposerModel.REMARKS     = "导入数据";
                disposerModel.RESPONSIBLE = item.Responsible;
                disposerModel.DUTY        = item.Duty;
                disposerModel.BOM         = item.Bom;
                disposerModel.ORDERMAN    = item.OrderMan;
                disposerModel.ORDERTIME   = ConventDateTime(item.OrderTime);
                disposerModel.ISORDER     = item.IsOrder == "是" ? 1 : 0;

                int disid = supportDisposer.Db.Insertable(disposerModel).ExecuteReturnIdentity();
                logger.Info("插入技术处理表完成");

                //step4 现场处理

                TASM_SUPPORT_HIS_Da supportHis      = new TASM_SUPPORT_HIS_Da();
                TASM_SUPPORT_HIS    supportHisModel = new TASM_SUPPORT_HIS();

                supportHisModel.SID         = sid;
                supportHisModel.PRE_USER    = supportModel.CONDUCTOR;         //上一处理人
                supportHisModel.NEXT_USER   = supportModel.CONDUCTOR;         //下一处理人
                supportHisModel.PRE_STATUS  = 0;                              //上一状态,订单初始创建,为0
                supportHisModel.NEXT_STATUS = item.IsPmcPoint == "是" ? 2 : 1; //下一状态,订单初始创建 下一状态为 现场处理,状态0,此处创建订单不做为状态,默认创建 和 创建后未处理状态都是0
                supportHisModel.TYPE        = 1;                              //类型,也代表着是哪个表的数据 初始为0
                supportHisModel.TID         = disid;                          //数据id 根据type 那张表,看是哪一条数据。
                supportHisModel.REMARKS     = "技术已处理,等待现场处理,导入数据";
                supportHisModel.CREATETIME  = DateTime.Now;
                supportHis.Db.Insertable(supportHisModel);
                logger.Info("插入历史表,技术处理完成");


                TASM_SUPPORT_PERSONAL_Da supportPersonal = new TASM_SUPPORT_PERSONAL_Da();
                TASM_SUPPORT_PERSONAL    personalModel   = new TASM_SUPPORT_PERSONAL();

                personalModel.CID        = supportModel.CONDUCTOR;
                personalModel.DID        = supportModel.CONDUCTOR;
                personalModel.CREATETIME = DateTime.Now;
                personalModel.SID        = sid;
                personalModel.STATUS     = 2;
                personalModel.TID        = 0; //2代表现场完成,PMC 介入, 1则是 现场处理完成,无需PMC,直接跳到现场处理。
                personalModel.CREATETIME = DateTime.Now;
                personalModel.REMARKS    = "数据导入";

                supportPersonal.Db.Insertable(personalModel);

                logger.Info("插入个人处理表,技术处理完成");


                logger.Info("===创建现场处理结束===!");
                return(true);
            }
            catch (Exception ex)
            {
                logger.Error("创建Disposer失败" + ex);
                return(false);
            }
        }