Browse Source

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

liqk 3 years ago
parent
commit
3178b26d0c

+ 2 - 31
TEAMModelOS.SDK/Models/Service/TriggerStuActivity.cs

@@ -362,11 +362,12 @@ namespace TEAMModelOS.SDK
                 if (claes.Count == 1 && claes.First().Equals("default"))
                 {
                     List<TmdInfo> infos = new List<TmdInfo>();
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<TmdInfo>(queryText: $"SELECT  value(c) FROM c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
+                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<TmdInfo>(queryText: $"SELECT  value(c) FROM c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school}") }))
                     {
                         infos.Add(item);
                     }
                     tmdinfos.AddRange(infos);
+                    classInfo.Add(new ClassListInfo { id = "default",name= "default", tmdInfos = infos });
                 }
                 else {
                     List<string> classes = new List<string>();
@@ -392,8 +393,6 @@ namespace TEAMModelOS.SDK
                         }
 
                     }
-
-
                     foreach (var x in tchLists)
                     {
 
@@ -418,23 +417,6 @@ namespace TEAMModelOS.SDK
                         }
                         tmdinfos.AddRange(infos);
                     }
-
-
-
-                    tchLists.ForEach(x => {
-                        ClassListInfo classListInfo = new ClassListInfo { id = x.id, name = x.name };
-                        if (x.teachers.IsNotEmpty())
-                        {
-                            x.teachers.ForEach(y => {
-                                var tmdinfo = tmdinfos.Where(z => z.id.Equals(y)).FirstOrDefault();
-                                if (tmdinfo != null)
-                                {
-                                    classListInfo.tmdInfos.Add(tmdinfo);
-                                }
-                            });
-                        }
-                        classInfo.Add(classListInfo);
-                    });
                     tchLists.ForEach(x => {
                         ClassListInfo classListInfo = new ClassListInfo { id = x.id, name = x.name };
                         if (x.teachers.IsNotEmpty())
@@ -449,18 +431,7 @@ namespace TEAMModelOS.SDK
                         }
                         classInfo.Add(classListInfo);
                     });
-
-
-                    //var classeids= students.GroupBy(x => x.classId).Select(x => x.Key).ToList();
-                    List<ClassInfo> classInfos = await GetClassInfo(client, _dingDing, classes, school);
-                    classInfos.ForEach(x =>
-                    {
-                        ClassListInfo classListInfo = new ClassListInfo { id = x.id, name = x.name };
-                        classInfo.Add(classListInfo);
-                    });
                 }
-                
-
                 return (tmdinfos,  classInfo);
             }
             catch (Exception ex)

+ 16 - 13
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue

@@ -20,7 +20,7 @@
 							:options="csOptions" :props="props" @change="treeChange" style="width:100%;">
 						</el-cascader>
 					</div>
-					<div>
+					<div v-else>
 						<BaseClassSelect :classes="classTargets" :type="targetType" @onChange="onTargetChange"
 							ref="classSelectRef" v-if="getCurScope === 'school' && curQnItem"></BaseClassSelect>
 						<BaseClassSelectPri :classes="classTargets" :scope="classType" @onChange="onTargetChange"
@@ -29,7 +29,7 @@
 				</div>
 			</FormItem>
 
-			<FormItem :label="$t('learnActivity.createEv.publishType')" prop="publishModel" v-show="qnFormEdit">
+			<FormItem :label="$t('learnActivity.createEv.publishType')" prop="publishModel" v-show="qnFormEdit && !isAreaSurvey">
 				<Checkbox v-model="isImmediate">{{ $t('global.publishType1')}}</Checkbox>
 			</FormItem>
 
@@ -137,11 +137,11 @@
 						message: vm.$t('survey.form.ruleName'),
 						trigger: 'blur'
 					}],
-					description: [{
-						required: true,
-						message: vm.$t('survey.form.ruleDescription'),
-						trigger: 'blur'
-					}],
+					// description: [{
+					// 	required: true,
+					// 	message: vm.$t('survey.form.ruleDescription'),
+					// 	trigger: 'blur'
+					// }],
 					// classes: [{
 					// 	required: true,
 					// 	message: vm.$t('survey.form.ruleClasses')
