Example #1
0
 public void GepItemUpdate(string code, string imageUrl, string gepName
     , string us_name, string us_desc
     , string de_name, string de_desc
     , string ru_name, string ru_desc)
 {
     GepItemsBiz Target = new GepItemsBiz();
     Target.GepItemUpdate(code, imageUrl, gepName
             , us_name, us_desc, de_name, de_desc, ru_name, ru_desc);
     Trace.WriteLine("Edit 설공");
 }
Example #2
0
 public JsonResult GetItemListData(string lcategory = "", string mcategory = "", string scategory = ""
     , string price1 = "", string price2 = "", string periodType = "", string sdate = "", string edate = ""
     , string gmarketVerfy = "", string itemVerify = "", string use = "", string searchType = ""
     , string searchText = "", int page = 1, string sord = "")
 {
     object list = new GepItemsBiz().GepItemsList(lcategory, mcategory, scategory
     , price1, price2, periodType, sdate, edate
     , gmarketVerfy, itemVerify, use, searchType
     , searchText, page, sord);
     return Json(list, JsonRequestBehavior.AllowGet);
 }
Example #3
0
 public void GepItemView(string code)
 {
     GepItemsBiz Target = new GepItemsBiz();
     GepItemsData Result = Target.GepItemView(code);
     if (Result == null)
     {
         Trace.WriteLine("데이터가 없습니다.");
     }
     else
     {
         Trace.WriteLine(string.Format("ID : {0}", Result._id));
         Trace.WriteLine(string.Format("ta : {0}", Result.ta));
         Trace.WriteLine(string.Format("name : {0}", Result.src_info.name));
         Trace.WriteLine(string.Format("no : {0}", Result.src_info.no));
     }
 }
Example #4
0
        public void GepItemsList(string lcategory = "", string mcategory = "", string scategory = ""
            , string price1 = "", string price2 = "", string periodType = "", string sdate = "", string edate = ""
            , string gmarketVerfy = "", string itemVerify = "", string use = "", string searchType = ""
            , string searchText = "", int page = 1)
        {
            GepItemsBiz Target = new GepItemsBiz();

            var Result = Target.GepItemsList(lcategory, mcategory, scategory
            , price1, price2, periodType, sdate, edate
            , gmarketVerfy, itemVerify, use, searchType
            , searchText, page);

            if (Result == null)
            {
                Trace.WriteLine("데이터가 없습니다.");
            }
            else
            {
                Trace.DumpBusinessEntity(Result.ToJson().ToList());
            }
        }
Example #5
0
        /// <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);
        }
Example #6
0
        public SellerAgreementChageResult SellerAgreementChange()
        {
            SellerAgreementChageResult result = new SellerAgreementChageResult();
            try
            {
                int rowEffect = 0;
                List<SellerAgreementT> sellerList = new AdminDac().GetChangedSellerAgreement();
                result.sellerCount = sellerList.Count;
                foreach (var seller in sellerList)
                {
                    //GEP 대상 상품
                    List<GepItemsData> gepTargetItem = new GepItemsBiz().GetStopReqItems(seller.SellerNo, seller.TaId);
                    foreach (var gepData in gepTargetItem)
                    {
                        gepData.stat = seller.AgreeYn == "Y" ? "S2" : "S3";
                        new GepItemsDac().Save(gepData);
                        rowEffect++;
                    }
                    //eBay 대상 상품
                    List<eBayItemsData> eBayTargetItem = new eBayItemBiz().GetStopReqItems(seller.SellerNo, seller.TaId);
                    foreach (var eBayData in eBayTargetItem)
                    {
                        if (seller.AgreeYn == "N")
                        {
                            StopRequest stopReauest = new StopRequest();
                            stopReauest.is_req = true;
                            stopReauest.reqdate = DateTime.Now;
                            stopReauest.reason = StopRequestReason.CancelAgreement;
                            eBayData.stopreq = stopReauest;
                            new eBayItemDac().Save(eBayData);
                            rowEffect++;
                        }
                    }
                }
                result.rowEffect = rowEffect;
                result.result = true;
            }
            catch (Exception ex)
            {
                result.result = false;
                result.message = string.Format("{0} {1} {2}", ex.Message, ex.Source, ex.StackTrace);
            }

            return result;
        }
