Prechádzať zdrojové kódy

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

CrazyIter_Bin 1 rok pred
rodič
commit
b4fdeda05d

+ 2 - 1
TEAMModelOS/ClientApp/src/view/signupActivity/createActivity.vue

@@ -1026,6 +1026,7 @@ export default {
                                 return files.name === item.name
                             })
                             console.log(newFile);
+                            newFile.url = newFile.blob
                             newFile.hash = this.$tools.convertFileMD5ToString(newFile.md5)
                             newFile.cnt = this.isArea ? this.areaId : this.$store.state.userInfo.schoolCode
                             return newFile
@@ -1038,7 +1039,7 @@ export default {
                     }) */
                     // 编辑状态下,未修改封面,posterFile.file为空,不需要重新赋值poster
                     if(this.posterFile.file) {
-                        this.createData.poster = fileBlob[0].url
+                        this.createData.poster = fileBlob[0].blob
                         // this.createData.attachment.shift()
                     } else {
                         // 编辑状态下的poster 拼接了sas,保存时需去掉

+ 5 - 4
TEAMModelOS/ClientApp/src/view/signupActivity/infoComponent/editActInfo.vue

@@ -142,7 +142,7 @@ export default {
                         address: this.actInfo.address,
                         stime: this.actInfo.stime,
                         etime: this.actInfo.etime,
-                        poster: this.actInfo.poster.includes('CoverImage.jpg') ? this.actInfo.poster : '',
+                        poster: this.actInfo.poster,
                         attachment: this._.cloneDeep(this.actInfo.attachment),
                         zb: this._.cloneDeep(this.actInfo.zb),
                         cb: this._.cloneDeep(this.actInfo.cb),
@@ -275,16 +275,17 @@ export default {
                         let newFile = fileBlob.find(files => {
                             return files.name === item.name
                         })
+                        newFile.url = newFile.blob
                         newFile.hash = this.$tools.convertFileMD5ToString(newFile.md5)
                         newFile.cnt = this.isArea ? this.areaId : this.$store.state.userInfo.schoolCode
                         return newFile
                     }
                 })
                 if(this.posterFile.file) {
-                    this.editInfo.poster = fileBlob[0].url
+                    this.editInfo.poster = fileBlob[0].blob
                 } else {
                     // 编辑状态下的poster 拼接了sas,保存时需去掉
-                    this.editInfo.poster = this.posterFile.url.slice(0, this.posterFile.url.lastIndexOf('?'))
+                    // this.editInfo.poster = this.posterFile.url.slice(0, this.posterFile.url.lastIndexOf('?'))
                 }
                 console.log(2222222222);
 
