|
@@ -36,7 +36,7 @@ namespace Util
|
|
|
//接收入参
|
|
|
public static Dictionary<string, string> getRequestParams(int projectId, string content)
|
|
|
{
|
|
|
- Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
|
+ Dictionary<string, string> dic = new();
|
|
|
JsonData jsonData = JsonMapper.ToObject(content);
|
|
|
var paramService = App.GetService<IPriProjectParamService>();
|
|
|
var paramList = paramService.GetList(m => m.projectId == projectId);
|
|
@@ -69,7 +69,7 @@ namespace Util
|
|
|
//查询条件匹配数据
|
|
|
public static List<QueryCondition> condition(int projectId, List<int> ids, string content)
|
|
|
{
|
|
|
- List<QueryCondition> dic = new List<QueryCondition>();
|
|
|
+ List<QueryCondition> dic = new();
|
|
|
var queryTableService = App.GetService<IPriQueryTableService>();
|
|
|
var queryFieldService = App.GetService<IPriQueryFieldService>();
|
|
|
var returnFieldService = App.GetService<IPriReturnFieldService>();
|
|
@@ -79,7 +79,7 @@ namespace Util
|
|
|
{
|
|
|
//查询返回字段
|
|
|
string fields = "";
|
|
|
- Dictionary<string, string> fieldDic = new Dictionary<string, string>();
|
|
|
+ Dictionary<string, string> fieldDic = new();
|
|
|
var returnFields = returnFieldService.GetList(m => m.queryTableId == queryTable.id);
|
|
|
foreach(var returnField in returnFields)
|
|
|
{
|
|
@@ -342,7 +342,7 @@ namespace Util
|
|
|
//奖励发放对象
|
|
|
public static string prizeObject(int prizeObjectTag, string content)
|
|
|
{
|
|
|
- Dictionary<string, object> dic = new Dictionary<string, object>();
|
|
|
+ Dictionary<string, object> dic = new();
|
|
|
var prizeObjectTableService = App.GetService<IPriPrizeObjectTableService>();
|
|
|
var prizeObjectFieldService = App.GetService<IPriPrizeObjectFieldService>();
|
|
|
//查询表
|
|
@@ -535,7 +535,7 @@ namespace Util
|
|
|
//奖励发放入口
|
|
|
public static string prizeInSet(string queueName)
|
|
|
{
|
|
|
- Dictionary<string, object> dic = new Dictionary<string, object>();
|
|
|
+ Dictionary<string, object> dic = new();
|
|
|
var prizeInSetService = App.GetService<IPriPrizeInSetService>();
|
|
|
//查询表
|
|
|
var prizeInSet = prizeInSetService.GetFirst(m => m.mqQueueName == queueName) ?? new PriPrizeInSet();
|
|
@@ -596,7 +596,7 @@ namespace Util
|
|
|
{
|
|
|
if(condition.startIndex <= index)
|
|
|
{
|
|
|
- Dictionary<string, string> logStepDic = new Dictionary<string, string>();
|
|
|
+ Dictionary<string, string> logStepDic = new();
|
|
|
|
|
|
var returnFieldId = condition.returnFieldId; //条件返回字段
|
|
|
var fieldQueryKind = condition.fieldQueryKind; //匹配条件
|
|
@@ -632,7 +632,7 @@ namespace Util
|
|
|
string title = GetQueryTableTitle(condiDic, returnField);
|
|
|
checkTitle = checkTitle.Replace(returnField, title);
|
|
|
}
|
|
|
- DataTable dt = new DataTable();
|
|
|
+ DataTable dt = new();
|
|
|
checkObj = dt.Compute(expresssion, "false").ToString();
|
|
|
}
|
|
|
else
|
|
@@ -911,7 +911,7 @@ namespace Util
|
|
|
}
|
|
|
}
|
|
|
logStepDic.Add("状态", passFlag ? "通过" : "未通过");
|
|
|
- setLogStep(sub.id, Newtonsoft.Json.JsonConvert.SerializeObject(logStepDic));
|
|
|
+ setLogStep(sub.id, logStepDic);
|
|
|
}
|
|
|
}
|
|
|
if(loopSet.conditionMode == "all" && passCount == allCount) prizeFlag = true;
|
|
@@ -971,10 +971,9 @@ namespace Util
|
|
|
var conditions = conditionService.GetList(m => m.listId == sub.id);
|
|
|
int allCount = conditions.Count; //所有奖励条件数
|
|
|
int passCount = 0; //通过条件数
|
|
|
- List<Dictionary<string, string>> logStepDics = new List<Dictionary<string, string>>();
|
|
|
foreach(var condition in conditions)
|
|
|
{
|
|
|
- Dictionary<string, string> logStepDic = new Dictionary<string, string>();
|
|
|
+ Dictionary<string, string> logStepDic = new();
|
|
|
var returnFieldId = condition.returnFieldId; //条件返回字段
|
|
|
var fieldQueryKind = condition.fieldQueryKind; //匹配条件
|
|
|
var fieldQueryModel = condition.fieldQueryModel; //匹配方式
|
|
@@ -1009,7 +1008,7 @@ namespace Util
|
|
|
string title = GetQueryTableTitle(condiDic, returnField);
|
|
|
checkTitle = checkTitle.Replace(returnField, title);
|
|
|
}
|
|
|
- DataTable dt = new DataTable();
|
|
|
+ DataTable dt = new();
|
|
|
checkObj = dt.Compute(expresssion, "false").ToString();
|
|
|
}
|
|
|
else
|
|
@@ -1295,7 +1294,7 @@ namespace Util
|
|
|
if(!sub.recursionFlag)
|
|
|
{
|
|
|
logStepDic.Add("状态", passFlag ? "通过" : "未通过");
|
|
|
- logStepDics.Add(logStepDic);
|
|
|
+ setLogStep(sub.id, logStepDic);
|
|
|
}
|
|
|
}
|
|
|
bool op = false;
|
|
@@ -1381,7 +1380,6 @@ namespace Util
|
|
|
if(!sub.recursionFlag)
|
|
|
{
|
|
|
setLogStatus(sub.id, op ? 1 : 0);
|
|
|
- setLogStep(sub.id, Newtonsoft.Json.JsonConvert.SerializeObject(logStepDics));
|
|
|
}
|
|
|
return prizeAmt;
|
|
|
}
|
|
@@ -1389,7 +1387,7 @@ namespace Util
|
|
|
//递归条件判断
|
|
|
public static List<QueryCondition> loopCondition(int projectId, PriList sub, string objId, string content)
|
|
|
{
|
|
|
- List<QueryCondition> dic = new List<QueryCondition>();
|
|
|
+ List<QueryCondition> dic = new();
|
|
|
var queryTableService = App.GetService<IPriRecursionStartTableService>();
|
|
|
var queryFieldService = App.GetService<IPriRecursionStartFieldService>();
|
|
|
var queryReturnFieldService = App.GetService<IPriRecursionStartReturnFieldService>();
|
|
@@ -1401,7 +1399,7 @@ namespace Util
|
|
|
{
|
|
|
//查询返回字段
|
|
|
string fields = "1";
|
|
|
- Dictionary<string, string> fieldDic = new Dictionary<string, string>();
|
|
|
+ Dictionary<string, string> fieldDic = new();
|
|
|
var returnFields = queryReturnFieldService.GetList(m => m.objectTableId == queryTable.id);
|
|
|
if(returnFields.Count > 0)
|
|
|
{
|
|
@@ -1633,7 +1631,7 @@ namespace Util
|
|
|
foreach(var prizeInTable in prizeInTables)
|
|
|
{
|
|
|
var db = initDb(prizeInTable.databaseId);
|
|
|
- Dictionary<string, object> doFields = new Dictionary<string, object>();
|
|
|
+ Dictionary<string, object> doFields = new();
|
|
|
//入库字段
|
|
|
var prizeInFields = prizeInFieldService.GetList(m => m.inTableId == prizeInTable.id);
|
|
|
foreach(var prizeInField in prizeInFields)
|
|
@@ -1887,7 +1885,7 @@ namespace Util
|
|
|
expresssion = expresssion.Replace(returnField, val);
|
|
|
}
|
|
|
}
|
|
|
- DataTable dt = new DataTable();
|
|
|
+ DataTable dt = new();
|
|
|
return dt.Compute(expresssion, "false").ToString();
|
|
|
}
|
|
|
return expresssion;
|
|
@@ -1936,13 +1934,13 @@ namespace Util
|
|
|
logService.Update(log);
|
|
|
}
|
|
|
}
|
|
|
- public static void setLogStep(int listId, string step)
|
|
|
+ public static void setLogStep(int listId, Dictionary<string, string> step)
|
|
|
{
|
|
|
var logService = App.GetService<IPriLogService>();
|
|
|
var log = logService.GetFirst(m => m.batchNo == batchNo && m.listId == listId);
|
|
|
if(log != null)
|
|
|
{
|
|
|
- log.stepList += step;
|
|
|
+ log.stepList += Newtonsoft.Json.JsonConvert.SerializeObject(step);
|
|
|
logService.Update(log);
|
|
|
}
|
|
|
}
|