Пример #1
0
        public void BasketOriginVerificationTest(BasketInputParamT reqBasketInputParam)
        {
            CartBiz biz = new CartBiz();
            ValidCheckResultT originValidCheckResult = new ValidCheckResultT();
            originValidCheckResult.Result = new GEPBaseResultT();
            BasketParamT basket = new BasketParamT();
            basket.Pbid = "1AF6EDB9-DD31-4B64-BEAE-3AF9D28BC89A";
            basket.OrderIdxs = "1100066150|1100066152|1100066159|1100066161";

            originValidCheckResult = biz.OriginVerification(basket);
            Console.WriteLine("주문 Verification 결과 : " + originValidCheckResult.Result.RetCode);
            for (int i = 0, cnt = originValidCheckResult.ValidCheckList.Count; i < cnt; i++)
            {
                Console.WriteLine(originValidCheckResult.ValidCheckList[i].OrderIdx + "::" + originValidCheckResult.ValidCheckList[i].RetCode);
            }
        }
Пример #2
0
        public ActionResult BasketTest()
        {
            /*
            OriginCheckResult result = new OriginCheckResult();

            result.Result.RetCode = 0;
            result.Result.RetMessage = "성공";

            string orderIdx = Request.QueryString["orderIdx"];
            string[] orderIdxList = orderIdx.Split(new char[] { ',' });

            foreach (string idx in orderIdxList)
            {
                result.CheckResult.Add(new BasketValidCheck { OrderIdx = Convert.ToInt32(idx), RetCode = 0, RetMessage = "성공" });
            }
            */

            CartBiz biz = new CartBiz();
            ValidCheckResultT result = new ValidCheckResultT();
            result.Result = new GEPBaseResultT();
            BasketParamT basket = new BasketParamT();

            string orderIdx = Request.QueryString["orderIdx"];
            string pid = Request.QueryString["pId"];
            string cloneIds = Request.QueryString["cloneIds"];

            basket.Pbid = pid;
            basket.OrderIdxs = orderIdx;
            basket.GoodsCodes = cloneIds;

            result = biz.OriginVerification(basket);
            JsonpResult jsonResult = new JsonpResult
            {
                Data = new { Result = result.Result, Data = result.ValidCheckList },
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };

            jsonResult.ContentEncoding = Encoding.GetEncoding("euc-kr");

            return jsonResult;
        }
Пример #3
0
        private BasketParamT MakeBasketParam(BasketInputParamT BasketInputParam)
        {
            BasketParamT resBasketParam = new BasketParamT();

            resBasketParam.CustNo = BasketInputParam.CustNo;
            resBasketParam.LoginId = BasketInputParam.LoginID;
            resBasketParam.GoodsCode = BasketInputParam.ItemNo;
            resBasketParam.OrderCnt = BasketInputParam.OrderCount;
            resBasketParam.OptNos = BasketInputParam.OptNos;

            return resBasketParam;
        }
