|
@@ -1102,419 +1102,425 @@ namespace Util
|
|
|
var recursionFlag = sub.recursionFlag; //是否递归
|
|
|
setLogStep(sub.id, "是否递归", recursionFlag ? "是" : "否");
|
|
|
Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-s4", "接收mq数据日志");
|
|
|
- if(recursionFlag)
|
|
|
+ //TODO: 外部查询数据日志重复,需要精简
|
|
|
+ bool check = prizeSendDo(projectId, sub, prizeObjectId, content, new PriLoopSet(), startData);
|
|
|
+ if(check)
|
|
|
{
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop0", "接收mq数据日志");
|
|
|
- List<QueryCondition> queryCondiDic = condition(sub.id, projectId, Tools.SpitIntArrary(sub.queryTableIdList, ',').ToList(), content, startData);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop1", "接收mq数据日志");
|
|
|
- setLogStep(sub.id, "查询原始数据", queryCondiDic);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop2", "接收mq数据日志");
|
|
|
- var loopSet = loopSetService.GetFirst(m => m.listId == sub.id) ?? new PriLoopSet();
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop3", "接收mq数据日志");
|
|
|
- var recursionStartTable = recursionStartTableService.GetFirst(m => m.listId == sub.id) ?? new PriRecursionStartTable();
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop4", "接收mq数据日志");
|
|
|
- var tableEnName = loopSet.tableEnName; //递归查询表
|
|
|
- var parentField = loopSet.parentField; //父字段
|
|
|
- var sonField = loopSet.sonField; //子字段
|
|
|
- var afterPrizeFlag = loopSet.afterPrizeFlag; //发奖后是否继续
|
|
|
- var db = initDb(loopSet.databaseId);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop5", "接收mq数据日志");
|
|
|
- string objId = prizeObjectId;
|
|
|
- bool op = true;
|
|
|
- int index = 0;
|
|
|
- loopAmount = 0;
|
|
|
- List<Dictionary<string, object>> loopLogDic = new();
|
|
|
- while(!string.IsNullOrEmpty(objId) && objId != "0" && op)
|
|
|
+ List<QueryCondition> rootCondiDic = condition(sub.id, projectId, Tools.SpitIntArrary(sub.queryTableIdList, ',').ToList(), content, startData);
|
|
|
+ if(recursionFlag)
|
|
|
{
|
|
|
- Dictionary<string, object> loopLog = new();
|
|
|
- List<QueryCondition> condiDic = loopCondition(projectId, sub, objId, content);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop-in-1", "接收mq数据日志");
|
|
|
- loopLog.Add("查询" + objId + "匹配数据", condiDic);
|
|
|
- if(condiDic.Count > 0)
|
|
|
- {
|
|
|
- bool prizeFlag = false;
|
|
|
- List<Dictionary<string, object>> logStepDics = new();
|
|
|
- var groupNos = recursionStartConditionService.GetList(m => m.loopSetId == loopSet.id).ToList().Select(m => m.groupNo).Distinct().ToList();
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop-in-2", "接收mq数据日志");
|
|
|
- foreach(var groupNo in groupNos)
|
|
|
- {
|
|
|
- var conditions = recursionStartConditionService.GetList(m => m.loopSetId == loopSet.id && m.groupNo == groupNo);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop-in-11", "接收mq数据日志");
|
|
|
- if(conditions.Count > 0)
|
|
|
- {
|
|
|
- int allCount = conditions.Count; //所有奖励条件数
|
|
|
- int passCount = 0; //通过条件数
|
|
|
- foreach(var condition in conditions)
|
|
|
- {
|
|
|
- if(condition.startIndex <= index)
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop0", "接收mq数据日志");
|
|
|
+ List<QueryCondition> queryCondiDic = condition(sub.id, projectId, Tools.SpitIntArrary(sub.queryTableIdList, ',').ToList(), content, startData);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop1", "接收mq数据日志");
|
|
|
+ // setLogStep(sub.id, "查询原始数据", queryCondiDic);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop2", "接收mq数据日志");
|
|
|
+ var loopSet = loopSetService.GetFirst(m => m.listId == sub.id) ?? new PriLoopSet();
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop3", "接收mq数据日志");
|
|
|
+ var recursionStartTable = recursionStartTableService.GetFirst(m => m.listId == sub.id) ?? new PriRecursionStartTable();
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop4", "接收mq数据日志");
|
|
|
+ var tableEnName = loopSet.tableEnName; //递归查询表
|
|
|
+ var parentField = loopSet.parentField; //父字段
|
|
|
+ var sonField = loopSet.sonField; //子字段
|
|
|
+ var afterPrizeFlag = loopSet.afterPrizeFlag; //发奖后是否继续
|
|
|
+ var db = initDb(loopSet.databaseId);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop5", "接收mq数据日志");
|
|
|
+ string objId = prizeObjectId;
|
|
|
+ bool op = true;
|
|
|
+ int index = 0;
|
|
|
+ loopAmount = 0;
|
|
|
+ List<Dictionary<string, object>> loopLogDic = new();
|
|
|
+ while(!string.IsNullOrEmpty(objId) && objId != "0" && op)
|
|
|
+ {
|
|
|
+ Dictionary<string, object> loopLog = new();
|
|
|
+ List<QueryCondition> condiDic = loopCondition(projectId, sub, objId, content);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop-in-1", "接收mq数据日志");
|
|
|
+ loopLog.Add("查询" + objId + "匹配数据", condiDic);
|
|
|
+ if(condiDic.Count > 0)
|
|
|
+ {
|
|
|
+ bool prizeFlag = false;
|
|
|
+ List<Dictionary<string, object>> logStepDics = new();
|
|
|
+ var groupNos = recursionStartConditionService.GetList(m => m.loopSetId == loopSet.id).ToList().Select(m => m.groupNo).Distinct().ToList();
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop-in-2", "接收mq数据日志");
|
|
|
+ foreach(var groupNo in groupNos)
|
|
|
+ {
|
|
|
+ var conditions = recursionStartConditionService.GetList(m => m.loopSetId == loopSet.id && m.groupNo == groupNo);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop-in-11", "接收mq数据日志");
|
|
|
+ if(conditions.Count > 0)
|
|
|
+ {
|
|
|
+ int allCount = conditions.Count; //所有奖励条件数
|
|
|
+ int passCount = 0; //通过条件数
|
|
|
+ foreach(var condition in conditions)
|
|
|
{
|
|
|
- Dictionary<string, object> logStepDic = new();
|
|
|
-
|
|
|
- var returnFieldId = condition.returnFieldId; //条件返回字段
|
|
|
- returnFieldId = MatchExpressionVal(returnFieldId);
|
|
|
- var fieldQueryKind = condition.fieldQueryKind; //匹配条件
|
|
|
- var fieldQueryModel = condition.fieldQueryModel; //匹配方式
|
|
|
- var fieldQueryValue = condition.fieldQueryValue; //匹配值
|
|
|
- var fieldQueryValueType = condition.fieldQueryValueType; //匹配值类型
|
|
|
-
|
|
|
- string checkObj = "";
|
|
|
- string checkTitle = "";
|
|
|
- if(returnFieldId.Contains(","))
|
|
|
+ if(condition.startIndex <= index)
|
|
|
{
|
|
|
- string[] returnFieldIdList = returnFieldId.Split(',');
|
|
|
- foreach(string subField in returnFieldIdList)
|
|
|
+ Dictionary<string, object> logStepDic = new();
|
|
|
+
|
|
|
+ var returnFieldId = condition.returnFieldId; //条件返回字段
|
|
|
+ returnFieldId = MatchExpressionVal(returnFieldId);
|
|
|
+ var fieldQueryKind = condition.fieldQueryKind; //匹配条件
|
|
|
+ var fieldQueryModel = condition.fieldQueryModel; //匹配方式
|
|
|
+ var fieldQueryValue = condition.fieldQueryValue; //匹配值
|
|
|
+ var fieldQueryValueType = condition.fieldQueryValueType; //匹配值类型
|
|
|
+
|
|
|
+ string checkObj = "";
|
|
|
+ string checkTitle = "";
|
|
|
+ if(returnFieldId.Contains(","))
|
|
|
{
|
|
|
- string val = GetQueryTableData(condiDic, subField);
|
|
|
- checkObj += val + ",";
|
|
|
- string title = GetQueryTableTitle(condiDic, subField);
|
|
|
- checkTitle += title + ",";
|
|
|
- }
|
|
|
- checkObj = checkObj.TrimEnd(',');
|
|
|
- checkTitle = checkTitle.TrimEnd(',');
|
|
|
- }
|
|
|
- else if (returnFieldId.Contains("+") || returnFieldId.Contains("-") || returnFieldId.Contains("*") || returnFieldId.Contains("/") || returnFieldId.Contains("(") || returnFieldId.Contains(")"))
|
|
|
- {
|
|
|
- string expresssion = returnFieldId;
|
|
|
- checkTitle = returnFieldId;
|
|
|
- string[] returnFields = returnFieldId.Split(new char[] { '+', '-', '*', '/', '(', ')' });
|
|
|
- foreach(string returnField in returnFields)
|
|
|
- {
|
|
|
- string val = GetQueryTableData(condiDic, returnField);
|
|
|
- expresssion = expresssion.Replace(returnField, val);
|
|
|
-
|
|
|
- string title = GetQueryTableTitle(condiDic, returnField);
|
|
|
- checkTitle = checkTitle.Replace(returnField, title);
|
|
|
- }
|
|
|
- DataTable dt = new();
|
|
|
- checkObj = dt.Compute(expresssion, "false").ToString();
|
|
|
- }
|
|
|
- else if(returnFieldId.StartsWith("val"))
|
|
|
- {
|
|
|
- checkObj = returnFieldId.Replace("val{", "").Replace("}", "");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- checkObj = GetQueryTableData(condiDic, returnFieldId);
|
|
|
- checkTitle = GetQueryTableTitle(condiDic, returnFieldId);
|
|
|
- }
|
|
|
-
|
|
|
- logStepDic.Add("标题", checkTitle);
|
|
|
- logStepDic.Add("匹配条件", getQueryKind(fieldQueryKind));
|
|
|
- logStepDic.Add("匹配方式", getQueryModel(fieldQueryModel));
|
|
|
- logStepDic.Add("匹配值", fieldQueryValue);
|
|
|
- logStepDic.Add("实际值", checkObj);
|
|
|
-
|
|
|
- var checkVal = fieldQueryValue;
|
|
|
- bool passFlag = false;
|
|
|
-
|
|
|
- if(fieldQueryKind == "1") //模糊匹配
|
|
|
- {
|
|
|
- if(fieldQueryValueType == "text")
|
|
|
- {
|
|
|
- if(checkObj.ToString().Contains(GetExpressionVal(checkVal)))
|
|
|
+ string[] returnFieldIdList = returnFieldId.Split(',');
|
|
|
+ foreach(string subField in returnFieldIdList)
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ string val = GetQueryTableData(condiDic, subField);
|
|
|
+ checkObj += val + ",";
|
|
|
+ string title = GetQueryTableTitle(condiDic, subField);
|
|
|
+ checkTitle += title + ",";
|
|
|
}
|
|
|
+ checkObj = checkObj.TrimEnd(',');
|
|
|
+ checkTitle = checkTitle.TrimEnd(',');
|
|
|
}
|
|
|
- }
|
|
|
- else if(fieldQueryKind == "2") //精确匹配
|
|
|
- {
|
|
|
- if(fieldQueryValueType == "int")
|
|
|
+ else if (returnFieldId.Contains("+") || returnFieldId.Contains("-") || returnFieldId.Contains("*") || returnFieldId.Contains("/") || returnFieldId.Contains("(") || returnFieldId.Contains(")"))
|
|
|
{
|
|
|
- if(int.Parse(Function.CheckInt(checkObj.ToString())) == int.Parse(Function.CheckNum(checkVal)))
|
|
|
+ string expresssion = returnFieldId;
|
|
|
+ checkTitle = returnFieldId;
|
|
|
+ string[] returnFields = returnFieldId.Split(new char[] { '+', '-', '*', '/', '(', ')' });
|
|
|
+ foreach(string returnField in returnFields)
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ string val = GetQueryTableData(condiDic, returnField);
|
|
|
+ expresssion = expresssion.Replace(returnField, val);
|
|
|
+
|
|
|
+ string title = GetQueryTableTitle(condiDic, returnField);
|
|
|
+ checkTitle = checkTitle.Replace(returnField, title);
|
|
|
}
|
|
|
+ DataTable dt = new();
|
|
|
+ checkObj = dt.Compute(expresssion, "false").ToString();
|
|
|
}
|
|
|
- else if(fieldQueryValueType == "number")
|
|
|
+ else if(returnFieldId.StartsWith("val"))
|
|
|
{
|
|
|
- if(decimal.Parse(Function.CheckNum(checkObj.ToString())) == decimal.Parse(Function.CheckNum(checkVal)))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
+ checkObj = returnFieldId.Replace("val{", "").Replace("}", "");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(checkObj.ToString() == GetExpressionVal(checkVal))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
+ checkObj = GetQueryTableData(condiDic, returnFieldId);
|
|
|
+ checkTitle = GetQueryTableTitle(condiDic, returnFieldId);
|
|
|
}
|
|
|
- }
|
|
|
- else if(fieldQueryKind == "3") //范围匹配
|
|
|
- {
|
|
|
- string[] val = checkVal.Split(':');
|
|
|
- string valLeft = val[0];
|
|
|
- string valRight = val[1];
|
|
|
- if(fieldQueryModel == "request_param")
|
|
|
+
|
|
|
+ logStepDic.Add("标题", checkTitle);
|
|
|
+ logStepDic.Add("匹配条件", getQueryKind(fieldQueryKind));
|
|
|
+ logStepDic.Add("匹配方式", getQueryModel(fieldQueryModel));
|
|
|
+ logStepDic.Add("匹配值", fieldQueryValue);
|
|
|
+ logStepDic.Add("实际值", checkObj);
|
|
|
+
|
|
|
+ var checkVal = fieldQueryValue;
|
|
|
+ bool passFlag = false;
|
|
|
+
|
|
|
+ if(fieldQueryKind == "1") //模糊匹配
|
|
|
{
|
|
|
- Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
|
- if(fieldQueryValueType == "number")
|
|
|
+ if(fieldQueryValueType == "text")
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft])) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight])))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft])))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight])))
|
|
|
+ if(checkObj.ToString().Contains(GetExpressionVal(checkVal)))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
}
|
|
|
- else if(fieldQueryValueType == "int")
|
|
|
+ }
|
|
|
+ else if(fieldQueryKind == "2") //精确匹配
|
|
|
+ {
|
|
|
+ if(fieldQueryValueType == "int")
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft])) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight])))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft])))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight])))
|
|
|
+ if(int.Parse(Function.CheckInt(checkObj.ToString())) == int.Parse(Function.CheckNum(checkVal)))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
}
|
|
|
- else if(fieldQueryValueType.StartsWith("date"))
|
|
|
+ else if(fieldQueryValueType == "number")
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight]))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft]))
|
|
|
+ if(decimal.Parse(Function.CheckNum(checkObj.ToString())) == decimal.Parse(Function.CheckNum(checkVal)))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
- else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight]))
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(checkObj.ToString() == GetExpressionVal(checkVal))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if(fieldQueryModel == "fixed_value")
|
|
|
+ else if(fieldQueryKind == "3") //范围匹配
|
|
|
{
|
|
|
- string checkValLeft = valLeft.Replace("#{", "").Replace("}#", "");
|
|
|
- string checkValRight = valRight.Replace("#{", "").Replace("}#", "");
|
|
|
- if(checkValLeft.Contains(",")) checkValLeft = checkValLeft.Split(',')[0];
|
|
|
- if(checkValRight.Contains(",")) checkValRight = checkValRight.Split(',')[0];
|
|
|
- valLeft = GetExpressionVal(valLeft);
|
|
|
- valRight = GetExpressionVal(valRight);
|
|
|
- if(fieldQueryValueType == "number")
|
|
|
+ string[] val = checkVal.Split(':');
|
|
|
+ string valLeft = val[0];
|
|
|
+ string valRight = val[1];
|
|
|
+ if(fieldQueryModel == "request_param")
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight)))
|
|
|
+ Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
|
+ if(fieldQueryValueType == "number")
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft])) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight])))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(req[valLeft])))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && decimal.Parse(checkObj) <= decimal.Parse(Function.CheckNum(req[valRight])))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
}
|
|
|
- else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft)))
|
|
|
+ else if(fieldQueryValueType == "int")
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft])) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight])))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(req[valLeft])))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && int.Parse(checkObj) <= int.Parse(Function.CheckInt(req[valRight])))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
}
|
|
|
- else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight)))
|
|
|
+ else if(fieldQueryValueType.StartsWith("date"))
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ if(!string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight]))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(!string.IsNullOrEmpty(req[valLeft]) && string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) >= DateTime.Parse(req[valLeft]))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(string.IsNullOrEmpty(req[valLeft]) && !string.IsNullOrEmpty(req[valRight]) && DateTime.Parse(checkObj) <= DateTime.Parse(req[valRight]))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- else if(fieldQueryValueType == "int")
|
|
|
+ else if(fieldQueryModel == "fixed_value")
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight)))
|
|
|
+ string checkValLeft = valLeft.Replace("#{", "").Replace("}#", "");
|
|
|
+ string checkValRight = valRight.Replace("#{", "").Replace("}#", "");
|
|
|
+ if(checkValLeft.Contains(",")) checkValLeft = checkValLeft.Split(',')[0];
|
|
|
+ if(checkValRight.Contains(",")) checkValRight = checkValRight.Split(',')[0];
|
|
|
+ valLeft = GetExpressionVal(valLeft);
|
|
|
+ valRight = GetExpressionVal(valRight);
|
|
|
+ if(fieldQueryValueType == "number")
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
}
|
|
|
- else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft)))
|
|
|
+ else if(fieldQueryValueType == "int")
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
}
|
|
|
- else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight)))
|
|
|
+ else if(fieldQueryValueType.StartsWith("date"))
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ if(valLeft == "0") valLeft = "";
|
|
|
+ if(valRight == "0") valRight = "";
|
|
|
+ if(checkObj != "0" && checkObj != "")
|
|
|
+ {
|
|
|
+ if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- else if(fieldQueryValueType.StartsWith("date"))
|
|
|
- {
|
|
|
- if(valLeft == "0") valLeft = "";
|
|
|
- if(valRight == "0") valRight = "";
|
|
|
- if(checkObj != "0" && checkObj != "")
|
|
|
+ else if(fieldQueryModel == "query_field")
|
|
|
+ {
|
|
|
+ valLeft = GetComputeVal(queryCondiDic, valLeft);
|
|
|
+ valRight = GetComputeVal(queryCondiDic, valRight);
|
|
|
+ if(fieldQueryValueType == "number")
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight)))
|
|
|
+ if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight)))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
- else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)))
|
|
|
+ else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft)))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
- else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight)))
|
|
|
+ else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight)))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- else if(fieldQueryModel == "query_field")
|
|
|
- {
|
|
|
- valLeft = GetComputeVal(queryCondiDic, valLeft);
|
|
|
- valRight = GetComputeVal(queryCondiDic, valRight);
|
|
|
- if(fieldQueryValueType == "number")
|
|
|
- {
|
|
|
- if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(checkObj) >= decimal.Parse(Function.CheckNum(valLeft)) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight)))
|
|
|
+ else if(fieldQueryValueType == "int")
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
}
|
|
|
- else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) >= decimal.Parse(Function.CheckNum(valLeft)))
|
|
|
+ else if(fieldQueryValueType.StartsWith("date"))
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ if(valLeft == "0") valLeft = "";
|
|
|
+ if(valRight == "0") valRight = "";
|
|
|
+ if(checkObj != "0" && checkObj != "")
|
|
|
+ {
|
|
|
+ if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight)))
|
|
|
+ {
|
|
|
+ passCount += 1; passFlag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && decimal.Parse(Function.CheckNum(checkObj.ToString())) <= decimal.Parse(Function.CheckNum(valRight)))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(fieldQueryKind == "4") //取反匹配
|
|
|
+ {
|
|
|
+ if(fieldQueryValueType == "int")
|
|
|
+ {
|
|
|
+ if(int.Parse(checkObj) != int.Parse(Function.CheckInt(checkVal)))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
}
|
|
|
- else if(fieldQueryValueType == "int")
|
|
|
+ else if(fieldQueryValueType == "number")
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(checkObj) >= int.Parse(Function.CheckInt(valLeft)) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight)))
|
|
|
+ if(decimal.Parse(checkObj) != decimal.Parse(Function.CheckNum(checkVal)))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
- else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) >= int.Parse(Function.CheckInt(valLeft)))
|
|
|
+ }
|
|
|
+ else if(fieldQueryValueType == "text")
|
|
|
+ {
|
|
|
+ if(checkObj.ToString() != GetExpressionVal(checkVal))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
- else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && int.Parse(Function.CheckInt(checkObj.ToString())) <= int.Parse(Function.CheckInt(valRight)))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(fieldQueryKind == "5" || fieldQueryKind == "6") //数组匹配/排除
|
|
|
+ {
|
|
|
+ string val = ",";
|
|
|
+ string[] valList = checkVal.Split(',');
|
|
|
+ if(fieldQueryModel == "request_param")
|
|
|
+ {
|
|
|
+ Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
|
+ foreach(string subVal in valList)
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ val += req[subVal] + ",";
|
|
|
}
|
|
|
}
|
|
|
- else if(fieldQueryValueType.StartsWith("date"))
|
|
|
+ else if(fieldQueryModel == "fixed_value")
|
|
|
{
|
|
|
- if(valLeft == "0") valLeft = "";
|
|
|
- if(valRight == "0") valRight = "";
|
|
|
- if(checkObj != "0" && checkObj != "")
|
|
|
+ foreach(string subVal in valList)
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight)))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- else if(!string.IsNullOrEmpty(valLeft) && string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) >= DateTime.Parse(GetExpressionVal(valLeft)))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- else if(string.IsNullOrEmpty(valLeft) && !string.IsNullOrEmpty(valRight) && DateTime.Parse(checkObj) <= DateTime.Parse(GetExpressionVal(valRight)))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
+ val += GetExpressionVal(subVal) + ",";
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- else if(fieldQueryKind == "4") //取反匹配
|
|
|
- {
|
|
|
- if(fieldQueryValueType == "int")
|
|
|
- {
|
|
|
- if(int.Parse(checkObj) != int.Parse(Function.CheckInt(checkVal)))
|
|
|
+ else if(fieldQueryModel == "db_field")
|
|
|
{
|
|
|
- passCount += 1; passFlag = true;
|
|
|
+ foreach(string subVal in valList)
|
|
|
+ {
|
|
|
+ val += GetDbExpressionVal(subVal) + ",";
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- else if(fieldQueryValueType == "number")
|
|
|
- {
|
|
|
- if(decimal.Parse(checkObj) != decimal.Parse(Function.CheckNum(checkVal)))
|
|
|
+ if(fieldQueryKind == "5" && val.Contains("," + checkObj.ToString() + ","))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
- }
|
|
|
- else if(fieldQueryValueType == "text")
|
|
|
- {
|
|
|
- if(checkObj.ToString() != GetExpressionVal(checkVal))
|
|
|
+ if(fieldQueryKind == "6" && !val.Contains("," + checkObj.ToString() + ","))
|
|
|
{
|
|
|
passCount += 1; passFlag = true;
|
|
|
}
|
|
|
}
|
|
|
+ logStepDic.Add("状态", passFlag ? "通过" : "未通过");
|
|
|
+ logStepDics.Add(logStepDic);
|
|
|
}
|
|
|
- else if(fieldQueryKind == "5" || fieldQueryKind == "6") //数组匹配/排除
|
|
|
- {
|
|
|
- string val = ",";
|
|
|
- string[] valList = checkVal.Split(',');
|
|
|
- if(fieldQueryModel == "request_param")
|
|
|
- {
|
|
|
- Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
|
- foreach(string subVal in valList)
|
|
|
- {
|
|
|
- val += req[subVal] + ",";
|
|
|
- }
|
|
|
- }
|
|
|
- else if(fieldQueryModel == "fixed_value")
|
|
|
- {
|
|
|
- foreach(string subVal in valList)
|
|
|
- {
|
|
|
- val += GetExpressionVal(subVal) + ",";
|
|
|
- }
|
|
|
- }
|
|
|
- else if(fieldQueryModel == "db_field")
|
|
|
- {
|
|
|
- foreach(string subVal in valList)
|
|
|
- {
|
|
|
- val += GetDbExpressionVal(subVal) + ",";
|
|
|
- }
|
|
|
- }
|
|
|
- if(fieldQueryKind == "5" && val.Contains("," + checkObj.ToString() + ","))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- if(fieldQueryKind == "6" && !val.Contains("," + checkObj.ToString() + ","))
|
|
|
- {
|
|
|
- passCount += 1; passFlag = true;
|
|
|
- }
|
|
|
- }
|
|
|
- logStepDic.Add("状态", passFlag ? "通过" : "未通过");
|
|
|
- logStepDics.Add(logStepDic);
|
|
|
}
|
|
|
+ if(loopSet.conditionMode == "all" && passCount == allCount) prizeFlag = true;
|
|
|
+ else if(loopSet.conditionMode == "one" && passCount >= 1) prizeFlag = true;
|
|
|
+ else if(loopSet.conditionMode == "two" && passCount >= 2) prizeFlag = true;
|
|
|
+ else if(loopSet.conditionMode == "three" && passCount >= 3) prizeFlag = true;
|
|
|
+ // else prizeFlag = false;
|
|
|
}
|
|
|
- if(loopSet.conditionMode == "all" && passCount == allCount) prizeFlag = true;
|
|
|
- else if(loopSet.conditionMode == "one" && passCount >= 1) prizeFlag = true;
|
|
|
- else if(loopSet.conditionMode == "two" && passCount >= 2) prizeFlag = true;
|
|
|
- else if(loopSet.conditionMode == "three" && passCount >= 3) prizeFlag = true;
|
|
|
- // else prizeFlag = false;
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // prizeFlag = false;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ loopLog.Add(objId + "匹配情况", logStepDics);
|
|
|
+ loopLog.Add("匹配结果", prizeFlag);
|
|
|
+ if(prizeFlag)
|
|
|
+ {
|
|
|
+ prizeAck(projectId, sub, prizeObjectId, content, new PriLoopSet(), rootCondiDic, startData);
|
|
|
+ op = afterPrizeFlag;
|
|
|
}
|
|
|
- // else
|
|
|
- // {
|
|
|
- // prizeFlag = false;
|
|
|
- // }
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop-in-3", "接收mq数据日志");
|
|
|
}
|
|
|
- loopLog.Add(objId + "匹配情况", logStepDics);
|
|
|
- loopLog.Add("匹配结果", prizeFlag);
|
|
|
- if(prizeFlag)
|
|
|
+ loopLogDic.Add(loopLog);
|
|
|
+ var parent = db.Ado.GetScalar("select " + parentField + " from " + tableEnName + " where " + sonField + "=" + objId);
|
|
|
+ if(parent != null)
|
|
|
{
|
|
|
- decimal prizeAmt = prizeSendDo(projectId, sub, objId, content, loopSet, startData);
|
|
|
- op = afterPrizeFlag;
|
|
|
+ objId = parent.ToString();
|
|
|
}
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-loop-in-3", "接收mq数据日志");
|
|
|
- }
|
|
|
- loopLogDic.Add(loopLog);
|
|
|
- var parent = db.Ado.GetScalar("select " + parentField + " from " + tableEnName + " where " + sonField + "=" + objId);
|
|
|
- if(parent != null)
|
|
|
- {
|
|
|
- objId = parent.ToString();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- objId = "0";
|
|
|
+ else
|
|
|
+ {
|
|
|
+ objId = "0";
|
|
|
+ }
|
|
|
+ index += 1;
|
|
|
}
|
|
|
- index += 1;
|
|
|
+ setLogStep(sub.id, "向上递归流程", loopLogDic);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ prizeAck(projectId, sub, prizeObjectId, content, new PriLoopSet(), rootCondiDic, startData);
|
|
|
}
|
|
|
- setLogStep(sub.id, "向上递归流程", loopLogDic);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- prizeSendDo(projectId, sub, prizeObjectId, content, new PriLoopSet(), startData);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static decimal loopAmount = 0;
|
|
|
- public static decimal prizeSendDo(int projectId, PriList sub, string prizeObjectId, string content, PriLoopSet set, Dictionary<string, string> startData)
|
|
|
+ public static bool prizeSendDo(int projectId, PriList sub, string prizeObjectId, string content, PriLoopSet set, Dictionary<string, string> startData)
|
|
|
{
|
|
|
var projectService = App.GetService<IPriProjectService>();
|
|
|
var recordService = App.GetService<IPriRecordService>();
|
|
@@ -1523,7 +1529,7 @@ namespace Util
|
|
|
// var queryTableService = App.GetService<IPriQueryTableService>();
|
|
|
var amountSetService = App.GetService<IPriListAmountSetService>();
|
|
|
|
|
|
- var project = projectService.GetFirst(m => m.id == projectId) ?? new PriProject();
|
|
|
+
|
|
|
//查询匹配条件
|
|
|
Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p1", "接收mq数据日志");
|
|
|
List<QueryCondition> condiDic = condition(sub.id, projectId, Tools.SpitIntArrary(sub.queryTableIdList, ',').ToList(), content, startData);
|
|
@@ -1549,7 +1555,7 @@ namespace Util
|
|
|
{
|
|
|
var conditions = conditionService.GetList(m => m.listId == sub.id && m.groupNo == groupNo);
|
|
|
Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p6", "接收mq数据日志");
|
|
|
- setLogStep(sub.id, "发放奖励匹配条件", condiDic);
|
|
|
+ // setLogStep(sub.id, "发放奖励匹配条件", condiDic);
|
|
|
Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p7", "接收mq数据日志");
|
|
|
int allCount = conditions.Count; //所有奖励条件数
|
|
|
int passCount = 0; //通过条件数
|
|
@@ -1895,181 +1901,206 @@ namespace Util
|
|
|
else if(conditionMode == "two" && passCount >= 2) op = true;
|
|
|
else if(conditionMode == "three" && passCount >= 3) op = true;
|
|
|
}
|
|
|
- decimal prizeAmt = 0;
|
|
|
setLogStep(sub.id, "是否通过", op ? "是" : "否");
|
|
|
Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p9", "接收mq数据日志");
|
|
|
- if(op) //满足条件
|
|
|
+ // if(op) //满足条件
|
|
|
+ // {
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if(!sub.recursionFlag)
|
|
|
+ // {
|
|
|
+ setLogStatus(sub.id, op ? 1 : 0);
|
|
|
+ // }
|
|
|
+ return op;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static decimal prizeAck(int projectId, PriList sub, string prizeObjectId, string content, PriLoopSet set, List<QueryCondition> condiDic, Dictionary<string, string> startData)
|
|
|
+ {
|
|
|
+ var projectService = App.GetService<IPriProjectService>();
|
|
|
+ var recordService = App.GetService<IPriRecordService>();
|
|
|
+ var conditionService = App.GetService<IPriConditionService>();
|
|
|
+ var returnFieldService = App.GetService<IPriReturnFieldService>();
|
|
|
+ // var queryTableService = App.GetService<IPriQueryTableService>();
|
|
|
+ var amountSetService = App.GetService<IPriListAmountSetService>();
|
|
|
+
|
|
|
+ var project = projectService.GetFirst(m => m.id == projectId) ?? new PriProject();
|
|
|
+
|
|
|
+ var prizeSourceField = sub.prizeSourceField; //奖励金额来源字段(对应条件匹配返回字段)
|
|
|
+ var prizePercent = sub.prizePercent; //奖励比例
|
|
|
+ var prizeAmount = sub.prizeAmount; //奖励固定值
|
|
|
+ var prizeContent = sub.prizeContent; //奖励内容
|
|
|
+ var conditionMode = sub.conditionMode; //条件模式
|
|
|
+ var recursionFlag = sub.recursionFlag; //是否递归
|
|
|
+ var prizeCode = sub.prizeCode; //奖励代码
|
|
|
+
|
|
|
+ decimal prizeAmt = 0;
|
|
|
+
|
|
|
+ prizeSourceField = MatchExpressionVal(prizeSourceField);
|
|
|
+ bool repeatFlag = sub.repeatFlag;
|
|
|
+ decimal number = 0;
|
|
|
+ if(prizeSourceField.Contains("/"))
|
|
|
{
|
|
|
- bool repeatFlag = sub.repeatFlag;
|
|
|
- decimal number = 0;
|
|
|
- if(prizeSourceField.Contains("/"))
|
|
|
- {
|
|
|
- number = decimal.Parse(prizeSourceField.Split('/')[1]);
|
|
|
- prizeSourceField = prizeSourceField.Split('/')[0];
|
|
|
- }
|
|
|
- string prizeSourceData = "";
|
|
|
- if(prizeSourceField.Contains(","))
|
|
|
- {
|
|
|
- string[] list = prizeSourceField.Split(',');
|
|
|
- foreach(string subField in list)
|
|
|
- {
|
|
|
- string val = GetQueryTableData(condiDic, subField);
|
|
|
- if(subField == val) val = GetStartData(startData, subField);
|
|
|
- prizeSourceData += val + ",";
|
|
|
- }
|
|
|
- prizeSourceData = prizeSourceData.TrimEnd(',');
|
|
|
- }
|
|
|
- else
|
|
|
+ number = decimal.Parse(prizeSourceField.Split('/')[1]);
|
|
|
+ prizeSourceField = prizeSourceField.Split('/')[0];
|
|
|
+ }
|
|
|
+ string prizeSourceData = "";
|
|
|
+ if(prizeSourceField.Contains(","))
|
|
|
+ {
|
|
|
+ string[] list = prizeSourceField.Split(',');
|
|
|
+ foreach(string subField in list)
|
|
|
{
|
|
|
- prizeSourceData = GetQueryTableData(condiDic, prizeSourceField);
|
|
|
+ string val = GetQueryTableData(condiDic, subField);
|
|
|
+ if(subField == val) val = GetStartData(startData, subField);
|
|
|
+ prizeSourceData += val + ",";
|
|
|
}
|
|
|
- if(string.IsNullOrEmpty(prizeSourceData)) prizeSourceData = "0";
|
|
|
- if(prizeSourceField.Contains("/") && number > 0)
|
|
|
+ prizeSourceData = prizeSourceData.TrimEnd(',');
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ prizeSourceData = GetQueryTableData(condiDic, prizeSourceField);
|
|
|
+ }
|
|
|
+ if(string.IsNullOrEmpty(prizeSourceData)) prizeSourceData = "0";
|
|
|
+ if(prizeSourceField.Contains("/") && number > 0)
|
|
|
+ {
|
|
|
+ decimal prizeSourceDataNum = decimal.Parse(prizeSourceData) / number;
|
|
|
+ prizeSourceData = prizeSourceDataNum.ToString("f2");
|
|
|
+ }
|
|
|
+ var amountSet = amountSetService.GetFirst(m => m.listId == sub.id && m.prizeSourceField == prizeSourceData);
|
|
|
+ if(amountSet != null)
|
|
|
+ {
|
|
|
+ prizePercent = amountSet.prizePercent;
|
|
|
+ prizeAmount = amountSet.prizeAmount;
|
|
|
+ prizeCode = amountSet.prizeCode;
|
|
|
+ repeatFlag = amountSet.repeatFlag;
|
|
|
+ }
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p9", "接收mq数据日志");
|
|
|
+
|
|
|
+ if(!prizeSourceData.Contains("$") && !prizeSourceData.Contains("=") && prizeSourceData.Contains(","))
|
|
|
+ {
|
|
|
+ string[] prizeSourceDataList = prizeSourceData.Split(',');
|
|
|
+ string checkField = "";
|
|
|
+ for (int i = 0; i < prizeSourceDataList.Length - 1; i++)
|
|
|
{
|
|
|
- decimal prizeSourceDataNum = decimal.Parse(prizeSourceData) / number;
|
|
|
- prizeSourceData = prizeSourceDataNum.ToString("f2");
|
|
|
+ checkField += prizeSourceDataList[i] + ",";
|
|
|
}
|
|
|
- var amountSet = amountSetService.GetFirst(m => m.listId == sub.id && m.prizeSourceField == prizeSourceData);
|
|
|
+ amountSet = amountSetService.GetFirst(m => m.listId == sub.id && m.prizeSourceField.StartsWith(checkField) && m.prizeSourceField.EndsWith(",%"));
|
|
|
if(amountSet != null)
|
|
|
{
|
|
|
prizePercent = amountSet.prizePercent;
|
|
|
prizeAmount = amountSet.prizeAmount;
|
|
|
prizeCode = amountSet.prizeCode;
|
|
|
repeatFlag = amountSet.repeatFlag;
|
|
|
+ prizeSourceData = prizeSourceDataList[prizeSourceDataList.Length - 1];
|
|
|
}
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p9", "接收mq数据日志");
|
|
|
-
|
|
|
- if(!prizeSourceData.Contains("$") && !prizeSourceData.Contains("=") && prizeSourceData.Contains(","))
|
|
|
+ }
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p10", "接收mq数据日志");
|
|
|
+ string[] prizeSourceFieldList = prizeSourceData.Split(',');
|
|
|
+ var amountSets = amountSetService.GetList(m => m.listId == sub.id && m.prizeSourceField.Contains("${"));
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p11", "接收mq数据日志");
|
|
|
+ foreach(var subAmountSet in amountSets)
|
|
|
+ {
|
|
|
+ string subPrizeSourceField = subAmountSet.prizeSourceField;
|
|
|
+ for (int i = 0; i < prizeSourceFieldList.Length; i++)
|
|
|
{
|
|
|
- string[] prizeSourceDataList = prizeSourceData.Split(',');
|
|
|
- string checkField = "";
|
|
|
- for (int i = 0; i < prizeSourceDataList.Length - 1; i++)
|
|
|
- {
|
|
|
- checkField += prizeSourceDataList[i] + ",";
|
|
|
- }
|
|
|
- amountSet = amountSetService.GetFirst(m => m.listId == sub.id && m.prizeSourceField.StartsWith(checkField) && m.prizeSourceField.EndsWith(",%"));
|
|
|
- if(amountSet != null)
|
|
|
- {
|
|
|
- prizePercent = amountSet.prizePercent;
|
|
|
- prizeAmount = amountSet.prizeAmount;
|
|
|
- prizeCode = amountSet.prizeCode;
|
|
|
- repeatFlag = amountSet.repeatFlag;
|
|
|
- prizeSourceData = prizeSourceDataList[prizeSourceDataList.Length - 1];
|
|
|
- }
|
|
|
+ subPrizeSourceField = subPrizeSourceField.Replace("${" + i + "}", prizeSourceFieldList[i]);
|
|
|
}
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p10", "接收mq数据日志");
|
|
|
- string[] prizeSourceFieldList = prizeSourceData.Split(',');
|
|
|
- var amountSets = amountSetService.GetList(m => m.listId == sub.id && m.prizeSourceField.Contains("${"));
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p11", "接收mq数据日志");
|
|
|
- foreach(var subAmountSet in amountSets)
|
|
|
+ DataTable dt = new();
|
|
|
+ string chk = dt.Compute(subPrizeSourceField, "false").ToString();
|
|
|
+ if(chk == "True")
|
|
|
{
|
|
|
- string subPrizeSourceField = subAmountSet.prizeSourceField;
|
|
|
- for (int i = 0; i < prizeSourceFieldList.Length; i++)
|
|
|
- {
|
|
|
- subPrizeSourceField = subPrizeSourceField.Replace("${" + i + "}", prizeSourceFieldList[i]);
|
|
|
- }
|
|
|
- DataTable dt = new();
|
|
|
- string chk = dt.Compute(subPrizeSourceField, "false").ToString();
|
|
|
- if(chk == "True")
|
|
|
- {
|
|
|
- prizePercent = subAmountSet.prizePercent;
|
|
|
- prizePercent = subAmountSet.prizePercent;
|
|
|
- prizeAmount = subAmountSet.prizeAmount;
|
|
|
- prizeCode = subAmountSet.prizeCode;
|
|
|
- repeatFlag = subAmountSet.repeatFlag;
|
|
|
- prizeSourceData = prizeSourceFieldList[subAmountSet.prizeSourceFieldIndex];
|
|
|
- break;
|
|
|
- }
|
|
|
+ prizePercent = subAmountSet.prizePercent;
|
|
|
+ prizePercent = subAmountSet.prizePercent;
|
|
|
+ prizeAmount = subAmountSet.prizeAmount;
|
|
|
+ prizeCode = subAmountSet.prizeCode;
|
|
|
+ repeatFlag = subAmountSet.repeatFlag;
|
|
|
+ prizeSourceData = prizeSourceFieldList[subAmountSet.prizeSourceFieldIndex];
|
|
|
+ break;
|
|
|
}
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p12", "接收mq数据日志");
|
|
|
-
|
|
|
- if(prizePercent > 0) prizeAmt += decimal.Parse(Function.CheckNum(prizeSourceData)) * prizePercent;
|
|
|
- if(prizeAmount > 0) prizeAmt += prizeAmount;
|
|
|
- decimal getPrizeAmount = prizeAmt;
|
|
|
- if(set.levelDiffFlag) prizeAmt -= loopAmount;
|
|
|
- setLogStep(sub.id, "发放金额", prizeAmt);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p13", "接收mq数据日志");
|
|
|
- if(prizeAmt > 0)
|
|
|
+ }
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p12", "接收mq数据日志");
|
|
|
+
|
|
|
+ if(prizePercent > 0) prizeAmt += decimal.Parse(Function.CheckNum(prizeSourceData)) * prizePercent;
|
|
|
+ if(prizeAmount > 0) prizeAmt += prizeAmount;
|
|
|
+ decimal getPrizeAmount = prizeAmt;
|
|
|
+ if(set.levelDiffFlag) prizeAmt -= loopAmount;
|
|
|
+ setLogStep(sub.id, "发放金额", prizeAmt);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p13", "接收mq数据日志");
|
|
|
+ if(prizeAmt > 0)
|
|
|
+ {
|
|
|
+ prizeAmt = Util.PublicFunction.NumberFormat(prizeAmt);
|
|
|
+ setLogPrizeAmount(sub.id, prizeAmt);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p14", "接收mq数据日志");
|
|
|
+ var req = getRequestParams(projectId, content);
|
|
|
+ // var requestParamField = req[sub.requestParamField];
|
|
|
+ var sendFlag = false;
|
|
|
+ if(!repeatFlag) sendFlag = recordService.Any(m => m.prizeObjId == prizeObjectId && m.listId == sub.id && m.prizeCode == prizeCode && m.requestParamField == content);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p15", "接收mq数据日志");
|
|
|
+ if(!sendFlag && prizeObjectId != "0" && !string.IsNullOrEmpty(prizeObjectId))
|
|
|
{
|
|
|
- prizeAmt = Util.PublicFunction.NumberFormat(prizeAmt);
|
|
|
- setLogPrizeAmount(sub.id, prizeAmt);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p14", "接收mq数据日志");
|
|
|
- var req = getRequestParams(projectId, content);
|
|
|
- // var requestParamField = req[sub.requestParamField];
|
|
|
- var sendFlag = false;
|
|
|
- if(!repeatFlag) sendFlag = recordService.Any(m => m.prizeObjId == prizeObjectId && m.listId == sub.id && m.prizeCode == prizeCode && m.requestParamField == content);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p15", "接收mq数据日志");
|
|
|
- if(!sendFlag && prizeObjectId != "0" && !string.IsNullOrEmpty(prizeObjectId))
|
|
|
- {
|
|
|
- PriRecord item = new PriRecord()
|
|
|
- {
|
|
|
- createDate = DateTime.Now,
|
|
|
- projectId = projectId,
|
|
|
- listId = sub.id,
|
|
|
- prizeAmount = prizeAmt,
|
|
|
- prizeCode = prizeCode,
|
|
|
- prizeObjId = prizeObjectId,
|
|
|
- requestParamField = content,
|
|
|
- batchNo = batchNo,
|
|
|
- };
|
|
|
- recordService.Add(item);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p16", "接收mq数据日志");
|
|
|
- Dictionary<string, object> prizeItem = new Dictionary<string, object>();
|
|
|
- prizeItem.Add("prize_date", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
- prizeItem.Add("prize_name", sub.prizeName);
|
|
|
- prizeItem.Add("prize_code", prizeCode);
|
|
|
- prizeItem.Add("batch_no", batchNo);
|
|
|
- prizeItem.Add("request_param_field", content);
|
|
|
- List<Dictionary<string, object>> prizeItemList = new List<Dictionary<string, object>>();
|
|
|
- Dictionary<string, object> prizeItemSub = new Dictionary<string, object>();
|
|
|
- prizeItemSub.Add("prize_amount", prizeAmt);
|
|
|
- prizeItemSub.Add("prize_obj", prizeObjectId);
|
|
|
- prizeItemList.Add(prizeItemSub);
|
|
|
- prizeItem.Add("prize_list", prizeItemList);
|
|
|
- string prizeOutContent = Newtonsoft.Json.JsonConvert.SerializeObject(prizeItem);
|
|
|
- setLogFieldValue(sub.id, "prizeOutContent", prizeOutContent);
|
|
|
- setLogFieldValue(sub.id, "prizeOutUrl", project.noticeUrl);
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p17", "接收mq数据日志");
|
|
|
- if(project.requestMode == "http" && !string.IsNullOrEmpty(project.noticeUrl))
|
|
|
- {
|
|
|
- int status = -1;
|
|
|
- string noticeJson = Function.PostWebRequest(project.noticeUrl, prizeOutContent, "application/json");
|
|
|
- Function.WriteLog(noticeJson, "通知返回报文");
|
|
|
- JsonData jsonObj = JsonMapper.ToObject(noticeJson);
|
|
|
- if(jsonObj["status"].ToString() == "1")
|
|
|
- {
|
|
|
- status = 1;
|
|
|
- }
|
|
|
- Function.WriteLog(status.ToString(), "通知返回报文");
|
|
|
- var sendItem = recordService.GetFirst(m => m.prizeObjId == prizeObjectId && m.listId == sub.id && m.requestParamField == content);
|
|
|
- if(sendItem != null)
|
|
|
- {
|
|
|
- Function.WriteLog("in", "通知返回报文");
|
|
|
- sendItem.status = status;
|
|
|
- recordService.Update(sendItem);
|
|
|
- Function.WriteLog("end", "通知返回报文");
|
|
|
- }
|
|
|
- }
|
|
|
- else if(project.requestMode == "mq")
|
|
|
- {}
|
|
|
- else if(project.requestMode == "db")
|
|
|
- {
|
|
|
- prizeToDatabase(projectId, sub.id, content, condiDic, prizeAmt, startData); //入库
|
|
|
- }
|
|
|
- Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p18", "接收mq数据日志");
|
|
|
- }
|
|
|
+ PriRecord item = new PriRecord()
|
|
|
+ {
|
|
|
+ createDate = DateTime.Now,
|
|
|
+ projectId = projectId,
|
|
|
+ listId = sub.id,
|
|
|
+ prizeAmount = prizeAmt,
|
|
|
+ prizeCode = prizeCode,
|
|
|
+ prizeObjId = prizeObjectId,
|
|
|
+ requestParamField = content,
|
|
|
+ batchNo = batchNo,
|
|
|
+ };
|
|
|
+ recordService.Add(item);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p16", "接收mq数据日志");
|
|
|
+ Dictionary<string, object> prizeItem = new Dictionary<string, object>();
|
|
|
+ prizeItem.Add("prize_date", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ prizeItem.Add("prize_name", sub.prizeName);
|
|
|
+ prizeItem.Add("prize_code", prizeCode);
|
|
|
+ prizeItem.Add("batch_no", batchNo);
|
|
|
+ prizeItem.Add("request_param_field", content);
|
|
|
+ List<Dictionary<string, object>> prizeItemList = new List<Dictionary<string, object>>();
|
|
|
+ Dictionary<string, object> prizeItemSub = new Dictionary<string, object>();
|
|
|
+ prizeItemSub.Add("prize_amount", prizeAmt);
|
|
|
+ prizeItemSub.Add("prize_obj", prizeObjectId);
|
|
|
+ prizeItemList.Add(prizeItemSub);
|
|
|
+ prizeItem.Add("prize_list", prizeItemList);
|
|
|
+ string prizeOutContent = Newtonsoft.Json.JsonConvert.SerializeObject(prizeItem);
|
|
|
+ setLogFieldValue(sub.id, "prizeOutContent", prizeOutContent);
|
|
|
+ setLogFieldValue(sub.id, "prizeOutUrl", project.noticeUrl);
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p17", "接收mq数据日志");
|
|
|
+ if(project.requestMode == "http" && !string.IsNullOrEmpty(project.noticeUrl))
|
|
|
+ {
|
|
|
+ int status = -1;
|
|
|
+ string noticeJson = Function.PostWebRequest(project.noticeUrl, prizeOutContent, "application/json");
|
|
|
+ Function.WriteLog(noticeJson, "通知返回报文");
|
|
|
+ JsonData jsonObj = JsonMapper.ToObject(noticeJson);
|
|
|
+ if(jsonObj["status"].ToString() == "1")
|
|
|
+ {
|
|
|
+ status = 1;
|
|
|
+ }
|
|
|
+ Function.WriteLog(status.ToString(), "通知返回报文");
|
|
|
+ var sendItem = recordService.GetFirst(m => m.prizeObjId == prizeObjectId && m.listId == sub.id && m.requestParamField == content);
|
|
|
+ if(sendItem != null)
|
|
|
+ {
|
|
|
+ Function.WriteLog("in", "通知返回报文");
|
|
|
+ sendItem.status = status;
|
|
|
+ recordService.Update(sendItem);
|
|
|
+ Function.WriteLog("end", "通知返回报文");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(project.requestMode == "mq")
|
|
|
+ {}
|
|
|
else if(project.requestMode == "db")
|
|
|
{
|
|
|
prizeToDatabase(projectId, sub.id, content, condiDic, prizeAmt, startData); //入库
|
|
|
}
|
|
|
- loopAmount = getPrizeAmount;
|
|
|
+ Function.WriteLog(batchNo + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "-p18", "接收mq数据日志");
|
|
|
+ }
|
|
|
+ else if(project.requestMode == "db")
|
|
|
+ {
|
|
|
+ prizeToDatabase(projectId, sub.id, content, condiDic, prizeAmt, startData); //入库
|
|
|
}
|
|
|
+ loopAmount = getPrizeAmount;
|
|
|
}
|
|
|
-
|
|
|
- // if(!sub.recursionFlag)
|
|
|
- // {
|
|
|
- setLogStatus(sub.id, op ? 1 : 0);
|
|
|
- // }
|
|
|
return prizeAmt;
|
|
|
}
|
|
|
|