Browse Source

update 检查文件是否存在。

CrazyIter_Bin 3 years ago
parent
commit
525ac06b1c

+ 12 - 12
TEAMModelOS.FunctionV4/HttpTrigger/ScsYxptApis.cs

@@ -57,7 +57,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
             Code = "GetProjectInfoByTrainComID";
             Code = "GetProjectInfoByTrainComID";
             parameterMap = new Dictionary<string, object>();
             parameterMap = new Dictionary<string, object>();
             parameterMap.Add("TrainComID", config.trainComID);
             parameterMap.Add("TrainComID", config.trainComID);
-            ScsResult result = new ScsResult { code = Code, title = "5.3.1.1获取项目列表" };
+            ScsResult result = new ScsResult { bizcode = Code, title = "5.3.1.1获取项目列表" };
             try
             try
             {
             {
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
@@ -101,7 +101,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
             Code = "GetProjectInfoByTrainComID";
             Code = "GetProjectInfoByTrainComID";
             parameterMap = new Dictionary<string, object>();
             parameterMap = new Dictionary<string, object>();
             parameterMap.Add("TrainComID", config.trainComID);
             parameterMap.Add("TrainComID", config.trainComID);
-            ScsResult result = new ScsResult { code = Code, title = "5.3.1.1获取项目列表" };
+            ScsResult result = new ScsResult { bizcode = Code, title = "5.3.1.1获取项目列表" };
             try
             try
             {
             {
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
@@ -154,7 +154,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                     {
                     {
                         parameterMap["ProjectID"] = ps.pd;
                         parameterMap["ProjectID"] = ps.pd;
                         parameterMap["ProjectItemID"] = ps.pid;
                         parameterMap["ProjectItemID"] = ps.pid;
-                        ScsResult result = new ScsResult { code = Code, title = " 5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表" };
+                        ScsResult result = new ScsResult { bizcode = Code, title = " 5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表" };
                         result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                         result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                         if (result.result)
                         if (result.result)
                         {
                         {
@@ -209,7 +209,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                     {
                     {
                         parameterMap["ProjectID"] = ps.pd;
                         parameterMap["ProjectID"] = ps.pd;
                         parameterMap["ProjectItemID"] = ps.pid;
                         parameterMap["ProjectItemID"] = ps.pid;
-                        ScsResult result = new ScsResult { code = Code, title = "5.3.1.2获取学员名单" };
+                        ScsResult result = new ScsResult { bizcode = Code, title = "5.3.1.2获取学员名单" };
                         result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                         result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                         if (result.result)
                         if (result.result)
                         {
                         {
@@ -268,7 +268,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                         parameterMap["ProjectItemID"] = ps.pid;
                         parameterMap["ProjectItemID"] = ps.pid;
                         parameterMap["SchoolID"] = $"{schoolCode}";
                         parameterMap["SchoolID"] = $"{schoolCode}";
                         parameterMap["School"] = $"{schoolCode}";
                         parameterMap["School"] = $"{schoolCode}";
-                        ScsResult result = new ScsResult { code = Code, title = " 5.3.1.20获取学校设置的可选能力点" };
+                        ScsResult result = new ScsResult { bizcode = Code, title = " 5.3.1.20获取学校设置的可选能力点" };
                         result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                         result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                         if (result.result)
                         if (result.result)
                         {
                         {
@@ -349,7 +349,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                     {
                     {
                         parameterMap["ProjectID"] = ps.pd;
                         parameterMap["ProjectID"] = ps.pd;
                         parameterMap["ProjectItemID"] = ps.pid;
                         parameterMap["ProjectItemID"] = ps.pid;
-                        ScsResult result = new ScsResult { code = Code, title = "5.3.1.19获取项目设置的可选能力点" };
+                        ScsResult result = new ScsResult { bizcode = Code, title = "5.3.1.19获取项目设置的可选能力点" };
                         result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                         result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                         if (result.result)
                         if (result.result)
                         {
                         {
@@ -422,7 +422,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
             parameterMap = new Dictionary<string, object>();
             parameterMap = new Dictionary<string, object>();
             parameterMap.Add("TrainComID", config.trainComID);
             parameterMap.Add("TrainComID", config.trainComID);
             parameterMap.Add("PXID", pxid);
             parameterMap.Add("PXID", pxid);
-            ScsResult result = new ScsResult { code = Code, title = "5.3.1.3通过项目编号获取学员测评能力项V2" };
+            ScsResult result = new ScsResult { bizcode = Code, title = "5.3.1.3通过项目编号获取学员测评能力项V2" };
             try
             try
             {
             {
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
@@ -491,7 +491,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
             parameterMap.Add("TrainComID", config.trainComID);
             parameterMap.Add("TrainComID", config.trainComID);
             parameterMap.Add("Pxid", $"{pxid}");
             parameterMap.Add("Pxid", $"{pxid}");
             parameterMap.Add("Tid", $"{tid}");
             parameterMap.Add("Tid", $"{tid}");
-            ScsResult result = new ScsResult { code = Code, title = "5.3.1.11获取跳转学员信息,用于sso单点,后端验证。" };
+            ScsResult result = new ScsResult { bizcode = Code, title = "5.3.1.11获取跳转学员信息,用于sso单点,后端验证。" };
             try
             try
             {
             {
                 ///{“result”:true,”reason”:null,”content”:”{“PXID”:””,”TID”:””,”TeacherName”:””,”ProjectTitle”:””,”ProjectItemTitle”:””,”CityName”:””,
                 ///{“result”:true,”reason”:null,”content”:”{“PXID”:””,”TID”:””,”TeacherName”:””,”ProjectTitle”:””,”ProjectItemTitle”:””,”CityName”:””,
@@ -821,19 +821,19 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                 }
                 }
                 //推送数据
                 //推送数据
                 UpdateTeacherListSituation = await _thirdApisService.Post(config.url, "UpdateTeacherListSituation", config.passKey, config.privateKey, parameterContent53112);
                 UpdateTeacherListSituation = await _thirdApisService.Post(config.url, "UpdateTeacherListSituation", config.passKey, config.privateKey, parameterContent53112);
-                UpdateTeacherListSituation.code = "UpdateTeacherListSituation";
+                UpdateTeacherListSituation.bizcode = "UpdateTeacherListSituation";
                 UpdateTeacherListSituation.title = "5.3.1.12学员培训基本情况批量回写";
                 UpdateTeacherListSituation.title = "5.3.1.12学员培训基本情况批量回写";
 
 
                 UpdateTeacherListDiagnosis = await _thirdApisService.Post(config.url, "UpdateTeacherListDiagnosis", config.passKey, config.privateKey, parameterContent53113);
                 UpdateTeacherListDiagnosis = await _thirdApisService.Post(config.url, "UpdateTeacherListDiagnosis", config.passKey, config.privateKey, parameterContent53113);
-                UpdateTeacherListDiagnosis.code = "UpdateTeacherListDiagnosis";
+                UpdateTeacherListDiagnosis.bizcode = "UpdateTeacherListDiagnosis";
                 UpdateTeacherListDiagnosis.title = "5.3.1.13学员能力点测评结果批量回写";
                 UpdateTeacherListDiagnosis.title = "5.3.1.13学员能力点测评结果批量回写";
 
 
                 UploadKTSLList = await _thirdApisService.Post(config.url, "UploadKTSLList", config.passKey, config.privateKey, parameterContent53117);
                 UploadKTSLList = await _thirdApisService.Post(config.url, "UploadKTSLList", config.passKey, config.privateKey, parameterContent53117);
-                UploadKTSLList.code = "UploadKTSLList";
+                UploadKTSLList.bizcode = "UploadKTSLList";
                 UploadKTSLList.title = "5.3.1.17学员课堂实录批量回写";
                 UploadKTSLList.title = "5.3.1.17学员课堂实录批量回写";
 
 
                 UploadSBTARPDFListV2 = await _thirdApisService.Post(config.url, "UploadSBTARPDFListV2", config.passKey, config.privateKey, parameterContent53122);
                 UploadSBTARPDFListV2 = await _thirdApisService.Post(config.url, "UploadSBTARPDFListV2", config.passKey, config.privateKey, parameterContent53122);
-                UploadSBTARPDFListV2.code = "UploadSBTARPDFListV2";
+                UploadSBTARPDFListV2.bizcode = "UploadSBTARPDFListV2";
                 UploadSBTARPDFListV2.title = "5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写";
                 UploadSBTARPDFListV2.title = "5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写";
                 results.Add(UpdateTeacherListSituation);
                 results.Add(UpdateTeacherListSituation);
                 results.Add(UpdateTeacherListDiagnosis);
                 results.Add(UpdateTeacherListDiagnosis);

+ 2 - 1
TEAMModelOS.SDK/Models/Service/Third/Sc/ScYxptModel.cs

@@ -226,7 +226,8 @@ namespace TEAMModelOS.SDK.Models
         public bool result { get; set; }
         public bool result { get; set; }
         public string reason { get; set; }
         public string reason { get; set; }
         public string content { get; set; }
         public string content { get; set; }
-        public string code { get; set; }
+        public string bizcode { get; set; }
+        public int  code { get; set; }
         public string title { get; set; }
         public string title { get; set; }
     }
     }
     public class Unbind
     public class Unbind

+ 2 - 1
TEAMModelOS.SDK/Models/Service/Third/ThirdApisService.cs

@@ -24,7 +24,8 @@ namespace TEAMModelOS.SDK
         {
         {
             HttpResponseMessage response=null;
             HttpResponseMessage response=null;
             try {
             try {
-                string Content = AESHelper.AESEncrypt(data.ToJsonString(), privateKey);
+                string json = data.ToJsonString();
+                string Content = AESHelper.AESEncrypt(json, privateKey);
                 string paramStr = "Code={0}&PassKey={1}&Content={2}";
                 string paramStr = "Code={0}&PassKey={1}&Content={2}";
                 string sendMsg = string.Format(paramStr, Code, PassKey, Content);
                 string sendMsg = string.Format(paramStr, Code, PassKey, Content);
                 #region 签名 Signature
                 #region 签名 Signature

+ 64 - 5
TEAMModelOS.SDK/Models/Service/Third/ThirdService.cs

@@ -300,7 +300,8 @@ namespace TEAMModelOS.SDK.Models
 
 
 
 
         //5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写-UploadSBTARPDFListV2
         //5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写-UploadSBTARPDFListV2
-        public   static (int t53122OK, List<KeyValuePair<string, string>> msgs) check53122(TeacherTrain teacherTrain, List<KeyValuePair<string, string>> msgs)
+        public  async static  Task<(int t53122OK, List<KeyValuePair<string, string>> msgs)> check53122(TeacherTrain teacherTrain, List<KeyValuePair<string, string>> msgs,string school,
+            string schoolPrefix,string sas, AzureStorageFactory _azureStorage)
         {
         {
             int t53122OK = 1;
             int t53122OK = 1;
             if (teacherTrain.offlineRecords.Count <= 0)
             if (teacherTrain.offlineRecords.Count <= 0)
@@ -317,7 +318,23 @@ namespace TEAMModelOS.SDK.Models
             if (teacherTrain.offlineReport==null) {
             if (teacherTrain.offlineReport==null) {
                 t53122OK = 0;
                 t53122OK = 0;
                 msgs.Add(new KeyValuePair<string, string>("offlineReport", $"校本研修汇总报告未生成。"));
                 msgs.Add(new KeyValuePair<string, string>("offlineReport", $"校本研修汇总报告未生成。"));
+
+            }
+            List<string> unexistUrl = new List<string>();
+            foreach (var url in hasUrl) {
+                string blobItem = url.url.Replace($"{schoolPrefix}/", "");
+                bool Exist = await _azureStorage.GetBlobContainerClient(school).GetBlobClient(blobItem).ExistsAsync();
+                if (!Exist)
+                {
+                    unexistUrl.Add($"{url.url}?{sas}");
+                }
+            }
+            if (unexistUrl.Any())
+            {
+                t53122OK = 0;
+                msgs.Add(new KeyValuePair<string, string>("offlineRecord-url-unexist", $"校本研修文件不存在,{string.Join("  ,   " ,unexistUrl)}"));
             }
             }
+
             //不需要检查每一个校本研修的文件记录。
             //不需要检查每一个校本研修的文件记录。
             //teacherTrain.offlineRecords.ForEach(x => {
             //teacherTrain.offlineRecords.ForEach(x => {
             //    if (string.IsNullOrEmpty(x.url)) {
             //    if (string.IsNullOrEmpty(x.url)) {
@@ -328,11 +345,12 @@ namespace TEAMModelOS.SDK.Models
             //        msgs.Add(new KeyValuePair<string, string>("offlineRecord-size", $"文件大小"));
             //        msgs.Add(new KeyValuePair<string, string>("offlineRecord-size", $"文件大小"));
             //    }
             //    }
             //});
             //});
-                return (t53122OK, msgs);
+            return (t53122OK, msgs);
         }
         }
 
 
         //5.3.1.17学员课堂实录批量回写-UploadKTSLList
         //5.3.1.17学员课堂实录批量回写-UploadKTSLList
-        public   static (int t53117OK, List<KeyValuePair<string, string>> msgs) check53117(TeacherTrain teacherTrain, List<KeyValuePair<string, string>> msgs)
+        public async  static Task<(int t53117OK, List<KeyValuePair<string, string>> msgs)> check53117(TeacherTrain teacherTrain, List<KeyValuePair<string, string>> msgs, string school,
+            string schoolPrefix, string sas, AzureStorageFactory _azureStorage)
         {
         {
             //校验 基本情况是否满足
             //校验 基本情况是否满足
             int t53117OK = 1;
             int t53117OK = 1;
@@ -354,6 +372,21 @@ namespace TEAMModelOS.SDK.Models
                     msgs.Add(new KeyValuePair<string, string>("teacherClasses", $"课堂实录链接无效"));
                     msgs.Add(new KeyValuePair<string, string>("teacherClasses", $"课堂实录链接无效"));
                 }
                 }
             });
             });
+            List<string> unexistUrl = new List<string>();
+            foreach (var url in teacherTrain.teacherClasses)
+            {
+                string blobItem = url.url.Replace($"{schoolPrefix}/", "");
+                bool Exist = await _azureStorage.GetBlobContainerClient(school).GetBlobClient(blobItem).ExistsAsync();
+                if (!Exist)
+                {
+                    unexistUrl.Add($"{url.url}?{sas}");
+                }
+            }
+            if (unexistUrl.Any())
+            {
+                t53117OK = 0;
+                msgs.Add(new KeyValuePair<string, string>("teacherClasses-url-unexist", $"课堂实录文件不存在,{string.Join("  ,   ", unexistUrl)}"));
+            }
             return (t53117OK, msgs);
             return (t53117OK, msgs);
         }
         }
         //5.3.1.12学员培训基本情况批量回写-UpdateTeacherListSituation
         //5.3.1.12学员培训基本情况批量回写-UpdateTeacherListSituation
@@ -388,7 +421,9 @@ namespace TEAMModelOS.SDK.Models
             return (t53112OK, msgs);
             return (t53112OK, msgs);
         }
         }
         //5.3.1.13学员能力点测评结果批量回写-UpdateTeacherListDiagnosis
         //5.3.1.13学员能力点测评结果批量回写-UpdateTeacherListDiagnosis
-        public  async static Task<(int t53113OK, List<KeyValuePair<string, string>> msgs, List<AbilitySub> abilitySubs)> check53113(AzureCosmosFactory _azureCosmos,TeacherTrain teacherTrain, ScTeacherDiagnosis diagnosis, List<KeyValuePair<string, string>> msgs)
+        public  async static Task<(int t53113OK, List<KeyValuePair<string, string>> msgs, List<AbilitySub> abilitySubs)> check53113(AzureCosmosFactory _azureCosmos,TeacherTrain teacherTrain, ScTeacherDiagnosis diagnosis, 
+            List<KeyValuePair<string, string>> msgs, string school,
+            string schoolPrefix, string sas, AzureStorageFactory _azureStorage)
         {
         {
             //校验 基本情况是否满足
             //校验 基本情况是否满足
             int t53113OK = 1;
             int t53113OK = 1;
@@ -480,6 +515,7 @@ namespace TEAMModelOS.SDK.Models
                                     //不足三个的则需要记录
                                     //不足三个的则需要记录
                                     if (uploaded.Count < 3) {
                                     if (uploaded.Count < 3) {
                                         t53113OK = 0;
                                         t53113OK = 0;
+                                        ///少于三个的,需要判断另外的不满足情况的
                                         abilitySubs.RemoveAll(x => x.uploads.Count > 0);
                                         abilitySubs.RemoveAll(x => x.uploads.Count > 0);
                                         abilitySubs.ForEach(ab => {
                                         abilitySubs.ForEach(ab => {
                                            var x =  teacherTrain.currency.teacherAilities.Find(x => x.id.Equals(ab.id));
                                            var x =  teacherTrain.currency.teacherAilities.Find(x => x.id.Equals(ab.id));
@@ -506,7 +542,30 @@ namespace TEAMModelOS.SDK.Models
                                                 msgs.Add(new KeyValuePair<string, string>("xzscore", $"认证材料,没有完成小组评:{x.no},{x.name},{x.xzscore}"));
                                                 msgs.Add(new KeyValuePair<string, string>("xzscore", $"认证材料,没有完成小组评:{x.no},{x.name},{x.xzscore}"));
                                             }
                                             }
                                         });
                                         });
-
+                                    }
+                                     //检查已经上传的文件是否正确。
+                                     foreach(AbilitySub abilitySub in uploaded)
+                                    {
+                                        //当前能力点上传的文件是否完全有效
+                                        bool isAllRight = true;
+                                        List<string> urlUn = new List<string>();
+                                        foreach (var subUpload in abilitySub.uploads)
+                                        {
+                                            foreach (var url in subUpload.urls)
+                                            {
+                                                string blobItem = url.url.Replace($"{schoolPrefix}/", "");
+                                                bool Exist = await _azureStorage.GetBlobContainerClient(school).GetBlobClient(blobItem).ExistsAsync();
+                                                // List<string> items = await _azureStorage.GetBlobContainerClient(item.school).ExistsAsync(blobItem);
+                                                if (!Exist)
+                                                {
+                                                    isAllRight = false;
+                                                    urlUn.Add($"{url.url}?{sas}");
+                                                }
+                                            }
+                                        }
+                                        if (isAllRight) { 
+                                        
+                                        }
                                     }
                                     }
                                 }
                                 }
 
 

+ 1 - 1
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -33,7 +33,7 @@
     <PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
     <PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
     <PackageReference Include="NUnit" Version="3.13.2" />
     <PackageReference Include="NUnit" Version="3.13.2" />
     <PackageReference Include="PinYinConverterCore" Version="1.0.2" />
     <PackageReference Include="PinYinConverterCore" Version="1.0.2" />
-    <PackageReference Include="StackExchange.Redis" Version="2.5.43" />
+    <PackageReference Include="StackExchange.Redis" Version="2.6.45" />
     <PackageReference Include="SvgNet" Version="2.2.2" />
     <PackageReference Include="SvgNet" Version="2.2.2" />
     <PackageReference Include="System.Drawing.Common" Version="6.0.0" />
     <PackageReference Include="System.Drawing.Common" Version="6.0.0" />
     <PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="2.0.0-preview" />
     <PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="2.0.0-preview" />

+ 25 - 25
TEAMModelOS/Controllers/Third/Sc/ScApiController.cs

@@ -93,7 +93,7 @@ namespace TEAMModelOS.Controllers
             Dictionary<string, object> parameterMap = new Dictionary<string, object>();
             Dictionary<string, object> parameterMap = new Dictionary<string, object>();
             parameterMap.Add("TrainComID", scsyxptConfig.trainComID);
             parameterMap.Add("TrainComID", scsyxptConfig.trainComID);
             ScsResult GetProjectInfoByTrainComID = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetProjectInfoByTrainComID = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetProjectInfoByTrainComID.code = Code;
+            GetProjectInfoByTrainComID.bizcode = Code;
             GetProjectInfoByTrainComID.title = "5.3.1.1获取项目列表";
             GetProjectInfoByTrainComID.title = "5.3.1.1获取项目列表";
 
 
 
 
@@ -106,7 +106,7 @@ namespace TEAMModelOS.Controllers
                 { "ProjectItemID", "1131" }
                 { "ProjectItemID", "1131" }
             };
             };
             ScsResult GetSchoolList1 = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetSchoolList1 = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetSchoolList1.code = Code;
+            GetSchoolList1.bizcode = Code;
             GetSchoolList1.title = "5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表";
             GetSchoolList1.title = "5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表";
 
 
             // 5.3.1.19获取项目设置的可选能力点,
             // 5.3.1.19获取项目设置的可选能力点,
@@ -118,7 +118,7 @@ namespace TEAMModelOS.Controllers
                 { "ProjectItemID", "1086" }
                 { "ProjectItemID", "1086" }
             };
             };
             ScsResult GetProjectDiagnosis = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetProjectDiagnosis = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetProjectDiagnosis.code = Code;
+            GetProjectDiagnosis.bizcode = Code;
             GetProjectDiagnosis.title = "5.3.1.19获取项目设置的可选能力点";
             GetProjectDiagnosis.title = "5.3.1.19获取项目设置的可选能力点";
             // 补充
             // 补充
             //  5.3.1.3通过项目编号获取学员测评能力项,需要确认每个教师是是否一样。
             //  5.3.1.3通过项目编号获取学员测评能力项,需要确认每个教师是是否一样。
@@ -131,7 +131,7 @@ namespace TEAMModelOS.Controllers
                 { "PXID", "242849" }
                 { "PXID", "242849" }
             };
             };
             ScsResult GetDiagnosisListByProject_V2 = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetDiagnosisListByProject_V2 = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetDiagnosisListByProject_V2.code = Code;
+            GetDiagnosisListByProject_V2.bizcode = Code;
             GetDiagnosisListByProject_V2.title = "5.3.1.3通过项目编号获取学员测评能力项V2";
             GetDiagnosisListByProject_V2.title = "5.3.1.3通过项目编号获取学员测评能力项V2";
 
 
 
 
@@ -144,7 +144,7 @@ namespace TEAMModelOS.Controllers
                 { "ProjectItemID", "1086" }
                 { "ProjectItemID", "1086" }
             };
             };
             ScsResult GetTeachersListByProject = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetTeachersListByProject = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetTeachersListByProject.code = Code;
+            GetTeachersListByProject.bizcode = Code;
 
 
 
 
             GetTeachersListByProject.title = "5.3.1.2获取学员名单"; return Ok(GetProjectInfoByTrainComID);
             GetTeachersListByProject.title = "5.3.1.2获取学员名单"; return Ok(GetProjectInfoByTrainComID);
@@ -156,7 +156,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("Pxid", "254175");
             parameterMap.Add("Pxid", "254175");
             parameterMap.Add("Tid", "422152");
             parameterMap.Add("Tid", "422152");
             ScsResult GetSingleTeacherByProject = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetSingleTeacherByProject = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetSingleTeacherByProject.code = Code;
+            GetSingleTeacherByProject.bizcode = Code;
             GetSingleTeacherByProject.title = "5.3.1.11获取跳转学员信息";
             GetSingleTeacherByProject.title = "5.3.1.11获取跳转学员信息";
 
 
             return Ok(new { GetSingleTeacherByProject, GetProjectDiagnosis });
             return Ok(new { GetSingleTeacherByProject, GetProjectDiagnosis });
@@ -172,7 +172,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("ProjectItemID", "24");
             parameterMap.Add("ProjectItemID", "24");
             parameterMap.Add("PXID", "65321");
             parameterMap.Add("PXID", "65321");
             ScsResult GetDiagnosisListByProject = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetDiagnosisListByProject = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetDiagnosisListByProject.code = Code;
+            GetDiagnosisListByProject.bizcode = Code;
             GetDiagnosisListByProject.title = "5.3.1.3通过项目编号获取学员测评能力项";
             GetDiagnosisListByProject.title = "5.3.1.3通过项目编号获取学员测评能力项";
 
 
 
 
@@ -185,7 +185,7 @@ namespace TEAMModelOS.Controllers
             //parameterMap.Add("ProjectItemID", "22");
             //parameterMap.Add("ProjectItemID", "22");
             parameterMap.Add("PXID", "244188");
             parameterMap.Add("PXID", "244188");
             ScsResult GetDiagnosisListByProject_V2T = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetDiagnosisListByProject_V2T = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetDiagnosisListByProject_V2T.code = Code;
+            GetDiagnosisListByProject_V2T.bizcode = Code;
             GetDiagnosisListByProject_V2T.title = "5.3.1.3通过项目编号获取学员测评能力项V2";
             GetDiagnosisListByProject_V2T.title = "5.3.1.3通过项目编号获取学员测评能力项V2";
 
 
             ScsResult UpdateTeacherSituation = null;
             ScsResult UpdateTeacherSituation = null;
@@ -202,7 +202,7 @@ namespace TEAMModelOS.Controllers
                 parameterMap.Add("ResearchText", "");//学习成果描述,字符长度<=300
                 parameterMap.Add("ResearchText", "");//学习成果描述,字符长度<=300
                 parameterMap.Add("ComPassed", "1");//0、未认定  1、合格  2、优秀  3、不合格  4、其他
                 parameterMap.Add("ComPassed", "1");//0、未认定  1、合格  2、优秀  3、不合格  4、其他
                 UpdateTeacherSituation = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
                 UpdateTeacherSituation = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-                UpdateTeacherSituation.code = Code;
+                UpdateTeacherSituation.bizcode = Code;
                 UpdateTeacherSituation.title = "5.3.1.4学员培训基本情况回写";
                 UpdateTeacherSituation.title = "5.3.1.4学员培训基本情况回写";
             }
             }
             catch (Exception ex) { }
             catch (Exception ex) { }
@@ -230,7 +230,7 @@ namespace TEAMModelOS.Controllers
                 pfileMapA.Add("fileType", "pdf");
                 pfileMapA.Add("fileType", "pdf");
                 pfilesA.Add(pfileMapA);
                 pfilesA.Add(pfileMapA);
                 UpdateTeacherDiagnosis = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
                 UpdateTeacherDiagnosis = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-                UpdateTeacherDiagnosis.code = Code;
+                UpdateTeacherDiagnosis.bizcode = Code;
                 UpdateTeacherDiagnosis.title = "5.3.1.5学员能力点测评结果回写";
                 UpdateTeacherDiagnosis.title = "5.3.1.5学员能力点测评结果回写";
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -243,7 +243,7 @@ namespace TEAMModelOS.Controllers
             parameterMap = new Dictionary<string, object>();
             parameterMap = new Dictionary<string, object>();
             parameterMap.Add("TrainComID", trainComID);
             parameterMap.Add("TrainComID", trainComID);
             ScsResult GetDiagnosisDic = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetDiagnosisDic = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetDiagnosisDic.code = Code;
+            GetDiagnosisDic.bizcode = Code;
             GetDiagnosisDic.title = "5.3.1.6获取能力测评体系字典值数据";
             GetDiagnosisDic.title = "5.3.1.6获取能力测评体系字典值数据";
 
 
 
 
@@ -253,7 +253,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("TrainComID", trainComID);
             parameterMap.Add("TrainComID", trainComID);
             parameterMap.Add("DiagnosisDicID", "3");
             parameterMap.Add("DiagnosisDicID", "3");
             ScsResult GetDiagnosisItemDic = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetDiagnosisItemDic = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetDiagnosisItemDic.code = Code;
+            GetDiagnosisItemDic.bizcode = Code;
             GetDiagnosisItemDic.title = "5.3.1.7获取能力测评评价类型字典值数据";
             GetDiagnosisItemDic.title = "5.3.1.7获取能力测评评价类型字典值数据";
 
 
 
 
@@ -263,7 +263,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("TrainComID", trainComID);
             parameterMap.Add("TrainComID", trainComID);
             parameterMap.Add("DiagnosisItemID", "4");
             parameterMap.Add("DiagnosisItemID", "4");
             ScsResult GetchoiceDic = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetchoiceDic = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetchoiceDic.code = Code;
+            GetchoiceDic.bizcode = Code;
             GetchoiceDic.title = "5.3.1.8获取能力测评评价类型细则字典值数据";
             GetchoiceDic.title = "5.3.1.8获取能力测评评价类型细则字典值数据";
 
 
 
 
@@ -273,7 +273,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("TrainComID", trainComID);
             parameterMap.Add("TrainComID", trainComID);
             parameterMap.Add("PXID", "65321");
             parameterMap.Add("PXID", "65321");
             ScsResult GetTeacherInfoByPXID = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetTeacherInfoByPXID = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetTeacherInfoByPXID.code = Code;
+            GetTeacherInfoByPXID.bizcode = Code;
             GetTeacherInfoByPXID.title = "5.3.1.9根据培训ID与机构ID获取老师信息";
             GetTeacherInfoByPXID.title = "5.3.1.9根据培训ID与机构ID获取老师信息";
 
 
 
 
@@ -285,7 +285,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("SchoolID", "220913");
             parameterMap.Add("SchoolID", "220913");
             parameterMap.Add("Type", "0");
             parameterMap.Add("Type", "0");
             ScsResult GetSchoolPlanBySchoolID = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetSchoolPlanBySchoolID = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetSchoolPlanBySchoolID.code = Code;
+            GetSchoolPlanBySchoolID.bizcode = Code;
             GetSchoolPlanBySchoolID.title = "5.3.1.10根据培训项目ID与学校ID获取学校方案";
             GetSchoolPlanBySchoolID.title = "5.3.1.10根据培训项目ID与学校ID获取学校方案";
 
 
 
 
@@ -340,7 +340,7 @@ namespace TEAMModelOS.Controllers
                     //list.Add(parameterMapData);
                     //list.Add(parameterMapData);
                 }
                 }
                 UpdateTeacherListSituation = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
                 UpdateTeacherListSituation = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