@@ -273,12 +273,13 @@
 			handleSubmit(name) {
 				return new Promise((resolve, reject) => {
 					this.$refs[name].validate((valid) => {
-						if (valid && this.getSimpleText(this.qnForm.description) && ((!this.isAreaSurvey && this.qnForm.classes.length) || (this.isAreaSurvey && this.schoolTarget.length))) {
+						let hasTargets = (!this.isAreaSurvey && this.qnForm.classes.length) || (this.isAreaSurvey && this.schoolTarget.length)
+						if (valid && this.getSimpleText(this.qnForm.description) && hasTargets) {
 							let params = JSON.parse(JSON.stringify(this.defaultParams))
 							let areaParams = null
 							let target = []
-							let classSelectScope = this.isAreaVote ? 'school' : this.$refs.classSelectRef.evaluationInfo.scope
-							let isSchoolClass = this.isAreaVote ? false : this.$refs.classSelectRef.evaluationInfo.scope ===
+							let classSelectScope = this.isAreaSurvey ? 'school' : this.$refs.classSelectRef.evaluationInfo.scope
+							let isSchoolClass = this.isAreaSurvey ? false : this.$refs.classSelectRef.evaluationInfo.scope ===
 								'school' && this.$refs.classSelectRef.privateClassType === 'school'
 							let isPersonal = this.$route.name === 'personalSurvey' && classSelectScope ===
 								'private'
@@ -343,7 +344,7 @@
 								areaParams = {
 									"id": this.areaId,
 									"para": para,
-									"vote": params
+									"survey": params
 								}
 							}else{
 								// 如果是校本投票 则需要进一步确定发布对象是教研组还是学生名单
@@ -362,8 +363,10 @@
 							console.log(finalParams)
 							resolve(finalParams)
 						} else {
-							if (!this.qnForm.classes.length) {
+							if (!hasTargets) {
 								this.$Message.error(this.$t('survey.form.ruleClasses'))
+							}else if(!this.getSimpleText(this.qnForm.description)){
+								this.$Message.error('问卷描述不能为空!')
 							} else {
 								this.$Message.error(this.$t('survey.form.noCompleteTip'))
 							}
@@ -468,7 +471,7 @@
 					rangeTime: item.endTime ? [item.startTime, item.endTime] : null
 				}
 				console.log(this.qnForm)
-				this.isImmediate = false
+				this.isImmediate = item.isImmediate || false
 				this.currentState = item.state
 				this.$nextTick(() => {
 					this.curQnItem = JSON.parse(JSON.stringify(item))

+ 17 - 15
TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue

@@ -28,7 +28,7 @@
 					</div>
 				</div>
 			</FormItem>
-			<FormItem :label="$t('learnActivity.createEv.publishType')" prop="publishModel" v-show="voteFormEdit">
+			<FormItem :label="$t('learnActivity.createEv.publishType')" prop="publishModel" v-show="voteFormEdit && !isAreaVote">
 				<Checkbox v-model="isImmediate">{{$t('global.publishType1')}}</Checkbox>
 			</FormItem>
 			<FormItem :label="$t('learnActivity.createEv.startTime')" v-if="!isImmediate || !voteFormEdit"
@@ -195,11 +195,11 @@
 						message: vm.$t('vote.form.ruleName'),
 						trigger: 'blur'
 					}],
-					description: [{
-						required: true,
-						message: vm.$t('vote.form.ruleDescription'),
-						trigger: 'blur'
-					}],
+					// description: [{
+					// 	// required: true,
+					// 	message: vm.$t('vote.form.ruleDescription'),
+					// 	trigger: 'blur'
+					// }],
 					startTime: [{
 						required: true,
 						type: 'date',
@@ -313,10 +313,10 @@
 			 */
 			async handleSubmit(name) {
 				this.isBtnLoading = true
+				let hasTargets = (!this.isAreaVote && this.voteForm.classes.length) || (this.isAreaVote && this.schoolTarget.length)
+				let optionComplete = this.voteOptionsContent.length && this.voteOptionsContent.every(i => i.value !== '')
 				this.$refs[name].validate(async (valid) => {
-					if (valid && this.getSimpleText(this.voteForm.description) && this.voteOptionsContent
-						.length && ((!this.isAreaVote && this.voteForm.classes.length) || (this
-							.isAreaVote && this.schoolTarget.length))) {
+					if (valid && this.getSimpleText(this.voteForm.description) && optionComplete && hasTargets) {
 						if (this.voteForm.selectMax > this.voteOptionsContent.length && this.voteForm
 							.repeat.indexOf('repeat') === -1) {
 							this.$Message.warning(this.$t('vote.optionMaxTip'))
@@ -379,7 +379,7 @@
 											let groupName = j[1].split('-')[1]
 											if (groupName === '所有老师(未分组)') {
 												para[index].gName = []
-												para[index].gId = []
+												para[index].gId = ['default']
 											} else {
 												let curSch = this.schList.find(sch => sch.id === i)
 												let groupId = curSch.gId[curSch.name.indexOf(groupName)]
@@ -428,12 +428,14 @@
 						}
 					} else {
 						this.isBtnLoading = false
-						if (!this.voteOptionsContent.length) {
-							this.$Message.error(this.$t('vote.form.noCompleteTip'))
-						} else if (!this.voteForm.classes.length) {
+						if (!optionComplete) {
+							this.$Message.error(this.$t('vote.form.noOptionTip'))
+						} else if (!hasTargets) {
 							this.$Message.error(this.$t('vote.form.ruleClasses'))
+						} else if(!this.getSimpleText(this.voteForm.description)){
+							this.$Message.error('投票详情不能为空!')
 						} else {
-							this.$Message.error(this.$t('vote.form.noOptionTip'))
+							this.$Message.error(this.$t('vote.form.noCompleteTip'))
 						}
 					}
 				})
@@ -710,7 +712,7 @@
 					voteNum: item.voteNum || 1,
 					isReset: []
 				}
-				this.isImmediate = false
+				this.isImmediate = item.isImmediate || false
 				this.descriptionEditor.txt.html(item.description)
 				this.voteOptionsContent = item.options
 				this.voteOptions = item.options.map((item, index) => index)

+ 1 - 0
TEAMModelOS/ClientApp/src/components/vote/BaseVotePie.vue

@@ -141,6 +141,7 @@
 				deep: true,
 				handler(val) {
 					if (val.length) {
+						console.log(val);
 						this.noChooseNum = val.filter(item => item.option === null).length
 						this.chooseNum = val.length - this.noChooseNum
 						this.drawLine(val)

+ 1 - 1
TEAMModelOS/ClientApp/src/locale/lang/en-US/vote.js

@@ -49,7 +49,7 @@ export default {
 		editSuc:'Edit successfully',
 		addSuc:'Add successfully',
 		noCompleteTip:'Please fill in the information completely',
-		noOptionTip:'The number of voting options cannot be zero!',
+		noOptionTip:'Voting options cannot be empty!',
 		attachmentMaxTip:'Maximum of 5 attachments can be uploaded',
 		optionNumsTip:'Maximum of 10 options only',
 		noMatchDataTip:'No matching data',

+ 1 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/vote.js

@@ -49,7 +49,7 @@ export default {
 		editSuc:'修改成功',
 		addSuc:'添加成功',
 		noCompleteTip:'请将信息填写完整',
-		noOptionTip:'投票选项个数不能为空!',
+		noOptionTip:'投票选项不能为空!',
 		attachmentMaxTip:'最多只能上传5个附件',
 		optionNumsTip:'最多只能有10个选项',
 		noMatchDataTip:'未匹配数据',

+ 1 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/vote.js

@@ -49,7 +49,7 @@ export default {
 		editSuc: '修改成功',
 		addSuc: '加入成功',
 		noCompleteTip: '請將資訊填寫完整',
-		noOptionTip: '投票選項個數不能為空!',
+		noOptionTip: '投票選項不能為空!',
 		attachmentMaxTip: '最多只能上傳5個附件',
 		optionNumsTip: '最多只能有10個選項',
 		noMatchDataTip: '未匹配數據',

+ 35 - 1
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue

@@ -260,6 +260,7 @@
 						rangeTime: [],
 						isReset: [],
 						owner: this.isAreaSurvey ? 'area' : 'school',
+						isImmediate: this.isAreaSurvey ? true : false,
 						progress: "pending",
 						questionUrl: [],
 						other: [],
@@ -451,7 +452,7 @@
 				try {
 					let qnBaseInfo = isQnFormEdit ? await this.$refs.qnForm.handleSubmit("qnForm") : this.currentQn;
 					let qnItems = this.$refs.qnPaper.items || [];
-
+					
 					if (this.isAreaSurvey) {
 						qnBaseInfo.survey.scope = 'school'
 						qnBaseInfo.survey.id = this.$tools.guid()
@@ -483,6 +484,7 @@
 							this.isBtnLoading = false;
 						});
 				} catch (e) {
+					console.log(e)
 					this.isLoading = false;
 					this.isBtnLoading = false;
 				}
@@ -528,6 +530,38 @@
 				})
 
 			},
+			
+			async doUploadAreaItems(qnBaseInfo, items, containerClient) {
+				return new Promise(async (resolve, reject) => {
+					let promiseArr = []
+					let areaId = sessionStorage.getItem('areaId')
+					for (let item of items) {
+						let curId = item.id || this.$tools.guid()
+						promiseArr.push(new Promise(async (r, j) => {
+							// let itemJsonFile = await this.$evTools.createBlobItem(exerciseItem);
+							let file = new File([JSON.stringify(item)], curId + ".json");
+							try {
+								// 等待上传blob的返回结果
+								let blobFile = await containerClient.upload(file, `${areaId}/survey/${qnBaseInfo.id}`,{} , true,`${areaId}/`);
+								if (blobFile.blob) {
+									console.log('上传Blob成功', blobFile)
+									r(blobFile.blob)
+								} else {
+									this.$Message.error(this.$t('evaluation.newExercise.uploadErrorTip'));
+								}
+							} catch (e) {
+								j(e)
+								this.isLoading = false;
+								this.isBtnLoading = false;
+								this.$Message.error(e.spaceError);
+							}
+						}))
+					}
+					Promise.all(promiseArr).then(result => {
+						resolve(result)
+					})
+				})
+			},
 
 			/* 上传index.json */
 			async doUploadItems(qnBaseInfo, items) {

+ 96 - 50
TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue

@@ -79,7 +79,7 @@
 								<div class="hw-box-header">
 									<span>{{ $t('vote.voteResult') }}</span>
 									<div class="hw-box-header-tools">
-										<div>
+										<div v-if="!isAreaVote">
 											<span class="hw-box-header-tools-tool" @click="changeTableView" v-if="!currentVote.secret">
 												<Icon type="md-podium" />
 												{{ isOptionView ? $t('vote.stuListView') : $t('vote.optionView') }}
@@ -95,16 +95,21 @@
 								<div v-if="voteList.length === 0 || hasNewAdd || currentVote.progress === 'pending'">
 									<EmptyData :top="50"></EmptyData>
 								</div>
-								<div class="hw-data-wrap" style="height:90%;padding-top: 20px;" ref="baseQnRef" v-else>
+								<div class="hw-data-wrap" style="height:90%;padding-top: 10px;" ref="baseQnRef" v-else>
 									<vuescroll>
-										<div style="display:flex;background-color: #f8f8f9;margin: 0 20px 20px 20px;" v-if="tableData.length">
+										<div v-if="isAreaVote && currentVote.progress !== 'pending'">
+											<Select v-model="areaSchIndex" style="width:200px;margin: 10px 20px;" @on-change="getAreaRecord">
+												<Option v-for="(item,index) in areaSchList" :value="index" :key="index">{{ item }}</Option>
+											</Select>
+										</div>
+										<div style="display:flex;background-color: #f8f8f9;margin: 0 20px 20px 20px;" v-if="tableData.length || isAreaVote">
 											<BaseVotePie pieId="votePie" :pieData="studentsTable"
-												v-show="tableData.length"></BaseVotePie>
+												v-show="tableData.length || isAreaVote"></BaseVotePie>
 											<BaseVoteBar pieId="votePie2" v-if="tableData.length" :pieData="tableData">
 											</BaseVoteBar>
 										</div>
-										<BaseVoteTable :tableDatas="tableData" v-show="isOptionView"></BaseVoteTable>
-										<BaseVoteSsTable :tableDatas="studentsTable" v-show="!isOptionView" :isSecret="currentVote.secret">
+										<BaseVoteTable :tableDatas="tableData" v-show="isOptionView && !isAreaVote"></BaseVoteTable>
+										<BaseVoteSsTable :tableDatas="studentsTable" v-show="!isOptionView && !isAreaVote" :isSecret="currentVote.secret">
 										</BaseVoteSsTable>
 									</vuescroll>
 								</div>
@@ -153,7 +158,9 @@
 				isFromRecord: false,
 				areaId: sessionStorage.getItem('areaId'),
 				areaVoteTeachers: [],
-				areaRecord:[]
+				areaRecord:[],
+				areaSchIndex:0,
+				areaSchList:[],
 			}
 		},
 		created() {},
@@ -194,6 +201,7 @@
 						}],
 						publishModel: '0',
 						selectMax: 1,
+						isImmediate: this.isAreaVote ? true : false,
 						endTime: new Date(new Date().toLocaleDateString()).getTime() + 2 * 24 * 60 * 60 * 1000 - 1,
 						startTime:new Date().getTime(),
 						description: '',
@@ -300,13 +308,14 @@
 				console.log(fullItem)
 				this.currentVote = fullItem
 				this.activeVoteIndex = index
-				
+				/* 如果是区级的活动 则需要根据recordUrl去换取区级活动的作答数据 */
 				if (this.isAreaVote && item.id) {
 					this.areaVoteTeachers = []
-					// if(item.progress === 'finish')
-					console.log(this.areaRecord)
-					this.areaRecord.length && this.getAreaRecord(1)
+					this.areaSchIndex = 0
+					this.areaSchList = this.areaRecord.map(i => i.name)
+					this.areaRecord.length && this.getAreaRecord(0)
 				}else{
+					/* 其余类型活动则需要去根据发布对象获取对应的作答数据 */
 					if (item.id && item.progress !== 'pending'){
 						if(fullItem.targetType === 'research'){
 							this.getVoteTeachers(fullItem, fullItem.tchLists)
@@ -315,7 +324,7 @@
 						}
 					} 
 				}
-				this.$refs.voteForm.voteFormEdit = false
+				this.$refs.voteForm && (this.$refs.voteForm.voteFormEdit = false)
 				this.$refs.voteFormScroll.scrollTo({
 						y: 0,
 					},
@@ -331,8 +340,33 @@
 				let curSchoolInfo = this.areaRecord[schoolIndex]
 				let schoolSas = await this.$evTools.getBlobSchoolSas(curSchoolInfo.code)
 				let fullPath = this.$evTools.getBlobHost() + '/' + curSchoolInfo.code + curSchoolInfo.url + schoolSas
-				let recordJson = await this.$tools.getFile(fullPath)
-				console.log(recordJson)
+				let recordJson = JSON.parse(await this.$tools.getFile(fullPath))
+				console.log(curSchoolInfo)
+				/* 区级活动获取某个学校的作答数据 */
+				if(recordJson.options.length){
+					let arr = []
+					recordJson.options = this._.orderBy(recordJson.options,'code')
+					recordJson.options.forEach((item, index) => {
+						arr.push({
+							option: item.code ? this.$t('vote.option') + (index +
+								1) : this.$t('vote.noVote'),
+							key: item.code || '',
+							result: new Array(item.count).fill('1')
+						})
+					})
+					this.tableData = arr
+				}else{
+					this.tableData = []
+				}
+				if(recordJson.records.length){
+					/* 饼图数据 */
+					let answerdArr = recordJson.records.map(i => { return { option:'A' }})
+					let noAnswerArr = new Array(curSchoolInfo.count - recordJson.records.length).fill({ option : null })
+					this.studentsTable = answerdArr.concat(noAnswerArr)
+				}else{
+					this.studentsTable = new Array(curSchoolInfo.count).fill({ option : null })
+				}
+				console.log(this.studentsTable)
 			},
 
 			/* 获取投票活动的详细数据 */
@@ -444,31 +478,39 @@
 			
 			/* 删除区级活动 */
 			delAreaTrain() {
-				this.$Modal.confirm({
-					title: '删除区级投票活动',
-					content: '删除区级活动后,相关学校将无法参与此活动,确认删除活动吗?',
-					onOk: () => {
-						this.isLoading = true
-						let params = {
-							id: this.currentVote.id,
-							areaId: this.areaId,
-							pk: this.currentVote.pk
-						}
-						this.$api.train.delAreaTrain(params).then(
-							res => {
-								setTimeout(() => {
-									this.isLoading = false
-									this.$Message.success(this.$t('vote.deleteSuc'))
-									this.handleTabClick(this.$route.name === 'manageVote' ?
-										0 : 1)
-								}, 1000)
-							},
-							err => {
-								this.$Message.error('删除失败')
+				if (this.currentVote.id) {
+					this.$Modal.confirm({
+						title: '删除区级投票活动',
+						content: '删除区级活动后,相关学校将无法参与此活动,确认删除活动吗?',
+						onOk: () => {
+							this.isLoading = true
+							let params = {
+								id: this.currentVote.id,
+								areaId: this.areaId,
+								pk: this.currentVote.pk
 							}
-						)
-					}
-				})
+							this.$api.train.delAreaTrain(params).then(
+								res => {
+									setTimeout(() => {
+										this.isLoading = false
+										this.$Message.success(this.$t('vote.deleteSuc'))
+										this.handleTabClick(this.$route.name === 'manageVote' ?
+											0 : 1)
+									}, 1000)
+								},
+								err => {
+									this.$Message.error('删除失败')
+								}
+							)
+						}
+					})
+				}else{
+					this.voteList.splice(this.voteList.indexOf(this.currentVote), 1)
+					this.isLoading = false
+					this.$Message.success(this.$t('vote.deleteSuc'))
+					if (this.voteList.length) this.onVoteClick(this.voteList[0], 0)
+				}
+				
 			},
 
 			/** 删除当前投票 */
@@ -535,20 +577,24 @@
 							let arr = [] //选项清单
 							res.list.forEach(classStus => {
 								classStus.class.stuInfos.forEach(i => {
-									list.push({
-										id: i.id,
-										name: i.name,
-										no: i.no || 0,
-										classroomName: classStus.class.name
-									})
+									if(!list.find(j => j.id === i.id)){
+										list.push({
+											id: i.id,
+											name: i.name,
+											no: i.no || 0,
+											classroomName: classStus.class.name
+										})
+									}
 								})
 								classStus.class.tmdInfos.forEach(i => {
-									list.push({
-										id: i.id,
-										name: i.name,
-										no: i.no || 0,
-										classroomName: classStus.class.name
-									})
+									if(!list.find(j => j.id === i.id)){
+										list.push({
+											id: i.id,
+											name: i.name,
+											no: i.no || 0,
+											classroomName: classStus.class.name
+										})
+									}
 								})
 							})
 							this.studentsTable = list

+ 122 - 91
TEAMModelOS/Controllers/Common/AreaController.cs

@@ -100,7 +100,7 @@ namespace TEAMModelOS.Controllers
 
                     }
                     group = group.Where(g => !string.IsNullOrEmpty(g.id)).ToList();
-                    groups.Add((sId, group.Select(s=>s.id).ToList(), group.Select(s => s.name).ToList()));
+                    groups.Add((sId, group.Select(s => s.id).ToList(), group.Select(s => s.name).ToList()));
                 }
                 //var (blob_uri, blob_sas) = _azureStorage.GetBlobContainerSAS("hbcn", BlobContainerSasPermissions.Write | BlobContainerSasPermissions.Read | BlobContainerSasPermissions.List);
                 var gr = groups.Select(o => new
@@ -238,7 +238,7 @@ namespace TEAMModelOS.Controllers
                         string json = "所有老师(未分组)";
                         study.targets.Add(json.ToJsonString().ToObject<JsonElement>());
                         //study.targets.Add("所有老师(未分组)");
-                       
+
                     }
                     else
                     {
@@ -249,7 +249,7 @@ namespace TEAMModelOS.Controllers
                         {
                             //处理区级target
                             string sName = pa.sName + "-" + name;
-                            allName.Add(sName);                          
+                            allName.Add(sName);
 
                         }
 
@@ -364,7 +364,7 @@ namespace TEAMModelOS.Controllers
                 //区级Id
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-               // List<string> baseIds = await getId(client, id.GetString());
+                // List<string> baseIds = await getId(client, id.GetString());
                 List<object> studies = new();
 
                 var query = $"select c.id,c.img,c.name,c.type,c.startTime,c.endTime,c.presenter,c.topic,c.address,c.owner,c.school from c ";
@@ -404,57 +404,85 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                List<string> baseIds = await getId(client, areaId.GetString());
+                List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<Study> studies = new();
                 List<(string id, string name)> ps = await getInfo(client, areaId.GetString());
                 //List<string> aName = new();
                 var query = $"select value(c) from c where c.pId = '{id}'";
-                foreach (string code in baseIds)
+                foreach ((string code,string name) in baseIds)
                 {
                     await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<Study>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Study-{code}") }))
                     {
                         studies.Add(item);
                     }
                 }
-                
-                List<Survey> trSurveys = new List<Survey>();
-                List<ExamLite> trExams = new List<ExamLite>();
+
+                List<(List<TmdInfo> teac, Survey sur)> trSurveys = new List<(List<TmdInfo> teac, Survey sur)>();
+                List<(List<TmdInfo> teac, ExamLite examLite)> trExams = new List<(List<TmdInfo> teac, ExamLite examLite)>();
                 List<(List<TmdInfo> teac, Study stu)> moreInfo = new List<(List<TmdInfo> teac, Study stu)>();
-                foreach (Study study in studies) {
+                List<(List<TmdInfo> teac, TeacherWork tw)> works = new List<(List<TmdInfo> teac, TeacherWork tw)>();
+                foreach (Study study in studies)
+                {
                     (List<TmdInfo> tchList, _) = await TriggerStuActivity.GetTchList(client, _dingDing, study.tchLists, study.school);
                     if (!string.IsNullOrEmpty(study.surveyId))
                     {
-                        await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<Survey>(queryText: $"select value(c) from c where c.id = '{study.surveyId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Survey-{study.school}") }))
+
+                        var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(study.surveyId, new PartitionKey($"Survey-{study.school}"));
+                        if (sresponse.Status == 200)
                         {
-                            trSurveys.Add(item);
+                            using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
+                            Survey surs = json.ToObject<Survey>();
+                            trSurveys.Add((tchList, surs));
                         }
                     }
-                    if (!string.IsNullOrEmpty(study.examId)) {
-                        await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamLite>(queryText: $"select value(c) from c where c.id = '{study.examId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamLite-{study.school}") }))
+                    if (!string.IsNullOrEmpty(study.examId))
+                    {
+                        var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(study.examId, new PartitionKey($"ExamLite-{study.school}"));
+                        if (sresponse.Status == 200)
                         {
-                            trExams.Add(item);
+                            using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
+                            ExamLite lite = json.ToObject<ExamLite>();
+                            trExams.Add((tchList, lite));
                         }
                     }
-                    moreInfo.Add((tchList,study));
-                } ;
-                var survey = trSurveys.Select(s => new {
-                    count = s.answers.Count,
-                    ansCount = s.answers.Count,
+                    if (!string.IsNullOrEmpty(study.workId))
+                    {
+                        var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(study.examId, new PartitionKey($"TeacherWork-{study.school}"));
+                        if (sresponse.Status == 200)
+                        {
+                            using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
+                            TeacherWork work = json.ToObject<TeacherWork>();
+                            works.Add((tchList, work));
+                        }
+                    }
+                    moreInfo.Add((tchList, study));
+                };
+                var survey = trSurveys.Select(s => new
+                {
+                    count = s.teac.Count,
+                    ansCount = s.sur.answers.Count,
+                });
+                var twork = works.Select(s => new
+                {
+                    count = s.teac.Count,
+                    ansCount = s.tw.teachers.Where(h => !string.IsNullOrEmpty(h.hw)).ToList().Count,
                 });
-                var exam = trExams.Select(s => new {
-                    count = s.teachers.Count,
-                    ansCount = s.teachers.Where(h => h.answer.Count > 0).ToList().Count,
+                var exam = trExams.Select(s => new
+                {
+                    count = s.teac.Count,
+                    ansCount = s.examLite.teachers.Where(h => h.answer.Count > 0).ToList().Count,
                 });
-                var info = studies.Select(s => new {
-                    s.id,
-                    name = ps.FirstOrDefault(c => c.id == s.id).name,
-                    count = s.teachers.Count,
+                var info = moreInfo.Select(s => new
+                {
+                    s.stu.id,
+                    name = ps.FirstOrDefault(c => c.id == s.stu.id).name,
+                    count = s.teac.Count,
                     //hwCount = s.teachers.Where(h => h.hwTime > 0).ToList().Count,
-                    signCount = s.teachers.Where(h => h.signTime > 0).ToList().Count,
-                    lateCount = s.teachers.Where(h =>!string.IsNullOrEmpty(h.sign) && h.sign.Equals("1")).ToList().Count,
-                    acount = s.teachers.Where(h => h.aTime > 0).ToList().Count
+                    signCount = s.stu.teachers.Where(h => h.signTime > 0).ToList().Count,
+                    lateCount = s.stu.teachers.Where(h => !string.IsNullOrEmpty(h.sign) && h.sign.Equals("1")).ToList().Count,
+                    acount = s.stu.teachers.Where(h => h.aTime > 0).ToList().Count
                 });
-                return Ok(new { survey,exam, info, studies = moreInfo.Select(m => new { m.teac,m.stu}) });
+                return Ok(new { survey, exam, info, studies = moreInfo.Select(m => new { m.teac, m.stu }) });
             }
             catch (Exception e)
             {
@@ -478,18 +506,18 @@ namespace TEAMModelOS.Controllers
                 List<object> votes = new();
                 //List<string> aName = new();
                 var query = $"select c.id,c.name,c.startTime,c.progress,c.owner,c.school from c ";
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Vote-{id}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Vote-{id}") }))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
-                        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())
                         {
-                            foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
-                            {
-                                votes.Add(obj.ToObject<object>());
-                            }
+                            votes.Add(obj.ToObject<object>());
                         }
                     }
-                
+                }
+
 
                 return Ok(new { votes });
             }
@@ -511,20 +539,20 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                List<string> baseIds = await getId(client, areaId.GetString());
+                List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 //List<object> votes = new();
-                List<(string id, string name)> ps = await getInfo(client, areaId.GetString()) ;
+                List<(string id, string name)> ps = await getInfo(client, areaId.GetString());
                 //List<string> aName = new();
                 List<Vote> votes = new List<Vote>();
                 Vote vote = null;
-                List<(string code,string url, int count)> recordUrl = new List<(string code, string url, int count)>();
+                List<(string code,string name, string url, int count)> recordUrl = new List<(string code, string name, string url, int count)>();
                 var response = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync(id.GetString(), new PartitionKey($"Vote-{areaId}"));
                 if (response.Status == 200)
                 {
                     using var json = await JsonDocument.ParseAsync(response.ContentStream);
                     vote = json.ToObject<Vote>();
                     var query = $"select  c.tchLists,c.recordUrl from c where c.pId = '{id}'";
-                    foreach (string code in baseIds)
+                    foreach ((string code, string name) in baseIds)
                     {
                         await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Vote-{code}") }))
                         {
@@ -537,15 +565,15 @@ namespace TEAMModelOS.Controllers
                                     JsonElement account = accounts.Current;
                                     List<string> tcs = account.GetProperty("tchLists").ToObject<List<string>>();
                                     (List<TmdInfo> tchList, _) = await TriggerStuActivity.GetTchList(client, _dingDing, tcs, code);
-                                    recordUrl.Add((code,account.GetProperty("recordUrl").GetString(),tchList.Count));
+                                    recordUrl.Add((code,name, account.GetProperty("recordUrl").GetString(), tchList.Count));
                                 }
                             }
                         }
                     }
                 }
-                
+
                 //var info = ps.Select(p => new { p.id, p.name });
-                return Ok(new { vote , code = recordUrl.Select(r => new { r.code, r.url,r.count }) });
+                return Ok(new { vote, code = recordUrl.Select(r => new { r.code,r.name, r.url, r.count }) });
             }
             catch (Exception e)
             {
@@ -570,19 +598,19 @@ namespace TEAMModelOS.Controllers
                 // List<string> aName = new();
                 var query = $"select c.id,c.name,c.startTime,c.progress,c.sType,c.owner,c.school from c ";
 
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Survey-{id}") }))
-                    {
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Survey-{id}") }))
+                {
 
-                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                        if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    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())
                         {
-                            foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
-                            {
-                                surveys.Add(obj.ToObject<object>());
-                            }
+                            surveys.Add(obj.ToObject<object>());
                         }
                     }
-                
+                }
+
 
                 return Ok(new { surveys });
             }
@@ -603,17 +631,17 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                List<string> baseIds = await getId(client, areaId.GetString());
+                List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<object> surveys = new();
                 Survey survey = null;
-                List<(string code, string url, int count)> recordUrl = new List<(string code, string url, int count)>();
+                List<(string code, string name,string url, int count)> recordUrl = new List<(string code, string name,string url, int count)>();
                 var response = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync(id.GetString(), new PartitionKey($"Survey-{areaId}"));
                 if (response.Status == 200)
                 {
                     using var json = await JsonDocument.ParseAsync(response.ContentStream);
                     survey = json.ToObject<Survey>();
                     var query = $"select  c.tchLists,c.recordUrl from c where c.pId = '{id}'";
-                    foreach (string code in baseIds)
+                    foreach ((string code, string name) in baseIds)
                     {
                         await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Survey-{code}") }))
                         {
@@ -626,7 +654,7 @@ namespace TEAMModelOS.Controllers
                                     JsonElement account = accounts.Current;
                                     List<string> tcs = account.GetProperty("tchLists").ToObject<List<string>>();
                                     (List<TmdInfo> tchList, _) = await TriggerStuActivity.GetTchList(client, _dingDing, tcs, code);
-                                    recordUrl.Add((code,account.GetProperty("recordUrl").GetString(),tchList.Count));
+                                    recordUrl.Add((code, name,account.GetProperty("recordUrl").GetString(), tchList.Count));
                                 }
                             }
                         }
@@ -634,7 +662,7 @@ namespace TEAMModelOS.Controllers
                 }
 
                 //var info = ps.Select(p => new { p.id, p.name });
-                return Ok(new { survey, code = recordUrl.Select(r => new { r.code,r.url,r.count }) });
+                return Ok(new { survey, code = recordUrl.Select(r => new { r.code,r.name, r.url, r.count }) });
             }
             catch (Exception e)
             {
@@ -660,19 +688,19 @@ namespace TEAMModelOS.Controllers
                 var query = $"select c.id,c.name,c.createTime,c.sType,c.owner,c.school from c ";
 
 
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamLite-{id}") }))
-                    {
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamLite-{id}") }))
+                {
 
-                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                        if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    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())
                         {
-                            foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
-                            {
-                                exams.Add(obj.ToObject<object>());
-                            }
+                            exams.Add(obj.ToObject<object>());
                         }
                     }
-                
+                }
+
 
                 return Ok(new { exams });
             }
