Ejemplo n.º 1
0
        public override void MakeDBData(tblOrderData pExcelData)
        {
            Dictionary<string, tblOrderData> pOrderList = OrderManager.Instance.GetOrderList();
            LQStructures.LQCrawlerInfo pCrawler = CrawlerManager.Instance.GetCrawlerInfo();

            // DB에 저장되어 있던 값이 아니면 들어온 값이라면
            if (pOrderList.ContainsKey(pExcelData.channelOrderCode_) == false)
            {
                pExcelData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.FINISH_BUY];

                // 신규 데이터라면 일단 DB에 넣는다.
                pExcelData.NeedDBProc_ = tblOrderData.NeedDBProc.Insert;
                pOrderList.Add(pExcelData.channelOrderCode_, pExcelData);
            }
            else
            {
                tblOrderData pDBData = pOrderList[pExcelData.channelOrderCode_];

                if (pDBData.State_ == DealStateManager.Instance.StateString_[(Int32)DealStateEnum.FINISH_BUY])
                {
                }
                else if (pDBData.State_ == DealStateManager.Instance.StateString_[(Int32)DealStateEnum.USED])
                {
                    // 사용 처리된 상태인데, 뭔가 해줘야 할게 있는가?
                }
            }
        }
Ejemplo n.º 2
0
 public void CopyFrom(tblOrderData srcData)
 {
     NeedDBProc_ = srcData.NeedDBProc_;
     bFindInExcel_ = srcData.bFindInExcel_;
     bProcessed_ = srcData.bProcessed_;
     seq_ = srcData.seq_;
     goodsSeq_ = srcData.goodsSeq_;
     memberSeq_ = srcData.memberSeq_;
     channelSeq_ = srcData.channelSeq_;
     goodsCode_ = srcData.goodsCode_;
     channelOrderCode_ = srcData.channelOrderCode_;
     orderReserveCode_ = srcData.orderReserveCode_;
     orderID_ = srcData.orderID_;
     orderSettlePrice_ = srcData.orderSettlePrice_;
     orderName_ = srcData.orderName_;
     orderPhone_ = srcData.orderPhone_;
     orderMethod_ = srcData.orderMethod_;
     orderEtc1_ = srcData.orderEtc1_;
     orderEtc2_ = srcData.orderEtc2_;
     orderTotalPrice_ = srcData.orderTotalPrice_;
     orderCouponPrice_ = srcData.orderCouponPrice_;
     orderPointPrice_ = srcData.orderPointPrice_;
     addPoint_ = srcData.addPoint_;
     State_ = srcData.State_;
     BuyDate_ = srcData.BuyDate_;
     ExData_GoodsName_ = srcData.ExData_GoodsName_;
     ExData_OptionOriginal_ = srcData.ExData_OptionOriginal_;
     BuyCount_ = srcData.BuyCount_;
 }
