/// <summary>
        /// 엑셀 다운로드전 유효성 체크 한다.(E-Shipping)
        /// </summary>
        /// <param name="ContrNos">체결번호들</param>        
        /// <returns></returns>
        public TransportResultSet ExcelDownESValidation(int[] ContrNos)
        {
            for (int k = 0; k < ContrNos.Length; k++)
            {
                GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(ContrNos[k]);
                if (gepWarehouse == null)
                {
                    return new TransportResultSet()
                    {
                        KeyValue = ContrNos[k].ToString()
                        ,
                        Code = ResultCodeEnum.Error
                        ,
                        Message = ContrNos[k].ToString() + " 은 정상적인 E-Shipping건이 아닙니다."
                    };
                }

                if (gepWarehouse.sitetransinfo.receiver_iso_country_code != "US")
                {
                    return new TransportResultSet()
                    {
                        KeyValue = ContrNos[k].ToString()
                        ,
                        Code = ResultCodeEnum.Error
                        ,
                        Message = ContrNos[k].ToString() + " 은 E-Shipping 건이 아닙니다."
                    };
                }
            }

            return new TransportResultSet()
            {
                Code = ResultCodeEnum.OK
            };
        }
        /// <summary>
        /// 배송 준비 스캔된 데이터 취득
        /// </summary>
        /// <param name="scanValue">송장번호</param>
        /// <returns>결과 데이터</returns>
        public DeliveryReadyGridData GetDeliveryReadyGridData(int scanValue)
        {
            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanValue);

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

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

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

            return new DeliveryReadyGridData() {
                ObjectID = gepWarehouse.contr_no.ToString()
                ,ArrivedDate = (null == gepWarehouse.arrived_dt ? "" : gepWarehouse.arrived_dt.Value.ToString("yyyy-MM-dd HH:mm:ss"))
                ,BuyerID = gepWarehouse.transinfo.clone_buyer_id
                ,BuyerName = gepWarehouse.transinfo.clone_buyer_name
                //,ContractDate = gepWarehouse.transinfo.reg_dt.ToString("yyyy-MM-dd HH:mm:ss")
                ,ContractDate = gepWarehouse.transinfo.clone_contr_dt.ToString("yyyy-MM-dd HH:mm:ss")
                ,DeliveryAddress = gepWarehouse.sitetransinfo.receiver_addr
                ,DeliveryNation = gepWarehouse.sitetransinfo.receiver_country_name
                ,ForeingConutryTransc = q[0].transport_way
                ,InvoicePrint = (0 < gepWarehouse.cn22_count ? "Y" : "N")
                ,OrderNum = gepWarehouse.contr_no.ToString()
                ,ProductAmt = gepWarehouse.transinfo.gep_order_count.ToString()
                ,ProductName = gepWarehouse.transinfo.clone_item_name
                ,ProductNum = gepWarehouse.transinfo.clone_item_no
                ,ProductOption = gepWarehouse.transinfo.clone_option_info
                ,ExpectedWeight = gepWarehouse.trns_cost.org_weight.ToString()
                ,ExpectedWeightCost = gepWarehouse.trns_cost.org_transport_cost.ToString()
                ,RealWeight = gepWarehouse.trns_cost.real_weight.ToString()
                ,RealWeightCost = gepWarehouse.trns_cost.real_transport_cost.ToString()
                ,ReceiverName = gepWarehouse.sitetransinfo.receiver_name
                //,State = gepWarehouse.GetState
                ,State = GEP.Framework.data.EnumDHelper.GetDescription(gepWarehouse.transinfo.state)
                ,ReceiverContact = gepWarehouse.sitetransinfo.receiver_hp_no == "" ? gepWarehouse.sitetransinfo.receiver_email : gepWarehouse.sitetransinfo.receiver_hp_no
                ,AddDeliveryCost = (new TransportCommonBiz().GetAddDeliveryCost(gepWarehouse.trns_cost.org_transport_cost, gepWarehouse.trns_cost.real_transport_cost)).ToString()
                ,
                BuyerContact = (String.IsNullOrEmpty(gepWarehouse.sitetransinfo.sender_hp_no) ?
                                    gepWarehouse.sitetransinfo.sender_tel_no : gepWarehouse.sitetransinfo.sender_hp_no )
            };
        }
        /// <summary>
        /// CN22 송장 출력
        /// </summary>
        /// <param name="contrNo">체결번호</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>송장 출력 데이터</returns>
        public GepWarehouse GetCN22Data(int contrNo, string userID)
        {
            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(contrNo);

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

            gepWarehouse.cn22_count = gepWarehouse.cn22_count + 1;
            gepWarehouse.cn22_print_dt = DateTime.Now;
            gepWarehouse.cn22_print_id = userID;

            new TransportGepWarehouseDac().Save(gepWarehouse);

            return gepWarehouse;
        }
        public List<GEPContractDetail> GetGEPContractDetailData(ref long TotalPage, int nowPage, int pageSize, int dateSerchType, DateTime sDate, DateTime eDate, int numSerchType, string serchNum)
        {
            List<GEPContractDetail> listGEPContractDetail = new List<GEPContractDetail>();

            MongoPagingResult<GepWarehouse> GepWarehouse = new TransportGepWarehouseDac().FindByPaging(dateSerchType, sDate, eDate, numSerchType, serchNum, pageSize, (pageSize * (nowPage - 1)));

            //IQueryable<GepWarehouse> Data = TGWDac.Read(query);
            TotalPage = (GepWarehouse.Count / pageSize);

            if (GepWarehouse.Count % pageSize != 0)
            {
                TotalPage++;
            }

            if (GepWarehouse.Result != null)
            {
                foreach (var t in GepWarehouse.Result)
                {
                    listGEPContractDetail.Add(GetGEPContractDetail(t));
                }
            }

            return listGEPContractDetail;
        }
        /// <summary>
        /// 배송준비 스캔
        /// </summary>
        /// <param name="scanValue">송장번호</param>
        /// <returns>스캔 결과</returns>
        public TransportResultSet SetDeliveryReadyScan(int scanValue)
        {
            TransportResultSet transportResultSet = new TransportResultSet();

            transportResultSet.KeyValue = scanValue.ToString();

            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanValue);

            if (gepWarehouse == null)
            {
                transportResultSet = new TransportCommonBiz().CheckCoreTranseportState(scanValue);
                if (0 < transportResultSet.Message.IndexOf("해외배송"))
                {
                    return transportResultSet;
                }
                else
                {
                    transportResultSet.KeyValue = scanValue.ToString();
                    transportResultSet.Code = ResultCodeEnum.Error;
                    transportResultSet.Message = "GEP 물류센터정보에 등록되어 있지 않는 건입니다.";
                    return transportResultSet;
                }
            }

            if (gepWarehouse.state != WarehouseStateEnum.Arrival && gepWarehouse.state != WarehouseStateEnum.PackingBox)
            {
                transportResultSet.KeyValue = scanValue.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "상품 상태값이 배송준비 스캔할 수 없는 상태입니다.";
                return transportResultSet;
            }

            if (gepWarehouse.trans_way_hist == null)
            {
                transportResultSet.Message = "상품 배송 방법 정보가 없습니다";
                transportResultSet.Code = ResultCodeEnum.Error;
                return transportResultSet;
            }

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

            if(q.Count == 0)
            {
                transportResultSet.Message = "상품 배송 방법 정보가 없습니다";
                transportResultSet.Code = ResultCodeEnum.Error;
                return transportResultSet;
            }

            string transWayCode = new TransportCommonBiz().GetTransWayCode(q[0].transport_way);
            if (transWayCode != "SP" && transWayCode != "RR")
            {
                transportResultSet.Message = "GEP-EMS 해외배송건 입니다.";
                transportResultSet.Code = ResultCodeEnum.Error;
                return transportResultSet;
            }

            //배송상태 체크
            transportResultSet = new TransportCommonBiz().CheckCoreTranseportState(scanValue);

            if (ResultCodeEnum.Error == transportResultSet.Code)
                return transportResultSet;

            transportResultSet.Message = "";
            transportResultSet.Code = ResultCodeEnum.OK;
            return transportResultSet;
        }
        /// <summary>
        /// 항공소형포장 EMS로 전환
        /// </summary>
        /// <param name="contrNo">체결번호</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>전환 결과</returns>
        public TransportResultSet SetChagneEMS(int contrNo, string userID)
        {
            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(contrNo);

            if (gepWarehouse == null)
            {
                return new TransportResultSet()
                {
                    KeyValue = contrNo.ToString()
                    ,
                    Code = ResultCodeEnum.Error
                    ,
                    Message = "GEP 물류센터정보에 등록되어 있지 않는 건입니다."
                };
            }
            GepTransWay transWayInfo = new TransportCommonBiz().GetTransWayInfo("EMS");
            transWayInfo.transport_way = "EMS-2";
            transWayInfo.reg_dt = DateTime.Now;
            transWayInfo.reg_id = userID;

            gepWarehouse.trans_way_hist.Add(transWayInfo);
            gepWarehouse.transinfo.trans_way = transWayInfo;

            new TransportGepWarehouseDac().Save(gepWarehouse);

            return new TransportResultSet()
            {
                KeyValue = contrNo.ToString()
                ,Code = ResultCodeEnum.OK
                ,Message = "EMS 전환이 완료되었습니다."
            };
        }
        /// <summary>
        /// EMS용 엑셀 데이터 다운로드
        /// </summary>
        /// <param name="orderNums">송장번호들 (구분자 ^)</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>엑셀용 html</returns>
        public string GetExcelHtmlToEMS(int[] orderNums, string userID)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine("<html>");
            stringBuilder.AppendLine("<head>");
            stringBuilder.AppendLine("<meta http-equiv='Content-type' content='text/html; charset=utf-8'>");
            stringBuilder.AppendLine("</head>");
            stringBuilder.AppendLine("<body>");

            stringBuilder.AppendLine("<table border='1' cellspacing='0' cellpadding='2' bordercolor='#93ACDB' bordercolorlight='#93ACDB' bordercolordark='#ffffff'>");
            stringBuilder.AppendLine("<tr>");

            stringBuilder.AppendLine("<th>일련번호</th>");
            stringBuilder.AppendLine("<th>입력일</th>");
            stringBuilder.AppendLine("<th>관리번호</th>");
            stringBuilder.AppendLine("<th>EMS번호</th>");
            stringBuilder.AppendLine("<th>보내는 사람</th>");
            stringBuilder.AppendLine("<th>우편번호</th>");
            stringBuilder.AppendLine("<th>보내는 사람 주소</th>");
            stringBuilder.AppendLine("<th>보내는 사람 전화1</th>");
            stringBuilder.AppendLine("<th>보내는 사람 전화2</th>");
            stringBuilder.AppendLine("<th>보내는 사람 EMAIL</th>");
            stringBuilder.AppendLine("<th>받는 사람</th>");
            stringBuilder.AppendLine("<th>받는 사람 우편번호</th>");
            stringBuilder.AppendLine("<th>받는 사람 주소</th>");
            stringBuilder.AppendLine("<th>받는 사람 전화1</th>");
            stringBuilder.AppendLine("<th>받는 사람 전화2</th>");
            stringBuilder.AppendLine("<th>국가명</th>");
            stringBuilder.AppendLine("<th>국가코드</th>");
            stringBuilder.AppendLine("<th>영문상품명1</th>");
            stringBuilder.AppendLine("<th>개수1</th>");
            stringBuilder.AppendLine("<th>가격1($)</th>");
            stringBuilder.AppendLine("<th>영문상품명2</th>");
            stringBuilder.AppendLine("<th>개수2</th>");
            stringBuilder.AppendLine("<th>가격2($)</th>");
            stringBuilder.AppendLine("<th>영문상품명3</th>");
            stringBuilder.AppendLine("<th>개수3</th>");
            stringBuilder.AppendLine("<th>가격3($)</th>");
            stringBuilder.AppendLine("<th>영문상품명4</th>");
            stringBuilder.AppendLine("<th>개수4</th>");
            stringBuilder.AppendLine("<th>가격4($)</th>");
            stringBuilder.AppendLine("<th>영문상품명5</th>");
            stringBuilder.AppendLine("<th>개수5</th>");
            stringBuilder.AppendLine("<th>가격5($)</th>");
            stringBuilder.AppendLine("<th>우편중량(g)</th>");
            stringBuilder.AppendLine("<th>우편요금(원)</th>");
            stringBuilder.AppendLine("<th>보내는업체명</th>");
            stringBuilder.AppendLine("<th>받는업체명</th>");
            stringBuilder.AppendLine("<th>보험여부</th>");
            stringBuilder.AppendLine("<th>보험금액(원)</th>");

            stringBuilder.AppendLine("</tr>");
            stringBuilder.AppendLine("</table>");

            stringBuilder.AppendLine("<table>");

            for (int k = 0; k < orderNums.Length; k++)
            {
                GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(orderNums[k]);

                if (gepWarehouse == null)
                {
                    continue;
                }

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

                stringBuilder.Append("<tr>");

                stringBuilder.AppendLine("<th>" + k.ToString() +"</th>");
                stringBuilder.AppendLine("<th>" + DateTime.Now.ToString("yyyy-MM-dd") + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.contr_no.ToString() + "</th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th>"  + gepWarehouse.sitetransinfo.sender_name +   "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_zip_code + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.sender_addr + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_tel_no + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_hp_no + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_email + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_name + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_zip_code + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_addr + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_tel_no + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_hp_no + "</th>");					stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_country_name + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_country_code + "</th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.transinfo.gep_order_count + "</th>");
                stringBuilder.AppendLine("<th>" + new TransportCommonBiz().GetUSDprice(gepWarehouse.transinfo.clone_contr_price) + "</th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.trns_cost.real_weight + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.trns_cost.real_transport_cost + "</th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");

                stringBuilder.Append("</tr>");
                new TransportCommonBiz().SetTransportState(orderNums[k], WarehouseStateEnum.Submitting, userID);
            }
            stringBuilder.AppendLine("</table>");

            stringBuilder.AppendLine("</body>");

            stringBuilder.AppendLine("</html>");

            return stringBuilder.ToString();
        }
