Example #1
0
 public override object GetData(JsonParameter[] paramList)
 {
     string pythonCode = "";
     string pythonFunc = "Main";
     string pythonFuncArg = "";
     List<PythonParam> pyParams = new List<PythonParam>();
     foreach (var param in paramList)
     {
         switch (param.Key)
         {
             case "_py_code":
                 pythonCode = param.Value;
                 break;
             case "_py_func":
                 pythonFunc = param.Value;
                 break;
             case "_py_func_arg":
                 pythonFuncArg = param.Value;
                 break;
             default:
                 if (!string.IsNullOrEmpty(param.Key))
                 {
                     pyParams.Add(new PythonParam(param.Key, param.Value));
                 }
                 break;
         }
     }
     return PythonUtils.CallFunc(pythonFunc, "", pyParams, pythonCode);
 }
 public void Process(string typeName, object args, JsonParameter[] paramList)
 {
     BaseDataProcesser dataProcesser = (BaseDataProcesser)Activator.CreateInstance(Type.GetType("ZyGames.Tianjiexing.BLL.WebService." + typeName + "Processer"));
     if (dataProcesser != null)
     {
         dataProcesser.Process(paramList);
     }
 }
Example #3
0
        public override object GetData(JsonParameter[] paramList)
        {
            int pageIndex = 0;
            int pageSize = 0;
            string condition = "Where 1=1";
            List<SqlParameter> paramValues = new List<SqlParameter>();
            foreach (JsonParameter param in paramList)
            {
                if (param.Key == "pageIndex")
                {
                    pageIndex = Convert.ToInt32(param.Value);
                    pageIndex = pageIndex < 1 ? 1 : pageIndex;
                }
                else if (param.Key == "pageSize")
                {
                    pageSize = Convert.ToInt32(param.Value);
                    pageSize = pageSize <= 0 ? 20 : pageSize;
                }
                else if (param.Key == "fromDate")
                {
                    condition += string.Format(" and CreateDate >= @{0}", param.Key);
                    paramValues.Add(SqlParamHelper.MakeInParam("@" + param.Key, SqlDbType.DateTime, 0, Convert.ToDateTime(param.Value)));
                }
                else if (param.Key == "toDate")
                {
                    condition += string.Format(" and CreateDate <= @{0}", param.Key);
                    if (param.Value.Length <= 10)
                    {
                        param.Value += " 23:59:59";
                    }
                    paramValues.Add(SqlParamHelper.MakeInParam("@" + param.Key, SqlDbType.DateTime, 0, Convert.ToDateTime(param.Value)));
                }
                else if (param.Key == "IsTasked")
                {
                    condition += string.Format(" and IsTasked = @{0}", param.Key);
                    paramValues.Add(SqlParamHelper.MakeInParam("@" + param.Key, SqlDbType.Bit, 0, param.Value.ToBool()));
                }
                else if (param.Key == "UserID" && !string.IsNullOrEmpty(param.Value))
                {
                    condition += string.Format(" and UserID = @{0}", param.Key);
                    paramValues.Add(SqlParamHelper.MakeInParam("@" + param.Key, SqlDbType.VarChar, 0, Convert.ToString(param.Value)));
                }
            }

            pageSize = pageSize <= 0 ? 20 : pageSize;
            pageIndex = pageIndex < 1 ? 1 : pageIndex;
            int statIndex = (pageIndex - 1) * pageSize;
            int endIndex = pageIndex * pageSize;
            paramValues.Add(SqlParamHelper.MakeInParam("@statIndex", SqlDbType.Int, 0, statIndex));
            paramValues.Add(SqlParamHelper.MakeInParam("@endIndex", SqlDbType.Int, 0, endIndex));

            int pageCount = 0;

            JsonGrid jsonGrid = new JsonGrid();
            jsonGrid.rows = GetUserPrizeList(condition, out pageCount, paramValues.ToArray());
            jsonGrid.total = pageCount;
            return jsonGrid;
        }