-                UpdateTeacherListSituation.code = Code;
+                UpdateTeacherListSituation.bizcode = Code;
                 UpdateTeacherListSituation.title = "5.3.1.12学员培训基本情况批量回写";
                 UpdateTeacherListSituation.title = "5.3.1.12学员培训基本情况批量回写";
             }
             }
             catch (Exception ex) { }
             catch (Exception ex) { }
@@ -418,7 +418,7 @@ namespace TEAMModelOS.Controllers
                 //    list.Add(parameterMapData);
                 //    list.Add(parameterMapData);
                 //}
                 //}
                 UpdateTeacherListDiagnosis = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
                 UpdateTeacherListDiagnosis = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
-                UpdateTeacherListDiagnosis.code = Code;
+                UpdateTeacherListDiagnosis.bizcode = Code;
                 UpdateTeacherListDiagnosis.title = "5.3.1.13学员能力点测评结果批量回写";
                 UpdateTeacherListDiagnosis.title = "5.3.1.13学员能力点测评结果批量回写";
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -441,7 +441,7 @@ namespace TEAMModelOS.Controllers
                 parameterMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
                 parameterMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
                 parameterMap.Add("fileType", "pdf");
                 parameterMap.Add("fileType", "pdf");
                 UploadSBTARPDF = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
                 UploadSBTARPDF = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-                UploadSBTARPDF.code = Code;