예제 #8
0
        /// <summary>
        /// 도착 확인 스캔
        /// </summary>
        /// <param name="scanNumber">송장번호</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>스캔 결과</returns>
        public TransportResultSet ArriveScan(int scanNumber, string userID)
        {
            TransportResultSet transportResultSet = new TransportResultSet();

            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanNumber);

            if (gepWarehouse == null)
            {
                gepWarehouse = new GepWarehouse();

                gepWarehouse.contr_no = scanNumber;
                gepWarehouse.state = WarehouseStateEnum.Arrival;
                gepWarehouse.arrived_dt = DateTime.Now;
                gepWarehouse.arrived_id = userID;
                gepWarehouse.isCanceled = false;
                gepWarehouse.label_print_dt = DateTime.Now;
                gepWarehouse.label_print_id = userID;

            }
            else if (gepWarehouse.state == WarehouseStateEnum.Arrival)
            {
                transportResultSet.KeyValue = scanNumber.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "이미 도착확인된 상품입니다.";
                return transportResultSet;
            }
            else if (gepWarehouse.state != WarehouseStateEnum.Ready)
            {
                transportResultSet.KeyValue = scanNumber.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = String.Format("이미 처리된 상품입니다.\n (상태: {0})", gepWarehouse.state);
                return transportResultSet;
            }

            //배송상태 체크
            transportResultSet = new TransportCommonBiz().CheckCoreTranseportState(scanNumber);

            if (ResultCodeEnum.Error == transportResultSet.Code)
                return transportResultSet;

            /*
            //2012.04.14 jdkim SetGepWarehouseFromOrderData()로 변경
            //주문정보 및 국내배송정보조회
            GepTransInfo gepTransInfo = new TransportCommonBiz().GetGepTransInfoData(scanNumber, ref gepWarehouse);

            if (gepTransInfo == null)
            {
                transportResultSet.KeyValue = scanNumber.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "Gep 배송 정보가 없습니다.";
                return transportResultSet;
            }
            */

            transportResultSet = new TransportCommonBiz().SetGepWarehouseFromOrderData(scanNumber.ToString(), userID, ref gepWarehouse);

            if (ResultCodeEnum.OK != transportResultSet.Code)
                return transportResultSet;

            //Warehouse 저장
            new TransportGepWarehouseDac().Save(gepWarehouse);

            //상태변경
            if (!new TransportCommonBiz().SetTransportState(scanNumber, WarehouseStateEnum.Arrival, userID))
            {
                transportResultSet.KeyValue = scanNumber.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "gopm상태값 변경에 문제가 있습니다.";
                return transportResultSet;
            }

            //국내 배송완료
            TransportD4UpdateT transportD4UpdateT = new TransportCommonBiz().TransportD4Update(scanNumber, userID, "S", "GEP국내배송처리", "N");

            if (transportD4UpdateT.Error != 0)
            {
                transportResultSet.KeyValue = scanNumber.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "국내배송 도착확인 처리에 문제가 있습니다.";
                //Result.Message = D4Data.RetMsg;
                return transportResultSet;
            }

            transportResultSet.KeyValue = scanNumber.ToString();
            transportResultSet.Code = ResultCodeEnum.OK;
            transportResultSet.Message = "";

            return transportResultSet;
        }
