示例#1
0
        public IActionResult GetPrincipalInfo(int id)
        {
            DataAccess.TASM_SUPPORT_PRINCIPAL_Da manager = new DataAccess.TASM_SUPPORT_PRINCIPAL_Da();
            TASM_SUPPORT_PRINCIPAL model = manager.CurrentDb.GetById(id);

            return(SuccessResult(model));
        }
示例#2
0
        private bool InsertPrincipal(TASM_SUPPORT_PRINCIPAL model, TASM_SUPPORT_PRINCIPAL_Da manager, ref int pid)
        {
            model.CREATETIME = DateTime.Now;
            model.STATUS     = model.STATUS;
            pid = manager.Db.Insertable(model).ExecuteReturnIdentity();

            return(pid > 0);
        }
示例#3
0
        private bool InsertHistory(TASM_SUPPORT_PRINCIPAL model, TASM_SUPPORT supportModel, int supportStatus, int nextUser, int pid)
        {
            string remarks = supportStatus == 5 ? "未完成" : "已完成";

            //3,当前处理人员发生修改,新增一条 修改记录 history
            TASM_SUPPORT_HIS hisModel = new TASM_SUPPORT_HIS();

            hisModel.CREATETIME = DateTime.Now;
            hisModel.PRE_USER   = supportModel.CONDUCTOR;
            hisModel.NEXT_USER  = nextUser;

            hisModel.SID        = model.SID;
            hisModel.REMARKS    = "负责人已审核:" + remarks;
            hisModel.PRE_STATUS = supportModel.STATUS;

            hisModel.NEXT_STATUS = supportStatus;
            hisModel.TYPE        = (int)Entites.SupportHisType.负责人审核;
            hisModel.TID         = pid;

            DataAccess.TASM_SUPPORT_HIS_Da his_manager = new TASM_SUPPORT_HIS_Da();
            return(his_manager.CurrentDb.Insert(hisModel));
        }
示例#4
0
        public IActionResult PrincipalUpdate(HisPrincipalModel info)
        {
            TASM_SUPPORT_PRINCIPAL_Da Principal = new TASM_SUPPORT_PRINCIPAL_Da();

            TASM_SUPPORT_HIS_Da his = new TASM_SUPPORT_HIS_Da();

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

            Principal.Db.BeginTran();

            hisModel.NEXT_USER = int.Parse(info.NEXT_USER);

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

            TASM_SUPPORT_PRINCIPAL model = new TASM_SUPPORT_PRINCIPAL()
            {
                CHECKUSER = info.CHECKUSER,
                ID        = info.TID,
                RESULT    = info.RESULT,
                ENDDATE   = DateTime.Parse(info.ENDDATE),
                SID       = info.SID
            };

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

            Principal.Db.CommitTran();

            return(SuccessMessage());
        }
示例#5
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);
            }
        }