+                UploadSBTARPDF.bizcode = Code;
                 UploadSBTARPDF.title = "5.3.1.14学员校本研修PDF回写";
                 UploadSBTARPDF.title = "5.3.1.14学员校本研修PDF回写";
             }
             }
             catch (Exception ex)
             catch (Exception ex)
@@ -479,7 +479,7 @@ namespace TEAMModelOS.Controllers
                     list.Add(parameterMapData);
                     list.Add(parameterMapData);
                 }
                 }
                 UploadSBTARPDFList = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
                 UploadSBTARPDFList = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
-                UploadSBTARPDFList.code = Code;
+                UploadSBTARPDFList.bizcode = Code;
                 UploadSBTARPDFList.title = "5.3.1.15学员校本教研PDF批量回写";
                 UploadSBTARPDFList.title = "5.3.1.15学员校本教研PDF批量回写";
             }
             }
             catch (Exception ex) { }
             catch (Exception ex) { }
@@ -499,7 +499,7 @@ namespace TEAMModelOS.Controllers
                 parameterMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
                 parameterMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
                 parameterMap.Add("fileType", "mp4");
                 parameterMap.Add("fileType", "mp4");
                 UploadKTSL = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
                 UploadKTSL = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-                UploadKTSL.code = Code;
+                UploadKTSL.bizcode = Code;
                 UploadKTSL.title = "5.3.1.16学员课堂实录回写";
                 UploadKTSL.title = "5.3.1.16学员课堂实录回写";
             }
             }
             catch (Exception ex) { }
             catch (Exception ex) { }