@@ -334,7 +335,7 @@ export default {
                 // 获取初始化Blob需要的数据
                 let code = this.isArea ? this.areaId : this.$store.state.userInfo.schoolCode
                 let scope = this.isArea ? 'area' : 'school'
-                let path = `activity/${this.editInfo.id}/attachment`
+                let path = `activity/${this.actInfo.id}/attachment`
                 //初始化Blob
                 let blobTool = new BlobTool(this.sasData.url, code, "?" + this.sasData.sas, scope)
                 let promiseArr = []

+ 4 - 99
TEAMModelOS/ClientApp/src/view/signupActivity/infoComponent/editContest.vue

@@ -9,13 +9,13 @@
                 </span>
             </FormItem>
             <FormItem label="报名时间" prop="signEtime">
-                <DatePicker v-model="actAllTime[0]" :editable="false" @on-change="getSignTime" type="datetimerange" :options="beforeToday" format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
+                <DatePicker v-model="actAllTime[0]" :editable="false" @on-change="(data, type) => getCreateTime(data, type, 0)" type="datetimerange" :options="beforeToday" format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
             </FormItem>
         </Form>
         <template v-if="conModules.includes('upload')">
             <Form :model="uploadInfo" :label-width="80" ref="uploadInfo" :rules="editDataRule">
                 <FormItem label="上传时间" prop="uploadEtime">
-                    <DatePicker v-model="actAllTime[1]" ref="workPicker" :editable="false" @on-change="getUploadTime" type="datetimerange" :options="beforeToday" format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
+                    <DatePicker v-model="actAllTime[1]" ref="workPicker" :editable="false" @on-change="(data, type) => getCreateTime(data, type, 1)" type="datetimerange" :options="beforeToday" format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
                 </FormItem>
                 <FormItem label="文件类型" v-if="uploadInfo?.fileType" prop="fileType">
                     <div class="tab-check">
@@ -39,14 +39,14 @@
         <template v-if="conModules.includes('review')">
             <Form :model="reviewInfo" :label-width="80" ref="reviewInfo" :rules="editDataRule">
                 <FormItem label="评审时间" prop="reviewEtime">
-                    <DatePicker v-model="actAllTime[2]" ref="reviewPicker" :editable="false" @on-change="getReviewTime" type="datetimerange" :options="beforeToday" format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
+                    <DatePicker v-model="actAllTime[2]" ref="reviewPicker" :editable="false" @on-change="(data, type) => getCreateTime(data, type, 2)" type="datetimerange" :options="beforeToday" format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
                 </FormItem>
             </Form>
         </template>
         <template v-if="conModules.includes('score')">
             <Form :model="scoreInfo" :label-width="80" ref="scoreInfo" :rules="editDataRule">
                 <FormItem label="公示时间" prop="scoreEtime">
-                    <DatePicker v-model="actAllTime[3]" ref="scorePicker" :editable="false" @on-change="getScoreTime" type="datetimerange" :options="beforeToday" format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
+                    <DatePicker v-model="actAllTime[3]" ref="scorePicker" :editable="false" @on-change="(data, type) => getCreateTime(data, type, 3)" type="datetimerange" :options="beforeToday" format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
                 </FormItem>
             </Form>
         </template>
@@ -286,101 +286,6 @@ export default {
                     break
             }
         },
