Ejemplo n.º 1
0
        public static string GetItemPropName(InoutDetailInfo inoutDetailInfo)
        {
            string display_name = string.Empty;

            //display_name = string.Format("{0}/{1}",
            //    inoutDetailInfo.item_code, inoutDetailInfo.item_name);
            if (inoutDetailInfo.prop_1_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_1_detail_name;
            }
            if (inoutDetailInfo.prop_2_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_2_detail_name;
            }
            if (inoutDetailInfo.prop_3_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_3_detail_name;
            }
            if (inoutDetailInfo.prop_4_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_4_detail_name;
            }
            if (inoutDetailInfo.prop_5_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_5_detail_name;
            }
            if (display_name.StartsWith("/"))
            {
                display_name = display_name.Substring(1);
            }
            return(display_name);
        }
Ejemplo n.º 2
0
        public static string GetItemAllName(InoutDetailInfo inoutDetailInfo)
        {
            string display_name = string.Empty;

            display_name = string.Format("{0}/{1}",
                                         inoutDetailInfo.item_code, inoutDetailInfo.item_name);
            if (inoutDetailInfo.prop_1_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_1_detail_name;
            }
            if (inoutDetailInfo.prop_2_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_2_detail_name;
            }
            if (inoutDetailInfo.prop_3_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_3_detail_name;
            }
            if (inoutDetailInfo.prop_4_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_4_detail_name;
            }
            if (inoutDetailInfo.prop_5_detail_name != null)
            {
                display_name += "/" + inoutDetailInfo.prop_5_detail_name;
            }

            return(display_name);
        }
Ejemplo n.º 3
0
    //将前台商品详细数据序列化
    private IList <InoutDetailInfo> SerializeFromUI()
    {
        IList <InoutDetailInfo> detail = new List <InoutDetailInfo>();
        var obj = (object[])new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(this.hidInout.Value);

        for (int i = 0; i < obj.Length; i++)
        {
            var dic  = (Dictionary <string, object>)obj[i];
            var item = new InoutDetailInfo();
            foreach (var key in dic)
            {
                switch (key.Key)
                {
                case "item_name": { item.item_name = (key.Value ?? "").ToString(); } break;

                case "item_code": item.item_code = (key.Value ?? "").ToString(); break;

                case "prop_1_detail_name": item.prop_1_detail_name = (key.Value ?? "").ToString(); break;

                case "prop_2_detail_name": item.prop_2_detail_name = (key.Value ?? "").ToString(); break;

                case "prop_3_detail_name": item.prop_3_detail_name = (key.Value ?? "").ToString(); break;

                case "prop_4_detail_name": item.prop_4_detail_name = (key.Value ?? "").ToString(); break;

                case "prop_5_detail_name": item.prop_5_detail_name = (key.Value ?? "").ToString(); break;

                case "order_detail_id": item.order_detail_id = key.Value == null ? null : key.Value.ToString(); break;

                case "sku_id": item.sku_id = key.Value == null ? null : key.Value.ToString(); break;

                case "order_qty": item.order_qty = Convert.ToDecimal(key.Value ?? "0"); break;

                case "enter_qty": item.enter_qty = Convert.ToDecimal(key.Value ?? "0"); break;

                case "std_price": item.std_price = Convert.ToDecimal(key.Value ?? "0"); break;

                case "retail_price": item.retail_price = Convert.ToDecimal(key.Value ?? "0"); break;

                case "retail_amount": item.retail_amount = Convert.ToDecimal(key.Value ?? "0"); break;

                case "discount_rate": item.discount_rate = Convert.ToDecimal(key.Value ?? "0"); break;

                case "retail_rate": item.retail_price = Convert.ToDecimal(key.Value ?? "0"); break;

                case "enter_price": item.enter_price = Convert.ToDecimal(key.Value ?? "0"); break;

                case "order_discount_rate": item.order_discount_rate = Convert.ToDecimal(key.Value ?? "0"); break;
                }
            }
            detail.Add(item);
        }
        return(detail);
    }
