示例#1
0
文件: SfcOp.cs 项目: fightx/U8
        /// <summary>
        /// 组织数据
        /// </summary>
        /// <param name="dt">当前任务节点信息</param>
        /// <param name="bd">HY_DZ_K7_DLLReflect 中预置的 data类</param>
        /// <returns></returns>
        public override Model.DealResult MakeData(Model.Synergismlogdt dt, BaseData bd)
        {
            Model.DealResult           dr      = new Model.DealResult();
            Model.APIData              apidata = bd as Model.APIData; //API实体,包括当前任务节点信息
            DAL.TaskLog.ITaskLogDetail dtdal;

            //当前任务节点信息
            dtdal = ClassFactory.GetITaskLogDetailDAL(3);
            Model.Synergismlogdt pdt = dtdal.GetPrevious(dt);  //上一任务节点信息

            apidata.ConnectInfo    = dtdal.GetConnectInfo(dt); //获取当前结点的数据串连接串
            apidata.Synergismlogdt = dt;

            if (!apidata.Dodelete)
            {
                DataSet rdds  = SetFromTabet(dt, pdt, apidata);                                                  //上一节点 单据头信息
                DataSet rdsds = SetFromTabets(dt, pdt, apidata);                                                 //上一节点 单据体信息

                DAL.IFieldcmps         fieldcmpdal    = ClassFactory.GetIFieldcmpsDAL(apidata.TaskType);         //new DAL.Fieldcmps();
                List <Model.Fieldcmps> listfd         = fieldcmpdal.GetListFieldcmps(dt, pdt, apidata.TaskType); //字段对照信息
                BLL.U8NameValue        u8namevaluebll = new BLL.U8NameValue();                                   //字段赋值
                u8namevaluebll.SetHeadData(apidata, rdds, rdsds, listfd, dt);
                u8namevaluebll.SetSfcBodyData(apidata, rdds, rdsds, listfd, dt);

                //设置订单关联
                DAL.Common.SetInBody(apidata);
                SetNormalValue(apidata, dt);
            }
            return(dr);
        }
示例#2
0
        /// <summary>
        /// 获取上游单据审核日期
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static string GetVerifyData(Model.Synergismlogdt dt)
        {
            string strDefault = DateTime.Now.ToString("yyyy-MM-dd").Replace('.', '-').Replace('/', '-');

            if (dt.Ilineno <= 1)
            {
                return(strDefault);
            }

            BLL.TaskLog.ITaskLogDetail bllDT = ClassFactory.GetITaskLogDetailBLL(dt.TaskType);
            DAL.TaskLog.ITaskLogDetail dalDT = ClassFactory.GetITaskLogDetailDAL(dt.TaskType);
            Model.Synergismlogdt       dtPrev;
            dtPrev = bllDT.GetPrevious(dt, dt.OP);
            Model.ConnectInfo ConnectStr = dalDT.getConnectStr(dtPrev);

            return(DAL.Common.GetVerifyDate(ConnectStr, dtPrev));
        }
示例#3
0
        /// <summary>
        /// 判断日志中记录的单据在账套中是否真的存在    added by liuxzha 2015.03.23
        /// 日志查询界面使用
        /// </summary>
        /// <param name="autoid"></param>
        /// <returns> 0 本节点没有生成,子结点也没生成;
        ///           10 本节点生成,子结点没有生成,单据为未审核状态
        ///           11 本节点生成,子结点没有生成,单据为已审核状态
        ///           100 本节点没有生成,子结点已经生成
        ///           110 本节点生成,子结点也已经生成,单据为未审核状态
        ///           111 本节点生成,子结点也已经生成,单据为已审核状态</returns>
        public int ChkExistsInData(string autoid)
        {
            int res = 0;

            //bool bHasCreateChild = false; //在日志中是否已生成子节点

            DAL.TaskLog.ITaskLogDetail daldt    = ClassFactory.GetITaskLogDetailDAL(3);
            BLL.TaskLog.ITaskLogDetail logdtbll = ClassFactory.GetITaskLogDetailBLL(3);
            Model.Synergismlogdt       dt       = daldt.GetModel(autoid);

            List <Model.Synergismlogdt> nextlist = logdtbll.GetNext(dt, null);

            foreach (Model.Synergismlogdt next in nextlist)
            {
                if (!string.IsNullOrEmpty(next.Cvoucherno))
                {
                    //bHasCreateChild = true;
                    res += 100;
                }
            }

            BaseData bd = ClassFactory.GetBaseData(dt);

            bd.Dodelete            = true;
            bd.Synergismlogdt      = dt;
            bd.Fristsynergismlogdt = daldt.GetFirst(dt);
            BaseOp op = ClassFactory.GetBaseOp(dt);

            op.MakeData(dt, bd);
            Model.APIData apidata = bd as Model.APIData;
            string        vouchid = op.GetCodeorID(dt.Cvoucherno, bd, "id");

            if (!string.IsNullOrEmpty(vouchid))
            {
                res += 10;   //本节点已生成
                if (((APIOp)op).CheckAuditStatus(dt.Cvoucherno, apidata.ConnectInfo.Constring))
                {
                    res += 1;
                }
            }

            return(res);
        }
