Ejemplo n.º 1
0
        /// <summary>
        /// 复制销售回款信息
        /// </summary>
        /// <param name="preVersionId">上一个版本Id</param>
        /// <param name="curVersionId">当前版本Id</param>
        public void CopySellDetails(string preVersionId, string curVersionId)
        {
            const string tbName      = "SellDetail";
            var          sellDetails = _ctx.FindAllByQuery(tbName, Query.EQ("versionId", preVersionId)).ToList();//上一个版本的销售计划
            var          copyBll     = CopyBsonHandle._(_ctx);
            var          keyValDict  = new Dictionary <string, string> {
                { "versionId", curVersionId }
            };

            copyBll.CopyBsons(tbName, sellDetails, "detailId", new string[] { "date", "salesVal", "minSalesVal", "comSalesVal" }, keyValDict);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 复制还款计划信息
        /// </summary>
        /// <param name="preVersionId">上一个版本Id</param>
        /// <param name="curVersionId">当前版本Id</param>
        public void CopyRepayDetails(string preVersionId, string curVersionId)
        {
            const string tbName      = "RepayDetail";
            var          sellDetails = _ctx.FindAllByQuery(tbName, Query.EQ("versionId", preVersionId)).ToList();//上一个版本的销售计划
            var          copyBll     = CopyBsonHandle._(_ctx);
            var          keyValDict  = new Dictionary <string, string> {
                { "versionId", curVersionId }
            };

            copyBll.CopyBsons(tbName, sellDetails, "detailId", new string[] { "date", "interest", "repayVal", "loan", "minInterest", "minRepayVal", "minLoan", "comInterest", "comRepayVal", "comLoan" }, keyValDict);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 复制财务数据以及融资渠道
        /// </summary>
        private void CopyFinance(string projId, string preVersionId, string versionId)
        {
            var preFinance      = _ctx.FindOneByQuery(PolicyDept.Finance, Query.And(Query.EQ("projId", projId), Query.EQ("versionId", preVersionId))); //上一个版本的财务数据
            var FinanceId       = preFinance.String("FinanceId");
            var preFinanceModes = _ctx.FindAllByQuery("FinanceMode", Query.EQ("FinanceId", FinanceId)).ToList();                                       //上个版本的融资渠道

            var copyBll      = CopyBsonHandle._(_ctx);
            var keyValueDict = new Dictionary <string, string> {
                { "projId", projId }, { "versionId", versionId }
            };
            var newFinance    = copyBll.CopyBson(PolicyDept.Finance, preFinance, "FinanceId", new string[] { "landMoney", "otherMoney", "name" }, keyValueDict);
            var newFinanceId  = newFinance.String("FinanceId");
            var keyValueDict2 = new Dictionary <string, string> {
                { "FinanceId", newFinanceId }
            };

            copyBll.CopyBsons("FinanceMode", preFinanceModes, "modeId", new string[] { "bank", "money", "cycle", "rate" }, keyValueDict2);
        }