Ejemplo n.º 4
0
    private void TestSetPosInout()
    {
        InoutInfo inoutInfo = new InoutInfo();

        inoutInfo.order_id          = "";
        inoutInfo.order_no          = "POS0033";
        inoutInfo.order_type_id     = "";
        inoutInfo.order_reason_id   = "";
        inoutInfo.red_flag          = "1";
        inoutInfo.ref_order_id      = "2";
        inoutInfo.ref_order_no      = "3";
        inoutInfo.warehouse_id      = "4";
        inoutInfo.order_date        = "2012-06-01";
        inoutInfo.request_date      = "2012-06-30";
        inoutInfo.complete_date     = "2012-06-25";
        inoutInfo.create_unit_id    = "5";
        inoutInfo.unit_id           = "6";
        inoutInfo.related_unit_id   = "7";
        inoutInfo.related_unit_code = "8";
        inoutInfo.pos_id            = "9";
        inoutInfo.shift_id          = "10";
        inoutInfo.sales_user        = "******";
        inoutInfo.total_amount      = Convert.ToDecimal("100");
        inoutInfo.discount_rate     = Convert.ToDecimal("0.9");
        inoutInfo.actual_amount     = Convert.ToDecimal("100");
        inoutInfo.receive_points    = Convert.ToDecimal("200");
        inoutInfo.pay_points        = Convert.ToDecimal("99");
        inoutInfo.pay_id            = "12";
        inoutInfo.print_times       = Convert.ToInt32("13");
        inoutInfo.carrier_id        = "14";
        inoutInfo.remark            = "15";
        inoutInfo.status            = "16";
        inoutInfo.status_desc       = "17";
        inoutInfo.total_qty         = Convert.ToDecimal("10.5");
        inoutInfo.total_retail      = Convert.ToDecimal("11.5");
        inoutInfo.keep_the_change   = Convert.ToDecimal("0.5");
        inoutInfo.wiping_zero       = Convert.ToDecimal("0.6");
        inoutInfo.vip_no            = "18";
        inoutInfo.create_time       = "";
        inoutInfo.create_user_id    = "";
        inoutInfo.approve_time      = "";
        inoutInfo.approve_user_id   = "";
        inoutInfo.send_time         = "";
        inoutInfo.send_user_id      = "";
        inoutInfo.accpect_time      = "";
        inoutInfo.accpect_user_id   = "";
        inoutInfo.modify_time       = "";
        inoutInfo.modify_user_id    = "";
        inoutInfo.BillKindCode      = "DO";
        //--------------------------------------
        InoutDetailInfo inoutDetailInfo1 = new InoutDetailInfo();

        inoutDetailInfo1.order_detail_id     = "";
        inoutDetailInfo1.order_id            = "";
        inoutDetailInfo1.ref_order_detail_id = "1";
        inoutDetailInfo1.sku_id              = "1";
        inoutDetailInfo1.unit_id             = "2";
        inoutDetailInfo1.order_qty           = Convert.ToDecimal("10.11");
        inoutDetailInfo1.enter_qty           = Convert.ToDecimal("10.22");
        inoutDetailInfo1.enter_price         = Convert.ToDecimal("10.33");
        inoutDetailInfo1.enter_amount        = Convert.ToDecimal("10.44");
        inoutDetailInfo1.std_price           = Convert.ToDecimal("10.55");
        inoutDetailInfo1.discount_rate       = Convert.ToDecimal("0.9");
        inoutDetailInfo1.retail_price        = Convert.ToDecimal("10.66");
        inoutDetailInfo1.retail_amount       = Convert.ToDecimal("10.77");
        inoutDetailInfo1.plan_price          = Convert.ToDecimal("10.88");
        inoutDetailInfo1.receive_points      = Convert.ToDecimal("10.99");
        inoutDetailInfo1.pay_points          = Convert.ToDecimal("10.1");
        inoutDetailInfo1.remark              = "4";
        inoutDetailInfo1.pos_order_code      = "5";
        inoutDetailInfo1.order_detail_status = "6";
        inoutDetailInfo1.display_index       = Convert.ToInt32("1");
        inoutDetailInfo1.create_time         = "";
        inoutDetailInfo1.create_user_id      = "";
        inoutDetailInfo1.modify_time         = "";
        inoutDetailInfo1.modify_user_id      = "";
        inoutDetailInfo1.ref_order_id        = "";
        inoutDetailInfo1.if_flag             = Convert.ToInt32("0");

        IList <InoutDetailInfo> inoutDetailList = new List <InoutDetailInfo>();

        inoutDetailList.Add(inoutDetailInfo1);

        inoutInfo.InoutDetailList = inoutDetailList;

        PosInoutAuthService posInoutAuthServices = new PosInoutAuthService();
        //UserInfo userInfo = userAuthServices.GetUserInfoByUserId("B87FBC7A6D664F67B65F9AD747C5E5DD", "29E11BDC6DAC439896958CC6866FF64E");
        IList <InoutInfo> inoutList = new List <InoutInfo>();

        inoutList.Add(inoutInfo);
        bool b = posInoutAuthServices.SetPosInoutInfo("c4db40c6a38e4a0cb319b65691a6296d", "bbdf6d65e09d4d8a8dbcd4991427cced", "7C47A0C6049F459E930B1083B0264BF5", inoutList);
        //bool b = posInoutAuthServices.SetPosInoutInfo("29E11BDC6DAC439896958CC6866FF64E", "bae1ed3ce4db4524a6d2398299075fbf", "B87FBC7A6D664F67B65F9AD747C5E5DD", inoutList);
    }