예제 #9
0
        /// <summary>
        /// 도착 확인 스캔한 데이터 취득
        /// </summary>
        /// <param name="scanValue">송장번호</param>
        /// <returns>스캔한 데이터</returns>
        public ArriveGridData GetArriveData(int scanValue)
        {
            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanValue);

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

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

            return new ArriveGridData()
            {
                ObjectID = gepWarehouse.contr_no.ToString()
                ,
                Idx = "1"
                ,
                ArrivedDate = (null == gepWarehouse.arrived_dt ? "" : gepWarehouse.arrived_dt.Value.ToString("yyyy-MM-dd HH:mm:ss"))
                ,
                BuyerID = gepWarehouse.transinfo.clone_buyer_id
                ,
                BuyerName = gepWarehouse.transinfo.clone_buyer_name
                ,
                EbayContractDate = gepWarehouse.transinfo.gep_payment_dt.ToString("yyyy-MM-dd HH:mm:ss")
                ,
                ForeingConutryTransc = tw[0].transport_way
                ,
                InvoiceNum = gepWarehouse.transinfo.local_invoice_no
                ,
                LocalTransc = gepWarehouse.transinfo.local_express_nm
                ,
                OrderNum = gepWarehouse.contr_no.ToString()
                ,
                ProductName = gepWarehouse.transinfo.clone_item_name
                ,
                ProductNum = gepWarehouse.transinfo.clone_item_no
                ,
                ProductOption = gepWarehouse.transinfo.clone_option_info
                ,
                SellerID = gepWarehouse.transinfo.clone_seller_id
                ,
                SellerName = gepWarehouse.transinfo.clone_seller_name
                ,
                //State = gepWarehouse.GetState
                State = GEP.Framework.data.EnumDHelper.GetDescription(gepWarehouse.transinfo.state)
                ,
                ProductAmt = gepWarehouse.transinfo.gep_order_count.ToString()
            };
        }
예제 #10
0
        ///GSM 라벨출력 정보 조회
        /// </summary>
        /// <param name="contrnos">송장번호</param>
        /// <returns>0 : 정상, -99 : 에러</returns>
        public List<LabelPrintResult> GetGepLabelPrintList(string contrnos)
        {
            List<LabelPrintResult> listLabelPrintResult = new List<LabelPrintResult>();

            if (String.IsNullOrEmpty(contrnos))
            {
                return listLabelPrintResult;
            }

            List<string> listContrNo = new List<string>(contrnos.Split(','));

            try
            {
                foreach (string contr_no in listContrNo)
                {
                    if (String.IsNullOrEmpty(contr_no))
                    {
                        continue;
                    }

                    GepWarehouse gepWarehouse = null;
                    gepWarehouse = new TransportGepWarehouseDac().FindOne(Convert.ToInt32(contr_no));
                    if (gepWarehouse != null)
                    {
                        LabelPrintResult labelinfo = new LabelPrintResult();
                        labelinfo.ContrNo = gepWarehouse.contr_no.ToString();
                        labelinfo.PrintDT = (null == gepWarehouse.gsm_label_print_dt ? "" : gepWarehouse.gsm_label_print_dt.Value.ToString("yyyy-MM-dd HH:mm:ss"));

                        listLabelPrintResult.Add(labelinfo);
                    }

                }
            }
            catch (Exception ex)
            {
                return null;
            }

            //gwDac.Dispose();

            return listLabelPrintResult;
        }