@@ -537,7 +537,7 @@ namespace TEAMModelOS.Controllers
                     list.Add(parameterMapData);
                     list.Add(parameterMapData);
                 }
                 }
                 UploadKTSLList = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
                 UploadKTSLList = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
-                UploadKTSLList.code = Code;
+                UploadKTSLList.bizcode = Code;
                 UploadKTSLList.title = "5.3.1.17学员课堂实录批量回写";
                 UploadKTSLList.title = "5.3.1.17学员课堂实录批量回写";
 
 
             }
             }
@@ -550,7 +550,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("ProjectID", "22");
             parameterMap.Add("ProjectID", "22");
             parameterMap.Add("ProjectItemID", "24");
             parameterMap.Add("ProjectItemID", "24");
             ScsResult GetSchoolList = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetSchoolList = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetSchoolList.code = Code;
+            GetSchoolList.bizcode = Code;
             GetSchoolList.title = "5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表";
             GetSchoolList.title = "5.3.1.18根据机构ID、项目ID、子项目ID返回学校列表";
 
 
 
 
@@ -566,7 +566,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("ProjectItemID", "21");
             parameterMap.Add("ProjectItemID", "21");
             parameterMap.Add("SchoolID", "200001");
             parameterMap.Add("SchoolID", "200001");
             ScsResult GetSchoolDiagnosis = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetSchoolDiagnosis = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetSchoolDiagnosis.code = Code;