-        getSignTime(data, type) {
-            let times = data.filter(item => {
-                return item
-            })
-            // 没有选择结束的时分秒,需将结束时间默认为 23:59:59
-            if(times.length > 1 && times[1].slice(-8) === '00:00:00' && type === 'date') {
-                times[1] = times[1].slice(0, -8) + '23:59:59'
-            }
-            this.signInfo.signStime = times.length > 1 ? (new Date(times[0])).getTime() : null
-            this.signInfo.signEtime = times.length > 1 ? (new Date(times[1])).getTime() : null
-            this.actAllTime = [[], [], [], []]
-            this.actAllTime[0] = times
-            this.uploadInfo.uploadStime = null
-            this.uploadInfo.uploadEtime = null
-            this.reviewInfo.reviewStime = null
-            this.reviewInfo.reviewEtime = null
-            this.scoreInfo.scoreStime = null
-            this.scoreInfo.scoreEtime = null
-        },
-        getUploadTime(data, type) {
-            let times = data.filter(item => {
-                return item
-            })
-            // 没有选择结束的时分秒,需将结束时间默认为 23:59:59
-            if(times.length > 1 && times[1].slice(-8) === '00:00:00' && type === 'date') {
-                times[1] = times[1].slice(0, -8) + '23:59:59'
-            }
-            if(times.length > 1 && !this.signInfo.signEtime) {
-                // this.$refs.workPicker.handleClear()
-                this.$Message.warning('请先设置报名时间')
-                this.actAllTime.splice(1, 1, [])
-                this.uploadInfo.uploadStime = null
-                this.uploadInfo.uploadEtime = null
-            } else if(times.length > 1 && (new Date(times[1])).getTime() < this.signInfo.signEtime) {
-                this.$Message.warning('上传结束时间不能早于报名时间')
-                this.actAllTime.splice(1, 1, [])
-                this.uploadInfo.uploadStime = null
-                this.uploadInfo.uploadEtime = null
-            } else if(times.length > 1) {
-                this.uploadInfo.uploadStime = times.length > 1 ? (new Date(times[0])).getTime() : null
-                this.uploadInfo.uploadEtime = times.length > 1 ? (new Date(times[1])).getTime() : null
-                this.actAllTime[1] = times
-            }
-            this.actAllTime.splice(2, 1, [])
-            this.actAllTime.splice(3, 1, [])
-        },
-        getReviewTime(data, type) {
-            let times = data.filter(item => {
-                return item
-            })
-            // 没有选择结束的时分秒,需将结束时间默认为 23:59:59
-            if(times.length > 1 && times[1].slice(-8) === '00:00:00' && type === 'date') {
-                times[1] = times[1].slice(0, -8) + '23:59:59'
-            }
-            if(times.length > 1 && (!this.signInfo.signEtime || !this.uploadInfo.uploadEtime)) {
-                this.$Message.warning('请先设置报名时间、上传时间')
-                this.actAllTime.splice(2, 1, [])
-                this.reviewInfo.reviewStime = null
-                this.reviewInfo.reviewEtime = null
-            } else if(times.length > 1 && (new Date(times[0])).getTime() < this.signInfo.signEtime || (new Date(times[0])).getTime() < this.uploadInfo.uploadEtime) {
-                this.$Message.warning('评审必须在报名、上传结束后进行')
-                this.actAllTime.splice(2, 1, [])
-                this.reviewInfo.reviewStime = null
-                this.reviewInfo.reviewEtime = null
-            } else if(times.length > 1) {
-                this.reviewInfo.reviewStime = times.length > 1 ? (new Date(times[0])).getTime() : null
-                this.reviewInfo.reviewEtime = times.length > 1 ? (new Date(times[1])).getTime() : null
-                this.actAllTime[2] = times
-            }
-            this.actAllTime.splice(3, 1, [])
-        },
-        getScoreTime(data, type) {
-            let times = data.filter(item => {
-                return item
-            })
-            // 没有选择结束的时分秒,需将结束时间默认为 23:59:59
-            if(times.length > 1 && times[1].slice(-8) === '00:00:00' && type === 'date') {
-                times[1] = times[1].slice(0, -8) + '23:59:59'
-            }
-            if(times.length > 1 && !this.reviewInfo.reviewEtime) {
-                this.$Message.warning('请先设置评审时间')
-                this.actAllTime.splice(3, 1, [])
-                this.scoreInfo.scoreStime = null
-                this.scoreInfo.scoreEtime = null
-            } else if(times.length > 1 && (new Date(times[0])).getTime() < this.reviewInfo.reviewEtime) {
-                this.$Message.warning('公示必须在评审结束后进行')
-                this.actAllTime.splice(3, 1, [])
-                this.scoreInfo.scoreStime = null
-                this.scoreInfo.scoreEtime = null
-            } else if(times.length > 1) {
-                this.scoreInfo.scoreStime = times.length > 1 ? (new Date(times[0])).getTime() : null
-                this.scoreInfo.scoreEtime = times.length > 1 ? (new Date(times[1])).getTime() : null
-                this.actAllTime.splice(3, 1, times)
-            }
-        },
         saveInfo() {
             let saving = true
             this.$refs['signInfo'].validate((valid) => {

+ 4 - 3
TEAMModelOS/ClientApp/src/view/signupActivity/infoGoing.vue

@@ -29,7 +29,7 @@
             <Tabs value="info">
                 <TabPane label="基本信息" name="info">
                     <vuescroll>
-                        <img :src="actInfo.poster" alt="">
+                        <img :src="actInfo.posterShow" alt="">
                         <div class="sk-info">
                             <!-- <div class="info-title">基本信息</div> -->
                             <p>主题:{{ actInfo.subject }}</p>
@@ -362,14 +362,15 @@ export default {
         },
         saveInfo(info) {
             let sas = this.actInfo.sas
+            let host = this.$store.state.user.userProfile.blob_uri.split('/' + this.$store.state.userInfo.TEAMModelId)[0]
             this.actInfo = info
             this.actInfo.startTime = this.$tools.formatTime(this.actInfo.stime, 'yyyy-MM-dd hh:mm:ss')
             this.actInfo.endTime = this.$tools.formatTime(this.actInfo.etime, 'yyyy-MM-dd hh:mm:ss')
             this.actInfo.sas = sas
-            this.actInfo.poster = !info.poster ? require('@/assets/image/no-poster-cn1.png') : `${info.poster}?${sas}`
+            this.actInfo.posterShow = !info.poster ? require('@/assets/image/no-poster-cn1.png') : `${host}/${info.owner}${info.poster}?${sas}`
             this.actInfo.attachment.forEach(attach => {
                 if(attach) {
-                    attach.url = `${attach.url}?${sas}`
+                    attach.urlShow = `${host}/${info.owner}${attach.url}?${sas}`
                 }
             })
             this.editArtModal = false

+ 1 - 1
TEAMModelOS/ClientApp/src/view/signupActivity/infoReleased.vue

@@ -28,7 +28,7 @@
             <div class="info-box">
                 <div class="activity-info">
                     <template>
-                        <img :src="actInfo.poster" alt="">
+                        <img :src="actInfo.posterShow" alt="">
                         <div>
                             <span>主题:</span>
                             <span>{{ actInfo.subject }}</span>

+ 4 - 3
TEAMModelOS/ClientApp/src/view/signupActivity/processActivity.vue

@@ -18,7 +18,7 @@
             <div class="activitya-list" v-if="activityListShow.length">
                 <div class="activity-box" v-for="(item, index) in activityListShow" :key="index" @click="goInfo(item)">
                     <div :class="['train-img-box',item.scope == 'area' ? 'area-train-bg': item.scope == 'school' ? 'school-train-bg' : '']">
-                        <img :src="item.poster" />
+                        <img :src="item.posterShow" />
                         <span class="train-type-label">
                             {{item.scope == 'area' ? $t('train.mgt.areaLabel') : item.scope == 'school' ? $t('train.mgt.schoolLabel') : '公开'}}
                         </span>
@@ -106,13 +106,14 @@ export default {
                     } else {
                         sasData.sas = this.$store.state.user.schoolProfile.blob_sas
                     } */
+                    let host = this.$store.state.user.userProfile.blob_uri.split('/' + this.$store.state.userInfo.TEAMModelId)[0]
                     this.activityList = res.activities.map(item => {
                         item.startTime = this.$tools.formatTime(item.stime, 'yyyy-MM-dd hh:mm:ss')
                         item.endTime = this.$tools.formatTime(item.etime, 'yyyy-MM-dd hh:mm:ss')
-                        item.poster = !item.poster ? require('@/assets/image/no-poster-cn1.png') : `${item.poster}?${item.sas}`
+                        item.posterShow = !item.poster ? require('@/assets/image/no-poster-cn1.png') : `${host}/${item.owner}${item.poster}?${item.sas}`
                         item.attachment.forEach(attach => {
                             if(attach) {
-                                attach.url = `${attach.url}?${item.sas}`
+                                attach.urlShow = `${host}/${item.owner}${attach.url}?${item.sas}`
                             }
                         })
                         // 校级确认参加: confirmedSchools[0].status = 0(没确认)/1(已确认)

+ 92 - 140
TEAMModelOS/Controllers/Common/ArtController.cs

@@ -301,18 +301,10 @@ namespace TEAMModelOS.Controllers.Common
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
-                var (_, _, _, school) = HttpContext.GetAuthTokenInfo();
-                if (!element.TryGetProperty("artId", out JsonElement artId)) return BadRequest();
-                if (!element.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
-                if (!element.TryGetProperty("quotaId", out JsonElement quotaId)) return BadRequest();
-                if (!element.TryGetProperty("acId", out JsonElement acId)) return BadRequest();
-                if (!element.TryGetProperty("subject", out JsonElement subject)) return BadRequest();
                 if (!element.TryGetProperty("stus", out JsonElement stus)) return BadRequest();
-                //HttpContext.Items.TryGetValue("Scope", out object scope);
-                //int userType = $"{scope}".Equals(Constant.ScopeStudent) ? 2 : 1;
                 List<stuFiles> stuFiles = stus.ToObject<List<stuFiles>>();
                 List<string> value = new List<string>();
-                await foreach (var s in stuTask(stuFiles, client, school, artId.GetString(), classId.GetString(), quotaId.GetString(), acId.GetString(), subject.GetString()))
+                await foreach (var s in stuTask(stuFiles, client))
                 {
                     if (s.code == 1)
                     {
@@ -336,136 +328,70 @@ namespace TEAMModelOS.Controllers.Common
 
         }
 
-        private async IAsyncEnumerable<(int code, string value)> stuTask(List<stuFiles> stuFiles, CosmosClient client, string school, string artId, string classId, string quotaId, string acId, string subject)
+        private async IAsyncEnumerable<(int code, string value)> stuTask(List<stuFiles> stuFiles, CosmosClient client)
         {
-            /* string queryScore = $" select c.id from c where c.artId ='{artId}' and c.quotaId = '{quotaId}' and c.acId = '{acId}' and c.subject = '{subject}' and c.classId = '{classId}'";
-             List<string> ids = new();
-             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryStreamIterator
-                 (queryText: queryScore, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("ArtRecord") }))
-             {
-                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
-                 {
-                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
-                     {
-                         if (obj.TryGetProperty("id", out JsonElement subScore))
-                         {
-                             //string sId = obj.GetProperty("id").GetString();
-                             ids.Add(subScore.GetString());
-                         }
-                     }
-                 }
-             }
-             await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemsAsync<ArtRecord>(ids, "ArtRecord");*/
-            // await _azureStorage.GetBlobServiceClient().DeleteBlobs(_dingDing, school, new List<string> { $"art/{artId}" });
-            foreach (var request in stuFiles)
+            foreach (var files in stuFiles)
             {
                 string value = "";
                 int code = 0;
                 try
                 {
-                    long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                    /*ArtRecord record = new()
-                    {
-                        school = school,
-                        stuId = request.stuId,
-                        artId = artId,
-                        classId = classId,
-                        quotaId = quotaId,
-                        acId = acId,
-                        subject = subject,
-                        createTime = now,
-                        code = "ArtRecord",
-                        attachments = request.attachments
-                    };*/
-                    StudentArtResult artResult;
-                    ArtEvaluation art;
-                    List<string> classIds = new();
-                    List<GroupListGrp> groups = await GroupListService.GetMemberInGroupList(_coreAPIHttpService, client, _dingDing, request.stuId, request.userType, school, new List<string> { "class", "teach" });
-                    foreach (var grp in groups)
+                    if (string.IsNullOrEmpty(files.id))
                     {
-                        classIds.Add(grp.id);
-                    }
-                    /*if (string.IsNullOrEmpty(record.id))
-                    {
-                        record.id = Guid.NewGuid().ToString();
-                        record = await client.GetContainer("TEAMModelOS", "Student").CreateItemAsync(record, new PartitionKey($"{record.code}"));
+                        ArtAttachment attachment = new()
+                        {
+                            id = Guid.NewGuid().ToString(),
+                            artId = files.artId,
+                            achievement = files.achievement,
+                            address = files.address,
+                            studentId = files.studentId,
+                            taskId = files.taskId,
+                            subjectId = files.subjectId,
+                            quotaId = files.quotaId,
+                            quotaName = files.quotaName,
+                            uploadName = files.uploadName,
+                            uploadTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                            duration = files.duration,
+                            name = files.name,
+                            des = files.des,
+                            artType = files.artType,
+                            level = files.level,
+                            files = files.files,
+                            ttl = -1,
+                            code = "ArtAttachment-" + files.school
+
+                        };
+                        await client.GetContainer("TEAMModelOS", "Student").CreateItemAsync(attachment, new PartitionKey($"{attachment.code}"));
                     }
                     else
                     {
-                        record = await client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync(record, record.id, new PartitionKey($"{record.code}"));
-                    }*/
-                    string rId = string.Format("{0}{1}{2}", school, "-", request.stuId);
-                    //首先根据大ID获取整个活动得内容
-                    var aresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(artId, new PartitionKey($"Art-{school}"));
-                    if (aresponse.Status == 200)
-                    {
-                        using var json = await JsonDocument.ParseAsync(aresponse.ContentStream);
-                        art = json.ToObject<ArtEvaluation>();
-                        var response = await client.GetContainer("TEAMModelOS", "Student").ReadItemStreamAsync(rId, new PartitionKey($"ArtResult-{artId}"));
-                        if (response.Status == 200)
-                        {
-                            using var json_1 = await JsonDocument.ParseAsync(response.ContentStream);
-                            artResult = json_1.ToObject<StudentArtResult>();
-                            List<Attachment> files = new();
-                            files = request.attachments;
-                            //bool flage = artResult.results.Exists(a => a.taskId == request.acId);
-                            artResult.results.ForEach(a =>
-                            {
-                                if (a.taskId == acId)
-                                {
-                                    a.name = request.name;
-                                    a.files = files;
-                                }
-                            });
-                            await client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync(artResult, artResult.id, new PartitionKey($"{artResult.code}"));
-                        }
-                        else
+                        ArtAttachment attachment = new()
                         {
-                            artResult = new StudentArtResult
-                            {
-                                id = rId,
-                                pk = "ArtResult",
-                                code = $"ArtResult-{artId}",
-                                studentId = request.stuId,
-                                //picture = picture,
-                                studentName = request.name,
-                                school = school,
-                                userType = request.userType,
-                                artId = artId,
-                                classIds = classIds,
-                            };
-                            foreach (var qIds in art.settings)
-                            {
-                                foreach (var task in qIds.task)
-                                {
-                                    ArtQuotaResult quotaResult = new()
-                                    {
-                                        quotaId = qIds.id,
-                                        quotaName = qIds.quotaname,
-                                        quotaType = (int)task.type,
-                                        subjectId = task.subject,
-                                        taskId = task.acId
-                                    };
-                                    if (!string.IsNullOrEmpty(quotaResult.taskId))
-                                    {
-                                        if (quotaResult.taskId.Equals(acId))
-                                        {
-                                            quotaResult.name = request.name;
-                                            quotaResult.files = request.attachments;
-                                        }
-                                    }
-                                    artResult.results.Add(quotaResult);
-                                }
-                            }
-
-                            await client.GetContainer("TEAMModelOS", "Student").CreateItemAsync(artResult, new PartitionKey($"{artResult.code}"));
-                        }
+                            artId = files.artId,
+                            achievement = files.achievement,
+                            address = files.address,
+                            studentId = files.studentId,
+                            taskId = files.taskId,
+                            subjectId = files.subjectId,
+                            quotaId = files.quotaId,
+                            quotaName = files.quotaName,
+                            updateTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                            uploadName = files.uploadName,
+                            duration = files.duration,
+                            name = files.name,
+                            des = files.des,
+                            artType = files.artType,
+                            level = files.level,
+                            files = files.files,
+                            ttl = -1,
+                            code = "ArtAttachment-" + files.school
+                        };
+                        await client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync(attachment, attachment.id, new PartitionKey($"{attachment.code}"));
                     }
                 }
                 catch (Exception e)
                 {
-                    value = request.stuId;
+                    value = files.studentId;
                     code = 1;
                 }
                 yield return (code, value);
@@ -577,7 +503,7 @@ namespace TEAMModelOS.Controllers.Common
                                 await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(artId, new PartitionKey("ArtMusic"));
                                 await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(artId, new PartitionKey("ArtExam"));
                             }
-                            string queryScore = $" select c.id from c where c.artId in ({string.Join(",", artIds.Select(o => $"'{o}'"))})";
+                            /*string queryScore = $" select c.id from c where c.artId in ({string.Join(",", artIds.Select(o => $"'{o}'"))})";
                             List<string> ids = new();
                             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryStreamIterator
                                 (queryText: queryScore, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("ArtRecord") }))
@@ -595,11 +521,11 @@ namespace TEAMModelOS.Controllers.Common
                                     }
                                 }
                             }
-                            await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemsAsync<ArtRecord>(ids, "ArtRecord");
+                            await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemsAsync<ArtRecord>(ids, "ArtRecord");*/
                         }
                         else
                         {
-                            string queryScore = $" select c.id from c where c.artId  = '{art.id})'";
+                           /* string queryScore = $" select c.id from c where c.artId  = '{art.id})'";
                             List<string> ids = new();
                             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryStreamIterator
                                 (queryText: queryScore, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("ArtRecord") }))
@@ -617,7 +543,7 @@ namespace TEAMModelOS.Controllers.Common
                                     }
                                 }
                             }
-                            await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemsAsync<ArtRecord>(ids, "ArtRecord");
+                            await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemsAsync<ArtRecord>(ids, "ArtRecord");*/
                             await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(art.id, new PartitionKey("ArtMusic"));
                         }
                     }
@@ -1039,7 +965,7 @@ namespace TEAMModelOS.Controllers.Common
                 {
                     artAttachments.Add(item);
                 }
-                List<(string stuId, string url)> zyUrl = new();
+                List<(string stuId, string url, long time)> zyUrl = new();
                 foreach (StudentArtResult artResult in artResults)
                 {
                     if (!string.IsNullOrWhiteSpace(artResult.zyanswer.thirdAnswerId))
@@ -1052,11 +978,11 @@ namespace TEAMModelOS.Controllers.Common
                         StringBuilder url = new("https://amesopen.aimusic.art?appid=8a68f563f3384662acbc268336b98ae2");
                         url.Append($"&data={base64Str}");
                         url.Append($"&thirdToken={token}");
-                        zyUrl.Add((artResult.studentId, url.ToString()));
+                        zyUrl.Add((artResult.studentId, url.ToString(), artResult.zyanswer.time));
                     }
                     else
                     {
-                        zyUrl.Add((artResult.studentId, string.Empty));
+                        zyUrl.Add((artResult.studentId, string.Empty, 0));
                     }
                 }
                 //if (string.IsNullOrWhiteSpace(artResult.zyanswer.thirdAnswerId)) { }
@@ -1069,12 +995,14 @@ namespace TEAMModelOS.Controllers.Common
                         x.classIds,
                         x.artId,
                         isAnswer = string.IsNullOrWhiteSpace(x.zyanswer.thirdAnswerId) ? 0 : 1,
-                        attachments = artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).ToList(),
-                        url = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().quotaId.Equals("quota_22") ? zyUrl.Where(c => c.stuId.Equals(x.studentId)).FirstOrDefault().url : ""
+                        attachments = artAttachments.Count > 0 ?artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).ToList() : null,
+                        url = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().quotaId.Equals("quota_22") ? zyUrl.Where(c => c.stuId.Equals(x.studentId)).FirstOrDefault().url : "",
+                        time = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().quotaId.Equals("quota_22") ? zyUrl.Where(c => c.stuId.Equals(x.studentId)).FirstOrDefault().time : 0
                     });
                     return Ok(new { works, code = 200 });
                 }
