Browse Source

Merge branch 'develop6.0-tmd' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop6.0-tmd

zhouj1203@hotmail.com 3 years ago
parent
commit
9abe8c4b3d

+ 145 - 47
TEAMModelOS.FunctionV4/HttpTrigger/ScsYxptApis.cs

@@ -522,24 +522,36 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
             List<Dictionary<string, object>> list53112 = new List<Dictionary<string, object>>();
             parameterContent53112.Add("TrainComID", config.trainComID);
             parameterContent53112.Add("List", list53112);
-
-
-
-            //5.3.1.13学员能力点测评结果批量回写-UpdateTeacherListDiagnosis
+             
+            //5.3.1.13学员能力点测评结果批量回写-UpdateTeacherListDiagnosis  300条限制 
             List<TeacherTrain> trains53113OK = new List<TeacherTrain>();
+            ScsResult UpdateTeacherListDiagnosis = null;
+            Dictionary<string, object> parameterContent53113 = new Dictionary<string, object>();
+            List<Dictionary<string, object>> list53113 = new List<Dictionary<string, object>>();
+            parameterContent53113.Add("TrainComID", config.trainComID);
+            parameterContent53113.Add("List", list53113);
 
-            //5.3.1.17学员课堂实录批量回写-UploadKTSLList
+            //5.3.1.17学员课堂实录批量回写-UploadKTSLList     300条限制 
             List<TeacherTrain> trains53117OK = new List<TeacherTrain>();
+            ScsResult UploadKTSLList = null;
+            Dictionary<string, object> parameterContent53117 = new Dictionary<string, object>();
+            List<Dictionary<string, object>> list53117 = new List<Dictionary<string, object>>();
+            parameterContent53117.Add("TrainComID", config.trainComID);
+            parameterContent53117.Add("List", list53117);
 
-            //5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写-UploadSBTARPDFListV2
+            //5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写-UploadSBTARPDFListV2   100条限制
             List<TeacherTrain> trains53122OK = new List<TeacherTrain>();