Пример #4
0
        //장바구니 주문 변수 만들기
        public BasketOrderParamT MakeBasketOrderParam(BasketParamT basketParam)
        {
            List<SelectOptionInfoT> lstSelOptInfo = new List<SelectOptionInfoT>();
            SelectOptionStatusT selOptStatus = new SelectOptionStatusT();
            SelectOptionSetResultT selOptSetResult = new SelectOptionSetResultT();

            SelectOptionInfoResultT selOptResult = new SelectOptionInfoResultT();
            selOptResult.Result = new GEPBaseResultT();

            BasketItemAddInfoT basketItemAddInfo = new BasketItemAddInfoT();

            string[] arrPluralKey, arrEachPluralKey, arrCouponNo;
            string strPluralCouponDetail, strPluralCostBasisNo;
            string strPluralKeyEnc, strPluralKeyDec;

            selOptStatus = GetSelectOptionStatus(basketParam.GoodsCode);
            BasketOrderParamT basketOrderParam = new BasketOrderParamT();
            if (selOptStatus == null)
            {
                basketParam.SellingStat = -1;
                basketParam.OptSelYn = "N";
                basketParam.OptAddYn = "N";
                basketParam.OptSelInventoryYn = "N";
                basketParam.OptAddInventoryYn = "N ";
                basketParam.OptSelSortCondition = string.Empty;
                basketParam.OptAddSortCondition = string.Empty;
            }
            else
            {
                basketParam.SellingStat = selOptStatus.SellingStat;
                basketParam.OptSelYn = selOptStatus.OptSelYn;
                basketParam.OptAddYn = selOptStatus.OptAddYn;
                basketParam.OptSelInventoryYn = selOptStatus.OptSelInventoryYn;
                basketParam.OptAddInventoryYn = selOptStatus.OptAddInventoryYn;
                basketParam.OptSelSortCondition = selOptStatus.OptSelSortCondition;
                basketParam.OptAddSortCondition = selOptStatus.OptAddSortCondition;
            }

            if (basketParam.PluralKey != null)
            {
                if (string.IsNullOrEmpty(basketParam.SingleOrderCnt) && basketParam.OrderCnt != "0")
                {
                    arrEachPluralKey = basketParam.PluralKey.Split(PaymentConstant.CommaSeperator);

                    strPluralCostBasisNo = string.Empty;
                    strPluralCouponDetail = string.Empty;

                    for (int i = 0, eachPluralKeyLength = arrEachPluralKey.Length; i < eachPluralKeyLength; i++)
                    {
                        strPluralKeyEnc = arrEachPluralKey[i];
                        strPluralKeyDec = FrontEncryption.TQDecode(strPluralKeyEnc);
                        if (!string.IsNullOrEmpty(strPluralKeyDec))
                        {
                            arrPluralKey = strPluralKeyDec.Split(PaymentConstant.MainDelimiter.ToCharArray());
                            strPluralCostBasisNo = strPluralCostBasisNo + arrPluralKey[2].Replace(PaymentConstant.ThirdDelimiter, PaymentConstant.MainDelimiter);
                            strPluralCouponDetail = strPluralCouponDetail + arrPluralKey[3].Replace(PaymentConstant.ThirdDelimiter, PaymentConstant.MainDelimiter);

                            if (arrPluralKey[2].Replace(PaymentConstant.ThirdDelimiter, PaymentConstant.MainDelimiter).IndexOf(PaymentConstant.MainDelimiter) < 0)
                            {
                                strPluralCostBasisNo = strPluralCostBasisNo + PaymentConstant.MainDelimiter;
                            }
                            else
                            {
                                strPluralCostBasisNo = strPluralCostBasisNo + "0";
                            }

                            if (i != (eachPluralKeyLength - 1))
                            {
                                strPluralCostBasisNo = strPluralCostBasisNo + ",";
                                strPluralCouponDetail = strPluralCouponDetail + ",";
                            }
                        }
                    }

                    basketParam.CostBasisNo = strPluralCostBasisNo;
                    basketParam.CouponNo = strPluralCouponDetail;
                }
            }
            if (!string.IsNullOrEmpty(basketParam.CouponNo) && !string.IsNullOrEmpty(basketParam.CouponNo.Replace(PaymentConstant.MainDelimiter, string.Empty).Trim()))
            {
                arrCouponNo = basketParam.CouponNo.Split(PaymentConstant.MainDelimiter.ToCharArray());
                //[skip] 개인별 할인쿠폰의 존재여부와 사용여부를 체크 line.392~421
            }
            //[skip] 선택정보가 있는 상품인지 확인 line.425~497

            //변수에 상품정보를 넣어주는 부분(원래는 '상품에 대한 쿠키를 무조건 생성한다.'부분 501~)
            if (!string.IsNullOrEmpty(basketParam.GoodsCode))
            {
                if (string.IsNullOrEmpty(basketParam.PosShopCd)) basketParam.PosShopCd = "XX";
                if (string.IsNullOrEmpty(basketParam.PosClassCd)) basketParam.PosClassCd = "111111111";
                if (string.IsNullOrEmpty(basketParam.PosClassKind)) basketParam.PosClassKind = "T";
                //[skip] 이 장바구니는 상품 정보가 하나씩 들어오도록 설계되어 이어붙이기는 생략 line.518~741
                if (string.IsNullOrEmpty(basketParam.CostBasisNo)) basketParam.CostBasisNo = "0";
                if (basketParam.IsExistSelInfoCheckStr == "N")
                {
                    if (string.IsNullOrEmpty(basketParam.OrderCnt))
                    {
                        basketParam.OrderCnt = "1";
                    }
                }
                if (string.IsNullOrEmpty(basketParam.FreeInterestExistYN)) basketParam.FreeInterestExistYN = "N";
                if (string.IsNullOrEmpty(basketParam.OverSeaNationList)) basketParam.OverSeaNationList = "해외배송불가";
                if (string.IsNullOrEmpty(basketParam.CouponEID)) basketParam.CouponEID = "0";
                if (string.IsNullOrEmpty(basketParam.MinSellOrderNo)) basketParam.MinSellOrderNo = "0";
                if (string.IsNullOrEmpty(basketParam.CouponNo)) basketParam.CouponNo = PaymentConstant.MainDelimiter;
                if (string.IsNullOrEmpty(basketParam.DeliveryGroupNo)) basketParam.DeliveryGroupNo = string.Empty;
                if (string.IsNullOrEmpty(basketParam.OkCashBagPoint)) basketParam.OkCashBagPoint = string.Empty;
                if (string.IsNullOrEmpty(basketParam.SpecTransFee)) basketParam.SpecTransFee = "0";
                if (string.IsNullOrEmpty(basketParam.SpecTransDay)) basketParam.SpecTransDay = "0";
                if (string.IsNullOrEmpty(basketParam.BuyUnitCnt)) basketParam.BuyUnitCnt = "1";
                if (string.IsNullOrEmpty(basketParam.MinBuyCnt)) basketParam.MinBuyCnt = "1";
                if (string.IsNullOrEmpty(basketParam.GdShopKind)) basketParam.GdShopKind = string.Empty;
                if (string.IsNullOrEmpty(basketParam.BdNo)) basketParam.BdNo = "0";
                if (string.IsNullOrEmpty(basketParam.PluralKey)) basketParam.PluralKey = string.Empty;
                if (string.IsNullOrEmpty(basketParam.DeliveryFeeCondition)) basketParam.DeliveryFeeCondition = string.Empty;
                if (string.IsNullOrEmpty(basketParam.DeliveryHopeDay)) basketParam.DeliveryHopeDay = string.Empty;
                if (string.IsNullOrEmpty(basketParam.JaehuID)) basketParam.JaehuID = string.Empty;
                //관리 상품 체크 line.790~
                int iRefusalGoodsCnt = 0;
                basketParam.RefusalGoodsCode = string.Empty;

                if (basketParam.GoodsCode.Length == 9)
                {
                    basketParam.RefusalGoodsCheckFlag = "False";

                    RefusalGoodsT refusalGoods = GetRefusalGoods(basketParam.GoodsCode);
                    if (refusalGoods != null)
                    {
                        if (basketParam.GoodsCode == refusalGoods.ItemNo)
                        {
                            if (selOptStatus.OptSelYn == "Y" || selOptStatus.OptAddYn == "Y")
                            {
                                iRefusalGoodsCnt = 0;
                                basketParam.RefusalGoodsCheckFlag = "False";
                            }
                            else
                            {
                                basketParam.RefusalGoodsCheckFlag = "True";
                                basketParam.RefusalGoodsCode = basketParam.GoodsCode;
                                iRefusalGoodsCnt = 1;
                            }
                        }
                    }

                    if (basketParam.DeliveryFeeCondition == "Q")
                    {
                        basketParam.ChakbulPrepayYN = "C";
                    }
                    else if (basketParam.DeliveryFeeCondition == "D")
                    {
                        basketParam.ChakbulPrepayYN = "N";
                    }
                    else
                    {
                        basketParam.ChakbulPrepayYN = "C";
                    }

                    //[skip] 퀵서비스 & 직접배송 line.822~869
                    //[skip] 경매 line.871~927
                    //[skip] 외부상품 line.929~943
                    //[skip] 예약공동구매 line.945~958
                    if (basketParam.RefusalGoodsCheckFlag == "False")
                    {
                        //[skip] 마트상품&우유.외부배달상품 line.962~996
                        //선택옵션 부분 추가 : 2012-02-20

                        if (selOptStatus.OptSelYn == "Y" || selOptStatus.OptAddYn == "Y")
                        {
                            selOptResult = OptionVerification(basketParam);
                            //selOptSetResult = SetSelectOption(selOptResult.OptionInfoList);
                        }

                        //basketOrderParam에 값 대입
                        basketOrderParam.Pid = basketParam.Pbid;
                        if (string.IsNullOrEmpty(basketParam.CustNo) || !Validate.IsNumeric(basketParam.CustNo))
                        {
                            basketOrderParam.CustNo = 0;
                        }
                        else
                        {
                            basketOrderParam.CustNo = int.Parse(basketParam.CustNo);
                        }
                        basketOrderParam.ItemNo = basketParam.GoodsCode;
                        basketOrderParam.GdSelNo = basketParam.GdSelNo;
                        basketOrderParam.ShopCode = "GEP";
                        basketOrderParam.CostBasisNo = basketParam.CostBasisNo;
                        basketOrderParam.JaehuId = basketParam.JaehuID;
                        basketOrderParam.GepOrderNo = long.Parse(basketParam.GEPOrderNo);
                        basketOrderParam.InputWay = basketParam.InputWay;

                        if (string.IsNullOrEmpty(basketParam.OrderCnt) || !Validate.IsNumeric(basketParam.OrderCnt))
                        {
                            basketOrderParam.OrderCnts = 0;
                        }
                        else
                        {
                            basketOrderParam.OrderCnts = int.Parse(basketParam.OrderCnt);
                        }
                        if (string.IsNullOrEmpty(basketParam.MinSellOrderNo) || !Validate.IsNumeric(basketParam.MinSellOrderNo))
                        {
                            basketOrderParam.MinSellOrderNo = 0;
                        }
                        else
                        {
                            basketOrderParam.MinSellOrderNo = Util.GetSafeLong(basketParam.MinSellOrderNo);
                        }

                        if (string.IsNullOrEmpty(basketParam.BuyUnitCnt) || !Validate.IsNumeric(basketParam.BuyUnitCnt))
                        {
                            basketOrderParam.BuyUnitCnt = 1;
                        }
                        else
                        {
                            basketOrderParam.BuyUnitCnt = int.Parse(basketParam.BuyUnitCnt);
                        }
                        if (string.IsNullOrEmpty(basketParam.MinBuyCnt) || !Validate.IsNumeric(basketParam.MinBuyCnt))
                        {
                            basketOrderParam.MinBuyCnt = 1;
                        }
                        else
                        {
                            basketOrderParam.MinBuyCnt = int.Parse(basketParam.MinBuyCnt);
                        }

                        basketOrderParam.GdShopkind = basketParam.GdShopKind;
                        basketOrderParam.PluralKey = basketParam.PluralKey;
                        if (string.IsNullOrEmpty(basketParam.DeliveryGroupNo) || !Validate.IsNumeric(basketParam.DeliveryGroupNo))
                        {
                            basketOrderParam.DeliveryGroupNo = 0;
                        }
                        else
                        {
                            basketOrderParam.DeliveryGroupNo = int.Parse(basketParam.DeliveryGroupNo);
                        }

                        basketOrderParam.ChakbulPrepayYN = basketParam.ChakbulPrepayYN;

                        string[] arrChkCostBasisNo = basketOrderParam.CostBasisNo.Split(PaymentConstant.ForthDelimiter.ToCharArray());
                        for (int tmpCnt = 0, chkCostBasisNoLenth = arrChkCostBasisNo.Length; tmpCnt < chkCostBasisNoLenth; tmpCnt++)
                        {
                            if (!Validate.IsNumeric(arrChkCostBasisNo[tmpCnt].Replace(PaymentConstant.MainDelimiter, "")) && arrChkCostBasisNo[tmpCnt].Replace(PaymentConstant.MainDelimiter, "").Trim() != "")
                            {
                                throw new ValidationException("정보가 올바르지 않습니다.");
                            }
                        }
                        //[skip] 결제수단 제한 쿠폰 중복 적용 여부 체크 line.64~84

                        string[] arrTmpPluralKey;
                        string strCostBasisNo, strPluralKey;
                        string strGdNm = string.Empty, strGdShopkind = string.Empty, strGdShopkind2 = string.Empty, strGdShopkind3 = string.Empty;
                        string strHasAddedFile = string.Empty, strGdlcCd = string.Empty, strGdmcCd = string.Empty, strGdscCd = string.Empty;
                        int iDeliveryGroupNo = 0;

                        strCostBasisNo = basketParam.CostBasisNo.Replace(" ", "");
                        strCostBasisNo = strCostBasisNo.Replace("&#65533;", "");
                        strPluralKey = basketOrderParam.PluralKey;

                        if (string.IsNullOrEmpty(strPluralKey))
                        {
                            arrTmpPluralKey = FrontEncryption.TQDecode(strPluralKey).Split(PaymentConstant.MainDelimiter.ToCharArray());
                            if (arrTmpPluralKey.Length < 8)
                            {
                                strPluralKey = string.Empty;
                                strCostBasisNo = string.Empty;
                            }
                            else if (arrTmpPluralKey[1] != basketOrderParam.ItemNo)
                            {
                                strPluralKey = string.Empty;
                                strCostBasisNo = string.Empty;
                            }
                        }

                        basketItemAddInfo = GetBasketItemAddInfo(basketOrderParam.ItemNo);

                        if (basketItemAddInfo != null)
                        {
                            strGdNm = basketItemAddInfo.ItemName;
                            iDeliveryGroupNo = basketItemAddInfo.DeliveryGroupNo;
                            strGdShopkind = basketItemAddInfo.GdShopkind;
                            strGdShopkind2 = basketItemAddInfo.GdShopkind2;
                            strGdShopkind3 = basketItemAddInfo.GdShopkind3;
                            strHasAddedFile = basketItemAddInfo.Hasaddedfile;
                            strGdlcCd = basketItemAddInfo.GdlcCd;
                            strGdmcCd = basketItemAddInfo.GdmcCd;
                            strGdscCd = basketItemAddInfo.GdscCd;
                        }

                        basketOrderParam.OrderIdx = basketParam.OrderIdx;
                        basketOrderParam.DeliveryGroupNo = iDeliveryGroupNo;
                        basketOrderParam.GdShopkind = strGdShopkind;
                        basketOrderParam.CostBasisNo = strCostBasisNo.Replace(PaymentConstant.ForthDelimiter, PaymentConstant.MainDelimiter);
                    }
                }

                //[skip] OK캐쉬백 사용 line.1048~1056
                //[skip] 상품중복담기체크 line.1058~1072
                //[skip] 퀵서비스 line.1075~1104

                if (iRefusalGoodsCnt > 0)
                {
                    string strRefusalGoodsName = "";

                    PluralItemInfoT pluralItemInfo = GetPluralItemInfo(basketParam.GoodsCode);

                    if (pluralItemInfo != null)
                    {
                        strRefusalGoodsName = pluralItemInfo.ItemName.Substring(0, 35) + "...";
                        Console.WriteLine("다음 상품은 장바구니에 담을 수 없습니다." + strRefusalGoodsName);
                    }
                }
            }
            return basketOrderParam;
        }