-                else {
+                else
+                {
                     var works = artResults.Select(x => new
                     {
                         stuId = x.studentId,
@@ -1082,12 +1010,13 @@ namespace TEAMModelOS.Controllers.Common
                         x.classIds,
                         x.artId,
                         isAnswer = string.IsNullOrWhiteSpace(x.zyanswer.thirdAnswerId) ? 0 : 1,
-                        attachments = artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).ToList(),
+                        attachments = artAttachments.Count > 0 ? artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).ToList(): null,
+                        time = artAttachments.Count > 0 ? artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).LastOrDefault().updateTime : 0,
                     });
                     return Ok(new { works, code = 200 });
                 }
-               
-                
+
+
 
             }
             catch (CosmosException ex) when (ex.Status == 404)
@@ -1175,10 +1104,33 @@ namespace TEAMModelOS.Controllers.Common
         }
         private class stuFiles
         {
-            public string stuId { get; set; }
-            public int userType { get; set; }
+            public string id { get; set; }
+            public string school { get; set; }
+            public string artId { get; set; }
+            public string taskId { get; set; }
+            public string studentId { get; set; }
+            public string quotaId { get; set; }
+            public string quotaName { get; set; }
+            public string subjectId { get; set; }
+            public string address { get; set; }
+            public string time { get; set; }
+            public string duration { get; set; }
+            public string achievement { get; set; }
             public string name { get; set; }
-            public List<Attachment> attachments { get; set; } = new List<Attachment>();
+            public string des { get; set; }
+            //0 艺术特长  1 艺术体验
+            public int artType { get; set; } = -1;
+            // 0 校级 1 区级 2 市级 3 省级 4 国家级
+            public int level { get; set; } = -1;
+            public long uploadTime { get; set; }
+            public string uploadName { get; set; }
+            public List<Attachment> files { get; set; } = new List<Attachment>();
+        }
+        private class studentInfos
+        {
+            public string id { get; set; }
+            public string paper { get; set; }
+            public string subject { get; set; }
         }
     }
 }