-
-            trains.ForEach(x => {
+            ScsResult UploadSBTARPDFListV2 = null;
+            Dictionary<string, object> parameterContent53122 = new Dictionary<string, object>();
+            List<Dictionary<string, object>> list53122 = new List<Dictionary<string, object>>();
+            parameterContent53122.Add("TrainComID", config.trainComID);
+            parameterContent53122.Add("List", list53122);
+            foreach (var x in trains) {
                 List<KeyValuePair<string, string>> msgs = new List<KeyValuePair<string, string>>();
-                List<ScTeacher> teacher =  scTeachers.FindAll(t => t.tmdid.Equals(x.id) );
-                teacher.ForEach(async t => {
-                    ScTeacherDiagnosis diagnosis= scTeacherDiagnoses.Find(x => x.RowKey.Equals(t.PXID));
-                   
+                List<ScTeacher> teacher = scTeachers.FindAll(t => t.tmdid.Equals(x.id));
+                foreach (var t in teacher) {
+                    ScTeacherDiagnosis diagnosis = scTeacherDiagnoses.Find(x => x.RowKey.Equals(t.PXID));
+
                     (int t53112OK, List<KeyValuePair<string, string>> msgs53112) = check53112(x, msgs);
                     (int t53113OK, List<KeyValuePair<string, string>> msgs53113, List<AbilitySub> abilitySubs) = await check53113(x, diagnosis, msgs);
                     (int t53117OK, List<KeyValuePair<string, string>> msgs53117) = check53117(x, msgs);
@@ -560,7 +572,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                         string ComPassed = "0";
                         switch (x.finalScore)
                         {
-                            case -2 :
+                            case -2:
                                 ComPassed = "4";
                                 break;
                             case -1:
@@ -586,49 +598,135 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                     //5.3.1.13学员能力点测评结果批量回写-UpdateTeacherListDiagnosis
                     if (t53113OK == 1)
                     {
+                        x.currency.teacherAilities.ForEach(a => {
+                            Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
+                            parameterMapData.Add("PXID", $"{t.PXID}");
+                            parameterMapData.Add("TID", $"{t.TID}");
+                            parameterMapData.Add("DiagnosisNum", $"{a.no}");
+                            //0"未认定", 1"合格", 2"优秀", 3"不合格"
+                            //系统 -1 未认定,0 不合格,1 合格,2 优秀
+                            string zpscore = "0";
+                            switch (a.zpscore)
+                            {
+                                case -1:
+                                    zpscore = "0";
+                                    break;
+                                case 0:
+                                    zpscore = "3";
+                                    break;
+                                case 1:
+                                    zpscore = "1";
+                                    break;
+                                case 2:
+                                    zpscore = "2";
+                                    break;
+                                default:
+                                    zpscore = "0";
+                                    break;
+                            }
+                            string hpscore = "0";
+                            switch (a.hpscore)
+                            {
+                                case -1:
+                                    hpscore = "0";
+                                    break;
+                                case 0:
+                                    hpscore = "3";
+                                    break;
+                                case 1:
+                                    hpscore = "1";
+                                    break;
+                                case 2:
+                                    hpscore = "2";
+                                    break;
+                                default:
+                                    hpscore = "0";
+                                    break;
+                            }
+                            string xzpresult = "0";
+                            switch (a.xzscore)
+                            {
+                                case -1:
+                                    xzpresult = "0";
+                                    break;
+                                case 0:
+                                    xzpresult = "3";
+                                    break;
+                                case 1:
+                                    xzpresult = "1";
+                                    break;
+                                case 2:
+                                    xzpresult = "2";
+                                    break;
+                                default:
+                                    xzpresult = "0";
+                                    break;
+                            }
+                            parameterMapData.Add("zpresult", zpscore);
+                            parameterMapData.Add("hpresult", hpscore);
+                            parameterMapData.Add("xzpresult", xzpresult);
+                            List<Dictionary<string, object>> pfiles = new List<Dictionary<string, object>>();
+                            parameterMapData.Add("pfiles", pfiles);
 
+                            AbilitySub abilitySub = abilitySubs.Find(sub => sub.id.Equals(a.id));
+                            if (abilitySub != null)
+                            {
+                                abilitySub.uploads.ForEach(upload => {
+                                    upload.urls.ForEach(url => {
+                                        Dictionary<string, object> pfileMap = new Dictionary<string, object>();
+                                        pfileMap.Add("url", url.url);
+                                        pfileMap.Add("fileName", url.name);
+                                        pfileMap.Add("fileSize", url.size);
+                                        pfileMap.Add("md5", url.hash);
+                                        string fileext = url.url.Substring(url.url.LastIndexOf(".") > 0 ? url.url.LastIndexOf(".") + 1 : 0);
+                                        pfileMap.Add("fileType", fileext);
+                                        pfiles.Add(pfileMap);
+                                    });
+                                });
+                            }
+                            list53113.Add(parameterMapData);
+                        });
                     }
                     //5.3.1.17学员课堂实录批量回写-UploadKTSLList
                     if (t53117OK == 1)
                     {
-
-                    }   
+                        x.teacherClasses.ForEach(clss =>
+                        {
+                            Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
+                            parameterMapData.Add("PXID", $"{t.PXID}");
+                            parameterMapData.Add("TID", $"{t.TID}");
+                            parameterMapData.Add("url", clss.url);//添加访问授权
+                            parameterMapData.Add("url2", clss.url);
+                            parameterMapData.Add("fileName", clss.name);
+                            parameterMapData.Add("fileSize", clss.size);
+                            parameterMapData.Add("md5", clss.hash);
+                            string fileext = clss.url.Substring(clss.url.LastIndexOf(".") > 0 ? clss.url.LastIndexOf(".") + 1 : 0);
+                            parameterMapData.Add("fileType", fileext);
+                            list53117.Add(parameterMapData);
+                        });
+                    }
                     //5.3.1.22学员校本教研PDF(每人可以返回多条)批量回写-UploadSBTARPDFListV2
                     if (t53122OK == 1)
                     {
-
+                        Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
+                        parameterMapData.Add("PXID", $"{t.PXID}");
+                        parameterMapData.Add("TID", $"{t.TID}");
+                        List<Dictionary<string, object>> files = new List<Dictionary<string, object>>();
+                        x.offlineRecords.ForEach(record => {
+                            Dictionary<string, object> fileMap = new Dictionary<string, object>();
+                            fileMap.Add("url", record.url);
+                            fileMap.Add("fileName", record.name);
+                            fileMap.Add("fileSize", record.size);
+                            fileMap.Add("md5", record.hash);
+                            string fileext = record.url.Substring(record.url.LastIndexOf(".") > 0 ? record.url.LastIndexOf(".") + 1 : 0);
+                            fileMap.Add("fileType", fileext);
+                            files.Add(fileMap);
+                        });
+                        parameterMapData.Add("files", files);
+                        list53122.Add(parameterMapData);
                     }
-                });
-
-
-                //var teacher = teachers.Find(t => t.id.Equals(x.id));
-                //if (teacher == null)
-                //{
-                //    fails.Add(new PushFail { tmdid = x.id, msgs = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("tmdid-unexistent", "账号不存在!") } });
-                //}
-                //else
-                //{
-                //    List<KeyValuePair<string, string>> msgs = new List<KeyValuePair<string, string>>();
-                //    var binddata = teachers.Where(t => t.id.Equals(x.id)).SelectMany(z => z.binds)
-                //        .Where(d => d.data.IsNotEmpty()).SelectMany(d => d.data)
-                //        .Where(d => string.IsNullOrEmpty(d) && d.Contains(config.config) && d.Contains(config.path));
-                //    if (binddata != null && binddata.Count() > 0)
-                //    {
-                //        var bindData = binddata.First().ToObject<ScBindData>();
-                //        if (bindData != null)
-                //        {
-                //        }
-                //        else
-                //        {
-                //            //如果没有找到绑定信息,则去blob查找。
-                //        }
-                //    }
-                //    else
-                //    {
-                //        //如果没有找到绑定信息,则去blob查找。
-                //    }
-                //}
-            });
+                }
+            }
             await response.WriteAsJsonAsync(new { });
             return response;
         }