Ejemplo n.º 5
0
        public Hashtable Run(string batId, cPos.Admin.Model.Customer.CustomerInfo customer)
        {
            string bizId = Utils.NewGuid();
            var    data  = new Hashtable();

            try
            {
                string customerId = customer.ID;
                int    count      = 0;  // 总数量
                int    rowsCount  = 10; // 每页数量
                int    startRow   = 0;
                string unitId     = null;

                var apInoutService = new Service.InoutService();
                var bsService      = BsWebService.CreatePosInoutService(customer);
                count = bsService.GetPosInoutNotPackagedCount(customerId, unitId);

                IList <InoutInfo> orderList = new List <InoutInfo>();
                string            dataBatId = string.Empty;
                while (count > 0 && startRow < count)
                {
                    dataBatId = Utils.NewGuid();
                    orderList.Clear();
                    var tmpList = bsService.GetPosInoutListPackaged(customerId, unitId, 0, rowsCount, dataBatId);
                    if (tmpList != null && tmpList.Length > 0)
                    {
                        foreach (var tmpObj in tmpList)
                        {
                            var orderObj = new InoutInfo();
                            orderObj.order_id        = tmpObj.order_id;
                            orderObj.order_no        = tmpObj.order_no;
                            orderObj.order_type_id   = tmpObj.order_type_id;
                            orderObj.order_reason_id = tmpObj.order_reason_id;
                            orderObj.red_flag        = tmpObj.red_flag;
                            orderObj.ref_order_id    = tmpObj.ref_order_id;
                            orderObj.ref_order_no    = tmpObj.ref_order_no;
                            orderObj.warehouse_id    = tmpObj.warehouse_id;
                            orderObj.order_date      = tmpObj.order_date;
                            orderObj.request_date    = tmpObj.request_date;
                            orderObj.complete_date   = tmpObj.complete_date;
                            orderObj.create_unit_id  = tmpObj.create_unit_id;
                            orderObj.unit_id         = tmpObj.unit_id;
                            orderObj.related_unit_id = tmpObj.related_unit_id;
                            //orderObj.ref_unit_id = tmpObj.ref_unit_id;
                            orderObj.pos_id           = tmpObj.pos_id;
                            orderObj.shift_id         = tmpObj.shift_id;
                            orderObj.sales_user       = tmpObj.sales_user;
                            orderObj.total_amount     = tmpObj.total_amount;
                            orderObj.discount_rate    = tmpObj.discount_rate;
                            orderObj.actual_amount    = tmpObj.actual_amount;
                            orderObj.receive_points   = tmpObj.receive_points;
                            orderObj.pay_points       = tmpObj.pay_points;
                            orderObj.pay_id           = tmpObj.pay_id;
                            orderObj.print_times      = tmpObj.print_times;
                            orderObj.carrier_id       = tmpObj.carrier_id;
                            orderObj.remark           = tmpObj.remark;
                            orderObj.status           = tmpObj.status;
                            orderObj.create_time      = tmpObj.create_time;
                            orderObj.create_user_id   = tmpObj.create_user_id;
                            orderObj.approve_time     = tmpObj.approve_time;
                            orderObj.approve_user_id  = tmpObj.approve_user_id;
                            orderObj.send_user_id     = tmpObj.send_user_id;
                            orderObj.send_time        = tmpObj.send_time;
                            orderObj.accpect_user_id  = tmpObj.accpect_user_id;
                            orderObj.accpect_time     = tmpObj.accpect_time;
                            orderObj.modify_user_id   = tmpObj.modify_user_id;
                            orderObj.modify_time      = tmpObj.modify_time;
                            orderObj.total_qty        = tmpObj.total_qty;
                            orderObj.total_retail     = tmpObj.total_retail;
                            orderObj.keep_the_change  = tmpObj.keep_the_change;
                            orderObj.wiping_zero      = tmpObj.wiping_zero;
                            orderObj.vip_no           = tmpObj.vip_no;
                            orderObj.data_from_id     = tmpObj.data_from_id;
                            orderObj.sales_unit_id    = tmpObj.sales_unit_id;
                            orderObj.purchase_unit_id = tmpObj.purchase_unit_id;
                            orderObj.if_flag          = tmpObj.if_flag;
                            orderList.Add(orderObj);
                        }
                        var tmpDetailList = bsService.GetPosInoutDetailListPackaged(customerId, unitId, tmpList);
                        IList <InoutDetailInfo> detailList = new List <InoutDetailInfo>();
                        if (tmpDetailList != null && tmpDetailList.Length > 0)
                        {
                            foreach (var tmpDetail in tmpDetailList)
                            {
                                var detailObj = new InoutDetailInfo();
                                detailObj.order_detail_id     = tmpDetail.order_detail_id;
                                detailObj.order_id            = tmpDetail.order_id;
                                detailObj.ref_order_detail_id = tmpDetail.ref_order_detail_id;
                                detailObj.sku_id              = tmpDetail.sku_id;
                                detailObj.unit_id             = tmpDetail.unit_id;
                                detailObj.enter_qty           = tmpDetail.enter_qty;
                                detailObj.order_qty           = tmpDetail.order_qty;
                                detailObj.enter_price         = tmpDetail.enter_price;
                                detailObj.std_price           = tmpDetail.std_price;
                                detailObj.discount_rate       = tmpDetail.discount_rate;
                                detailObj.retail_price        = tmpDetail.retail_price;
                                detailObj.retail_amount       = tmpDetail.retail_amount;
                                detailObj.enter_amount        = tmpDetail.enter_amount;
                                detailObj.receive_points      = tmpDetail.receive_points;
                                detailObj.pay_points          = tmpDetail.pay_points;
                                detailObj.remark              = tmpDetail.remark;
                                detailObj.order_detail_status = tmpDetail.order_detail_status;
                                detailObj.display_index       = tmpDetail.display_index;
                                detailObj.create_time         = tmpDetail.create_time;
                                detailObj.create_user_id      = tmpDetail.create_user_id;
                                detailObj.modify_time         = tmpDetail.modify_time;
                                detailObj.modify_user_id      = tmpDetail.modify_user_id;
                                detailObj.ref_order_id        = tmpDetail.ref_order_id;
                                detailObj.if_flag             = tmpDetail.if_flag;
                                detailObj.pos_order_code      = tmpDetail.pos_order_code;
                                detailObj.plan_price          = tmpDetail.plan_price;
                                detailList.Add(detailObj);
                            }
                        }

                        // 保存Order
                        data = apInoutService.SaveInoutList(true, orderList, detailList);

                        // 更新标记
                        bsService.SetPosInoutIfFlagInfo(customerId, dataBatId);
                    }
                    startRow += orderList.Count;
                }
                data["status"] = Utils.GetStatus(true);
                return(data);
            }
            catch (Exception ex)
            {
                data["status"] = Utils.GetStatus(false);
                data["error"]  = ex.ToString();
                Console.WriteLine(ex.ToString());
            }
            return(data);
        }