Example #7
0
        /// <summary>
        /// GepWarehouse 정보를 gep 통합주문정보와 gmkt주문정보에서 가져온다.
        /// </summary>
        /// <param name="scanValue"></param>
        /// <param name="userID"></param>
        /// <param name="gepWarehouse"></param>
        /// <returns></returns>
        public TransportResultSet SetGepWarehouseFromOrderData(string scanValue, string userID, ref GepWarehouse gepWarehouse)
        {
            TransportResultSet result = new TransportResultSet();
            result.KeyValue = scanValue;
            result.Code = ResultCodeEnum.OK;
            result.Message = "";

            //gmkt 에서 데이터 가져오기
            OrderInfoT gmktOrder = new TransportGMKTCoreDac().OrderInfo(Util.GetSafeInt(scanValue));

            if (null == gmktOrder)
            {
                result.KeyValue = scanValue;
                result.Code = ResultCodeEnum.Error;
                result.Message = "G마켓 주문 정보가 없습니다.";
                return result;
            }

            //GEP 에서 데이터 가져오기
            GEPOrderInfoT gepOrder = new GEPOrderDac().GetGEPOrderInfo(Query.EQ("GMKTOrder.ContrNo", Util.GetSafeInt(scanValue)));

            if (null == gepOrder)
            {
                result.KeyValue = scanValue;
                result.Code = ResultCodeEnum.Error;
                result.Message = "GEP 통합주문 정보가 없습니다.";
                return result;
            }

            if (String.IsNullOrEmpty(gepOrder.ExportSiteTrans.trans_way) || "0" == gepOrder.ExportSiteTrans.trans_way)
            {
                result.KeyValue = scanValue;
                result.Code = ResultCodeEnum.Error;
                result.Message = "GEP 통합주문 정보에 Site배송방법이 없습니다.";
                return result;
            }

            //라벨출력일
            gepWarehouse.gsm_label_print_dt = gmktOrder.LabelPrintDt;
            gepWarehouse.gsm_label_print_id = gmktOrder.SellerId;

            if (null == gepWarehouse.transinfo)
                gepWarehouse.transinfo = new GepTransInfo();

            gepWarehouse.transinfo.contr_no = Util.GetSafeInt(scanValue);

            //Gep통합주문정보 --> TransInfo
            //Gep통합주문정보 --> item 정보
            CovertTo(gepOrder, ref gepWarehouse.transinfo);

            //gmkt주문정보 --> TransInfo
            CovertTo(gmktOrder, ref gepWarehouse.transinfo);
            gepWarehouse.transinfo.chg_dt = DateTime.Now;
            gepWarehouse.transinfo.chg_id = userID;

            //Gep통합주문정보 --> GEP에 배송방법
            gepWarehouse.transinfo.trans_way = new TransportCommonBiz().GetTransWayInfo(gepOrder.ExportSiteTrans.trans_way);
            gepWarehouse.transinfo.trans_way.reg_dt = DateTime.Now;
            gepWarehouse.transinfo.trans_way.reg_id = userID;

            //GOPM 배송방법 이력
            if (null == gepWarehouse.trans_way_hist)
                gepWarehouse.trans_way_hist = new List<GepTransWay>();
            gepWarehouse.trans_way_hist.Add(gepWarehouse.transinfo.trans_way);

            //사이트 주문일로부터 5일이상 경과 시 배송방법 EMS전환
            if ((gepWarehouse.transinfo.gep_payment_dt.AddDays(5)) < DateTime.Now
                    && gepWarehouse.transinfo.trans_way.transport_way != "EMS")
            {
                GepTransWay gepTransWay = new TransportCommonBiz().GetTransWayInfo("EMS");
                gepTransWay.reg_dt = DateTime.Now.AddSeconds(1);
                gepTransWay.reg_id = userID;
                gepTransWay.transport_way = "EMS-2";
                gepWarehouse.trans_way_hist.Add(gepTransWay);

                gepWarehouse.transinfo.trans_way = gepTransWay;
            }

            //사이트 배송지 정보
            if (gepOrder.ExportSiteTrans == null)
            {
                result.KeyValue = scanValue;
                result.Code = ResultCodeEnum.Error;
                result.Message = "GEP 사이트별 가변 배송정보가 없습니다.";
                return result;
            }
            gepWarehouse.sitetransinfo = gepOrder.ExportSiteTrans;

            //보내는 사람 주소
            //사이트별 배송지 정보
            TaInfo ta = new TaInfoBiz().FindTaUser(gmktOrder.BuyerId);
            if (ta == null)
            {
                result.KeyValue = gmktOrder.BuyerId;
                result.Code = ResultCodeEnum.Error;
                result.Message = "TA 사용자 정보가 없습니다.";
                return result;
            }
            ConvertTo(ta, ref gepWarehouse.sitetransinfo);

            //발송인 국가 전화번호
            if ("KR" != gepWarehouse.sitetransinfo.sender_iso_country_code)
                gepWarehouse.sitetransinfo.sender_country_code = new TransportCommonBiz().GetNationPhoneNo(gepWarehouse.sitetransinfo.sender_iso_country_code);

            //수취인 국가 전화번호
            gepWarehouse.sitetransinfo.receiver_country_code = new TransportCommonBiz().GetNationPhoneNo(gepWarehouse.sitetransinfo.receiver_iso_country_code);

            //예상무게
            if (0 < Util.GetSafeLong(gepOrder.Item.gep_id))
            {
                gepWarehouse.trns_cost = new TransportCommonBiz().GetTransportCostForOrigin(Util.GetSafeLong(gepOrder.Item.gep_id)
                                                                                        , gepWarehouse.transinfo.clone_item_no
                                                                                        , ""
                                                                                        , gepWarehouse.sitetransinfo.sender_iso_country_code
                                                                                        , gepWarehouse.sitetransinfo.receiver_iso_country_code
                                                                                        , gepWarehouse.sitetransinfo.trans_way
                                                                                        , userID
                                                                                        , ShippingRateTypeEnum.GmktToExpress);
            }
            else
            {
                gepWarehouse.trns_cost = new TransportCommonBiz().GetTransportCostForOrigin(gepWarehouse.transinfo.clone_item_no
                                                                                        , ""
                                                                                        , gepWarehouse.sitetransinfo.sender_iso_country_code
                                                                                        , gepWarehouse.sitetransinfo.receiver_iso_country_code
                                                                                        , gepWarehouse.sitetransinfo.trans_way
                                                                                        , userID
                                                                                        , ShippingRateTypeEnum.GmktToExpress);
            }

            //상품 영문명
            GepItemsData gepitem = new GepItemsBiz().GepItemView(gepWarehouse.transinfo.gep_item_id.ToString());
            if ( !String.IsNullOrEmpty(gepitem.src_info.mcategory.cid) )
            {
                CategoryGmktEngInfoT category = GetGmktMiddleCategoryEngName(gepitem.src_info.mcategory.cid);
                if (null != category && !String.IsNullOrEmpty(category.EngName))
                    gepWarehouse.transinfo.gep_mcategory_ename = category.EngName;

                if ( !String.IsNullOrEmpty(gepitem.src_info.eng_name) )
                    gepWarehouse.transinfo.gep_item_ename = gepitem.src_info.eng_name;
            }

            return result;
        }