예제 #11
0
        /// <summary>
        /// 배송상태 변경
        /// </summary>
        /// <param name="scanValue"></param>
        /// <param name="state"></param>
        /// <param name="userID"></param>
        /// <returns></returns>
        public bool SetTransportState(int scanValue, WarehouseStateEnum state, string userID)
        {
            GepWarehouse GWData = new TransportGepWarehouseDac().FindOne(scanValue);

            if (GWData == null)
            {
                return false;
            }

            if (state == WarehouseStateEnum.Arrival)
            {
                GWData.state = state;
                GWData.arrived_dt = DateTime.Now;
                GWData.arrived_id = userID;
                GWData.transinfo.state = GepShippingStateEnum.InWarehouse;
            }
            else if (state == WarehouseStateEnum.PackingBox)
            {
                GWData.state = state;
                GWData.check_weight_dt = DateTime.Now;
                GWData.check_weight_id = userID;
            }
            else if (state == WarehouseStateEnum.Submitting)
            {
                GWData.state = state;
                GWData.excel_ouput_dt = DateTime.Now;
                GWData.excel_output_id = userID;
            }
            else if (state == WarehouseStateEnum.InputInvoice)
            {
                //*todo: 송장 추적 관련 로직을 여기서 처리해야함.
                GWData.state = state;
                GWData.invoice_input_dt = DateTime.Now;
                GWData.invoice_input_id = userID;
                GWData.transinfo.state = GepShippingStateEnum.Tracking;
            }
            else
            {
                return false;
            }

            new TransportGepWarehouseDac().Save(GWData);

            return true;
        }
        public string GetGEPContractDetailDataForExcel(int dateSerchType, DateTime sDate, DateTime eDate, int numSerchType, string serchNum)
        {
            List<GepWarehouse> gepWarehouse = new TransportGepWarehouseDac().Find(dateSerchType, sDate, eDate, numSerchType, serchNum);

            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine("<html>");
            stringBuilder.AppendLine("<head>");
            stringBuilder.AppendLine("<meta http-equiv='Content-type' content='text/html; charset=utf-8'>");
            stringBuilder.AppendLine("</head>");
            stringBuilder.AppendLine("<body>");

            stringBuilder.AppendLine("<table border='1' cellspacing='0' cellpadding='2' bordercolor='#93ACDB' bordercolorlight='#93ACDB' bordercolordark='#ffffff'>");

            stringBuilder.AppendLine("<tr>");
            stringBuilder.AppendLine("<th>상태</th>");
            stringBuilder.AppendLine("<th>해외배송사</th>");
            stringBuilder.AppendLine("<th>해외배송송장번호</th>");
            stringBuilder.AppendLine("<th>체결일</th>");
            stringBuilder.AppendLine("<th>주문번호</th>");
            stringBuilder.AppendLine("<th>상품번호</th>");
            stringBuilder.AppendLine("<th>상품명</th>");
            stringBuilder.AppendLine("<th>선택/옵션</th>");
            stringBuilder.AppendLine("<th>수량</th>");
            stringBuilder.AppendLine("<th>수취인명</th>");
            stringBuilder.AppendLine("<th>수취인연락처</th>");
            stringBuilder.AppendLine("<th>배송국가</th>");
            stringBuilder.AppendLine("<th>배송지주소</th>");
            stringBuilder.AppendLine("<th>물류센터도착일</th>");
            stringBuilder.AppendLine("<th>택배사</th>");
            stringBuilder.AppendLine("<th>송장번호</th>");
            stringBuilder.AppendLine("<th>처리자ID</th>");
            stringBuilder.AppendLine("<th>예상무게</th>");
            stringBuilder.AppendLine("<th>실측무게</th>");
            stringBuilder.AppendLine("<th>예상배송비</th>");
            stringBuilder.AppendLine("<th>실측배송비</th>");
            stringBuilder.AppendLine("<th>체결ID</th>");
            stringBuilder.AppendLine("<th>EMS전환일</th>");
            stringBuilder.AppendLine("<th>판매자명</th>");
            stringBuilder.AppendLine("<th>판매자ID</th>");
            stringBuilder.AppendLine("</tr>");

            stringBuilder.AppendLine("</table>");

            stringBuilder.AppendLine("<table>");

            if (gepWarehouse != null)
            {
                foreach (var t in gepWarehouse)
                {
                    var Target = GetGEPContractDetail(t);
                    stringBuilder.AppendLine("<tr>");
                    stringBuilder.AppendLine("<td>" + Target.State + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ForeingConutryTransc + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ForeingConutryInvoiceNum + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ContractDate + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.OrderNum + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ProductNum + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ProductName + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ProductOption + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ProductAmt + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ReceiverName + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ReceiverContact + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.DeliveryNation + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.DeliveryAddress + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ArrivedDate + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.LocalTransc + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.InvoiceNum + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.UserID + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ExpectedWeight + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.RealWeight + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ExpectedWeightCost + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.RealWeightCost + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.ContractID + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.EMSChagneDate + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.SellerName + "</td>");
                    stringBuilder.AppendLine("<td>" + Target.SellerID + "</td>");
                    stringBuilder.AppendLine("</tr>");
                }
            }
            //실제 리턴할 html

            stringBuilder.AppendLine("</table>");

            stringBuilder.AppendLine("</body>");

            stringBuilder.AppendLine("</html>");

            return stringBuilder.ToString();
        }
        /// <summary>
        /// 배송대기 스캔
        /// </summary>
        /// <param name="scanValue">송장번호</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>스캔 결과</returns>
        public TransportResultSet SetDeliveryReadyWaitScan(int scanValue, string userID)
        {
            TransportResultSet transportResultSet = new TransportResultSet();

            transportResultSet.KeyValue = scanValue.ToString();

            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanValue);

            if (gepWarehouse == null)
            {
                transportResultSet = new TransportCommonBiz().CheckCoreTranseportState(scanValue);
                if (0 < transportResultSet.Message.IndexOf("해외배송"))
                {
                    return transportResultSet;
                }
                else
                {
                    transportResultSet.KeyValue = scanValue.ToString();
                    transportResultSet.Code = ResultCodeEnum.Error;
                    transportResultSet.Message = "GEP 물류센터정보에 등록되어 있지 않는 건입니다.";
                    return transportResultSet;
                }
            }

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

            if (q.Count == 0)
            {
                transportResultSet.Message = "상품 배송 방법 정보가 없습니다";
                transportResultSet.Code = ResultCodeEnum.Error;
                return transportResultSet;
            }

            if (q[0].transport_way.IndexOf("EMS") < 0)
            {
                transportResultSet.Message = "항공소형포장건 입니다.";
                transportResultSet.Code = ResultCodeEnum.Error;
                return transportResultSet;
            }

            if (gepWarehouse.state != WarehouseStateEnum.PackingBox && gepWarehouse.state != WarehouseStateEnum.Submitting)
            {
                transportResultSet.KeyValue = scanValue.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "상품 상태값이 배송대기 스캔할 수 없는 상태입니다.";
                return transportResultSet;
            }

            //int CheckResult = new TransportCommonBiz().CheckCoreTranseportState(gepWarehouse.contr_no);

            //int TranseportCheck = new TransportCommonBiz().CheckCoreTranseportState(scanValue);

            //if (TranseportCheck == 1)
            //{
            //    transportResultSet.KeyValue = scanValue.ToString();
            //    transportResultSet.Code = ResultCodeEnum.Error;
            //    transportResultSet.Message = "반품된 상품 입니다.";
            //    return transportResultSet;
            //}

            //if (TranseportCheck == -11)
            //{
            //    transportResultSet.KeyValue = scanValue.ToString();
            //    transportResultSet.Code = ResultCodeEnum.Error;
            //    transportResultSet.Message = "G마켓 해외배송 상품입니다.";
            //    return transportResultSet;
            //}

            //if (TranseportCheck < 0)
            //{
            //    transportResultSet.KeyValue = scanValue.ToString();
            //    transportResultSet.Code = ResultCodeEnum.Error;
            //    transportResultSet.Message = "에러 입니다.";
            //    return transportResultSet;
            //}

            //배송상태 체크
            transportResultSet = new TransportCommonBiz().CheckCoreTranseportState(scanValue);

            if (ResultCodeEnum.Error == transportResultSet.Code)
                return transportResultSet;

            transportResultSet.Code = ResultCodeEnum.OK;
            transportResultSet.Message = "";

            return transportResultSet;
        }
        /// <summary>
        /// E-Shipping용 엑셀 데이터 다운로드
        /// </summary>
        /// <param name="orderNums">송장번호들 (구분자 ^)</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>엑셀 다운로드용 html</returns>
        public string GetExcelHtmlToES(int[] orderNums, string userID)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("<html>");
            stringBuilder.Append("<head>");
            stringBuilder.Append("<meta http-equiv='Content-type' content='text/html; charset=utf-8'>");
            stringBuilder.Append("</head>");
            stringBuilder.Append("<body>");
            stringBuilder.Append("<table width='1000' border='1' cellspacing='0' cellpadding='2' bordercolor='#93ACDB' bordercolorlight='#93ACDB' bordercolordark='#ffffff'>");
            stringBuilder.Append(" <tr>");

            stringBuilder.Append(" <td>");
            stringBuilder.Append("");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td colspan='32'>");
            stringBuilder.Append("수취인정보(영문 알파벳만 작성)-허용 불가한 특수문자①( “ ? ! $ %  ^  *  +  { }  [ ] | \\) ② 영문알파벳과 비슷한 스페인어 등 ③ 영문 붙여넣기 ");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" </tr>");

            // 두번째 행 제목
            stringBuilder.Append(" <tr>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("상품구분<br>(Sample-샘플)<br>(Gift-선물)<br>(Merchandise-상품)<br>(Document-서류)<br>4가지중  하단 버튼이용 선택");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("수취인명<br>(영문40자이내 <br>공백포함)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("수취인EMAIL");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("수취인전화<br>국가번호<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("수취인전화<br>지역번호<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("수취인전화<br>국번<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("수취인전화<br>전화번호<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td>");
            stringBuilder.Append("수취인국가코드보기<br>EMS");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td>");
            stringBuilder.Append("수취인국가명<br>(영문국가명 국가코드 확실<br>시  생략가능) ");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("수취인우편번호<br>(숫자,문자 가능<br>20자이내)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("수취인주소<br>( 영문 140자이내 공백포함)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("박스포장<br>총중량(g)<br>(실제 요금이 적용<br>되는 무게)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("내용품명<br>(영문 32자이내 <br>공백포함)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("개수");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("순준량(g)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("가격(us$)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("HSCODE<br>(코드보기)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("생산지");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>"); // 보험가입여부
            stringBuilder.Append("보험가입여부<br>(Y/N)<br>(미선택시<br>공백가능)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>"); // 보험가입금액
            stringBuilder.Append("보험가입금액<br>(물품가액을 <br>기입 원\\)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>"); // 프리미엄여부
            stringBuilder.Append("프리미엄여부<br>(Y/N)<br>(미선택시<br>공백가능)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("고객주문번호<br>( 숫자,영문 30자이내)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인우편번호<br>(숫자6자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인주소<br>( 영문 140자이내 공백포함)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append("<td rowspan=2>");
            stringBuilder.Append("주문인명<br>( 영문 40자이내 공백포함)");
            stringBuilder.Append("</td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인전화<br>국가번호<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인전화<br>지역번호<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인전화<br>국번<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인<br>전화번호<br>(숫자4자리)");
            stringBuilder.Append(" </td rowspan=2>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인휴대전화<br>지역번호<br>(숫자3자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인휴대전화<br>국번<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인휴대전화<br>끝번<br>(숫자4자리)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td rowspan=2>");
            stringBuilder.Append("주문인EMAIL<br>( 영문 40자이내)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" </tr>");

            //3번째
            stringBuilder.Append(" <tr>");

            stringBuilder.Append(" <td >");
            stringBuilder.Append("수취인국가코드보기<br>EMS프리미엄<br>(예시 미국->US입력)");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" <td >");
            stringBuilder.Append("국가별<br>발송조건 보기");
            stringBuilder.Append(" </td>");

            stringBuilder.Append(" </tr>");
            stringBuilder.AppendLine("</table>");

            stringBuilder.AppendLine("<table>");

            for (int k = 0; k < orderNums.Length; k++)
            {
                GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(orderNums[k]);

                if (gepWarehouse == null)
                {
                    continue;
                }

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

                stringBuilder.Append("<tr>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append("");
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append("Gift");
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.receiver_name);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.receiver_email);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.receiver_country_code);
                stringBuilder.Append(" </td>");

                string Temp = Regex.Replace(gepWarehouse.sitetransinfo.receiver_tel_no, @"\D", "");
                if (Temp.Length >= 10)
                {
                    int Length = Temp.Length;

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 10, 3));
                    stringBuilder.Append(" </td>");

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 7, 3));
                    stringBuilder.Append(" </td>");

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 4, 4));
                    stringBuilder.Append(" </td>");
                }
                else
                {
                    stringBuilder.Append("<td></td><td></td><td></td>");
                }

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.receiver_iso_country_code);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.receiver_country_name);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.receiver_zip_code);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.receiver_addr);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.trns_cost.real_weight);
                stringBuilder.Append(" </td>");

                //영문상품명은 중분류카테고리 영문명.
                string strEngName = String.IsNullOrEmpty(gepWarehouse.transinfo.gep_mcategory_ename) ?
                                        gepWarehouse.transinfo.gep_item_ename : gepWarehouse.transinfo.gep_mcategory_ename;
                stringBuilder.Append(" <td>");
                stringBuilder.Append(strEngName);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.transinfo.gep_order_count);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.trns_cost.real_weight);
                stringBuilder.Append(" </td>");

                stringBuilder.AppendLine("<td>" + new TransportCommonBiz().GetUSDprice(gepWarehouse.transinfo.clone_contr_price) + "</td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.hscode);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append("Korea");
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append("");
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append("");
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append("");
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.contr_no.ToString());
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.sender_zip_code);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.sender_addr);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.sender_name);
                stringBuilder.Append("</td>");

                stringBuilder.Append(" <td>");
                stringBuilder.Append(gepWarehouse.sitetransinfo.receiver_country_code);
                stringBuilder.Append(" </td>");

                Temp = Regex.Replace(gepWarehouse.sitetransinfo.sender_tel_no, @"\D", "");

                if (Temp.Length >= 10)
                {
                    int Length = Temp.Length;

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 10, 3));
                    stringBuilder.Append(" </td>");

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 7, 3));
                    stringBuilder.Append(" </td>");

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 4, 4));
                    stringBuilder.Append(" </td>");
                }
                else
                {
                    stringBuilder.Append("<td></td><td></td><td></td>");
                }

                Temp = Regex.Replace(gepWarehouse.sitetransinfo.sender_hp_no, @"\D", "");
                if (Temp.Length >= 10)
                {
                    int Length = Temp.Length;

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 10, 3));
                    stringBuilder.Append(" </td>");

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 7, 3));
                    stringBuilder.Append(" </td>");

                    stringBuilder.Append(" <td>");
                    stringBuilder.Append(Temp.Substring(Length - 4, 4));
                    stringBuilder.Append(" </td>");
                }
                else
                {
                    stringBuilder.Append("<td></td><td></td><td></td>");
                }

                stringBuilder.Append(" <td>");
                //stringBuilder.Append(gepWarehouse.sitetransinfo.sender_email);	//주문번호로 채워짐.
                stringBuilder.Append(gepWarehouse.contr_no);
                stringBuilder.Append(" </td>");

                stringBuilder.Append(" </tr>");

                new TransportCommonBiz().SetTransportState(orderNums[k], WarehouseStateEnum.Submitting, userID);
            }
            stringBuilder.AppendLine("</table>");

            stringBuilder.AppendLine("</body>");

            stringBuilder.AppendLine("</html>");

            return stringBuilder.ToString();
        }
        /// <summary>
        /// 배송대기 스캔
        /// </summary>
        /// <param name="scanValue">체결번호</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>스캔 결과</returns>
        public TransportResultSet SetDeliveryReadyWaitScan(int scanValue, string userID)
        {
            TransportResultSet transportResultSet = new TransportResultSet();

            transportResultSet.KeyValue = scanValue.ToString();

            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanValue);

            if (gepWarehouse == null)
            {
                transportResultSet = new TransportCommonBiz().CheckCoreTranseportState(scanValue);
                if (0 < transportResultSet.Message.IndexOf("해외배송"))
                {
                    return transportResultSet;
                }
                else
                {
                    transportResultSet.KeyValue = scanValue.ToString();
                    transportResultSet.Code = ResultCodeEnum.Error;
                    transportResultSet.Message = "GEP 물류센터정보에 등록되어 있지 않는 건입니다.";
                    return transportResultSet;
                }
            }

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

            if (q[0].transport_way != "SP" && q[0].transport_way != "RR")
            {
                transportResultSet.Message = "GEP-EMS 해외배송건 입니다.";
                transportResultSet.Code = ResultCodeEnum.Error;
                return transportResultSet;
            }

            if (gepWarehouse.state != WarehouseStateEnum.PackingBox && gepWarehouse.state != WarehouseStateEnum.Submitting)
            {
                transportResultSet.KeyValue = scanValue.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "상품 상태값이 배송대기 스캔할 수 없는 상태입니다.";
                return transportResultSet;
            }

            //배송상태 체크
            transportResultSet = new TransportCommonBiz().CheckCoreTranseportState(scanValue);

            if (ResultCodeEnum.Error == transportResultSet.Code)
                return transportResultSet;

            transportResultSet.Code = ResultCodeEnum.OK;
            transportResultSet.Message = "";

            return transportResultSet;
        }