Пример #5
0
        //재고체크
        public InventoryCheckResultT InventoryVerification(BasketParamT reqBasketParam)
        {
            InventoryCheckResultT inventoryCheckResult = new InventoryCheckResultT();
            int orderCnt = 0;
            if(int.TryParse(reqBasketParam.OrderCnt, out orderCnt))
            {
                inventoryCheckResult = GetInventoryCheckResult(reqBasketParam.GoodsCode, orderCnt);
            }

            return inventoryCheckResult;
        }
Пример #6
0
        public AvailableBasketInfoResultT InsertableBasketInfo(BasketParamT requestBasketParam)
        {
            BasketOrderParamT basketOrderParam = new BasketOrderParamT();
            AvailableBasketInfoResultT result = InsertableBasketInfo(requestBasketParam, ref basketOrderParam);

            return result;
        }
Пример #7
0
        //장바구니 변수 초기화 (basketParam 파라미터 채우기)
        public BasketParamT InitBasketParam(BasketParamT reqBasketParam)
        {
            BasketParamT basketParam = reqBasketParam;
            BasketItemBasicInfoT basketItemBasicInfo = new BasketItemBasicInfoT();
            List<ItemDiscountT> lstItemDiscount = new List<ItemDiscountT>();
            PaymentOrderIndexT basketOrderIdx = new PaymentOrderIndexT();

            //파라미터 초기화
            basketParam.ChargeOffTextOn = "N";
            basketParam.EtcCostPriceSum = "0";
            basketParam.EtcDeliveryFeeSum = "0";
            basketParam.FirstComeGdSelNo = string.Empty;
            basketParam.GdDuplicationYn = "N";
            basketParam.OkCashBagPointSaveYn = "Y";
            basketParam.TodayDeliveryYN = string.Empty;
            basketParam.OrderCustomBasketAmt = "0";
            basketParam.OrderCustomContrAmt = "0";
            basketParam.OrderLimitCnt = "0";
            basketParam.OrderLimitNo = "0";
            basketParam.OrderLimitYn = "N";
            basketParam.OrderPossibleCnt = "0";
            basketParam.OriginalBundleDeliveryFee = "0";
            basketParam.SumBundleDeliveryFee = "0";
            basketParam.ZeroMarginCostBasisNo = "2558647";
            basketParam.OrderType = "normal";
            basketParam.AddInfoType = "S";

            //PID 생성 or 가져오기 함수 호출
            basketParam.Pbid = GetBasketPid(basketParam.CustNo);

            //gd_sel_no 생성
            if (!string.IsNullOrEmpty(basketParam.GoodsCode))
            {
                IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
                string clientIP = string.Empty;
                for (int i = 0; i < host.AddressList.Length; i++)
                {
                    if (host.AddressList[i].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                    {
                        clientIP = host.AddressList[i].ToString();
                    }
                }
                basketParam.GdSelNo = clientIP.Replace(".", "").Substring(2, 7) + DateTime.Now.ToString("dd") + DateTime.Now.ToString("HH") + DateTime.Now.ToString("mm") + DateTime.Now.ToString("ss") + DateTime.Now.ToString("fff");
            }

            //order_idx 생성
            basketOrderIdx = GetBasketOrderIndex();
            basketParam.OrderIdx = basketOrderIdx.OrderIdx;

            //request 부분 -> 상품기본정보 가져와서 파라미터 채우기
            basketItemBasicInfo = GetBasketItemBasicInfo(basketParam.GoodsCode);

            basketParam.DeliveryGroupNo = basketItemBasicInfo.DeliveryGroupNo.ToString();
            basketParam.OrderPrice = basketItemBasicInfo.SellPrice.ToString();
            basketParam.TradWay = basketItemBasicInfo.TradWay;
            basketParam.MinSellOrderNo = basketItemBasicInfo.MinSellOrderNo.ToString();
            basketParam.DeliveryFee = basketItemBasicInfo.DeliveryFee.ToString();
            basketParam.DeliveryFeeYn = basketItemBasicInfo.DeliveryFeeYn;
            basketParam.DeliveryFeeCondition = basketItemBasicInfo.DeliveryFeeCondition;
            basketParam.MinBuyCnt = basketItemBasicInfo.MinBuyCnt.ToString();
            basketParam.BuyUnitCnt = basketItemBasicInfo.BuyUnitCnt.ToString();
            basketParam.AddFileYn = basketItemBasicInfo.AddFileYn;
            basketParam.GdShopKind = basketItemBasicInfo.GdShopkind1;

            //할인 PluralKey랑 CostBasisNo 채우기
            lstItemDiscount = GetItemDiscountInfo(basketParam.GoodsCode);
            if (lstItemDiscount != null)
            {
                string strCostBasisNo = string.Empty;
                string strDcCouponNo = string.Empty;
                string strPluralKeyEnc = string.Empty;

                if (lstItemDiscount.Count > 0)
                {
                    for (int i = 0, lstItemDiscountCnt = lstItemDiscount.Count; i < lstItemDiscountCnt; i++)
                    {
                        strCostBasisNo = strCostBasisNo + lstItemDiscount[i].CostBasisNo.ToString() + PaymentConstant.MainDelimiter;
                        strDcCouponNo = strDcCouponNo + PaymentConstant.MainDelimiter;
                    }
                    strPluralKeyEnc = strPluralKeyEnc +
                        FrontEncryption.TQEncode("GMKT" + PaymentConstant.MainDelimiter +
                        basketParam.GoodsCode + PaymentConstant.MainDelimiter +
                        strCostBasisNo.Replace(PaymentConstant.MainDelimiter, PaymentConstant.ThirdDelimiter) + PaymentConstant.MainDelimiter +
                        strDcCouponNo.Replace(PaymentConstant.MainDelimiter, PaymentConstant.ThirdDelimiter) + PaymentConstant.MainDelimiter +
                        DateTime.Now.ToString("yyyyMMdd") + PaymentConstant.MainDelimiter +
                        DateTime.Now.ToString("HHmm") + PaymentConstant.MainDelimiter +
                        basketParam.LoginId + PaymentConstant.MainDelimiter +
                        basketParam.CustNo + PaymentConstant.MainDelimiter
                        );
                    basketParam.CostBasisNo = strCostBasisNo;
                    basketParam.PluralKey = strPluralKeyEnc;
                }
                else
                {
                    basketParam.CostBasisNo = "";
                    basketParam.PluralKey = "";
                }
            }
            else
            {
                basketParam.CostBasisNo = "";
                basketParam.PluralKey = "";
            }

            //아래는 필요없지만 테이블이 바뀌기 전까지는 필요한 아이들
            basketParam.PosShopCd = "GEP"; //외부상품정보
            basketParam.PosClassCd = "";
            basketParam.PosClassKind = "";
            basketParam.FreeInterestExistYN = "N"; //카드 무이자 정보
            basketParam.CostPriceYN = "N"; //쿠폰적용시 Y
            basketParam.FullGoodsHalbuStr = "";
            basketParam.OrderSiteInfo = "";
            basketParam.AdditionalInfo = "";
            basketParam.OverSeaGoodsYn = "N";
            basketParam.OrderLimitYn = "N";

            if (string.IsNullOrEmpty(basketParam.OrderSiteInfo))
            {
                basketParam.OrderSiteInfo = "KOR";
            }
            return basketParam;
        }
Пример #8
0
        //장바구니 넣기 진입점 - 리스트로 파라미터 값들이 바로 넘어 왔을 때
        public GmarketBasketAddResultT BasketInput(List<BasketInputParamT> lstBasketInputParam)
        {
            GEPOrderBiz gepBiz = new GEPOrderBiz();
            BasketParamT basketParam = new BasketParamT();
            AvailableBasketInfoResultT availableBasketInfoResult = new AvailableBasketInfoResultT();
            GmarketBasketAddResultT gmktBasketInputResult = new GmarketBasketAddResultT();
            gmktBasketInputResult.Result = new GEPBaseResultT();
            GEPBaseResultT insertDBResult = new GEPBaseResultT();
            List<BasketGepOrderNoT> basketGepOrderNos = new List<BasketGepOrderNoT>();
            BasketCurrCountT basketCurrentCnt = new BasketCurrCountT();

            long conGepOrderNo;
            int inputErrorCnt = 0, orderImpossCnt = 0;
            string basketPid = CheckBasketPid(lstBasketInputParam[0].CustNo);
            int lstBasketInputParamCnt = lstBasketInputParam.Count;

            //상품은 100개 까지만 담을 수 있다.
            if (basketPid != string.Empty)
            {
                basketCurrentCnt = GetBasketCurrentCount(basketPid);
                int cartCnt = basketCurrentCnt.NationalCnt;

                if ((cartCnt + lstBasketInputParamCnt) > 100)
                {
                    gmktBasketInputResult.Result.RetCode = -10;
                    gmktBasketInputResult.Result.RetMessage = "현재 장바구니에 " + cartCnt + "건의 주문건이 있습니다.";

                    return gmktBasketInputResult;
                }
            }

            //주문 불가 상품(-970에러)인지 체크
            if (lstBasketInputParam[0].InputWay == "C")
            {
                for (int i = 0; i < lstBasketInputParamCnt; i++)
                {
                    GEPOrderInfoT gepOrderInfo = new GEPOrderInfoT();
                    GmarketBasketAddT checkOrderStatusRtn = new GmarketBasketAddT();
                    if (long.TryParse(lstBasketInputParam[i].GEPOrderNo, out conGepOrderNo))
                    {
                        gepOrderInfo = GetGEPOrderInfo(conGepOrderNo);
                    }
                    if (gepOrderInfo != null)
                    {
                        if (gepOrderInfo.GEPOrder.Status == GepOrderStatus.Conclusion && (gepOrderInfo.GMKTOrder.OrderStatus == GmktOrderStatus.None || gepOrderInfo.GMKTOrder.OrderStatus == GmktOrderStatus.ConclusionFail))
                        {
                            checkOrderStatusRtn.GepOrderNo = lstBasketInputParam[i].GEPOrderNo;
                            checkOrderStatusRtn.RetCode = "0";
                            checkOrderStatusRtn.RetMessage = "주문 가능 상태 체크 성공";
                        }
                        else
                        {
                            orderImpossCnt += 1;
                            checkOrderStatusRtn.GepOrderNo = lstBasketInputParam[i].GEPOrderNo;
                            checkOrderStatusRtn.RetCode = "970";
                            checkOrderStatusRtn.RetMessage = "상품이 주문 가능 상태가 아닙니다.";
                        }
                        gmktBasketInputResult.AddResultList.Add(checkOrderStatusRtn);
                    }
                }
                if (orderImpossCnt > 0)
                {
                    gmktBasketInputResult.Result.RetCode = -1;
                    gmktBasketInputResult.Result.RetMessage = "장바구니담기 실패";

                    return gmktBasketInputResult;
                }
                else
                {
                    gmktBasketInputResult.AddResultList.Clear();
                }
            }

            //장바구니 중복 담긴 상품인지 체크
            if (basketPid != string.Empty)
            {
                int duplicaBasketCnt = 0;
                basketGepOrderNos = GetBasketGepOrderNo(basketPid);
                for (int i = 0; i < lstBasketInputParamCnt; i++)
                {
                    GmarketBasketAddT checkDuplicaRtn = new GmarketBasketAddT();

                    BasketGepOrderNoT result = basketGepOrderNos.Find(
                        delegate(BasketGepOrderNoT gepOrderNo)
                        {
                            return gepOrderNo.GepOrderNo.ToString() == lstBasketInputParam[i].GEPOrderNo;
                        }
                    );
                    if (result != null)
                    {
                        duplicaBasketCnt += 1;
                        checkDuplicaRtn.GepOrderNo = lstBasketInputParam[i].GEPOrderNo;
                        checkDuplicaRtn.RetCode = "1001";
                        checkDuplicaRtn.RetMessage = "이미 장바구니에 담긴 상품이 있습니다.";
                    }
                    else
                    {
                        checkDuplicaRtn.GepOrderNo = lstBasketInputParam[i].GEPOrderNo;
                        checkDuplicaRtn.RetCode = "0";
                        checkDuplicaRtn.RetMessage = "중복 체크 성공";
                    }
                    gmktBasketInputResult.AddResultList.Add(checkDuplicaRtn);
                }

                if (duplicaBasketCnt > 0)
                {
                    gmktBasketInputResult.Result.RetCode = -1;
                    gmktBasketInputResult.Result.RetMessage = "장바구니담기 실패";

                    return gmktBasketInputResult;
                }
                else
                {
                    gmktBasketInputResult.AddResultList.Clear();
                }
            }

            if (lstBasketInputParam.Count > 0)
            {
                for (int itemIdx = 0; itemIdx < lstBasketInputParamCnt; itemIdx++)
                {
                    availableBasketInfoResult.Result = new GEPBaseResultT();
                    GmarketBasketAddT checkInsertableInfo = new GmarketBasketAddT();
                    basketParam = MakeBasketParam(lstBasketInputParam[itemIdx]);
                    availableBasketInfoResult = InsertableBasketInfo(basketParam);

                    checkInsertableInfo.GepOrderNo = lstBasketInputParam[itemIdx].GEPOrderNo;
                    checkInsertableInfo.RetCode = availableBasketInfoResult.Result.RetCode.ToString();
                    checkInsertableInfo.RetMessage = availableBasketInfoResult.Result.RetMessage;

                    gmktBasketInputResult.AddResultList.Add(checkInsertableInfo);

                    if (availableBasketInfoResult.Result.RetCode != 0)
                    {
                        inputErrorCnt += 1;
                        gmktBasketInputResult.Result.RetCode = -1;
                        gmktBasketInputResult.Result.RetMessage = "장바구니담기 실패";

                        if (long.TryParse(lstBasketInputParam[itemIdx].GEPOrderNo, out conGepOrderNo))
                        {
                            try
                            {
                                gepBiz.InsertDisableOrder(conGepOrderNo);
                            }
                            catch (Exception e)
                            {
                            }
                        }
                    }
                }

                if (inputErrorCnt == 0)
                {
                    gmktBasketInputResult.AddResultList.Clear();
                    for (int itemIdx = 0; itemIdx < lstBasketInputParamCnt; itemIdx++)
                    {
                        GmarketBasketAddT gmktBasketRtn = new GmarketBasketAddT();
                        basketParam = MakeBasketParam(lstBasketInputParam[itemIdx]);
                        insertDBResult = BasketInput(basketParam);

                        gmktBasketRtn.GepOrderNo = basketParam.GEPOrderNo;
                        gmktBasketRtn.RetCode = insertDBResult.RetCode.ToString();
                        gmktBasketRtn.RetMessage = insertDBResult.RetMessage;

                        if (gmktBasketRtn.RetCode != "0")
                        {
                            if (long.TryParse(lstBasketInputParam[itemIdx].GEPOrderNo, out conGepOrderNo))
                            {
                                try
                                {
                                    gepBiz.InsertDisableOrder(conGepOrderNo);
                                }
                                catch (Exception e)
                                {
                                }
                            }
                        }

                        gmktBasketInputResult.AddResultList.Add(gmktBasketRtn);
                    }
                }
            }
            return gmktBasketInputResult;
        }
Пример #9
0
        //변수를 basketParam 형식으로 만들기(리스트)
        public BasketParamT MakeBasketParam(BasketInputParamT reqBasketInputParam)
        {
            BasketParamT resBasketParam = new BasketParamT();

            resBasketParam.CustNo = reqBasketInputParam.CustNo;
            resBasketParam.LoginId = reqBasketInputParam.LoginID;
            resBasketParam.GoodsCode = reqBasketInputParam.ItemNo;
            resBasketParam.OrderCnt = reqBasketInputParam.OrderCount;
            resBasketParam.OptNos = reqBasketInputParam.OptNos;
            resBasketParam.GEPOrderNo = reqBasketInputParam.GEPOrderNo;
            resBasketParam.InputWay = reqBasketInputParam.InputWay;

            return resBasketParam;
        }
Пример #10
0
        //장바구니에 넣기 전 Verification
        public GEPBaseResultT BasketVerification(BasketParamT reqBasketParam)
        {
            GEPBaseResultT basketVerificationResult = new GEPBaseResultT();
            basketVerificationResult.RetCode = 0;

            //배송체크
            if (DeliveryVerification(reqBasketParam) != 0)
            {
                basketVerificationResult.RetCode = 202;
                basketVerificationResult.RetMessage = "다음 상품은 배송비 설정이 잘못 되었습니다.";
                return basketVerificationResult;
            }

            //재고체크
            InventoryCheckResultT inventoryVerificationResult = new InventoryCheckResultT();
            inventoryVerificationResult = InventoryVerification(reqBasketParam);
            if (inventoryVerificationResult.RetCode != 0)
            {
                basketVerificationResult.RetCode = 203;
                basketVerificationResult.RetMessage = "다음 상품은 "+ inventoryVerificationResult.RetMsg +" 상품입니다.";
                return basketVerificationResult;
            }

            //옵션체크
            SelectOptionInfoResultT selOptResult = new SelectOptionInfoResultT();
            selOptResult.Result = new GEPBaseResultT();
            selOptResult = OptionVerification(reqBasketParam);
            if (reqBasketParam.OptSelYn == "Y" || reqBasketParam.OptAddYn == "Y") //옵션이 있을 때
            {
                if (selOptResult.Result.RetCode != 0)
                {
                    basketVerificationResult.RetCode = 204;
                    basketVerificationResult.RetMessage = "다음 상품은 장바구니에 담을 수 없습니다." + selOptResult.Result.RetMessage;
                    return basketVerificationResult;
                }
            }

            if (reqBasketParam.InputWay == "C")
            {
                //Mother상품비교변경사항체크
                ValidCheckResultT oriCheckResult = new ValidCheckResultT();
                oriCheckResult.Result = new GEPBaseResultT();
                oriCheckResult = OriginVerification(reqBasketParam);
                if (oriCheckResult.Result.RetCode != 0)
                {
                    basketVerificationResult.RetCode = 204;
                    basketVerificationResult.RetMessage = "상품 정보가 변경되었습니다.";
                    return basketVerificationResult;
                }
            }

            if(basketVerificationResult.RetCode == 0){
                basketVerificationResult.RetMessage = "Verification Success!";
            }

            return basketVerificationResult;
        }
Пример #11
0
        //장바구니에 넣기 로직
        public GEPBaseResultT BasketInput(BasketParamT requestBasketParam)
        {
            BasketOrderParamT basketOrderParam = new BasketOrderParamT();
            BasketParamT basketParam = new BasketParamT();
            AvailableBasketInfoResultT availableBasketInfoResult = new AvailableBasketInfoResultT();
            availableBasketInfoResult.Result = new GEPBaseResultT();
            SelectOptionInfoResultT selOptResult = new SelectOptionInfoResultT();
            GEPBaseResultT basketInputResult = new GEPBaseResultT();

            availableBasketInfoResult = InsertableBasketInfo(requestBasketParam, ref basketOrderParam);
            if (availableBasketInfoResult.Result.RetCode == 0)
            {
                selOptResult = OptionVerification(availableBasketInfoResult.BasketInfo);
            }

            if (availableBasketInfoResult.Result.RetCode == 0 && selOptResult.Result.RetCode == 0)
            {
                //basketInfoSetResult = SetBasketInfo(basketOrderParam); //SP넣는 부분
                try
                {
                    basketInputResult = InputDataToDB(selOptResult.OptionInfoList, basketOrderParam);
                }
                catch (Exception e)
                {
                    //Console.WriteLine(e.Message);
                }
            }
            else
            {
                if(availableBasketInfoResult.Result.RetCode != 0){
                    basketInputResult.RetMessage = "상품 정보에 오류가 있습니다.";
                    basketInputResult.RetCode = 400;
                }
                else if (selOptResult.Result.RetCode != 0)
                {
                    basketInputResult.RetMessage = "선택옵션 정보에 오류가 있습니다.";
                    basketInputResult.RetCode = 401;
                }else
                {
                    basketInputResult.RetMessage = "해당 상품을 장바구니 담기에 실패하였습니다.";
                    basketInputResult.RetCode = 402;
                }
            }
            return basketInputResult;
        }
Пример #12
0
        //장바구니 넣기에 적합한 형태로 변환 및 체크
        private AvailableBasketInfoResultT InsertableBasketInfo(BasketParamT requestBasketParam, ref BasketOrderParamT basketOrderParam)
        {
            AvailableBasketInfoResultT inputResult = new AvailableBasketInfoResultT();
            GEPBaseResultT verificationResult = new GEPBaseResultT();
            inputResult.Result = new GEPBaseResultT();

            BasketParamT basketParam = requestBasketParam;
            BasketInfoSetResultT basketInfoSetResult = new BasketInfoSetResultT();

            try
            {
                basketParam = InitBasketParam(basketParam); //초기화
                verificationResult = BasketVerification(basketParam); //Item value Verification
                if (verificationResult.RetCode == 0)
                {
                    basketOrderParam = MakeBasketOrderParam(basketParam); //insert SP에 넘길 파라미터 만들기(ref형)

                    if (basketParam.Pbid != null)
                    {
                        inputResult.BasketInfo = basketParam;

                        inputResult.Result.RetCode = 0;
                        inputResult.Result.RetMessage = "성공";
                    }
                }
                else
                {
                    inputResult.Result.RetCode = verificationResult.RetCode;
                    inputResult.Result.RetMessage = verificationResult.RetMessage;
                    throw new ValidationException("Validation 검사 중 에러가 발생하였습니다.");
                }
            }
            catch (ValidationException ve)
            {
                Console.WriteLine(ve.Message);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            return inputResult;
        }
Пример #13
0
        //장바구니에 넣은 후 - 주문하기 전 Verification
        public GEPBaseResultT PaymentVerification(BasketParamT reqBasketParam)
        {
            GEPBaseResultT PaymentVerificationResult = new GEPBaseResultT();
            PaymentVerificationResult.RetCode = 0;
            /* asp 페이지에서 함
            //재고체크
            InventoryCheckResultT inventoryVerificationResult = new InventoryCheckResultT();
            inventoryVerificationResult = InventoryVerification(reqBasketParam);
            if (inventoryVerificationResult.RetCode > 0)
            {
                basketVerificationResult.RetCode = 301;
                basketVerificationResult.RetMessage = "다음 상품은 " + inventoryVerificationResult.RetMsg + " 상품입니다.";
                return basketVerificationResult;
            }

            //옵션체크
            OptionValidCheckTResultT selOptResult = new OptionValidCheckTResultT();
            selOptResult.Result = new GEPBaseResultT();
            selOptResult = PaymentOptionVerification(reqBasketParam);
            if (reqBasketParam.OptSelYn == "Y" || reqBasketParam.OptAddYn == "Y") //옵션이 있을 때
            {
                if (selOptResult.Result.RetCode > 0)
                {
                    basketVerificationResult.RetCode = 302;
                    basketVerificationResult.RetMessage = "다음 상품은 장바구니에 담을 수 없습니다." + selOptResult.Result.RetMessage;
                    return basketVerificationResult;
                }
            }
            */
            //Mother상품비교변경사항체크
            if (reqBasketParam.InputWay == "C")
            {
                ValidCheckResultT oriCheckResult = new ValidCheckResultT();
                oriCheckResult.Result = new GEPBaseResultT();
                oriCheckResult = OriginVerification(reqBasketParam);
                if (oriCheckResult.Result.RetCode > 0)
                {
                    PaymentVerificationResult.RetCode = 301;
                    PaymentVerificationResult.RetMessage = "상품 정보가 변경되었습니다.";
                    return PaymentVerificationResult;
                }
            }

            return PaymentVerificationResult;
        }
Пример #14
0
        //옵션체크(클론옵션과장바구니옵션비교)
        public ValidCheckResultT PaymentOptionVerification(BasketParamT reqBasketParam)
        {
            ValidCheckResultT paymentOptionVerificationResult = new ValidCheckResultT();
            paymentOptionVerificationResult.Result = new GEPBaseResultT();

            List<SelectOptionInfoT> lstSelOptInfo = new List<SelectOptionInfoT>();
            BasketGoodsBasicInfoT basketGoodsBasicInfo = new BasketGoodsBasicInfoT();
            List<GEPBasketOptionInfoT> lstGEPBasketOptionInfo = new List<GEPBasketOptionInfoT>();
            SelectOptionStatusT selectOptionStatus = new SelectOptionStatusT();
            string strOptionValidCheckResult = "OK";
            string strOrderIdxs = string.Empty;
            string[] arrGdNo, arrGdSelNo;
            string strXML = string.Empty;
            int err_count = 0;
            strOrderIdxs = reqBasketParam.OrderIdxs;
            if (strOrderIdxs.Substring(strOrderIdxs.Length - 1) != "|")
            {
                strOrderIdxs = strOrderIdxs + "|";
            }
            strOrderIdxs = strOrderIdxs.Replace("|", ",");
            //장바구니 내 정보 가져오기(덩어리)
            basketGoodsBasicInfo = GetBasketGoodsBasicInfo(reqBasketParam.Pbid, "N", strOrderIdxs);

            //장바구니 옵션 테이블에서 정보 가져와서 lstGEPBasketOptionInfo에 넣기
            if (strOrderIdxs.Length > 0)
            {
                arrGdNo = basketGoodsBasicInfo.ItemNo.Split(PaymentConstant.CommaSeperator);
                arrGdSelNo = basketGoodsBasicInfo.GdSelNo.Split(PaymentConstant.CommaSeperator);

                strXML = "<Data>";
                for (int i = 0, arrGdNoLenth = arrGdNo.Length; i < arrGdNoLenth; i++)
                {
                    if (arrGdNo[i] != string.Empty && arrGdSelNo[i] != string.Empty)
                    {
                        strXML = strXML + "<rows>";
                        strXML = strXML + "<iid>" + i + "</iid>";
                        strXML = strXML + "<gd_no>" + arrGdNo[i] + "</gd_no>";
                        strXML = strXML + "<gd_sel_no>" + arrGdSelNo[i] + "</gd_sel_no>";
                        strXML = strXML + "</rows>";
                    }
                }
                strXML = strXML + "</Data>";

                lstGEPBasketOptionInfo = GetGEPCartOptionInfo("B", reqBasketParam.Pbid, "N", "", "", strXML);

                string strOptValidationChk = string.Empty;
                for (int bIdx = 0, lstGEPBasketOptionInfoCnt = lstGEPBasketOptionInfo.Count; bIdx < lstGEPBasketOptionInfoCnt; bIdx++)
                {
                    if (!Validate.IsNull(lstGEPBasketOptionInfo[bIdx].OptNo))
                    {
                        selectOptionStatus = GetSelectOptionStatus(lstGEPBasketOptionInfo[bIdx].GdNo);
                        lstSelOptInfo = GetSelectOptionInfo(lstGEPBasketOptionInfo[bIdx].GdNo, "S");
                        for (int optIdx = 0, lstSelOptInfoCnt = lstSelOptInfo.Count; optIdx < lstSelOptInfoCnt; optIdx++)
                        {
                            strOptValidationChk = "N";
                            if (lstGEPBasketOptionInfo[bIdx].OptNo == lstSelOptInfo[optIdx].OptNo)
                            {
                                if (lstSelOptInfo[optIdx].OptStat == "N")
                                {
                                    strOptValidationChk = "O"; //품절
                                    continue;
                                }

                                if (lstSelOptInfo[optIdx].InfoType == "Y")
                                {
                                    if (lstGEPBasketOptionInfo[bIdx].OptOrderCnt > lstSelOptInfo[optIdx].InventoryCnt)
                                    {
                                        strOptValidationChk = "I"; //재고부족
                                        continue;
                                    }
                                }

                                if (lstGEPBasketOptionInfo[bIdx].VersionChgDt != lstSelOptInfo[optIdx].VersionChgDt)
                                {
                                    strOptValidationChk = "Y"; //정보변경
                                    continue;
                                }
                                strOptValidationChk = "F";

                                if (strOptValidationChk == "I" || strOptValidationChk == "O" || selectOptionStatus.SellingStat == 1)
                                {
                                    strOptionValidCheckResult = "IV";
                                }
                                else if (strOptValidationChk == "Y")
                                {
                                    if (lstGEPBasketOptionInfo[bIdx].SelName != lstSelOptInfo[optIdx].OptNm)
                                    {
                                        strOptionValidCheckResult = "NM";
                                    }
                                    else if (lstGEPBasketOptionInfo[bIdx].SelValue != lstSelOptInfo[optIdx].OptValue)
                                    {
                                        strOptionValidCheckResult = "VL";
                                    }
                                    else if (lstGEPBasketOptionInfo[bIdx].SelPrice != lstSelOptInfo[optIdx].OptPrice)
                                    {
                                        strOptionValidCheckResult = "PR";
                                    }
                                    else
                                    {
                                        strOptionValidCheckResult = "ET";
                                    }
                                }

                                if (strOptValidationChk != "N" && strOptValidationChk != "F")
                                {
                                    err_count = err_count + 1;
                                }
                                else
                                {
                                    strOptionValidCheckResult = "PS";
                                }
                                ValidCheckT optionVaildCheck = new ValidCheckT();
                                optionVaildCheck.OrderIdx = lstGEPBasketOptionInfo[bIdx].OrderIdx.ToString();
                                optionVaildCheck.RetCode = strOptionValidCheckResult;

                                paymentOptionVerificationResult.ValidCheckList.Add(optionVaildCheck);
                            }
                        }
                    }
                }
            }
            if (err_count > 0)
            {
                paymentOptionVerificationResult.Result.RetCode = -1;
            }
            else
            {
                paymentOptionVerificationResult.Result.RetCode = 0;
            }

            return paymentOptionVerificationResult;
        }
Пример #15
0
        //Mother상품비교변경사항체크
        public ValidCheckResultT OriginVerification(BasketParamT reqBasketParam)
        {
            CommonBiz commonBiz = new CommonBiz();
            ValidCheckResultT originValidCheckResult = new ValidCheckResultT();
            GmarketVerifyDataClone gmktVerifyDataResult = new GmarketVerifyDataClone();
            originValidCheckResult.Result = new GEPBaseResultT();
            originValidCheckResult.Result.RetCode = 0;
            int errcnt = 0;

            string[] arrOrderIdx, arrCloneId;
            string strOrderIdxs = string.Empty;
            strOrderIdxs = reqBasketParam.OrderIdxs;
            string strCloneIds = reqBasketParam.GoodsCodes;
            if (strOrderIdxs != null)
            {
                if (strOrderIdxs.Substring(strOrderIdxs.Length - 1) != "|")
                {
                    strOrderIdxs = strOrderIdxs + "|";
                }
                strOrderIdxs = strOrderIdxs.Replace("|", ",");
                arrOrderIdx = strOrderIdxs.Split(PaymentConstant.CommaSeperator);

                arrCloneId = strCloneIds.Split(new char[] { ';' });

                //이 상태는 몽고 디비에 데이터가 없다는 거.
                //테스트를 위해 무조건 유효성검사성공임
                for (int i = 0, arrOrderIdxLenth = arrOrderIdx.Length; i < arrOrderIdxLenth; i++)
                {
                    if (arrOrderIdx[i] != string.Empty)
                    {
                        ValidCheckT originValidCheck = new ValidCheckT();
                        originValidCheck.OrderIdx = arrOrderIdx[i];

                        originValidCheck.RetCode = "S";
                        originValidCheck.RetMessage = "유효성검사성공";

                        originValidCheckResult.ValidCheckList.Add(originValidCheck);
                    }
                }

                /*
                for (int i = 0, arrOrderIdxLenth = arrOrderIdx.Length; i < arrOrderIdxLenth; i++)
                {
                    if (arrOrderIdx[i] != string.Empty && arrCloneId[i] != string.Empty)
                    {
                        ValidCheckT originValidCheck = new ValidCheckT();
                        originValidCheck.OrderIdx = arrOrderIdx[i];

                        gmktVerifyDataResult = commonBiz.GmarketVerifyCloneId(arrCloneId[i]);

                        if (gmktVerifyDataResult.Result == true)
                        {
                            originValidCheck.RetCode = "S";
                            originValidCheck.RetMessage = "유효성검사성공";
                        }
                        else
                        {
                            originValidCheck.RetCode = "F";
                            originValidCheck.RetMessage = "유효성검사실패";
                            errcnt = errcnt + 1;
                        }
                        originValidCheckResult.ValidCheckList.Add(originValidCheck);
                    }
                }
                */

                if (errcnt > 0)
                {
                    originValidCheckResult.Result.RetCode = -1;
                    originValidCheckResult.Result.RetMessage = "원상품유효성검사실패";
                }
                else
                {
                    originValidCheckResult.Result.RetCode = 0;
                    originValidCheckResult.Result.RetMessage = "원상품유효성검사성공";
                }
            }

            return originValidCheckResult;
        }
Пример #16
0
        //옵션체크(옵션설정값자체)
        public SelectOptionInfoResultT OptionVerification(BasketParamT reqBasketParam)
        {
            SelectOptionInfoResultT selOptResult = new SelectOptionInfoResultT();
            selOptResult.Result = new GEPBaseResultT();

            List<SelectOptionInfoT> lstSelOptInfo = new List<SelectOptionInfoT>();
            List<SelectOptionParamT> lstSelOptParam = new List<SelectOptionParamT>();

            string strMsg = String.Empty;
            int errorCnt = 0;

            if (reqBasketParam.OptSelYn == "Y" || reqBasketParam.OptAddYn == "Y") //옵션이 있을 때
            {
                string[] arrOptNo = reqBasketParam.OptNos.Split(PaymentConstant.ForthDelimiter.ToCharArray());
                lstSelOptInfo = GetSelectOptionInfo(reqBasketParam.GoodsCode, reqBasketParam.AddInfoType);

                if (lstSelOptInfo != null)
                {
                    if (lstSelOptInfo.Count > 0)
                    {
                        string strOptValidationchk = "N"; //N:변동없음
                        string strInventoryYn = String.Empty;
                        if (arrOptNo.Length > 0)
                        {
                            for (int j = 0, arrOptNoLenth = arrOptNo.Length; j < arrOptNoLenth; j++)
                            {
                                for (int i = 0, lstSelOptInfoCnt = lstSelOptInfo.Count; i < lstSelOptInfoCnt; i++)
                                {
                                    if (lstSelOptInfo[i].OptNo.ToString() == arrOptNo[j])
                                    {
                                        //옵션 Validation Check - 재고 수량 체크
                                        if (lstSelOptInfo[i].OptStat == "N")
                                        {
                                            strOptValidationchk = "O"; //옵션품절
                                            continue;
                                        }

                                        if (lstSelOptInfo[i].InfoType == "S")
                                        {
                                            strInventoryYn = reqBasketParam.OptSelInventoryYn;
                                        }
                                        else if (lstSelOptInfo[i].InfoType == "P")
                                        {
                                            strInventoryYn = reqBasketParam.OptAddInventoryYn;
                                        }

                                        if (strInventoryYn == "Y")
                                        {
                                            if (int.Parse(reqBasketParam.OrderCnt) > lstSelOptInfo[i].InventoryCnt)
                                            {
                                                strOptValidationchk = "I"; //재고부족
                                                continue;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        continue;
                                    }
                                    strOptValidationchk = "F";

                                    if (strOptValidationchk != "N" && strOptValidationchk != "F")
                                    {
                                        strMsg = strMsg + "대상 : " + lstSelOptInfo[i].OptNm + "-" + lstSelOptInfo[i].OptValue;
                                        if (lstSelOptInfo[i].OptPrice > 0)
                                        {
                                            strMsg = strMsg + "(+" + lstSelOptInfo[i].OptPrice + "):";
                                        }
                                        else if (lstSelOptInfo[i].OptPrice < 0)
                                        {
                                            strMsg = strMsg + "(-" + lstSelOptInfo[i].OptPrice + "):";
                                        }
                                        if (strOptValidationchk == "O")
                                        {
                                            strMsg = strMsg + "선택상품품절\n";
                                        }
                                        else if (strOptValidationchk == "I")
                                        {
                                            strMsg = strMsg + "재고부족\n";
                                        }
                                        errorCnt = errorCnt + 1;
                                    }
                                    else
                                    {
                                        //gep_cart_option_info 에 데이터 넣기
                                        SelectOptionParamT optParam = new SelectOptionParamT();
                                        optParam.Pid = reqBasketParam.Pbid;
                                        optParam.CustNo = reqBasketParam.CustNo;
                                        optParam.ItemNo = reqBasketParam.GoodsCode;
                                        optParam.GdSelNo = reqBasketParam.GdSelNo;
                                        optParam.OptNm = lstSelOptInfo[i].OptNm;
                                        optParam.OptValue = lstSelOptInfo[i].OptValue;
                                        optParam.InfoType = lstSelOptInfo[i].InfoType;
                                        optParam.SelItemPrice = (Int32)lstSelOptInfo[i].OptPrice;
                                        optParam.OrderCnts = int.Parse(reqBasketParam.OrderCnt);
                                        optParam.OptNo = lstSelOptInfo[i].OptNo;
                                        optParam.OptOrderCnt = optParam.OrderCnts;
                                        optParam.OrderGubun = "N";
                                        optParam.VersionChgDt = lstSelOptInfo[i].VersionChgDt;
                                        optParam.OrderIdx = reqBasketParam.OrderIdx;

                                        lstSelOptParam.Add(optParam);
                                    }
                                }
                            }
                        }
                        else
                        {
                            errorCnt = 1002;
                        }
                    }
                    else
                    {
                        errorCnt = 1001;
                    }
                }
                else
                {
                    errorCnt = 1000;
                }
            }
            selOptResult.Result.RetCode = errorCnt;
            if (errorCnt > 999)
            {
                strMsg = "옵션 정보가 올바르지 않습니다.";
            }
            selOptResult.Result.RetMessage = strMsg;
            if (selOptResult.Result.RetCode == 0)
            {
                selOptResult.OptionInfoList.AddRange(lstSelOptParam);
            }
            return selOptResult;
        }
Пример #17
0
 //배송체크
 public int DeliveryVerification(BasketParamT reqBasketParam)
 {
     int deliveryCheckResult = 2;
     //배송비 종류가 유료,조건부무료,무료만 적용되었는지 체크
     if (reqBasketParam.DeliveryFeeYn == "Y")
     {
         if (reqBasketParam.DeliveryFeeCondition == "M" || reqBasketParam.DeliveryFeeCondition == "R" || reqBasketParam.DeliveryFeeCondition == "F" || reqBasketParam.DeliveryFeeCondition == "X")
         {
             deliveryCheckResult = 0;
         }
     }else if(reqBasketParam.DeliveryFeeYn == "N")
     {
         deliveryCheckResult = 0;
     }
     return deliveryCheckResult;
 }
Пример #18
0
        //변수를 basketParam 형식으로 만들기(단건)
        public BasketParamT MakeBasketParam(string custNo, string loginID, string itemNo, string orderCount, string optNos, string gepOrderNo, string inputWay)
        {
            BasketParamT resBasketParam = new BasketParamT();

            resBasketParam.CustNo = custNo;
            resBasketParam.LoginId = loginID;
            resBasketParam.GoodsCode = itemNo;
            resBasketParam.OrderCnt = orderCount.ToString();
            resBasketParam.OptNos = optNos;
            resBasketParam.GEPOrderNo = gepOrderNo;
            resBasketParam.InputWay = inputWay;
            return resBasketParam;
        }