public ActionResult eBayCategories(eBayCategorySearch request) { if(!ModelState.IsValid){ //invalidate 처리 return null; } var result = new CommonBiz().GeteBayCategories(request); return Json(result,JsonRequestBehavior.AllowGet); }
public void GmarketVerify(List<string> gepId) { List<GmarketVerifyData> result = new CommonBiz().GmarketVerify(gepId); Trace.WriteLine(result.Count.ToString()); foreach (var data in result) { Trace.WriteLine(data.Message); Trace.WriteLine(data.GepItemsDataClass._id.ToString()); } }
public JsonResult GetCategoryGmktResult(ReqData data) { CommonBiz biz = new CommonBiz(); List<CategoryGmktInfoT> categories = biz.GetGmktCategory(data.Step, data.ParentCode); ReqResult result = new ReqResult(); result.ReturnForm = data.ReturnForm; result.CategoryGmkt = new List<CategoryGmktInfoT>(); result.CategoryGmkt = categories; return Json(result); }
// G마켓 카테고리를 사용하시려면 ~/Scripts/CategoryGmkt.js 를 Parent View에 include하세요. public PartialViewResult CategoryGmkt(string suffix) { CommonBiz biz = new CommonBiz(); List<CategoryGmktInfoT> lcategories = biz.GetGmktCategory("LC", ""); ViewBag.LCID = "GDLC_CD" + suffix; ViewBag.MCID = "GDMC_CD" + suffix; ViewBag.SCID = "GDSC_CD" + suffix; ViewBag.ListLCategory = lcategories; return PartialView(); }
internal void Process() { try { int result = new CommonBiz().TokenExpireDateCompareDaemonRun(); logger.Info(string.Format("Effect Count : {0}", result)); } catch (Exception ex) { logger.Error(string.Format("Exception!!\n[StackTrance]\n{0}", ex.StackTrace.ToString())); return; } }
public JsonResult GetCancelList(eBayCancelSearchModel model) { if (!ModelState.IsValid) { return Json(new JQGridResult()); } List<BsonValue> eBayIds = new List<BsonValue>(); if (model.sellerId == "All") { // TODO: (이태희) "eBay" 하드코딩? List<TaAccounts> taAccounts = new CommonBiz().GetTaeBayAccount(MemberContext.LoginID, "eBay"); foreach (TaAccounts t in taAccounts) { eBayIds.Add(BsonValue.Create(t.site_login_id)); } } else { eBayIds.Add(BsonValue.Create(model.sellerId)); } MongoPagingResult<EBayCancelGridT> GridData = new eBayOrderBiz().GeteBayCancelGridData(model.Page.Value , model.Rows.Value , eBayIds , Util.GetSafeInt(model.eBaySite) , (int)model.disputeRecordType.Value , (int)model.searchKind.Value , model.searchKey , model.startDate.Value , model.endDate.Value.AddDays(1)); JQGridResult result = new JQGridResult(); result.total = Math.Ceiling(Convert.ToDecimal(Convert.ToDecimal(GridData.Count) / 10)); result.page = model.Page.Value; result.rows = GridData.Result.ToArray(); result.Count = GridData.Count; return Json(result); }
//Mother상품비교변경사항체크 public ValidCheckResultT OriginVerification(BasketParamT reqBasketParam) { CommonBiz commonBiz = new CommonBiz(); ValidCheckResultT originValidCheckResult = new ValidCheckResultT(); GmarketVerifyDataClone gmktVerifyDataResult = new GmarketVerifyDataClone(); originValidCheckResult.Result = new GEPBaseResultT(); originValidCheckResult.Result.RetCode = 0; int errcnt = 0; string[] arrOrderIdx, arrCloneId; string strOrderIdxs = string.Empty; strOrderIdxs = reqBasketParam.OrderIdxs; string strCloneIds = reqBasketParam.GoodsCodes; if (strOrderIdxs != null) { if (strOrderIdxs.Substring(strOrderIdxs.Length - 1) != "|") { strOrderIdxs = strOrderIdxs + "|"; } strOrderIdxs = strOrderIdxs.Replace("|", ","); arrOrderIdx = strOrderIdxs.Split(PaymentConstant.CommaSeperator); arrCloneId = strCloneIds.Split(new char[] { ';' }); //이 상태는 몽고 디비에 데이터가 없다는 거. //테스트를 위해 무조건 유효성검사성공임 for (int i = 0, arrOrderIdxLenth = arrOrderIdx.Length; i < arrOrderIdxLenth; i++) { if (arrOrderIdx[i] != string.Empty) { ValidCheckT originValidCheck = new ValidCheckT(); originValidCheck.OrderIdx = arrOrderIdx[i]; originValidCheck.RetCode = "S"; originValidCheck.RetMessage = "유효성검사성공"; originValidCheckResult.ValidCheckList.Add(originValidCheck); } } /* for (int i = 0, arrOrderIdxLenth = arrOrderIdx.Length; i < arrOrderIdxLenth; i++) { if (arrOrderIdx[i] != string.Empty && arrCloneId[i] != string.Empty) { ValidCheckT originValidCheck = new ValidCheckT(); originValidCheck.OrderIdx = arrOrderIdx[i]; gmktVerifyDataResult = commonBiz.GmarketVerifyCloneId(arrCloneId[i]); if (gmktVerifyDataResult.Result == true) { originValidCheck.RetCode = "S"; originValidCheck.RetMessage = "유효성검사성공"; } else { originValidCheck.RetCode = "F"; originValidCheck.RetMessage = "유효성검사실패"; errcnt = errcnt + 1; } originValidCheckResult.ValidCheckList.Add(originValidCheck); } } */ if (errcnt > 0) { originValidCheckResult.Result.RetCode = -1; originValidCheckResult.Result.RetMessage = "원상품유효성검사실패"; } else { originValidCheckResult.Result.RetCode = 0; originValidCheckResult.Result.RetMessage = "원상품유효성검사성공"; } } return originValidCheckResult; }
public JsonResult GepExportSecondSite() { List<ExportSecondSite> list = new CommonBiz().ExportSecondSiteListName("eBay"); int count = list.Count; return Json(list, JsonRequestBehavior.AllowGet); }
public JsonResult SetItemVerify(string gepId) { List<string> listGepId = new List<string>(); string[] arrIdx = gepId.Split(';'); for (int i = 0; i < arrIdx.Length; i++) { listGepId.Add(arrIdx[i]); } List<GmarketVerifyData> list = new CommonBiz().GmarketVerify(listGepId); return Json(list.Count, JsonRequestBehavior.AllowGet); }
/// <summary> /// eBay 상품 조회 /// 2차가공리스팅, 대기상품 리스팅, 상품관리 리스팅에서 호출 /// </summary> /// <returns></returns> public ActionResult List() { String status = Request.QueryString["status"]; if (String.IsNullOrEmpty(status)) status = "init"; var accounts = new CommonBiz().GetTaeBayAccount(MemberContext.LoginID, "ebay"); if (accounts != null) { ViewBag.eBayAccounts = from e in accounts where e.site.ToLower().Equals("ebay") select new SelectListItem { Text = e.site_login_id, Value = e.site_login_id }; } if (status.ToLower().Equals("init")) return View("InitList", new eBayItemSearchModel()); else if (status.ToLower().Equals("waiting")) return View("WaitingList", new eBayItemSearchModel(eBayItemStat.Wait)); else if (status.ToLower().Equals("listing")) return View("ListingList", new eBayItemSearchModel(eBayItemStat.Listing)); else return new EmptyResult(); }
/// <summary> /// 사이트 환경설정 저장 /// </summary> /// <param name="formCollection">저장할 FormCollection</param> /// <param name="userId">사용자아이디</param> public void SaveSettings(FormCollection formCollection, string taId) { ExportSecondSite site = new CommonBiz().ExportSecondSiteView(Util.GetSafeInt(formCollection["exportSite"])); Dictionary<string, object> dic = new Dictionary<string, object>(); dic.Add("ta_id", taId); dic.Add("reg_date", DateTime.Now); dic.Add("exportSiteName", site.second_site_name); for (int i = 0; i < formCollection.Count; i++) { dic.Add(formCollection.AllKeys[i], formCollection[i]); } new SettingsDac().Create(dic); }
public void GmarketVerifyCloneId(string cloneId) { GmarketVerifyDataClone result = new CommonBiz().GmarketVerifyCloneId(cloneId); Trace.WriteLine(result.Message); Trace.WriteLine(result.Result.ToString()); }
public void GetTaeBayAccount(string gmktId, string site) { List<TaAccounts> list = new CommonBiz().GetTaeBayAccount(gmktId); Trace.DumpBusinessEntity(list); }
public void GeteBayTokenId(string gmktId, string site) { string result = new CommonBiz().GeteBayTokenId(gmktId); System.Console.WriteLine(string.Format("TokenId : {0}", result)); }
public void eBayProductChange(string gepId, string siteId, string settingId, string loginId) { // 환경설정 가져오기 BsonDocument bsonDocument = new SettingsDac().View(ObjectId.Parse(settingId)); //site 정보 가져오기 ExportSecondSite exportSite = new CommonBiz().ExportSecondSiteView(Util.GetSafeInt(siteId)); string[] arrGepId = gepId.Split(','); foreach (var data in arrGepId) { //gep item 가져오기 GepItemsData gepItem = new GepItemsDac().View(Util.GetSafeLong(data)); if (gepItem.stat != "S2") continue; //eBay 상품 변환 eBayItemsData eBayItems = new eBayItemsData(); eBayItemsDataForSeller dynamicdata = new eBayItemsDataForSeller(); //Gep item 데이터 GEPItem itemgep = new GEPItem(); itemgep.img = gepItem.img; itemgep.ta = gepItem.ta; itemgep.rdate = gepItem.rdate; //Gep의 소스상품 데이터 itemgep.src_ver_code = gepItem.ver_code; itemgep.src_no = gepItem.src_info.no; itemgep.src_name = gepItem.src_info.name; itemgep.lcategory = new lcategory(); itemgep.lcategory = gepItem.src_info.lcategory; itemgep.mcategory = new mcategory(); itemgep.mcategory = gepItem.src_info.mcategory; itemgep.scategory = new scategory(); itemgep.scategory = gepItem.src_info.scategory; itemgep.src_tot_price = gepItem.src_info.price + gepItem.src_info.sel_price + gepItem.src_info.dlv.dlv_fee; itemgep.src_price = gepItem.src_info.price; itemgep.src_settle_price = gepItem.src_info.settle_price; itemgep.src_qty = gepItem.src_info.qty; itemgep.dlv_fee_cond = gepItem.src_info.dlv.dlv_fee_cond; itemgep.sel_no = gepItem.src_info.sel_no; itemgep.sel_name = gepItem.src_info.sel_name; itemgep.sel_price = gepItem.src_info.sel_price; itemgep.sel_qty = gepItem.src_info.sel_qty; itemgep.src_seller = gepItem.src_info.seller; #region Trans 정보가 있으면 정보 넣어줌. foreach (var trans in gepItem.trans) { string lang = "EN"; if (trans.lang == "US" || trans.lang == "UK" || trans.lang == "AU") { lang = "EN"; } else { lang = trans.lang; } if (exportSite.lang == lang) { dynamicdata.Description = trans.desc; } } #endregion eBayItems._id = ObjectId.GenerateNewId(); eBayItems.gep_id = gepItem._id; eBayItems.stat = eBayItemStat.Raw; eBayItems.gep_info = itemgep; eBayItems.img = gepItem.img; eBayItems.rdate = DateTime.Now; eBayItems.ta = loginId; Dictionary<string, object> category = GeteBaySuggestedCategory( Util.GetSafeInt(siteId), gepItem.src_info.lcategory.name, gepItem.src_info.mcategory.name, gepItem.src_info.scategory.name, gepItem.src_info.no, gepItem.src_info.name ); #region 환경설정 데이터 Dictionary<string, object> dynamicSettings = new Dictionary<string, object>(); foreach (var settings in bsonDocument) { if (settings.Name == "ListingType") { dynamicdata.ListingType = settings.Value.ToString(); } else if (settings.Name == "exportSite") { eBayItems.site = Util.GetSafeInt(settings.Value.ToString()); } else if (settings.Name == "exportSiteName") { eBayItems.site_name = settings.Value.ToString(); } else if (settings.Name == "PriceConfig") { eBayItems.price_config = settings.Value.ToString(); } else if (settings.Name == "PriceConfigValue") { eBayItems.Price_config_value = Util.GetSafeInt(settings.Value.ToString()); } else if (settings.Name == "ListingType") { dynamicdata.ListingType = settings.Value.ToString(); } else if (settings.Name == "Quantity") { dynamicdata.Quantity = Common.Util.Util.GetSafeInt(settings.Value.ToString()); } else if (settings.Name == "ListingDuration") { dynamicdata.ListingDuration = Common.Util.Util.GetSafeInt(settings.Value.ToString()); } else if (settings.Name == "Country") { dynamicdata.Country = settings.Value.ToString(); } else if (settings.Name == "Location") { dynamicdata.Location = settings.Value.ToString(); } else if (settings.Name == "ShippingService") { dynamicdata.ShippingService = settings.Value.ToString(); } else if (settings.Name == "ShippingCost") { dynamicdata.ShippingCost = Common.Util.Util.GetSafeInt(settings.Value.ToString()); } else if (settings.Name == "AdditionalShippingCost") { dynamicdata.AdditionalShippingCost = Common.Util.Util.GetSafeInt(settings.Value.ToString()); } else if (settings.Name == "DispatchTimeMax") { dynamicdata.DispatchTimeMax = Common.Util.Util.GetSafeInt(settings.Value.ToString()); } else if (settings.Name == "ExcludeShipToLocation") { dynamicdata.ExcludeShipToLocation = settings.Value.ToString(); } else if (settings.Name == "ReturnsAccepted") { dynamicdata.ReturnsAccepted = settings.Value.ToString(); } else if (settings.Name == "ReturnsWithin") { dynamicdata.ReturnsWithin = settings.Value.ToString(); } else if (settings.Name == "ReturnsRefund") { dynamicdata.ReturnsRefund = settings.Value.ToString(); } else if (settings.Name == "ReturnsShippingCostPaidBy") { dynamicdata.ReturnsShippingCostPaidBy = settings.Value.ToString(); } else if (settings.Name == "ReturnsDescription") { dynamicdata.ReturnsDescription = settings.Value.ToString(); } else if (settings.Name == "HitCounter") { dynamicSettings.Add(settings.Name, settings.Value); } else { //dynamicSettings.Add(settings.Name, settings.Value); } #region 이전 //if (settings.Name == "ListingType") //{ // ((dynamic)dynamicdata).ListingType = "test"; // dynamicdata.ListingType = settings.Value.ToString(); //} //else if (settings.Name == "exportSite") //{ // eBayItems.site = Util.GetSafeInt(settings.Value.ToString()); //} //else if (settings.Name == "exportSiteName") //{ // eBayItems.site_name = settings.Value.ToString(); //} //else if (settings.Name == "PriceConfig") //{ // eBayItems.price_config = settings.Value.ToString(); //} //else if (settings.Name == "PriceConfigValue") //{ // eBayItems.Price_config_value = Util.GetSafeInt(settings.Value.ToString()); //} //else if (settings.Name == "Quantity") //{ // dynamicdata.Quantity = Util.GetSafeInt(settings.Value.ToString()); //} //else if (settings.Name == "ListingDuraton") //{ // dynamicdata.ListingDuration = Util.GetSafeInt(settings.Value.ToString()); //} //else if (settings.Name == "ItemLocationCountry") //{ // dynamicdata.Country = settings.Value.ToString(); //} //else if (settings.Name == "ItemLocation") //{ // dynamicdata.Location = settings.Value.ToString(); //} //else if (settings.Name == "ShippingService") //{ // dynamicdata.ShippingService = settings.Value.ToString(); //} //else if (settings.Name == "ShippingCost") //{ // dynamicdata.ShippingCost = Util.GetSafeInt(settings.Value.ToString()); //} //else if (settings.Name == "AdditionalShippingCost") //{ // dynamicdata.AdditionalShippingCost = Util.GetSafeInt(settings.Value.ToString()); //} //else if (settings.Name == "DispatchTimeMax") //{ // dynamicdata.DispatchTimeMax = Util.GetSafeInt(settings.Value.ToString()); //} //else if (settings.Name == "FreeShipping") //{ // dynamicdata.FreeShipping = settings.Value.ToString(); //} //else if (settings.Name == "txtExcludeShippingLocation") //{ // dynamicdata.ExcludeShipToLocation = settings.Value.ToString(); //} //else if (settings.Name == "Returns") //{ // dynamicdata.ReturnsAccepted = settings.Value.ToString(); //} //else if (settings.Name == "ReturnsWithin") //{ // dynamicdata.ReturnsWithin = settings.Value.ToString(); //} //else if (settings.Name == "ReturnsRefund") //{ // dynamicdata.ReturnsRefund = settings.Value.ToString(); //} //else if (settings.Name == "ReturnsShippingCostPaidBy") //{ // dynamicdata.ReturnsShippingCostPaidBy = settings.Value.ToString(); //} //else if (settings.Name == "ReturnsDescription") //{ // dynamicdata.ReturnsDescription = settings.Value.ToString(); //} #endregion } #endregion dynamicdata.PrimaryCategoryID = Util.GetSafeLong(category["category"].ToString()); dynamicdata.PrimaryCategoryPath = category["categoryPathOriginal"].ToString(); dynamicdata.Title = category["name"].ToString(); dynamicSettings.Remove("reg_date"); dynamicSettings.Remove("ta_id"); dynamicdata.SetDynamics(dynamicSettings); eBayItems.dynamicData = dynamicdata; new eBayItemDac().Save(eBayItems); //전환 이력 저장 SaveExportHistory(loginId, bsonDocument, exportSite, gepItem); //Gep Collection에 전환 이력 update GepCollectionUpdate(gepItem._id, gepItem.total_exp_count, loginId); } }
public GmarketVerifyData ViewVerifyResult(string gepId) { GepItemsData data = new GepItemsDac().View(Query.EQ("_id", Util.GetSafeLong(gepId))); string errorMessage = string.Empty; string[] arrError = data.ver_code.Split(','); foreach (var err in arrError) { errorMessage += new CommonBiz().ErrorCase(err); } GmarketVerifyData verData = new GmarketVerifyData(); verData.GepItemsDataClass = data; verData.Message = errorMessage; return verData; }
/// <summary> /// 상품정보 수정 페이지 /// 2차 가공, 대기상품, 리스팅 상품에서 호출 /// </summary> /// <param name="id">ebay_items 컬렉션의 ObjectID(string형태로 받고 추후 ObjectID로 변경)</param> /// <param name="category">Ebay 1차 카테고리(없으면 미리 저장된 데이터 사용)</param> /// <returns></returns> public ActionResult Edit(string id, string category) { if (id == "" || id == null) { //exception을 던지거나 공통 오류 페이지로 보내거나 기타등등의 방법으로 처리하는게 더 나을듯.. //return SetAlertAndRedirect("잘못된 접근 입니다.", Url.Action("List")); throw new Exception("잘못된 접근 입니다."); } eBayItemsData objeBayItemData = new eBayItemBiz().GetEbayItemData(id); if (objeBayItemData == null) { throw new Exception("eBay상품 키값이 유효하지 않습니다."); } GepItemsData gepItemData = new GepItemsBiz().GepItemView(objeBayItemData.gep_id.ToString()); if (gepItemData == null) { throw new Exception("Gep상품 코드가 유효하지 않습니다."); } if (category != "" && category != null && category != "0") { objeBayItemData.dynamicData.PrimaryCategoryID = Util.GetSafeLong(category); } ebayItemDataForSeller forSellerData = new eBayItemBiz().GetForSellerDataParseJSON(objeBayItemData.site, objeBayItemData.dynamicData.PrimaryCategoryID); if (forSellerData == null) { throw new Exception("forSeller와 데이터 연동에 실패했습니다."); } // eBay 대기상품의 경우 계정정보 수정이 가능함 if (objeBayItemData.stat == eBayItemStat.Wait) { var accounts = new CommonBiz().GetTaeBayAccount(MemberContext.LoginID, "ebay"); if (accounts != null) { ViewBag.eBayAccounts = from e in accounts where e.site.ToLower().Equals("ebay") select new SelectListItem { Text = e.site_login_id, Value = e.site_login_id }; } } //ViewBag.siteId = siteId; ViewBag.allowEmsRegion = new TransportCommonBiz().GetEmsNationList(); ViewBag.allowRr = new TransportCommonBiz().GetSpNationList(); ViewBag.eBayItemsData = objeBayItemData; ViewBag.gepItemData = gepItemData; return View(forSellerData); }
public void GmarketVerfy(string param) { List<string> paramList = new List<string>(); paramList.Add(param); CommonBiz Target = new CommonBiz(); List<GmarketVerifyData> Result = Target.GmarketVerify(paramList); foreach (var t in Result) { Trace.DumpBusinessEntity(t); } }
/// <summary> /// ebay_items의 _id 상품에 대하여 판매 중지 요청 /// </summary> /// <param name="id">ebay_items 컬렉션의 id 임. eBay 의 실제 상품 번호 아님!</param> /// <returns> /// 성공시 Success = true, Message = null /// 실패시 Success = false, Messsage = 실패사유 /// </returns> public eBayItemResultBase RequestStopListing(string id) { eBayItemsData info = new eBayItemDac().View(Query.EQ("_id", ObjectId.Parse(id))); if (String.IsNullOrWhiteSpace(info.itemno)) { return new eBayItemResultBase { Success = false, Message = "eBay 상품번호가 없어 판매중지요청을 할 수 없습니다." }; } if (string.IsNullOrWhiteSpace(info.ebay_acnt)) { return new eBayItemResultBase { Success = false, Message = "eBay 계정이 존재하지 않거나 유효한 eBay 계정이 아닙니다." }; } //TODO valid한 SiteID인지도 체크 해야되! 근데 valid한 SiteID가 뭔지를 몰라 ㅋㅋㅋㅋㅋ var ebayToken = new CommonBiz().GeteBayTokenId(info.ebay_acnt); if (String.IsNullOrWhiteSpace(ebayToken)) { return new eBayItemResultBase { Success = false, Message = "eBay 계정이 존재하지 않거나 유효한 eBay 계정이 아닙니다." }; } var request = new CloseItemRequest { EbayTokenID = ebayToken, ItemID = info.itemno, SiteID = info.site }; var response = new ItemService(apiUrl).CloseItem(request); if (response.Ack.Equals(AckType.Failure)) { return new eBayItemResultBase { Success = false, Message = (from messages in response.Response.Messages select messages[AckType.Failure.ToString()]).ToArray().ToString() }; } //TODO 해당 eBay item 판매중지상태로 update SaveItemStatus(new ObjectId(id), eBayItemStat.Stop); //clone 상품 팔자주문 내리기 new ItemOrderBiz().DeleteOrder(info.gep_info.src_no, info.gep_info.src_seller.sid, info.gep_info.src_seller.sid); return new eBayItemResultBase { Success = true }; }
public ActionResult ItemVerifyResult(string gepId = "") { GmarketVerifyData data = new CommonBiz().ViewVerifyResult(gepId); return View(data); }