/// <summary> /// 주문번호(체결번호)로 해외배송정보(트래킹URL포함) 조회 /// </summary> /// <param name="contrNo"></param> /// <returns></returns> public DeliveryTracking GetDeliveryTracking(int contrNo) { //todo:GepWarehouse 없을 경우, 배송대기로 상태값 전송 GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(contrNo); DeliveryTracking tracking = new DeliveryTracking(); tracking.DeliveryState = CBT.GEP.Framework.data.EnumDHelper.GetDescription(GepShippingStateEnum.Wait); tracking.DeliveryWay = ""; tracking.InvoiceNo = ""; tracking.TrackingURL = ""; if (gepWarehouse == null) { return tracking; } else { if (gepWarehouse.trans_way_hist == null || gepWarehouse.trans_way_hist.Count == 0) { return tracking; } var q = (from t in gepWarehouse.trans_way_hist orderby t.reg_dt descending select t).ToList(); string TrackingURL = ""; if (q[0].transport_way.IndexOf("EMS") > -1) { TrackingURL = "http://service.epost.go.kr/trace.RetrieveEmsTrace.postal?ems_gubun=E&POST_CODE=" + gepWarehouse.transinfo.oversea_invoice_no; } else { TrackingURL = "http://service.epost.go.kr/trace.RetrieveEmsTrace.postal?ems_gubun=R&POST_CODE=" + gepWarehouse.transinfo.oversea_invoice_no; } tracking.DeliveryState = CBT.GEP.Framework.data.EnumDHelper.GetDescription(gepWarehouse.transinfo.state); //ConvertTo(gepWarehouse.transinfo.state, ""); tracking.DeliveryWay = q[0].transport_way; tracking.DeliveryWayKor = GetTransWayKor(q[0].transport_way); tracking.InvoiceNo = String.IsNullOrEmpty(gepWarehouse.transinfo.oversea_invoice_no) ? "" : gepWarehouse.transinfo.oversea_invoice_no; tracking.TrackingURL = TrackingURL; return tracking; } }
public GEPOrderGridT AddTransportInfo(DeliveryTracking deliveryTracking, GepTranstCost expectTransInfo) { DeliveryTracking = (deliveryTracking == null) ? new DeliveryTracking() : deliveryTracking; ExpectTransInfo = expectTransInfo; return this; }
public OrderDetailT MakeOrderDetailList(int packNo, string custNo) { List<OrderDetailInfoT> orderDetailList = new List<OrderDetailInfoT>(); OrderDetailT orderDetail = new OrderDetailT(); ContrDetailValueT contrDetailValue = new ContrDetailValueT(); ContrBasicInfoT contrBasicInfo = new ContrBasicInfoT(); List<GepOrderNoT> gepOrderNoList = new List<GepOrderNoT>(); Dictionary<long, long> GepOrderNos = new Dictionary<long, long>(); long gepOrderNo; decimal totalPayMoney = 0, totalOriginPayMoney = 0, totalItemPrice = 0, totalDeliveryFee = 0; int orderCnt = 0; DateTime finalDepositDt; string tmpContrDt = string.Empty; string orderNos = string.Empty; orderDetailList = GetGmarketOrderDetailInfo(packNo, custNo); for (int j = 0, orderNosCnt = orderDetailList.Count; j < orderNosCnt; j++) { if (j == 0) { orderNos = orderDetailList[j].BuyOrderNo.ToString(); } else { orderNos = orderNos + "," + orderDetailList[j].BuyOrderNo.ToString(); } } gepOrderNoList = GetGepOrderNo(orderNos); for (int k = 0, gepOrderNoListCnt = gepOrderNoList.Count; k < gepOrderNoListCnt; k++) { GepOrderNos.Add((int)gepOrderNoList[k].OrderNo, gepOrderNoList[k].GepOrderNo); } for (int i = 0, orderDetailListCnt = orderDetailList.Count; i < orderDetailListCnt; i++) { OrderDetailValueT detailValue = new OrderDetailValueT(); GEPOrderInfoT gepOrderInfo = new GEPOrderInfoT(); DomesticDeliveryStatusParamT domDelStatusParam = new DomesticDeliveryStatusParamT(); DomesticDeliveryStatusT rtnDelStatus = new DomesticDeliveryStatusT(); SellerInfoT sellerInfo = new SellerInfoT(); GepOrderNoT resultGepOrderNo = new GepOrderNoT(); TransportCommonBiz transBiz = new TransportCommonBiz(); DeliveryTracking overseaDeliveryTracking = new DeliveryTracking(); sellerInfo = GetSellerInfo(orderDetailList[i].ChgSellCustNo, "y"); if (GepOrderNos.TryGetValue(orderDetailList[i].BuyOrderNo, out gepOrderNo)) { //몽고디비에서 GEP Order 정보 가져오는 부분 gepOrderInfo = GetGEPOrderInfo(gepOrderNo); } else { gepOrderInfo = null; } //해외배송 정보 가져오는 부분 overseaDeliveryTracking = transBiz.GetDeliveryTracking(orderDetailList[i].ContrNo); if (orderDetailList != null) { detailValue.ListNo = i; detailValue.ContrNo = orderDetailList[i].ContrNo; detailValue.CloneItemNo = orderDetailList[i].ItemNo; detailValue.CloneItemName = orderDetailList[i].ItemName; detailValue.ContrAmt = orderDetailList[i].ContrAmt; detailValue.ItemPrice = orderDetailList[i].ContrPrice; detailValue.TotalPrice = orderDetailList[i].ContrPrice * orderDetailList[i].ContrAmt + orderDetailList[i].TotSelItemPrice; detailValue.DeliveryFee = orderDetailList[i].DeliveryFee; detailValue.CustKey = CustNoEncode(orderDetailList[i].ChgSellCustNo); detailValue.SellerId = sellerInfo.Nickname; detailValue.SellerPhone = sellerInfo.HelpdeskTelNo; detailValue.SellerEmail = sellerInfo.EMail; detailValue.SelOptInfo = MakeOrderSelOptInfo(orderDetailList[i].ItemNo, orderDetailList[i].OrderNo); domDelStatusParam.StatInfo = orderDetailList[i].StatInfo; domDelStatusParam.IsDeliveryGoodsYn = orderDetailList[i].IsDeliveryGoodsYn; domDelStatusParam.TranscNm = orderDetailList[i].TakbaeName; domDelStatusParam.InvoiceNo = orderDetailList[i].NoSongjang; domDelStatusParam.GdShopkind = orderDetailList[i].GdShopkind; domDelStatusParam.GdShopkind2 = orderDetailList[i].GdShopkind2; domDelStatusParam.GdShopkind3 = orderDetailList[i].GdShopkind3; domDelStatusParam.DelivLtpExtendDt = orderDetailList[i].DelivLtpExtendDt; domDelStatusParam.DelivLtpStat = orderDetailList[i].DelivLtpStat; domDelStatusParam.TransDate = orderDetailList[i].TransDt; domDelStatusParam.SendPlanDt = orderDetailList[i].SendPlanDt.ToString(); domDelStatusParam.SendPlanRec = orderDetailList[i].SendPlanRec; domDelStatusParam.ItemName = orderDetailList[i].ItemName; rtnDelStatus = MakeDomesticDeliveryStatus(domDelStatusParam); //detailValue.DomesticDeliveryStatus = rtnDelStatus.DeliveryStat; if(orderDetailList[i].AcntStat != "SC" && orderDetailList[i].AcntStat != "SX" && orderDetailList[i].AcntStat != "SQ") { totalPayMoney = totalPayMoney + detailValue.TotalPrice + detailValue.DeliveryFee - orderDetailList[i].CostPrice; } totalOriginPayMoney = totalOriginPayMoney + detailValue.TotalPrice + detailValue.DeliveryFee - orderDetailList[i].CostPrice; orderCnt = orderCnt + 1; totalItemPrice = totalItemPrice + detailValue.ItemPrice; totalDeliveryFee = totalDeliveryFee + detailValue.DeliveryFee; if (gepOrderInfo != null) { detailValue.MotherItemNo = gepOrderInfo.Item.src_no; detailValue.ExportSiteItemNo = gepOrderInfo.Item.ExportItemId; detailValue.ExportSiteItemName = gepOrderInfo.Item.ExportItemName; detailValue.ExportSiteName = gepOrderInfo.ExportSite.Name; detailValue.OverseaDeliveryState = overseaDeliveryTracking.DeliveryState; if (overseaDeliveryTracking.DeliveryWay == "PS") { detailValue.OverseaDeliveryWay = overseaDeliveryTracking.DeliveryWayKor; } else { detailValue.OverseaDeliveryWay = overseaDeliveryTracking.DeliveryWay; } detailValue.OverseaInvoiceNo = overseaDeliveryTracking.InvoiceNo; detailValue.OverseaTrackingURL = overseaDeliveryTracking.TrackingURL; if (gepOrderInfo.GEPOrder.OrderNo == "0") { detailValue.ExportSiteOrderNo = gepOrderInfo.GEPOrder.OrderNoSub; } else { detailValue.ExportSiteOrderNo = gepOrderInfo.GEPOrder.OrderNo; } detailValue.OverseaAddress = gepOrderInfo.ExportSiteTrans.receiver_addr; detailValue.OverseaRcvNm = gepOrderInfo.ExportSiteTrans.receiver_name; detailValue.OverseaPhone = gepOrderInfo.ExportSiteTrans.receiver_tel_no; detailValue.OverseaEmail = gepOrderInfo.ExportSiteTrans.receiver_email; detailValue.ViewItemURL = gepOrderInfo.Item.ExportSiteViewItemUrl; } orderDetail.DomesticDeliveryStatusList.Add(rtnDelStatus); orderDetail.OrderDetailValueList.Add(detailValue); } else { //아무 디비도 안 나옴 } } //결제 정보 contrDetailValue.ItemCnt = orderCnt; contrDetailValue.TotItemPrice = totalItemPrice; contrDetailValue.TotDeliveryFee = totalDeliveryFee; contrDetailValue.PackTotPayMoney = totalPayMoney; contrDetailValue.PackOriginTotPayMoney = totalOriginPayMoney; contrDetailValue.PackCancelTotPayMoney = totalOriginPayMoney - totalPayMoney; contrBasicInfo.AcntWay = orderDetailList[0].AcntWay; contrBasicInfo.CashpayWay = orderDetailList[0].CashpayWay; contrBasicInfo.StatInfo = orderDetailList[0].StatInfo; tmpContrDt = orderDetailList[0].ContrDt.Substring(0, 4) + "-" + orderDetailList[0].ContrDt.Substring(4, 2) + "-" + orderDetailList[0].ContrDt.Substring(6, 2); finalDepositDt = DateTime.Parse(tmpContrDt); contrBasicInfo.FinalDeposit = finalDepositDt.AddDays(7).ToString("yyyy-MM-dd"); contrBasicInfo.PackNo = orderDetailList[0].PackNo; if (orderDetailList[0].AcntWay == "A2" || orderDetailList[0].AcntWay == "A7") { int sttlNoLenth = 0; int halbuMonth = orderDetailList[0].Halbumonth; contrBasicInfo.SttlName = orderDetailList[0].SttlkindNm; if (orderDetailList[0].CardNo != string.Empty) { sttlNoLenth = orderDetailList[0].CardNo.Length; contrBasicInfo.SttlNo = orderDetailList[0].CardNo.Substring(0, 8) + "****************"; contrBasicInfo.SttlNo = contrBasicInfo.SttlNo.Substring(0, sttlNoLenth); contrBasicInfo.CardAcptDt = orderDetailList[0].AcptDt; } if (halbuMonth >= 60) { halbuMonth = halbuMonth - 60; } else if (halbuMonth >= 40 && halbuMonth < 60 && halbuMonth != 41) { halbuMonth = halbuMonth - 40; } if (halbuMonth == 0 || halbuMonth == 41) { contrBasicInfo.SttlWay = "일시불"; } else { if (orderDetailList[0].HalbuType == "C" || orderDetailList[0].HalbuType == "F") { contrBasicInfo.SttlWay = halbuMonth + " 개월 무이자 할부"; } else { contrBasicInfo.SttlWay = halbuMonth + " 개월 할부"; } } } else { contrBasicInfo.SttlName = orderDetailList[0].BankNm; contrBasicInfo.SttlNo = ShowVAccount(orderDetailList[0].BankAcntNo, orderDetailList[0].GbankNo); contrBasicInfo.DepositName = orderDetailList[0].DepositNm; contrBasicInfo.SttlWay = "현금"; } contrDetailValue = MakeContrInfo(contrBasicInfo, contrDetailValue); orderDetail.ContrValue = contrDetailValue; return orderDetail; }