示例#4
0
        /// <summary>
        /// 重做
        /// </summary>
        /// <param name="autoid"></param>
        /// <param name="id"></param>
        public void ReDo(string autoid, string id)
        {
            DAL.TaskLog.ITaskLogDetail dal = ClassFactory.GetITaskLogDetailDAL(3);
            Model.Synergismlogdt       dt  = dal.GetModel(autoid);
            dt.Cstatus    = Constant.SynergisnLogDT_Cstatus_NoDeal;
            dt.Cerrordesc = string.Empty;

            //如果有单号,先删除再重发
            if (string.IsNullOrEmpty(dt.Cvoucherno))
            {
                DeleteSyncDt(1, autoid, id);
            }

            dal.Update(dt);
            DAL.TaskLog.ITaskLogMain logdal = ClassFactory.GetITaskLogMainDAL(3);
            Model.Synergismlog       log    = logdal.GetModel(id);
            log.Cstatus = Constant.SynerginsLog_Cstatus_Dealing;
            logdal.Update(log);
        }
示例#5
0
文件: OperUtility.cs 项目: sky-tc/U8
        /// <summary>
        /// 删除
        /// added by liuxzha 2016.03.08
        /// </summary>
        /// <param name="taskType">任务类别 0 CQ 1 XT</param>
        /// <param name="autoid"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public DealResult DeleteVouch(int tasktype, Synergismlogdt dt)
        {
            DealResult dr = new DealResult();

            try
            {
                DAL.TaskLogFactory.ITaskLogDetail daldt = ClassFactory.GetITaskLogDetailDAL(tasktype);
                BLL.SynergisnLogDT logdtbll             = new SynergisnLogDT();



                #region 协同 校验
                if (tasktype.Equals("1"))
                {
                    List <Model.Synergismlogdt> nextlist = logdtbll.GetNext(dt, null);

                    foreach (Model.Synergismlogdt next in nextlist)
                    {
                        if (!string.IsNullOrEmpty(next.Cvoucherno))
                        {
                            dr.ResultNum = -1;
                            dr.ResultMsg = "下游单据未删除,请先删除下游单据";
                            return(dr);
                        }
                    }
                }
                #endregion

                BaseData bd = ClassFactory.GetBaseData(dt);
                bd.Dodelete            = true;
                bd.Synergismlogdt      = dt;
                bd.Fristsynergismlogdt = daldt.GetFirst(dt);
                BaseOp op = ClassFactory.GetBaseOp(dt);
                op.MakeData(dt, bd);

                string vouchid = op.GetCodeorID(dt.Cvoucherno, bd, "id");

                if (!string.IsNullOrEmpty(vouchid))
                {
                    dr = op.UndoMake(bd, dt);
                }

                if (dr.ResultNum < Constant.ResultNum_NoError)
                {
                    return(dr);
                }
                dt.Cstatus    = Constant.SynergisnLogDT_Cstatus_Delete;
                dt.Cvoucherno = string.Empty;
                daldt.Update(dt);
                DAL.TaskLogFactory.ITaskLogMain logdal = ClassFactory.GetITaskLogMainDAL(tasktype);


                Model.Synergismlog log = logdal.GetModel(dt.Id, dt.OP);
                log.Cstatus = Constant.SynerginsLog_Cstatus_Wait;
                logdal.Update(log, dt.OP);
            }
            catch (Exception ex)
            {
                dr.ResultMsg = ex.ToString();
                dr.ResultNum = -1;
            }
            return(dr);
        }