예제 #16
0
        public GepShippingSummaryT GetShippingSummary(string ta_gmkt_id)
        {
            //국내배송 건수
            GepShippingSummaryT sumData = new TransportGMKTCoreDac().ShippingSummary(ta_gmkt_id);

            //해외배송 건수
            GepShippingSummaryT overseaSumData = new TransportGepWarehouseDac().GetShippingSummary(ta_gmkt_id);

            sumData.InWarehouseCnt = overseaSumData.InWarehouseCnt;
            sumData.OverseaShippingCnt = overseaSumData.OverseaShippingCnt;

            return sumData;
        }
        /// <summary>
        /// 무게 수신 정보 저장
        /// </summary>
        /// <param name="contrNo">체결번호</param>
        /// <param name="scanWeight">무게</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>무게 수신 결과</returns>
        public TransportResultSet SetDeliveryReadyWeightSave(int contrNo, int scanWeight, string userID)
        {
            TransportResultSet transportResultSet = new TransportResultSet();

            transportResultSet.KeyValue = contrNo.ToString();

            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(contrNo);

            if (gepWarehouse == null)
            {
                transportResultSet.KeyValue = contrNo.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "GEP 물류센터정보에 등록되어 있지 않는 건입니다.";
                return transportResultSet;
            }

            if (gepWarehouse.state != WarehouseStateEnum.Arrival && gepWarehouse.state != WarehouseStateEnum.PackingBox)
            {
                transportResultSet.KeyValue = contrNo.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "상품 상태값이 배송준비 스캔할 수 없는 상태입니다.";
                return transportResultSet;
            }

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

            int Cost = new TransportCommonBiz().GetTransportCostForWeight(scanWeight,
                                                            gepWarehouse.sitetransinfo.sender_iso_country_code,
                                                            gepWarehouse.sitetransinfo.receiver_iso_country_code,
                                                            gepWarehouse.sitetransinfo.trans_way,
                                                            ShippingRateTypeEnum.GmktToExpress);

            if (Cost == 0)
            {
                transportResultSet.KeyValue = contrNo.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "배송비 계산에 문제가 있습니다.";
                return transportResultSet;
            }

            gepWarehouse.trns_cost.real_weight = scanWeight;
            gepWarehouse.trns_cost.real_transport_cost = Cost;
            gepWarehouse.trns_cost.reg_dt = DateTime.Now;
            gepWarehouse.trns_cost.reg_id = userID;
            gepWarehouse.check_weight_dt = DateTime.Now;
            gepWarehouse.check_weight_id = userID;

            //new TransportGepWarehouseDac().Save(gepWarehouse);

            //if (!new TransportCommonBiz().SetTransportState(contrNo, WarehouseStateEnum.PackingBox, userID))
            //{
            //    transportResultSet.KeyValue = contrNo.ToString();
            //    transportResultSet.Code = ResultCodeEnum.Error;
            //    transportResultSet.Message = "gopm상태값 변경에 문제가 있습니다.";
            //    return transportResultSet;
            //}

            if (false == new TransportCommonBiz().SetTransportState(ref gepWarehouse, WarehouseStateEnum.PackingBox, userID))
            {
                transportResultSet.KeyValue = contrNo.ToString();
                transportResultSet.Code = ResultCodeEnum.Error;
                transportResultSet.Message = "gopm상태값 변경에 문제가 있습니다.";
                return transportResultSet;
            }

            //상태변경하고 저장
            new TransportGepWarehouseDac().Save(gepWarehouse);

            //실측무게 배송비 전달용
            transportResultSet.KeyValue = Cost.ToString();

            if (scanWeight > 2000)
            {
                transportResultSet.Code = ResultCodeEnum.MustChagneEMS;
                transportResultSet.Message = "EMS로 전환 요청";
            }
            else
            {
                transportResultSet.Code = ResultCodeEnum.OK;
                transportResultSet.Message = "";

                //gep 무게 업데이트
                new TransportCommonBiz().SetGepItemWeight(gepWarehouse.transinfo.gep_item_id.ToString(), scanWeight);
            }

            return transportResultSet;
        }