+ 20 - 3
TEAMModelOS/ClientApp/src/view/jyzx/offline.vue

@@ -65,8 +65,8 @@
                                         </div>
                                         <div class="site" v-show="resource.owner != 'area'">
                                             <span class="info-label">学时获得:</span>
-                                            <span style="color: #e61c1c;">省平台要求,教师必须满足以下条件才可获得校本研修活动学时:</span>
-                                            <span style="color: #e61c1c; display: inline-block; margin-left: calc(80px + 2%)">1. 参加一次需要提交作业的校本研修活动。</span>
+                                            <span style="color: #e61c1c;">根据省平台要求,教师必须满足以下条件才可获得校本研修活动学时:</span>
+                                            <span style="color: #e61c1c; display: inline-block; margin-left: calc(80px + 2%)">1. 10学时中至少有一次需提交作业的校本研修活动。</span>
                                             <span style="color: #e61c1c; display: inline-block; margin-left: calc(80px + 2%)">2. 在活动中成功提交PDF作业。</span>
                                         </div>
                                     </div>
@@ -144,8 +144,11 @@
                                     
                                     <div class="target hw-style" v-if="!leaderSubmit || isLeader">
                                         <div style="margin-bottom: 20px" v-if="answerList">
-                                            <p>{{ $t('jyzx.offline.submitFile') }}:</p>
+                                            <p>{{ $t('jyzx.offline.submitFile') }}:
+                                                <!-- <span style="float: right; margin-right: 10px; color: blue; cursor: pointer;" @click="deleteFile">批量删除</span> -->
+                                            </p>
                                             <div>
+                                                <!-- <Table ref="selection" :columns="fileCol" :data="answerList.content" @on-selection-change="selectionChange"> -->
                                                 <Table :columns="fileCol" :data="answerList.content">
                                                     <template slot-scope="{row}" slot="name">
                                                         <span v-show="row.prime" class="school-gade" style="display: inline-block; background: #a2b02e;">{{ $t('jyzx.offline.main') }}</span>