@@ -694,12 +722,12 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                List<string> baseIds = await getId(client, areaId.GetString());
+                List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<object> exams = new();
                 List<(string id, string name)> ps = await getInfo(client, areaId.GetString());
                 //List<string> aName = new();
                 var query = $"select c.school,c.teachers from c where c.acId = '{id}'";
-                foreach (string code in baseIds)
+                foreach ((string code, string name) in baseIds)
                 {
                     await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TrExam-{code}") }))
                     {
@@ -714,7 +742,7 @@ namespace TEAMModelOS.Controllers
                     }
                 }
                 var info = ps.Select(p => new { p.id, p.name });
-                return Ok(new {info,exams });
+                return Ok(new { info, exams });
             }
             catch (Exception e)
             {
@@ -791,7 +819,7 @@ namespace TEAMModelOS.Controllers
                     {
                         trVote.progress = "going";
                     }
-                   
+
                     if (pa.gName.Count == 0)
                     {
                         string sName = pa.sName + "-" + "所有老师(未分组)";
@@ -802,13 +830,13 @@ namespace TEAMModelOS.Controllers
                     }
                     else
                     {
-                        var tn = pa.gName.ToJsonString().ToObject<List<JsonElement>>();                      
+                        var tn = pa.gName.ToJsonString().ToObject<List<JsonElement>>();
                         trVote.targets = tn;
                         foreach (string name in pa.gName)
                         {
                             //处理区级target
                             string sName = pa.sName + "-" + name;
-                            allName.Add(sName);                          
+                            allName.Add(sName);
                         }
 
                     }
@@ -832,7 +860,7 @@ namespace TEAMModelOS.Controllers
                 {
                     atn.Add(agn.ToObject<JsonElement>());
                 }*/
-                areaVote.targets =atn;
+                areaVote.targets = atn;
                 await client.GetContainer("TEAMModelOS", "Common").UpsertItemAsync(areaVote, new PartitionKey($"{areaVote.code}"));
                 var ids = votes.Select(s => new { s.id, s.school });
                 return Ok(new { id, ids, code = (int)HttpStatusCode.OK });
@@ -860,9 +888,10 @@ namespace TEAMModelOS.Controllers
                 if (!request.TryGetProperty("pk", out JsonElement pk)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var response = await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"{pk}-{code}"));