예제 #18
0
        /// <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;
            }
        }
        /// <summary>
        /// 배송완료 상품 송장입력
        /// </summary>
        /// <param name="orderNums">송장번호들 (구분자 ^)</param>
        /// <param name="invoiceNums">해외송장번호들 (구분자 ^)</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns></returns>
        public List<TransportResultSet> SetInvoceNums(int[] orderNums, string[] invoiceNums, string userID)
        {
            List<TransportResultSet> Results = new List<TransportResultSet>();

            if (orderNums.Length != invoiceNums.Length)
            {
                Results.Add(new TransportResultSet() {
                    KeyValue = ""
                    ,Code = ResultCodeEnum.Error
                    ,Message = "인자값이 잘못되었습니다."
                });
                return Results;
            }

            for (int k = 0; k < orderNums.Length; k++)
            {
                GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(orderNums[k]);

                if (gepWarehouse == null)
                {
                    Results.Add(new TransportResultSet()
                    {
                        KeyValue = orderNums[k].ToString()
                        ,
                        Code = ResultCodeEnum.Error
                        ,
                        Message = "도착확인되지 않은 상품입니다."
                    });
                    continue;
                }

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

                if (q.Count == 0)
                {
                    Results.Add(new TransportResultSet()
                    {
                        KeyValue = orderNums[k].ToString()
                        ,
                        Code = ResultCodeEnum.Error
                        ,
                        Message = "상품 배송 방법 정보가 없습니다"
                    });
                    continue;
                }

                string transWayCode = new TransportCommonBiz().GetTransWayCode(q[0].transport_way);
                if (transWayCode != "SP" && transWayCode != "RR")
                {
                    Results.Add(new TransportResultSet()
                    {
                        KeyValue = orderNums[k].ToString()
                        ,
                        Code = ResultCodeEnum.Error
                        ,
                        Message = "항공소형포장건 입니다."
                    });
                    continue;
                }

                if (gepWarehouse.state != WarehouseStateEnum.Submitting && gepWarehouse.state != WarehouseStateEnum.InputInvoice)
                {
                    Results.Add(new TransportResultSet()
                    {
                        KeyValue = orderNums[k].ToString()
                        ,
                        Code = ResultCodeEnum.Error
                        ,
                        Message = "gopm 상태값이 송장 입력할수 있는 상태가 아닙니다."
                    });
                    continue;
                }

                gepWarehouse.invoice_input_dt = DateTime.Now;
                gepWarehouse.invoice_input_id = userID;
                gepWarehouse.state = WarehouseStateEnum.InputInvoice;
                gepWarehouse.transinfo.state = GepShippingStateEnum.Tracking;

                gepWarehouse.transinfo.oversea_invoice_no = invoiceNums[k];

                new TransportGepWarehouseDac().Save(gepWarehouse);

                new TransportCommonBiz().SetTransportState(orderNums[k], WarehouseStateEnum.InputInvoice, userID);

                Results.Add(new TransportResultSet() {
                    KeyValue = gepWarehouse.contr_no.ToString()
                    ,Code = ResultCodeEnum.OK
                    ,Message = ""
                });
            }

            return Results;
        }
        /// <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 tw = (from t in gepWarehouse.trans_way_hist
                     orderby t.reg_dt descending
                     select t).ToList();

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

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

            return new DeliveryWaitGridData() {
                DeliveryAddress = gepWarehouse.sitetransinfo.receiver_addr
                ,DeliveryNation = gepWarehouse.sitetransinfo.receiver_country_name
                ,ForeingConutryTransc = tw[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
            };
        }
