|
@@ -17,7 +17,7 @@ namespace Util
|
|
|
{
|
|
|
batchNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + Function.get_Random(3);
|
|
|
JsonData jsonObj = JsonMapper.ToObject(content);
|
|
|
- string priObjString = prizeInSet(jsonObj["prize_tag"].ToString());
|
|
|
+ string priObjString = prizeInSet(int.Parse(Function.CheckInt(jsonObj["prize_tag"].ToString())));
|
|
|
content = jsonObj["content"].ToString();
|
|
|
if(!string.IsNullOrEmpty(priObjString))
|
|
|
{
|
|
@@ -520,14 +520,18 @@ namespace Util
|
|
|
}
|
|
|
|
|
|
//奖励发放入口
|
|
|
- public static string prizeInSet(string prizeObjectTag)
|
|
|
+ public static string prizeInSet(int prizeObjectTag)
|
|
|
{
|
|
|
Dictionary<string, object> dic = new Dictionary<string, object>();
|
|
|
var prizeInSetService = App.GetService<IPriPrizeInSetService>();
|
|
|
//查询表
|
|
|
- var prizeInSet = prizeInSetService.GetFirst(m => m.prizeListIds == prizeObjectTag) ?? new PriPrizeInSet();
|
|
|
- int projectId = prizeInSet.projectId;
|
|
|
- return prizeInSet.prizeListIds + "|" + projectId;
|
|
|
+ var prizeInSet = prizeInSetService.GetFirst(m => m.id == prizeObjectTag) ?? new PriPrizeInSet();
|
|
|
+ if(prizeInSet.id > 0)
|
|
|
+ {
|
|
|
+ int projectId = prizeInSet.projectId;
|
|
|
+ return prizeInSet.prizeListIds + "|" + projectId;
|
|
|
+ }
|
|
|
+ return "";
|
|
|
}
|
|
|
|
|
|
//奖励列表
|
|
@@ -1003,7 +1007,7 @@ namespace Util
|
|
|
batchNo = batchNo,
|
|
|
});
|
|
|
loopAmount = getPrizeAmount;
|
|
|
- // prizeToDatabase(projectId, content); //入库
|
|
|
+ prizeToDatabase(projectId, sub.id, content); //入库
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1238,14 +1242,14 @@ namespace Util
|
|
|
}
|
|
|
|
|
|
//奖励入库
|
|
|
- public static void prizeToDatabase(int projectId, string content)
|
|
|
+ public static void prizeToDatabase(int projectId, int listId, string content)
|
|
|
{
|
|
|
var prizeInTableService = App.GetService<IPriPrizeInTableService>();
|
|
|
var prizeInFieldService = App.GetService<IPriPrizeInFieldService>();
|
|
|
var prizeInQueryFieldService = App.GetService<IPriPrizeInQueryFieldService>();
|
|
|
|
|
|
//入库表
|
|
|
- var prizeInTables = prizeInTableService.GetList(m => m.projectId == projectId);
|
|
|
+ var prizeInTables = prizeInTableService.GetList(m => m.listId == listId);
|
|
|
foreach(var prizeInTable in prizeInTables)
|
|
|
{
|
|
|
var db = initDb(prizeInTable.databaseId);
|
|
@@ -1262,6 +1266,10 @@ namespace Util
|
|
|
{
|
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
|
fieldQueryValue = req.ContainsKey(fieldQueryValue) ? req[fieldQueryValue] : "0";
|
|
|
+ }
|
|
|
+ else if(fieldQueryModel == "query_field")
|
|
|
+ {
|
|
|
+
|
|
|
}
|
|
|
else if(fieldQueryModel == "fixed_value")
|
|
|
{
|
|
@@ -1425,8 +1433,10 @@ namespace Util
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(prizeInTable.excuteKind == "add") db.Insertable(doFields).ExecuteCommand();
|
|
|
- if(prizeInTable.excuteKind == "update") db.Updateable(doFields).Where("1=1" + condi).ExecuteCommand();
|
|
|
+ if(prizeInTable.excuteKind == "add") db.Insertable(doFields).AS(prizeInTable.tableEnName).ExecuteCommand();
|
|
|
+ if(prizeInTable.excuteKind == "update") db.Updateable(doFields).AS(prizeInTable.tableEnName).Where("1=1" + condi).ExecuteCommand();
|
|
|
+
|
|
|
+ Function.WriteLog(DateTime.Now.ToString() + "\n" + prizeInTable.excuteKind + "\n" + prizeInTable.tableEnName + "\n" + Newtonsoft.Json.JsonConvert.SerializeObject(doFields) + "\n\n", "奖励入库数据");
|
|
|
}
|
|
|
|
|
|
}
|