Ejemplo n.º 3
0
        public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "")
        {
            if (string.IsNullOrEmpty(comparesitename) == true)
                return 0;

            if (comparesitename.IndexOf(str_sitecompare_) < 0)
                return 0;
            //string optionstring = Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", "");
            string optionstring = Regex.Replace(pExcelData.ExData_Option_, @" ", "");
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string optionname = "";

            optionname = Convert.ToString(Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", ""));
            nBuycount = pExcelData.BuyCount_;
            for (Int32 i = 0; i < nBuycount; i++)
            {
                nTotalcount++;
                tblOrderData tempExcelData = new tblOrderData();
                tempExcelData.CopyFrom(pExcelData);
                tempExcelData.ExData_Option_ = optionname;
                tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                tempExcelData.bFindInExcel_ = true;
                OrderManager.Instance.AddExcelData(tempExcelData);
            }

            return nTotalcount;
        }
Ejemplo n.º 4
0
 public void CopyFrom(tblOrderData srcData)
 {
     NeedDBProc_            = srcData.NeedDBProc_;
     bFindInExcel_          = srcData.bFindInExcel_;
     bProcessed_            = srcData.bProcessed_;
     seq_                   = srcData.seq_;
     goodsSeq_              = srcData.goodsSeq_;
     memberSeq_             = srcData.memberSeq_;
     channelSeq_            = srcData.channelSeq_;
     goodsCode_             = srcData.goodsCode_;
     channelOrderCode_      = srcData.channelOrderCode_;
     orderReserveCode_      = srcData.orderReserveCode_;
     orderID_               = srcData.orderID_;
     orderSettlePrice_      = srcData.orderSettlePrice_;
     orderName_             = srcData.orderName_;
     orderPhone_            = srcData.orderPhone_;
     orderMethod_           = srcData.orderMethod_;
     orderEtc1_             = srcData.orderEtc1_;
     orderEtc2_             = srcData.orderEtc2_;
     orderTotalPrice_       = srcData.orderTotalPrice_;
     orderCouponPrice_      = srcData.orderCouponPrice_;
     orderPointPrice_       = srcData.orderPointPrice_;
     addPoint_              = srcData.addPoint_;
     State_                 = srcData.State_;
     BuyDate_               = srcData.BuyDate_;
     ExData_GoodsName_      = srcData.ExData_GoodsName_;
     ExData_OptionOriginal_ = srcData.ExData_OptionOriginal_;
     BuyCount_              = srcData.BuyCount_;
 }
Ejemplo n.º 5
0
        public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "")
        {
            string optionstring = pExcelData.ExData_Option_;
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string tempString = "";
            string optionname = "";
            string regstring = @"(?<OptionName>\S+)\((?<Price>\S+)원\)";
            //string regstring = @"(?<OptionName>\S+)\(\S+\)(?<Count>\d+)개";

            optionstring = optionstring.Replace(" ", "");
            Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            MatchCollection oe = re.Matches(optionstring);

            foreach (Match mat in oe)
            {
                GroupCollection group = mat.Groups;
                optionname = Convert.ToString(group["OptionName"].Value);
                optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", "");
                tempString = Convert.ToString(group["Price"].Value);
                nBuycount = pExcelData.BuyCount_;

                if (tempString != null)
                {// 돈에 , 가 있으면 제거하자.
                    tempString = tempString.Replace(",", "");
                    pExcelData.orderSettlePrice_ = Convert.ToInt32(tempString);
                }

                for (Int32 i = 0; i < nBuycount; i++)
                {
                    nTotalcount++;
                    tblOrderData tempExcelData = new tblOrderData();
                    tempExcelData.CopyFrom(pExcelData);
                    tempExcelData.bFindInExcel_ = true;
                    tempExcelData.ExData_Option_ = optionname;
                    tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                    OrderManager.Instance.AddExcelData(tempExcelData);
                }
            }

            return nTotalcount;
        }
Ejemplo n.º 6
0
 // 체크해야 하는 데이터인가? 채널별로 하지 않아도 되는것이 있다.
 public override bool IsNeedCheck(tblOrderData pExcelData)
 {
     return true;
 }
Ejemplo n.º 7
0
        public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "")
        {
            if (string.IsNullOrEmpty(comparesitename) == true)
                return 0;

            if (comparesitename.IndexOf(str_sitecompare_) < 0)
                return 0;

            //string optionstring = Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", "");
            string optionstring = Regex.Replace(pExcelData.ExData_Option_, @" ", "");
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string optionname = "";
            string regstring = @"(?<OptionName>\S+)/\S+/(?<Count>\d+)개|(?<OptionName>\S+)/(?<Count>\d+)개";

            // 옵션명 개수 빼기
            Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            MatchCollection oe = re.Matches(optionstring);

            optionname = Convert.ToString(Regex.Replace(oe[0].Groups["OptionName"].Value, @"[^a-zA-Z0-9가-힣]", ""));
            nBuycount = Convert.ToInt32(oe[0].Groups["Count"].Value);
            for (Int32 i = 0; i < nBuycount; i++)
            {
                nTotalcount++;
                tblOrderData tempExcelData = new tblOrderData();
                tempExcelData.CopyFrom(pExcelData);
                tempExcelData.ExData_Option_ = optionname;
                tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                tempExcelData.bFindInExcel_ = true;
                OrderManager.Instance.AddExcelData(tempExcelData);
            }

            return nTotalcount;
        }
Ejemplo n.º 8
0
        public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "")
        {
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            nBuycount = pExcelData.BuyCount_;
            pExcelData.ExData_Option_ = Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", "");

            for (Int32 i = 0; i < nBuycount; i++)
            {
               nTotalcount++;
               tblOrderData tempExcelData = new tblOrderData();
               tempExcelData.CopyFrom(pExcelData);
               tempExcelData.bFindInExcel_ = true;
               tempExcelData.ExData_Option_ = pExcelData.ExData_Option_;
               tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
               OrderManager.Instance.AddExcelData(tempExcelData);
            }

            return nTotalcount;
        }
