浏览代码

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

zj 2 年之前
父节点
当前提交
03aa3b3ca7
共有 32 个文件被更改,包括 1312 次插入277 次删除
  1. 4 0
      TEAMModelBI/ClientApp/src/api/index.js
  2. 264 13
      TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue
  3. 20 19
      TEAMModelBI/ClientApp/src/view/index/index.vue
  4. 40 3
      TEAMModelBI/ClientApp/src/view/systemConfig/operate.vue
  5. 2 2
      TEAMModelBI/ClientApp/src/view/teachermanage/manage.vue
  6. 41 34
      TEAMModelBI/Controllers/BINormal/AreaRelevantController.cs
  7. 491 147
      TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs
  8. 38 0
      TEAMModelBI/Controllers/BISchool/SchoolController.cs
  9. 8 8
      TEAMModelBI/Controllers/BITeacher/TeacherController.cs
  10. 25 0
      TEAMModelBI/Controllers/Census/SchoolController.cs
  11. 1 1
      TEAMModelBI/Controllers/LoginController.cs
  12. 34 0
      TEAMModelBI/Models/AssistSchool.cs
  13. 3 3
      TEAMModelBI/TEAMModelBI.csproj
  14. 6 0
      TEAMModelOS.SDK/Context/Constant/Constant.cs
  15. 119 10
      TEAMModelOS.SDK/DI/CoreAPI/CoreAPIHttpService.cs
  16. 5 0
      TEAMModelOS.SDK/Models/Cosmos/BI/DingDingUserInfo.cs
  17. 2 0
      TEAMModelOS.SDK/Models/Cosmos/Teacher/Teacher.cs
  18. 5 1
      TEAMModelOS.SDK/Models/Service/Common/TeacherService.cs
  19. 14 10
      TEAMModelOS/ClientApp/src/api/schoolSetting.js
  20. 3 2
      TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/Exam.vue
  21. 2 2
      TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/ExamQu.vue
  22. 1 1
      TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/ExamTable.vue
  23. 2 1
      TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/RecordView.less
  24. 52 3
      TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/RecordView.vue
  25. 1 1
      TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/ScoreBarChart.vue
  26. 14 3
      TEAMModelOS/ClientApp/src/view/settings/Index.vue
  27. 11 1
      TEAMModelOS/Controllers/Both/ShareController.cs
  28. 5 3
      TEAMModelOS/Controllers/Normal/ArtSettingController.cs
  29. 39 9
      TEAMModelOS/Controllers/Teacher/InitController.cs
  30. 20 0
      TEAMModelOS/Lang/en-us.json
  31. 20 0
      TEAMModelOS/Lang/zh-cn.json
  32. 20 0
      TEAMModelOS/Lang/zh-tw.json

+ 4 - 0
TEAMModelBI/ClientApp/src/api/index.js

@@ -122,6 +122,10 @@ export default {
     deleteAdmin(data) {
         return post('/area/del-manage', data)
     },
+    //管理员所管理学校
+    adminRelevanceschool(data){
+        return post('/schoolcheck/get-managescs',data)
+    },
 
     //学校管理
     //获取所有学校或 单独某个学校信息

+ 264 - 13
TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue

@@ -169,7 +169,7 @@
                   {{ $t(`areaManages.operational.areaAddSchool.tabletitle`) }}
                 </div>
                 <div :class="[!PowerShow ? 'subjoin':'','schoolRight-table']">
-                  <el-table :data="tableDatas" style="width: 100%" height="535">
+                  <el-table :data="tableDatas" style="width: 100%" height="535"> 
                     <el-table-column prop="index" :label="$t(`areaManages.operational.areaAddSchool.tables.serialnum`)" type="index" />
                     <el-table-column :label="$t(`areaManages.operational.areaAddSchool.tables.badge`)" align="center">
                       <template #default="scope">
@@ -247,14 +247,14 @@
               <div class="setadmin">
                 <div class="admin-List">
                   <p class="admin-List-title">学区管理员列表</p>
-                  <div class="list-item" v-for="(item,index) in adminData" :key="index">
-                    <div class="list-item-photo">
+                  <div :class="[adminIndex ===index ? 'patch-item':'list-item']" v-for="(item,index) in adminData" :key="index">
+                    <div class="list-item-photo" @click="admintheSchool(item.id,index)">
                       <div class="headerPhoto">
                         <el-image style="width: 55px; height: 55px;border-radius:50%" :src="item.picture" fit="fill" v-if="item.picture !=='' "></el-image>
                         <PersonalPhoto style="cursor: pointer;" :name="item.name" width="55px" height="55px" v-else></PersonalPhoto>
                       </div>
                     </div>
-                    <div class="list-item-left">
+                    <div class="list-item-left" @click="admintheSchool(item.id,index)">
                       <p class="list-item-left-name">{{item.name}}</p>
                       <p class="list-item-left-content"><span class="list-item-left-title">醍摩豆账号:</span><span>{{item.id}}</span></p>
                       <!-- <p class="list-item-left-content"><span class="list-item-left-title">手机号:</span><span>{{item.mobile}}</span></p> -->
@@ -269,7 +269,7 @@
                     </div>
                   </div>
                 </div>
-                <div class="setadmin-add">
+                <div class="setadmin-add" v-if="adminOrsearch ==='search'">
                   <p class="admin-List-title">添加学区管理者</p>
                   <div class="admin-searchbox">
                     <div class="admin-text">
@@ -302,7 +302,7 @@
                             <!-- <p class="result-text-phone">{{searchData.mobile}}</p> -->
                           </div>
                           <div class="anewbox">
-                            <el-button type="primary" size="small" @click="addAreaadmin()" class="anewbox-btn">加入到学区管理员</el-button>
+                            <el-button type="primary" size="small" @click="stageShow.state=true" class="anewbox-btn">加入到学区管理员</el-button>
                             <el-button type="primary" size="small" class="anewbox-btn" @click="searchState=false,searchData='',adminfilter=''">重新检索人员</el-button>
                           </div>
                         </div>
@@ -310,6 +310,40 @@
                     </div>
                   </div>
                 </div>
+                <div class="examine" v-else-if="adminOrsearch ==='Vdetails'">
+                  <p class="admin-List-title">
+                    <div>当前管理学校列表</div>
+                    <div><el-button size="small" type="primary" @click="adminOrsearch='search',adminIndex=-1" :icon="Search">
+                      <el-icon><Back /></el-icon>
+                      添加管理员</el-button></div>
+                    </p>
+                  <div class="examine-tables">
+                    <div class="stagebox-table" >
+                  <el-table :data="adminSchoold.data" style="width: 100%" max-height="50vh" height="50vh" v-loading="adminSchoold.loading" element-loading-text="数据加载中...">
+                    <el-table-column :label="$t(`areaManages.operational.areaAddSchool.tables.badge`)" align="center">
+                      <template #default="scope">
+                        <el-image :src="scope.row.picture" fit="fill"></el-image>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="name" :label="$t(`areaManages.operational.areaAddSchool.tables.name`)" align="center" />
+                    <el-table-column prop="id" :label="$t(`areaManages.operational.areaAddSchool.tables.brevityCode`)" align="center" />
+                    <el-table-column label="位置" align="center">
+                      <template #default="scope">
+                        {{scope.row.province}}{{scope.row.city}}{{scope.row.dist}}
+                      </template>
+                    </el-table-column>
+                    <el-table-column align="center">
+                      <template #header>
+                        <el-input v-model="schoolSearch" size="small" placeholder="搜索学校名称/简码" clearable />
+                      </template>
+                      <template #default="scope">
+                        <el-button type="danger" size="small">移除对该校管理</el-button>
+                      </template>
+                    </el-table-column>
+                  </el-table>
+                </div>
+                  </div>
+                </div>
               </div>
             </div>
           </el-tab-pane>
@@ -407,26 +441,73 @@
           </div>
         </template>
       </el-dialog>
+      <!--询问加入管理员方式-->
+      <el-dialog v-model="stageShow.state" :width="stageShow.width" :show-close="false"  :close-on-press-escape="false" :close-on-click-modal="false">
+        <div class="stagebox" v-if="stageShow.definedShow===false" v-loading="adminSchoold.allLoading" element-loading-text="正在设置相应内容...">
+          <div class="stagebox-title">加入学区管理员</div>
+          <div class="stagebox-text">请问加入学区管理员方式:</div>
+          <div class="stagebox-btns">
+            <div><el-button size="small" @click="addAreaadmin()">仅加入学区管理员</el-button></div>
+            <div><el-button size="small" @click="batchAddadmin('all')">加入学区及成为所有学校管理员</el-button></div>
+            <div><el-button size="small" @click="defined()">加入学区及自定义学校管理员</el-button></div>
+            <div><el-button size="small" @click="stageShow.state=false">取消</el-button></div>
+          </div>
+        </div>
+        <div class="stagebox-defined" v-else-if="stageShow.definedShow ===true" v-loading="adminSchoold.customLoading" element-loading-text="正在设置相应内容...">
+          <div class="stagebox-defined-title">
+            <div class="left-title">学区学校列表</div>
+            <div class="right-back"><el-button size="small" type="primary" @click="stageShow.definedShow=false,stageShow.width='20%'"> <el-icon><Back /></el-icon>返回</el-button></div>
+          </div>
+          <div class="stagebox-table">
+            <el-table :data="stageShow.definedData" style="width: 100%" max-height="50vh" height="40vh" @selection-change="selectChange">
+                    <el-table-column type="selection" width="55" />
+                    <el-table-column :label="$t(`areaManages.operational.areaAddSchool.tables.badge`)" align="center">
+                      <template #default="scope">
+                        <el-image :src="scope.row.picture" fit="fill"></el-image>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="name" :label="$t(`areaManages.operational.areaAddSchool.tables.name`)" align="center" />
+                    <el-table-column prop="id" :label="$t(`areaManages.operational.areaAddSchool.tables.brevityCode`)" align="center" />
+                    <el-table-column label="位置" align="center">
+                      <template #default="scope">
+                        {{scope.row.province}}{{scope.row.city}}{{scope.row.dist}}
+                      </template>
+                    </el-table-column>
+                    <el-table-column align="center">
+              <template #header>
+                <el-input v-model="schoolSearch" size="small" placeholder="搜索学校名称/简码" clearable />
+              </template>
+            </el-table-column>
+            </el-table>
+          </div>
+          <div class="stagebox-verify">
+            <el-button size="small" type="primary" class="verify-btn" v-if="concernSchoolArr.length !==0" @click="batchAddadmin('topo')">选中学校及成为管理员</el-button>
+            <el-button size="small" type="primary" class="verify-btn" disabled v-else>选中学校及成为管理员</el-button>
+          </div>
+        </div>
+      </el-dialog>
+       <!--询问加入管理员方式end-->
     </div>
   </div>
 </template>
 <script>
 import { ref, onMounted, getCurrentInstance, reactive, h, watch } from 'vue'
 import { useStore } from 'vuex'
-import { ElMessageBox, ElMessage } from 'element-plus'
+import { ElMessageBox, ElMessage,ElLoading } from 'element-plus'
 import router from '@/router/index.js'
 import { useRouter } from 'vue-router'
 import Ability from '@/components/Ability.vue'
 import option from '@/static/region.json'
 import loadingsz from '@/components/loading/partial.vue'
-import { CopyDocument } from '@element-plus/icons-vue'
+import { CopyDocument,Back } from '@element-plus/icons-vue'
 import useClipboard from 'vue-clipboard3'
 const optionsData = option
 export default {
   components: {
     Ability,
     loadingsz,
-    CopyDocument
+    CopyDocument,
+    Back
   },
   setup () {
     let { proxy } = getCurrentInstance()
@@ -458,7 +539,7 @@ export default {
     })
     let abilityModel = ref(true)
     const routerInfo = useRouter()
-    const tableDatas = ref([])
+    let tableDatas = ref([])
     let CutNotarize = ref(false)
     //选择的替换方案
     let replaceProject = ref()
@@ -490,6 +571,26 @@ export default {
     let addmodels = ref('1')
     let addSchoolitem = ref()
     let loadingSchoolList = ref(true)
+    let stageShow=ref({
+      state:false,
+      width:'20%',
+      definedShow:false,
+      definedData:[],
+      schoolValues:'',
+      original:[],
+    })
+    let concernSchoolArr=ref ([])
+    let adminIndex=ref(-1)
+    let adminSchoold=ref({
+      data:[],
+      loading:false,
+      allLoading:false,
+      customLoading:false,
+    })
+    let schoolSearch=ref('')
+    let timer=ref('')
+    //添加管理员及查看管理员管理学校状态
+    let adminOrsearch=ref('search')
     onMounted(() => {
       provinceOptions.value.optionInfo = optionsData
     })
@@ -535,7 +636,7 @@ export default {
       let data = { areaId: currentlySelect.value.id }
       proxy.$api.getForareaSchool(data).then((res) => {
         console.log(res, '现在区域拥有的学校')
-        res.state === 200 ? tableDatas.value.push(...res.joinAreaSchools) : ''
+        res.state === 200 ? (tableDatas.value.push(...res.joinAreaSchools),stageShow.value.definedData.push(...res.joinAreaSchools),stageShow.value.original.push(...res.joinAreaSchools)) : ''
       })
     }
     //获取当前未加入区的所有学校
@@ -811,6 +912,25 @@ export default {
           ElMessage.error('添加学区管理员失败')
         })
     }
+    //批量加入管理员
+    function batchAddadmin(state){
+      const loading = ElLoading.service({
+      lock: true,
+      text: '正在设置相应内容',
+      background: 'rgba(0, 0, 0, 0.5)',
+    })
+      let data=state ==='all' ? ({tmdId: searchData.value.id, tmdName: searchData.value.name, tmdPic: searchData.value.picture, areaId: currentlySelect.value.id, areaName: currentlySelect.value.name,isSc:'yesm',scInfos:tableDatas.value})
+      :({tmdId: searchData.value.id, tmdName: searchData.value.name, tmdPic: searchData.value.picture, areaId: currentlySelect.value.id, areaName: currentlySelect.value.name,isSc:'yesm',scInfos:concernSchoolArr.value})
+      proxy.$api.areaAddadmins(data).then((res)=>{
+        res.state === 200 ? (ElMessage.success('操作成功'), getAreasadmin()) : ''
+      }).catch((error)=>{
+        ElMessage.error('批量添加学区管理员失败')
+      })
+      setTimeout(() => {
+    loading.close()
+  }, 1000)
+      // state === 'all' ? adminSchoold.value.allLoading=false:adminSchoold.value.customLoading=false
+    }
     function removeadmin (value) {
       console.log(value)
       if (adminData.value.length <= 1) {
@@ -839,6 +959,44 @@ export default {
           })
       })
     }
