Exemplo n.º 1
0
        /// <summary>
        /// 查询收入明细列表
        /// </summary>
        /// <param name="req">条件</param>
        /// <returns></returns>
        public async Task <PageAmountList <InRecordListInfo> > QueryInRecordAsync(InRecordReq req)
        {
            //查询
            var taskModel         = ReportDAL.Inst.QueryInRecordAsync(this.LoginInfo.FamilyID, req); //明细
            var taskInType        = BasicDAL.Inst.QueryInTypeAsync(this.LoginInfo.FamilyID);         //类型
            var taskAmountAccount = BasicDAL.Inst.QueryAmountAccountAsync(this.LoginInfo.FamilyID);  //账户

            var lstModel         = await taskModel;                                                  //明细
            var lstInType        = await taskInType;                                                 //类型
            var lstAmountAccount = await taskAmountAccount;                                          //账户

            var list = new List <InRecordListInfo>();
            var seq  = req.GetSkip() + 1;

            foreach (var model in lstModel)
            {
                var item = new InRecordListInfo();
                list.Add(item);

                //类型
                var inType = lstInType.Find(m => m.ID == model.InTypeID);

                //账户
                var amountAccount = lstAmountAccount.Find(m => m.ID == model.AmountAccountID);

                item.Seq               = seq++;
                item.ID                = model.ID;
                item.InDate            = model.InDate;
                item.InTypeName        = inType != null ? inType.Name : "";
                item.AmountAccountName = amountAccount != null ? amountAccount.Name : "";
                item.Amount            = model.Amount;
                item.Remark            = model.Remark;
            }

            return(new PageAmountList <InRecordListInfo>(list, lstModel.TotalRecord, lstModel.TotalAmount));
        }
Exemplo n.º 2
0
        public async Task <ResultPageAmountList <InRecordListInfo> > QueryInRecordAsync([FromBody] InRecordReq req)
        {
            var list = await this.bll.QueryInRecordAsync(req);

            return(new ResultPageAmountList <InRecordListInfo>(true, this.bll.Res.Gen.OK, list, (req.GetSkip() + 1), list.TotalRecord, list.TotalAmount));
        }