Ejemplo n.º 9
0
        // DB에서 사용처리 해야하는 테이블 로드
        public static bool Select_tblOrder(SqlHelper dbHelper, Int32 xchannelSeq)
        {
            bool bResult = true;

            try
            {
                // 2014.06.05
                Dictionary<string, object> argdic = new Dictionary<string, object>();
                argdic.Add("xChannelIdx", xchannelSeq);

                MySqlDataReader datareader = dbHelper.call_proc("sp_select_OrderInfo", argdic);

                while (datareader.Read())
                {
                    tblOrderData pOrderData = new tblOrderData();
                    pOrderData.NeedDBProc_ = tblOrderData.NeedDBProc.None;
                    pOrderData.seq_ = Convert.ToInt64(datareader["seq"]);
                    pOrderData.goodsSeq_ = Convert.ToInt32(datareader["goodsSeq"]);
                    pOrderData.memberSeq_ = Convert.ToInt32(datareader["memberSeq"]);
                    pOrderData.channelSeq_ = Convert.ToInt32(datareader["channelSeq"]);

                    pOrderData.channelOrderCode_ = Convert.ToString(datareader["channelOrderCode"]);
                    pOrderData.orderReserveCode_ = Convert.ToString(datareader["orderCode"]);
                    pOrderData.orderID_ = Convert.ToString(datareader["orderId"]);

                    pOrderData.orderSettlePrice_ = Convert.ToInt32(datareader["orderSettlePrice"]);
                    pOrderData.orderName_ = Convert.ToString(datareader["orderName"]);
                    pOrderData.orderPhone_ = Convert.ToString(datareader["orderPhone"]);
                    //pOrderData.orderMethod_ = Convert.ToString(datareader["orderMethod"]);
                    pOrderData.State_ = Convert.ToString(datareader["State"]);

                    OrderManager.Instance.AddOrderData(pOrderData);
                }

                datareader.Close();
                datareader.Dispose();
                datareader = null;
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.Log(ex.Message);
                bResult = false;
            }

            return bResult;
        }
