Beispiel #1
0
        /// <summary>
        /// 查询销售收款单
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <param name="pageSize">分页大小</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="sortField">排序字段(带asc或desc)</param>
        /// <param name="callback">查询结果返回回调</param>
        public void Query(SaleIncomeQueryVM query, int pageSize, int pageIndex, string sortField, Action <SaleIncomeQueryResultVM> callback)
        {
            SOIncomeQueryFilter filter = query.ConvertVM <SaleIncomeQueryVM, SOIncomeQueryFilter>();

            filter.PagingInfo = new PagingInfo()
            {
                PageIndex = pageIndex,
                PageSize  = pageSize,
                SortBy    = sortField
            };

            string relativeUrl = "/InvoiceService/SOIncome/Query";

            restClient.QueryDynamicData(relativeUrl, filter, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                SaleIncomeQueryResultVM result = new SaleIncomeQueryResultVM();
                if (args.Result[0] != null && args.Result[0].Rows != null)
                {
                    result.ResultList = DynamicConverter <SaleIncomeVM> .ConvertToVMList(args.Result[0].Rows);
                    result.TotalCount = args.Result[0].TotalCount;
                }
                if (args.Result[1] != null && args.Result[1].Rows != null)
                {
                    result.Statistic = DynamicConverter <SaleIncomeQueryStatisticVM> .ConvertToVMList <StatisticCollection <SaleIncomeQueryStatisticVM> >(args.Result[1].Rows);
                }
                callback(result);
            });
        }
Beispiel #2
0
        public List <SOIncomeInfo> GetListByCriteria(int?sysNo, int?orderSysNo, SOIncomeOrderType?orderType, List <SOIncomeStatus> soIncomeStatus)
        {
            SOIncomeQueryFilter query = new SOIncomeQueryFilter();

            query.SysNo              = sysNo;
            query.OrderSysNo         = orderSysNo.HasValue ? orderSysNo.ToString() : null;
            query.OrderType          = orderType;
            query.InIncomeStatusList = soIncomeStatus;
            return(GetListByCriteria(query));
        }
        public virtual QueryResult ExportROExcelFile(SOIncomeQueryFilter request)
        {
            var dataTable = ObjectFactory <ISOIncomeQueryDA> .Instance.QueryROExport(request).Tables["Table"];

            return(new QueryResult()
            {
                Data = dataTable,
                TotalCount = dataTable.Rows.Count
            });
        }
        public virtual void SyncSAPSales(SOIncomeQueryFilter request)
        {
            int totalCount;
            var dataSet = ObjectFactory <ISOIncomeQueryDA> .Instance.Query(request, out totalCount);

            DataTable dt = this.QuerySOIncome(request)[0].Data;

            if (dt != null && dt.Rows.Count > 0)
            {
                ObjectFactory <NECN_SyncSAPSalesAPPService> .Instance.SyncSAPSales(dt, request.OrderType.Value);
            }
        }
Beispiel #5
0
        /// <summary>
        /// 根据收款单系统编号加载收款单数据
        /// </summary>
        /// <param name="sysNo"></param>
        /// <returns></returns>
        public SOIncomeInfo LoadBySysNo(int sysNo)
        {
            var query = new SOIncomeQueryFilter()
            {
                SysNo = sysNo
            };

            var result = GetListByCriteria(query);

            if (result.Count > 0)
            {
                return(result[0]);
            }
            return(null);
        }
Beispiel #6
0
        public void ExportSuccessResult(SaleIncomeQueryVM query, ColumnSet[] columnSet)
        {
            SOIncomeQueryFilter filter = query.ConvertVM <SaleIncomeQueryVM, SOIncomeQueryFilter>();

            filter.PagingInfo = new PagingInfo()
            {
                PageIndex = 0,
                PageSize  = ECCentral.Portal.Basic.ConstValue.MaxRowCountLimit,
                SortBy    = "SysNo desc"
            };

            string relativeUrl = "/InvoiceService/SOIncome/Export";

            restClient.ExportFile(relativeUrl, filter, columnSet);
        }
Beispiel #7
0
        /// <summary>
        /// 导出RO
        /// </summary>
        /// <param name="queryVM"></param>
        /// <param name="columnSet"></param>
        public void ExportROExcelFile(SaleIncomeQueryVM queryVM, ColumnSet[] columnSet)
        {
            SOIncomeQueryFilter queryFilter = queryVM.ConvertVM <SaleIncomeQueryVM, SOIncomeQueryFilter>();

            queryFilter.PagingInfo = new PagingInfo
            {
                PageSize  = ECCentral.Portal.Basic.ConstValue.MaxRowCountLimit,
                PageIndex = 0,
                SortBy    = "SysNo desc"
            };
            queryFilter.CompanyCode = CPApplication.Current.CompanyCode;
            string relativeUrl = "/InvoiceService/SOIncome/ExportRO";

            restClient.ExportFile(relativeUrl, queryFilter, columnSet);
        }
        public virtual QueryResultList QuerySOIncome(SOIncomeQueryFilter request)
        {
            int totalCount;
            var dataSet = ObjectFactory <ISOIncomeQueryDA> .Instance.Query(request, out totalCount);

            return(new QueryResultList()
            {
                new QueryResult()
                {
                    Data = dataSet.Tables["DataResult"], TotalCount = totalCount
                },
                new QueryResult()
                {
                    Data = dataSet.Tables["StatisticResult"]
                }
            });
        }