-                List<string> bascId = await getId(client,code.GetString());
+                List<(string id, string name)> bascId = await getId(client, code.GetString());
                 List<(string id, string name)> ids = new();
-                foreach (string sId in bascId) {
+                foreach ((string sId, string name) in bascId)
+                {
                     await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select c.id,c.code from c where c.pId = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{pk}-{sId}") }))
                     {
 
@@ -877,13 +906,14 @@ namespace TEAMModelOS.Controllers
                             }
                         }
 
-                    }                   
+                    }
                 }
                 if (ids.Count > 0)
                 {
                     foreach ((string s, string c) in ids)
                     {
-                        if (c.Contains("Study")) {
+                        if (c.Contains("Study"))
+                        {
                             var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(s.ToString(), new PartitionKey($"{c}"));
                             if (sresponse.Status == 200)
                             {
@@ -898,7 +928,7 @@ namespace TEAMModelOS.Controllers
                                     await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(study.surveyId, new PartitionKey($"Survey-{study.school}"));
                                 }
                             }
-                        }                       
+                        }
                         await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(s.ToString(), new PartitionKey($"{c}"));
                     }
                 }
@@ -977,7 +1007,7 @@ namespace TEAMModelOS.Controllers
                     {
                         trSurvey.progress = "going";
                     }