Ejemplo n.º 10
0
        public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "")
        {
            string optionstring = pExcelData.ExData_Option_;
            string optionPhone = pExcelData.orderPhone_.Replace(" ","");
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string optionname = "";

            //            string regstring = @"(?<OptionName>\S+),\S+(?<Count>\d+)개";
            string regstring = @"(?<OptionName>\S+)";
            string regstringPhone = @"연락처\:(?<OrderPhone>\S+)|MS\S+\(\S+\):(?<OrderPhone>\S+)";

            string[] optionarray = System.Text.RegularExpressions.Regex.Split(optionstring, "\n");

            foreach (string curoption in optionarray)
            {
                optionstring = curoption.Replace(" ", "");
                Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                Regex rePhone = new Regex(regstringPhone, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                MatchCollection oe = re.Matches(optionstring);

                if (optionPhone.Contains("MMS") == true)
                {
                    MatchCollection oePhone = rePhone.Matches(optionPhone);
                    GroupCollection group2 = oePhone[0].Groups;
                    optionPhone = Convert.ToString(group2["OrderPhone"].Value);
                }

                nBuycount = pExcelData.BuyCount_;

                foreach (Match mat in oe)
                {
                    GroupCollection group = mat.Groups;

                    optionname = Convert.ToString(group["OptionName"].Value);
                    optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", "");

                    optionPhone = Regex.Replace(optionPhone, @"^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?([0-9]{3,4})-?([0-9]{4})$", @"$1-$2-$3");

                    for (Int32 i = 0; i < nBuycount; i++)
                    {
                        nTotalcount++;
                        tblOrderData tempExcelData = new tblOrderData();
                        tempExcelData.CopyFrom(pExcelData);
                        tempExcelData.bFindInExcel_ = true;
                        tempExcelData.ExData_Option_ = optionname;
                        tempExcelData.orderPhone_ = optionPhone;
                        tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                        OrderManager.Instance.AddExcelData(tempExcelData);
                    }
                }
            }

            return nTotalcount;
        }
Ejemplo n.º 11
0
        public override void MakeDBData(tblOrderData pExcelData)
        {
            Dictionary<string, tblOrderData> pOrderList = OrderManager.Instance.GetOrderList();
            LQStructures.LQCrawlerInfo pCrawler = CrawlerManager.Instance.GetCrawlerInfo();

            // DB에 저장되어 있던 값이 아니면 들어온 값이라면
            if (pOrderList.ContainsKey(pExcelData.channelOrderCode_) == false)
            {
                // 상태값 변경
                if (pExcelData.ExData_Use_.Contains(pCrawler.ExData_UseCheck_))
                {
                    pExcelData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.A];
                }
                else if (pExcelData.ExData_Cancel_ == pCrawler.ExData_CancelCheck_)
                {
                    pExcelData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.FINISH_REFUND];
                }
                else if (pExcelData.ExData_Use_ == "정산완료" || pExcelData.ExData_Cancel_ == "정산완료")
                {
                    pExcelData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.A];
                }
                else
                {
                    pExcelData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.FINISH_BUY];
                }

                // 신규 데이터라면 일단 DB에 넣는다.
                pExcelData.NeedDBProc_ = tblOrderData.NeedDBProc.Insert;
                pExcelData.bFindInExcel_ = true;
                pExcelData.bProcessed_ = true;
                pOrderList.Add(pExcelData.channelOrderCode_, pExcelData);
            }
            else
            {
                tblOrderData pDBData = pOrderList[pExcelData.channelOrderCode_];
                if (pExcelData.State_ == pDBData.State_)
                    return;

                pDBData.bFindInExcel_ = true;
                pDBData.bProcessed_ = true;

                if (pDBData.State_ == DealStateManager.Instance.StateString_[(Int32)DealStateEnum.FINISH_RESERVED])
                {// 예약한 상태 사용처리 해야함
                }
                else if (pDBData.State_ == DealStateManager.Instance.StateString_[(Int32)DealStateEnum.USER_WANT_REFUND])
                {// 사용 취소를 요청한 상태 사용취소처리 해야함
                }
                else if (pDBData.State_ == DealStateManager.Instance.StateString_[(Int32)DealStateEnum.FINISH_BUY])
                {// DB 에는 구매만 한 상태인데, 엑셀에는 취소 요청을 해둔 상태라면 환불이다.
                    if (pExcelData.ExData_Cancel_ == pCrawler.ExData_CancelCheck_)
                    {
                        pDBData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.USER_WANT_REFUND];
                    }
                }
                else if (pDBData.State_ == DealStateManager.Instance.StateString_[(Int32)DealStateEnum.USED])
                {
                    // 사용 처리된 상태인데, 뭔가 해줘야 할게 있는가?
                }
                else if (pDBData.State_ == DealStateManager.Instance.StateString_[(Int32)DealStateEnum.FINISH_REFUND])
                {// 환불이 끝난 상태 아무것도 하지 않는다.
                }
                else
                {
                    //pCrawler.ExData_UseCheck_
                    if (pExcelData.ExData_Use_.IndexOf(pCrawler.ExData_UseCheck_) >= 0)
                    {
                        pDBData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.A];
                        pDBData.NeedDBProc_ = tblOrderData.NeedDBProc.Update;
                        LogManager.Instance.Log(string.Format("채널에서 이미 사용처리 되어 있어서 DB 값만 바꾸자.{0}", pDBData.channelOrderCode_));
                    }
                    else
                    {
                        string log = string.Format("C:{0}, CP:{1}, S:{2}, {3}, {4} "
                        , pDBData.channelSeq_, pDBData.channelOrderCode_, pDBData.State_, pExcelData.ExData_Cancel_, pExcelData.ExData_Use_);
                        LogManager.Instance.Log(log);
                    }
                }
            }
        }