Example #4
0
 public static JsonParameterList Convert(JsonParameter[] parameters)
 {
     JsonParameterList ht = new JsonParameterList();
     foreach (JsonParameter param in parameters)
     {
         ht.Add(param);
     }
     return ht;
 }
 public object GetData(string typeName, object args, JsonParameter[] paramList)
 {
     BaseDataGetter dataGeter = (BaseDataGetter)Activator.CreateInstance(Type.GetType("ZyGames.Tianjiexing.BLL.WebService." + typeName + "Getter"));
     if (dataGeter != null)
     {
         return dataGeter.GetData(paramList);
     }
     return string.Empty;
 }
Example #6
0
 public void DataProcess(string type, JsonParameter[] paramList)
 {
     try
     {
         new OATianjiexingService().Process(type, new object[0], paramList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #7
0
 public void Add(JsonParameter param)
 {
     if (!ht.ContainsKey(param.Key))
     {
         ht.Add(param.Key, param.Value);
     }
     else
     {
         ht[param.Key] = param.Value;
     }
 }
Example #8
0
 public void Add(JsonParameter param)
 {
     if (!ht.ContainsKey(param.Key))
     {
         ht.Add(param.Key, param.Value);
     }
     else
     {
         ht[param.Key] = param.Value;
     }
 }
        public override void Process(JsonParameter[] paramList)
        {
            JsonParameterList parameters = JsonParameter.Convert(paramList);

            if (parameters["op"].Length > 0)
            {
                string userID = parameters["UserId"];
                if (!string.IsNullOrEmpty(userID) && userID.ToUpper().StartsWith("Z"))
                {
                    string          pid  = userID;
                    List <GameUser> list = new List <GameUser>();
                    new GameDataCacheSet <GameUser>().Foreach((personalId, key, user) =>
                    {
                        if (user.Pid.ToUpper() == pid.ToUpper())
                        {
                            list.Add(user);
                        }
                        return(true);
                    });
                    if (list.Count > 0)
                    {
                        userID = list[0].UserID;
                    }
                }
                if (!string.IsNullOrEmpty(userID) && parameters["op"].Equals("1"))
                {
                    UserCacheGlobal.ReLoad(userID);
                }
                else
                {
                    var cacheSet = new ConfigCacheSet <CareerInfo>();
                    if (parameters["op"].Equals("0"))
                    {
                        ConfigCacheGlobal.Load();
                        UserCacheGlobal.ReLoad(string.Empty);
                        SystemGlobal.LoadGlobalData();
                        GameConfigSet.Initialize();
                    }
                    else if (parameters["op"].Equals("2"))
                    {
                        //刷新data配置表
                        SystemGlobal.LoadGlobalData();
                        GameConfigSet.Initialize();
                    }
                    else if (parameters["op"].Equals("3"))
                    {
                        //刷新config配置表
                        ConfigCacheGlobal.Load();
                        GameConfigSet.Initialize();
                    }
                }
            }
        }
Example #10
0
        public override void Process(JsonParameter[] paramList)
        {
            JsonParameterList parameters = JsonParameter.Convert(paramList);
            string            op         = parameters["op"];
            string            userID     = parameters["UserID"];
            GameUser          gameUser   = new PersonalCacheStruct <GameUser>().FindKey(userID);

            OAOperationLog oAOperationLog = new OAOperationLog();

            oAOperationLog.ID         = Guid.NewGuid().ToString();
            oAOperationLog.UserID     = userID;
            oAOperationLog.OpUserID   = Convert.ToInt32(parameters["OpUserID"]);
            oAOperationLog.CreateDate = DateTime.Now;
            if (parameters["EndDate"].Length > 0)
            {
                oAOperationLog.EndDate = Convert.ToDateTime(parameters["EndDate"]);
            }

            oAOperationLog.Reason = parameters["Reason"];
            if (gameUser == null)
            {
                return;
            }
            if (op == "disableId")
            {
                gameUser.UserStatus   = UserStatus.FengJin;
                oAOperationLog.OpType = 1;
            }
            else if (op == "enableId")
            {
                gameUser.UserStatus   = UserStatus.Normal;
                oAOperationLog.OpType = 2;
            }
            else if (op == "disableMsg")
            {
                gameUser.MsgState     = false;
                oAOperationLog.OpType = 3;
            }
            else if (op == "enableMsg")
            {
                gameUser.MsgState     = true;
                oAOperationLog.OpType = 4;
            }
            else
            {
                return;
            }
            //gameUser.Update();
            var sender = DataSyncManager.GetDataSender();

            sender.Send(oAOperationLog);
        }
Example #11
0
        public override void Process(JsonParameter[] paramList)
        {
            JsonParameterList parameters = JsonParameter.Convert(paramList);
            string op = parameters["op"];
            string userID = parameters["UserID"];
            GameUser gameUser = new GameDataCacheSet<GameUser>().FindKey(userID);

            OAOperationLog oAOperationLog = new OAOperationLog();
            oAOperationLog.ID = Guid.NewGuid().ToString();
            oAOperationLog.UserID = userID;
            oAOperationLog.OpUserID = Convert.ToInt32(parameters["OpUserID"]);
            oAOperationLog.CreateDate = DateTime.Now;
            if (parameters["EndDate"].Length > 0)
            {
                oAOperationLog.EndDate = Convert.ToDateTime(parameters["EndDate"]);
            }

            oAOperationLog.Reason = parameters["Reason"];
            if (gameUser == null)
            {
                return;
            }
            if (op == "disableId")
            {
                gameUser.UserStatus = UserStatus.FengJin;
                oAOperationLog.OpType = 1;
            }
            else if (op == "enableId")
            {
                gameUser.UserStatus = UserStatus.Normal;
                oAOperationLog.OpType = 2;
            }
            else if (op == "disableMsg")
            {
                gameUser.MsgState = false;
                oAOperationLog.OpType = 3;
            }
            else if (op == "enableMsg")
            {
                gameUser.MsgState = true;
                oAOperationLog.OpType = 4;
            }
            else
            {
                return;
            }
            //gameUser.Update();
            var sender = DataSyncManager.GetDataSender();
            sender.Send(oAOperationLog);
        }
 public override void Process(JsonParameter[] paramList)
 {
     JsonParameterList parameters = JsonParameter.Convert(paramList);
     if (parameters["op"].Length > 0)
     {
         string userID = parameters["UserId"];
         if (!string.IsNullOrEmpty(userID) && userID.ToUpper().StartsWith("Z"))
         {
             string pid = userID;
             List<GameUser> list = new List<GameUser>();
             new PersonalCacheStruct<GameUser>().Foreach((personalId, key, user) =>
             {
                 if (user.Pid.ToUpper() == pid.ToUpper())
                 {
                     list.Add(user);
                 }
                 return true;
             });
             if (list.Count > 0)
             {
                 userID = list[0].UserID;
             }
         }
         if (!string.IsNullOrEmpty(userID) && parameters["op"].Equals("1"))
         {
             UserCacheGlobal.ReLoad(userID);
         }
         else
         {
             var cacheSet = new ShareCacheStruct<CareerInfo>();
             if (parameters["op"].Equals("0"))
             {
                 UserCacheGlobal.ReLoad(string.Empty);
                 SystemGlobal.LoadGlobalData();
                 GameConfigSet.Initialize();
             }
             else if (parameters["op"].Equals("2"))
             {
                 //刷新data配置表
                 SystemGlobal.LoadGlobalData();
                 GameConfigSet.Initialize();
             }
             else if (parameters["op"].Equals("3"))
             {
                 //刷新config配置表
                 GameConfigSet.Initialize();
             }
         }
     }
 }
Example #13
0
        public string GetData(string type, JsonParameter[] paramList)
        {
            try
            {
                string jsonString = string.Empty;

                object obj = new OATianjiexingService().GetData(type, new object[0], paramList);
                if (obj != null)
                {
                    jsonString = JsonUtils.Serialize(obj);
                }
                return jsonString;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #14
0
 public override void Process(JsonParameter[] paramList)
 {
     JsonParameterList parameters = JsonParameter.Convert(paramList);
     string op = parameters["op"];
     ChatKeyWord keyword = new ChatKeyWord()
     {
         KeyID = parameters["KeyID"].ToNotNullString(),
         KeyWord = parameters["KeyWord"].ToNotNullString()
     };
     var sender = DataSyncManager.GetDataSender();
     if (op == "add" || op == "save")
     {
         sender.Send(keyword);
     }
     else if (op == "delete")
     {
         keyword.OnDelete();
         sender.Send(keyword);
     }
 }
        public override object GetData(JsonParameter[] paramList)
        {
            string pythonCode = "";
            string pythonFunc = "Main";
            string pythonFuncArg = "";
            List<KeyValuePair<string, object>> pyParams = new List<KeyValuePair<string, object>>();
            foreach (var param in paramList)
            {
                switch (param.Key)
                {
                    case "_py_code":
                        pythonCode = param.Value;
                        break;
                    case "_py_func":
                        pythonFunc = param.Value;
                        break;
                    case "_py_func_arg":
                        pythonFuncArg = param.Value;
                        break;
                    default:
                        if (!string.IsNullOrEmpty(param.Key))
                        {
                            pyParams.Add(new KeyValuePair<string, object>(param.Key, param.Value));
                        }
                        break;
                }
            }

            var scope = ScriptEngines.ExecutePythonSource(pythonCode, new string[0]);
            foreach (var param in pyParams)
            {
                scope.SetVariable(param.Key, param.Value);
            }
           var func = scope.GetVariable<Func<string, object>>(pythonFunc);
            if (func != null)
            {
                return func("");
            }
            return null;
            //return PythonUtils.CallFunc(pythonFunc, "", pyParams, pythonCode);
        }
Example #16
0
        public override void Process(JsonParameter[] paramList)
        {
            JsonParameterList parameters = JsonParameter.Convert(paramList);
            string            op         = parameters["op"];
            ChatKeyWord       keyword    = new ChatKeyWord()
            {
                KeyID   = parameters["KeyID"].ToNotNullString(),
                KeyWord = parameters["KeyWord"].ToNotNullString()
            };
            var sender = DataSyncManager.GetDataSender();

            if (op == "add" || op == "save")
            {
                sender.Send(new[] { keyword });
            }
            else if (op == "delete")
            {
                keyword.OnDelete();
                sender.Send(new[] { keyword });
            }
        }
Example #17
0
        public override object GetData(JsonParameter[] paramList)
        {
            var dbProvider = DbConnectionProvider.CreateDbProvider(DbConfig.Data);
            var filter = dbProvider.CreateCommandFilter();
            //command.Columns = "count(ID)";
            //command.Filter = dbProvider.CreateCommandFilter();
            //command.Filter.Condition = condition;
            //command.Filter.AddParam("NickName", name);
            //command.Parser();

            int pageIndex = 0;
            int pageSize = 0;
            //string condition = "Where 1=1";
            List<SqlParameter> paramValues = new List<SqlParameter>();
            foreach (JsonParameter param in paramList)
            {
                if (param.Key == "pageIndex")
                {
                    pageIndex = Convert.ToInt32(param.Value);
                    pageIndex = pageIndex < 1 ? 1 : pageIndex;
                }
                else if (param.Key == "pageSize")
                {
                    pageSize = Convert.ToInt32(param.Value);
                    pageSize = pageSize <= 0 ? 20 : pageSize;
                }
                else if (param.Key == "fromDate")
                {
                    filter.Condition += " AND " + filter.FormatExpression("CreateDate", ">=", param.Key);
                    filter.AddParam(param.Key, Convert.ToDateTime(param.Value));
                }
                else if (param.Key == "toDate")
                {
                    filter.Condition += " AND " + filter.FormatExpression("CreateDate", "<=", param.Key);
                    if (param.Value.Length <= 10)
                    {
                        param.Value += " 23:59:59";
                    }
                    filter.AddParam(param.Key, Convert.ToDateTime(param.Value));
                }
                else if (param.Key == "IsTasked")
                {
                    filter.Condition += " AND " + filter.FormatExpression("IsTasked");
                    filter.AddParam("IsTasked", param.Value.ToBool());
                }
                else if (param.Key == "UserID" && !string.IsNullOrEmpty(param.Value))
                {
                    filter.Condition += " AND " + filter.FormatExpression("UserID");
                    filter.AddParam("UserID", Convert.ToString(param.Value));
                }
            }

            pageSize = pageSize <= 0 ? 20 : pageSize;
            pageIndex = pageIndex < 1 ? 1 : pageIndex;
            int statIndex = (pageIndex - 1) * pageSize;
            int endIndex = pageIndex * pageSize;

            var command = dbProvider.CreateCommandStruct("UserTakePrize", CommandMode.Inquiry);
            command.Columns = "COUNT(ID)";
            command.Filter = filter;
            command.Parser();
            int pageCount = dbProvider.ExecuteScalar(CommandType.Text,command.Sql, command.Parameters).ToInt();

            JsonGrid jsonGrid = new JsonGrid();
            jsonGrid.rows = GetUserPrizeList(dbProvider, filter, statIndex, endIndex);
            jsonGrid.total = pageCount;
            return jsonGrid;
        }
Example #18
0
 public abstract void Process(JsonParameter[] paramList);
Example #19
0
        public override void Process(JsonParameter[] paramList)
        {
            JsonParameterList parameters = JsonParameter.Convert(paramList);
            string op = parameters["op"];
            string[] UserList = Convert.ToString(parameters["UserID"]).Split(new char[] { ',' });
            string itemPackage = Convert.ToString(parameters["Item"]);
            string crystalList = Convert.ToString(parameters["Crystal"]);
            string sparePackage = Convert.ToString(parameters["SparePackage"]);
            string enchantPackage = Convert.ToString(parameters["EnchantPackage"]);

            int obtainNum = 0;
            if (parameters["ObtainNum"].Length > 0)
            {
                obtainNum = Convert.ToInt32(parameters["ObtainNum"]);
            }
            short energyNum = 0;
            if (parameters["EnergyNum"].Length > 0)
            {
                energyNum = Convert.ToInt16(parameters["EnergyNum"]);
            }
            int gameCoin = 0;
            if (parameters["GameCoin"].Length > 0)
            {
                gameCoin = Convert.ToInt32(parameters["GameCoin"]);
            }
            int gold = 0;
            if (parameters["Gold"].Length > 0)
            {
                gold = Convert.ToInt32(parameters["Gold"]);
            }
            int expNum = 0;
            if (parameters["ExpNum"].Length > 0)
            {
                expNum = Convert.ToInt32(parameters["ExpNum"]);
            }
            int vipLv = 0;
            if (parameters["VipLv"].Length > 0)
            {
                vipLv = Convert.ToInt32(parameters["VipLv"]);
            }
            int gainBlessing = 0;
            if (parameters["GainBlessing"].Length > 0)
            {
                gainBlessing = Convert.ToInt32(parameters["GainBlessing"]);
            }
            int honourNum = 0;
            if (parameters["HonourNum"].Length > 0)
            {
                honourNum = Convert.ToInt32(parameters["HonourNum"]);
            }
            string mailContent = Convert.ToString(parameters["MailContent"]);
            int opUserID = Convert.ToInt32(parameters["OpUserID"]);
            //var cacheSetUserItem = new GameDataCacheSet<UserItemPackage>();
            var cacheSetItemInfo = new ShareCacheStruct<ItemBaseInfo>();
            var itemArray = itemPackage.Split(',');
            foreach (string str in UserList)
            {
                try
                {
                    int userID = str.Trim().ToInt();

                    var user = new GameDataCacheSet<GameUser>().FindKey(str);
                    if(user!=null)
                    {
                        user.GiftGold = MathUtils.Addition(user.GiftGold, gold);
                        user.ObtainNum = MathUtils.Addition(user.ObtainNum, obtainNum);
                        user.EnergyNum = MathUtils.Addition(user.EnergyNum, energyNum);
                        user.GameCoin = MathUtils.Addition(user.GameCoin, gameCoin);
                        user.ExpNum = MathUtils.Addition(user.ExpNum, expNum);
                        user.HonourNum = MathUtils.Addition(user.HonourNum, honourNum);
                    }

                    foreach (var item in itemArray)
                    {
                        if(item.Split('=').Length==2)
                        {
                            var itemInfo = cacheSetItemInfo.FindKey(item.Split('=')[0]);
                            if(itemInfo!=null)
                            {
                                UserItemHelper.AddUserItem(str, item.Split('=')[0].ToInt(), item.Split('=')[1].ToInt());
                            }
                        }
                    }
                    Guid newGuid = Guid.NewGuid();
                    UserTakePrize userPrizeLog = new UserTakePrize
                    {
                        ID = newGuid.ToString(),
                        UserID = userID,
                        ObtainNum = obtainNum,
                        EnergyNum = energyNum,
                        GameCoin = gameCoin,
                        Gold = gold,
                        ExpNum = expNum,
                        VipLv = vipLv,
                        GainBlessing = gainBlessing,
                        ItemPackage = itemPackage,
                        CrystalPackage = crystalList,
                        SparePackage = sparePackage,
                        EnchantPackage = enchantPackage,
                        MailContent = mailContent,
                        IsTasked = false,
                        TaskDate = MathUtils.SqlMinDate,
                        OpUserID = opUserID,
                        CreateDate = DateTime.Now,
                        HonourNum = honourNum,
                        Items = itemPackage,

                    };
                    var cacheSet = new ShareCacheStruct<UserTakePrize>();
                    cacheSet.Add(userPrizeLog, GameEnvironment.CacheGlobalPeriod);
                    cacheSet.Update();
                    PutCrystal(crystalList.Split(','), str);

                    // 发送系统信件
                    UserMail userMail = new UserMail(newGuid);
                    userMail.UserId = userID;
                    userMail.MailType = (int)MailType.System;
                    userMail.Title = LanguageManager.GetLang().St_SystemMailTitle;
                    userMail.Content = mailContent;
                    userMail.SendDate = DateTime.Now;
                    TjxMailService mailService=new TjxMailService(user);
                    mailService.Send(userMail);
                }
                catch (Exception ex)
                {
                    new BaseLog().SaveLog(ex);
                }
            }
        }
        public override void Process(JsonParameter[] paramList)
        {
            JsonParameterList parameters = JsonParameter.Convert(paramList);
            string            op         = parameters["op"];

            string[] UserList       = Convert.ToString(parameters["UserID"]).Split(new char[] { ',' });
            string   itemPackage    = Convert.ToString(parameters["Item"]);
            string   crystalList    = Convert.ToString(parameters["Crystal"]);
            string   sparePackage   = Convert.ToString(parameters["SparePackage"]);
            string   enchantPackage = Convert.ToString(parameters["EnchantPackage"]);

            int obtainNum = 0;

            if (parameters["ObtainNum"].Length > 0)
            {
                obtainNum = Convert.ToInt32(parameters["ObtainNum"]);
            }
            short energyNum = 0;

            if (parameters["EnergyNum"].Length > 0)
            {
                energyNum = Convert.ToInt16(parameters["EnergyNum"]);
            }
            int gameCoin = 0;

            if (parameters["GameCoin"].Length > 0)
            {
                gameCoin = Convert.ToInt32(parameters["GameCoin"]);
            }
            int gold = 0;

            if (parameters["Gold"].Length > 0)
            {
                gold = Convert.ToInt32(parameters["Gold"]);
            }
            int expNum = 0;

            if (parameters["ExpNum"].Length > 0)
            {
                expNum = Convert.ToInt32(parameters["ExpNum"]);
            }
            int vipLv = 0;

            if (parameters["VipLv"].Length > 0)
            {
                vipLv = Convert.ToInt32(parameters["VipLv"]);
            }
            int gainBlessing = 0;

            if (parameters["GainBlessing"].Length > 0)
            {
                gainBlessing = Convert.ToInt32(parameters["GainBlessing"]);
            }
            int honourNum = 0;

            if (parameters["HonourNum"].Length > 0)
            {
                honourNum = Convert.ToInt32(parameters["HonourNum"]);
            }
            string mailContent = Convert.ToString(parameters["MailContent"]);
            int    opUserID    = Convert.ToInt32(parameters["OpUserID"]);
            //var cacheSetUserItem = new GameDataCacheSet<UserItemPackage>();
            var cacheSetItemInfo = new ShareCacheStruct <ItemBaseInfo>();
            var itemArray        = itemPackage.Split(',');

            foreach (string str in UserList)
            {
                try
                {
                    int userID = str.Trim().ToInt();


                    var user = new GameDataCacheSet <GameUser>().FindKey(str);
                    if (user != null)
                    {
                        user.GiftGold  = MathUtils.Addition(user.GiftGold, gold);
                        user.ObtainNum = MathUtils.Addition(user.ObtainNum, obtainNum);
                        user.EnergyNum = MathUtils.Addition(user.EnergyNum, energyNum);
                        user.GameCoin  = MathUtils.Addition(user.GameCoin, gameCoin);
                        user.ExpNum    = MathUtils.Addition(user.ExpNum, expNum);
                        user.HonourNum = MathUtils.Addition(user.HonourNum, honourNum);
                    }


                    foreach (var item in itemArray)
                    {
                        if (item.Split('=').Length == 2)
                        {
                            var itemInfo = cacheSetItemInfo.FindKey(item.Split('=')[0]);
                            if (itemInfo != null)
                            {
                                UserItemHelper.AddUserItem(str, item.Split('=')[0].ToInt(), item.Split('=')[1].ToInt());
                            }
                        }
                    }
                    Guid          newGuid      = Guid.NewGuid();
                    UserTakePrize userPrizeLog = new UserTakePrize
                    {
                        ID             = newGuid.ToString(),
                        UserID         = userID,
                        ObtainNum      = obtainNum,
                        EnergyNum      = energyNum,
                        GameCoin       = gameCoin,
                        Gold           = gold,
                        ExpNum         = expNum,
                        VipLv          = vipLv,
                        GainBlessing   = gainBlessing,
                        ItemPackage    = itemPackage,
                        CrystalPackage = crystalList,
                        SparePackage   = sparePackage,
                        EnchantPackage = enchantPackage,
                        MailContent    = mailContent,
                        IsTasked       = false,
                        TaskDate       = MathUtils.SqlMinDate,
                        OpUserID       = opUserID,
                        CreateDate     = DateTime.Now,
                        HonourNum      = honourNum,
                        Items          = itemPackage,
                    };
                    var cacheSet = new ShareCacheStruct <UserTakePrize>();
                    cacheSet.Add(userPrizeLog);
                    cacheSet.Update();
                    PutCrystal(crystalList.Split(','), str);

                    // 发送系统信件
                    UserMail userMail = new UserMail(newGuid);
                    userMail.UserId   = userID;
                    userMail.MailType = (int)MailType.System;
                    userMail.Title    = LanguageManager.GetLang().St_SystemMailTitle;
                    userMail.Content  = mailContent;
                    userMail.SendDate = DateTime.Now;
                    TjxMailService mailService = new TjxMailService(user);
                    mailService.Send(userMail);
                }
                catch (Exception ex)
                {
                    new BaseLog().SaveLog(ex);
                }
            }
        }