+    //自定义加入学区管理员
+    function defined(){
+      stageShow.value.definedShow=true
+      stageShow.value.width='55%'
+    }
+    function selectChange (value) {
+      console.log(value)
+      concernSchoolArr.value = value
+      console.log(concernSchoolArr.value)
+    }
+    function debounce (fn, wait) {
+      if (timer.value !== null) {
+        clearTimeout(timer.value)
+      }
+      timer.value = setTimeout(fn, wait)
+    }
+    function personnelSearch () {
+      let arr = stageShow.value.definedData
+      let newArr = arr.filter((item) => {
+        // return (item.name && item.name.includes(filterText.value)) || (item.mobile && item.mobile.includes(filterText.value)) || (item.mobile && item.mobile.tmdId.includes(filterText.value))
+        return item.name.includes(schoolSearch.value) || item.id.includes(schoolSearch.value)
+      })
+      stageShow.value.definedData = newArr
+    }
+    //学区内某个管理员关联的学校
+    function admintheSchool(id,index){
+      adminSchoold.value.loading=true
+      adminOrsearch.value='Vdetails'
+      adminIndex.value=index
+      let data={tmdId:id}
+      proxy.$api.adminRelevanceschool(data).then((res)=>{
+        console.log(res,'管理返回')
+        res.state === 200 ? adminSchoold.value.data=res.mScInfos:''
+      }).catch((error)=>{
+        ElMessage.error('API异常,加载管理员管理学校列表失败')
+      })
+      adminSchoold.value.loading=false
+    }
     watch(abilityModel, (newdata) => {
       console.log(newdata)
       newdata
@@ -847,6 +1005,14 @@ export default {
         : ((cutbtnTitle.value.name = '查看能力点数据'),
           (cutbtnTitle.value.icon = '#icon-chakan2'))
     })
+    watch(schoolSearch, (newdata) => {
+      console.log('11111')
+      if (newdata.trim().length !== 0) {
+        debounce(personnelSearch, 500)
+      } else {
+        stageShow.value.definedData = stageShow.value.original
+      }
+    })
     return {
       nowPitch,
       PowerShow,
@@ -898,7 +1064,18 @@ export default {
       addAreaadmin,
       adminData,
       getAreasadmin,
-      removeadmin
+      removeadmin,
+      stageShow,
+      defined,
+      selectChange,
+      concernSchoolArr,
+      debounce,
+      schoolSearch,
+      adminOrsearch,
+      adminIndex,
+      admintheSchool,
+      adminSchoold,
+      batchAddadmin
     }
   },
 }
@@ -1306,6 +1483,10 @@ export default {
   padding-left: 2%;
   text-align: left;
 }