Ejemplo n.º 12
0
        public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "")
        {
            string optionstring = pExcelData.ExData_Option_;
            string optionPhone = pExcelData.orderPhone_.Replace(" ", "");
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string optionname = "";

            //            string regstring = @"(?<OptionName>\S+),\S+(?<Count>\d+)개";

            string[] optionarray = System.Text.RegularExpressions.Regex.Split(optionstring, "\n");

            foreach (string curoption in optionarray)
            {
                optionstring = curoption.Replace(" ", "");
                optionname = optionstring;
                nBuycount = pExcelData.BuyCount_;

                optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", "");

                for (Int32 i = 0; i < nBuycount; i++)
                {
                      nTotalcount++;
                      tblOrderData tempExcelData = new tblOrderData();
                      tempExcelData.CopyFrom(pExcelData);
                      tempExcelData.bFindInExcel_ = true;
                      tempExcelData.ExData_Option_ = optionname;
                      tempExcelData.orderPhone_ = optionPhone;
                      tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                      OrderManager.Instance.AddExcelData(tempExcelData);
                }

            }
            return nTotalcount;
        }
Ejemplo n.º 13
0
        public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "")
        {
            pExcelData.bFindInExcel_ = true;
            pExcelData.ExData_Option_ = Regex.Replace(pExcelData.ExData_Option_, @"[^a-zA-Z0-9가-힣]", "");
            OrderManager.Instance.AddExcelData(pExcelData);

            return 1;
        }
Ejemplo n.º 14
0
        public override void MakeDBData(tblOrderData pExcelData)
        {
            Dictionary<string, tblOrderData> pOrderList = OrderManager.Instance.GetOrderList();
            LQStructures.LQCrawlerInfo pCrawler = CrawlerManager.Instance.GetCrawlerInfo();

            // DB에 저장되어 있던 값이 아니면 들어온 값이라면
            if (pOrderList.ContainsKey(pExcelData.channelOrderCode_) == false)
            {
                //if (pExcelData.ExData_Use_ == pCrawler.ExData_UseCheck_)
                //{
                //    pExcelData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.USED];
                //}
                //else if (pExcelData.ExData_Cancel_ == pCrawler.ExData_CancelCheck_)
                //{
                //    pExcelData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.CANCEL];
                //}
                //else
                //{

                //}

                pExcelData.State_ = DealStateManager.Instance.StateString_[(Int32)DealStateEnum.FINISH_BUY];

                // 신규 데이터라면 일단 DB에 넣는다.
                pExcelData.NeedDBProc_ = tblOrderData.NeedDBProc.Insert;
                pExcelData.bFindInExcel_ = true;
                pExcelData.bProcessed_ = true;
                pOrderList.Add(pExcelData.channelOrderCode_, pExcelData);
            }
            else
            {
                tblOrderData pDBData = pOrderList[pExcelData.channelOrderCode_];
                if (pExcelData.State_ == pDBData.State_)
                    return;

                pDBData.bFindInExcel_ = true;
                pDBData.bProcessed_ = true;
            }
        }
Ejemplo n.º 15
0
        public override Int32 SplitDealAndInsertExcelData(tblOrderData pExcelData, string comparesitename = "")
        {
            string optionstring = pExcelData.ExData_Option_;
            string optionPhone = pExcelData.orderPhone_.Replace(" ", "");
            Int32 nBuycount = 0;
            Int32 nTotalcount = 0;
            string optionname = "";

            string regstring = @"(?<OptionName>\S+)";

            string[] optionarray = System.Text.RegularExpressions.Regex.Split(optionstring, "\n");

            foreach (string curoption in optionarray)
            {
                optionstring = curoption.Replace(" ", "");
                Regex re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                MatchCollection oe = re.Matches(optionstring);
                nBuycount = pExcelData.BuyCount_;

                foreach (Match mat in oe)
                {
                    GroupCollection group = mat.Groups;

                    optionname = Convert.ToString(group["OptionName"].Value);
                    optionname = Regex.Replace(optionname, @"[^a-zA-Z0-9가-힣]", "");
                    for (Int32 i = 0; i < nBuycount; i++)
                    {
                        nTotalcount++;
                        tblOrderData tempExcelData = new tblOrderData();
                        tempExcelData.CopyFrom(pExcelData);
                        tempExcelData.bFindInExcel_ = true;
                        tempExcelData.ExData_Option_ = optionname;
                        tempExcelData.orderPhone_ = optionPhone;
                        tempExcelData.channelOrderCode_ = string.Format("{0}_{1}", pExcelData.channelOrderCode_, nTotalcount);
                        OrderManager.Instance.AddExcelData(tempExcelData);
                    }
                }
            }

            return nTotalcount;
        }
