|
@@ -1585,6 +1585,42 @@ namespace TEAMModelBI.Controllers.BICommon
|
|
return responseMessage;
|
|
return responseMessage;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //BI訊息推送DB記入
|
|
|
|
+ /// <summary>
|
|
|
|
+ ///
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="msgType">訊息類型 mail:郵件、notify:端外、sms:簡訊</param>
|
|
|
|
+ /// <param name="selType">挑選方式 single:個別、multi:批次</param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private async Task CrtBiNoticeData(string msgType, string selType)
|
|
|
|
+ {
|
|
|
|
+ var cosmosClientIes = _azureCosmos.GetCosmosClient(); //IES
|
|
|
|
+ BINotice bINotice = new()
|
|
|
|
+ {
|
|
|
|
+ id = Guid.NewGuid().ToString(),
|
|
|
|
+ code = "BINotice",
|
|
|
|
+ msgType = msgType,
|
|
|
|
+ selType = selType,
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //type = !string.IsNullOrEmpty($"{type}") ? type.GetInt32() : 0,
|
|
|
|
+ //jumpUrl = !string.IsNullOrEmpty($"{jumpUrl}") ? $"{jumpUrl}" : "",
|
|
|
|
+ //callbackName = !string.IsNullOrEmpty($"{callbackName}") ? $"{callbackName}" : "",
|
|
|
|
+ //refuseName = !string.IsNullOrEmpty($"{refuseName}") ? $"{refuseName}" : "",
|
|
|
|
+ //theme = $"{theme}",
|
|
|
|
+ //content = $"{content}",
|
|
|
|
+ //crowd = crowd,
|
|
|
|
+ //crowdIds = idNameCodes.Select(s => $"{s.id}_{tagServiceName}").ToList(),
|
|
|
|
+ //createId = _tmdId,
|
|
|
|
+ //sendTime = sendTime.GetInt64(),//发布时间待解决
|
|
|
|
+ //createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
|
+ //source = !string.IsNullOrEmpty($"{source}") ? $"{source}" : "BI"
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ bINotice = await cosmosClientIes.GetContainer(Constant.TEAMModelOS, "Common").CreateItemAsync<BINotice>(bINotice, new PartitionKey("BINotice"));
|
|
|
|
+ }
|
|
|
|
+
|
|
private string GetDictionaryKeyByValue(Dictionary<string, string> dic, string value)
|
|
private string GetDictionaryKeyByValue(Dictionary<string, string> dic, string value)
|
|
{
|
|
{
|
|
string result = string.Empty;
|
|
string result = string.Empty;
|