Ejemplo n.º 1
0
        public PriceStrategyOperate AddPriceSetting(SubmitPriceSetting settting)
        {
            var oper = new PriceStrategyOperate();

            oper.setting = settting;
            oper.status  = -1;

            submitOperateMap[settting.second] = oper;

            return(oper);
        }
Ejemplo n.º 2
0
        public static SubmitPriceSetting fromLine(string line)
        {
            if (line == null || line.Trim().Length == 0)
            {
                return(null);
            }
            string[] arr = line.Trim().Split(',');
            if (arr.Length < 3)
            {
                return(null);
            }

            // 检测秒数,匹配价格区间,加价
            var sps = new SubmitPriceSetting();

            sps.second = int.Parse(arr[0].Trim());
            var range = arr[1].Trim();

            if (range.Contains("-"))
            {
                sps.IsRange = true;
                var a2 = range.Split('-');
                sps.RangeStartDelta = int.Parse(a2[0]);
                sps.RangeEndDelta   = int.Parse(a2[1]);
            }
            else
            {
                sps.IsRange         = false;
                sps.RangeStartDelta = int.Parse(range);
            }

            sps.deltaPrice = int.Parse(arr[2].Trim());


            return(sps);
        }