+.admin-List-title:first-child{
+  font-size:18px;
+  font-weight: 700;
+}
 .list-item {
   padding: 5px 20px 5px 15px;
   display: flex;
@@ -1357,6 +1538,11 @@ export default {
 .list-item:hover .deletebtn {
   opacity: 1;
 }
+.patch-item{
+  background-color: #c8d6e5;
+  padding: 5px 20px 5px 15px;
+  display: flex;
+}
 .admin-searchbox {
   position: relative;
   padding-left: 20px;
@@ -1456,6 +1642,9 @@ export default {
   display: flex;
   align-items: center;
 }
+.list-item-photo:hover,.list-item-left:hover{
+  cursor: pointer;
+}
 .pigpicture {
   margin-bottom: 5%;
 }
@@ -1501,6 +1690,62 @@ export default {
   padding: 0.5%;
   float: left;
 }
+.stagebox{
+  width:100%;
+  padding: 1%;
+  text-align: center;
+  font-size:16px;
+}
+.stagebox-text{
+  width:100%;
+  text-align: left;
+  padding-left: 5%;
+}
+.stagebox-btns{
+  width:100%;
+  padding: 2%;
+}
+.stagebox-btns div{
+  width:100%;
+  line-height: 45px;
+  font-size:14px;
+}
+.stagebox-defined{
+  width:100%;
+  padding: 1%;
+}
+.left-title,.right-back{
+  width:50%;
+  text-align: right;
+  display: inline-block;
+  vertical-align: top;
+}
+.left-title{
+  font-size:18px;
+}
+.right-back{
+  padding-right:2%;
+}
+.stagebox-table{
+  padding: 0.5%;
+  border: 1px solid #ccc;
+  border-radius: 10px;
+}
+.verify-btn{
+  width:40%;
+  line-height: 20px;
+  margin-top:2%;
+}
+.examine{
+  width:70%;
+  padding: 1%;
+}
+.admin-List-title div{
+  width:50%;
+  display: inline-block;
+  vertical-align: top;
+  text-align: right;
+}
 </style>
 <style>
 .traitfrom .refer {
@@ -1626,7 +1871,10 @@ export default {
   background-color: #fff;
 }
 .schoolRight-table .el-image {
-  width: 45%;
+  width: 35%;
+}
+.stagebox-table .el-image{
+  width:25%;
 }
 .subjoin .el-image__inner {
   width: 45%;
@@ -1652,4 +1900,7 @@ export default {
 .headerPhoto .el-image {
   display: block;
 }
+.stagebox-btns div button{
+  width:50%;
+}
 </style>

+ 20 - 19
TEAMModelBI/ClientApp/src/view/index/index.vue

@@ -793,12 +793,12 @@ export default {
           data: nowTimeQuantum.value.classTime,
           axisLine: {
             lineStyle: {
-              color: 'rgba(189, 195, 199,0.5)',
+              color: 'rgba(189, 195, 199,0.7)',
             },
           },
           axisLabel: {
             textStyle: {
-              color: 'rgba(189, 195, 199,0.5)',
+              color: 'rgba(189, 195, 199,0.7)',
             },
           },
         },
@@ -807,14 +807,14 @@ export default {
             type: 'value',
             axisLabel: {
               textStyle: {
-                color: 'rgba(189, 195, 199,0.5)',
+                color: 'rgba(189, 195, 199,0.7)',
               },
             },
             axisLine: {
               show: true,
               lineStyle: {
                 fontSize: 12,
-                color: 'rgba(189, 195, 199,0.5)',
+                color: 'rgba(189, 195, 199,0.7)',
               },
             },
             splitLine: { show: false, lineStyle: { color: ['rgba(189, 195, 199,0.5)'], type: [5, 8], dashOffset: 3 } },
@@ -1078,11 +1078,11 @@ export default {
             lineStyle: {
               normal: {
                 width: 3,
-                color: 'rgba(129, 236, 236,0.7)', // 线条颜色
+                color: 'rgba(129, 236, 236,0.9)', // 线条颜色
               },
             },
             itemStyle: {
-              color: 'rgba(129, 236, 236,0.7)',
+              color: 'rgba(129, 236, 236,0.9)',
             },
             // emphasis: {
             //     itemStyle: {
@@ -1093,7 +1093,7 @@ export default {
               show: true,
             },
             // data: nowTimeQuantum.value.classinToday,
-            data: nowTimeQuantum.value.todayUpload,
+             data: nowTimeQuantum.value.todayUpload,
           },
           {
             name: '开课',
@@ -1105,7 +1105,7 @@ export default {
             itemStyle: {
               normal: {
                 show: true,
-                color: 'rgba(129, 236, 236,0.3)',
+                color: 'rgba(50,213,185,0.7)',
                 borderWidth: 0,
                 borderColor: '#fff',
               }
@@ -1120,7 +1120,7 @@ export default {
             label: {
               show: true,
               position: 'top',
-              color: 'rgba(0, 210, 211,1.0)',
+              color: 'rgba(50,213,185,1.0)',
             },
             // markPoint: {
             //     data: [{ type: 'max', name: 'Max' }],
@@ -1166,11 +1166,11 @@ export default {
             lineStyle: {
               normal: {
                 width: 3,
-                color: 'rgba(116, 185, 255,0.3)', // 线条颜色
+                color: 'rgba(73,98,252,0.6)', // 线条颜色
               },
             },
             itemStyle: {
-              color: 'rgba(116, 185, 255,0.3)',
+              color: 'rgba(73,98,252,0.6)',
             },
             tooltip: {
               show: true,
@@ -1178,7 +1178,7 @@ export default {
             label: {
               show: true,
               position: 'top',
-              color: 'rgba(116, 185, 255)',
+              color: 'rgba(73,98,252)',
             },
             // markPoint: {
             //     data: [{ type: 'max', name: 'Max' }],
@@ -1189,7 +1189,7 @@ export default {
             //     },
             // },
             // data: nowTimeQuantum.value.classinYesterday,
-            data: nowTimeQuantum.value.classinYesterday,
+             data: nowTimeQuantum.value.classinYesterday,
           },
         ],
       },
@@ -2994,11 +2994,11 @@ export default {
             lineStyle: {
               normal: {
                 width: 3,
-                color: 'rgba(129, 236, 236,0.7)', // 线条颜色
+                color: 'rgba(129, 236, 236,0.9)', // 线条颜色
               },
             },
             itemStyle: {
-              color: 'rgba(129, 236, 236,0.7)',
+              color: 'rgba(129, 236, 236,0.9)',
             },
             // emphasis: {
             //     itemStyle: {
@@ -3021,7 +3021,7 @@ export default {
             itemStyle: {
               normal: {
                 show: true,
-                color: 'rgba(129, 236, 236,0.3)',
+                color: 'rgba(50,213,185,0.7)',
                 borderWidth: 0,
                 borderColor: '#fff',
               }
@@ -3082,11 +3082,11 @@ export default {
             lineStyle: {
               normal: {
                 width: 3,
-                color: 'rgba(116, 185, 255,0.3)', // 线条颜色
+                color: 'rgba(73,98,252,0.6)', // 线条颜色
               },
             },
             itemStyle: {
-              color: 'rgba(116, 185, 255,0.3)',
+              color: 'rgba(73,98,252,0.6)',
             },
             tooltip: {
               show: true,
@@ -3094,7 +3094,7 @@ export default {
             label: {
               show: true,
               position: 'top',
-              color: 'rgba(116, 185, 255)',
+              color: 'rgba(73,98,252,1.0)',
             },
             // markPoint: {
             //     data: [{ type: 'max', name: 'Max' }],
@@ -3236,6 +3236,7 @@ export default {
   background: url("../../assets/img/bg-index.jpg") no-repeat;
   background-size: 100% 100%;
   position: relative;
+  height:100%;
 }
 .statisticsbox,
 .statisticsbox-all {

+ 40 - 3
TEAMModelBI/ClientApp/src/view/systemConfig/operate.vue

@@ -26,16 +26,20 @@
       <div class="authority-block" v-for="(item,index) in authorityList" :key="index">
         <p class="authority-block-title">{{item.name}}</p>
         <div :class="[items.key ==='china-read' || items.key==='global-read' ?'sitebox':'authority-block-item']" v-for="(items,indexs) in item.children" :key="indexs">
-          <div :class="[items.key ==='china-read' || items.key==='global-read' ?'sitebox-name':'authority-block-item-name']">{{items.name}}</div>
-          <div :class="[items.key ==='china-read' || items.key==='global-read' ?'sitebox-state':'authority-block-item-state']">
+          <div :class="[items.key ==='china-read' || items.key==='global-read' ?'sitebox-name':items.key==='login'? 'login-block-item':'authority-block-item-name']">{{items.name}}</div>
+          <div :class="[items.key ==='china-read' || items.key==='global-read' ?'sitebox-state':items.key ==='login'? 'login-block-item-state':'authority-block-item-state']">
             <!-- <el-switch v-model="items.state" v-if="nowUsers.handleRoles.includes('admin')" disabled /> -->
+            <div v-if="items.key ==='login'" class="login-text">
+              <span v-show="items.state" class="impower">已授权登录</span>
+              <span v-show="!items.state" class="forbid">已禁止用户登录</span>
+            </div>
             <div v-if="nowUsers.handleRoles.includes('admin')">
               <svg class="icon" aria-hidden="true">
                 <use xlink:href="#icon-70BasicIcons-all-37"></use>
               </svg>
             </div>
             <el-switch v-model="items.state" v-else-if="!PowerShow" disabled />
-            <el-switch v-model="items.state" v-else @change="changeAuthority" />
+            <el-switch v-model="items.state" v-else @change="changeAuthority" :style="[items.key==='login' ? '--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949':'']"/>
           </div>
         </div>
       </div>
@@ -128,6 +132,13 @@ export default {
           { id: 4 - 2, name: '修改学校相关信息', key: 'schooldata-upd', state: false },
         ],
       },
+      {
+        id:5,
+        name:'登录权限',
+        children:[
+          {id:5 - 1,name:'禁用登录',key:'login',state:true}
+        ]
+      }
       // {
       //   id: 5,
       //   name: '站点数据',
@@ -259,6 +270,14 @@ export default {
   padding-left: 10px;
   color: #636e72;
 }
+.login-block-item{
+  width: 40%;
+  display: inline-block;
+  vertical-align: top;
+  font-size: 16px;
+  padding-left: 10px;
+  color: #636e72;
+}
 .authority-block-item-state {
   width: 25%;
   display: inline-block;
@@ -266,6 +285,13 @@ export default {
   text-align: right;
   padding-right: 5%;
 }
+.login-block-item-state{
+  width: 52%;
+  display: inline-block;
+  vertical-align: top;
+  text-align: right;
+  padding-right: 5%;
+}
 .authority-block-item {
   padding: 1% 0%;
 }
@@ -314,6 +340,17 @@ export default {
   padding-left: 10px;
   color: #636e72;
 }
+.login-text{
+  font-size:14px;
+  display: inline-block;
+  margin-right:1%;
+}
+.impower{
+  color: #95d475
+}
+.forbid{
+  color:#909399
+}
 </style>
 <style>
 .identitybox-select .el-select--small {

+ 2 - 2
TEAMModelBI/ClientApp/src/view/teachermanage/manage.vue

@@ -814,8 +814,8 @@ export default {
   right: 4px;
 }
 .personnel-drawer .el-drawer.rtl {
-  top: 6%;
-  height: 94vh;
+  top: 5.5%;
+  height: 94.5vh;
 }
 .personnel-drawer .el-drawer__header {
   line-height: 20px;

+ 41 - 34
TEAMModelBI/Controllers/BINormal/AreaRelevantController.cs

@@ -244,6 +244,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
             SimpleInfo existsArea = null;
             List<SimpleInfo> existsSc = new();
+            List<SimpleInfo> errorSc = new();
             StringBuilder strMsg = new($"{_tmdName}【{_tmdId}】账户将{tmdName}【{tmdId}】");
 
             Teacher teacher = null;
@@ -285,46 +286,52 @@ namespace TEAMModelBI.Controllers.BINormal
                     strMsg.Append($"并将改账户设置为学校管理员;修改信息:");
                     foreach (var item in schoolMs)
                     {
-                        SchoolTeacher schoolTeacher = null;
-                        var resScTch = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{item.id}"));
-                        if (resScTch.Status == 200)
+                        var resSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{item.id}", new PartitionKey($"Base"));
+                        if (resSc.Status == 200)
                         {
-                            using var json = await JsonDocument.ParseAsync(resScTch.ContentStream);
-                            schoolTeacher = json.ToObject<SchoolTeacher>();
-                            if (!schoolTeacher.roles.Contains("admin"))
+                            SchoolTeacher schoolTeacher = null;
+                            var resScTch = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{item.id}"));
+                            if (resScTch.Status == 200)
                             {
-                                schoolTeacher.roles.Add("admin");
-                                schoolTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<SchoolTeacher>(schoolTeacher, schoolTeacher.id, new PartitionKey($"Teacher-{item.id}"));
+                                using var json = await JsonDocument.ParseAsync(resScTch.ContentStream);
+                                schoolTeacher = json.ToObject<SchoolTeacher>();
+                                if (!schoolTeacher.roles.Contains("admin"))
+                                {
+                                    schoolTeacher.roles.Add("admin");
+                                    schoolTeacher = await cosmosClient.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<SchoolTeacher>(schoolTeacher, schoolTeacher.id, new PartitionKey($"Teacher-{item.id}"));
+                                }
+                                else
+                                    existsSc.Add(item);
                             }
                             else
-                                existsSc.Add(item);
-                        }
-                        else
-                        {
-                            schoolTeacher = new()
                             {
-                                id = $"{tmdId}",
-                                code = $"Teacher-{item.id}",
-                                roles = new List<string> { "admin", "teacher" },
-                                job = "管理员",
-                                name = $"{tmdName}",
-                                picture = string.IsNullOrEmpty($"{item.picture}") ? "" : $"{item.picture}",
-                                status = "join",
-                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
-                                pk = "Teacher",
-                                ttl = -1
-                            };
+                                schoolTeacher = new()
+                                {
+                                    id = $"{tmdId}",
+                                    code = $"Teacher-{item.id}",
+                                    roles = new List<string> { "admin", "teacher" },
+                                    job = "管理员",
+                                    name = $"{tmdName}",
+                                    picture = string.IsNullOrEmpty($"{item.picture}") ? "" : $"{item.picture}",
+                                    status = "join",
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                    pk = "Teacher",
+                                    ttl = -1
+                                };
+
+                                schoolTeacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey($"Teacher-{item.id}"));
+                            }
 
-                            schoolTeacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey($"Teacher-{item.id}"));
-                        }
+                            var existArea = teacher.schools.Find(f => f.schoolId.Equals($"{item.id}"));
+                            if (existArea == null)
+                            {
+                                teacher.schools.Add(new Teacher.TeacherSchool { schoolId = $"{item.id}", name = $"{item.name}", status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), picture = string.IsNullOrEmpty($"{item.picture}") ? "" : $"{item.picture}", areaId = $"{areaId}" });
+                            }
 
-                        var existArea = teacher.schools.Find(f => f.schoolId.Equals($"{item.id}"));
-                        if (existArea == null)
-                        {
-                            teacher.schools.Add(new Teacher.TeacherSchool { schoolId = $"{item.id}", name = $"{item.name}", status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), picture = string.IsNullOrEmpty($"{item.picture}") ? "" : $"{item.picture}", areaId = $"{areaId}" });
+                            strMsg.Append($"{item.name}【{item.id}】|");
                         }
-
-                        strMsg.Append($"{item.name}【{item.id}】|");
+                        else
+                            errorSc.Add(item);
                     }
 
                     teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
@@ -336,8 +343,8 @@ namespace TEAMModelBI.Controllers.BINormal
             //保存操作记录
             await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "schoolTeacher-add", strMsg.ToString(), _dingDing, httpContext: HttpContext);
 
-            if (existsArea != null || existsSc.Count > 0 )
-                return Ok(new { state = RespondCode.Created, teacher, existsArea, existsSc });
+            if (existsArea != null || existsSc.Count > 0 || errorSc.Count > 0)
+                return Ok(new { state = RespondCode.Created, teacher, existsArea, existsSc, errorSc });
             else
                 return Ok(new { state = RespondCode.Ok, teacher });
         }

+ 491 - 147
TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs

@@ -29,6 +29,12 @@ using TEAMModelBI.Models;
 using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.Context.BI;
 using TEAMModelOS.SDK.Context.Constant;
+using Pipelines.Sockets.Unofficial.Arenas;
+using Microsoft.Identity.Client;
+using TEAMModelOS.SDK.Models.Dtos;
+using static TEAMModelBI.Controllers.BITest.TestController;
+using static TEAMModelBI.Controllers.BISchool.BatchSchoolController;
+using DocumentFormat.OpenXml.Spreadsheet;
 
 namespace TEAMModelBI.Controllers.BISchool
 {
@@ -100,24 +106,19 @@ namespace TEAMModelBI.Controllers.BISchool
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 var tableClient = _azureStorage.GetCloudTableClient();
                 var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
-                if (BIConst.Global.Equals($"{foundSchools.site}"))
-                {
-                    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
-                    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
-                }
+                //if (BIConst.Global.Equals($"{foundSchools.site}"))
+                //{
+                //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
+                //    tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
+                //    blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
+                //}
 
                 if (foundSchools.biSchools.Count > 0)
                 {
+                    #region 新版直接创建
+
                     foreach (BISchool bischool in foundSchools.biSchools)
                     {
-                        List<string> scName = new();
-                        //查询学校名称是否全字段匹配
-                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: $"select value(c.name) from c where c.name='{bischool.name}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
-                        {
-                            scName.Add(item);
-                        }
-
                         Area area = null;
                         //查询区是否存在
                         var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bischool.areaId}", new PartitionKey("Base-Area"));
@@ -127,150 +128,303 @@ namespace TEAMModelBI.Controllers.BISchool
                             area = areaBase.ToObject<Area>();
                         }
 
-                        bool isSYNCArea = false;
-                        //查询去是否同步省平台
-                        var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bischool.areaId}", new PartitionKey("AreaSetting"));
-                        if (responseSet.Status == 200)
+                        CreateSchoolInfo createSchoolInfo = new CreateSchoolInfo()
                         {
-                            using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
-                            AreaSetting delSet = fileJson.ToObject<AreaSetting>();
-                            if (!string.IsNullOrEmpty(delSet.accessConfig))
-                                isSYNCArea = true;
-                        }
-
-                        if (scName.Count <= 0)
+                            province = bischool.province,
+                            id = "",
+                            name = bischool.name,
+                            city = bischool.city,
+                            aname = "",
+                            createCount = 0,
+                        };
+
+                        //生成学校ID
+                        bool tempStaus = true;
+                        do
+                        {
+                            createSchoolInfo = await SchoolCode.GenerateSchoolCode(createSchoolInfo, _dingDing, _environment);
+                            var schoolStatu = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{createSchoolInfo.id}", new PartitionKey($"Base"));
+                            if (schoolStatu.Status != 200) tempStaus = false;
+                            else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
+                        } while (tempStaus);
+                        
+                        if (createSchoolInfo.id != null)
                         {
-                            if (isSYNCArea == false)
+                            string campusId = Guid.NewGuid().ToString();
+                            School upSchool = new()
+                            {
+                                id = createSchoolInfo.id,
+                                name = bischool.name,
+                                size = bischool.size == 0 ? 100 : bischool.size,
+                                code = "Base",
+                                campuses = new List<Campus> { new Campus { name = bischool.name, id = campusId } },
+                                region = bischool.region,
+                                province = bischool.province,
+                                city = bischool.city,
+                                dist = bischool.dist,
+                                address = bischool.address,
+                                picture = "https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/school/bbf54fb3-3fc8-43ae-a358-107281c174cc.png",
+                                timeZone = new TEAMModelOS.SDK.Models.TimeZone { label = "(UTC+08:00) 北京,重庆,香港特别行政区,乌鲁木齐", value = "+08:00" },
+                                type = string.IsNullOrEmpty(bischool.type.ToString()) ? 1 : bischool.type,
+                                pk = "School",
+                                ttl = -1,
+                                areaId = area == null ? "" : area.id,
+                                standard = area == null ? "" : area.standard,
+                                schoolCode = createSchoolInfo.id,
+                                period = PresetSchoolPeriod(bischool.period, foundSchools.lang, campusId),
+                                scale = bischool.size >= 300 ? 500 : 0,
+                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
+                            };
+
+                            stringBuilder.Append($"创建学校:{upSchool.name}【{upSchool.id}】");
+                            noticeDD.Append($"{upSchool.name}【{upSchool.id}】 \r 学校管理员信息:");
+                            upSc.Add(upSchool.id);
+                            //创建学校
+                            await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<School>(upSchool, new PartitionKey(upSchool.code));
+                            
+                            var content = new StringContent(bischool.admin.ToArray().ToJsonString(), Encoding.UTF8, "application/json");
+                            string json = await _coreAPIHttpService.GetUserInfos(content);
+                            List<TmdUserinfo> tmdInfos = json.ToObject<List<TmdUserinfo>>();
+
+                            foreach (var tmdIndo in tmdInfos)
                             {
-                                var coreUser = await _coreAPIHttpService.GetUserInfo(new Dictionary<string, string> { { "key", $"{bischool.admin}" } }, _option.Location, _configuration);
-                                if (coreUser != null && coreUser.id != null)
+                                Teacher teacher = new();
+                                var resTeache = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{tmdIndo.id}", new PartitionKey("Base"));
+                                if (resTeache.Status == 200)
                                 {
-                                    CreateSchoolInfo createSchoolInfo = new CreateSchoolInfo()
+                                    using var tchJson = await JsonDocument.ParseAsync(resTeache.ContentStream);
+                                    teacher = tchJson.ToObject<Teacher>();
+                                    //教师存在,在该教师信息中添加要管理的学校信息
+                                    teacher.schools.Add(new Teacher.TeacherSchool { areaId = string.IsNullOrEmpty(bischool.areaId) ? "" : bischool.areaId, schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
+                                    //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, coreUser.id, new PartitionKey("Base"));
+                                    SchoolTeacher schoolTeacher = new()
                                     {
-                                        province = bischool.province,
-                                        id = "",
-                                        name = bischool.name,
-                                        city = bischool.city,
-                                        aname = "",
-                                        createCount = 0,
+                                        id = tmdIndo.id,
+                                        code = $"Teacher-{createSchoolInfo.id}",
+                                        roles = new List<string> { "admin" },
+                                        job = "管理员",
+                                        name = teacher.name,
+                                        picture = teacher.picture,
+                                        status = "join",
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        pk = "Teacher",
+                                        ttl = -1
                                     };
-
-                                    //生成学校ID
-                                    bool tempStaus = true;
-                                    do
+                                    stringBuilder.Append($"【基础:{schoolTeacher.name}【{schoolTeacher.id}】,权限:{string.Join(",", schoolTeacher.roles)}】");
+                                    noticeDD.Append($"{schoolTeacher.name}【{schoolTeacher.id}】");
+                                    await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
+                                    await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
+                                }
+                                else
+                                {
+                                    //不存在 新建教师和新建要管理的学校信息
+                                    Teacher addteacher = new()
                                     {
-                                        createSchoolInfo = await SchoolCode.GenerateSchoolCode(createSchoolInfo, _dingDing, _environment);
-                                        var schoolStatu = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{createSchoolInfo.id}", new PartitionKey($"Base"));
-                                        if (schoolStatu.Status != 200) tempStaus = false;
-                                        else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
-                                    } while (tempStaus);
+                                        id = tmdIndo.id,
+                                        pk = "Base",
+                                        code = "Base",
+                                        name = $"{tmdIndo.name}",
+                                        picture = $"{tmdIndo.picture}",
+                                        //创建账号并第一次登录IES5则默认赠送1G
+                                        size = 1,
+                                        defaultSchool = createSchoolInfo.id,
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        schools = new List<Teacher.TeacherSchool>() { new Teacher.TeacherSchool { schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() } }
+                                    };
 
-                                    if (createSchoolInfo.id != null)
-                                    {
-                                        string campusId = Guid.NewGuid().ToString();
-                                        School upSchool = new()
-                                        {
-                                            id = createSchoolInfo.id,
-                                            name = bischool.name,
-                                            size = bischool.size == 0 ? 100 : bischool.size,
-                                            code = "Base",
-                                            campuses = new List<Campus> { new Campus { name = bischool.name, id = campusId } },
-                                            region = bischool.region,
-                                            province = bischool.province,
-                                            city = bischool.city,
-                                            dist = bischool.dist,
-                                            address = bischool.address,
-                                            picture = "https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/school/bbf54fb3-3fc8-43ae-a358-107281c174cc.png",
-                                            timeZone = new TEAMModelOS.SDK.Models.TimeZone { label = "(UTC+08:00) 北京,重庆,香港特别行政区,乌鲁木齐", value = "+08:00" },
-                                            type = string.IsNullOrEmpty(bischool.type.ToString()) ? 1 : bischool.type,
-                                            pk = "School",
-                                            ttl = -1,
-                                            areaId = area == null ? "" : area.id,
-                                            standard = area == null ? "" : area.standard,
-                                            schoolCode = createSchoolInfo.id,
-                                            period = PresetSchoolPeriod(bischool.period, foundSchools.lang, campusId),
-                                            scale = bischool.size >= 300 ? 500 : 0,
-                                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
-                                        };
+                                    stringBuilder.Append($"【没有该教师基础信息,创建的教师基本信息:{addteacher.name}【{addteacher.id}】");
+                                    await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(addteacher, new PartitionKey("Base"));
 
-                                        stringBuilder.Append($"创建学校:{upSchool.name}【{upSchool.id}】");
-                                        noticeDD.Append($"【ID:{upSchool.id}|名称:{upSchool.name}】 ");
-                                        upSc.Add(upSchool.id);
-                                        //创建学校
-                                        await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<School>(upSchool, new PartitionKey(upSchool.code));
+                                    SchoolTeacher schoolTeacher = new()
+                                    {
+                                        id = tmdIndo.id,
+                                        code = $"Teacher-{createSchoolInfo.id}",
+                                        roles = new List<string> { "admin" },
+                                        job = "管理员",
+                                        name = $"{tmdIndo.name}",
+                                        picture = "",
+                                        status = "join",
+                                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                                        pk = "Teacher",
+                                        ttl = -1
+                                    };
 
-                                        //创建学校管理员
-                                        Teacher teacher = null;
-                                        var resTeache = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{coreUser.id}", new PartitionKey("Base"));
-                                        if (resTeache.Status == 200)
-                                        {
-                                            using var tchJson = await JsonDocument.ParseAsync(resTeache.ContentStream);
-                                            teacher = tchJson.ToObject<Teacher>();
-                                            //教师存在,在该教师信息中添加要管理的学校信息
-                                            teacher.schools.Add(new Teacher.TeacherSchool { areaId = string.IsNullOrEmpty(bischool.areaId) ? "" : bischool.areaId, schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
-                                            //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, coreUser.id, new PartitionKey("Base"));
-                                            SchoolTeacher schoolTeacher = new()
-                                            {
-                                                id = coreUser.id,
-                                                code = $"Teacher-{createSchoolInfo.id}",
-                                                roles = new List<string> { "admin", "teacher" },
-                                                job = "管理员",
-                                                name = teacher.name,
-                                                picture = teacher.picture,
-                                                status = "join",
-                                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
-                                                pk = "Teacher",
-                                                ttl = -1
-                                            };
-                                            stringBuilder.Append($"教师信息:{schoolTeacher.name}【{schoolTeacher.id}】,教师权限:{string.Join(",", schoolTeacher.roles)}");
-                                            await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
-                                            await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
-                                        }
-                                        else
-                                        {
-                                            //不存在 新建教师和新建要管理的学校信息
-                                            Teacher addteacher = new()
-                                            {
-                                                id = coreUser.id,
-                                                pk = "Base",
-                                                code = "Base",
-                                                name = $"{coreUser.name}",
-                                                picture = $"{coreUser.picture}",
-                                                //创建账号并第一次登录IES5则默认赠送1G
-                                                size = 1,
-                                                defaultSchool = createSchoolInfo.id,
-                                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
-                                                schools = new List<Teacher.TeacherSchool>() { new Teacher.TeacherSchool { schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() } }
-                                            };
-
-                                            stringBuilder.Append($"没有该教师信息创建的教师信息:{addteacher.name}【{addteacher.id}】");
-                                            await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(addteacher, new PartitionKey("Base"));
-
-                                            SchoolTeacher schoolTeacher = new()
-                                            {
-                                                id = coreUser.id,
-                                                code = $"Teacher-{createSchoolInfo.id}",
-                                                roles = new List<string> { "admin", "teacher" },
-                                                job = "管理员",
-                                                name = $"{coreUser.name}",
-                                                picture = "",
-                                                status = "join",
-                                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
-                                                pk = "Teacher",
-                                                ttl = -1
-                                            };
-
-                                            stringBuilder.Append($"教师权限:{string.Join(",", schoolTeacher.roles)}");
-                                            await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
-                                        }
-                                    }
+                                    stringBuilder.Append($"权限:{string.Join(",", schoolTeacher.roles)}】"); 
+                                    noticeDD.Append($"{schoolTeacher.name}【{schoolTeacher.id}】");
+                                    await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
                                 }
-                                else userScs.Add(bischool);
                             }
-                            else cutArea.Add(bischool);
                         }
-                        else schools.Add(bischool);
                     }
+
+                    #endregion
+
+                    #region  旧版先检测 在创建
+
+                    //foreach (BISchool bischool in foundSchools.biSchools)
+                    //{
+                    //    List<string> scName = new();
+                    //    //查询学校名称是否全字段匹配
+                    //    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: $"select value(c.name) from c where c.name='{bischool.name}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                    //    {
+                    //        scName.Add(item);
+                    //    }
+
+                    //    Area area = null;
+                    //    //查询区是否存在
+                    //    var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bischool.areaId}", new PartitionKey("Base-Area"));
+                    //    if (respAreaId.Status == 200)
+                    //    {
+                    //        using var areaBase = await JsonDocument.ParseAsync(respAreaId.ContentStream);
+                    //        area = areaBase.ToObject<Area>();
+                    //    }
+
+                    //    bool isSYNCArea = false;
+                    //    //查询去是否同步省平台
+                    //    var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bischool.areaId}", new PartitionKey("AreaSetting"));
+                    //    if (responseSet.Status == 200)
+                    //    {
+                    //        using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                    //        AreaSetting delSet = fileJson.ToObject<AreaSetting>();
+                    //        if (!string.IsNullOrEmpty(delSet.accessConfig))
+                    //            isSYNCArea = true;
+                    //    }
+
+                    //    if (scName.Count <= 0)
+                    //    {
+                    //        if (isSYNCArea == false)
+                    //        {
+                    //            var coreUser = await _coreAPIHttpService.GetUserInfo(new Dictionary<string, string> { { "key", $"{bischool.admin}" } }, _option.Location, _configuration);
+                    //            if (coreUser != null && coreUser.id != null)
+                    //            {
+                    //                CreateSchoolInfo createSchoolInfo = new CreateSchoolInfo()
+                    //                {
+                    //                    province = bischool.province,
+                    //                    id = "",
+                    //                    name = bischool.name,
+                    //                    city = bischool.city,
+                    //                    aname = "",
+                    //                    createCount = 0,
+                    //                };
+
+                    //                //生成学校ID
+                    //                bool tempStaus = true;
+                    //                do
+                    //                {
+                    //                    createSchoolInfo = await SchoolCode.GenerateSchoolCode(createSchoolInfo, _dingDing, _environment);
+                    //                    var schoolStatu = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{createSchoolInfo.id}", new PartitionKey($"Base"));
+                    //                    if (schoolStatu.Status != 200) tempStaus = false;
+                    //                    else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
+                    //                } while (tempStaus);
+
+                    //                if (createSchoolInfo.id != null)
+                    //                {
+                    //                    string campusId = Guid.NewGuid().ToString();
+                    //                    School upSchool = new()
+                    //                    {
+                    //                        id = createSchoolInfo.id,
+                    //                        name = bischool.name,
+                    //                        size = bischool.size == 0 ? 100 : bischool.size,
+                    //                        code = "Base",
+                    //                        campuses = new List<Campus> { new Campus { name = bischool.name, id = campusId } },
+                    //                        region = bischool.region,
+                    //                        province = bischool.province,
+                    //                        city = bischool.city,
+                    //                        dist = bischool.dist,
+                    //                        address = bischool.address,
+                    //                        picture = "https://teammodelstorage.blob.core.chinacloudapi.cn/0-public/school/bbf54fb3-3fc8-43ae-a358-107281c174cc.png",
+                    //                        timeZone = new TEAMModelOS.SDK.Models.TimeZone { label = "(UTC+08:00) 北京,重庆,香港特别行政区,乌鲁木齐", value = "+08:00" },
+                    //                        type = string.IsNullOrEmpty(bischool.type.ToString()) ? 1 : bischool.type,
+                    //                        pk = "School",
+                    //                        ttl = -1,
+                    //                        areaId = area == null ? "" : area.id,
+                    //                        standard = area == null ? "" : area.standard,
+                    //                        schoolCode = createSchoolInfo.id,
+                    //                        period = PresetSchoolPeriod(bischool.period, foundSchools.lang, campusId),
+                    //                        scale = bischool.size >= 300 ? 500 : 0,
+                    //                        createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
+                    //                    };
+
+                    //                    stringBuilder.Append($"创建学校:{upSchool.name}【{upSchool.id}】");
+                    //                    noticeDD.Append($"【ID:{upSchool.id}|名称:{upSchool.name}】 ");
+                    //                    upSc.Add(upSchool.id);
+                    //                    //创建学校
+                    //                    await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<School>(upSchool, new PartitionKey(upSchool.code));
+
+                    //                    //创建学校管理员
+                    //                    Teacher teacher = null;
+                    //                    var resTeache = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{coreUser.id}", new PartitionKey("Base"));
+                    //                    if (resTeache.Status == 200)
+                    //                    {
+                    //                        using var tchJson = await JsonDocument.ParseAsync(resTeache.ContentStream);
+                    //                        teacher = tchJson.ToObject<Teacher>();
+                    //                        //教师存在,在该教师信息中添加要管理的学校信息
+                    //                        teacher.schools.Add(new Teacher.TeacherSchool { areaId = string.IsNullOrEmpty(bischool.areaId) ? "" : bischool.areaId, schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
+                    //                        //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, coreUser.id, new PartitionKey("Base"));
+                    //                        SchoolTeacher schoolTeacher = new()
+                    //                        {
+                    //                            id = coreUser.id,
+                    //                            code = $"Teacher-{createSchoolInfo.id}",
+                    //                            roles = new List<string> { "admin", "teacher" },
+                    //                            job = "管理员",
+                    //                            name = teacher.name,
+                    //                            picture = teacher.picture,
+                    //                            status = "join",
+                    //                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                    //                            pk = "Teacher",
+                    //                            ttl = -1
+                    //                        };
+                    //                        stringBuilder.Append($"教师信息:{schoolTeacher.name}【{schoolTeacher.id}】,教师权限:{string.Join(",", schoolTeacher.roles)}");
+                    //                        await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey(teacher.code));
+                    //                        await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
+                    //                    }
+                    //                    else
+                    //                    {
+                    //                        //不存在 新建教师和新建要管理的学校信息
+                    //                        Teacher addteacher = new()
+                    //                        {
+                    //                            id = coreUser.id,
+                    //                            pk = "Base",
+                    //                            code = "Base",
+                    //                            name = $"{coreUser.name}",
+                    //                            picture = $"{coreUser.picture}",
+                    //                            //创建账号并第一次登录IES5则默认赠送1G
+                    //                            size = 1,
+                    //                            defaultSchool = createSchoolInfo.id,
+                    //                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                    //                            schools = new List<Teacher.TeacherSchool>() { new Teacher.TeacherSchool { schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() } }
+                    //                        };
+
+                    //                        stringBuilder.Append($"没有该教师信息创建的教师信息:{addteacher.name}【{addteacher.id}】");
+                    //                        await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(addteacher, new PartitionKey("Base"));
+
+                    //                        SchoolTeacher schoolTeacher = new()
+                    //                        {
+                    //                            id = coreUser.id,
+                    //                            code = $"Teacher-{createSchoolInfo.id}",
+                    //                            roles = new List<string> { "admin", "teacher" },
+                    //                            job = "管理员",
+                    //                            name = $"{coreUser.name}",
+                    //                            picture = "",
+                    //                            status = "join",
+                    //                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                    //                            pk = "Teacher",
+                    //                            ttl = -1
+                    //                        };
+
+                    //                        stringBuilder.Append($"教师权限:{string.Join(",", schoolTeacher.roles)}");
+                    //                        await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
+                    //                    }
+                    //                }
+                    //            }
+                    //            else userScs.Add(bischool);
+                    //        }
+                    //        else cutArea.Add(bischool);
+                    //    }
+                    //    else schools.Add(bischool);
+                    //}
+
+                    #endregion
                 }
                 else return Ok(new { state = 1, message = "创校信息为空" });
 
@@ -832,6 +986,7 @@ namespace TEAMModelBI.Controllers.BISchool
         /// </summary>
         /// <param name="jsonElement"></param>
         /// <returns></returns>
+        [ProducesDefaultResponseType]
         [HttpPost("get-schools")]
         public async Task<IActionResult> GetSchools(JsonElement jsonElement)
         {
@@ -875,6 +1030,194 @@ namespace TEAMModelBI.Controllers.BISchool
             return Ok(new { state = 200, schoolAssists });
         }
 
+        /// <summary>
+        /// 创校前检查数据
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-checlkexist")]
+        public async Task<IActionResult> GetCheckExist(JsonElement jsonElement) 
+        {
+            if (!jsonElement.TryGetProperty("scNames", out JsonElement _scNames)) return BadRequest();
+            if (!jsonElement.TryGetProperty("accounts", out JsonElement _accounts)) return BadRequest();
+            if (!jsonElement.TryGetProperty("areaIds", out JsonElement _areaIds)) return BadRequest();
+
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+
+            List<string> scNames = _scNames.ToObject<List<string>>();
+            List<string> accounts = _accounts.ToObject<List<string>>();
+            List<string> areaIds = _areaIds.ToObject<List<string>>();
+
+            List<string> existScNames = new();   //存在的学校
+            List<string> noAccounts = new();    // 不存在的账户
+            List<string> noAreaIds = new();     //不存在的学区
+            List<string> synPro = new();      //已同步省平台
+
+            if (scNames.Count > 0)
+            {
+                foreach (var item in scNames)
+                {
+                    //查询学校名称是否全字段匹配
+                    await foreach (var sc in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: $"select value(c.name) from c where c.name='{item}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                    {
+                        existScNames.Add(item);
+                    }
+                }
+            }
+
+            if (accounts.Count > 0)
+            {
+                var content = new StringContent(_accounts.ToString(), Encoding.UTF8, "application/json");
+                string json = await _coreAPIHttpService.GetUserInfos(content);
+                List<TmdUserinfo> tmdInfos = json.ToObject<List<TmdUserinfo>>();
+
+                accounts.ForEach(ac =>
+                {
+                    var noTmdInfo = tmdInfos.Find(f => f.id.Equals($"{ac}") || f.mail.Equals($"{ac}") || f.mobile.Equals($"{ac}"));
+                    if (noTmdInfo == null)
+                        noAccounts.Add(ac);
+                });
+            }
+
+            if (areaIds.Count > 0) 
+            {
+                foreach (var item in areaIds)
+                {
+                    //查询区是否存在
+                    var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{item}", new PartitionKey("Base-Area"));
+                    if (respAreaId.Status != 200)
+                    {
+                        noAreaIds.Add(item);
+                    }
+
+                    //查询去是否同步省平台
+                    var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{item}", new PartitionKey("AreaSetting"));
+                    if (responseSet.Status == 200)
+                    {
+                        using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                        AreaSetting delSet = fileJson.ToObject<AreaSetting>();
+                        if (!string.IsNullOrEmpty(delSet.accessConfig))
+                            synPro.Add(item);
+                    }
+                }
+            }
+
+            if (existScNames.Count > 0 || noAccounts.Count > 0 || noAreaIds.Count > 0 || synPro.Count > 0)
+                return Ok(new { state = RespondCode.Created, existScNames, noAccounts, noAreaIds, synPro });
+            else
+                return Ok(new { state = RespondCode.Ok });
+        }
+
+        /// <summary>
+        /// 添加多个学校添加多个管理员
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [HttpPost("set-batchmanage")]
+        public async Task<IActionResult> SetBatchManage(JsonElement jsonElement)
+        {
+            if (!jsonElement.TryGetProperty("scIds", out JsonElement _scIds)) return BadRequest();
+            if (!jsonElement.TryGetProperty("manages", out JsonElement _manages)) return BadRequest();
+
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+
+            List<string> scIds= _scIds.ToObject<List<string>>();
+            List<string> manages = _manages.ToObject<List<string>>();
+
+            List<ExistScManage> existScManages = new();
+            if (scIds.Count > 0 && manages.Count > 0)
+            {
+                foreach (var scId in scIds)
+                {
+                    foreach (var msId in manages)
+                    {
+                        //不存在则在原来的基础上添加顾问角色
+                        Teacher tempTeacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<Teacher>($"{msId}", new PartitionKey("Base"));
+                        if (tempTeacher != null)
+                        {
+                            var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{msId}", new PartitionKey($"Teacher-{scId}"));
+                            if (response.Status == 200)
+                            {
+                                using var tchJson = await JsonDocument.ParseAsync(response.ContentStream);
+                                SchoolTeacher tchSc = tchJson.ToObject<SchoolTeacher>();
+                                if (tchSc.roles.Contains("admin"))
+                                {
+                                    tchSc.roles.Add("admin");
+                                    //添加顾问权限
+                                    await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<SchoolTeacher>(tchSc, tchSc.id, new PartitionKey($"Teacher-{scId}"));
+                                }
+                                else
+                                    existScManages.Add(new ExistScManage() { scId = scId, tmdId = msId });
+                            }
+                            else
+                            {
+                                SchoolTeacher addSchoolTeacher = new()
+                                {
+                                    id = tempTeacher.id,
+                                    code = $"Teacher-{scId}",
+                                    pk = "Teacher",
+                                    status = "join",
+                                    roles = new List<string>() { "admin" },
+                                    name = tempTeacher.name,
+                                    job = $"管理员",
+                                    size = 0,
+                                    createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
+                                };
+
+                                var haveTeacher = tempTeacher.schools.Find(x => x.schoolId.Equals($"{scId}"));
+                                if (haveTeacher == null) 
+                                {
+                                    School school = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemAsync<School>(scId, new PartitionKey("Base"));
+                                    //教师存在,在该教师信息中添加要管理的学校信息
+                                    tempTeacher.schools.Add(new Teacher.TeacherSchool { areaId = string.IsNullOrEmpty(school.areaId) ? "" : school.areaId, schoolId = school.id, name = school.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
+
+                                    tempTeacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(tempTeacher, msId, new PartitionKey("Base"));
+                                }
+
+                                //添加学校学校顾问
+                                await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(addSchoolTeacher, new PartitionKey($"Teacher-{scId}"));
+                            }
+                        }
+                        else
+                        {
+                            CoreUser coreUser = await _coreAPIHttpService.GetUserInfo(new Dictionary<string, string> { { "key", $"{msId}" } }, _option.Location, _configuration);
+
+                            Teacher teacher = new() { id = coreUser.id, name = coreUser.name, picture = coreUser.picture, pk = "Base", code = "Base", size = 1, createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() };
+                            var responseSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scId, new PartitionKey("Base"));
+                            if (responseSc.Status == 200)
+                            {
+                                using var tchJson = await JsonDocument.ParseAsync(responseSc.ContentStream);
+                                School scInfo = tchJson.ToObject<School>();
+                                teacher.schools.Add(new() { schoolId = scInfo.id, name = scInfo.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), picture = scInfo.picture, areaId = scInfo.areaId });
+                            }
+                            
+                            teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
+                            SchoolTeacher addSchoolTeacher = new()
+                            {
+                                id = coreUser.id,
+                                code = $"Teacher-{scId}",
+                                pk = "Teacher",
+                                status = "join",
+                                roles = new List<string>() { "admin" },
+                                name = coreUser.name,
+                                job = $"管理员",
+                                size = 0,
+                                createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
+                            };
+
+                            //添加学校学校顾问
+                            await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<SchoolTeacher>(addSchoolTeacher, new PartitionKey($"Teacher-{scId}"));
+                        }
+                    }
+                }
+            }
+
+            if (existScManages.Count > 0)
+                return Ok(new { state = RespondCode.Created, existScManages });
+            else
+                return Ok(new { state = RespondCode.Ok });
+        }
 
         #region   预设学校基础信息 多语言
 
@@ -1044,7 +1387,7 @@ namespace TEAMModelBI.Controllers.BISchool
             /// <summary>
             /// 学校管理员
             /// </summary>
-            public string admin { get; set; }
+            public List<string> admin { get; set; }
             /// <summary>
             /// 学校的学段
             /// </summary>
@@ -1087,10 +1430,11 @@ namespace TEAMModelBI.Controllers.BISchool
             public string standard { get; set; }
         }
 
-        public record Exist()
+
+        public record ExistScManage
         {
-            public string ID { get; set; }
-            public string name { get; set; }
+            public string scId{ get; set; }
+            public string tmdId { get; set; }
         }
     }
 }

+ 38 - 0
TEAMModelBI/Controllers/BISchool/SchoolController.cs

@@ -1940,6 +1940,44 @@ namespace TEAMModelBI.Controllers.BISchool
         }
 
 
+        /// <summary>
+        /// 管理员所管理的学校信息
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [HttpPost("get-managescs")]
+        public async Task<IActionResult> GetManageSclist(JsonElement jsonElement)
+        {
+            if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
+            jsonElement.TryGetProperty("areaId", out JsonElement areaId);
+
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+            List<ManageScInfo> mScInfos = new();
+            List<string> scIds = new();
+
+            string mScSql = $"SELECT value(REPLACE(c.code, 'Teacher-', '')) FROM c where array_contains(c.roles,'admin',true) and c.pk='Teacher' and c.id='{tmdId}'";
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: mScSql, requestOptions: new QueryRequestOptions() { }))
+            {
+                scIds.Add(item);
+            }
+
+            if (scIds.Count > 0)
+            {
+                string scInfoSql = $"select c.id,c.name,c.code,c.picture,c.region,c.province,c.city,c.dist,c.areaId from c ";
+                string idSql = BICommonWay.ManyScSql("c.id", scIds);
+                string scSql = $"{scInfoSql} where {idSql}";
+                if (!string.IsNullOrEmpty($"{areaId}")) 
+                {
+                    scSql = $"{scInfoSql} where {idSql} and c.areaId='{areaId}'";
+                }
+
+                mScInfos = await CommonFind.GetObject<ManageScInfo>(cosmosClient, "School", scSql, "Base");
+            }
+
+            return Ok(new { state = RespondCode.Ok, mScInfos });
+        }
+
+
         #region 购买记录
 
         /// <summary>

+ 8 - 8
TEAMModelBI/Controllers/BITeacher/TeacherController.cs

@@ -47,7 +47,7 @@ namespace TEAMModelBI.Controllers.BITeacher
             //if ($"{site}".Equals(BIConst.Global))
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
-            List<SchoolTeacher> teachers = new();
+            List<ScTch> teachers = new();
             string sqlTxt = "";
             if (!string.IsNullOrEmpty($"{tmdId}")) 
             {
@@ -65,12 +65,12 @@ namespace TEAMModelBI.Controllers.BITeacher
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
-                        SchoolTeacher schoolTeacher = new();
-                        schoolTeacher.id = obj.GetProperty("id").GetString();
-                        schoolTeacher.code = obj.GetProperty("code").GetString();
-                        schoolTeacher.name = obj.GetProperty("name").GetString();
-                        schoolTeacher.picture = obj.GetProperty("picture").GetString();
-                        teachers.Add(schoolTeacher);
+                        ScTch scTch = new();
+                        scTch.id = obj.GetProperty("id").GetString();
+                        scTch.code = obj.GetProperty("code").GetString();
+                        scTch.name = obj.GetProperty("name").GetString();
+                        scTch.picture = obj.GetProperty("picture").GetString();
+                        teachers.Add(scTch);
                     }
                 }
             }
@@ -112,7 +112,7 @@ namespace TEAMModelBI.Controllers.BITeacher
             return Ok(new { state = 200, teachers = objs });
         }
 
-        public record SchoolTeacher 
+        public record ScTch
         {
             public string id { get; set; }
 

+ 25 - 0
TEAMModelBI/Controllers/Census/SchoolController.cs

@@ -352,6 +352,31 @@ namespace TEAMModelBI.Controllers.Census
             return Ok(new { state = 200, tecCount, stuCount, classCount, roomCount, allLessCount, lastWeekLess, weekLess, lastTermLess, termLess, lessYearLess, yearLess, allActivity, lastYearActivity, yearActivity, lastWeekActivity, weekActivity, allBlob, lastYearBlob, yearBlob });
         }
 
+
+        /// <summary>
+        /// 未区域学校统计    未写完
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        public async Task<IActionResult> GetNoAreaCnt(JsonElement jsonElement)
+        {
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+            List<string> scIds = new();
+
+            string scIdSql = "";
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: scIdSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
+            {
+                scIds.Add(item);
+            }
+
+
+
+
+
+
+            return Ok(new { state = 200 });
+        }
+
         /// <summary>
         /// 依据Id查询School容器  数据管理工具——查询工具
         /// </summary>

+ 1 - 1
TEAMModelBI/Controllers/LoginController.cs

@@ -122,7 +122,7 @@ namespace TEAMModelBI.Controllers
                 OapiSnsGetuserinfoBycodeRequest req = new() { TmpAuthCode = $"{LoginTempCode}" };  //通过扫描二维码,跳转到指定的Url后,向Url中追加Code临时授权码
                 OapiSnsGetuserinfoBycodeResponse response = clientinfo.Execute(req, appKey, appSecret);
 
-                if (response.Errcode.Equals(40078))
+                if (response.Errcode.Equals(40078) || response.Errcode.Equals(853002))
                 {
                     return Ok(new { state = 0, msg = $"state:{response.Errcode};Err{response.Errmsg}/临时授权码过期请重新扫码" });
                 }

+ 34 - 0
TEAMModelBI/Models/AssistSchool.cs

@@ -91,4 +91,38 @@ namespace TEAMModelBI.Models
         public string name { get; set; }
         public string picture { get; set; }
     }
+
+    /// <summary>
+    /// 醍摩豆用户信息
+    /// </summary>
+    public class TmdUserinfo
+    {
+        public string searchKey { get; set; }
+        public string id { get; set; }
+        public string vid { get; set; }
+        public string name { get; set; }
+        public string mail { get; set; }
+        public string mobile { get; set; }
+        public string picture { get; set; }
+        public bool isActivate { get; set; }
+    }
+
+
+    /// <summary>
+    /// 管理员所管理的学校信息
+    /// </summary>
+    public class ManageScInfo
+    {
+        public string id { get; set; }
+        public string code { get; set; }
+        public string schoolCode { get; set; }
+        public string picture { get; set; }
+        public string name { get; set; }
+        public string region { get; set; }
+        public string province { get; set; }
+        public string city { get; set; }
+        public string dist { get; set; }
+        public string areaId { get; set; }
+    }
+
 }

+ 3 - 3
TEAMModelBI/TEAMModelBI.csproj

@@ -39,9 +39,9 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>1.2208.25</Version>
-		<AssemblyVersion>1.2208.25.1</AssemblyVersion>
-		<FileVersion>1.2208.25.1</FileVersion>
+		<Version>1.2208.31</Version>
+		<AssemblyVersion>1.2208.31.1</AssemblyVersion>
+		<FileVersion>1.2208.31.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记202200825</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>

+ 6 - 0
TEAMModelOS.SDK/Context/Constant/Constant.cs

@@ -22,6 +22,12 @@ namespace TEAMModelOS.SDK.DI
         public static readonly int private_lesson_limit = 50;
         public static readonly int private_lesson_expire = 7;
         public static readonly int school_lesson_expire = 7;
+
+        public static readonly string NotifyType_IES5_Management = "IES5_Management";
+        public static readonly string NotifyType_IES5_Course = "IES5_Course";
+        public static readonly string NotifyType_IES5_Task = "IES5_Task";
+        public static readonly string NotifyType_IES5_Contect = "IES5_Contect";
+
         public static readonly Dictionary<string, string> DefaultPeriod = new Dictionary<string, string> { 
             {"pre" ,"学前"},
             {"primary","小学"},

+ 119 - 10
TEAMModelOS.SDK/DI/CoreAPI/CoreAPIHttpService.cs

@@ -1,16 +1,27 @@
+using HTEXLib.COMM.Helpers;
+using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Options;
+using OpenXmlPowerTools;
 using System;
 using System.Collections.Generic;
+using System.Dynamic;
+using System.IO;
+using System.Linq;
 using System.Net;
 using System.Net.Http;
 using System.Net.Http.Json;
+using System.Security.Policy;
 using System.Text;
 using System.Text.Json;
 using System.Threading.Tasks;
+using TEAMModelOS.Models;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.DI.CoreAPI;
 using TEAMModelOS.SDK.Extension;
-
+using TEAMModelOS.SDK.Models;
 
 namespace TEAMModelOS.SDK
 {
@@ -38,14 +49,24 @@ namespace TEAMModelOS.SDK
     }
     public class CoreAPIHttpService
     {
-
+        private readonly IWebHostEnvironment _environment;
         public bool check=true;
+        private SnowflakeId _snowflakeId;
         private readonly HttpClient _httpClient;
         public readonly IOptionsMonitor<CoreAPIHttpServiceOptions> options;
-        public CoreAPIHttpService(HttpClient httpClient, IOptionsMonitor<CoreAPIHttpServiceOptions> optionsMonitor)
+        private readonly IConfiguration _configuration;
+        private readonly DI.DingDing _dingDing;
+        public readonly Option _option;
+        public CoreAPIHttpService(IOptionsSnapshot<Option> option, DingDing dingDing,IConfiguration configuration,HttpClient httpClient, IOptionsMonitor<CoreAPIHttpServiceOptions> optionsMonitor, IWebHostEnvironment environment,SnowflakeId snowflakeId)
         {
             _httpClient = httpClient;
             options = optionsMonitor;
+            _environment = environment;
+            _snowflakeId= snowflakeId;
+            _option = option?.Value;
+            _configuration = configuration;
+            _dingDing = dingDing;
+
         }
         /*
         hubName	string	Optional	指定要傳送到哪個訊息中樞,若沒給則不傳送端外通知,只會發送端內通知。(目前只有"hita"及"hita5"能使用)
@@ -56,20 +77,108 @@ namespace TEAMModelOS.SDK
         eventId	string	Optional	事件ID
         eventName	string	Optional	事件名稱
         data	string	Optional	額外資料
+
+
+        'request_school': vm.$t('notice.type1'), // 管理员收到他人申请加入的通知
+        'invite_school': vm.$t('notice.type2'), // 你收到学校邀请你的通知
+        'remove_school': vm.$t('notice.type3'), // 学校将你移除的通知
+        'request-join_school': vm.$t('notice.type1'), // 学校同意你的加入请求
+        'invite-join_school': vm.$t('notice.type2'), // 某人已同意你对他的邀请
+        'coedit_syllabus': vm.$t('notice.type4'), // 邀请课纲共编的通知
+        'share_syllabus': vm.$t('notice.type4'), // 个人课纲分享的通知
+        'transfer-admin_school': vm.$t('notice.type5'), // 管理员转移的通知
+        'scoring-arb_school': vm.$t('notice.type6'), // 仲裁卷阅卷任务分配通知
+        'scoring-err_school': vm.$t('notice.type6'), // 异常卷阅卷任务分配通知
+        'scoring-mark_school': vm.$t('notice.type6'), // 普通阅卷任务分配通知
+        'scan-join_groupList': vm.$t('notice.type7'), // 扫码加入名单通知
+        'scan-join_school': vm.$t('notice.type7'), // 扫码加入学校通知
+        'submitanswer_homework': vm.$t('notice.type8'), // 作业提交通知
+        'expire_lessonRecord': vm.$t('notice.type9'), // 课例过期通知
          */
         /// <summary>
+        /// 
         ///  發送端內外通知
+        /// 
+        /// id: 教师id,name 教师名称,code 语系
         /// </summary>
-        /// <param name="clientID"></param>
-        /// <param name="clientSecret"></param>
+        /// <param name="toTeachers"></param>
+        /// <param name="notifyCode"></param>
+        /// <param name="replaceData"></param>
         /// <param name="location"></param>
-        /// <param name="url"></param>
-        /// <param name="data"></param>
+        /// <param name="_configuration"></param>
+        /// <param name="_dingDing"></param>
         /// <returns></returns>
-        public async Task<(HttpStatusCode code, string content)> PushNotify(Dictionary<string, object> data, string location, IConfiguration _configuration, DI.DingDing _dingDing) {
-            return (HttpStatusCode.BadRequest, null);
+        public   void PushNotify(List<IdNameCode> toTeachers ,  string notifyCode,string notifyType,Dictionary<string, object> replaceData) {
+            /*
+             * IES5_Management  shift-assist_school  DelBeforeCopyAbility-mark_start  copyAbility-mark_finish  copyAbility-mark_start 
+             *                  transfer-admin_school invite-join_school invite_school  request_school request-join_school remove_school  scan-join_school
+             * IES5_Course      submitanswer_homework   scan-join_groupList    expire-school_lessonRecord
+             * IES5_Task        scoring-mark_school scoring-arb_school scoring-err_school 
+             * IES5_Contect     coedit_syllabus  share_syllabus 
+             {
+                "hubName":"hita5",
+                "sender":"ies5",
+                "tags":["1595321354_IES5_Management"]
+                "title":"",
+                "body":"",
+                "eventId":"",
+                "eventName":"",
+                "data":""action":{"type":"click\link","tokenbindtype":1,"url":"http://xxxx"}"
+            }
+            */
+            string lang = _option.Location.Contains("China") ? "zh-cn" : "en-us";
+            toTeachers.FindAll(x => string.IsNullOrWhiteSpace(x.code)||(!x.code.Equals("zh-cn")&& !x.code.Equals("zh-tw")&& !x.code.Equals("en-us"))).ForEach(x => { x.code = lang; });
+            var groups = toTeachers.GroupBy(x => x.code).Select(x => new { x.Key, list = x.ToList() });
+            var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
+            var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
+            var url = _configuration.GetValue<string>("HaBookAuth:CoreAPI");
+            var token = CoreTokenExtensions.CreateAccessToken(clientID, clientSecret,_option.Location).Result;
+            _httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {token.AccessToken}");
+            foreach (var group in groups)
+            {
+                string path = $"{_environment.ContentRootPath}/Lang/{group.Key}.json";
+                var sampleJson = File.ReadAllBytes(path).AsSpan();
+                Utf8JsonReader reader = new Utf8JsonReader(sampleJson);
+                if (JsonDocument.TryParseValue(ref reader, out JsonDocument jsonDoc) && jsonDoc.RootElement.TryGetProperty(notifyCode, out JsonElement json )) {
+                    List<string> msgs = json.ToObject<List<string>>();
+                    if (msgs.IsNotEmpty()) {
+                        var tags= group.list.Select(x => $"{x.id}_{notifyType}");
+                        NotifyData notifyData = new NotifyData
+                        {
+                            hubName = "hita5",
+                            sender = "ies5",
+                            tags = tags.ToList(),
+                            title = msgs[0],
+                            eventId = $"{notifyCode}-{_snowflakeId.NextId()}",
+                            eventName = $"{msgs[0]}",
+                            data = new { value = replaceData }.ToJsonString()
+                        };
+                        if (msgs.Count == 1)
+                        {
+                            notifyData.body = msgs[0];
+                        }
+                        else
+                        {
+                            replaceData.Keys.ToList().ForEach(x => {
+                                msgs[1]=  msgs[1].Replace("{" + x + "}", $"{replaceData[x]}");
+                            });
+                            notifyData.body = msgs[1];
+                        }
+                        _ = _httpClient.PostAsJsonAsync(url, notifyData);
+                    }
+                }
+            }
+        }
+        public class NotifyData { 
+            public string hubName { get; set; }
+            public string sender { get; set; }
+            public List<string> tags { get; set; } = new List<string>();
+            public string title { get; set; }
+            public string body { get; set; }
+            public string eventId { get; set; }
+            public string eventName { get; set; }
+            public string data { get; set; }
         }
-
         /// <summary>
         ///  发送短信验证码
         /// </summary>

+ 5 - 0
TEAMModelOS.SDK/Models/Cosmos/BI/DingDingUserInfo.cs

@@ -123,5 +123,10 @@ namespace TEAMModelOS.SDK.Models.Cosmos.BI
         /// 学校列表
         /// </summary>
         public string schoolIds { get; set; }
+
+        /// <summary>
+        /// 是否禁用   0 禁用   1启用
+        /// </summary>
+        public long isDisable { get; set; } = 1;
     }
 }

+ 2 - 0
TEAMModelOS.SDK/Models/Cosmos/Teacher/Teacher.cs

@@ -25,6 +25,8 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public List<LoginInfo> loginInfos { get; set; } = new List<LoginInfo>();
 
+        public string lang { get; set; }
+
         public class LoginInfo
         {
             /// <summary>

+ 5 - 1
TEAMModelOS.SDK/Models/Service/Common/TeacherService.cs

@@ -29,7 +29,8 @@ namespace TEAMModelOS.Services
 {
     public static class TeacherService
     {
-        public static async Task<TeacherInfo> TeacherInfo(AzureCosmosFactory _azureCosmos, Teacher teacher, string name, string picture, string id, AzureStorageFactory _azureStorage, Option _option,AzureRedisFactory _azureRedis,string ip, HttpTrigger _httpTrigger)
+        public static async Task<TeacherInfo> TeacherInfo(AzureCosmosFactory _azureCosmos, Teacher teacher, string name, string picture, string id,
+            AzureStorageFactory _azureStorage, Option _option,AzureRedisFactory _azureRedis,string ip, HttpTrigger _httpTrigger,string lang )
         {
             List<object> schools = new List<object>();
             List<AreaDto> areas = new List<AreaDto>();
@@ -45,6 +46,9 @@ namespace TEAMModelOS.Services
                 if (teacher == null)
                 {
                     teacher = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<Teacher>(id, new PartitionKey("Base"));
+                    if (!string.IsNullOrWhiteSpace(lang) &&  string.IsNullOrWhiteSpace(teacher.lang)) {
+                        teacher.lang = lang;
+                    }
                     teacher.name = $"{name}";
                     teacher.picture = $"{picture}";
                 }

+ 14 - 10
TEAMModelOS/ClientApp/src/api/schoolSetting.js

@@ -6,7 +6,7 @@ export default {
     findSchoolSystem: function (data) {
         return post('/school/init/find', data)
     },
-    findSchoolBase: function(schoolCode) {
+    findSchoolBase: function (schoolCode) {
         let format = {
             "school_code": schoolCode
         }
@@ -62,9 +62,9 @@ export default {
     getClassByIds: function (data) {
         return post('/school/classroom/name', data)
     },
-	
-	// 申请建立学校
-	applySchool:function (data) {
+
+    // 申请建立学校
+    applySchool: function (data) {
         return post('/core/apply-school', data)
     },
 
@@ -72,21 +72,25 @@ export default {
     applyManager: function (data) {
         return post('/core/apply-manager', data)
     },
-	
-	setDefaultSch:function (data) {
+
+    setTchInfo: function (data) {
+        return post('/teacher/init/set-teacher-info', data)
+    },
+
+    setDefaultSch: function (data) {
         return post('/teacher/init/set-teacher-info', data)
     },
     //转让管理员身份
-    TransferAdminRole:function (data) {
+    TransferAdminRole: function (data) {
         return post('/teacher/init/set-teacher-info', data)
     },
     //保存/更新学校基础设置
-    upsertSchoolSetting:function (data) {
+    upsertSchoolSetting: function (data) {
         return post('/school/setting/opt-setting', data)
     },
     //查询学校基础设置
-    getSchoolSetting:function (data) {
+    getSchoolSetting: function (data) {
         return post('/school/setting/find-id', data)
     },
-    
+
 }

+ 3 - 2
TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/Exam.vue

@@ -6,9 +6,9 @@
             {{ $t("studentWeb.courseContent.noExam") }}
         </div>
         <div v-else class="exam-chart-wrap">
+            <ExamTable :examDetaiInfo="examDetaiInfo" :examInfo="examInfo" :recordInfo="recordInfo"></ExamTable>
             <ScoreBarChart :total="classTotal" :subjectNames="subjectName"></ScoreBarChart>
             <ExamQu :quData="correctData[0] ? correctData[0].data : []"></ExamQu>
-            <ExamTable :examDetaiInfo="examDetaiInfo" :examInfo="examInfo" :recordInfo="recordInfo"></ExamTable>
         </div>
         <div>
             <Icon type="ios-person" class="owner-student-client-icon"/>
@@ -238,7 +238,8 @@ export default {
 }
 .exam-chart-wrap{
     display: flex;
-    overflow-x: scroll;
+    // overflow-x: scroll;
+    flex-wrap: wrap;
 }
 
 .clt-type {

+ 2 - 2
TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/ExamQu.vue

@@ -264,8 +264,8 @@ export default {
 </script>
 <style scoped lang="less">
 .qu-score {
-    padding: 15px 40px 0 40px;
-    width: 400px;
+    padding: 15px 20px 0 20px;
+    width: 500px;
     height: 250px;
 }
 .qu-score-count {

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/ExamTable.vue

@@ -321,7 +321,7 @@ export default {
 .exam-table-wrap {
     margin-top: 5px;
     padding: 10px;
-    width: 250px;
+    width: 135px;
     height: 270px;
     box-shadow: 0px 2px 5px #e9e9e9;
     display: flex;

+ 2 - 1
TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/RecordView.less

@@ -178,6 +178,7 @@
                         height: auto;
                         padding: 3px 10px;
                         border-radius: 4px;
+                        width: 130px;
     
                         &:hover {
                             cursor: pointer;
@@ -405,7 +406,7 @@
                         border: 1px dashed transparent;
                         margin-bottom: 15px;
                         padding: 5px 5px;
-                        overflow-x: scroll;
+                        // overflow-x: scroll;
                         
                         &:hover {
                             border: 1px dashed #e0e0e0;

+ 52 - 3
TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/RecordView.vue

@@ -137,8 +137,12 @@
                                         <div v-for="(items, index) in showPageList" :key="index" :id="'page' + (items.page)">
                                             <div v-if="items.pageData.length" class="message-box">
                                                 <div class="message-page">
-                                                    <div @click="toVideo(index + 1, $event)">
+                                                    <div class="messagetoPPT-tag" @click="toVideo(index + 1, $event)">
+                                                        {{`${$t('cusMgt.rcd.cw')}${items.page}${$t('cusMgt.rcd.page')}`}}
+                                                    </div>
+                                                    <div>
                                                         <img :src="items.img" @click="openViewer(items.img)">
+                                                        <span style="color: #9e9e9e;">{{ items.time }}</span>
                                                     </div>
                                                 </div>
                                                 <div class="message-record">
@@ -147,7 +151,7 @@
                                                             <!-- 即问即答 -->
                                                             <div v-if="currentfilterType === '' || currentfilterType === 'ShowAnsLoad'">
                                                                 <ShowQues class="event-item student-event" v-if="event.Event === 'PopQuesLoad' || event.Event === 'ReAtmpAnsStrt'" :nowStuInfo="nowStuInfo" :evtType="event.Event" :irsData="event.data"></ShowQues>
-                                                                <PopQues class="event-item" v-if="event.Event === 'PopQuesLoad' || event.Event === 'ReAtmpAnsStrt'" :evtType="event.Event" :irsData="event.data"></PopQues>
+                                                                <PopQues class="event-item" v-if="(event.Event === 'PopQuesLoad' || event.Event === 'ReAtmpAnsStrt') && baseData" :evtType="event.Event" :irsData="event.data" :students="baseData.student"></PopQues>
                                                             </div>
                                                             <!-- 抢权 -->
                                                             <Buzr class="event-item student-event" v-if="event.Event === 'BuzrAns' && baseData" :buzrData="event.data" :students="baseData.student"></Buzr>
@@ -561,6 +565,7 @@ export default {
                 page.page = index + 1
                 //当前页面对应的sokrates
                 page.pageData = pageEvents.filter(record => record.Pgid === item && this.fnEvents.includes(record.Event))
+                page.time = this.formatTime(page.pageData[0]?.Time)
                 havePage += (page.pageData.length ? 1 : 0)
                 page.pageData.forEach(e => {
                     e.pageIndex = index
@@ -701,6 +706,35 @@ export default {
             // this.$refs["datawrap"].scrollIntoView('#page' + page, 500)
             this.player.play()
         },
+        // 点击互动记录页面tag
+        toVideo(page, e) {
+            this.curPage = page
+            //页面滚动
+            /* let dataLoacation = this.$refs["datawrap"].getPosition()
+            let pageLocaltion = this.$refs["pagewrap"].getPosition()
+            let y = e.pageY - 770 + pageLocaltion.scrollTop + dataLoacation.scrollTop
+            this.$nextTick(() => {
+                this.$refs["pagewrap"].scrollTo(
+                    {
+                        x: 0,
+                        y: 0
+                    }
+                )
+                this.$refs["datawrap"].scrollTo(
+                    {
+                        x: 0,
+                        y: y
+                    }
+                )
+            }) */
+            //视频时间定位
+            let pageInfo = this.markers.find(item => {
+                return item.page === page
+            })
+            if (pageInfo) {
+                this.player.currentTime(pageInfo.time)
+            }
+        },
         // 点击课件page
         getCurHTEX(page) {
             this.curPage = page
@@ -717,7 +751,7 @@ export default {
                     this.player.pause()
                 }
                 //互动记录滚动
-                // this.$refs["datawrap"].scrollIntoView('#page' + page, 500)
+                this.$refs["datawrap"].scrollIntoView('#page' + page, 500)
             } else {
             }
         },
@@ -755,6 +789,21 @@ export default {
             var S = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()) + " "
             return Y + M + D + H + Min;
         },
+        //小于10 补0
+        fullZero(n) {
+            return n < 10 ? `0${n}` : `${n}`
+        },
+        formatTime(time) {
+            let h = Math.floor(time / (60 * 60))
+            time = time % (60 * 60)
+            let m = Math.floor(time / 60)
+            let s = Math.floor(time % 60)
+            return `${this.fullZero(h)}:${this.fullZero(m)}:${this.fullZero(s)}`
+        },
+        //查看图片
+        openViewer(url) {
+            this.$hevueImgPreview(url)
+        },
     },
     computed: {
         ...mapGetters(["getNowCourse", "getSidebarisOpen",]),

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/ScoreBarChart.vue

@@ -152,7 +152,7 @@ export default {
 
 <style scoped>
 .score-bar-chart {
-    width: 400px;
+    width: 300px;
     /* margin: auto; */
     /* margin-bottom: 50px; */
     padding: 15px 40px 0px 40px;

+ 14 - 3
TEAMModelOS/ClientApp/src/view/settings/Index.vue

@@ -96,9 +96,20 @@ export default {
   methods: {
 
     onSelectLang(val) {
-      localStorage.setItem('cloudSetting', JSON.stringify(this.cloudSetting))
-      this.$tools.changeLang(val)
-      this.$store.commit("setLanguage", val);
+      this.$api.schoolSetting.setTchInfo({
+        "opt": "UpdateLang",
+        "lang": val
+      }).then(res => {
+        if (!res.error) {
+          localStorage.setItem('cloudSetting', JSON.stringify(this.cloudSetting))
+          this.$tools.changeLang(val)
+          this.$store.commit("setLanguage", val);
+        } else {
+          this.$Message.error('Fail')
+        }
+      }).catch(e => {
+        this.$Message.error('Fail')
+      })
     },
 
     onMenuStatusChange(val) {

+ 11 - 1
TEAMModelOS/Controllers/Both/ShareController.cs

@@ -244,7 +244,17 @@ namespace TEAMModelOS.Controllers
                                         from = $"ies5:{_option.Location}:private",
                                         to = new List<string>() { x.code.Replace("Share-", "").Replace($"{x.type}-", "") },
                                         label = $"{x.type}_syllabus",
-                                        body = new { location = _option.Location, biz = x.type, tmdid = x.issuer, tmdname = x.issuerName, sid = x.id, sname = x.syllabusName, vid = x.volumeId, vname = x.volumeName, status = 1, time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }.ToJsonString(),
+                                        body = new { location = _option.Location,
+                                            biz = x.type,
+                                            tmdid = x.issuer,
+                                            tmdname = x.issuerName,
+                                            sid = x.id,
+                                            sname = x.syllabusName,
+                                            vid = x.volumeId,
+                                            vname = x.volumeName,
+                                            status = 1,
+                                            time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
+                                        }.ToJsonString(),
                                         expires = DateTimeOffset.UtcNow.AddDays(7).ToUnixTimeSeconds()
                                     };
                                     var url = _configuration.GetValue<string>("HaBookAuth:CoreService:sendnotification");

+ 5 - 3
TEAMModelOS/Controllers/Normal/ArtSettingController.cs

@@ -74,9 +74,11 @@ namespace TEAMModelOS.Controllers
                 request.TryGetProperty("schoolCode", out JsonElement _schoolCode);
                 ///request.TryGetProperty("areaId", out JsonElement _areaId);
                 List<School> schools = new List<School>();
-                School schoolHbcn = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>("hbcn", new PartitionKey("Base"));
-                schools.Add(schoolHbcn);
-                if (!string.IsNullOrWhiteSpace($"{_schoolCode}") && !$"{_schoolCode}".Equals("hbcn")) {
+                //School schoolHbcn = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>("hbcn", new PartitionKey("Base"));
+                //schools.Add(schoolHbcn);
+                //if (!string.IsNullOrWhiteSpace($"{_schoolCode}") && !$"{_schoolCode}".Equals("hbcn")) {
+                if (!string.IsNullOrWhiteSpace($"{_schoolCode}") )
+                    {
                     School schoolSelf = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>($"{_schoolCode}", new PartitionKey("Base"));
                     schools.Add(schoolSelf);
                 }

+ 39 - 9
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -125,7 +125,22 @@ namespace TEAMModelOS.Controllers
             {
                
                 switch (true)
-                {
+                { 
+                    //修改常用语系
+                    case bool when $"{_opt}".Equals("UpdateLang", StringComparison.OrdinalIgnoreCase) && (request.TryGetProperty("lang", out JsonElement lang)):
+                        {
+                            Teacher teacher = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<Teacher>(userid, new PartitionKey("Base"));
+                            if (!string.IsNullOrEmpty($"{lang}"))
+                            {
+                                teacher.lang = $"{lang}";
+                                await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, userid, new PartitionKey("Base"));
+                                return Ok(new { teacher, status = 1 });
+                            }
+                            else
+                            {
+                                return BadRequest(new { status = -1, msg = "语系参数为空!" });
+                            }
+                        }
                     //修改默认学校
                     case bool when $"{_opt}".Equals("UpdateDefaultSchool", StringComparison.OrdinalIgnoreCase) && (request.TryGetProperty("defaultSchool", out JsonElement _defaultSchool)):
                         {
@@ -228,7 +243,8 @@ namespace TEAMModelOS.Controllers
                                     from = $"ies5:{_option.Location}:{school}",
                                     to = new List<string> { $"{_targetTecher}" },
                                     label = $"{code}_school",
-                                    body = new {
+                                    body = new
+                                    {
                                         location = _option.Location,
                                         biz = code,
                                         tmdid = userid,
@@ -249,6 +265,9 @@ namespace TEAMModelOS.Controllers
                                     var location = _option.Location;
                                     await _notificationService.SendNotification(clientID, clientSecret, location, url, notification);
                                 }
+                                Teacher targetTeacher = await client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReadItemAsync<Teacher>($"{_targetTecher}", new PartitionKey($"Base"));
+                                _coreAPIHttpService.PushNotify(new List<IdNameCode> { new IdNameCode { id= targetTeacher.id,name= targetTeacher.name,code=targetTeacher.lang} }, "transfer-admin_school", Constant.NotifyType_IES5_Management,
+                                    new Dictionary<string, object> { { "tmdname", name },{ "schooName", schoolBase.name } });
                                 _ = _azureStorage.SaveLog("transfer-admin-role", new { request, userid, name, school, schoolName = schoolBase.name, targetTecher = _targetTecher, }.ToJsonString(), bizId: $"{userid}-{schoolBase.id}-{_targetTecher}", httpContext: HttpContext, dingDing: _dingDing, scope: "school");
                                 return Ok(new { status = 1 });
                             }
@@ -350,6 +369,10 @@ namespace TEAMModelOS.Controllers
         [HttpPost("get-teacher-info")]
         public async Task<IActionResult> GetTeacherInfo(JsonElement request)
         {
+            string lang = "";
+            if (HttpContext.Request.Headers.TryGetValue("lang", out var _lang)) {
+                lang = $"{_lang}";
+            }
             string OAuthShow_domain = HttpContext?.Request?.Host.Host;
             if (OAuthShow_domain.Equals("teammodelos.chinacloudsites.cn"))
             {
@@ -373,7 +396,7 @@ namespace TEAMModelOS.Controllers
             try
             {
                 Teacher teacher = null;
-                TeacherInfo teacherInfo = await TeacherService.TeacherInfo(_azureCosmos, teacher, $"{name}", $"{picture}", id, _azureStorage, _option, _azureRedis, ip, _httpTrigger);
+                TeacherInfo teacherInfo = await TeacherService.TeacherInfo(_azureCosmos, teacher, $"{name}", $"{picture}", id, _azureStorage, _option, _azureRedis, ip, _httpTrigger, $"{_lang}");
                 teacherInfo.areas.ForEach(x => { if (x.setting != null) { x.setting.accessConfig = x.setting.accessConfig; } });
                 LoginService.LoginLog(HttpContext, _option, _logger, _dingDing, ip, region, id, $"{name}", 200);
                 int lessonLimit = teacherInfo.teacher.lessonLimit;
@@ -1119,13 +1142,14 @@ namespace TEAMModelOS.Controllers
                     {
                         teachers.Add(item);
                     }
+                    string code = grant_type.GetString();
+                    if (grant_type.GetString().Equals("join"))
+                    {
+                        code = "invite-join";
+                    }
                     if (teachers.IsNotEmpty())
                     {
-                        string code = grant_type.GetString();
-                        if (grant_type.GetString().Equals("join"))
-                        {
-                            code = "invite-join";
-                        }
+
                         notification = new Notification
                         {
                             hubName = "hita",
@@ -1144,8 +1168,14 @@ namespace TEAMModelOS.Controllers
                         var clientID = _configuration.GetValue<string>("HaBookAuth:CoreService:clientID");
                         var clientSecret = _configuration.GetValue<string>("HaBookAuth:CoreService:clientSecret");
                         var location = _option.Location;
-                        var code = await _notificationService.SendNotification(clientID, clientSecret, location, url, notification);
+                        var val = await _notificationService.SendNotification(clientID, clientSecret, location, url, notification);
+                    }
+                    if (teachers.IsNotEmpty()) {
+                        //string sql = $"select c.id, c.name ,c.lang as code from c where c.id in ({string.Join(",",teachers.Select(x=>$"'{x.id}'"))})";
+                        //_coreAPIHttpService.PushNotify(new List<IdNameCode> { new IdNameCode { id = targetTeacher.id, name = targetTeacher.name, code = targetTeacher.lang } }, $"{code}_school", Constant.NotifyType_IES5_Management,
+                        //          new Dictionary<string, object> { { "tmdname", name }, { "schooName", schoolBase.name } });
                     }
+                      
                     return Ok(new { stauts = 1 });
                 }
             }

+ 20 - 0
TEAMModelOS/Lang/en-us.json

@@ -0,0 +1,20 @@
+{
+  //start 通知類語言包
+  //通知類型編碼 ["通知標題 title","通知內容 body"]
+  "request_school": [ "Apply to join school", "{tmdname}({tmdid}) applying to join {schooName}." ], // 管理員收到他人申請加入的通知
+  "invite_school": [ "Invite to join school", "{schooName} has invited you to join." ], // 你收到學校邀請你的通知
+  "remove_school": [ "Remove from school", "{schooName} removed you from the school's teacher list." ], // 學校將你移除的通知
+  "request-join_school": [ "Agree to join school", "{schooName} has agreed you to join the school." ], // 學校同意你的加入請求
+  "invite-join_school": [ "Accepting join school invitation", "{tmdname} has accepted an invitation to join {schooName}." ], // 某人已同意你對他的邀請
+  "coedit_syllabus": [ "Invite to co-edit syllabus", "{tmdname} invites you to co-edit school-based syllabus, Volume name: {volumeName}, Node name: {syllabusName}." ], // 邀請課綱共編的通知
+  "share_syllabus": [ "Receive shared syllabus", "{tmdname} shared personal syllabus with you, Volume name: {volumeName}, Node name: {syllabusName}." ], // 個人課綱分享的通知
+  "transfer-admin_school": [ "Transfer administrator", "{tmdname} will transfer the administrator of {schooName} to you." ], // 管理員轉移的通知
+  "scoring-arb_school": [ "Assign arbitration exam scoring task", "{tmdname} of {schoolname} has assign you an arbitration exam scoring task." ], //仲裁卷閱卷任務分配通知
+  "scoring-err_school": [ "Assign abnormal exam paper grading task", "{tmdname} of {schoolname} has assign you an abnormal exam paper grading task." ], //異常卷閱卷任務分配通知
+  "scoring-mark_school": [ "Assign exam paper grading task", "{tmdname} of {schoolname} has assign you an exam paper grading task." ], //普通閱卷任務分配通知
+  "scan-join_groupList": [ "Join course notice", "{tmdname} join the {groupListName} course via QRcode scanning" ], //掃碼加入名單通知
+  "scan-join_school": [ "Join school notice", "{tmdname} join school, {schoolName}, via QRcode scanning" ], // 掃碼加入學校通知
+  "submitanswer_homework": [ "Homework submission notice", "{tmdname} has submitted a homework({homeworkName})" ], //作業提交通知
+  "expire-school_lessonRecord": [ "Lesson record expiration notice", "Your lesson record, {lessonRecordName}, on {schoolname} will expire at {expireTime}" ] //課堂記錄過期通知
+  //end  通知類語言包
+}

+ 20 - 0
TEAMModelOS/Lang/zh-cn.json

@@ -0,0 +1,20 @@
+{
+  //start 通知类语言包
+  //通知类型编码 ["通知标题 title","通知内容 body"]
+  "request_school": [ "申请加入学校通知", "{tmdname}({tmdid})申请加入{schooName}。" ], // 管理员收到他人申请加入的通知
+  "invite_school": [ "邀请加入学校通知", "{schooName}邀请您加入学校。" ], // 你收到学校邀请你的通知
+  "remove_school": [ "从学校移除通知", "{schooName}将您从学校教师名单中移除。" ], // 学校将你移除的通知
+  "request-join_school": [ "同意申请加入学校通知", "{schooName}已同意您申请加入学校。" ], // 学校同意你的加入请求
+  "invite-join_school": [ "同意邀请加入学校通知", "{tmdname}已接受加入{schooName}的邀请。" ], // 某人已同意你对他的邀请
+  "coedit_syllabus": [ "邀请共编课纲通知", "{tmdname}邀请你参与共编校本课纲,册别名称:{volumeName},课纲节点名称:{syllabusName}。" ], // 邀请课纲共编的通知
+  "share_syllabus": [ "课纲分享接收通知", "{tmdname}向您分享了个人课纲,册别名称:{volumeName},课纲节点名称:{syllabusName}。" ], // 个人课纲分享的通知
+  "transfer-admin_school": [ "管理员移交通知", "{tmdname}将{schooName}的管理员移交给您。" ], // 管理员转移的通知
+  "scoring-arb_school": [ "仲裁卷阅卷任务通知", "{schoolname}的{tmdname}向您发送了仲裁卷阅卷任务。" ], //仲裁卷阅卷任务分配通知
+  "scoring-err_school": [ "异常卷阅卷任务通知", "{schoolname}的{tmdname}向您发送了异常卷阅卷任务。" ], //异常卷阅卷任务分配通知
+  "scoring-mark_school": [ "普通阅卷任务通知", "{schoolname}的{tmdname}向您发送了普通卷阅卷任务。" ], //普通阅卷任务分配通知
+  "scan-join_groupList": [ "扫码加入名单通知", "{tmdname}扫码加入名单,名单:{groupListName}" ], //扫码加入名单通知
+  "scan-join_school": [ "扫码加入学校通知", "{tmdname}扫码加入学校,学校名称:{schoolName}" ], // 扫码加入学校通知
+  "submitanswer_homework": [ "作业提交通知", "{tmdname}已提交作业,作业名称({homeworkName})" ], //作业提交通知
+  "expire-school_lessonRecord": [ "课例到期通知", "您在{schoolname}的课例将在{expireTime}到期,课例名称:{lessonRecordName}" ] //课例过期通知
+  //end  通知类语言包
+}

+ 20 - 0
TEAMModelOS/Lang/zh-tw.json

@@ -0,0 +1,20 @@
+{
+  //start 通知类语言包
+  //通知类型编码 ["通知标题 title","通知内容 body"]
+  "request_school": [ "申请加入学校通知", "{tmdname}({tmdid})申请加入{schooName}。" ], // 管理员收到他人申请加入的通知
+  "invite_school": [ "邀请加入学校通知", "{schooName}邀请您加入学校。" ], // 你收到学校邀请你的通知
+  "remove_school": [ "从学校移除通知", "{schooName}将您从学校教师名单中移除。" ], // 学校将你移除的通知
+  "request-join_school": [ "同意申请加入学校通知", "{schooName}已同意您申请加入学校。" ], // 学校同意你的加入请求
+  "invite-join_school": [ "同意邀请加入学校通知", "{tmdname}已接受加入{schooName}的邀请。" ], // 某人已同意你对他的邀请
+  "coedit_syllabus": [ "邀请共编课纲通知", "{tmdname}邀请你参与共编校本课纲,册别名称:{volumeName},课纲节点名称:{syllabusName}。" ], // 邀请课纲共编的通知
+  "share_syllabus": [ "课纲分享接收通知", "{tmdname}向您分享了个人课纲,册别名称:{volumeName},课纲节点名称:{syllabusName}。" ], // 个人课纲分享的通知
+  "transfer-admin_school": [ "管理员移交通知", "{tmdname}将{schooName}的管理员移交给您。" ], // 管理员转移的通知
+  "scoring-arb_school": [ "仲裁卷阅卷任务通知", "{schoolname}的{tmdname}向您发送了仲裁卷阅卷任务。" ], //仲裁卷阅卷任务分配通知
+  "scoring-err_school": [ "异常卷阅卷任务通知", "{schoolname}的{tmdname}向您发送了异常卷阅卷任务。" ], //异常卷阅卷任务分配通知
+  "scoring-mark_school": [ "普通阅卷任务通知", "{schoolname}的{tmdname}向您发送了普通卷阅卷任务。" ], //普通阅卷任务分配通知
+  "scan-join_groupList": [ "扫码加入名单通知", "{tmdname}扫码加入名单,名单:{groupListName}" ], //扫码加入名单通知
+  "scan-join_school": [ "扫码加入学校通知", "{tmdname}扫码加入学校,学校名称:{schoolName}" ], // 扫码加入学校通知
+  "submitanswer_homework": [ "作业提交通知", "{tmdname}已提交作业,作业名称({homeworkName})" ], //作业提交通知
+  "expire-school_lessonRecord": [ "课例到期通知", "您在{schoolname}的课例将在{expireTime}到期,课例名称:{lessonRecordName}" ] //课例过期通知
+  //end  通知类语言包
+}