-                   
+
                     if (pa.gName.Count == 0)
                     {
                         string sName = pa.sName + "-" + "所有老师(未分组)";
@@ -1010,7 +1040,7 @@ namespace TEAMModelOS.Controllers
                     }
                     else
                     {
-                       // trSurvey.blob = SurveyService.getBlob(trSurvey.id);
+                        // trSurvey.blob = SurveyService.getBlob(trSurvey.id);
                         await client.GetContainer("TEAMModelOS", "Common").UpsertItemAsync(trSurvey, new PartitionKey($"{trSurvey.code}"));
                     }
                     surveys.Add(trSurvey);
@@ -1091,7 +1121,7 @@ namespace TEAMModelOS.Controllers
                     if (string.IsNullOrEmpty(trExam.id))
                     {
                         trExam.id = Guid.NewGuid().ToString();
-                      //  trExam.blob = ExamService.getBlob(trExam.id);
+                        //  trExam.blob = ExamService.getBlob(trExam.id);
                         await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(trExam, new PartitionKey($"{trExam.code}"));
                     }
                     else
@@ -1114,11 +1144,11 @@ namespace TEAMModelOS.Controllers
 
         }
 
-        private async Task<List<string>> getId(CosmosClient client, string id)
+        private async Task<List<(string id, string name)>> getId(CosmosClient client, string id)
         {
             //获取区级以下所有学校编码和基础信息
-            List<string> baseIds = new();
-            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.areaId = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
+            List<(string id,string name)> baseIds = new();
+            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id,c.name from c where c.areaId = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -1127,7 +1157,7 @@ namespace TEAMModelOS.Controllers
                     while (accounts.MoveNext())
                     {
                         JsonElement account = accounts.Current;
-                        baseIds.Add(account.GetProperty("id").GetString());
+                        baseIds.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString()));
 
                     }
                 }
