Exemplo n.º 1
0
 /// <summary>
 /// 查询自提点信息
 /// </summary>
 /// <param name="id">自提点ID</param>
 /// <returns>结果</returns>
 public System.Collections.Generic.List <Jinher.AMP.BTP.Deploy.CustomDTO.SelfTakeStationResult> GetAllSelfTakeStation(Jinher.AMP.BTP.Deploy.CustomDTO.SelfTakeStationSearchSDTO selfTakeStationSearch, out int rowCount)
 {
     base.Do();
     return(this.Command.GetAllSelfTakeStation(selfTakeStationSearch, out rowCount));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 查询自提点信息
        /// </summary>
        /// <param name="id">自提点ID</param>
        /// <returns>结果</returns>
        public System.Collections.Generic.List <Jinher.AMP.BTP.Deploy.CustomDTO.SelfTakeStationResult> GetAllSelfTakeStation(Jinher.AMP.BTP.Deploy.CustomDTO.SelfTakeStationSearchSDTO selfTakeStationSearch, out int rowCount)
        {
            //定义返回值
            System.Collections.Generic.List <Jinher.AMP.BTP.Deploy.CustomDTO.SelfTakeStationResult> result;

            try
            {
                //调用代理方法
                result = base.Channel.GetAllSelfTakeStation(selfTakeStationSearch, out rowCount);
            }
            catch
            {
                //抛异常
                throw;
            }
            finally
            {
                //关链接
                ChannelClose();
            }            //返回结果
            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 查询自提点信息
        /// </summary>
        /// <param name="selfTakeStationSearch">查询类</param>
        /// <param name="rowCount">总记录数</param>
        /// <returns>结果</returns>
        public System.Collections.Generic.List <Jinher.AMP.BTP.Deploy.CustomDTO.SelfTakeStationResult> GetAllSelfTakeStationExt(Jinher.AMP.BTP.Deploy.CustomDTO.SelfTakeStationSearchSDTO selfTakeStationSearch, out int rowCount)
        {
            List <SelfTakeStationResult> result = new List <SelfTakeStationResult>();
            //总代名称
            string cityOwnerName = string.Empty;

            if (selfTakeStationSearch == null || selfTakeStationSearch.pageIndex < 1 || selfTakeStationSearch.pageSize < 1)
            {
                rowCount = 0;
                return(result);
            }

            var query = SelfTakeStation.ObjectSet().Where(t => !t.IsDel);

            if (selfTakeStationSearch.SelfTakeStationType != null)
            {
                query = query.Where(t => t.SelfTakeStationType == selfTakeStationSearch.SelfTakeStationType);
            }

            if (selfTakeStationSearch.CityOwnerId != Guid.Empty)
            {
                query = query.Where(t => t.CityOwnerId == selfTakeStationSearch.CityOwnerId);
            }

            if (!string.IsNullOrWhiteSpace(selfTakeStationSearch.Name))
            {
                query = query.Where(t => t.Name.Contains(selfTakeStationSearch.Name));
            }
            if (selfTakeStationSearch.AppId != Guid.Empty)
            {
                query = query.Where(t => t.AppId == selfTakeStationSearch.AppId);
            }

            query    = query.Distinct();
            rowCount = query.Count();

            query = query.OrderByDescending(n => n.SubTime).Skip((selfTakeStationSearch.pageIndex - 1) * selfTakeStationSearch.pageSize).Take(selfTakeStationSearch.pageSize);

            var tmpResult = query.ToList();

            if (tmpResult.Count == 0)
            {
                rowCount = 0;
                return(result);
            }
            //总代名称服
            //try
            //{
            //    Jinher.AMP.ZPH.ISV.Facade.ProxyFacade proxyFac = new ZPH.ISV.Facade.ProxyFacade();
            //    Jinher.AMP.ZPH.Deploy.CustomDTO.ReturnInfo<List<Jinher.AMP.ZPH.Deploy.CustomDTO.ProxyContentCDTO>> resultProxy = proxyFac.GetProxyById4BTP(selfTakeStationSearch.CityOwnerId);
            //    cityOwnerName = resultProxy.Data[0].proxyName;
            //}
            //catch (Exception ex)
            //{
            //    LogHelper.Error(string.Format("获取总代名称服务异常。id:{0}", selfTakeStationSearch.CityOwnerId), ex);
            //    rowCount = 0;
            //    return result;
            //}

            //总代名称服
            if (selfTakeStationSearch.SelfTakeStationType == 0)
            {
                try
                {
                    Jinher.AMP.ZPH.Deploy.CustomDTO.QueryProxyPrarm prarm = new ZPH.Deploy.CustomDTO.QueryProxyPrarm();
                    prarm.changeOrg = selfTakeStationSearch.CityOwnerId;

                    Jinher.AMP.ZPH.Deploy.CustomDTO.ProxyContentCDTO proxyContent = new ZPH.Deploy.CustomDTO.ProxyContentCDTO();
                    Jinher.AMP.ZPH.Deploy.CustomDTO.ReturnInfo <List <Jinher.AMP.ZPH.Deploy.CustomDTO.ProxyContentCDTO> > resultProxy = Jinher.AMP.BTP.TPS.ZPHSV.Instance.GetAllProxyList4BTP(prarm);
                    cityOwnerName = resultProxy.Data[0].proxyName;
                }
                catch (Exception ex)
                {
                    LogHelper.Error(string.Format("获取总代名称服务异常。id:{0}", selfTakeStationSearch.CityOwnerId), ex);
                    rowCount = 0;
                    return(result);
                }
            }

            //取负责人信息
            var ids = tmpResult.Select(t => t.Id).ToList();
            var selfTakeStationManager = SelfTakeStationManager.ObjectSet().Where(t => ids.Contains(t.SelfTakeStationId) && !t.IsDel).ToList();


            try
            {
                foreach (var item in tmpResult)
                {
                    SelfTakeStationResult data = new SelfTakeStationResult();
                    data.Id          = item.Id;
                    data.CityOwnerId = item.CityOwnerId;
                    data.Name        = item.Name;
                    data.Province    = item.Province;
                    data.City        = item.City;
                    data.District    = item.District;
                    data.Address     = item.Address;
                    data.SpreadUrl   = item.SpreadUrl;
                    data.Remark      = item.Remark;
                    data.SubTime     = item.SubTime;
                    data.ModifiedOn  = item.ModifiedOn;
                    data.QRCodeUrl   = item.QRCodeUrl;
                    data.SpreadCode  = item.SpreadCode;

                    data.CityOwnerName = cityOwnerName;

                    string province = Jinher.AMP.BTP.Common.ProvinceCityHelper.GetAreaNameByCode(data.Province);
                    string city     = string.Empty;
                    ////北京110000 天津120000 上海310000 重庆500000
                    //List<string> specialCityList = new List<string>() { "110000", "120000", "310000", "500000" };
                    //if (specialCityList.Contains(data.Province))
                    //{
                    //    city = "";
                    //}
                    //else
                    //{
                    //    city = Jinher.AMP.BTP.Common.ProvinceCityHelper.GetAreaNameByCode(data.City);
                    //}
                    city = Jinher.AMP.BTP.Common.ProvinceCityHelper.GetAreaNameByCode(data.City);
                    data.AddressDetail = province + city + data.Address;

                    //附上负责人信息
                    var selfManager = (from manager in selfTakeStationManager
                                       where manager.SelfTakeStationId == item.Id && !manager.IsDel
                                       select new Jinher.AMP.BTP.Deploy.CustomDTO.SelfTakeStationManagerSDTO
                    {
                        Id = manager.Id,
                        SubTime = manager.SubTime,
                        ModifiedOn = manager.ModifiedOn,
                        UserCode = manager.UserCode,
                        UserId = manager.UserId,
                        SelfTakeStationId = manager.SelfTakeStationId
                    }).ToList();
                    data.SelfTakeStationManageList = selfManager;

                    result.Add(data);
                }
                return(result);
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("查询自提点BP服务异常。selfTakeStationSearch:{0}", JsonHelper.JsonSerializer(selfTakeStationSearch)), ex);
                rowCount = 0;
                return(result);
            }
        }