public async Task <ExchangeOrder[]> GetMyExchangeOrderListJson() { string AuthKey = Request.Form["AuthKey"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.GetMyExchangeOrderListAsync(AuthKey)); }
public async Task <int> CustomerServiceAccept() { try { Logger.Info($"进入工单推送"); string AuthKey = Request.Form["AuthKey"].ToString(); string Topic = Request.Form["Topic"].ToString(); string Content = Request.Form["Content"].ToString(); string ServiceStaff = "0"; int AcceptSource = 578; Logger.Info($"工单推送参数AuthKey:{AuthKey},Topic={Topic},Content={Content},ServiceStaff={ServiceStaff},AcceptSource={AcceptSource}"); Logger.Info($"工单推送美驰key:{AuthKey}"); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); var result = await client.CustomerServiceAcceptAsync(AuthKey, Topic, Content, ServiceStaff, AcceptSource); if (result == -100) { result = await client.CustomerServiceAcceptAsync(AuthKey, Topic, Content, ServiceStaff, AcceptSource); } Logger.Info($"工单推送调用结果:{result}"); return(result); } catch (Exception ex) { Logger.Error(ex.Message + ex.StackTrace); throw ex; } }
public async Task <string> GetGiftsByCatalogJson() { int Catalog = -1; int.TryParse(Request.Form["Catalog"].ToString(), out Catalog); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); string result = ""; try { result = await client.GetGiftsByCatalogJsonAsync(await DefaultUserLoginAndGetMCKey(), Catalog); } catch { result = await client.GetGiftsByCatalogJsonAsync(await DefaultUserLoginAndGetMCKey(true), Catalog); } var AesResult = await GetDefaultAesKey(); try { return(AesCryptoService.Decrypt(result, AesResult.CryptAESKey, AesResult.CryptAESIV)); } catch { AesResult = await GetDefaultAesKey(true); return(AesCryptoService.Decrypt(result, AesResult.CryptAESKey, AesResult.CryptAESIV)); } }
public async Task <string> GetGiftInfoJson() { string GiftCode = Request.Form["GiftCode"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); string result = ""; try { result = await client.GetGiftInfoJsonAsync(await DefaultUserLoginAndGetMCKey(), GiftCode); } catch { result = await client.GetGiftInfoJsonAsync(await DefaultUserLoginAndGetMCKey(true), GiftCode); } var AesResult = await GetDefaultAesKey(); try { return(AesCryptoService.Decrypt(result, AesResult.CryptAESKey, AesResult.CryptAESIV)); } catch { AesResult = await GetDefaultAesKey(true); return(AesCryptoService.Decrypt(result, AesResult.CryptAESKey, AesResult.CryptAESIV)); } }
public async Task <int> SendUserRegisterMail() { string AuthKey = Request.Form["AuthKey"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.SendUserRegisterMailAsync(AuthKey)); }
public async Task <Member> GetMyMemberInfoJson() { string AuthKey = Request.Form["AuthKey"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.GetMyMemberInfoAsync(AuthKey)); }
public async Task <decimal> GetPointsBalance() { string AuthKey = Request.Form["AuthKey"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); var balance = await client.GetPointsBalanceAsync(AuthKey); return(balance); }
public async Task <int> DeliveryAddressDel() { string AuthKey = Request.Form["AuthKey"].ToString(); int AddrID = -1; int.TryParse(Request.Form["AddrID"].ToString(), out AddrID); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.DeliveryAddressDelAsync(AuthKey, AddrID)); }
public async Task <int> SignInExchangeOrder() { string AuthKey = Request.Form["AuthKey"].ToString(); int OrderID = -1; int.TryParse(Request.Form["OrderID"].ToString(), out OrderID); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.SignInExchangeOrderAsync(AuthKey, OrderID)); }
public async Task <string> GetDeliveryAddressJson() { string AuthKey = Request.Form["AuthKey"].ToString(); string AesKey = Request.Form["AesKey"].ToString(); string Iv = Request.Form["Iv"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); var result = await client.GetDeliveryAddressJsonAsync(AuthKey); return(AesCryptoService.DecryptText(result, AesKey, Iv)); }
public async Task <int> MemberBindWeChat() { string AuthKey = Request.Form["AuthKey"].ToString(); string UserWeChat = Request.Form["UserWeChat"].ToString(); string CompanyWeChat = Request.Form["CompanyWeChat"].ToString(); string Remark = Request.Form["Remark"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.MemberBindWeChatAsync(AuthKey, UserWeChat, CompanyWeChat, Remark)); }
public async Task <int> ChangeExchangeOrderAddressJson() { string AuthKey = Request.Form["AuthKey"].ToString(); int OrderID = -1; int.TryParse(Request.Form["OrderID"].ToString(), out OrderID); string NewAddress = Request.Form["NewAddress"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.ChangeExchangeOrderAddressJsonAsync(AuthKey, OrderID, NewAddress)); }
public async Task <int> CancelExchangeOrderEx() { string AuthKey = Request.Form["AuthKey"].ToString(); int OrderID = -1; int.TryParse(Request.Form["OrderID"].ToString(), out OrderID); string CancelRemark = Request.Form["CancelRemark"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.CancelExchangeOrderExAsync(AuthKey, OrderID, CancelRemark)); }
public async Task <int> DeliveryAddressAddJson() { string AuthKey = Request.Form["AuthKey"].ToString(); string AesKey = Request.Form["AesKey"].ToString(); string Iv = Request.Form["Iv"].ToString(); string Addr = Request.Form["Addr"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); var aesAddr = AesCryptoService.Encrypt(Addr, AesKey, Iv); return(await client.DeliveryAddressAddJsonAsync(AuthKey, aesAddr)); }
public async Task <string> GetPointsChangeDetailJson() { string AuthKey = Request.Form["AuthKey"].ToString(); string AesKey = Request.Form["AesKey"].ToString(); string Iv = Request.Form["Iv"].ToString(); DateTime BeginDate = DateTime.MinValue; DateTime EndDate = DateTime.MinValue; DateTime.TryParse(Request.Form["BeginDate"].ToString(), out BeginDate); DateTime.TryParse(Request.Form["EndDate"].ToString(), out EndDate); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); var result = await client.GetPointsChangeDetailJsonAsync(AuthKey, BeginDate, EndDate); return(AesCryptoService.DecryptText(result, AesKey, Iv)); }
public async Task <AddProductPointsResponse> AddProductPoints() { string AuthKey = Request.Form["AuthKey"].ToString(); string ProductCode = Request.Form["ProductCode"].ToString(); string Retailer = Request.Form["Retailer"].ToString(); int Channel = -1; int.TryParse(Request.Form["Channel"].ToString(), out Channel); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.AddProductPointsAsync(new AddProductPointsRequest { AuthKey = AuthKey, Retailer = Retailer, ProductCode = ProductCode })); }
public async Task <int> CustomerExchangeOrderApplyEx() { string AuthKey = Request.Form["AuthKey"].ToString(); string Consignee = Request.Form["Consignee"].ToString(); string Address = Request.Form["Address"].ToString(); string Mobile = Request.Form["Mobile"].ToString(); string AcceptRemark = Request.Form["AcceptRemark"].ToString(); string ProductIDs = Request.Form["ProductIDs"].ToString(); string Quantitys = Request.Form["Quantitys"].ToString(); int OfficialCity = -1; int.TryParse(Request.Form["OfficialCity"].ToString(), out OfficialCity); int Source = -1; int.TryParse(Request.Form["Source"].ToString(), out Source); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.CustomerExchangeOrderApplyExAsync(AuthKey, OfficialCity, Consignee, Address, Mobile, AcceptRemark, ProductIDs, Quantitys, Source)); }
public async Task <int> GetGiftInventory() { int GiftID = -1; int.TryParse(Request.Form["GiftID"].ToString(), out GiftID); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); int result = 0; try { result = await client.GetGiftInventoryAsync(await DefaultUserLoginAndGetMCKey(), GiftID); } catch { result = await client.GetGiftInventoryAsync(await DefaultUserLoginAndGetMCKey(true), GiftID); } return(result); }
public async Task <int> ChangeExchangeOrderAddress() { string AuthKey = Request.Form["AuthKey"].ToString(); string Consignee = Request.Form["Consignee"].ToString(); string Address = Request.Form["Address"].ToString(); string Mobile = Request.Form["Mobile"].ToString(); string AcceptRemark = Request.Form["AcceptRemark"].ToString(); int OrderID = -1; int.TryParse(Request.Form["OrderID"].ToString(), out OrderID); int OfficialCity = -1; int.TryParse(Request.Form["OfficialCity"].ToString(), out OfficialCity); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); return(await client.ChangeExchangeOrderAddressAsync(AuthKey, OrderID, OfficialCity, Consignee, Address, Mobile, AcceptRemark)); }
public async Task <string> GetHotGiftsJson() { int TopCount = -1; int.TryParse(Request.Form["TopCount"].ToString(), out TopCount); int MaxPoints = -1; int.TryParse(Request.Form["MaxPoints"].ToString(), out MaxPoints); DateTime BeginDate = DateTime.MinValue; DateTime.TryParse(Request.Form["BeginDate"].ToString(), out BeginDate); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); string result = ""; try { result = await client.GetHotGiftsJsonAsync(await DefaultUserLoginAndGetMCKey(), TopCount, MaxPoints, BeginDate); } catch { result = await client.GetHotGiftsJsonAsync(await DefaultUserLoginAndGetMCKey(true), TopCount, MaxPoints, BeginDate); } var AesResult = await GetDefaultAesKey(); try { return(AesCryptoService.Decrypt(result, AesResult.CryptAESKey, AesResult.CryptAESIV)); } catch { AesResult = await GetDefaultAesKey(true); return(AesCryptoService.Decrypt(result, AesResult.CryptAESKey, AesResult.CryptAESIV)); } }
public async Task <string> GetRetailerListByOfficialCityJson() { Logger.Info("门店调用开始"); string AuthKey = Request.Form["AuthKey"].ToString(); string AesKey = Request.Form["AesKey"].ToString(); string Iv = Request.Form["Iv"].ToString(); int OfficialCity = 1; int.TryParse(Request.Form["OfficialCity"].ToString(), out OfficialCity); Logger.Info("城市id:" + OfficialCity); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); var result = await client.GetRetailerListByOfficialCityJsonAsync(AuthKey, OfficialCity); if (!string.IsNullOrWhiteSpace(result) && result != "null") { return(AesCryptoService.DecryptText(result, AesKey, Iv)); } else { return(result); } }
private async Task SetMemberInfo(string openId, string userName, string newPassword, string authKey, string AesKey, string Iv, string mobilePhone = null) { var members = await _mpUserMemberAppService.GetList(new MpUserMembers.Dto.GetMpUserMembersInput { MemberUserName = userName }); var fan = await _mpFanAppService.GetFirstOrDefaultByOpenID(openId); Logger.Info($"查询粉丝表信息,条件:{openId},结果:{JsonConvert.SerializeObject(fan)}"); if (members != null && members.Count > 0) { foreach (var item in members) { item.MemberPassword = newPassword; if (!string.IsNullOrEmpty(mobilePhone)) { item.MobilePhone = mobilePhone; } item.OpenID = openId; item.IsBinding = true; await _mpUserMemberAppService.Update(item); await _cacheManager.GetCache(AppConsts.Cache_MpUserMemberKey).RemoveAsync(item.OpenID);//重置会员缓存 } #region 更新粉丝信息 await _cacheManager.GetCache(AppConsts.Cache_MpFansByOpenId).RemoveAsync(openId); if (fan != null) { fan.MemberID = members[0].Id; await _mpFanAppService.Update(fan); } else { await _mpFanAppService.Create(new MpFans.Dto.MpFanDto { OpenID = openId, IsFans = true, MpID = 1, MemberID = members[0].Id, LastModificationTime = DateTime.Now }); } #endregion } else { #region 绑定openID MemberServiceSoapClient client22 = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); var bindResult = await client22.MemberBindWeChatAsync(authKey, openId, yiliwechat, ""); #endregion #region 新增会员信息 var member = await _mpUserMemberAppService.Create(new MpUserMembers.Dto.MpUserMemberDto() { OpenID = openId, MemeberUserName = userName, MemberPassword = newPassword, RegisterTime = DateTime.Now, CreationTime = DateTime.Now, IsDeleted = false, ChannelID = fan != null ? Convert.ToInt32(fan.ChannelID) : 0, ChannelName = fan != null ? fan.ChannelName : "", SubscribeTime = fan != null ? fan.SubscribeTime : null, IsBinding = true, BindingTime = DateTime.Now, }); await _mpUserMemberAppService.DeleteOtherSame(openId, member.Id); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); var mcmember = await client.GetMyMemberInfoAsync(authKey); member.MemberName = mcmember.RealName; member.CRMID = mcmember.CRMID; member.MemberType = mcmember.MemberType; member.BabyName = mcmember.BabyName; member.BabyBirthday = mcmember.Birthday; member.MemberIdentity = mcmember.HomeRole.ToString(); member.RegistProductName = mcmember.CollectProductName; member.RegistProduct = mcmember.CollectProduct; member.UsedBrand = mcmember.PreBrand; member.FeedingMode = mcmember.FeedMode; member.MonthConsumption = mcmember.EatQuantityOneMonth; member.DayConsumption = mcmember.EatTimesOneDay; member.OfficialCity = mcmember.OfficialCity; member.Address = mcmember.CollectProduct; member.LikeChannel = mcmember.ServicePreferences.ToString(); member.ServiceShop = mcmember.ServiceCMClientName; member.MobilePhone = mcmember.Mobile; await _mpUserMemberAppService.Update(member); Logger.Info($"新增会员信息 {JsonConvert.SerializeObject(mcmember)}"); #endregion #region 更新粉丝信息 await _cacheManager.GetCache(AppConsts.Cache_MpFansByOpenId).RemoveAsync(openId); if (fan != null) { fan.MemberID = member.Id; await _mpFanAppService.Update(fan); } else { await _mpFanAppService.Create(new MpFans.Dto.MpFanDto { OpenID = openId, IsFans = true, MpID = 1, MemberID = member.Id, LastModificationTime = DateTime.Now }); } #endregion } }
public async Task <int> UpdateMemberInfoJson() { string AuthKey = Request.Form["AuthKey"].ToString(); string AesKey = Request.Form["AesKey"].ToString(); string Iv = Request.Form["Iv"].ToString(); string Member = Request.Form["Member"].ToString(); MemberServiceSoapClient client = new MemberServiceSoapClient(MemberServiceSoapClient.EndpointConfiguration.MemberServiceSoap); Logger.Info("会员更新:" + AuthKey); var mckey = AuthKey; var aesMember = AesCryptoService.Encrypt(Member, AesKey, Iv); Logger.Info("传入更新的会员信息:" + Member); var result = await client.UpdateMemberInfoJsonAsync(mckey, aesMember); Logger.Info($"更新的结果:{result}"); #region 获取更新后美驰的会员信息 var jsonStr = await client.GetMyMemberInfoJsonAsync(mckey); if (!string.IsNullOrWhiteSpace(jsonStr) && jsonStr != "null") { string plainJson = AesCryptoService.DecryptText(jsonStr, AesKey, Iv); Logger.Info($"获取美驰的更新后的会员信息:{plainJson}"); } #endregion var openid = await _cacheManager.GetCache(AppConsts.Cache_AuthKey2OpenID).GetOrDefaultAsync(AuthKey); var member = await _mpUserMemberAppService.GetByOpenID(openid.ToString()); var newmember = JsonConvert.DeserializeObject <MeiChiMember>(Member); member.MemberType = newmember.MemberType; member.BabyName = newmember.BabyName; member.BabyBirthday = newmember.Birthday; member.MemberName = newmember.RealName; member.MemberIdentity = newmember.HomeRole.ToString(); member.RegistProductName = newmember.CollectProductName; member.RegistProduct = newmember.CollectProduct; member.UsedBrand = newmember.PreBrand; member.FeedingMode = newmember.FeedMode; member.MonthConsumption = newmember.EatQuantityOneMonth; member.DayConsumption = newmember.EatTimesOneDay; member.OfficialCity = newmember.OfficialCity; member.Address = newmember.Address; member.LikeChannel = newmember.ServicePreferences.ToString(); member.ServiceShop = newmember.serviceCMClientName; if (!string.IsNullOrWhiteSpace(newmember.OfficialCityName)) { var areaArray = newmember.OfficialCityName.Split(' '); member.Province = areaArray.Length > 0 ? areaArray[0] : string.Empty; member.City = areaArray.Length > 1 ? areaArray[1] : string.Empty; member.Area = areaArray.Length > 2 ? areaArray[2] : string.Empty; } //member.ServiceShopCode = newmember.serviceCMClientCode; member.CRMID = newmember.CRMID; var fans = await _mpFanAppService.GetFirstOrDefaultByOpenID(openid.ToString()); if (fans != null) { fans.MemberID = newmember.CRMID; await _mpFanAppService.Update(fans); } else { await _mpFanAppService.Create(new MpFans.Dto.MpFanDto { OpenID = openid.ToString(), IsFans = true, MpID = 1, MemberID = newmember.CRMID, LastModificationTime = DateTime.Now }); } await _mpUserMemberAppService.Update(member); return(result); }