+            GetSchoolDiagnosis.bizcode = Code;
             GetSchoolDiagnosis.title = "5.3.1.20获取学校设置的可选能力点";
             GetSchoolDiagnosis.title = "5.3.1.20获取学校设置的可选能力点";
 
 
             // 5.3.1.21分页获取学员名单
             // 5.3.1.21分页获取学员名单
@@ -578,7 +578,7 @@ namespace TEAMModelOS.Controllers
             parameterMap.Add("curPage", "1");
             parameterMap.Add("curPage", "1");
             parameterMap.Add("pageSize", "10");
             parameterMap.Add("pageSize", "10");
             ScsResult GetTeachersPageListByProject = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
             ScsResult GetTeachersPageListByProject = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterMap);
-            GetTeachersPageListByProject.code = Code;
+            GetTeachersPageListByProject.bizcode = Code;
             GetTeachersPageListByProject.title = "5.3.1.21分页获取学员名单";
             GetTeachersPageListByProject.title = "5.3.1.21分页获取学员名单";
 
 
             // 5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写
             // 5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写
@@ -633,7 +633,7 @@ namespace TEAMModelOS.Controllers
                 list.Add(parameterMapData);
                 list.Add(parameterMapData);
             }
             }
             ScsResult UploadSBTARPDFListV2 = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
             ScsResult UploadSBTARPDFListV2 = await _scsApisService.Post(scsyxptConfig.url, Code, scsyxptConfig.passKey, scsyxptConfig.privateKey, parameterContent);
-            UploadSBTARPDFListV2.code = Code;
+            UploadSBTARPDFListV2.bizcode = Code;
             UploadSBTARPDFListV2.title = "5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写";
             UploadSBTARPDFListV2.title = "5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写";
 
 
 
 

+ 1 - 1
TEAMModelOS/Controllers/Third/Sc/ScDataInitController.cs