@@ -330,6 +333,11 @@ export default {
             uploadList: [], //上传文件列表
             answerList: undefined, //以前作业列表
             fileCol: [
+                /* {
+                    type: 'selection',
+                    width: 60,
+                    align: 'center',
+                }, */
                 {
                     title: "文件名称",
                     key: "name",
@@ -361,6 +369,7 @@ export default {
             previewStatus: false,
             mainFile: undefined, //需要上传的主要文件
             isUpload: false,
+            selectionFile: [],
         }
     },
     created() {
@@ -1026,6 +1035,14 @@ export default {
             })
             
         },
+        selectionChange(selection) {
+            this.selectionFile = selection
+        },
+        deleteFile() {
+            if(!this.selectionFile.length) {
+                this.$Message.warning("请先选择文件!")
+            }
+        },
     },
 
     computed: {

+ 32 - 34
TEAMModelOS/Controllers/Third/ScApiController.cs

@@ -612,23 +612,22 @@ namespace TEAMModelOS.Controllers
                 Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
                 parameterMapData.Add("PXID", "65309");
                 parameterMapData.Add("TID", "253940");
-                List<Dictionary<string, object>> pfiles = new List<Dictionary<string, object>>();
-                parameterMapData.Add("pfiles", pfiles);
-                Dictionary<string, object> pfileMap = new Dictionary<string, object>();
-                pfileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
-                pfileMap.Add("fileName", "XXX.pdf");
-                pfileMap.Add("fileSize", "247767");
-                pfileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
-                pfileMap.Add("fileType", "pdf");
-                pfiles.Add(pfileMap);
-                pfileMap = new Dictionary<string, object>(); //添加第二个校本研修方案
-                pfileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
-                pfileMap.Add("fileName", "XXX.pdf");
-                pfileMap.Add("fileSize", "247767");
-                pfileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
-                pfileMap.Add("fileType", "pdf");
-                pfiles.Add(pfileMap);
-                parameterMapData.Add("files", pfiles);
+                List<Dictionary<string, object>> files = new List<Dictionary<string, object>>();
+                Dictionary<string, object> fileMap = new Dictionary<string, object>();
+                fileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
+                fileMap.Add("fileName", "XXX.pdf");
+                fileMap.Add("fileSize", "247767");
+                fileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
+                fileMap.Add("fileType", "pdf");
+                files.Add(fileMap);
+                fileMap = new Dictionary<string, object>(); //添加第二个校本研修方案
+                fileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
+                fileMap.Add("fileName", "XXX.pdf");
+                fileMap.Add("fileSize", "247767");
+                fileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
+                fileMap.Add("fileType", "pdf");
+                files.Add(fileMap);
+                parameterMapData.Add("files", files);
                 list.Add(parameterMapData);
             }
 
@@ -636,23 +635,22 @@ namespace TEAMModelOS.Controllers
                 Dictionary<string, object> parameterMapData = new Dictionary<string, object>();
                 parameterMapData.Add("PXID", "65306");
                 parameterMapData.Add("TID", "32393");
-                List<Dictionary<string, object>> pfiles = new List<Dictionary<string, object>>();
-                parameterMapData.Add("pfiles", pfiles);
-                Dictionary<string, object> pfileMap = new Dictionary<string, object>();
-                pfileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
-                pfileMap.Add("fileName", "XXX.pdf");
-                pfileMap.Add("fileSize", "247767");
-                pfileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
-                pfileMap.Add("fileType", "pdf");
-                pfiles.Add(pfileMap);
-                pfileMap = new Dictionary<string, object>(); //添加第二个校本研修方案
-                pfileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
-                pfileMap.Add("fileName", "XXX.pdf");
-                pfileMap.Add("fileSize", "247767");
-                pfileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
-                pfileMap.Add("fileType", "pdf");
-                pfiles.Add(pfileMap);
-                parameterMapData.Add("files", pfiles);
+                List<Dictionary<string, object>> files = new List<Dictionary<string, object>>();
+                Dictionary<string, object> fileMap = new Dictionary<string, object>();
+                fileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
+                fileMap.Add("fileName", "XXX.pdf");
+                fileMap.Add("fileSize", "247767");
+                fileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
+                fileMap.Add("fileType", "pdf");
+                files.Add(fileMap);
+                fileMap = new Dictionary<string, object>(); //添加第二个校本研修方案
+                fileMap.Add("url", "https://scnltsfiles.scedu.com.cn/upload/infofj/202104011628463774.pdf");
+                fileMap.Add("fileName", "XXX.pdf");
+                fileMap.Add("fileSize", "247767");
+                fileMap.Add("md5", "9c3da8c5c07c2c660cd73c01f56d7fca");
+                fileMap.Add("fileType", "pdf");
+                files.Add(fileMap);
+                parameterMapData.Add("files", files);
                 list.Add(parameterMapData);
             }
             ScsResult UploadSBTARPDFListV2 = await _scsApisService.Post(_sc_url, Code, _sc_passKey, _sc_privateKey, parameterContent);

+ 1 - 1
TEAMModelOS/Filter/AuthTokenAttribute.cs

@@ -90,7 +90,7 @@ namespace TEAMModelOS.Filter
                     context.HttpContext.Items.Add("Website", website);
                 }
                 else
-                    context.Result = new BadRequestResult();
+                    context.Result = new UnauthorizedResult();
             }
 
             public void OnResourceExecuted(ResourceExecutedContext context)