Пример #1
0
        /// <summary>
        /// 获取初始绑定
        /// </summary>
        /// <returns></returns>
        public async Task <SaleReservationBillModel> GetInitDataAsync(bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api      = RefitServiceBuilder.Build <ISaleReservationBillApi>(URL);
                var cacheKey = RefitServiceBuilder.Cacher("SaleReservationBillService.GetInitDataAsync", storeId, userId);
                var results  = await _makeRequest.StartUseCache(api.GetInitDataAsync(storeId, userId, calToken), cacheKey, force, calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #2
0
        /// <summary>
        /// 获取公司配置
        /// </summary>
        /// <returns></returns>
        public void GetCompanySettingAsync(CancellationToken calToken = default)
        {
            var model = new CompanySettingModel();

            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api      = RefitServiceBuilder.Build <ISettingApi>(URL);
                var cacheKey = RefitServiceBuilder.Cacher("GetCompanySettingAsync", storeId, userId);
                _makeRequest.StartUseCache_Rx(api.GetCompanySettingAsync(storeId, calToken), cacheKey, calToken)?.Subscribe((results) =>
                {
                    if (results != null && results?.Code >= 0)
                    {
                        model = results?.Data;
                        if (model != null)
                        {
                            Settings.CompanySetting = JsonConvert.SerializeObject(model);
                            if (string.IsNullOrEmpty(Settings.DefaultPricePlan) || Settings.DefaultPricePlan == "0_0")
                            {
                                Settings.DefaultPricePlan = model.DefaultPricePlan;
                            }
                        }
                    }
                });
            }
            catch (Exception e)
            {
                e.HandleException();
            }
        }
Пример #3
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="billId"></param>
        /// <returns></returns>
        public async Task <ResultData> AuditingAsync(int billId = 0, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api     = RefitServiceBuilder.Build <ISaleReservationBillApi>(URL);
                var results = await _makeRequest.Start(api.AuditingAsync(storeId, userId, billId, calToken), calToken);

                return(new ResultData
                {
                    Success = (bool)(results?.Success),
                    Message = results?.Message
                });
            }
            catch (Exception e)
            {
                return(new ResultData
                {
                    Success = false,
                    Message = e.Message
                });
            }
        }