@@ -95,7 +95,7 @@ namespace TEAMModelOS.Controllers.Third
             {
             {
                 Dictionary<string, object> parameterMap = new Dictionary<string, object>();
                 Dictionary<string, object> parameterMap = new Dictionary<string, object>();
                 parameterMap.Add("TrainComID", config.trainComID);
                 parameterMap.Add("TrainComID", config.trainComID);
-                ScsResult result = new ScsResult { code = Code, title = "5.3.1.1获取项目列表" };
+                ScsResult result = new ScsResult { bizcode = Code, title = "5.3.1.1获取项目列表" };
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                 result = await _thirdApisService.Post(config.url, Code, config.passKey, config.privateKey, parameterMap);
                 List<ScProject> projects = result.content.ToObject<List<ScProject>>(new JsonSerializerOptions { PropertyNameCaseInsensitive = false });
                 List<ScProject> projects = result.content.ToObject<List<ScProject>>(new JsonSerializerOptions { PropertyNameCaseInsensitive = false });
                 List<ScProject> scProjects = await table.FindListByDict<ScProject>(new Dictionary<string, object> { { Constant.PartitionKey, "ScProject" }, { "trainComID", $"{config.trainComID}" } });
                 List<ScProject> scProjects = await table.FindListByDict<ScProject>(new Dictionary<string, object> { { Constant.PartitionKey, "ScProject" }, { "trainComID", $"{config.trainComID}" } });

+ 52 - 32
TEAMModelOS/Controllers/Third/Sc/ScDataPushController.cs

@@ -31,15 +31,15 @@ namespace TEAMModelOS.Controllers
  
  
         public IConfiguration _configuration { get; set; }
         public IConfiguration _configuration { get; set; }
 
 
-        //private readonly ThirdApisService _thirdApisService;
-        public ScDataPushController( AzureCosmosFactory azureCosmos,   AzureStorageFactory azureStorage,  IConfiguration configuration)
+        private readonly ThirdApisService _thirdApisService;
+        public ScDataPushController(ThirdApisService thirdApisService, AzureCosmosFactory azureCosmos,   AzureStorageFactory azureStorage,  IConfiguration configuration)
         {
         {
             _azureCosmos = azureCosmos;
             _azureCosmos = azureCosmos;
            
            
             _azureStorage = azureStorage;
             _azureStorage = azureStorage;
           
           
             _configuration = configuration;
             _configuration = configuration;
-           // _thirdApisService = thirdApisService;
+            _thirdApisService = thirdApisService;
         }
         }
      
      
         [ProducesDefaultResponseType]
         [ProducesDefaultResponseType]
@@ -94,6 +94,9 @@ namespace TEAMModelOS.Controllers
             Dictionary<string, Dictionary<string, object>> pushDatas = new Dictionary<string, Dictionary<string, object>>();
             Dictionary<string, Dictionary<string, object>> pushDatas = new Dictionary<string, Dictionary<string, object>>();
             List<Dictionary<string, object>> dicts = new List<Dictionary<string, object>>();
             List<Dictionary<string, object>> dicts = new List<Dictionary<string, object>>();
             int pages = (trains.Count + 19) / 20; //pages = (total + max -1) / max;
             int pages = (trains.Count + 19) / 20; //pages = (total + max -1) / max;
+
+            var teammodelossas= _azureStorage.GetBlobContainerSAS99Year("teammodelos", Azure.Storage.Sas.BlobContainerSasPermissions.Read);
+            var schoolsas = _azureStorage.GetBlobContainerSAS99Year($"{school}", Azure.Storage.Sas.BlobContainerSasPermissions.Read);
             for (int i = 0; i < pages; i++)
             for (int i = 0; i < pages; i++)
             {
             {
                 List<TeacherTrain> lists = trains.Skip((i) * 20).Take(20).ToList();
                 List<TeacherTrain> lists = trains.Skip((i) * 20).Take(20).ToList();
@@ -133,6 +136,7 @@ namespace TEAMModelOS.Controllers
                 dicts.Add(parameterContent53113);
                 dicts.Add(parameterContent53113);
                 dicts.Add(parameterContent53117);
                 dicts.Add(parameterContent53117);
                 dicts.Add(parameterContent53122);
                 dicts.Add(parameterContent53122);
+                
                 foreach (var x in lists)
                 foreach (var x in lists)
                 {
                 {
                     List<KeyValuePair<string, string>> msgs = new List<KeyValuePair<string, string>>();
                     List<KeyValuePair<string, string>> msgs = new List<KeyValuePair<string, string>>();
@@ -144,9 +148,9 @@ namespace TEAMModelOS.Controllers
                         string jsonTech = scTeacherDiagnoses.ToJsonString();
                         string jsonTech = scTeacherDiagnoses.ToJsonString();
                         ScTeacherDiagnosis diagnosis = scTeacherDiagnoses.Find(x => x.RowKey.Equals($"{t.PXID}"));
                         ScTeacherDiagnosis diagnosis = scTeacherDiagnoses.Find(x => x.RowKey.Equals($"{t.PXID}"));
                         (int t53112OK, List<KeyValuePair<string, string>> msgs53112) = ThirdService. check53112(x, msgs);
                         (int t53112OK, List<KeyValuePair<string, string>> msgs53112) = ThirdService. check53112(x, msgs);
-                        (int t53113OK, List<KeyValuePair<string, string>> msgs53113, List<AbilitySub> abilitySubs) = await ThirdService.check53113(_azureCosmos,x, diagnosis, msgs);
-                        (int t53117OK, List<KeyValuePair<string, string>> msgs53117) = ThirdService.check53117(x, msgs);
-                        (int t53122OK, List<KeyValuePair<string, string>> msgs53122) = ThirdService.check53122(x, msgs);
+                        (int t53113OK, List<KeyValuePair<string, string>> msgs53113, List<AbilitySub> abilitySubs) = await ThirdService.check53113(_azureCosmos,x, diagnosis, msgs, $"{school}", schoolsas.uri, schoolsas.sas, _azureStorage);
+                        (int t53117OK, List<KeyValuePair<string, string>> msgs53117) = await ThirdService.check53117(x, msgs, $"{school}", schoolsas.uri, schoolsas.sas, _azureStorage);
+                        (int t53122OK, List<KeyValuePair<string, string>> msgs53122) = await ThirdService.check53122(x, msgs,$"{school}",schoolsas.uri,schoolsas.sas,_azureStorage);
 
 
                         //5.3.1.12学员培训基本情况批量回写-UpdateTeacherListSituation
                         //5.3.1.12学员培训基本情况批量回写-UpdateTeacherListSituation
                         if (t53112OK == 1)
                         if (t53112OK == 1)
@@ -211,9 +215,9 @@ namespace TEAMModelOS.Controllers
                                     abilitySub.uploads.ForEach(upload => {
                                     abilitySub.uploads.ForEach(upload => {
                                         upload.urls.ForEach(url => {
                                         upload.urls.ForEach(url => {
                                             Dictionary<string, object> pfileMap = new Dictionary<string, object>();
                                             Dictionary<string, object> pfileMap = new Dictionary<string, object>();
-                                            pfileMap.Add("url", url.url);
+                                            pfileMap.Add("url", $"{url.url}?{schoolsas.sas}");
                                             pfileMap.Add("fileName", url.name);
                                             pfileMap.Add("fileName", url.name);
-                                            pfileMap.Add("fileSize", url.size);
+                                            pfileMap.Add("fileSize", $"{url.size}");
                                             pfileMap.Add("md5", url.hash);
                                             pfileMap.Add("md5", url.hash);
                                             string fileext = url.url.Substring(url.url.LastIndexOf(".") > 0 ? url.url.LastIndexOf(".") + 1 : 0);
                                             string fileext = url.url.Substring(url.url.LastIndexOf(".") > 0 ? url.url.LastIndexOf(".") + 1 : 0);
                                             pfileMap.Add("fileType", fileext);
                                             pfileMap.Add("fileType", fileext);
@@ -314,10 +318,10 @@ namespace TEAMModelOS.Controllers
                                 Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
                                 Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
                                 parameterMapData.Add("PXID", $"{t.PXID}");
                                 parameterMapData.Add("PXID", $"{t.PXID}");
                                 parameterMapData.Add("TID", $"{t.TID}");
                                 parameterMapData.Add("TID", $"{t.TID}");
-                                parameterMapData.Add("url", clss.url);//添加访问授权
-                                parameterMapData.Add("url2", clss.url);
+                                parameterMapData.Add("url", $"{clss.url}?{schoolsas.sas}");//添加访问授权
+                                parameterMapData.Add("url2", $"{clss.url}?{schoolsas.sas}");
                                 parameterMapData.Add("fileName", clss.name);
                                 parameterMapData.Add("fileName", clss.name);
-                                parameterMapData.Add("fileSize", clss.size);
+                                parameterMapData.Add("fileSize", $"{clss.size}");
                                 parameterMapData.Add("md5", clss.hash);
                                 parameterMapData.Add("md5", clss.hash);
                                 string fileext = clss.url.Substring(clss.url.LastIndexOf(".") > 0 ? clss.url.LastIndexOf(".") + 1 : 0);
                                 string fileext = clss.url.Substring(clss.url.LastIndexOf(".") > 0 ? clss.url.LastIndexOf(".") + 1 : 0);
                                 parameterMapData.Add("fileType", fileext);
                                 parameterMapData.Add("fileType", fileext);
@@ -342,9 +346,9 @@ namespace TEAMModelOS.Controllers
                                 if (!string.IsNullOrWhiteSpace(record.url))
                                 if (!string.IsNullOrWhiteSpace(record.url))
                                 {
                                 {
                                     Dictionary<string, object> fileMap = new Dictionary<string, object>();
                                     Dictionary<string, object> fileMap = new Dictionary<string, object>();
-                                    fileMap.Add("url", record.url);
+                                    fileMap.Add("url", $"{record.url}?{schoolsas.sas}");
                                     fileMap.Add("fileName", record.name);
                                     fileMap.Add("fileName", record.name);
-                                    fileMap.Add("fileSize", record.size);
+                                    fileMap.Add("fileSize", $"{record.size}");
                                     fileMap.Add("md5", record.hash);
                                     fileMap.Add("md5", record.hash);
                                     string fileext = record.url.Substring(record.url.LastIndexOf(".") > 0 ? record.url.LastIndexOf(".") + 1 : 0);
                                     string fileext = record.url.Substring(record.url.LastIndexOf(".") > 0 ? record.url.LastIndexOf(".") + 1 : 0);
                                     fileMap.Add("fileType", fileext);
                                     fileMap.Add("fileType", fileext);
@@ -353,9 +357,9 @@ namespace TEAMModelOS.Controllers
                             });
                             });
                             if (x.offlineReport != null) {
                             if (x.offlineReport != null) {
                                 Dictionary<string, object> fileMap = new Dictionary<string, object>();
                                 Dictionary<string, object> fileMap = new Dictionary<string, object>();
-                                fileMap.Add("url", x.offlineReport.blob);
+                                fileMap.Add("url", $"{x.offlineReport.blob}?{teammodelossas.sas}");
                                 fileMap.Add("fileName", x.offlineReport.name);
                                 fileMap.Add("fileName", x.offlineReport.name);
-                                fileMap.Add("fileSize", x.offlineReport.size);
+                                fileMap.Add("fileSize", $"{x.offlineReport.size}");
                                 fileMap.Add("md5", x.offlineReport.hash);
                                 fileMap.Add("md5", x.offlineReport.hash);
                                 string fileext = x.offlineReport.extension;
                                 string fileext = x.offlineReport.extension;
                                 fileMap.Add("fileType", fileext);
                                 fileMap.Add("fileType", fileext);
@@ -374,30 +378,46 @@ namespace TEAMModelOS.Controllers
                     }
                     }
                 }
                 }
                 //推送数据
                 //推送数据
-                //UpdateTeacherListSituation = await _thirdApisService.Post(config.url, "UpdateTeacherListSituation", config.passKey, config.privateKey, parameterContent53112);
-                //UpdateTeacherListSituation.code = "UpdateTeacherListSituation";
-                //UpdateTeacherListSituation.title = "5.3.1.12学员培训基本情况批量回写";
+                UpdateTeacherListSituation = await _thirdApisService.Post(config.url, "UpdateTeacherListSituation", config.passKey, config.privateKey, parameterContent53112);
+                UpdateTeacherListSituation.bizcode = "UpdateTeacherListSituation";
+                UpdateTeacherListSituation.title = "5.3.1.12学员培训基本情况批量回写";
 
 
-                //UpdateTeacherListDiagnosis = await _thirdApisService.Post(config.url, "UpdateTeacherListDiagnosis", config.passKey, config.privateKey, parameterContent53113);
-                //UpdateTeacherListDiagnosis.code = "UpdateTeacherListDiagnosis";
-                //UpdateTeacherListDiagnosis.title = "5.3.1.13学员能力点测评结果批量回写";
+                UpdateTeacherListDiagnosis = await _thirdApisService.Post(config.url, "UpdateTeacherListDiagnosis", config.passKey, config.privateKey, parameterContent53113);
+                UpdateTeacherListDiagnosis.bizcode = "UpdateTeacherListDiagnosis";
+                UpdateTeacherListDiagnosis.title = "5.3.1.13学员能力点测评结果批量回写";
 
 
-                //UploadKTSLList = await _thirdApisService.Post(config.url, "UploadKTSLList", config.passKey, config.privateKey, parameterContent53117);
-                //UploadKTSLList.code = "UploadKTSLList";
-                //UploadKTSLList.title = "5.3.1.17学员课堂实录批量回写";
+                UploadKTSLList = await _thirdApisService.Post(config.url, "UploadKTSLList", config.passKey, config.privateKey, parameterContent53117);
+                UploadKTSLList.bizcode = "UploadKTSLList";
+                UploadKTSLList.title = "5.3.1.17学员课堂实录批量回写";
 
 
-                //UploadSBTARPDFListV2 = await _thirdApisService.Post(config.url, "UploadSBTARPDFListV2", config.passKey, config.privateKey, parameterContent53122);
-                //UploadSBTARPDFListV2.code = "UploadSBTARPDFListV2";
-                //UploadSBTARPDFListV2.title = "5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写";
-                //results.Add(UpdateTeacherListSituation);
-                //results.Add(UpdateTeacherListDiagnosis);
-                //results.Add(UploadKTSLList);
-                //results.Add(UploadSBTARPDFListV2);
+                UploadSBTARPDFListV2 = await _thirdApisService.Post(config.url, "UploadSBTARPDFListV2", config.passKey, config.privateKey, parameterContent53122);
+                UploadSBTARPDFListV2.bizcode = "UploadSBTARPDFListV2";
+                UploadSBTARPDFListV2.title = "5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写";
+                results.Add(UpdateTeacherListSituation);
+                results.Add(UpdateTeacherListDiagnosis);
+                results.Add(UploadKTSLList);
+                results.Add(UploadSBTARPDFListV2);
             }
             }
          
          
             return Ok(new { data = new { results, pushDatas, dicts } });        
             return Ok(new { data = new { results, pushDatas, dicts } });        
         }
         }
-
+        [ProducesDefaultResponseType]
+        [HttpPost("sc-check")]
+        public async Task<IActionResult> css(JsonElement json) 
+        {
+            JsonElement areaIdJson = json.GetProperty("areaId");
+            AreaSetting areaSetting = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Normal).ReadItemAsync<AreaSetting>($"{areaIdJson}", new PartitionKey("AreaSetting"));
+            ScAccessConfig config = areaSetting.accessConfig.ToObject<ScAccessConfig>();
+            Dictionary<string, object> parameterContent53123 = new Dictionary<string, object>();
+            parameterContent53123.Add("Content", new { TrainComID = config.trainComID, ProjectID =config.p.First().pd, ProjectItemID =config.p.First().pid, PXID = "277838", TID= "624316" });
+            parameterContent53123.Add("TrainComID", config.trainComID);
+            parameterContent53123.Add("ProjectID", config.p.First().pd);
+            parameterContent53123.Add("ProjectItemID", config.p.First().pid);
+            parameterContent53123.Add("PXID", "277838");
+            parameterContent53123.Add("TID", "624316");
+            ScsResult GetDiagnosisResultByPXIDCommand = await _thirdApisService.Post(config.url, "GetDiagnosisResultByPXIDCommand", config.passKey, config.privateKey, parameterContent53123);
+            return Ok(GetDiagnosisResultByPXIDCommand);
+        }
       
       
     }
     }
 }
 }

+ 46 - 30
TEAMModelOS/Controllers/XTest/FixDataController.cs

@@ -2732,46 +2732,62 @@ namespace TEAMModelOS.Controllers
                 tmdidSchooCode.Add(item);
                 tmdidSchooCode.Add(item);
             }
             }
             var blobclient = _azureStorage.GetBlobContainerClient($"teammodelos");
             var blobclient = _azureStorage.GetBlobContainerClient($"teammodelos");
