CrazyIter_Bin 3 years ago
parent
commit
565532191d

+ 7 - 3
TEAMModelOS.SDK/Models/Service/Third/ThirdService.cs

@@ -300,7 +300,7 @@ namespace TEAMModelOS.SDK.Models
 
 
         //5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写-UploadSBTARPDFListV2
-        public  async static  Task<(int t53122OK, List<KeyValuePair<string, string>> msgs)> check53122(TeacherTrain teacherTrain, List<KeyValuePair<string, string>> msgs,string school,
+        public  async static  Task<(int t53122OK, List<KeyValuePair<string, string>> msgs, List<OfflineRecord> allRightOfflineRecords)> check53122(TeacherTrain teacherTrain, List<KeyValuePair<string, string>> msgs,string school,
             string schoolPrefix,string sas, AzureStorageFactory _azureStorage)
         {
             int t53122OK = 1;
@@ -309,6 +309,7 @@ namespace TEAMModelOS.SDK.Models
                 t53122OK = 0;
                 msgs.Add(new KeyValuePair<string, string>("offlineRecord-count", $"文件个数为0"));
             }
+            List<OfflineRecord> allRightOfflineRecords = new List<OfflineRecord>();
             var hasUrl = teacherTrain.offlineRecords.Where(x => !string.IsNullOrWhiteSpace(x.url) && x.size > 0);
             if (!hasUrl.Any())
             {
@@ -328,8 +329,11 @@ namespace TEAMModelOS.SDK.Models
                 {
                     unexistUrl.Add($"{url.url}?{sas}");
                 }
+                else {
+                    allRightOfflineRecords.Add(url);
+                }
             }
-            if (unexistUrl.Any())
+            if (unexistUrl.Any() && hasUrl.Count() > 0 && hasUrl.Count() == unexistUrl.Count)
             {
                 t53122OK = 0;
                 msgs.Add(new KeyValuePair<string, string>("offlineRecord-url-unexist", $"校本研修文件不存在,{string.Join("  ,   " ,unexistUrl)}"));
@@ -345,7 +349,7 @@ namespace TEAMModelOS.SDK.Models
             //        msgs.Add(new KeyValuePair<string, string>("offlineRecord-size", $"文件大小"));
             //    }
             //});
-            return (t53122OK, msgs);
+            return (t53122OK, msgs, allRightOfflineRecords);
         }
 
         //5.3.1.17学员课堂实录批量回写-UploadKTSLList

+ 3 - 2
TEAMModelOS/Controllers/Third/Sc/ScDataPushController.cs

@@ -232,6 +232,7 @@ namespace TEAMModelOS.Controllers
 
                 List<KeyValuePair<string, string>> msgs53117 = null;
                 List<KeyValuePair<string, string>> msgs53122 = null;
+                List<OfflineRecord> allRightOfflineRecords = new List<OfflineRecord>();
                 List<AbilitySub> allRightAbility = new List<AbilitySub>();
                 List<AbilitySub> abilitySubs = new List<AbilitySub>(); 
                 if (!x.pushes.Contains("53112")) {
@@ -250,7 +251,7 @@ namespace TEAMModelOS.Controllers
                 if (!x.pushes.Contains("53122"))
                 {
                     pushAll = false;
-                    (  t53122OK,  msgs53122) = await ThirdService.check53122(x, msgs, $"{school}", schoolsas.uri, schoolsas.sas, _azureStorage);
+                    (  t53122OK,  msgs53122, allRightOfflineRecords) = await ThirdService.check53122(x, msgs, $"{school}", schoolsas.uri, schoolsas.sas, _azureStorage);
                 }
                 if (pushAll== false &&  t53112OK == 1 && t53113OK == 1 && t53117OK == 1 && t53122OK == 1)
                 {
@@ -442,7 +443,7 @@ namespace TEAMModelOS.Controllers
                         parameterMapData.Add("PXID", $"{t.PXID}");
                         parameterMapData.Add("TID", $"{t.TID}");
                         List<Dictionary<string, object>> files = new List<Dictionary<string, object>>();
-                        x.offlineRecords.ForEach(record =>
+                        allRightOfflineRecords.ForEach(record =>
                         {
                             if (!string.IsNullOrWhiteSpace(record.url))
                             {