예제 #21
0
        /// <summary>
        /// 묶음 배송된 상품 데이터 취득
        /// </summary>
        /// <param name="scanValue">송장번호</param>
        /// <returns>해당하는 송장의 국내 배송번호가 같은 상품 데이터</returns>
        public List<ArriveGridData> GetSummeryArriveData(int scanValue)
        {
            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanValue);

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

            List<GepWarehouse> listGepWarehouse = new TransportGepWarehouseDac().Find(gepWarehouse.transinfo.local_invoice_no);

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

            List<GepTransInfo> listGepTransInfo = new TransportCommonBiz().GetGepTransInfoDatas(gepWarehouse.transinfo.local_invoice_no);

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

            List<ArriveGridData> listArriveGridData = new List<ArriveGridData>();

            int k = 0;
            foreach (var t in listGepTransInfo)
            {
                if (t == null)
                {
                    continue;
                }

                k++;

                int Count = 0;

                if (listGepWarehouse != null && listGepWarehouse.Count != 0)
                {
                    Count = (from f in listGepWarehouse
                                 where t.contr_no == f.contr_no
                                 select t).Count();
                }

                listArriveGridData.Add(new ArriveGridData()
                {
                    Idx = k.ToString()
                    ,
                    ArrivedDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                    ,
                    BuyerID = t.clone_buyer_id
                    ,
                    BuyerName = t.clone_buyer_name
                    ,
                    EbayContractDate = ""
                    ,
                    ForeingConutryTransc = t.trans_way.transport_way
                    ,
                    InvoiceNum = t.local_invoice_no
                    ,
                    LocalTransc = t.local_express_nm
                    ,
                    ObjectID = ObjectId.GenerateNewId().ToString()
                    ,
                    OrderNum = t.contr_no.ToString()
                    ,
                    ProductAmt = t.gep_order_count.ToString()
                    ,
                    ProductName = t.clone_item_name
                    ,
                    ProductNum = t.clone_item_no.ToString()
                    ,
                    ProductOption = t.clone_option_info
                    ,
                    SellerID = t.clone_seller_id
                    ,
                    SellerName = t.clone_seller_name
                    ,
                    State = Count == 0 ? "입고" : "도착"
                });
            }

            return listArriveGridData;
        }
        /// <summary>
        /// 배송 대기 데이터 엑셀 취득
        /// </summary>
        /// <param name="orderNums">송장번호</param>
        /// <param name="userID">사용자 아이디</param>
        /// <returns>엑셀 파일 구성용 html</returns>
        public string GetExcelHtml(int[] orderNums, string userID)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine("<html>");
            stringBuilder.AppendLine("<head>");
            stringBuilder.AppendLine("<meta http-equiv='Content-type' content='text/html; charset=utf-8'>");
            stringBuilder.AppendLine("</head>");
            stringBuilder.AppendLine("<body>");

            stringBuilder.AppendLine("<table border='1' cellspacing='0' cellpadding='2' bordercolor='#93ACDB' bordercolorlight='#93ACDB' bordercolordark='#ffffff'>");

            stringBuilder.AppendLine("<tr>");
            stringBuilder.AppendLine("<th>순번</th>");
            stringBuilder.AppendLine("<th>등기번호</th>");
            stringBuilder.AppendLine("<th>도착국가코드</th>");
            stringBuilder.AppendLine("<th>중량(g)</th>");
            stringBuilder.AppendLine("<th>수취인성명</th>");
            stringBuilder.AppendLine("<th>수취인우편번호</th>");
            stringBuilder.AppendLine("<th>상세주소(수취인)</th>");
            stringBuilder.AppendLine("<th>시군(수취인)</th>");
            stringBuilder.AppendLine("<th>주도(수취인)</th>");
            stringBuilder.AppendLine("<th>수취인전화번호</th>");
            stringBuilder.AppendLine("<th>발송인성명</th>");
            stringBuilder.AppendLine("<th>발송인우편번호</th>");
            stringBuilder.AppendLine("<th>시도(발송인)</th>");
            stringBuilder.AppendLine("<th>구군(발송인)</th>");
            stringBuilder.AppendLine("<th>상세주소(발송인)</th>");
            stringBuilder.AppendLine("<th>발송인휴대폰</th>");
            stringBuilder.AppendLine("<th>구분</th>");
            stringBuilder.AppendLine("<th>내용품명</th>");
            stringBuilder.AppendLine("<th>물품개수</th>");
            stringBuilder.AppendLine("<th>물품가격(US$)</th>");
            stringBuilder.AppendLine("<th>G주문번호</th>");

            stringBuilder.AppendLine("</tr>");

            stringBuilder.AppendLine("</table>");

            stringBuilder.AppendLine("<table>");

            for (int k = 0; k < orderNums.Length; k++)
            {
                GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(orderNums[k]);

                if (gepWarehouse == null)
                {
                    continue;
                }

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

                stringBuilder.Append("<tr>");

                stringBuilder.AppendLine("<th>" + (k+1).ToString() + "</th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_iso_country_code +"</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.trns_cost.real_weight + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_name + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_zip_code + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_addr + "</th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.receiver_tel_no + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.sender_name + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.sender_zip_code + "</th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th></th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.sender_addr + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.sitetransinfo.sender_hp_no + "</th>");
                stringBuilder.AppendLine("<th></th>");

                //영문상품명은 중분류카테고리 영문명.
                string strEngName = String.IsNullOrEmpty(gepWarehouse.transinfo.gep_mcategory_ename) ?
                                        gepWarehouse.transinfo.gep_item_ename : gepWarehouse.transinfo.gep_mcategory_ename;
                stringBuilder.AppendLine("<th>" + strEngName + "</th>");

                stringBuilder.AppendLine("<th>" + gepWarehouse.transinfo.gep_order_count + "</th>");
                stringBuilder.AppendLine("<th>" + new TransportCommonBiz().GetUSDprice(gepWarehouse.transinfo.clone_contr_price) + "</th>");
                stringBuilder.AppendLine("<th>" + gepWarehouse.contr_no + "</th>");

                stringBuilder.Append("</tr>");

                new TransportCommonBiz().SetTransportState(orderNums[k], WarehouseStateEnum.Submitting, userID);
            }
            stringBuilder.AppendLine("</table>");

            stringBuilder.AppendLine("</body>");

            stringBuilder.AppendLine("</html>");

            return stringBuilder.ToString();
        }