Пример #4
0
        /// <summary>
        /// 获取单据
        /// </summary>
        /// <param name="billId"></param>
        /// <returns></returns>
        public async Task <ExchangeBillModel> GetBillAsync(int billId, bool force = false, CancellationToken calToken = default)
        {
            var model = new ExchangeBillModel();

            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api = RefitServiceBuilder.Build <IExchangeBillApi>(URL);

                var cacheKey = RefitServiceBuilder.Cacher("ExchangeBillService.GetBillAsync", storeId, userId, billId);
                var results  = await _makeRequest.StartUseCache(api.GetBillAsync(storeId, userId, billId, calToken), cacheKey, force, calToken);

                if (results != null && results?.Code >= 0)
                {
                    model = results?.Data;
                }
                return(model);
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #5
0
        /// <summary>
        /// 完成盘点
        /// </summary>
        /// <param name="billId"></param>
        /// <returns></returns>
        public async Task <bool> SetInventoryCompletedAsync(int billId = 0, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api     = RefitServiceBuilder.Build <IInventoryApi>(URL);
                var results = await _makeRequest.Start(api.SetInventoryCompletedAsync(storeId, userId, billId, calToken), calToken);

                if (results?.Data != null && results?.Code >= 0)
                {
                    return((bool)(results?.Success));
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(false);
            }
        }
Пример #6
0
        /// <summary>
        /// 获取全部盘点单据
        /// </summary>
        /// <param name="makeuserId"></param>
        /// <param name="inventoryPerson"></param>
        /// <param name="wareHouseId"></param>
        /// <param name="billNumber"></param>
        /// <param name="remark"></param>
        /// <param name="auditedStatus"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="inventoryStatus"></param>
        /// <param name="showReverse"></param>
        /// <param name="sortByCompletedTime"></param>
        /// <param name="pagenumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task <IList <InventoryPartTaskBillModel> > GetInventoryAllsAsync(int?makeuserId, int?inventoryPerson, int?wareHouseId, string billNumber, string remark, bool?auditedStatus = null, DateTime?startTime = null, DateTime?endTime = null, int?inventoryStatus = -1, bool?showReverse = null, bool?sortByCompletedTime = null, int pagenumber = 0, int pageSize = 20, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api = RefitServiceBuilder.Build <IInventoryApi>(URL);

                var cacheKey = RefitServiceBuilder.Cacher("GetInventoryAllsAsync", storeId,
                                                          makeuserId,
                                                          inventoryPerson,
                                                          wareHouseId,
                                                          billNumber,
                                                          remark,
                                                          auditedStatus,
                                                          startTime,
                                                          endTime,
                                                          inventoryStatus,
                                                          showReverse,
                                                          sortByCompletedTime,
                                                          pagenumber,
                                                          pageSize);

                var results = await _makeRequest.StartUseCache(api.GetInventoryAllsAsync(storeId,
                                                                                         makeuserId,
                                                                                         inventoryPerson,
                                                                                         wareHouseId,
                                                                                         billNumber,
                                                                                         remark,
                                                                                         auditedStatus,
                                                                                         startTime,
                                                                                         endTime,
                                                                                         inventoryStatus,
                                                                                         showReverse,
                                                                                         sortByCompletedTime,
                                                                                         pagenumber,
                                                                                         pageSize, calToken),
                                                               cacheKey, force, calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data.ToList());
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #7
0
        /// <summary>
        /// 库存查询
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public async Task <IList <StockReportProduct> > GetStocksAsync(int?wareHouseId = 0, int?categoryId = 0, int?productId = 0, string productName = "", int?brandId = 0, bool?status = null, int?maxStock = 0, bool?showZeroStack = null, int pagenumber = 50, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api = RefitServiceBuilder.Build <IReportingApi>(URL);

                var cacheKey = RefitServiceBuilder.Cacher("GetStocksAsync", storeId,
                                                          wareHouseId,
                                                          categoryId,
                                                          productId,
                                                          productName,
                                                          brandId,
                                                          status,
                                                          maxStock,
                                                          showZeroStack,
                                                          pagenumber);

                var results = await _makeRequest.StartUseCache(api.GetStocksAsync(storeId,
                                                                                  wareHouseId,
                                                                                  categoryId,
                                                                                  productId,
                                                                                  productName,
                                                                                  brandId,
                                                                                  status,
                                                                                  maxStock,
                                                                                  showZeroStack,
                                                                                  pagenumber, calToken),
                                                               cacheKey, force, calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #8
0
        /// <summary>
        /// 获取销售单
        /// </summary>
        /// <param name="makeuserId"></param>
        /// <param name="terminalId"></param>
        /// <param name="terminalName"></param>
        /// <param name="businessUserId"></param>
        /// <param name="districtId"></param>
        /// <param name="deliveryUserId"></param>
        /// <param name="wareHouseId"></param>
        /// <param name="billNumber"></param>
        /// <param name="remark"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="auditedStatus"></param>
        /// <param name="sortByAuditedTime"></param>
        /// <param name="showReverse"></param>
        /// <param name="showReturn"></param>
        /// <param name="paymentMethodType"></param>
        /// <param name="billSourceType"></param>
        /// <param name="handleStatus"></param>
        /// <param name="pagenumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task <IList <SaleBillModel> > GetSalebillsAsync(int?makeuserId, int?terminalId, string terminalName, int?businessUserId, int?districtId, int?deliveryUserId, int?wareHouseId, string billNumber, string remark, DateTime?startTime = null, DateTime?endTime = null, bool?auditedStatus = null, bool?sortByAuditedTime = null, bool?showReverse = null, bool?showReturn = null, int?paymentMethodType = null, int?billSourceType = null, bool?handleStatus = null, int?sign = null, int pagenumber = 0, int pageSize = 30, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api = RefitServiceBuilder.Build <ISaleBillApi>(URL);

                var results = await _makeRequest.Start(api.GetSalebillsAsync(storeId,
                                                                             makeuserId,
                                                                             terminalId,
                                                                             terminalName,
                                                                             businessUserId,
                                                                             districtId,
                                                                             deliveryUserId,
                                                                             wareHouseId,
                                                                             billNumber,
                                                                             remark,
                                                                             startTime,
                                                                             endTime,
                                                                             auditedStatus,
                                                                             sortByAuditedTime,
                                                                             showReverse,
                                                                             showReturn,
                                                                             paymentMethodType,
                                                                             billSourceType,
                                                                             handleStatus,
                                                                             sign,
                                                                             pagenumber,
                                                                             pageSize, calToken), calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data.ToList());
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #9
0
        /// <summary>
        /// 热销排行榜
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public async Task <IList <HotSaleRanking> > GetHotSaleRankingAsync(int?terminalId = null, int?businessUserId = null, int?brandId = null, int?categoryId = null, DateTime?startTime = null, DateTime?endTime = null, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api = RefitServiceBuilder.Build <IReportingApi>(URL);

                var cacheKey = RefitServiceBuilder.Cacher("GetHotSaleRankingAsync",
                                                          storeId,
                                                          terminalId,
                                                          businessUserId,
                                                          brandId,
                                                          categoryId,
                                                          force,
                                                          startTime,
                                                          endTime);

                var results = await _makeRequest.StartUseCache(api.GetHotSaleRankingAsync(storeId,
                                                                                          terminalId,
                                                                                          businessUserId,
                                                                                          brandId,
                                                                                          categoryId,
                                                                                          startTime,
                                                                                          endTime,
                                                                                          calToken),
                                                               cacheKey,
                                                               force,
                                                               calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #10
0
        /// <summary>
        /// 红冲
        /// </summary>
        /// <param name="billId"></param>
        /// <returns></returns>
        public async Task <bool> ReverseAsync(int billId = 0, string remark = "", CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;
                var api     = RefitServiceBuilder.Build <ISaleBillApi>(URL);
                var results = await _makeRequest.Start(api.ReverseAsync(storeId, userId, billId, remark, calToken), calToken);

                return((bool)(results?.Success));
            }
            catch (Exception e)
            {
                e.HandleException();
                return(false);
            }
        }
Пример #11
0
 /// <summary>
 /// 业务员综合分析
 /// </summary>
 /// <param name="args"></param>
 /// <returns></returns>
 public IObservable <APIResult <BusinessAnalysis> > Rx_GetBusinessAnalysis(int?type = null, CancellationToken calToken = default)
 {
     try
     {
         int storeId  = Settings.StoreId;
         int userId   = Settings.UserId;
         var api      = RefitServiceBuilder.Build <IReportingApi>(URL);
         var cacheKey = RefitServiceBuilder.Cacher("GetBusinessAnalysis", storeId, type);
         var results  = _makeRequest.StartUseCache_Rx(api.GetBusinessAnalysis(storeId, type, true, calToken), cacheKey, calToken);
         return(results);
     }
     catch (Exception e)
     {
         e.HandleException();
         return(null);
     }
 }
Пример #12
0
        /// <summary>
        /// 提交单据
        /// </summary>
        /// <param name="data"></param>
        /// <param name="billId"></param>
        /// <returns></returns>
        public async Task <APIResult <ReturnReservationBillUpdateModel> > CreateOrUpdateAsync(ReturnReservationBillUpdateModel data, int billId = 0, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;
                var api     = RefitServiceBuilder.Build <IReturnReservationBillApi>(URL);
                var results = await _makeRequest.Start(api.CreateOrUpdateAsync(data, storeId, userId, billId, calToken), calToken);

                return(results);
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #13
0
        /// <summary>
        /// 获取库存
        /// </summary>
        /// <returns></returns>
        public async Task <IList <WareHouseModel> > GetWareHousesAsync(BillTypeEnum btype, string searchStr = "", int pageIndex = 0, int pageSize = 50, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api = RefitServiceBuilder.Build <IWareHousesApi>(URL);

                var cacheKey = RefitServiceBuilder.Cacher("GetWareHousesAsync",
                                                          storeId,
                                                          userId,
                                                          (int)btype,
                                                          searchStr,
                                                          true,
                                                          pageIndex,
                                                          pageSize);

                var results = await _makeRequest.StartUseCache(api.GetWareHousesAsync(storeId,
                                                                                      userId,
                                                                                      (int)btype,
                                                                                      searchStr,
                                                                                      pageIndex,
                                                                                      pageSize,
                                                                                      calToken),
                                                               cacheKey,
                                                               true,
                                                               calToken,
                                                               TimeSpan.FromSeconds(5));

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data?.ToList());
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #14
0
        /// <summary>
        /// 用于单据拒签
        /// </summary>
        /// <param name="data"></param>
        /// <param name="billId"></param>
        /// <param name="cts"></param>
        /// <returns></returns>
        public async Task <APIResult <DeliverySignUpdateModel> > RefusedConfirmAsync(DeliverySignUpdateModel data, int billId = 0, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api     = RefitServiceBuilder.Build <ISaleBillApi>(URL);
                var results = await _makeRequest.Start(api.RefusedConfirmAsync(data, storeId, userId, billId, calToken), calToken);

                return(results);
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #15
0
        /// <summary>
        /// 获取盘点单
        /// </summary>
        /// <param name="billId"></param>
        /// <returns></returns>
        public async Task <InventoryPartTaskBillModel> GetInventoryPartTaskBillAsync(int billId, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api     = RefitServiceBuilder.Build <IInventoryApi>(URL);
                var results = await _makeRequest.Start(api.GetInventoryPartTaskBillAsync(storeId, userId, billId, calToken));

                return(results?.Data);
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #16
0
        /// <summary>
        /// 获取已签收单据
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public async Task <IList <DeliverySignModel> > GetDeliveriedSignsAsync(int userId, DateTime?start = null, DateTime?end = null, int?businessUserId = null, int?terminalId = null, int pageIndex = 0, int pageSize = 20, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;

                var api = RefitServiceBuilder.Build <ISaleBillApi>(URL);

                var cacheKey = RefitServiceBuilder.Cacher("GetDeliveriedSignsAsync", storeId,
                                                          userId,
                                                          start,
                                                          end,
                                                          businessUserId,
                                                          terminalId,
                                                          pageIndex,
                                                          pageSize);

                var results = await _makeRequest.StartUseCache(api.GetDeliveriedSignsAsync(storeId,
                                                                                           userId,
                                                                                           start,
                                                                                           end,
                                                                                           businessUserId,
                                                                                           terminalId,
                                                                                           pageIndex,
                                                                                           pageSize, calToken),
                                                               cacheKey, force, calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data.ToList());
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #17
0
 public IObservable <APIResult <DashboardReport> > Rx_GetDashboardReportAsync(CancellationToken calToken = default)
 {
     try
     {
         int storeId         = Settings.StoreId;
         var businessUserIds = new int[] { Settings.UserId };
         var cacheKey        = RefitServiceBuilder.Cacher("GetDashboardReportAsync", storeId, businessUserIds);
         var results         = _makeRequest.StartUseCache_Rx(RefitServiceBuilder.Build <IReportingApi>(URL).GetDashboardReportAsync(storeId, businessUserIds, calToken), cacheKey, calToken);
         return(results);
     }
     catch (System.ObjectDisposedException e)
     {
         e.HandleException();
         return(null);
     }
     catch (Exception e)
     {
         e.HandleException();
         return(null);
     }
 }
Пример #18
0
        /// <summary>
        /// 获取调拨单
        /// </summary>
        /// <param name="forceRefresh"></param>
        /// <param name="makeuserId"></param>
        /// <param name="businessUserId"></param>
        /// <param name="shipmentWareHouseId"></param>
        /// <param name="incomeWareHouseId"></param>
        /// <param name="billNumber"></param>
        /// <param name="remark"></param>
        /// <param name="auditedStatus"></param>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        /// <param name="showReverse"></param>
        /// <param name="sortByAuditedTime"></param>
        /// <param name="pagenumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task <IList <AllocationBillModel> > GetAllocationsAsync(int?makeuserId, int businessUserId, int?shipmentWareHouseId, int?incomeWareHouseId, string billNumber, string remark, bool?auditedStatus = null, DateTime?startTime = null, DateTime?endTime = null, bool?showReverse = null, bool?sortByAuditedTime = null, int pagenumber = 0, int pageSize = 20, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api = RefitServiceBuilder.Build <IAllocationApi>(URL);

                var results = await _makeRequest.Start(api.GetAllocationsAsync(storeId,
                                                                               makeuserId,
                                                                               businessUserId,
                                                                               shipmentWareHouseId,
                                                                               incomeWareHouseId,
                                                                               billNumber,
                                                                               remark,
                                                                               auditedStatus,
                                                                               startTime,
                                                                               endTime,
                                                                               showReverse,
                                                                               sortByAuditedTime,
                                                                               pagenumber,
                                                                               pageSize,
                                                                               calToken), calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data.ToList());
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #19
0
 public IObservable <APIResult <ReturnReservationBillModel> > Rx_GetInitDataAsync(CancellationToken calToken = default)
 {
     try
     {
         int storeId  = Settings.StoreId;
         int userId   = Settings.UserId;
         var api      = RefitServiceBuilder.Build <IReturnReservationBillApi>(URL);
         var cacheKey = RefitServiceBuilder.Cacher("ReturnReservationBillService.GetInitDataAsync", storeId, userId);
         var results  = _makeRequest.StartUseCache_Rx(api.GetInitDataAsync(storeId, userId, calToken), cacheKey, calToken);
         return(results);
     }
     catch (System.ObjectDisposedException e)
     {
         e.HandleException();
         return(null);
     }
     catch (Exception e)
     {
         e.HandleException();
         return(null);
     }
 }
Пример #20
0
        public IObservable <APIResult <IList <HotSaleRanking> > > Rx_GetHotSaleRankingAsync(int?terminalId = null, int?businessUserId = null, int?brandId = null, int?categoryId = null, DateTime?startTime = null, DateTime?endTime = null, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;

                var api = RefitServiceBuilder.Build <IReportingApi>(URL);

                var cacheKey = RefitServiceBuilder.Cacher("Rx_GetHotSaleRankingAsync",
                                                          storeId,
                                                          terminalId,
                                                          businessUserId,
                                                          brandId,
                                                          categoryId,
                                                          startTime?.ToString("yyy-MM-dd"),
                                                          endTime?.ToString("yyy-MM-dd"));

                var results = _makeRequest.StartUseCache_Rx(api.GetHotSaleRankingAsync(storeId,
                                                                                       terminalId,
                                                                                       businessUserId,
                                                                                       brandId,
                                                                                       categoryId,
                                                                                       startTime,
                                                                                       endTime,
                                                                                       calToken),
                                                            cacheKey,
                                                            calToken);

                return(results);
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #21
0
        /// <summary>
        /// 获取备注
        /// </summary>
        /// <param name="cts"></param>
        /// <returns></returns>
        public async Task <Dictionary <int, string> > GetRemarkConfigListSetting(CancellationToken calToken = default)
        {
            //{"Success":true,"Data":{"98":"赠品","99":"费用","100":"付款未到货","101":"搭赠","102":"兑奖","103":"捆绑","104":"满立减","105":"1元换购","106":"空瓶兑换","107":"费用货补","108":"代垫","109":"古井","110":"商品抵费用","111":"有成本兑奖赠酒"}}
            Dictionary <int, string> dic = new Dictionary <int, string>();

            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;
                var api     = RefitServiceBuilder.Build <ISettingApi>(URL);
                var results = await _makeRequest.Start(api.GetRemarkConfigListSetting(storeId, calToken), calToken);

                if (results != null && results?.Code >= 0)
                {
                    dic = results?.Data;
                }
                return(dic);
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #22
0
        /// <summary>
        /// 检查盘点
        /// </summary>
        /// <param name="wareHouseId"></param>
        /// <returns></returns>
        public async Task <IList <InventoryPartTaskBillModel> > CheckInventoryAsync(int wareHouseId, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                int userId  = Settings.UserId;
                var api     = RefitServiceBuilder.Build <IInventoryApi>(URL);
                var results = await _makeRequest.Start(api.CheckInventoryAsync(storeId, userId, wareHouseId, calToken), calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data.ToList());
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }
Пример #23
0
        /// <summary>
        ///  获取待签收单据(已经调度且未签收单据)
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public async Task <IList <DispatchItemModel> > GetUndeliveredSignsAsync(int?userId, DateTime?start = null, DateTime?end = null, int?businessUserId = null, int?districtId = null, int?terminalId = null, string terminalName = "", string billNumber = "", int?deliveryUserId = null, int?channelId = null, int?rankId = null, int?billTypeId = null, bool?showDispatchReserved = null, bool?dispatchStatus = null, int pageIndex = 0, int pageSize = 20, bool force = false, CancellationToken calToken = default)
        {
            try
            {
                int storeId = Settings.StoreId;
                deliveryUserId = userId;

                var api = RefitServiceBuilder.Build <ISaleBillApi>(URL);

                var cacheKey = RefitServiceBuilder.Cacher("GetUndeliveredSignsAsync", storeId,
                                                          userId,
                                                          start,
                                                          end,
                                                          businessUserId,
                                                          districtId,
                                                          terminalId,
                                                          terminalName,
                                                          billNumber,
                                                          deliveryUserId,
                                                          channelId,
                                                          rankId,
                                                          billTypeId,
                                                          showDispatchReserved,
                                                          dispatchStatus,
                                                          pageIndex,
                                                          pageSize);

                var results = await _makeRequest.StartUseCache(api.GetUndeliveredSignsAsync(storeId,
                                                                                            userId,
                                                                                            start,
                                                                                            end,
                                                                                            businessUserId,
                                                                                            districtId,
                                                                                            terminalId,
                                                                                            terminalName,
                                                                                            billNumber,
                                                                                            deliveryUserId,
                                                                                            channelId,
                                                                                            rankId,
                                                                                            billTypeId,
                                                                                            showDispatchReserved,
                                                                                            dispatchStatus,
                                                                                            pageIndex,
                                                                                            pageSize, calToken),
                                                               cacheKey, force, calToken);

                if (results != null && results?.Code >= 0)
                {
                    return(results?.Data.ToList());
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                e.HandleException();
                return(null);
            }
        }