Beispiel #9
0
        public static SOIncomeInfo CreateSOIncome(SOIncomeInfo entity)
        {
            SOIncomeQueryFilter query = new SOIncomeQueryFilter();

            query.SysNo              = null;
            query.OrderSysNo         = entity.OrderSysNo.HasValue ? entity.OrderSysNo.ToString() : null;
            query.OrderType          = entity.OrderType;
            query.InIncomeStatusList = null;
            List <SOIncomeInfo> result = SOIncomeDA.GetListByCriteria(query);

            if (result.Exists(s => s.Status != SOIncomeStatus.Abandon))
            {
                throw new BusinessException("收款单记录已经存在,插入操作失败。");
            }

            SOIncomeDA.CreateSOIncome(entity);
            return(entity);
        }
Beispiel #10
0
        /// <summary>
        /// 根据查询条件取得收款单列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        List <SOIncomeInfo> GetListByCriteria(SOIncomeQueryFilter query)
        {
            List <SOIncomeInfo> result      = new List <SOIncomeInfo>();
            CustomDataCommand   dataCommand = DataCommandManager.CreateCustomDataCommandFromConfig("GetSOIncomeList");

            using (DynamicQuerySqlBuilder sqlBuilder = new DynamicQuerySqlBuilder(
                       dataCommand.CommandText, dataCommand, null, "SysNo"))
            {
                if (query.SysNo != null)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "SysNo",
                                                                 DbType.Int32, "@SysNo", QueryConditionOperatorType.Equal, query.SysNo.Value);
                }

                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "CompanyCode",
                                                             DbType.AnsiStringFixedLength, "@CompanyCode", QueryConditionOperatorType.Equal, query.CompanyCode);

                if (!string.IsNullOrEmpty(query.OrderSysNo))
                {
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "OrderSysNo",
                                                                 DbType.Int32, "@OrderSysNo", QueryConditionOperatorType.Equal, int.Parse(query.OrderSysNo));
                }

                if (query.OrderType != null)
                {
                    sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "OrderType",
                                                                 DbType.Int32, "@OrderType", QueryConditionOperatorType.Equal, (int)query.OrderType.Value);
                }

                if (query.InIncomeStatusList != null && query.InIncomeStatusList.Count > 0)
                {
                    sqlBuilder.ConditionConstructor.AddSubQueryCondition(QueryConditionRelationType.AND, "Status"
                                                                         , QueryConditionOperatorType.In, string.Join(",", query.InIncomeStatusList.Select(p => ((int)p).ToString())));
                }

                dataCommand.CommandText = sqlBuilder.BuildQuerySql();

                result = dataCommand.ExecuteEntityList <SOIncomeInfo>();
            }

            return(result);
        }
Beispiel #11
0
        public void SyncSAPSales(SaleIncomeQueryVM query, int pageSize, int pageIndex, string sortField, Action callback)
        {
            SOIncomeQueryFilter filter = query.ConvertVM <SaleIncomeQueryVM, SOIncomeQueryFilter>();

            filter.PagingInfo = new PagingInfo()
            {
                PageIndex = pageIndex,
                PageSize  = pageSize,
                SortBy    = sortField
            };

            string relativeUrl = "/InvoiceService/SyncSAPSales/SOIncome";

            restClient.Update(relativeUrl, filter, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                callback();
            });
        }
        public virtual QueryResult ExportSOIncomeExcelFile(SOIncomeQueryFilter request)
        {
            int totalCount;
            var dataSet = ObjectFactory <ISOIncomeQueryDA> .Instance.Query(request, out totalCount);

            var dataTable = dataSet.Tables["DataResult"];

            dataTable.Columns.Add("BankInfo");
            foreach (DataRow row in dataTable.Rows.AsParallel())
            {
                row["BankInfo"] = row["BankName"] + "-" + row["BranchBankName"];
                if (row["SapImportedStatus"] == DBNull.Value)
                {
                    row["SapImportedStatus"] = (int)SapImportedStatus.UnHandle;
                }
            }

            return(new QueryResult()
            {
                Data = dataTable,
                TotalCount = totalCount
            });
        }