Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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;
        }