Beispiel #1
0
        public ActionResult CartDisableOrder()
        {
            CartBiz biz = new CartBiz();
            GEPBaseResultT result = new GEPBaseResultT();

            string gdNos = Request.QueryString["gdNos"];
            string gdSelNos = Request.QueryString["gdSelNos"];
            string pId = Request.QueryString["pId"];

            result = biz.insertCartDisableOrder(gdNos, gdSelNos, pId);

            return new JsonpResult
            {
                Data = new { Result = result, GdNos = gdNos, GdSelNos = gdSelNos },
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }
Beispiel #2
0
        //ASP 장바구니에서 주문 불가로 삭제하는 건들을 주문 불가 리스트에 넣기
        public GEPBaseResultT insertCartDisableOrder(string gdNos, string gdSelNos, string pId)
        {
            GEPBaseResultT disableOrderResult = new GEPBaseResultT();
            DisOrderGepOrderNoT disOrderGepOrderNo = new DisOrderGepOrderNoT();
            GEPOrderBiz gepBiz = new GEPOrderBiz();

            string[] itemNoArray = gdNos.Split('|');
            string[] gdSelNoArray = gdSelNos.Split('|');
            long gepOrderNo;
            int errCnt = 0;

            for (int i = 0, cnt = itemNoArray.Length; i < cnt; i++)
            {
                if (itemNoArray[i] != string.Empty)
                {
                    disOrderGepOrderNo = GetDisOrderGepOrderNo(pId, itemNoArray[i], gdSelNoArray[i]);
                    if (disOrderGepOrderNo != null)
                    {
                        gepOrderNo = disOrderGepOrderNo.GepOrderNo;
                        try
                        {
                            gepBiz.InsertDisableOrder(gepOrderNo);
                        }
                        catch (Exception e)
                        {
                        }
                    }
                    else
                    {
                        errCnt += 1;
                    }
                }
            }

            if (errCnt > 0)
            {
                disableOrderResult.RetCode = -1;
                disableOrderResult.RetMessage = "주문 불가 리스트 넣기 오류";
            }
            else
            {
                disableOrderResult.RetCode = 0;
                disableOrderResult.RetMessage = "주문 불가 리스트 넣기 성공";
            }
            return disableOrderResult;
        }
Beispiel #3
0
        /// <summary>
        ///GSM에서 발주 준비 및 라벨출력 시 기초정보 생성
        /// </summary>
        /// <param name="contrnos">송장번호</param>
        /// <returns>0 : 정상, -99 : 에러</returns>
        public GEPBaseResultT SetTransportReady(string contrnos, string user_id)
        {
            if (String.IsNullOrEmpty(contrnos))
            {
                return new GEPBaseResultT() { RetCode = -99, RetMessage = "인자값 오류" };
            }

            GEPBaseResultT result = new GEPBaseResultT()
            {
                RetCode = 0,
                RetMessage = ""
            };

            string[] listContrNo = contrnos.Split(',');

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

                    if (new TransportGepWarehouseDac().FindOne(Convert.ToInt32(contr_no)) != null)
                    {
                        result.RetCode = 20;
                        result.RetMessage += contr_no + ",";

                        continue;
                    }

                    GepTransInfo gepTransInfo = new GepTransInfo()
                    {
                        //_id = ObjectId.GenerateNewId(),

                        contr_no = Util.GetSafeInt(contr_no),
                        reg_dt = DateTime.Now,
                        reg_id = user_id,
                        state = GepShippingStateEnum.Wait,
                    };

                    new TransportGepWarehouseDac().Insert(new GepWarehouse()
                    {
                        //_id = ObjectId.GenerateNewId(),

                        state = WarehouseStateEnum.Ready,
                        contr_no = Convert.ToInt32(contr_no),

                        gsm_label_print_dt = DateTime.Now,
                        gsm_label_print_id = user_id,

                        transinfo = gepTransInfo
                    });
                }
            }
            catch (Exception ex)
            {
                result.RetCode = -40;
                result.RetMessage = ex.Message;
            }

            return result;
        }
Beispiel #4
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;
        }
Beispiel #5
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;
        }
Beispiel #6
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;
        }
Beispiel #7
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;
        }
Beispiel #8
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;
        }
Beispiel #9
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;
        }
Beispiel #10
0
        private GEPBaseResultT PaymentExecuteOrderFollowUp(PaymentOrderMultiParamT orderParam)
        {
            GEPBaseResultT result = new GEPBaseResultT();

            PaymentProcessQueryBiz paymentProcessQueryBiz = new PaymentProcessQueryBiz();

            #region 주문시 클라이언트 IP를 기록

            try
            {
                paymentProcessQueryBiz.InsertOrderLogIpAddress(orderParam.RemoteAddr, orderParam.PackNo.ToString() + ",", orderParam.ServerIPAddr);
            }
            catch
            {
                // 실패 시 lion.dbo.order_error_log_for_sub_sp 에 기록
            }

            if (!orderParam.AcntType.Equals("GL", StringComparison.InvariantCultureIgnoreCase) && orderParam.PayAuthSeq != 0)
            {
                int retCode = 0;

                //try
                //{
                    retCode = paymentProcessQueryBiz.UpdateOrderSubAuthLog(orderParam.PayAuthSeq, orderParam.PackNo, orderParam.OrderDateTime);
                //}
                //catch
                //{

                //}

                // 주문에 영향은 없다고 함.
                /*
                if (retCode < 0)
                {
                    result.RetCode = retCode;
                    result.RetMessage = "정상적으로 주문은 접수되었지만, 문제가 발생했습니다. 나의 쇼핑정보에서 확인해주세요";

                    return result;
                }
                */
            }

            #endregion

            return result;
        }