예제 #23
0
        /// <summary>
        /// 묶음 배송된 상품 도착 확인
        /// </summary>
        /// <param name="scanValue">송장번호</param>
        /// <param name="userID">유저 아이디</param>
        /// <returns>도착 확인 결과</returns>
        public List<TransportResultSet> SetSummeryArrive(int scanValue, string userID)
        {
            List<TransportResultSet> listTransportResultSet = new List<TransportResultSet>();

            GepWarehouse gepWarehouse = new TransportGepWarehouseDac().FindOne(scanValue);

            if (gepWarehouse == null)
            {
                listTransportResultSet.Add(new TransportResultSet()
                {
                    KeyValue = scanValue.ToString()
                    ,
                    Code = ResultCodeEnum.Error
                    ,
                    Message = "도착 확인된 건이 아닙니다."
                });

                return listTransportResultSet;
            }

            string LocalInvoceNum = gepWarehouse.transinfo.local_invoice_no;

            List<GepTransInfo> listGepTransInfo = new TransportCommonBiz().GetGepTransInfoDatas(LocalInvoceNum);

            if (listGepTransInfo == null)
            {
                listTransportResultSet.Add(new TransportResultSet()
                {
                    KeyValue = scanValue.ToString()
                    ,
                    Code = ResultCodeEnum.Error
                    ,
                    Message = "Gep 연동 데이터가 없습니다."
                });

                return listTransportResultSet;
            }

            var q = (from t in listGepTransInfo
                     where t.contr_no != scanValue
                     select t).ToList();

            foreach (var t in q)
            {
                listTransportResultSet.Add(ArriveScan(t.contr_no, userID));
            }

            return listTransportResultSet;
        }
        /// <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
            };
        }