Ejemplo n.º 16
0
        public static bool Select_tblOrderWr(SqlHelper dbHelper, Int32 xchannelSeq)
        {
            bool bResult = true;

            try
            {
                // 2014.06.05
                Dictionary<string, object> argdic = new Dictionary<string, object>();
                argdic.Add("xChannelIdx", xchannelSeq);

                MySqlDataReader datareader = dbHelper.call_proc("sp_select_OrderWrInfo", argdic);

                while (datareader.Read())
                {
                    tblOrderData pOrderData = new tblOrderData();
                    pOrderData.channelOrderCode_ = Convert.ToString(datareader["channelOrderCode"]);
                    pOrderData.NeedDBProc_ = tblOrderData.NeedDBProc.None;
                    OrderManager.Instance.AddWrongData(pOrderData);
                }

                datareader.Close();
                datareader.Dispose();
                datareader = null;
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.Log(ex.Message);
                bResult = false;
            }

            return bResult;
        }
Ejemplo n.º 17
0
        public override bool LoadExcelAndInsertList(string filepath, Int32 GoodsAttrType, bool bFixedType, string goodsname)
        {
            LQStructures.LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();

            Microsoft.Office.Interop.Excel.Application ap = null;
            Workbook wb = null;
            Worksheet ws = null;
            HKExcelHelper.GetWorkSheet(filepath, ref ap, ref wb, ref ws);

            Range tRange = null;
            string tempString = "";
            string comparesitename = "";

            Int32 nCurrentRow = 0;
            Int32 ExData_Option = 0;
            Int32 ExData_Coupncode = 0;
            Int32 ExData_Buyer = 0;
            Int32 ExData_Cancel = 0;

            Int32 ExData_Use = 0;
            Int32 ExData_Buyphone = 0;
            Int32 ExData_Price = 0;
            Int32 ExData_BuyDate = 0;
            Int32 ExData_BuyCount = 0;

            if (bFixedType == true)
            {// 레저큐 양식일때는 고정값으로
                nCurrentRow = 2;
                ExData_Option = 4;
                ExData_Coupncode = 3;
                ExData_Buyer = 1;
                ExData_Cancel = 6;
                ExData_Use = 6;
                ExData_Buyphone = 2;
                ExData_Price = 5;
                ExData_BuyDate = 7;
                ExData_BuyCount = 8;
            }
            else
            {
                nCurrentRow = pCrawlerInfo.ExData_Start_;
                ExData_Option = pCrawlerInfo.ExData_Option_;
                ExData_Coupncode = pCrawlerInfo.ExData_Coupncode_;
                ExData_Buyer = pCrawlerInfo.ExData_Buyer_;
                ExData_Cancel = pCrawlerInfo.ExData_Cancel_;
                ExData_Use = pCrawlerInfo.ExData_Use_;
                ExData_Buyphone = pCrawlerInfo.ExData_Buyphone_;
                ExData_Price = pCrawlerInfo.ExData_Price_;
                ExData_BuyDate = pCrawlerInfo.ExData_Buydate_;
                ExData_BuyCount = pCrawlerInfo.ExData_Count_;

                // 티몬을 위한 변경
                if (GoodsAttrType == 1)
                {
                    nCurrentRow = 3;
                    ExData_Option = 6;
                    ExData_Coupncode = 3;
                    ExData_Buyer = 1;
                    ExData_Cancel = 8;
                    ExData_Use = 8;
                    ExData_Buyphone = 2;
                    ExData_Price = 7;
                    ExData_BuyDate = 9;
                }
            }

            while (true)
            {
                try
                {
                    tRange = ws.Cells[nCurrentRow, 1];
                    comparesitename = Convert.ToString(tRange.Value2);

                    tRange = ws.Cells[nCurrentRow, ExData_Option];
                    if (tRange == null)
                        break;

                    tempString = tRange.Value2;
                    if (tempString == null)
                    {
                        break;
                    }

                    Int32 tempgoodSeq = -1;
                    tblOrderData pExcelData = new tblOrderData();
                    pExcelData.channelSeq_ = pCrawlerInfo.Channel_Idx_;
                    pExcelData.authoritySeq_ = pCrawlerInfo.AuthoritySeq_;
                    //pExcelData.goodsCode_ = pGoodInfo.Goods_Code_;
                    pExcelData.goodsSeq_ = tempgoodSeq;
                    pExcelData.ExData_Option_ = tempString;
                    pExcelData.ExData_OptionOriginal_ = tempString;
                    if (string.IsNullOrEmpty(goodsname) == false)
                    {
                        pExcelData.ExData_GoodsName_ = goodsname;
                    }

                    tRange = ws.Cells[nCurrentRow, ExData_Coupncode];
                    if (tRange == null)
                        break;

                    pExcelData.channelOrderCode_ = Convert.ToString(tRange.Value2);
                    if (pExcelData.channelOrderCode_ == null)
                        break;
                    pExcelData.channelOrderCode_ = pExcelData.channelOrderCode_.Replace("'", "");
                    pExcelData.channelOrderCode_ = pExcelData.channelOrderCode_.Trim();   // 공백 제거

                    tRange = ws.Cells[nCurrentRow, ExData_Buyer];
                    pExcelData.orderName_ = Convert.ToString(tRange.Value2);
                    if (pExcelData.orderName_ == null) pExcelData.orderName_ = "";

                    tRange = ws.Cells[nCurrentRow, ExData_Cancel];
                    pExcelData.ExData_Cancel_ = tRange.Value2;
                    if (pExcelData.ExData_Cancel_ == null) pExcelData.ExData_Cancel_ = "";

                    tRange = ws.Cells[nCurrentRow, ExData_Use];
                    pExcelData.ExData_Use_ = tRange.Value2;
                    if (pExcelData.ExData_Use_ == null) pExcelData.ExData_Use_ = "";

                    tRange = ws.Cells[nCurrentRow, ExData_Buyphone];
                    pExcelData.orderPhone_ = Convert.ToString(tRange.Value2);
                    if (pExcelData.orderPhone_ == null || pExcelData.orderPhone_ == "")
                    {
                        tRange = ws.Cells[nCurrentRow, 31];
                        pExcelData.orderPhone_ = Convert.ToString(tRange.Value2);
                    }

                    pExcelData.orderPhone_ = pExcelData.orderPhone_.Replace("'", "");

                    if (ExData_Price != 0)
                    {
                        tRange = ws.Cells[nCurrentRow, ExData_Price];

                        if (tRange.Value2 != null)
                        {// 돈에 , 가 있으면 제거하자.
                            tempString = Convert.ToString(tRange.Value2);
                            tempString = tempString.Replace(",", "");
                            pExcelData.orderSettlePrice_ = Convert.ToInt32(tempString);
                        }
                    }

                    tRange = ws.Cells[nCurrentRow, ExData_BuyDate];
                    double temp = Convert.ToDouble(tRange.Value2);
                    DateTime dta = DateTime.FromOADate(temp);
                    pExcelData.BuyDate_ = dta.ToString("u");
                    pExcelData.BuyDate_ = pExcelData.BuyDate_.Replace("Z", "");

                    if (ExData_BuyCount != 0)// 구매갯수를 따로 뽑아야 하는 채널에서만
                    {
                        tRange = ws.Cells[nCurrentRow, ExData_BuyCount];
                        pExcelData.BuyCount_ = Convert.ToInt32(tRange.Value2);
                    }

                    SplitDealAndInsertExcelData(pExcelData, comparesitename);

                }
                catch (System.Exception ex)
                {
                    LogManager.Instance.Log(string.Format("엑셀 파싱 에러 : {0}", ex.Message));
                    nCurrentRow++;
                    continue;
                }

                nCurrentRow++;
            }

            wb.Close(false, Type.Missing, Type.Missing);
            ap.Quit();

            Marshal.FinalReleaseComObject(ws);
            Marshal.FinalReleaseComObject(wb);
            Marshal.FinalReleaseComObject(ap);
            ws = null;
            wb = null;
            ap = null;
            GC.Collect();

            return true;
        }
Ejemplo n.º 18
0
        // 체크해야 하는 데이터인가? 채널별로 하지 않아도 되는것이 있다.
        public virtual bool IsNeedCheck(tblOrderData pExcelData)
        {
            // 이미 리스트에 들어있고
            Dictionary<string, tblOrderData> pOrderList = OrderManager.Instance.GetOrderList();
            if (pOrderList.ContainsKey(pExcelData.channelOrderCode_) == true)
            {
                tblOrderData pData = pOrderList[pExcelData.channelOrderCode_];
                if (pData.bProcessed_ == true)
                    return false;
            }

            return true;
        }