-           var s= _azureStorage.GetBlobContainerSAS99Year("teammodelos", Azure.Storage.Sas.BlobContainerSasPermissions.Read);
-            string sas= s.sas;
-            foreach (var idcode in tmdidSchooCode) {
+            List<Task> tasks = new List<Task>();
+            tmdidSchooCode.ForEach(idcode =>
+            {
+                tasks.Add(resot(idcode, blobclient));
+            });
+            int pagesize = 500;
+            if (tasks.Count <= pagesize)
+            {
+                await Task.WhenAll(tasks);
+            }
+            else
+            {
+                int pages = (tasks.Count + pagesize) / pagesize; //256是批量操作最大值,pages = (total + max -1) / max;
+                for (int i = 0; i < pages; i++)
+                {
+                    var listssb = tasks.Skip((i) * pagesize).Take(pagesize).ToList();
+                    await Task.WhenAll(listssb);
+                }
+            }
+            return Ok();
+        }
 
 
-                Azure.Response teacherTrainRes = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReadItemStreamAsync(idcode.id, new PartitionKey($"TeacherTrain-{idcode.code}"));
-                if (teacherTrainRes.Status == 200)
+        private async Task resot(IdNameCode idcode, BlobContainerClient blobclient) {
+            Azure.Response teacherTrainRes = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReadItemStreamAsync(idcode.id, new PartitionKey($"TeacherTrain-{idcode.code}"));
+            if (teacherTrainRes.Status == 200)
+            {
+                TeacherTrain teacherTrain = JsonDocument.Parse(teacherTrainRes.Content).RootElement.Deserialize<TeacherTrain>();
+                try
                 {
                 {
-                    TeacherTrain teacherTrain = JsonDocument.Parse(teacherTrainRes.Content).RootElement.Deserialize<TeacherTrain>();
-                    try
+                    if (!string.IsNullOrWhiteSpace(teacherTrain.offlineUrl))
                     {
                     {
-                        if (!string.IsNullOrWhiteSpace(teacherTrain.offlineUrl)) {
-                            BlobDownloadInfo blobDownload = await blobclient.GetBlobClient(teacherTrain.offlineUrl).DownloadAsync(range: new HttpRange(0, 4 * 1048576), rangeGetContentHash: true);
-                            if (blobDownload.Details.ContentHash != null)
-                            {
+                        BlobDownloadInfo blobDownload = await blobclient.GetBlobClient(teacherTrain.offlineUrl).DownloadAsync(range: new HttpRange(0, 4 * 1048576), rangeGetContentHash: true);
+                        if (blobDownload.Details.ContentHash != null)
+                        {
 
 
-                                string hash = Md5Hash.GetbyteToString(blobDownload.Details.ContentHash);
-                                teacherTrain.offlineReport = new Attachment
-                                {
-                                    hash = hash,
-                                    url = teacherTrain.offlineUrl,
-                                    blob = $"{blobclient.Uri}/{teacherTrain.offlineUrl}",
-                                    extension = "pdf",
-                                    name = $"{teacherTrain.nickname}-校本研修汇总报告.pdf",
-                                    type = "doc",
-                                    size = blobDownload.ContentLength
-                                };
-                                await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReplaceItemAsync<TeacherTrain>(teacherTrain, idcode.id, new PartitionKey($"TeacherTrain-{idcode.code}"));
-                            }
+                            string hash = Md5Hash.GetbyteToString(blobDownload.Details.ContentHash);
+                            teacherTrain.offlineReport = new Attachment
+                            {
+                                hash = hash,
+                                url = teacherTrain.offlineUrl,
+                                blob = $"{blobclient.Uri}/{teacherTrain.offlineUrl}",
+                                extension = "pdf",
+                                name = $"{teacherTrain.nickname}-校本研修汇总报告.pdf",
+                                type = "doc",
+                                size = blobDownload.ContentLength
+                            };
+                            await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReplaceItemAsync<TeacherTrain>(teacherTrain, idcode.id, new PartitionKey($"TeacherTrain-{idcode.code}"));
                         }
                         }
                     }
                     }
-                    catch
-                    {
-                    }
+                }
+                catch
+                {
                 }
                 }
             }
             }
