Bladeren bron

处理端外通知发送时间的问题

Li 2 jaren geleden
bovenliggende
commit
8b417cdac6

+ 5 - 5
TEAMModelBI/Controllers/BICommon/BINoticeController.cs

@@ -135,11 +135,11 @@ namespace TEAMModelBI.Controllers.BICommon
                 jsonElement.TryGetProperty("schoolIds", out JsonElement _schoolIds);
                 jsonElement.TryGetProperty("areaIds", out JsonElement _areaIds);
                 if (!jsonElement.TryGetProperty("crowdType", out JsonElement _crowdType)) return BadRequest();
-                jsonElement.TryGetProperty("sendTime", out JsonElement sendTime);
+                if(!jsonElement.TryGetProperty("sendTime", out JsonElement sendTime)) return BadRequest();
                 jsonElement.TryGetProperty("source", out JsonElement source);
 
                 var cosmosClient = _azureCosmos.GetCosmosClient();
-                DateTimeOffset dateTime = DateTimeOffset.UtcNow;
+                //DateTimeOffset dateTime = DateTimeOffset.UtcNow;
 
                 List<IdNameCode> idNameCodes = new();
                 BINotice bINotice = new();
@@ -147,8 +147,8 @@ namespace TEAMModelBI.Controllers.BICommon
                 List<string> schoolIds = new();
                 List<string> areaIds = new();
 
-                if (!string.IsNullOrEmpty($"{sendTime}"))
-                    dateTime = DateTimeOffset.Parse($"{sendTime}");
+                //if (!string.IsNullOrEmpty($"{sendTime}"))
+                //    dateTime = DateTimeOffset.Parse($"{sendTime}");
                 if (string.IsNullOrEmpty($"{_tmdIds}") && string.IsNullOrEmpty($"{_schoolIds}") && string.IsNullOrEmpty($"{_areaIds}"))
                     return Ok(new { state = RespondCode.ParamsError, msg = "发送人群不能为空" });
                 if (!string.IsNullOrEmpty($"{_tmdIds}"))
@@ -223,7 +223,7 @@ namespace TEAMModelBI.Controllers.BICommon
                     crowd = crowd,
                     crowdIds = tmdIds,
                     createId = _tmdId,
-                    sendTime = dateTime.ToUnixTimeMilliseconds(),//发布时间待解决
+                    sendTime = sendTime.GetInt64(),//发布时间待解决
                     createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
                     source = !string.IsNullOrEmpty($"{source}") ? $"{source}" : "BI"
                 };

+ 2 - 0
TEAMModelBI/Controllers/BITest/TestController.cs

@@ -1663,7 +1663,9 @@ namespace TEAMModelBI.Controllers.BITest
             };
 
             var artTerm = DenseMatrix.OfColumns(doubs);
+            //var temp1 = artTerm.SetRow(1, 5);
 
+            var temp = artTerm.SubMatrix(1, 5, 0, artTerm.ColumnCount);
 
             List<List<double>> doubles = new() {
                 new List<double>() { 6, 5, 4, 3, 2, 1},