public TransCompanyInfoT MakeTransCompanyInfo(string transcNm, string invoiceNo) { TransCompanyInfoT transCompanyInfo = new TransCompanyInfoT(); string transCompanyName = string.Empty; if(transcNm == string.Empty || transcNm == null) { transCompanyInfo.Uid = 0; transCompanyInfo.TranscTel = "-"; transCompanyInfo.TranscHomepage = "-"; transCompanyInfo.TrackingUrl = "-"; }else{ transCompanyName = transcNm.Trim().Replace(" ","").Replace("(","").Replace(")",""); transCompanyName = transCompanyName.Replace("지정", "").Replace("통합", "").Replace("물류", "").Replace("도서", "").Replace("해외", "").Replace("소형항공", "").Replace("마트", ""); transCompanyName = transCompanyName.Substring(0, 4); transCompanyInfo = GetTransCompanyInfo(transCompanyName); if(transCompanyInfo != null) { transCompanyInfo.TrackingUrl = transCompanyInfo.TrackingUrl + invoiceNo; } else { //transCompanyInfo.Uid = 0; transCompanyInfo.TranscTel = "-"; transCompanyInfo.TranscHomepage = "-"; transCompanyInfo.TrackingUrl = "-"; } if(transCompanyName == "자체배송" || transCompanyName == "기타") { transCompanyInfo.Uid = 0; transCompanyInfo.TranscTel = "-"; transCompanyInfo.TranscHomepage = "-"; transCompanyInfo.TrackingUrl = "-"; } } return transCompanyInfo; }
public DomesticDeliveryStatusT MakeDomesticDeliveryStatus(DomesticDeliveryStatusParamT reqDomDelStatus) { TransCompanyInfoT transCompanyInfo = new TransCompanyInfoT(); DomesticDeliveryStatusT rtnDomDelStatus = new DomesticDeliveryStatusT(); rtnDomDelStatus.DeliveryStat = reqDomDelStatus.StatInfo; if (reqDomDelStatus.StatInfo == "배송중" || reqDomDelStatus.StatInfo == "배송완료") { rtnDomDelStatus.DeliveryStat = reqDomDelStatus.StatInfo; transCompanyInfo = MakeTransCompanyInfo(reqDomDelStatus.TranscNm, reqDomDelStatus.InvoiceNo); if(reqDomDelStatus.IsDeliveryGoodsYn == "Y") { if (reqDomDelStatus.TranscNm.IndexOf("대한") > 0) { rtnDomDelStatus.TranscTel = "1577-1275"; } } if (transCompanyInfo.TranscHomepage != "-") { rtnDomDelStatus.TranscHomepage = transCompanyInfo.TranscHomepage; } rtnDomDelStatus.DeliveryStat = statFunc(reqDomDelStatus.StatInfo, reqDomDelStatus.GdShopkind, reqDomDelStatus.GdShopkind2, reqDomDelStatus.GdShopkind3); rtnDomDelStatus.TranscName = reqDomDelStatus.TranscNm; rtnDomDelStatus.TranscTel = transCompanyInfo.TranscTel; rtnDomDelStatus.InvoiceNo = reqDomDelStatus.InvoiceNo; rtnDomDelStatus.TranscName = reqDomDelStatus.TranscNm; rtnDomDelStatus.TransDate = reqDomDelStatus.TransDate; rtnDomDelStatus.IsDeliveryGoodsYn = reqDomDelStatus.IsDeliveryGoodsYn; rtnDomDelStatus.ItemName = reqDomDelStatus.ItemName; rtnDomDelStatus.Type = "A"; } else { if (reqDomDelStatus.StatInfo == "배송요청") { if (reqDomDelStatus.DelivLtpExtendDt != string.Empty && reqDomDelStatus.DelivLtpStat == "S6") { rtnDomDelStatus.DeliveryStat = "배송요청"; string tmpDeliveryLtpExtDt; DateTime deliveryLtpExtendDate; tmpDeliveryLtpExtDt = reqDomDelStatus.DelivLtpExtendDt.Substring(0, 4) + "-" + reqDomDelStatus.DelivLtpExtendDt.Substring(4, 2) + "-" + reqDomDelStatus.DelivLtpExtendDt.Substring(6, 2); deliveryLtpExtendDate = DateTime.Parse(tmpDeliveryLtpExtDt); deliveryLtpExtendDate = CheckBusinessDay(deliveryLtpExtendDate, 30, 112); rtnDomDelStatus.DelLimitExtendDt = deliveryLtpExtendDate.ToString("yyyy-mm-dd"); rtnDomDelStatus.Type = "B"; } else if (DateTime.Parse(reqDomDelStatus.SendPlanDt) < DateTime.Today.Date && reqDomDelStatus.SendPlanDt != "1/1/0001 12:00:00 AM") { rtnDomDelStatus.DeliveryStat = "발송지연"; rtnDomDelStatus.Type = "C"; } else if (reqDomDelStatus.SendPlanDt != string.Empty && reqDomDelStatus.SendPlanDt != null && reqDomDelStatus.SendPlanDt != "1/1/0001 12:00:00 AM") { rtnDomDelStatus.DeliveryStat = "발송예정"; rtnDomDelStatus.SendPlanDt = reqDomDelStatus.SendPlanDt; rtnDomDelStatus.Type = "D"; if (reqDomDelStatus.SendPlanRec != null || reqDomDelStatus.SendPlanRec != string.Empty) { rtnDomDelStatus.SendPlanRec = reqDomDelStatus.SendPlanRec; rtnDomDelStatus.Type = "E"; } } else { rtnDomDelStatus.DeliveryStat = statFunc(reqDomDelStatus.StatInfo, reqDomDelStatus.GdShopkind, reqDomDelStatus.GdShopkind2, reqDomDelStatus.GdShopkind3); rtnDomDelStatus.Type = "C"; } } else { if (reqDomDelStatus.StatInfo == "신고처리중") { rtnDomDelStatus.DeliveryStat = reqDomDelStatus.StatInfo; rtnDomDelStatus.Type = "C"; } else { rtnDomDelStatus.DeliveryStat = statFunc(reqDomDelStatus.StatInfo, reqDomDelStatus.GdShopkind, reqDomDelStatus.GdShopkind2, reqDomDelStatus.GdShopkind3); rtnDomDelStatus.Type = "C"; } } } return rtnDomDelStatus; }