Example #8
0
        /// <summary>
        /// Gep item 무게 업데이트 (단위: g)
        /// </summary>
        /// <param name="gepid"></param>
        /// <param name="weight"></param>
        public void SetGepItemWeight(string gepid, int weight)
        {
            GepItemsData gepitem = new GepItemsBiz().GepItemView(gepid);

            gepitem.src_info.weight = weight;
            gepitem.udate = DateTime.Now;

            new GepItemsDac().Save(gepitem);
        }
Example #9
0
        /// <summary>
        /// Gep item 무게 조회 (단위: g)
        /// </summary>
        /// <param name="gepid"></param>
        /// <param name="weight"></param>
        public int GetGepItemWeight(string gepid)
        {
            GepItemsData gepitem = new GepItemsBiz().GepItemView(gepid);

            return gepitem == null ? 0 : gepitem.src_info.weight;
        }
        /// <summary>
        /// 배송대기 스캔 데이터 취득
        /// </summary>
        /// <param name="scanValue">송장번호</param>
        /// <returns>스캔한 데이터</returns>
        public DeliveryWaitGridData GetDeliveryWaitGridData(int scanValue)
        {
            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanValue);

            if (gepWarehouse == null)
            {
                return null;
            }

            var transWays = (from t in gepWarehouse.trans_way_hist
                      orderby t.reg_dt descending
                      select t).ToList();

            if (transWays.Count == 0)
            {
                return null;
            }

            if (gepWarehouse.transinfo == null || gepWarehouse.trans_way_hist == null || gepWarehouse.trns_cost == null)
            {
                return null;
            }

            //미국일때, HSCODE 조회
            if ("US" == gepWarehouse.sitetransinfo.receiver_iso_country_code && String.IsNullOrEmpty(gepWarehouse.hscode))
            {
                GepItemsData gepItem = new GepItemsBiz().GepItemView(Util.GetSafeString(gepWarehouse.transinfo.gep_item_id));

                if (null != gepItem && null != gepItem.src_info)
                {
                    List<CategoryHscodeT> data = new TransportGMKTCoreDac().GetCategoryHscodeT(gepItem.src_info.lcategory.cid, gepItem.src_info.mcategory.cid, gepItem.src_info.scategory.cid);

                    if (null != data && 0 < data.Count)
                    {
                        gepWarehouse.hscode = data[0].Hscode;

                        //업데이트
                        if (!String.IsNullOrEmpty(gepWarehouse.hscode))
                            new TransportGepWarehouseDac().Save(gepWarehouse);
                    }
                }
            }

            return new DeliveryWaitGridData()
            {
                DeliveryAddress = gepWarehouse.sitetransinfo.receiver_addr
                ,
                DeliveryNation = gepWarehouse.sitetransinfo.receiver_country_name
                ,
                ForeingConutryTransc = transWays[0].transport_way
                ,
                idx = "0"
                ,
                InvoiceNum = ""
                ,
                ObjectID = gepWarehouse.contr_no.ToString()
                ,
                OrderNum = gepWarehouse.contr_no.ToString()
                ,
                RealWeight = gepWarehouse.trns_cost.real_weight.ToString()
                ,
                ReceiverName = gepWarehouse.sitetransinfo.receiver_name
            };
        }