Пример #1
0
        /// <summary>
        /// 判断商品是否厂送
        /// https://open.suning.com/ospos/apipage/toApiMethodDetailMenu.do?interCode=suning.govbus.judgefacproduct.get
        /// </summary>
        /// <param name="factoryDeliverDto"></param>
        /// <returns></returns>
        public static SNFactoryDeliveryReturnDTO JudgeIsFactoryDelivery(SNFactoryDeliveryDTO factoryDeliverDto)
        {
            SNFactoryDeliveryReturnDTO ret = new SNFactoryDeliveryReturnDTO();

            try
            {
                #region 将系统中自有的实体转换为苏宁自己的实体传入
                List <snsdk.suning_api_sdk.Models.CustomGovbusModel.JudgefacproductGetSkuIdsReq> listApplyRejList = new List <snsdk.suning_api_sdk.Models.CustomGovbusModel.JudgefacproductGetSkuIdsReq>();

                factoryDeliverDto.SkuIds.ForEach(p =>
                {
                    listApplyRejList.Add(new snsdk.suning_api_sdk.Models.CustomGovbusModel.JudgefacproductGetSkuIdsReq()
                    {
                        skuId = p.SkuId
                    });
                });

                snsdk.suning_api_sdk.BizRequest.CustomGovbusRequest.JudgefacproductGetRequest request = new snsdk.suning_api_sdk.BizRequest.CustomGovbusRequest.JudgefacproductGetRequest()
                {
                    cityId = factoryDeliverDto.CityId,
                    skuIds = listApplyRejList
                };
                #endregion
                snsdk.suning_api_sdk.BizResponse.CustomGovbusResponse.JudgefacproductGetResponse response = SuningClient.Execute(request);

                #region 构造返回实体

                if (response != null)
                {
                    List <SNFactoryDeliveryReturnListDTO> listRet = new List <SNFactoryDeliveryReturnListDTO>();

                    response.results.ForEach(p =>
                    {
                        listRet.Add(new SNFactoryDeliveryReturnListDTO()
                        {
                            IsFactorySend = p.isFactorySend.Equals("01") ? true : false, SkuId = p.skuId
                        });
                    });

                    ret = new SNFactoryDeliveryReturnDTO()
                    {
                        IsSuccess = response.isSuccess.Equals("Y") ? true : false, ResultsList = listRet
                    };
                }
                #endregion
            }
            catch (Exception ex)
            {
                LogHelper.Error("SuningSV.JudgeIsFactoryDelivery 判断商品是否厂送", ex);
            }
            return(ret);
        }
Пример #2
0
        /// <summary>
        /// 判断是否是厂送
        /// </summary>
        /// <param name="provinceName">省名称</param>
        /// <param name="cityName">城市名称</param>
        /// <param name="skuIds">9位或者11位商品编码</param>
        /// <returns></returns>
        public static List <SNFactoryDeliveryReturnListDTO> SNJudgeIsFactoryDelivery(string provinceName, string cityName, List <SNApplyRejectedSkusDTO> skuIds)
        {
            SNAreaDTO areaDto = GetCityId(provinceName, cityName);

            if (areaDto != null)
            {
                SNFactoryDeliveryDTO dto = new SNFactoryDeliveryDTO
                {
                    CityId = areaDto.A,
                    SkuIds = skuIds
                };

                SNFactoryDeliveryReturnDTO ty = SuningSV.JudgeIsFactoryDelivery(dto);
                if (ty != null && ty.IsSuccess)
                {
                    return(ty.ResultsList);
                }
            }
            return(new List <SNFactoryDeliveryReturnListDTO>());
        }