@@ -1163,12 +1193,12 @@ namespace TEAMModelOS.Controllers
 
                 string json = "所有老师(未分组)";
                 trExam.targets.Add(json.ToJsonString().ToObject<JsonElement>());
-                
+
             }
             else
             {
                 var tn = pa.gName.ToJsonString().ToObject<List<JsonElement>>();
-                trExam.targets = tn;               
+                trExam.targets = tn;
 
             }
             return Task.FromResult(trExam);
@@ -1208,7 +1238,8 @@ namespace TEAMModelOS.Controllers
             return Task.FromResult(work);
         }
 
-        private async Task<List<(string id, string name)>> getInfo(CosmosClient client, string id) {
+        private async Task<List<(string id, string name)>> getInfo(CosmosClient client, string id)
+        {
             List<(string id, string name)> scInfos = new List<(string id, string name)>();
             await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id,c.name from c where c.areaId = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
             {

+ 77 - 29
TEAMModelOS/Controllers/Research/AbilityStatisticsController.cs

@@ -637,7 +637,7 @@ namespace TEAMModelOS.Controllers.Research
                     abilities.Add(item);
                 }
                 List<string> abilitieIds = abilities.Select(x => x.id).ToList();
-                List<ScTeacher> teachers = new List<ScTeacher>();
+               // List<ScTeacher> teachers = new List<ScTeacher>();
                 List<ClassVideo> classVideos = new List<ClassVideo>();
                 List<AbilitySub> abilitySubs = new List<AbilitySub>();
 
@@ -647,21 +647,42 @@ namespace TEAMModelOS.Controllers.Research
                 {
                     classVideos.Add(item);
                 }
-                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScTeacher>(queryText: $"SELECT c.groupName,c.groupId, c.id, c.name,   c.picture  FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{_school}") }))
+                //await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScTeacher>(queryText: $"SELECT c.groupName,c.groupId, c.id, c.name,   c.picture  FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{_school}") }))
+                //{
+                //    if (string.IsNullOrEmpty(item.groupId))
+                //    {
+                //        item.groupId = "default";
+                //        item.groupName = "默认组别";
+                //    }
+                //    groups.Add(item.groupName);
+                //    groupDict[item.groupName] = item.groupId;
+                //    teachers.Add(item);
+                //}
+
+                List<TchList> tchLists = new List<TchList>();
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<TchList>(queryText: $"SELECT value(c) FROM c  ",
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TchList-{_school}") }))
                 {
-                    if (string.IsNullOrEmpty(item.groupId))
-                    {
-                        item.groupId = "default";
-                        item.groupName = "默认组别";
+                    groups.Add(item.name);
+                    groupDict[item.name] = item.id;
+                    tchLists.Add(item);
+                }
+                List<string> ids = tchLists.Select(x => x.id).ToList();
+                if (!ids.IsNotEmpty())
+                {
+                    ids.Add("default");
+                }
+                (List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{_school}");
+                List< GroupMember > teachers= new List<GroupMember>();
+                foreach (var classInfo in classInfos) {
+                    foreach (var tmdinfo in classInfo.tmdInfos) {
+                        teachers.Add(new GroupMember { groupId = classInfo.id, groupName = classInfo.name, tmdid = tmdinfo.id, tmdname = tmdinfo.name, picture = tmdinfo.picture });
                     }
-                    groups.Add(item.groupName);
-                    groupDict[item.groupName] = item.groupId;
-                    teachers.Add(item);
                 }
                 foreach (var tec in teachers)
                 {
                     await foreach (var sub in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
-                         .GetItemQueryIterator<AbilitySub>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{_school}-{tec.id}") }))
+                         .GetItemQueryIterator<AbilitySub>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{_school}-{tec.tmdid}") }))
                     {
                         abilitySubs.Add(sub);
                     }
@@ -801,7 +822,7 @@ namespace TEAMModelOS.Controllers.Research
                     //    }
                     //}
                     bool isJoinVideo = false;
-                    ClassVideo classVideo = classVideos.Find(x => x.id.Equals(t.id));
+                    ClassVideo classVideo = classVideos.Find(x => x.id.Equals(t.tmdid));
                     if (classVideo != null && classVideo.files.IsNotEmpty())
                     {
                         isJoinVideo = true;
@@ -815,7 +836,7 @@ namespace TEAMModelOS.Controllers.Research
                     }
 
                     List<SubStatistic> subs = new();
-                    abilitySubs.Where(x => x.code.Equals($"AbilitySub-{_school}-{t.id}")).ToList().ForEach(item => {
+                    abilitySubs.Where(x => x.code.Equals($"AbilitySub-{_school}-{t.tmdid}")).ToList().ForEach(item => {
                         subCount += 1;
                         thcSubCount += 1;
                         if (item.exerciseScore > 0)
@@ -895,8 +916,8 @@ namespace TEAMModelOS.Controllers.Research
                             tchSubmitCount = tchSubmitCount,
                             tchUnSubmitCount = tchUnSubmitCount,
                             thcSubCount = thcSubCount,
-                            tmdname = t.name,
-                            tmdid = t.id,
+                            tmdname = t.tmdname,
+                            tmdid = t.tmdid,
                             picture = t.picture,
                             groupName = t.groupName,
                             groupId = t.groupId,
@@ -1117,17 +1138,37 @@ namespace TEAMModelOS.Controllers.Research
                 {
                     abilities.Add(item);
                 }
-                List<ScTeacher> teachers = new List<ScTeacher>();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScTeacher>(queryText: $"SELECT c.groupName,c.groupId, c.id, c.name,   c.picture  FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school}") }))
+                //List<ScTeacher> teachers = new List<ScTeacher>();
+                //await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScTeacher>(queryText: $"SELECT c.groupName,c.groupId, c.id, c.name,   c.picture  FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school}") }))
+                //{
+                //    if (string.IsNullOrEmpty(item.groupId))
+                //    {
+                //        item.groupId = "default";
+                //        item.groupName = "默认组别";
+                //    }
+                //    teachers.Add(item);
+                //}
+
+                List<TchList> tchLists = new List<TchList>();
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<TchList>(queryText: $"SELECT value(c) FROM c  ",
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TchList-{_school}") }))
                 {
-                    if (string.IsNullOrEmpty(item.groupId))
+                    tchLists.Add(item);
+                }
+                List<string> ids = tchLists.Select(x => x.id).ToList();
+                if (!ids.IsNotEmpty())
+                {
+                    ids.Add("default");
+                }
+                (List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{_school}");
+                List<GroupMember> teachers = new List<GroupMember>();
+                foreach (var classInfo in classInfos)
+                {
+                    foreach (var tmdinfo in classInfo.tmdInfos)
                     {
-                        item.groupId = "default";
-                        item.groupName = "默认组别";
+                        teachers.Add(new GroupMember { groupId = classInfo.id, groupName = classInfo.name, tmdid = tmdinfo.id, tmdname = tmdinfo.name, picture = tmdinfo.picture });
                     }
-                    teachers.Add(item);
                 }
-
                 if ($"{_all}".Equals("1"))
                 {
                     List<SubGroupMember> groupMembers = new List<SubGroupMember>();
@@ -1139,13 +1180,13 @@ namespace TEAMModelOS.Controllers.Research
                         {
 
                             await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
-                                .GetItemQueryIterator<AbilitySub>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{school}-{t.id}") }))
+                                .GetItemQueryIterator<AbilitySub>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{school}-{t.tmdid}") }))
                             {
                                // comids.Add(item.comid);
                                 groupMembers.Add(new SubGroupMember
                                 {
-                                    tmdname = t.name,
-                                    tmdid = t.id,
+                                    tmdname = t.tmdname,
+                                    tmdid = t.tmdid,
                                     picture = t.picture,
                                     groupName = t.groupName,
                                     groupId = t.groupId,
@@ -1204,7 +1245,7 @@ namespace TEAMModelOS.Controllers.Research
                 }
                 else
                 {
-                    var teacer = teachers.Find(x => x.id.Equals($"{_tmdid}"));
+                    var teacer = teachers.Find(x => x.tmdid.Equals($"{_tmdid}"));
                     if (teacer != null)
                     {
                         //List<Debate> debates = new List<Debate>();
@@ -1214,14 +1255,14 @@ namespace TEAMModelOS.Controllers.Research
                         foreach (var t in tecs)
                         {
                             //排除自己
-                            if (t.id.Equals($"{_tmdid}")) { continue; }
+                            if (t.tmdid.Equals($"{_tmdid}")) { continue; }
                             await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
-                                .GetItemQueryIterator<AbilitySub>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{school}-{t.id}") }))
+                                .GetItemQueryIterator<AbilitySub>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{school}-{t.tmdid}") }))
                             {
                                 groupMembers.Add(new SubGroupMember
                                 {
-                                    tmdname = t.name,
-                                    tmdid = t.id,
+                                    tmdname = t.tmdname,
+                                    tmdid = t.tmdid,
                                     picture = t.picture,
                                     groupName = t.groupName,
                                     groupId = t.groupId,
@@ -1293,6 +1334,13 @@ namespace TEAMModelOS.Controllers.Research
             public List<SubUpload> uploads { get; set; }
             public List<OtherScore> otherScore { get; set; }
         }
+        public class GroupMember {
+            public string tmdname { get; set; }
+            public string tmdid { get; set; }
+            public string picture { get; set; }
+            public string groupName { get; set; }
+            public string groupId { get; set; }
+        }
         public class SubGroupMember
         {
             public string tmdname { get; set; }

+ 1 - 1
TEAMModelOS/Controllers/Research/AbilityTaskController.cs

@@ -224,7 +224,7 @@ namespace TEAMModelOS.Controllers.Research
                 int rnodeCount=0;
                 ability = await client.GetContainer("TEAMModelOS", "School").ReadItemAsync<Ability>($"{abilityId}", new PartitionKey($"Ability-{standard}"));
                 await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c where c.abilityId='{abilityId}'",
-                    requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"AbilityTask-{ability.standard}") }))
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"AbilityTask-{standard}") }))
                 {
                     var rns = item.children.Select(x => x.rnodes);
                     if (rns != null)

+ 2 - 2
TEAMModelOS/Controllers/Research/AppraiseController.cs

@@ -251,8 +251,8 @@ namespace TEAMModelOS.Controllers.Research
                         Debate rdebate = null;
                         try {
                               rdebate = await client.GetContainer("TEAMModelOS", "School").ReadItemAsync<Debate>($"{_videoId}", new PartitionKey($"Debate-{_atSchool}"));
-                        } catch (CosmosException ex) { 
-                        
+                        } catch (CosmosException ex) {
+                            rdebate = null;
                         }
                         if (appraises.roles != null) {
                             appraises.roles.ToList().ForEach(x => {

+ 125 - 33
TEAMModelOS/Controllers/Research/ClassVideoController.cs

@@ -51,23 +51,33 @@ namespace TEAMModelOS.Controllers.Research
                 var client = _azureCosmos.GetCosmosClient();
                 if (!request.TryGetProperty("tmdid", out JsonElement _tmdid)) return BadRequest();
                 if (!request.TryGetProperty("school", out JsonElement _school)) return BadRequest(); 
-                List<ScTeacher> teachers = new List<ScTeacher>();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScTeacher>(queryText: $"SELECT c.groupName,c.groupId, c.id, c.name,   c.picture  FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{_school}") }))
+                //List<ScTeacher> teachers = new List<ScTeacher>();
+                //await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScTeacher>(queryText: $"SELECT c.groupName,c.groupId, c.id, c.name,   c.picture  FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{_school}") }))
+                //{
+                //    if (string.IsNullOrEmpty(item.groupId)) {
+                //        item.groupId = "default";
+                //        item.groupName = "默认组别";
+                //    }
+                //    teachers.Add(item);
+                //}
+                List<TchList> tchLists = new List<TchList>();
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<TchList>(queryText: $"SELECT value(c) FROM c  join A1 in c.teachers where A1='{_tmdid}'",
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TchList-{_school}") }))
                 {
-                    if (string.IsNullOrEmpty(item.groupId)) {
-                        item.groupId = "default";
-                        item.groupName = "默认组别";
-                    }
-                    teachers.Add(item);
+                    tchLists.Add(item);
+                }
+                List<string> ids = tchLists.Select(x => x.id).ToList();
+                if (!ids.IsNotEmpty())
+                {
+                    ids.Add("default");
                 }
-                var teacer = teachers.Find(x => x.id .Equals($"{_tmdid}"));
-                if (teacer != null ) 
+                (List<TmdInfo> tmdInfos, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{_school}");
+                if (classInfos.IsNotEmpty())
                 {
-                    if (!string.IsNullOrEmpty(teacer.groupId))
+                    List<dynamic> groupMembers = new List<dynamic>();
+                    foreach (var classinfo in classInfos)
                     {
-                        List<dynamic> groupMembers = new List<dynamic>();
-                        var tecs = teachers.Where(x => !string.IsNullOrEmpty(x.groupId) && x.groupId.Equals(teacer.groupId)).ToList();
-                        foreach (var t in tecs)
+                        foreach (var t in classinfo.tmdInfos)
                         {
                             //排除自己
                             if (t.id.Equals($"{_tmdid}")) { continue; }
@@ -76,15 +86,16 @@ namespace TEAMModelOS.Controllers.Research
                                 ClassVideo classVideo = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<ClassVideo>(t.id, partitionKey: new PartitionKey($"ClassVideo-{_school}"));
                                 if (classVideo.files.IsNotEmpty())
                                 {
-                                    foreach (var file in classVideo.files) {
+                                    foreach (var file in classVideo.files)
+                                    {
                                         groupMembers.Add(new
                                         {
                                             tmdname = t.name,
                                             tmdid = t.id,
                                             picture = t.picture,
-                                            groupName = t.groupName,
-                                            groupId = t.groupId,
-                                            roles=t.roles,
+                                            groupName = classinfo.name,
+                                            groupId = classinfo.id,
+                                            // roles = t.roles,
                                             school = $"{_school}",
                                             score = file.score,
                                             vid = file.id,
@@ -101,16 +112,64 @@ namespace TEAMModelOS.Controllers.Research
 
                             }
                         }
-                        return Ok(new { groupMembers });
-                    }
-                    else {
-                        return Ok(new{ });
                     }
+                    return Ok(new { groupMembers });
                 }
-                else
-                {
-                    return BadRequest("");
+                else {
+                    return Ok(new { });
                 }
+
+                //var teacer = teachers.Find(x => x.id .Equals($"{_tmdid}"));
+                //if (teacer != null ) 
+                //{
+                //    if (!string.IsNullOrEmpty(teacer.groupId))
+                //    {
+                //        List<dynamic> groupMembers = new List<dynamic>();
+                //        var tecs = teachers.Where(x => !string.IsNullOrEmpty(x.groupId) && x.groupId.Equals(teacer.groupId)).ToList();
+                //        foreach (var t in tecs)
+                //        {
+                //            //排除自己
+                //            if (t.id.Equals($"{_tmdid}")) { continue; }
+                //            try
+                //            {
+                //                ClassVideo classVideo = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<ClassVideo>(t.id, partitionKey: new PartitionKey($"ClassVideo-{_school}"));
+                //                if (classVideo.files.IsNotEmpty())
+                //                {
+                //                    foreach (var file in classVideo.files) {
+                //                        groupMembers.Add(new
+                //                        {
+                //                            tmdname = t.name,
+                //                            tmdid = t.id,
+                //                            picture = t.picture,
+                //                            groupName = t.groupName,
+                //                            groupId = t.groupId,
+                //                            roles=t.roles,
+                //                            school = $"{_school}",
+                //                            score = file.score,
+                //                            vid = file.id,
+                //                            vurl = file.url,
+                //                            vname = file.name,
+                //                            vsize = file.size,
+                //                            vtime = file.time
+                //                        });
+                //                    }
+                //                }
+                //            }
+                //            catch (CosmosException ex)
+                //            {
+
+                //            }
+                //        }
+                //        return Ok(new { groupMembers });
+                //    }
+                //    else {
+                //        return Ok(new{ });
+                //    }
+                //}
+                //else
+                //{
+                //    return BadRequest("");
+                //}
             }
             catch (Exception ex)
             {
@@ -127,27 +186,60 @@ namespace TEAMModelOS.Controllers.Research
             {
                 var client = _azureCosmos.GetCosmosClient();
                 if (!request.TryGetProperty("school", out JsonElement _school)) return BadRequest();
-                string code = $"ClassVideo-{_school}";
-                List<ScTeacher> teachers = new List<ScTeacher>();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScTeacher>(queryText: $"SELECT c.groupName,c.groupId, c.id, c.name,   c.picture  FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{_school}") }))
+                
+                //List<ScTeacher> teachers = new List<ScTeacher>();
+                //await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScTeacher>(queryText: $"SELECT c.groupName,c.groupId, c.id, c.name,   c.picture  FROM c", 
+                //    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{_school}") }))
+                //{
+                //    teachers.Add(item);
+                //}
+                List<TchList> tchLists = new List<TchList>();
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<TchList>(queryText: $"SELECT value(c) FROM c",
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TchList-{_school}") }))
                 {
-                    teachers.Add(item);
+                    tchLists.Add(item);
+                }
+                List<string> ids = tchLists.Select(x => x.id).ToList();
+                if (!ids.IsNotEmpty()) {
+                    ids.Add("default");
                 }
+                (List<TmdInfo> tmdInfos,List<ClassListInfo> classInfos )  =  await   TriggerStuActivity.GetTchList(client, _dingDing, ids, $"{_school}");
                 List<dynamic> classVideos = new();
-                foreach (var t in teachers) {
+                string code = $"ClassVideo-{_school}";
+                foreach (var listInfo in classInfos) {
                     try
                     {
-                        
                         await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
-                            .GetItemQueryIterator<ClassVideo>(queryText: $"select value(c) from c where c.id='{t.id}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+                            .GetItemQueryIterator<ClassVideo>(queryText: $"select value(c) from c where c.id in ({string.Join(",", listInfo.tmdInfos.Select(o => $"'{o.id}'"))})", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
                         {
-                            foreach (var vids in item.files) {
-                                classVideos.Add(new { videos = vids, teacher = t,school=item.school });
+                            TmdInfo info= listInfo.tmdInfos.Find(x => x.id.Equals(item.id));
+                            if (info != null) {
+                                dynamic t = new { id=info.id,name=info.name, picture=info.picture, groupId= listInfo.id, groupName=listInfo.name };
+                                foreach (var vids in item.files)
+                                {
+                                    classVideos.Add(new { videos = vids, teacher = t, school = item.school });
+                                }
                             }
+                            
                         }
                     }
                     catch (CosmosException ex) { }
                 }
+
+                //foreach (var t in teachers) {
+                //    try
+                //    {
+                //        await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher")
+                //            .GetItemQueryIterator<ClassVideo>(queryText: $"select value(c) from c where c.id='{t.id}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+                //        {
+                //            foreach (var vids in item.files)
+                //            {
+                //                classVideos.Add(new { videos = vids, teacher = t, school = item.school });
+                //            }
+                //        }
+                //    }
+                //    catch (CosmosException ex) { }
+                //}
                 return Ok(new { classVideos });
             }
             catch (Exception ex) { 

+ 2 - 2
TEAMModelOS/Controllers/XTest/TestController.cs

@@ -291,8 +291,8 @@ namespace TEAMModelOS.Controllers
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
-                (List<TmdInfo> tchList, _) =await TriggerStuActivity.GetTchList(client, _dingDing, new List<string> { "76739d39-b9c1-d34f-8407-836369a4f3a2", "82c216a2-2595-ffc7-1b80-5455e064bc03" }, "hbcn");
-                return Ok(new { code = 1, tchList });
+                (List<TmdInfo> tchList, List<ClassListInfo> classInfos) = await TriggerStuActivity.GetTchList(client, _dingDing, new List<string> { "76739d39-b9c1-d34f-8407-836369a4f3a2", "82c216a2-2595-ffc7-1b80-5455e064bc03" , "a981419a-6c35-22fe-f339-8f46e5a41456" }, "hbcn");
+                return Ok(new { code = 1, tchList, classInfos });
             }
             catch (Exception e)
             {

+ 0 - 15
TEAMModelOS/MSBuild_Logs/MSBuild_pid-1876_f6a33b090fd448c2b17d2796477abb8e.failure.txt

@@ -1,15 +0,0 @@
-UNHANDLED EXCEPTIONS FROM PROCESS 1876:
-=====================
-2021/9/9 15:59:50
-System.UnauthorizedAccessException: 对路径“C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\MSBuild_Logs”的访问被拒绝。
-   在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
-   在 System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
-   在 System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
-   在 Microsoft.Build.Shared.ExceptionHandling.DumpExceptionToFile(Exception ex)
-   在 Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)
-   在 Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.PacketPumpProc()
-   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
-   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
-   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
-   在 System.Threading.ThreadHelper.ThreadStart()
-===================