-            return Ok();
         }
         }
 
 
-
-
         /// <summary>
         /// <summary>
         /// 修复学校课例及blob计算
         /// 修复学校课例及blob计算
         /// </summary>
         /// </summary>

+ 7 - 7
TEAMModelOS/appsettings.Development.json

@@ -21,19 +21,19 @@
   },
   },
   "Azure": {
   "Azure": {
     "Storage": {
     "Storage": {
-      "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodeltest;AccountKey=O2W2vadCqexDxWO+px+QK7y1sHwsYj8f/WwKLdOdG5RwHgW/Dupz9dDUb4c1gi6ojzQaRpFUeAAmOu4N9E+37A==;EndpointSuffix=core.chinacloudapi.cn"
+      "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelos;AccountKey=Dl04mfZ9hE9cdPVO1UtqTUQYN/kz/dD/p1nGvSq4tUu/4WhiKcNRVdY9tbe8620nPXo/RaXxs+1F9sVrWRo0bg==;EndpointSuffix=core.chinacloudapi.cn"
     },
     },
     "Cosmos": {
     "Cosmos": {
-      "ConnectionString": "AccountEndpoint=https://cdhabookdep-free.documents.azure.cn:443/;AccountKey=JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==;"
+      "ConnectionString": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;"
     },
     },
     "Redis": {
     "Redis": {
-      "ConnectionString": "52.130.252.100:6379,password=habook,ssl=false,abortConnect=False,writeBuffer=10240"
+      "ConnectionString": "CoreRedisCN.redis.cache.chinacloudapi.cn:6380,password=LyJWP1ORJdv+poXWofAF97lhCEQPg1wXWqvtzXGXQuE=,ssl=True,abortConnect=False"
     },
     },
     "ServiceBus": {
     "ServiceBus": {
-      "ConnectionString": "Endpoint=sb://teammodelos.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Sy4h4EQ8zP+7w/lOLi1X3tGord/7ShFHimHs1vC50Dc=",
-      "ActiveTask": "dep-active-task",
-      "ItemCondQueue": "dep-itemcond",
-      "GenPdfQueue": "dep-genpdf"
+      "ConnectionString": "Endpoint=sb://coreiotservicebuscnpro.servicebus.chinacloudapi.cn/;SharedAccessKeyName=TEAMModelOS;SharedAccessKey=llRPBMDJG9w1Nnifj+pGhV0g4H2REcq0PjvX2qqpcOg=",
+      "ActiveTask": "active-task",
+      "ItemCondQueue": "itemcond",
+      "GenPdfQueue": "genpdf"
     }
     }
   },
   },
   "HaBookAuth": {
   "HaBookAuth": {