Esempio n. 1
0
        public GEPBaseResultT InputDataToDB(List<SelectOptionParamT> lstSelOpt, BasketOrderParamT basketOrderParam)
        {
            GEPBaseResultT inputDataToDBResult = new GEPBaseResultT();
            SelectOptionSetResultT selOptSetResult = new SelectOptionSetResultT();
            BasketInfoSetResultT basketInfoResult = new BasketInfoSetResultT();

            selOptSetResult = SetSelectOption(lstSelOpt);
            basketInfoResult = SetBasketInfo(basketOrderParam);

            if (selOptSetResult.RetCode == "N" || basketInfoResult.RetCode != "0")
            {
                inputDataToDBResult.RetCode = -1;
                inputDataToDBResult.RetMessage = "데이터 쓰기 실패";
            }
            else
            {
                inputDataToDBResult.RetMessage = "데이터 쓰기 성공";
                inputDataToDBResult.RetCode = 0;
            }
            return inputDataToDBResult;
        }
Esempio n. 2
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;
        }
Esempio n. 3
0
        public SelectOptionSetResultT SetSelectOption(List<SelectOptionParamT> lstSelOpt)
        {
            CartBiz biz = new CartBiz();
            SelectOptionSetResultT result = new SelectOptionSetResultT();

            try
            {
                foreach (SelectOptionParamT item in lstSelOpt)
                {
                    result = biz.SetSelectOption(item);

                    if (result.ErrCode != 0)
                        throw new PaymentBizException("필수선택 입력 도중 오류가 발생하였습니다.");
                }
            }
            catch (PaymentBizException e)
            {
                Console.WriteLine(e.Message);
            }
            return result;
        }