黄贺彬 пре 9 месеци
родитељ
комит
7d8f9eb0d1
100 измењених фајлова са 4962 додато и 1896 уклоњено
  1. 2 0
      .gitignore
  2. 1 1
      TEAMModelBI/ClientApp/package.json
  3. 14 1
      TEAMModelBI/ClientApp/src/api/index.js
  4. 1 1
      TEAMModelBI/ClientApp/src/components/echarts/test/size.vue
  5. 4 4
      TEAMModelBI/ClientApp/src/components/echarts/versionsPie.vue
  6. 389 4
      TEAMModelBI/ClientApp/src/language/lang/zh-cn.js
  7. 402 20
      TEAMModelBI/ClientApp/src/language/lang/zh-tw.js
  8. 33 6
      TEAMModelBI/ClientApp/src/router/index.js
  9. 2 1
      TEAMModelBI/ClientApp/src/until/common.js
  10. 3 2
      TEAMModelBI/ClientApp/src/until/http.js
  11. 26 3
      TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue
  12. 37 19
      TEAMModelBI/ClientApp/src/view/common/aside.vue
  13. 1 1
      TEAMModelBI/ClientApp/src/view/common/header.vue
  14. 724 0
      TEAMModelBI/ClientApp/src/view/htcommunity/adminpanel.vue
  15. 3 3
      TEAMModelBI/ClientApp/src/view/index/dashboard.vue
  16. 108 108
      TEAMModelBI/ClientApp/src/view/index/index.vue
  17. 191 9
      TEAMModelBI/ClientApp/src/view/issueCoupons/crteadCoupon.vue
  18. 189 2
      TEAMModelBI/ClientApp/src/view/issueCoupons/notice.vue
  19. 17 5
      TEAMModelBI/ClientApp/src/view/login.vue
  20. 437 119
      TEAMModelBI/ClientApp/src/view/product/details.vue
  21. 191 185
      TEAMModelBI/ClientApp/src/view/product/index.vue
  22. 85 13
      TEAMModelBI/ClientApp/src/view/schoolmanage/schoolAnalyse.vue
  23. 103 90
      TEAMModelBI/ClientApp/src/view/userInquire/details.vue
  24. 71 381
      TEAMModelBI/ClientApp/src/view/userInquire/idIncrement.vue
  25. 16 16
      TEAMModelBI/ClientApp/src/view/userInquire/index.vue
  26. 7 4
      TEAMModelBI/ClientApp/src/view/userInquire/iot.vue
  27. 1 1
      TEAMModelBI/Controllers/BICommon/BICouponController.cs
  28. 6 8
      TEAMModelBI/Controllers/BICommon/BINoticeController.cs
  29. 3 3
      TEAMModelBI/Controllers/BICommon/BIProductUseRecordController.cs
  30. 6 9
      TEAMModelBI/Controllers/BICommon/JointlyController.cs
  31. 2 3
      TEAMModelBI/Controllers/BICommon/StatsNoticeController.cs
  32. 10 10
      TEAMModelBI/Controllers/BIHome/HomeStatisController.cs
  33. 3 3
      TEAMModelBI/Controllers/BIHome/OnLineController.cs
  34. 7 8
      TEAMModelBI/Controllers/BINormal/AbilityMgmtController.cs
  35. 9 9
      TEAMModelBI/Controllers/BINormal/AbilityTaskMgmtController.cs
  36. 21 21
      TEAMModelBI/Controllers/BINormal/AreaRelevantController.cs
  37. 61 63
      TEAMModelBI/Controllers/BINormal/BatchAreaController.cs
  38. 14 14
      TEAMModelBI/Controllers/BINormal/BusinessConfigController.cs
  39. 11 11
      TEAMModelBI/Controllers/BINormal/BusinessUsersController.cs
  40. 153 16
      TEAMModelBI/Controllers/BIProductAnalysis/ProductAnalysisController.cs
  41. 63 69
      TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs
  42. 3 3
      TEAMModelBI/Controllers/BISchool/RoomController.cs
  43. 183 90
      TEAMModelBI/Controllers/BISchool/SchoolController.cs
  44. 0 1
      TEAMModelBI/Controllers/BIServer/BiServersController.cs
  45. 1 1
      TEAMModelBI/Controllers/BIStudent/StuActivityController.cs
  46. 7 7
      TEAMModelBI/Controllers/BIStudent/StudentController.cs
  47. 4 4
      TEAMModelBI/Controllers/BITable/BIOpenApiController.cs
  48. 9 10
      TEAMModelBI/Controllers/BITable/DDStructController.cs
  49. 2 3
      TEAMModelBI/Controllers/BITable/IES5OAuthController.cs
  50. 2 2
      TEAMModelBI/Controllers/BITable/OperateLogController.cs
  51. 18 20
      TEAMModelBI/Controllers/BITable/TableDingDingInfoController.cs
  52. 5 5
      TEAMModelBI/Controllers/BITeacher/TeacherController.cs
  53. 13 12
      TEAMModelBI/Controllers/BITest/Ies5TestController.cs
  54. 32 36
      TEAMModelBI/Controllers/BITest/TestController.cs
  55. 278 156
      TEAMModelBI/Controllers/BITmid/TmidController.cs
  56. 18 18
      TEAMModelBI/Controllers/Census/ActivitySticsController.cs
  57. 2 2
      TEAMModelBI/Controllers/Census/BlobLogController.cs
  58. 21 22
      TEAMModelBI/Controllers/Census/ItemSticsController.cs
  59. 35 35
      TEAMModelBI/Controllers/Census/LessonSticsController.cs
  60. 19 21
      TEAMModelBI/Controllers/Census/PaperController.cs
  61. 26 26
      TEAMModelBI/Controllers/Census/ProductStatisController.cs
  62. 55 57
      TEAMModelBI/Controllers/Census/SchoolController.cs
  63. 3 4
      TEAMModelBI/Controllers/LoginController.cs
  64. 8 11
      TEAMModelBI/Controllers/RepairApi/InitialAreaController.cs
  65. 2 2
      TEAMModelBI/Controllers/RepairApi/NormalController.cs
  66. 31 19
      TEAMModelBI/Controllers/RepairApi/SchoolRepController.cs
  67. 5 5
      TEAMModelBI/Controllers/RepairApi/TeacherREPController.cs
  68. 2 5
      TEAMModelBI/Filter/RequestAuditFilter.cs
  69. 23 0
      TEAMModelBI/Models/AssistSchool.cs
  70. 1 2
      TEAMModelBI/Models/ItemInfo.cs
  71. 41 0
      TEAMModelBI/Models/Purchase.cs
  72. 12 2
      TEAMModelBI/Models/RearEndMiddle.cs
  73. 0 1
      TEAMModelBI/Startup.cs
  74. 4 4
      TEAMModelBI/TEAMModelBI.csproj
  75. 22 23
      TEAMModelBI/Tool/CommonFind.cs
  76. 8 7
      TEAMModelBI/Tool/CosmosBank/ActivityWay.cs
  77. 5 4
      TEAMModelBI/Tool/CosmosBank/JointlySingleQuery1.cs
  78. 4 3
      TEAMModelBI/Tool/CosmosBank/ProductWay.cs
  79. 4 3
      TEAMModelBI/Tool/CosmosBank/SchoolWay.cs
  80. 11 20
      TEAMModelBI/Tool/CosmosBank/StatsWay.cs
  81. 4 2
      TEAMModelBI/Tool/Extension/JwtAuth.cs
  82. 1 2
      TEAMModelBI/Tool/TimeHelper1.cs
  83. 11 0
      TEAMModelOS.Extension/Contest.Client/.eslintrc.cjs
  84. 30 0
      TEAMModelOS.Extension/Contest.Client/.gitignore
  85. 11 0
      TEAMModelOS.Extension/Contest.Client/Contest.Client.esproj
  86. 35 0
      TEAMModelOS.Extension/Contest.Client/README.md
  87. 5 0
      TEAMModelOS.Extension/Contest.Client/babel.config.js
  88. 13 0
      TEAMModelOS.Extension/Contest.Client/index.html
  89. 8 0
      TEAMModelOS.Extension/Contest.Client/jsconfig.json
  90. 10 0
      TEAMModelOS.Extension/Contest.Client/nuget.config
  91. 56 0
      TEAMModelOS.Extension/Contest.Client/package.json
  92. BIN
      TEAMModelOS.Extension/Contest.Client/public/favicon.ico
  93. 22 0
      TEAMModelOS.Extension/Contest.Client/public/index.html
  94. 48 0
      TEAMModelOS.Extension/Contest.Client/public/reset.css
  95. 27 0
      TEAMModelOS.Extension/Contest.Client/src/App.vue
  96. 296 0
      TEAMModelOS.Extension/Contest.Client/src/api/http.js
  97. 39 0
      TEAMModelOS.Extension/Contest.Client/src/api/index.js
  98. BIN
      TEAMModelOS.Extension/Contest.Client/src/assets/img/events.jpg
  99. BIN
      TEAMModelOS.Extension/Contest.Client/src/assets/img/fengj.jpg
  100. 0 0
      TEAMModelOS.Extension/Contest.Client/src/assets/img/fengjing.jpg

+ 2 - 0
.gitignore

@@ -269,3 +269,5 @@ TEAMModelOS.FunctionV4/Properties/ServiceDependencies/teammodelfunction-rc - Zip
 /TEAMModelOS/.local-chromium
 
 TEAMModelBI/Properties/ServiceDependencies/teammodelbi-RC - Web Deploy/profile.arm.json
+/TEAMModelOS.Function/local.settings.json
+/TEAMModelOS.Extension/Contest.Client/dist

+ 1 - 1
TEAMModelBI/ClientApp/package.json

@@ -4,7 +4,7 @@
     "private": true,
     "scripts": {
         "serve": "vue-cli-service serve",
-        "build": "vue-cli-service build",
+        "build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
         "lint": "vue-cli-service lint"
     },
     "dependencies": {

+ 14 - 1
TEAMModelBI/ClientApp/src/api/index.js

@@ -610,5 +610,18 @@ export default {
     // 發送
     pushNotify(data) {
         return post('/coupon/push-notify',data)
-    }
+    },
+    //統購平台 - 縣市名額設定 ※目前只開放GL站 
+    setPurchaseSeats(data, testflg=false) {
+        let Domain = (testflg) ? 'bb-rc.teammodel.net' : 'bb.teammodel.net';
+        return post(`https://${Domain}/bbauthapi/set-purchase-seats`, data)
+    },
+    //統購平台 - 取得統購平台列表
+    getBBPurchase(data) {
+        return post('/schoolcheck/get-bbpurchase',data)
+    },
+    //統購平台 - 取得縣市學校
+    getCsSchoolByGeo(data) {
+        return post('/schoolcheck/get-school-geo', data)
+    },
 }

+ 1 - 1
TEAMModelBI/ClientApp/src/components/echarts/test/size.vue

@@ -67,7 +67,7 @@ class InitChart {
       color: ['#3fb1e3', '#6be6c1', '#626c91', '#a0a7e6', '#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42'],
       // backgroundColor: '#fff',
       title: {
-        text: ['{a|总空间:}', `{b|${allUnit}}` + '\n\n' + '{c|已使用:}', `{d|${useUnit}}` + '\n\n' + `{e|剩余空间:}`, `{f|${residueUnit}}`].join(''),
+          text: [`{a|${proxy.$t('commonChart.size.totalSpace')}:}`, `{b|${allUnit}}` + '\n\n' + `{c|${proxy.$t('commonChart.size.used')}:}`, `{d|${useUnit}}` + '\n\n' + `{e|${proxy.$t('commonChart.size.leftSpace')}:}`, `{f|${residueUnit}}`].join(''),
         top: '35%',
         textAlign: 'center',
         left: '50%',

+ 4 - 4
TEAMModelBI/ClientApp/src/components/echarts/versionsPie.vue

@@ -76,7 +76,7 @@ class InitChart {
             },
             series: [
                 {
-                    name: '版本占比',
+                    name: proxy.$t(`commonChart.version.verPercent`),
                     type: 'pie',
                     radius: '80%',
                     center: ['50%', '50%'],
@@ -91,9 +91,9 @@ class InitChart {
                         },
                     },
                     data: [
-                        { value: 70, name: '基础版' },
-                        { value: 38, name: '标准版' },
-                        { value: 32, name: '专业版' },
+                        { value: 70, name: proxy.$t(`commonChart.version.verBasic`) },
+                        { value: 38, name: proxy.$t(`commonChart.version.verStandard`) },
+                        { value: 32, name: proxy.$t(`commonChart.version.verProfession`) },
                     ],
                 },
             ],

+ 389 - 4
TEAMModelBI/ClientApp/src/language/lang/zh-cn.js

@@ -1,9 +1,11 @@
 const zh_cn = {
     login: {
         title: '钉钉扫码登录',
+        byQrode: '钉钉扫码登录',
+        byAccount: '钉钉账号登录',
         logining: '正在登录,请稍后...',
         loginSuccess: '登录成功',
-
+        apiError: 'API异常,登录失败',
     },
     bind: {
         title: '验证手机号',
@@ -41,22 +43,105 @@ const zh_cn = {
             application: '应用数据',
             platform: '平台数据',
             rests: '其他'
-        }
+        },
+        apiDataError: 'API返回数据异常',
+        apiRequestError: 'API访问异常',
     },
     menu: {
         index: '首  页',
+        systemManage: '系统管理',
+        systemConfig: '系统配置',
         basicsSettings: '基础设置',
         personnel: '人员管理',
         area: '区域管理',
         school: '学校管理',
+        areaSchoolManage: '区校管理',
+        areaManage: '学区管理',
+        abilityManage: '微能力点管理',
         ability: '微能力点',
+        thirdPartyManage: '第三方管理',
+        areaSchoolInfo: '区校掌握',
+        areaInfo: '学区情况',
+        schoolInfo: '学校情况',
         lock: '锁定菜单栏',
         unlock: '解锁菜单栏',
+        oprateDiary: '操作日志',
+        sendMessage: '消息推送',
+        productAnalysis: '产品分析',
+        userRelated: '用户相关',
+        issueCoupon: '发优惠券',
+        jointPurchase: '统购设定',
+        engaged: '我参与的',
     },
     header: {
         log: '操作日志',
         name: '姓名',
         quit: '退出登录',
+        title: '数据监控系统',
+    },
+    home: {
+        title: '数据监控系统',
+        dataTime: '数据时间',
+        onlineTrend: '在线趋势',
+        onlineUsersTrend: '在线人数趋势',
+        onlineUsersNow: '当前在线人数',
+        classAndUploadData: '开课及上传数据',
+        areaSchool: '区内学校',
+        areaTeacher: '区内老师',
+        areaTotal: '学区总数',
+        schoolTotal: '学校总数',
+        teacherTotal: '教师总数',
+        studentTotal: '学生总数',
+        yeaterday: '昨日',
+        today: '当天',
+        thisWeek: '本周',
+        thisMonth: '本月',
+        thisYear: '全年',
+        overYear: '历年',
+        semester: '学期',
+        cumulative: '累计',
+        data: '数据',
+        online: '在线',
+        trend: '趋势',
+        teacher: '老师',
+        school: '学校',
+        student: '学生',
+        teamModel: '醍摩豆',
+        inSchool: '校内',
+        offerClass: '开课',
+        number: '数量',
+        uploadLessonRecord: '上传课堂记录',
+        spaceUsage: '空间使用',
+        spaceUsedRate: '空间已使用率',
+        spacePercent: '空间占比',
+        spaceTotal: '空间总容量',
+        basicData: '基础数据',
+        peopleNum: '人数',
+        courseNumber: '课例数',
+        courseActivateLv: '课例活跃度',
+        getDataErr: '获取异常',
+        vote: '投票',
+        question: '问卷',
+        syllabus: '课纲',
+        exam: '评测',
+        homework: '作业',
+        activity: '活动',
+        lessonRecord: '课堂记录',
+        contentModule: '内容模块',
+        paper: '试题试卷',
+        resource: '资源',
+        otherAppData: '其他应用数据',
+        leftSpace: '剩余空间',
+        percentage: '占比',
+        verPercent: '版本占比',
+        verBasic: '基础版',
+        verStandard: '标准版',
+        verProfession: '专业版',
+        verTest: '评测版',
+        allOutput: '产出总数据',
+        activityNumber: '活动数',
+        researchCompleteTime: '完成研训学时',
+        visitNumber: '访问量',
     },
     personnelManagement: {
         select: {
@@ -514,7 +599,6 @@ const zh_cn = {
             platform: '平台',
             content: '操作内容',
             dataID: '数据ID',
-            details: '内容',
             location: '文件位置',
             time: '时间',
             details: '详情',
@@ -602,6 +686,307 @@ const zh_cn = {
             changeError: '储存变更失败',
         },
         parameterError: '参数错误',
-    }
+    },
+    product: {
+        dataFilter: '数据筛选',
+        filterType: '筛选类型',
+        timeRange: '时间范围',
+        accurateSelect: '精准选择',
+        startTime: '开始时间',
+        endTime: '截止时间',
+        startMonth: '开始月份',
+        endMonth: '结束月份',
+        to: '至',
+        selectOneYear: '请选择 某一年 来进行数据统计',
+        timeType: '时间类型',
+        selectStaCityOrArea: '请选择要统计的城市或区',
+        selectStaProvince: '请选择要统计的省份',
+        selectStaArea: '请选择要统计的学区',
+        search: '搜索',
+        thereAre: '共有',
+        records: '条数据',
+        users: '名用户',
+        exportDataTo: '导出数据到',
+        prepareData: '正在准备数据中',
+        searchSchool: '学校搜索',
+        searchSchoolBy: '搜索学校',
+        name: '名称',
+        area: '学区',
+        school: '学校',
+        simpleCode: '简码',
+        teacher: '教师',
+        searchResult: '搜索结果',
+        loading: '加载中',
+        cancel: '取消',
+        confirm: '确认',
+        exportFilter: '导出筛选',
+        personalData: '个人数据查询',
+        teacherList: '教师详细列表',
+        nowSupportMax: '目前支持同时最多',
+        usersForResearch: '名用户查询',
+        photo: '头像',
+        userName: '姓名',
+        weakUserRegist: '弱归户',
+        userRegist: '归户',
+        none: '无',
+        noneYet: '暂无',
+        selectAreaForStatistics: '选择相应的学区进行统计',
+        thisSemester: '本学期',
+        points: '积分',
+        close: '关闭',
+        time: '时间',
+        classroomNumber: '教室数',
+        teacherNumber: '教师数',
+        studentNumber: '学生人数',
+        studentNumberUnique: '学生人次',
+        lessonNumber: '课堂总数',
+        lessonHours: '课堂总时数',
+        studentJoinHours: '学生参与总时数',
+        joinNumberUnique: '参与人次',
+        lessonTime: '授课时间',
+        tIndicator: 'T指标数',
+        tGreenZero: '无绿灯',
+        tGreenOne: '单绿灯',
+        tGreenTwo: '双绿灯',
+        tGreen: 'T绿灯',
+        tLesson: 'T课堂',
+        operate: '操作',
+        missionNumber: '任务数',
+        workNumber: '作品数',
+        itemNumber: '题目数',
+        interactionNumber: '互动数',
+        number: '数量',
+        equip: '设备',
+        noAuth: '无授权',
+        authed: '授权',
+        comprehensive: '综合',
+        use: '使用',
+        lesson: '课程',
+        resource: '资源',
+        type: '型态',
+        cooperate: '合作',
+        interaction: '互动',
+        mission: '任务',
+        difference: '差异化',
+        exam: '测验',
+        teachMaterial: '教材展示',
+        whiteBoardApp: '白板应用',
+        device: '硬体装置',
+        noDeviceAuth: '无机器授权',
+        hasDeviceAuth: '安装机器授权',
+        seeFilterResult: '查看筛选结果',
+        showAllSchool: '显示所有学校',
+        showNoAreaSchool: '显示未归区学校',
+        schoolEmblem: '校徽',
+        scaleVer: '规模版本',
+        belongArea: '所属学区',
+        resultType: '结果类型',
+        sumStatistics: '累计统计',
+        soloStatistics: '独立统计',
+        productType: '产品类型',
+        sourceType: '来源类型',
+        areaCity: '地区城市',
+        timeSelect: '时间选择',
+        targetRange: '目标范围',
+        districtSelect: '地区选择',
+        province: '省',
+        city: '城市',
+        minute: '分钟',
+        day: '天',
+        week: '周',
+        month: '月',
+        year: '年',
+        smaller: '小于',
+        bigger: '大于',
+        equal: '等于',
+        authType: '授权类型',
+        all: '全部',
+        testUse: '试用',
+        authorized: '已授权',
+        apiErrpr: 'API异常',
+        basicDataError: '基础数据获取异常',
+        getDataError: '数据获取失败',
+        getRegionDataError: '省市区数据获取异常',
+        timeRangeSelectError: '请选择时间进行数据搜索',
+        addSchoolManually: '手动添加学校',
+        productAnalysisOverview: '产品使用分析全览',
+        deviceData: '装置数据',
+        listTable: '列表',
+        productAnalysisTable: '产品使用分析表',
+        pleaseSelect: '请选择',
+        viewAllTeacher: '查看所有教师',
+        view: '查看',
+        message1_1: '当前查询人数仅支持小于或等于',
+        message1_2: '名用户',
+    },
+    userInquire: {
+        index: {
+            smartEducation: '智慧教育',
+            userSearch: '用户查询',
+            dataSearching: '数据搜索中',
+            input: '输入',
+            selfphoneNumber: '手机号码',
+            tmid: '醍摩豆账号',
+            doSearch: '进行搜索',
+            refinedQuery: '精准查询',
+            searchRecord: '搜索记录',
+            searchResult: '搜索结果',
+            weakUserRegist: '弱归户',
+            idUserRegistSta: 'ID归户增量统计',
+            message1_1: '同时查询人员不能大于',
+            message1_2: ',请调整查询范围',
+            message2: '暂无搜索到相关人员,请检查搜索信息',
+            message3: 'API异常,查询失败',
+            message4: '请输入手机号码 / 醍魔豆账号 进行搜索!',
+        },
+        details: {
+            dataLoading: '数据加载中',
+            noName: '暂无姓名',
+            noData: '暂无数据',
+            noRights: '暂无权益内容',
+            seeUserDetailData: '查看账户进阶数据',
+            seeLoginData: '查看完整登入情况',
+            lastLoginTime: '上次登陆时间',
+            noUseRecently: '近期未使用',
+            time: '时间',
+            total: '共',
+            school: '学校',
+            spaceAndRights: '空间与权益',
+            apRule: '产品扩充项',
+            productDetail: '产品详细',
+            spaceSize: '空间大小',
+            endTime: '到期日',
+            myRights: '我的权益',
+            mySpace: '我的空间',
+            sokrate: '苏格拉底',
+            pointsAndTickets: '积分与票卷',
+            baxkToSearch: '返回搜索',
+            loginLists: '所有登入情况',
+            loginDetail: '登入详细',
+            platform: '平台',
+            close: '关闭',
+            null: '暂无',
+            none: '无',
+            userID: '用户ID',
+            selfphoneNumber: '手机号码',
+            email: '邮箱',
+            areaLocation: '地区位置',
+            lessonObservation: '观议课',
+            commonAccount: '通用账号',
+            extraFunction: '附加功能',
+            loginSum: '登录总量',
+            usedTotalValue: "已使用总量",
+            used: '已使用',
+            left: '已剩余',
+            schoolAssignSpace: '学校分配空间',
+            sumValue: '总大小',
+            rights: '权限',
+            collectedWorks: '作品收集数',
+            accessNumber: '连线人数',
+            message1: 'API异常,查询失败',
+            message2: '请先选择查询月份!!',
+        },
+
+    },
+    purchase: {
+        purchasePlatform: '统购平台',
+        productManagement: '县市产品名额',
+        prodSeatsInfo: '产品及名额资讯',
+        addNew: '新增',
+        cityOrDistrict: '县市',
+        selectCityOrDistrict: '请选择县市',
+        prodName: '产品名称',
+        selectProd: '请选择产品',
+        space: '空间',
+        inputSpace: '请输入容量',
+        unit: '单位',
+        expirationDate: '使用期限',
+        startDate: '开始时间',
+        endDate: '结束时间',
+        quota: '名额',
+        inputQuota: '请输入名额',
+        school: '学校',
+        schoolName: '学校名称',
+        schoolCode: '学校简码',
+        inputNumber: '请输入数字',
+        receiveNumber: '领取人数',
+        operate: '操作',
+        remove: '移除',
+        selectSchool: '请选择学校',
+        confirmOk: '确定',
+        cancel: '取消',
+        addSchool: '追加学校',
+        importSchool: '汇入学校',
+        extension: '扩充项',
+        action: '动作',
+        import: '汇入',
+        searchSchName: '搜寻学校名称',
+    },
+    auth:{
+        YMPCVCIM: '学情分析模组',
+        IPDYZYLC: '智慧学校管理服务',
+        _3CLYJ6NP: 'AClass ONE智慧学伴',
+        IPALJ6NY: '数据储存服务空间',
+        VABAJ6NV: '卷卡合一阅卷系统',
+        VLY6J6N6: '教研中心模组',
+        _0VPBDZPG: 'Haboard醍摩豆智慧大屏',
+        B9GPJ6NY: '苏格拉底频道管理',
+        LY9AJ6NY: '苏格拉底频道空间',
+        YL9CJ6NY: '苏格拉底通用议课教室数',
+        LL9MJ6NY: '苏格拉底通用议课连线数',
+        B6V5J6NP: '艺术评测服务',
+        LSZYJ6NA: '智慧体育服务',
+        CVGPJ6NN: '智慧德育服务',
+        VDPGJ6NC: '劳动教育服务',
+        YPXSJ6NJ: '五育看板',
+        IPALB6EY: 'IES5个人空间',
+    },
+    aprule: {
+        hdcam: 'USB录影支援',
+        sokrate: '苏格拉底',
+        sokapp: '苏格拉底议课APP',
+        sokvdo: '苏格拉底影片',
+        sokdesk: '苏格拉底桌面',
+        sokrpt: '苏格拉底报告',
+        soksdata: '苏格拉底小数据',
+        ezs: 'AI智能终端',
+        wordanls: 'AI文句分析',
+        dgistuid: '电子学生证',
+        cloudas: '云端诊断分析系统',
+        cligroup: '分组数',
+        clientVolume: 'IRS连线授权数',
+        soknumber: '议课人数',
+        scorsys: '智慧评分系统',
+        irs: 'IRS硬体遥控器',
+        sokvtt: '苏格拉底语音转写',
+        cowork: '协作',
+        aigpt: 'AI/GPT 智连环',
+    },
+    commonTimeName: {
+        day: '天',
+        month: '月',
+        year: '年',
+        sunday: "周日",
+        monday: "周一",
+        tuesday: "周二",
+        wednesday: "周三",
+        thursday: "周四",
+        friday: "周五",
+        saturday: "周六",
+    },
+    commonChart: {
+        version: {
+            verPercent: '版本占比',
+            verBasic: '基础版',
+            verStandard: '标准版',
+            verProfession: '专业版',
+            verTest: '评测版',
+        },
+        size: {
+            totalSpace: '总空间',
+            used: '已使用',
+            leftSpace: '剩余空间',
+        }
+    },
 }
 export default zh_cn

+ 402 - 20
TEAMModelBI/ClientApp/src/language/lang/zh-tw.js

@@ -1,8 +1,11 @@
 const zh_tw = {
     login: {
-        title: '釘釘掃碼登錄',
-        logining: '正在登錄,請稍後...',
-        loginSuccess: '登錄成功',
+        title: '釘釘掃碼登入',
+        byQrode: '釘釘掃碼登入',
+        byAccount: '釘釘帳號登入',
+        logining: '正在登入,請稍後...',
+        loginSuccess: '登入成功',
+        apiError: 'API異常,登入失敗',
     },
     bind: {
         title: '驗證手機號',
@@ -40,22 +43,101 @@ const zh_tw = {
             application: '應用數據',
             platform: '平台數據',
             rests: '其他'
-        }
+        },
+        apiDataError: 'API返回數據異常',
+        apiRequestError: 'API訪問異常',
     },
     menu: {
         index: '首  頁',
+        systemManage: '系統管理',
+        systemConfig: '系統配置',
         basicsSettings: '基礎設置',
         personnel: '人員管理',
         area: '區域管理',
         school: '學校管理',
+        areaSchoolManage: '區校管理',
+        areaManage: '學區管理',
+        abilityManage: '微能力點管理',
         ability: '微能力點',
+        thirdPartyManage: '第三方管理',
+        areaSchoolInfo: '區校掌握',
+        areaInfo: '學區情況',
+        schoolInfo: '學校情況',
         lock: '鎖定菜單欄',
         unlock: '解鎖菜單欄',
+        oprateDiary: '操作日志',
+        sendMessage: '消息推送',
+        productAnalysis: '產品分析',
+        userRelated: '用戶相關',
+        issueCoupon: '發優惠券',
+        jointPurchase: '統購設定',
+        engaged: '我參與的',
     },
     header: {
         log: '操作日誌',
         name: '姓名',
         quit: '退出登錄',
+        title: '數據監控系統',
+    },
+    home: {
+        title: '數據監控系統',
+        dataTime: '數據時間',
+        onlineTrend: '在線趨勢',
+        onlineUsersTrend: '在線人數趨勢',
+        onlineUsersNow: '當前在線人數',
+        classAndUploadData: '開課及上傳數據',
+        areaTotal: '學區總數',
+        schoolTotal: '學校總數',
+        teacherTotal: '教師總數',
+        studentTotal: '學生總數',
+        yeaterday: '昨日',
+        today: '當天',
+        thisMonth: '本月',
+        thisYear: '全年',
+        overYear: '歷年',
+        semester: '學期',
+        cumulative: '累計',
+        online: '在線',
+        trend: '趨勢',
+        teacher: '老師',
+        school: '學校',
+        student: '學生',
+        teamModel: '醍摩豆',
+        inSchool: '校內',
+        offerClass: '開課',
+        number: '數量',
+        uploadLessonRecord: '上傳課堂記錄',
+        spaceUsage: '空間使用',
+        spaceUsedRate: '空間已使用率',
+        spacePercent: '空間占比',
+        spaceTotal: '空間總容量',
+        basicData: '基礎數據',
+        peopleNum: '人數',
+        courseNumber: '課例數',
+        courseActivateLv: '課例活躍度',
+        getDataErr: '獲取異常',
+        vote: '投票',
+        question: '問卷',
+        syllabus: '課綱',
+        exam: '評測',
+        homework: '作業',
+        activity: '活動',
+        lessonRecord: '課堂記錄',
+        contentModule: '內容模塊',
+        paper: '試題試卷',
+        resource: '資源',
+        otherAppData: '其他應用數據',
+        leftSpace: '剩余空間',
+        percentage: '占比',
+        verPercent: '版本占比',
+        verBasic: '基礎版',
+        verStandard: '標準版',
+        verProfession: '專業版',
+        verTest: '評測版',
+        allOutput: '產出總數據',
+        activityNumber: '活動數',
+        researchCompleteTime: '完成研訓學時',
+        visitNumber: '訪問量',
     },
     personnelManagement: {
         select: {
@@ -119,8 +201,8 @@ const zh_tw = {
             title: '創建學區',
             areaSelect: '地區選擇',
             notArea: '無地區限制',
-            notAreaname: '全国区域学区',
-            schoolAreaname: '学区',
+            notAreaname: '全國區域學區',
+            schoolAreaname: '學區',
             name: '名稱',
             namehint: '地區名稱',
             affiliation: '所屬機構',
@@ -187,7 +269,7 @@ const zh_tw = {
             brevityCode: '學校簡碼',
             province: '省',
             city: '市',
-            area: '',
+            area: '',
             spacesize: '空間大小',
             assis: '關聯管家',
             operate: '操作',
@@ -226,25 +308,25 @@ const zh_tw = {
                 address: 'address: 詳細地址',
             }
         },
-        redactSet: '基础设置',
-        redactGrading: '段管理',
-        redactServe: '服务授权管理',
-        redactSerial: '智慧教室授管理',
+        redactSet: '基礎設置',
+        redactGrading: '段管理',
+        redactServe: '服務授權管理',
+        redactSerial: '智慧教室授管理',
         basicSet: {
-            name: '学校名称',
+            name: '學校名稱',
             badge: '校徽',
             badgeChange: '更 換',
-            type: '学校类型',
+            type: '學校類型',
             ordinary: '普教',
             higherEducation: '高教',
             nowAssistant: '當前管家',
             nowAssistanthint: '可選擇管家列表',
-            brevityCode: '学校简码',
+            brevityCode: '學校簡碼',
             notCode: '無簡碼',
-            region: '所在域',
-            scale: '学校规模',
-            location: '校地址',
-            spacesize: '空大小',
+            region: '所在域',
+            scale: '學校規模',
+            location: '校地址',
+            spacesize: '空大小',
             submit: '提交更改'
         },
         gradSet: {
@@ -510,7 +592,6 @@ const zh_tw = {
             platform: '平臺',
             content: '操作內容',
             dataID: '數據ID',
-            details: '內容',
             location: '文件位置',
             time: '時間',
             details: '詳情',
@@ -598,6 +679,307 @@ const zh_tw = {
             changeError: '儲存變更失敗',
         },
         parameterError: '參數錯誤',
-    }
+    },
+    product: {
+        dataFilter: '數據篩選',
+        filterType: '篩選類型',
+        timeRange: '時間範圍',
+        accurateSelect: '精準選擇',
+        startTime: '開始時間',
+        endTime: '截止時間',
+        startMonth: '開始月份',
+        endMonth: '結束月份',
+        to: '至',
+        selectOneYear: '請選擇 某一年 來進行數據統計',
+        timeType: '時間類型',
+        selectStaCityOrArea: '請選擇要統計的城市或區',
+        selectStaProvince: '請選擇要統計的省份',
+        selectStaArea: '請選擇要統計的學區',
+        search: '搜索',
+        thereAre: '共有',
+        records: '條數據',
+        users: '名用戶',
+        exportDataTo: '導出數據到',
+        prepareData: '正在準備數據中',
+        searchSchool: '學校搜索',
+        searchSchoolBy: '搜索學校',
+        name: '名稱',
+        area: '學區',
+        school: '學校',
+        simpleCode: '簡碼',
+        teacher: '教師',
+        searchResult: '搜索結果',
+        loading: '加載中',
+        cancel: '取消',
+        confirm: '確認',
+        exportFilter: '導出篩選',
+        personalData: '個人數據查詢',
+        teacherList: '教師詳細列表',
+        nowSupportMax: '目前支持同時最多',
+        usersForResearch: '名用戶查詢',
+        photo: '頭像',
+        userName: '姓名',
+        weakUserRegist: '弱歸戶',
+        userRegist: '歸戶',
+        none: '無',
+        noneYet: '暫無',
+        selectAreaForStatistics: '選擇相應的學區進行統計',
+        thisSemester: '本學期',
+        points: '積分',
+        close: '關閉',
+        time: '時間',
+        classroomNumber: '教室數',
+        teacherNumber: '教師數',
+        studentNumber: '學生人數',
+        studentNumberUnique: '學生人次',
+        lessonNumber: '課堂總數',
+        lessonHours: '課堂總時數',
+        studentJoinHours: '學生參與總時數',
+        joinNumberUnique: '參與人次',
+        lessonTime: '授課時間',
+        tIndicator: 'T指標數',
+        tGreenZero: '無綠燈',
+        tGreenOne: '單綠燈',
+        tGreenTwo: '雙綠燈',
+        tGreen: 'T綠燈',
+        tLesson: 'T課堂',
+        operate: '操作',
+        missionNumber: '任務數',
+        workNumber: '作品數',
+        itemNumber: '題目數',
+        interactionNumber: '互動數',
+        number: '數量',
+        equip: '設備',
+        noAuth: '無授權',
+        authed: '授權',
+        comprehensive: '綜合',
+        use: '使用',
+        lesson: '課程',
+        resource: '資源',
+        type: '型態',
+        cooperate: '合作',
+        interaction: '互動',
+        mission: '任務',
+        difference: '差異化',
+        exam: '測驗',
+        teachMaterial: '教材展示',
+        whiteBoardApp: '白板應用',
+        device: '硬體裝置',
+        noDeviceAuth: '無機器授權',
+        hasDeviceAuth: '安裝機器授權',
+        seeFilterResult: '查看篩選結果',
+        showAllSchool: '顯示所有學校',
+        showNoAreaSchool: '顯示未歸區學校',
+        schoolEmblem: '校徽',
+        scaleVer: '規模版本',
+        belongArea: '所屬學區',
+        resultType: '結果類型',
+        sumStatistics: '累計統計',
+        soloStatistics: '獨立統計',
+        productType: '產品類型',
+        sourceType: '來源類型',
+        areaCity: '地區城市',
+        timeSelect: '時間選擇',
+        targetRange: '目標範圍',
+        districtSelect: '地區選擇',
+        province: '省',
+        city: '城市',
+        minute: '分鐘',
+        day: '天',
+        week: '周',
+        month: '月',
+        year: '年',
+        smaller: '小於',
+        bigger: '大於',
+        equal: '等於',
+        authType: '授權類型',
+        all: '全部',
+        testUse: '試用',
+        authorized: '已授權',
+        apiErrpr: 'API異常',
+        basicDataError: '基礎數據獲取異常',
+        getDataError: '數據獲取失敗',
+        getRegionDataError: '省市區數據獲取異常',
+        timeRangeSelectError: '請選擇時間進行數據搜索',
+        addSchoolManually: '手動添加學校',
+        productAnalysisOverview: '產品使用分析全覽',
+        deviceData: '裝置數據',
+        listTable: '列表',
+        productAnalysisTable: '產品使用分析表',
+        pleaseSelect: '請選擇',
+        viewAllTeacher: '查看所有教師',
+        view: '查看',
+        message1_1: '當前查詢人數僅支持小於或等於',
+        message1_2: '名用戶',
+    },
+    userInquire: {
+        index: {
+            smartEducation: '智慧教育',
+            userSearch: '用戶查詢',
+            dataSearching: '數據搜索中',
+            input: '輸入',
+            selfphoneNumber: '手機號碼',
+            tmid: '醍摩豆賬號',
+            doSearch: '進行搜索',
+            refinedQuery: '精準查詢',
+            searchRecord: '搜索記錄',
+            searchResult: '搜索結果',
+            weakUserRegist: '弱歸戶',
+            idUserRegistSta: 'ID歸戶增量統計',
+            message1_1: '同時查詢人員不能大於',
+            message1_2: ',請調整查詢範圍',
+            message2: '暫無搜索到相關人員,請檢查搜索信息',
+            message3: 'API異常,查詢失敗',
+            message4: '請輸入手機號碼 / 醍魔豆賬號 進行搜索!',
+        },
+        details: {
+            dataLoading: '數據加載中',
+            noName: '暫無姓名',
+            noData: '暫無數據',
+            noRights: '暫無權益內容',
+            seeUserDetailData: '查看賬戶進階數據',
+            seeLoginData: '查看完整登入情況',
+            lastLoginTime: '上次登陸時間',
+            noUseRecently: '近期未使用',
+            time: '時間',
+            total: '共',
+            school: '學校',
+            spaceAndRights: '空間與權益',
+            apRule: '產品擴充項',
+            productDetail: '產品詳細',
+            spaceSize: '空間大小',
+            endTime: '到期日',
+            myRights: '我的權益',
+            mySpace: '我的空間',
+            sokrate: '蘇格拉底',
+            pointsAndTickets: '積分與票卷',
+            baxkToSearch: '返回搜索',
+            loginLists: '所有登入情況',
+            loginDetail: '登入詳細',
+            platform: '平台',
+            close: '關閉',
+            null: '暫無',
+            none: '無',
+            userID: '用戶ID',
+            selfphoneNumber: '手機號碼',
+            email: '郵箱',
+            areaLocation: '地區位置',
+            lessonObservation: '觀議課',
+            commonAccount: '通用賬號',
+            extraFunction: '附加功能',
+            loginSum: '登錄總量',
+            usedTotalValue: "已使用總量",
+            used: '已使用',
+            left: '已剩餘',
+            schoolAssignSpace: '學校分配空間',
+            sumValue: '總大小',
+            rights: '權限',
+            collectedWorks: '作品收集數',
+            accessNumber: '連線人數',
+            message1: 'API異常,查詢失敗',
+            message2: '請先選擇查詢月份!!',
+        },
+
+    },
+    purchase: {
+        purchasePlatform: '統購平台',
+        productManagement: '縣市產品名額',
+        prodSeatsInfo: '產品及名額資訊',
+        addNew: '新增',
+        cityOrDistrict: '縣市',
+        selectCityOrDistrict: '請選擇縣市',
+        prodName: '產品名稱',
+        selectProd: '請選擇產品',
+        space: '空間',
+        inputSpace: '請輸入容量',
+        unit: '單位',
+        expirationDate: '使用期限',
+        startDate: '開始時間',
+        endDate: '結束時間',
+        quota: '名額',
+        inputQuota: '請輸入名額',
+        school: '學校',
+        schoolName: '學校名稱',
+        schoolCode: '學校簡碼',
+        inputNumber: '請輸入數字',
+        receiveNumber: '領取人數',
+        operate: '操作',
+        remove: '移除',
+        selectSchool: '請選擇學校',
+        confirmOk: '確定',
+        cancel: '取消',
+        addSchool: '追加學校',
+        importSchool: '匯入學校',
+        extension: '擴充項',
+        action: '動作',
+        import: '匯入',
+        searchSchName: '搜尋學校名稱',
+    },
+    auth:{
+        YMPCVCIM: '學情分析模組',
+        IPDYZYLC: '智慧學校管理服務',
+        _3CLYJ6NP: 'AClass ONE智慧學伴',
+        IPALJ6NY: '數據儲存服務空間',
+        VABAJ6NV: '卷卡合一閱卷系統',
+        VLY6J6N6: '教研中心模组',
+        _0VPBDZPG: 'Haboard醍摩豆智慧大屏',
+        B9GPJ6NY: '蘇格拉底頻道管理',
+        LY9AJ6NY: '蘇格拉底頻道空間',
+        YL9CJ6NY: '蘇格拉底通用議課教室數',
+        LL9MJ6NY: '蘇格拉底通用議課連線數',
+        B6V5J6NP: '藝術評測服務',
+        LSZYJ6NA: '智慧體育服務',
+        CVGPJ6NN: '智慧德育服務',
+        VDPGJ6NC: '勞動教育服務',
+        YPXSJ6NJ: '五育看板',
+        IPALB6EY: 'IES5個人空間',
+    },
+    aprule: {
+        hdcam: 'USB錄影支援',
+        sokrate: '蘇格拉底',
+        sokapp: '蘇格拉底議課APP',
+        sokvdo: '蘇格拉底影片',
+        sokdesk: '蘇格拉底桌面',
+        sokrpt: '蘇格拉底報告',
+        soksdata: '蘇格拉底小數據',
+        ezs: 'AI智能終端',
+        wordanls: 'AI文句分析',
+        dgistuid: '電子學生證',
+        cloudas: '雲端診斷分析系統',
+        cligroup: '分組數',
+        clientVolume: 'IRS連線授權數',
+        soknumber: '議課人數',
+        scorsys: '智慧評分系統',
+        irs: 'IRS硬體遙控器',
+        sokvtt: '蘇格拉底語音轉寫',
+        cowork: '協作',
+        aigpt: 'AI/GPT 智連環',
+    },
+    commonTimeName: {
+        day: '天',
+        month: '月',
+        year: '年',
+        sunday: "周日",
+        monday: "周一",
+        tuesday: "周二",
+        wednesday: "周三",
+        thursday: "周四",
+        friday: "周五",
+        saturday: "周六",
+    },
+    commonChart: {
+        version: {
+            verPercent: '版本占比',
+            verBasic: '基礎版',
+            verStandard: '標準版',
+            verProfession: '專業版',
+            verTest: '評測版',
+        },
+        size: {
+            totalSpace: '總空間',
+            used: '已使用',
+            leftSpace: '剩余空間',
+        }
+    },
 }
 export default zh_tw

+ 33 - 6
TEAMModelBI/ClientApp/src/router/index.js

@@ -1,7 +1,8 @@
-import { createWebHashHistory, createRouter } from "vue-router";
+import { createWebHashHistory, createRouter  } from "vue-router";
 import jwt_decode from 'jwt-decode'
 // import store from '@/store/index.js'
-const routes = [{
+const routes = [
+    {
         path: "/",
         redirect: "/login"
     },
@@ -16,12 +17,26 @@ const routes = [{
         name: "test",
         roles: "all",
         component: () => require.ensure([], (require) => require(`@/view/index/test.vue`))
-    },
+    },   
     // {
     //     path: "/dashboard",
     //     name: "dashboard",
     //     component: () => require.ensure([], (require) => require(`@/view/index/dashboard.vue`))
     // },
+    // {
+    //     path: "/htcommunity",
+    //     name: "htcommunity",
+    //     component: () => require.ensure([], (require) => require(`@/view/htcommunity/adminpanel.vue`)),
+    //     children: [{
+    //             name: "adminpanel",
+    //             path: "adminpanel",
+    //             permission: "teacher-read|teacher-upd",
+    //             roles: ['all'],
+    //             isShow: true,
+    //             component: () => require.ensure([], (require) => require(`@/view/htcommunity/adminpanel.vue`))
+    //         },            
+    //     ]
+    // },
     {
         path: "/home",
         name: "home",
@@ -61,6 +76,14 @@ const routes = [{
                 isShow: true,
                 component: () => require.ensure([], (require) => require(`@/view/product/index.vue`))
             },
+            // 統購平台
+            {
+                path: "adminpanel",
+                name: "adminpanel",
+                permission: "teacher-read|teacher-upd",
+                roles: ['admin'],                
+                component: () => require.ensure([], (require) => require(`@/view/htcommunity/adminpanel.vue`))
+            },
             //区校管理(学区管理)--研发部
             {
                 name: "areaManagement",
@@ -276,11 +299,15 @@ const routes = [{
     // },
 ];
 const router = createRouter({
-    history: createWebHashHistory(),
+    history: createWebHashHistory(),    
     routes,
 });
-router.beforeEach((to, from, next) => {
-    console.log(to, 'router')
+router.beforeEach((to, from, next) => {    
+    console.log(to, 'router')      
+    if (to.query.htype === 'adminlogin')
+    {        
+        localStorage.setItem("htype",'adminlogin');
+    }
     if (to.path === '/login' || to.path === '/resultPage') return next()
     if (to.path === '/login-thirdparty') return next()
     let thirdUser = localStorage.getItem('thirdUser')

+ 2 - 1
TEAMModelBI/ClientApp/src/until/common.js

@@ -74,10 +74,11 @@ export default {
         });
         return totaldays
     },
-    timestampToTime(timestamp, state) {
+    timestampToTime(timestamp, state, isUtc=false) {
         if (timestamp === 0) { return 0 }
         let multiple = timestamp.toString().length === 13 ? 1 : 1000
         var date = new Date(Number(timestamp) * multiple); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+        if (isUtc) date = new Date(date.toLocaleString('en-US', { timeZone: 'UTC' }));
         var Y = date.getFullYear() + '-';
         var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
         var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + '   ';

+ 3 - 2
TEAMModelBI/ClientApp/src/until/http.js

@@ -3,7 +3,7 @@ axios.defaults.timeout = 1000000; //设置超时时长
 axios.defaults.baseURL = '';
 //http request 拦截器
 axios.interceptors.request.use(
-    config => {
+    config => {        
         // const token = getCookie('名称');
         config.data = JSON.stringify(config.data);
         console.log(config, '访问内容')
@@ -35,7 +35,8 @@ axios.interceptors.request.use(
         } else if (config.url.indexOf('ies5') != -1 ||
             config.url.indexOf('tmid') != -1 ||
             config.url.indexOf('/service/PushNotify') != -1 ||
-            config.url.indexOf('prodanalysis') != -1) {
+            config.url.indexOf('prodanalysis') != -1 ||
+            config.url.indexOf('bbauthapi') != -1) {
             config.headers = {
                 'Content-Type': 'application/json',
                 'authorization': 'Bearer ' + JSON.parse(localStorage.access_token)

+ 26 - 3
TEAMModelBI/ClientApp/src/view/areaServe/areamanage.vue

@@ -185,7 +185,7 @@
             <div class="haveSchool">
               <div class="schoolLeft" v-loading="loadingSchoolList" element-loading-text="数据加载中..." v-if="PowerShow">
                 <div class="haveSchool-title">
-                  <div class="select-text">{{ $t(`areaManages.operational.areaAddSchool.schooltitle`) }}</div>
+                  <div class="select-text">{{ $t(`areaManages.operational.areaAddSchool.schooltitle`) }}</div>                                  
                   <div class="select-click">
                     <el-dropdown trigger="click" @command="handleCommand">
                       <span class="el-dropdown-link">
@@ -218,6 +218,10 @@
                   </div>
                   <div class="synchronization-title" v-show="currentlySelect.cutArea"><span>已同步省平台</span></div>
                 </div>
+                <div  class="search-school-btn">
+                <el-button type="primary"  @click="selectAll" size="small">全選</el-button>
+                  <el-button type="primary"  @click="deselectAll" size="small">全不選</el-button>
+                </div>
                 <ul>
                   <li class="details-list-school" v-for="(item, index) in notjoinSchool" :key="item.id" :class="{ active: position === index }">
                     <div class="details-list-checkboxs" @change="multipleChange">
@@ -1449,7 +1453,10 @@ export default {
     //学校列表 未加入学区
     function notjoinSchoolarea () {
       let values = schoolSeach.value
-      let newdata = notjoinPrimitive.value.filter((item) => { return item.name.includes(values) })
+      let newdata = notjoinPrimitive.value.filter((item) => {        
+        // 撈出名稱跟地址包含關鍵字的學校
+         return item.name.includes(values) || item.city?.includes(values) 
+        })        
       notjoinSchool.value = JSON.parse(JSON.stringify(newdata))
     }
     //学校显示(虚拟、实体)
@@ -1518,6 +1525,20 @@ export default {
       return jsonData.map((v) => filterVal.map((j) => v[j]))
     }
 
+    function selectAll() {                
+      notjoinSchool.value.forEach(item => {
+        item.checkstate = true;
+      });      
+      multiplecheck.value = true;
+    }
+    function deselectAll() {      
+      notjoinSchool.value.forEach(item => {
+        item.checkstate = false;
+      });    
+      multiplecheck.value = false;
+    }
+
+
     watch(abilityModel, (newdata) => {
       console.log(newdata)
       newdata
@@ -1653,7 +1674,9 @@ export default {
       exportAreadata,
       exportData,
       exportExcel,
-      formatJson
+      formatJson,
+      selectAll,
+      deselectAll
     }
   },
 }

+ 37 - 19
TEAMModelBI/ClientApp/src/view/common/aside.vue

@@ -70,7 +70,7 @@ export default {
     headerHost[0] !== zc[0] ? window.history.pushState('', '', headerHost[0] + '/' + zc[1]) : ''
     const schoolMenus = [
       {
-        name: '首 页',
+        name: proxy.$t(`menu.index`),
         icon: '#icon-shouye',
         router: '/home/index',
         isShow: true,
@@ -80,7 +80,7 @@ export default {
         sort: 0,
       },
       {
-        name: '系统管理',
+        name: proxy.$t(`menu.systemManage`),
         icon: '#icon-xitongshezhi1',
         router: '',
         role: ['admin'],
@@ -89,7 +89,7 @@ export default {
         sort: 1,
         child: [
           {
-            name: '系统配置',
+            name: proxy.$t(`menu.systemConfig`), 
             router: '/home/system',
             icon: '#icon-peizhi-xitongpeizhi',
             permission: ['orgusers-read', 'orgusers-upd'],
@@ -105,7 +105,7 @@ export default {
             sort: 3,
           },
           {
-            name: '操作日志',
+            name: proxy.$t(`menu.oprateDiary`),
             router: '/home/log',
             icon: '#icon-rizhi1',
             permission: [],
@@ -121,7 +121,7 @@ export default {
           //   sort: 5,
           // },
           {
-            name: '消息推送',
+            name: proxy.$t(`menu.sendMessage`),
             router: '/home/pushmsg',
             icon: '#icon-xiaoxi',
             permission: [],
@@ -129,7 +129,7 @@ export default {
             sort: 6,
           },
           {
-            name: '产品分析',
+            name: proxy.$t(`menu.productAnalysis`),
             router: '/home/analysis',
             icon: '#icon-fenxi1',
             permission: [],
@@ -137,7 +137,7 @@ export default {
             sort: 7,
           },
           {
-            name: '用户相關',
+            name: proxy.$t(`menu.userRelated`),
             router: '/home/userinquire',
             icon: '#icon-a-97-yonghuchaxun',
             permission: [],
@@ -153,7 +153,7 @@ export default {
           //   sort: 19,
           // },
           {
-            name: '發優惠券',
+            name: proxy.$t(`menu.issueCoupon`),
             router: '/home/issuecoupons',
             icon: '#icon-Ticket',
             permission: [],
@@ -161,10 +161,19 @@ export default {
             sort: 6,
             srvType: 'Global'
           },
+          {
+            name: proxy.$t(`menu.jointPurchase`),
+            router: '/home/adminpanel',
+            icon: '#icon-laoshi1',
+            permission: [],
+            isShow: true,
+            sort: 7,
+            srvType: 'Global'
+          },
         ],
       },
       {
-        name: '区校管理',
+        name: proxy.$t(`menu.areaSchoolManage`),
         router: '',
         role: ['special', 'admin'],
         icon: '#icon-zisunchaquyufenbu',
@@ -173,7 +182,7 @@ export default {
         sort: 8,
         child: [
           {
-            name: '学区管理',
+            name: proxy.$t(`menu.areaManage`),
             router: '/home/areamanage',
             icon: '#icon-quyuguanli',
             permission: ['orgusers-read', 'orgusers-upd'],
@@ -181,7 +190,7 @@ export default {
             sort: 9,
           },
           {
-            name: '学校管理',
+            name: proxy.$t(`menu.school`),
             router: '/home/schoolmanage',
             icon: '#icon-pingtai_xuexiaoguanli',
             permission: ['orgusers-read', 'orgusers-upd'],
@@ -189,7 +198,7 @@ export default {
             sort: 10,
           },
           {
-            name: '微能力管理',
+            name: proxy.$t(`menu.abilityManage`),
             router: '/home/traitmanage',
             icon: '#icon-peizhiguanli',
             permission: ['orgusers-read', 'orgusers-upd'],
@@ -205,7 +214,7 @@ export default {
           //   sort: 10,
           // },
           {
-            name: '第三方管理',
+            name: proxy.$t(`menu.thirdPartyManage`),
             router: '/home/thirdparty',
             icon: '#icon-collaboration-system',
             permission: [],
@@ -267,7 +276,7 @@ export default {
       //     sort: 5,
       // },
       {
-        name: '区校掌握',
+        name: proxy.$t(`menu.areaSchoolInfo`), 
         icon: '#icon-jichuguanli',
         router: '',
         role: ['admin', 'assist', 'leader', 'sales'],
@@ -276,7 +285,7 @@ export default {
         sort: 13,
         child: [
           {
-            name: '学区情况',
+            name: proxy.$t(`menu.areaInfo`), 
             router: '/home/district',
             icon: '#icon-xiangmufanwei',
             permission: [],
@@ -284,7 +293,7 @@ export default {
             sort: 14,
           },
           {
-            name: '学校情况',
+            name: proxy.$t(`menu.schoolInfo`),
             router: '/home/campus',
             icon: '#icon-xuexiao2',
             permission: [],
@@ -294,7 +303,7 @@ export default {
         ],
       },
       {
-        name: '我参与的',
+        name: proxy.$t(`menu.engaged`), 
         icon: '#icon-canyu',
         router: '',
         role: ['admin', 'assist', 'leader', 'sales'],
@@ -303,7 +312,7 @@ export default {
         sort: 16,
         child: [
           {
-            name: '学校管理',
+            name: proxy.$t(`menu.school`),
             router: '/home/participation',
             icon: '#icon-xuexiao3',
             permission: [],
@@ -311,7 +320,7 @@ export default {
             sort: 17,
           },
           {
-            name: '微能力点管理',
+            name: proxy.$t(`menu.abilityManage`),
             router: '/home/setability',
             icon: '#icon-tiaozheng1',
             permission: [],
@@ -370,6 +379,15 @@ export default {
         let name = userRoles[n]
         console.log(name)
         for (let i in schoolMenus) {
+
+          // 統購平台大陸先遮蔽
+            if (schoolMenus[i].name === proxy.$t(`menu.areaSchoolManage`)) { //区校管理
+            let siteValue = window.location.host === 'bi.teammodel.cn' ? 'cn' : window.location.host === 'bitest.teammodel.cn' ? 'cn' : 'international'
+            //debugger
+            if (siteValue === 'cn') {
+              schoolMenus[1].child.splice(7, 1);
+            }
+          }
           // if (schoolMenus[i].name === '区校掌握') { continue }
           schoolMenus[i].role.indexOf('all') != -1 ? menuList.value.push(schoolMenus[i]) : ''
           schoolMenus[i].role.includes(name) ? menuList.value.push(schoolMenus[i]) : ''

+ 1 - 1
TEAMModelBI/ClientApp/src/view/common/header.vue

@@ -1,7 +1,7 @@
 <template>
     <el-header style="text-align: right; font-size: 12px">
         <div class="logsbox">
-           <div v-show="store.state.indexTitle"><span>TEAMModel·BI 数据监控系统</span></div>
+           <div v-show="store.state.indexTitle"><span>TEAMModel·BI {{$t(`header.title`)}}</span></div>
             <div class="showTime" @click="detectionsize(screen.state)" v-show="store.state.indexTitle">
                     <svg class="skip" aria-hidden="true">
                         <use :xlink:href="screen.icon"></use>

Разлика између датотеке није приказан због своје велике величине
+ 724 - 0
TEAMModelBI/ClientApp/src/view/htcommunity/adminpanel.vue


+ 3 - 3
TEAMModelBI/ClientApp/src/view/index/dashboard.vue

@@ -13,7 +13,7 @@
             <div class="column">
                 <div class="panel bar">
                     <div class="chart" v-loading="loading.BaseBarAcross" element-loading-background="rgba(62,182,250, 0.2)">
-                        <div class="left-titles"><span>各市学校</span></div>
+                        <div class="left-titles"><span>{{$t('dashboard.everySchool')}}</span></div>
                         <BaseBarAcross :mapData="AcrossBar"></BaseBarAcross>
                     </div>
                     <div class="panel-footer"></div>
@@ -484,11 +484,11 @@ export default {
                         ? res.productStatis.forEach((item) => {
                               modelsData.value.legendData.push(item.prodName), modelsData.value.data.push(item.count)
                           })
-                        : ElMessage.error('API返回数据异常')
+                        : ElMessage.error(proxy.$t(`dashboard.apiError`))
                     console.log(modelsData.value)
                 })
                 .catch((res) => {
-                    ElMessage.error('API访问异常')
+                    ElMessage.error(proxy.$t(`dashboard.apiRequestError`))
                 })
         }
         //查看当前状态 切换成全屏或不全屏

+ 108 - 108
TEAMModelBI/ClientApp/src/view/index/index.vue

@@ -1,11 +1,11 @@
 <template>
   <!--首页(管理员以及研发页面)-->
   <div class="eachSite">
-    <div class="gain-time">数据时间:{{dataTime}}</div>
+    <div class="gain-time">{{$t(`home.dataTime`)}}:{{dataTime}}</div>
     <div class="statisticsbox-all" v-if="siteValue==='china'">
       <c-scrollbar ref="scrollbarRef" width="100%" height="100%" trigger="hover" direction="y">
         <div class="headerinbox" v-if="screen.icon === '#icon-tuichuquanping-fill-copy'">
-          <div class="headerinbox-title">TEAM Model·BI 数据监控系统</div>
+            <div class="headerinbox-title">TEAM Model·BI {{$t(`home.title`)}}</div>
           <div class="showTime" @click="detectionsize(screen.state)">
             <svg class="skip" aria-hidden="true">
               <use :xlink:href="screen.icon"></use>
@@ -76,7 +76,7 @@
                       <use xlink:href="#icon-keliuqushi"></use>
                     </svg>
                   </div>
-                  <div class="commonbox-title-name">在线人数趋势</div>
+                  <div class="commonbox-title-name">{{$t(`home.onlineUsersTrend`)}}</div>
                 </div>
                 <div class="leftbox-online" v-loading="loading.basics" element-loading-background="rgba(0, 0, 0, 0.2)">
                   <CommonBar :barData="totalArea.onlineType"></CommonBar>
@@ -99,7 +99,7 @@
                       <use xlink:href="#icon-XX_061"></use>
                     </svg>
                   </div>
-                  <div class="commonbox-title-name">HiTeach开课</div>
+                  <div class="commonbox-title-name">HiTeach{{$t(`home.offerClass`)}}</div>
                 </div>
                 <div class="rightbox-login">
                   <!-- <div class="rightbox-login-select">
@@ -124,7 +124,7 @@
                   <use xlink:href="#icon-huoyue"></use>
                 </svg>
               </div>
-              <div class="commonbox-title-name">开课及上传数据</div>
+              <div class="commonbox-title-name">{{$t(`home.classAndUploadData`)}}</div>
               </p>
               <!-- <CommonBar :barData="totalArea.classAndactivity"></CommonBar> -->
               <div class="center-resource-line" v-loading="loading.active" element-loading-background="rgba(0, 0, 0, 0.2)">
@@ -168,13 +168,13 @@
                     <use xlink:href="#icon-guanfangbanben"></use>
                   </svg>
                 </div>
-                <div class="commonbox-title-name">版本占比</div>
+                <div class="commonbox-title-name">{{$t(`home.verPercent`)}}</div>
                 </p>
                 <div class="commonbox-versions" v-loading="loading.versions" element-loading-background="rgba(0, 0, 0, 0.2)">
                   <div class="commonbox-versions-title">
-                    <p class="versions-title-name">基础版</p>
-                    <p class="versions-title-num">数量
-                      <span>{{ versionsData.basics.num }}</span>
+                    <p class="versions-title-name">{{$t(`home.verBasic`)}}</p>
+                    <p class="versions-title-num">{{$t(`home.number`)}}
+                        <span>{{ versionsData.basics.num }}</span>
                     </p>
                   </div>
                   <div class="commonbox-versions-chart">
@@ -184,9 +184,9 @@
                 </div>
                 <div class="commonbox-versions" v-loading="loading.versions" element-loading-background="rgba(0, 0, 0, 0.2)">
                   <div class="commonbox-versions-title">
-                    <p class="versions-title-name">标准版</p>
-                    <p class="versions-title-num">数量
-                      <span>{{ versionsData.standard.num }}</span>
+                    <p class="versions-title-name">{{$t(`home.verStandard`)}}</p>
+                    <p class="versions-title-num">{{$t(`home.number`)}}
+                        <span>{{ versionsData.standard.num }}</span>
                     </p>
                   </div>
                   <div class="commonbox-versions-chart">
@@ -196,9 +196,9 @@
                 </div>
                 <div class="commonbox-versions" v-loading="loading.versions" element-loading-background="rgba(0, 0, 0, 0.2)">
                   <div class="commonbox-versions-title">
-                    <p class="versions-title-name">专业版</p>
-                    <p class="versions-title-num">数量
-                      <span>{{ versionsData.major.num }}</span>
+                    <p class="versions-title-name">{{$t(`home.verProfession`)}}</p>
+                    <p class="versions-title-num">{{$t(`home.number`)}}
+                        <span>{{ versionsData.major.num }}</span>
                     </p>
                   </div>
                   <div class="commonbox-versions-chart">
@@ -208,9 +208,9 @@
                 </div>
                 <div class="commonbox-versions" v-loading="loading.versions" element-loading-background="rgba(0, 0, 0, 0.2)">
                   <div class="commonbox-versions-title">
-                    <p class="versions-title-name">评测版</p>
-                    <p class="versions-title-num">数量
-                      <span>{{ versionsData.custom.num }}</span>
+                    <p class="versions-title-name">{{$t(`home.verTest`)}}</p>
+                    <p class="versions-title-num">{{$t(`home.number`)}}
+                        <span>{{ versionsData.custom.num }}</span>
                     </p>
                   </div>
                   <div class="commonbox-versions-chart">
@@ -227,7 +227,7 @@
                   <use xlink:href="#icon-32cunchuguanli"></use>
                 </svg>
               </div>
-              <div class="commonbox-title-name">空间使用</div>
+              <div class="commonbox-title-name">{{$t(`home.spaceUsage`)}}</div>
               </p>
               <div class="bottom-rightbox-right" v-loading="loading.sizeType" element-loading-background="rgba(0, 0, 0, 0.2)">
                 <Size :lineData="totalArea.sizePie" :sizenum="allSize"></Size>
@@ -287,32 +287,32 @@ export default {
     let dataTime = ref('')
     let showPattern = ref([])
     let aspectsData = ref([
-      { id: 1, title: '区内学校', num: 0, icon: '#icon-renshixuexiao', classname: 'school' },
-      { id: 2, title: '区内老师', num: 0, icon: '#icon-schoollaoshi', classname: 'teach' },
-      { id: 3, title: '本周数据', num: 0, icon: '#icon-benzhou', classname: 'months' },
-      { id: 4, title: '产出总数据', num: 0, icon: '#icon-ziyuan1', classname: 'datas' },
-      { id: 5, title: '空间总容量', num: 0, icon: '#icon-kongjian', classname: 'size' },
+      { id: 1, title: proxy.$t(`home.spaceUsage`), num: 0, icon: '#icon-renshixuexiao', classname: 'school' },
+      { id: 2, title: proxy.$t(`home.areaTeacher`), num: 0, icon: '#icon-schoollaoshi', classname: 'teach' },
+      { id: 3, title: proxy.$t(`home.thisWeek`) + proxy.$t(`home.data`), num: 0, icon: '#icon-benzhou', classname: 'months' },
+      { id: 4, title: proxy.$t(`home.allOutput`), num: 0, icon: '#icon-ziyuan1', classname: 'datas' },
+      { id: 5, title: proxy.$t(`home.spaceTotal`), num: 0, icon: '#icon-kongjian', classname: 'size' },
     ])
     let activityData = ref({
       total: [
-        { id: 1, title: '本周课例数', num: 0, type: 'month' },
-        { id: 2, title: '学期课例数', num: 0, type: 'month' },
-        { id: 3, title: '本周活动数', num: 0, type: 'month' },
-        { id: 4, title: '学期活动数', num: 0, type: 'month' },
-        { id: 5, title: '累计完成研训学时', num: 0, type: 'total' },
-        { id: 6, title: '累计课例', num: 0, type: 'total' },
-        { id: 7, title: '累计资源', num: 0, type: 'total' },
-        { id: 8, title: '累计活动', num: 0, type: 'total' },
+        { id: 1, title: proxy.$t(`home.thisWeek`) + proxy.$t(`home.courseNumber`), num: 0, type: 'month' },
+        { id: 2, title: proxy.$t(`home.semester`) + proxy.$t(`home.courseNumber`), num: 0, type: 'month' },
+        { id: 3, title: proxy.$t(`home.thisWeek`) + proxy.$t(`home.activityNumber`), num: 0, type: 'month' },
+        { id: 4, title: proxy.$t(`home.semester`) + proxy.$t(`home.activityNumber`), num: 0, type: 'month' },
+        { id: 5, title: proxy.$t(`home.cumulative`) + proxy.$t(`home.researchCompleteTime`), num: 0, type: 'total' },
+        { id: 6, title: proxy.$t(`home.cumulative`) + proxy.$t(`home.courseNumber`), num: 0, type: 'total' },
+        { id: 7, title: proxy.$t(`home.cumulative`) + proxy.$t(`home.resource`), num: 0, type: 'total' },
+        { id: 8, title: proxy.$t(`home.cumulative`) + proxy.$t(`home.activity`), num: 0, type: 'total' },
       ],
       oneself: [
-        { id: 1, title: '本周课例数', num: 0, type: 'month' },
-        { id: 2, title: '学期课例数', num: 0, type: 'month' },
-        { id: 3, title: '本周活动数', num: 0, type: 'month' },
-        { id: 4, title: '学期活动数', num: 0, type: 'month' },
-        { id: 5, title: '累计完成研训学时', num: 0, type: 'total' },
-        { id: 6, title: '累计课例', num: 0, type: 'total' },
-        { id: 7, title: '累计资源', num: 0, type: 'total' },
-        { id: 8, title: '累计活动', num: 0, type: 'total' },
+        { id: 1, title: proxy.$t(`home.thisWeek`) + proxy.$t(`home.courseNumber`), num: 0, type: 'month' },
+        { id: 2, title: proxy.$t(`home.semester`) + proxy.$t(`home.courseNumber`), num: 0, type: 'month' },
+        { id: 3, title: proxy.$t(`home.thisWeek`) + proxy.$t(`home.activityNumber`), num: 0, type: 'month' },
+        { id: 4, title: proxy.$t(`home.semester`) + proxy.$t(`home.activityNumber`), num: 0, type: 'month' },
+        { id: 5, title: proxy.$t(`home.cumulative`) + proxy.$t(`home.researchCompleteTime`), num: 0, type: 'total' },
+        { id: 6, title: proxy.$t(`home.cumulative`) + proxy.$t(`home.courseNumber`), num: 0, type: 'total' },
+        { id: 7, title: proxy.$t(`home.cumulative`) + proxy.$t(`home.resource`), num: 0, type: 'total' },
+        { id: 8, title: proxy.$t(`home.cumulative`) + proxy.$t(`home.activity`), num: 0, type: 'total' },
       ],
     })
     let eachSchool = ref({
@@ -325,20 +325,20 @@ export default {
       type: 'eachschool',
     })
     let areaAspectsData = ref([
-      { id: 1, title: '当前在线人数', num: 0, icon: '#icon-zaixianyonghu2', classname: 'online', state: '0', teach: 0, student: 0, increase: 0 },
-      { id: 2, title: '学区总数', num: 0, icon: '#icon-quyugongsi', classname: 'school', state: '0', teach: 0, student: 0, increase: 0 },
-      { id: 3, title: '学校总数', num: 0, icon: '#icon-all-school', classname: 'datas', state: '1', teach: 0, student: 0, increase: 0 },
-      { id: 4, title: '教师总数', num: 0, icon: '#icon-laoshi1', classname: 'teach', state: '1', teach: 0, student: 0, increase: 0 },
-      { id: 5, title: '学生总数', num: 0, icon: '#icon-xuesheng1', classname: 'student', state: '1', teach: 0, student: 0, increase: 0 },
+      { id: 1, title: proxy.$t(`home.onlineUsersNow`), num: 0, icon: '#icon-zaixianyonghu2', classname: 'online', state: '0', teach: 0, student: 0, increase: 0 },
+      { id: 2, title: proxy.$t(`home.areaTotal`), num: 0, icon: '#icon-quyugongsi', classname: 'school', state: '0', teach: 0, student: 0, increase: 0 },
+      { id: 3, title: proxy.$t(`home.schoolTotal`), num: 0, icon: '#icon-all-school', classname: 'datas', state: '1', teach: 0, student: 0, increase: 0 },
+      { id: 4, title: proxy.$t(`home.teacherTotal`), num: 0, icon: '#icon-laoshi1', classname: 'teach', state: '1', teach: 0, student: 0, increase: 0 },
+      { id: 5, title: proxy.$t(`home.studentTotal`), num: 0, icon: '#icon-xuesheng1', classname: 'student', state: '1', teach: 0, student: 0, increase: 0 },
       // { id: 6, title: '异常报错', num: 59, icon: '#icon-yichang-1', classname: 'months', state: '0', teach: 0, student: 0, increase: 0 },
-      { id: 6, title: 'API访问量', num: 0, icon: '#icon-yichang-1', classname: 'months', state: '0', teach: 0, student: 0, increase: 0 },
+      { id: 6, title: 'API' + proxy.$t(`home.visitNumber`) , num: 0, icon: '#icon-yichang-1', classname: 'months', state: '0', teach: 0, student: 0, increase: 0 },
     ])
     let worldareaAspectsData = ref([
-      { id: 1, title: '当前在线人数', num: 0, icon: '#icon-zaixianyonghu2', classname: 'online', state: '0', teach: 0, student: 0, increase: 0 },
-      { id: 2, title: '学区总数', num: 0, icon: '#icon-quyugongsi', classname: 'school', state: '0', teach: 0, student: 0, increase: 0 },
-      { id: 3, title: '学校总数', num: 0, icon: '#icon-all-school', classname: 'datas', state: '1', teach: 0, student: 0, increase: 0 },
-      { id: 4, title: '教师总数', num: 0, icon: '#icon-laoshi1', classname: 'teach', state: '1', teach: 0, student: 0, increase: 0 },
-      { id: 5, title: '学生总数', num: 0, icon: '#icon-xuesheng1', classname: 'student', state: '1', teach: 0, student: 0, increase: 0 },
+      { id: 1, title: proxy.$t(`home.onlineUsersNow`), num: 0, icon: '#icon-zaixianyonghu2', classname: 'online', state: '0', teach: 0, student: 0, increase: 0 },
+      { id: 2, title: proxy.$t(`home.areaTotal`), num: 0, icon: '#icon-quyugongsi', classname: 'school', state: '0', teach: 0, student: 0, increase: 0 },
+      { id: 3, title: proxy.$t(`home.schoolTotal`), num: 0, icon: '#icon-all-school', classname: 'datas', state: '1', teach: 0, student: 0, increase: 0 },
+      { id: 4, title: proxy.$t(`home.teacherTotal`), num: 0, icon: '#icon-laoshi1', classname: 'teach', state: '1', teach: 0, student: 0, increase: 0 },
+      { id: 5, title: proxy.$t(`home.studentTotal`), num: 0, icon: '#icon-xuesheng1', classname: 'student', state: '1', teach: 0, student: 0, increase: 0 },
       // { id: 6, title: '异常报错', num: 59, icon: '#icon-yichang-1', classname: 'months', state: '0', teach: 0, student: 0, increase: 0 },
     ])
     let areaLists = ref([
@@ -474,10 +474,10 @@ export default {
     let optionsData = ref({
       values: 'now',
       data: [
-        { id: 1, label: '当天', value: 'now' },
-        { id: 2, label: '本月', value: 'month' },
-        { id: 3, label: '全年', value: 'allmonth' },
-        { id: 4, label: '历年', value: 'year' },
+        { id: 1, label: proxy.$t(`home.today`), value: 'now' },
+        { id: 2, label: proxy.$t(`home.thisMonth`), value: 'month' },
+        { id: 3, label: proxy.$t(`home.thisYear`), value: 'allmonth' },
+        { id: 4, label: proxy.$t(`home.overYear`), value: 'year' },
       ]
     })
     let totalArea = ref({
@@ -626,7 +626,7 @@ export default {
             data: nowTimeQuantum.value.onlineValue,
           },
           {
-            name: '在线趋势',
+            name: proxy.$t(`home.onlineTrend`),
             data: nowTimeQuantum.value.onlineValue,
             type: 'line',
             smooth: true, //true曲线; false折线
@@ -661,9 +661,9 @@ export default {
               },
             },
           },
-          { name: '老师', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { borderRadius: 0 }, data: nowTimeQuantum.value.onlineTeach },
-          { name: '学校学生', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { borderRadius: 0 }, data: nowTimeQuantum.value.onlineStudent },
-          { name: '醍摩豆学生', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { borderRadius: 0 }, data: nowTimeQuantum.value.onlineTmdStudent },
+          { name: proxy.$t(`home.teacher`), type: 'bar', barWidth: 20, stack: 'total', itemStyle: { borderRadius: 0 }, data: nowTimeQuantum.value.onlineTeach },
+          { name: proxy.$t(`home.school`) + proxy.$t(`home.student`), type: 'bar', barWidth: 20, stack: 'total', itemStyle: { borderRadius: 0 }, data: nowTimeQuantum.value.onlineStudent },
+          { name: proxy.$t(`home.teamModel`) + proxy.$t(`home.student`), type: 'bar', barWidth: 20, stack: 'total', itemStyle: { borderRadius: 0 }, data: nowTimeQuantum.value.onlineTmdStudent },
         ],
       },
       //在线人数区分
@@ -745,7 +745,7 @@ export default {
             data: nowTimeQuantum.value.onlineValue,
           },
           {
-            name: '在线趋势',
+            name: proxy.$t(`home.onlineTrend`),
             data: nowTimeQuantum.value.onlineValue,
             type: 'line',
             smooth: true, //true曲线; false折线
@@ -780,9 +780,9 @@ export default {
               },
             },
           },
-          { name: '在线老师', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#62F4D1', barBorderRadius: 1, } }, data: nowTimeQuantum.value.onlineTeach },
-          { name: '在线学生(ID)', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#25CCF7', barBorderRadius: 1, } }, data: nowTimeQuantum.value.onlineTmdStudent },
-          { name: '在线学生(校内)', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#32ff7e', barBorderRadius: 1, } }, data: nowTimeQuantum.value.onlineStudent },
+          { name: proxy.$t(`home.online`) + proxy.$t(`home.teacher`), type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#62F4D1', barBorderRadius: 1, } }, data: nowTimeQuantum.value.onlineTeach },
+          { name: proxy.$t(`home.online`) + proxy.$t(`home.student`) + '(ID)', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#25CCF7', barBorderRadius: 1, } }, data: nowTimeQuantum.value.onlineTmdStudent },
+          { name: proxy.$t(`home.online`) + proxy.$t(`home.student`) + '(' + proxy.$t(`home.inSchool`) + ')', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#32ff7e', barBorderRadius: 1, } }, data: nowTimeQuantum.value.onlineStudent },
         ],
       },
       //HiTeach开课
@@ -878,7 +878,7 @@ export default {
         ],
         series: [
           {
-            name: '开课数量',
+            name: proxy.$t(`home.offerClass`) + proxy.$t(`home.number`),
             type: 'bar',
             stack: 'total',
             barWidth: '12px',
@@ -981,7 +981,7 @@ export default {
           left: '40%',
           top: '0%',
           itemHeight: 10,
-          data: ['开课', '上传课堂记录', '昨日开课', '昨日上传课堂记录'],
+          data: [proxy.$t(`home.offerClass`), proxy.$t(`home.uploadLessonRecord`), proxy.$t(`home.yeaterday`) + proxy.$t(`home.offerClass`), proxy.$t(`home.yeaterday`) + proxy.$t(`home.uploadLessonRecord`) ],
           textStyle: {
             fontSize: 14,
             color: "#fff",
@@ -1086,7 +1086,7 @@ export default {
         ],
         series: [
           {
-            name: '上传课堂记录',
+            name: proxy.$t(`home.uploadLessonRecord`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             // showAllSymbol: true,
@@ -1113,7 +1113,7 @@ export default {
             data: nowTimeQuantum.value.todayUpload,
           },
           {
-            name: '开课',
+            name: proxy.$t(`home.offerClass`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             // showAllSymbol: true,
@@ -1151,7 +1151,7 @@ export default {
             data: nowTimeQuantum.value.classinToday,
           },
           {
-            name: '昨日上传课堂记录',
+            name: proxy.$t(`home.yeaterday`) + proxy.$t(`home.uploadLessonRecord`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             stack: 'yesterday',
@@ -1173,7 +1173,7 @@ export default {
             data: nowTimeQuantum.value.yesterdayUpload,
           },
           {
-            name: '昨日开课',
+            name: proxy.$t(`home.yeaterday`) + proxy.$t(`home.offerClass`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             stack: 'yesterday',
@@ -1214,7 +1214,7 @@ export default {
       size: {
         title: [
           {
-            text: '空间已使用率',
+            text: proxy.$t(`home.spaceUsedRate`),
             x: '25%',
             y: '82%',
             textStyle: {
@@ -1291,7 +1291,7 @@ export default {
         },
         series: [
           {
-            name: '空间占比',
+            name: proxy.$t(`home.spacePercent`),
             type: 'pie',
             radius: '85%',
             center: ['50%', '50%'],
@@ -1324,7 +1324,7 @@ export default {
         },
         series: [
           {
-            name: '空间占比',
+            name: proxy.$t(`home.spacePercent`),
             type: 'pie',
             center: ['50%', '50%'],
             radius: ['60%', '80%'],
@@ -1433,7 +1433,7 @@ export default {
             data: worldnowTimeQuantum.value.onlineValue,
           },
           {
-            name: '在线趋势',
+            name: proxy.$t(`home.online`) + proxy.$t(`home.trend`),
             data: worldnowTimeQuantum.value.onlineValue,
             type: 'line',
             smooth: true, //true曲线; false折线
@@ -1468,9 +1468,9 @@ export default {
               },
             },
           },
-          { name: '老师', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#62F4D1', barBorderRadius: 1, } }, data: worldnowTimeQuantum.value.onlineTeach },
-          { name: '学校学生', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#25CCF7', barBorderRadius: 1, } }, data: worldnowTimeQuantum.value.onlineStudent },
-          { name: '醍摩豆学生', type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#32ff7e', barBorderRadius: 1, } }, data: worldnowTimeQuantum.value.onlineTmdStudent },
+          { name: proxy.$t(`home.teacher`), type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#62F4D1', barBorderRadius: 1, } }, data: worldnowTimeQuantum.value.onlineTeach },
+          { name: proxy.$t(`home.school`) + proxy.$t(`home.student`), type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#25CCF7', barBorderRadius: 1, } }, data: worldnowTimeQuantum.value.onlineStudent },
+          { name: proxy.$t(`home.teamModel`) + proxy.$t(`home.student`), type: 'bar', barWidth: 20, stack: 'total', itemStyle: { normal: { color: '#32ff7e', barBorderRadius: 1, } }, data: worldnowTimeQuantum.value.onlineTmdStudent },
         ],
       },
       //HiTeach开课
@@ -1565,7 +1565,7 @@ export default {
         ],
         series: [
           {
-            name: '开课数量',
+            name: proxy.$t(`home.offerClass`) + proxy.$t(`home.number`),
             type: 'bar',
             stack: 'total',
             barWidth: '12px',
@@ -1668,7 +1668,7 @@ export default {
           left: '40%',
           top: '0%',
           itemHeight: 10,
-          data: ['开课', '上传课堂记录', '昨日开课', '昨日上传课堂记录'],
+          data: [proxy.$t(`home.offerClass`), proxy.$t(`home.uploadLessonRecord`), proxy.$t(`home.yeaterday`) + proxy.$t(`home.offerClass`), proxy.$t(`home.yeaterday`) + proxy.$t(`home.uploadLessonRecord`)],
           textStyle: {
             fontSize: 14,
             color: "#fff",
@@ -1773,7 +1773,7 @@ export default {
         ],
         series: [
           {
-            name: '上传课堂记录',
+            name: proxy.$t(`home.uploadLessonRecord`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             // showAllSymbol: true,
@@ -1800,7 +1800,7 @@ export default {
             data: nowTimeQuantum.value.todayUpload,
           },
           {
-            name: '开课',
+            name: proxy.$t(`home.offerClass`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             // showAllSymbol: true,
@@ -1838,7 +1838,7 @@ export default {
             data: nowTimeQuantum.value.classinToday,
           },
           {
-            name: '昨日上传课堂记录',
+            name: proxy.$t(`home.yeaterday`) + proxy.$t(`home.uploadLessonRecord`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             stack: 'yesterday',
@@ -1860,7 +1860,7 @@ export default {
             data: nowTimeQuantum.value.yesterdayUpload,
           },
           {
-            name: '昨日开课',
+            name: proxy.$t(`home.yeaterday`) + proxy.$t(`home.offerClass`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             stack: 'yesterday',
@@ -1901,7 +1901,7 @@ export default {
       size: {
         title: [
           {
-            text: '空间已使用率',
+            text: proxy.$t(`home.spaceUsedRate`),
             x: '25%',
             y: '82%',
             textStyle: {
@@ -1978,7 +1978,7 @@ export default {
         },
         series: [
           {
-            name: '空间占比',
+            name: proxy.$t(`home.spacePercent`),
             type: 'pie',
             radius: '85%',
             center: ['50%', '50%'],
@@ -2011,7 +2011,7 @@ export default {
         },
         series: [
           {
-            name: '空间占比',
+            name: proxy.$t(`home.spacePercent`),
             type: 'pie',
             center: ['50%', '50%'],
             radius: ['60%', '80%'],
@@ -2130,7 +2130,7 @@ export default {
           }
         })
         .catch((res) => {
-          ElMessage.error('基础数据获取异常')
+          ElMessage.error(proxy.$t(`home.basicData`) + proxy.$t(`home.getDataErr`))
         })
     }
     //获取在线人数的数据(成员和趋势图)
@@ -2332,7 +2332,7 @@ export default {
         }
       })
         .catch((res) => {
-          ElMessage.error('课例活跃度获取异常')
+          ElMessage.error(proxy.$t(`home.courseActivateLv`) + proxy.$t(`home.getDataErr`))
         })
     }
     //获取版本占比
@@ -3096,7 +3096,7 @@ export default {
         console.log( versionsData.value.custom.num,versionsData.value.custom.proportion,'自订')
         let dataBasics = {
               title: {
-                text: '{a|' + versionsData.value.basics.proportion + '}{c|%}' + '\n' + '基础版占比',
+                text: '{a|' + versionsData.value.basics.proportion + '}{c|%}' + '\n' + proxy.$t(`home.verBasic`) + proxy.$t(`home.percentage`),
                 x: 'center',
                 y: 'center',
                 textStyle: {
@@ -3179,7 +3179,7 @@ export default {
         }
         let dataStandard = {
               title: {
-                text: '{a|' + versionsData.value.standard.proportion + '}{c|%}' + '\n' + '标准版占比',
+                text: '{a|' + versionsData.value.standard.proportion + '}{c|%}' + '\n' + proxy.$t(`home.verStandard`) + proxy.$t(`home.percentage`),
                 x: 'center',
                 y: 'center',
                 textStyle: {
@@ -3262,7 +3262,7 @@ export default {
         }
         let dataMajor = {
               title: {
-                text: '{a|' + versionsData.value.major.proportion + '}{c|%}' + '\n' + '专业版占比',
+                text: '{a|' + versionsData.value.major.proportion + '}{c|%}' + '\n' + proxy.$t(`home.verProfession`) + proxy.$t(`home.percentage`),
                 x: 'center',
                 y: 'center',
                 textStyle: {
@@ -3345,7 +3345,7 @@ export default {
         }
         let dataCustom = {
               title: {
-                text: '{a|' + versionsData.value.custom.proportion + '}{c|%}' + '\n' + '评测版占比',
+                text: '{a|' + versionsData.value.custom.proportion + '}{c|%}' + '\n' + proxy.$t(`home.verTest`) + proxy.$t(`home.percentage`),
                 x: 'center',
                 y: 'center',
                 textStyle: {
@@ -3446,15 +3446,15 @@ export default {
           totalSize: '',
           various: [
             { value: '', size: 0, name: '' },
-            { value: '', size: 0, name: '投票' },
-            { value: '', size: 0, name: '问卷' },
-            { value: '', size: 0, name: '课纲' },
-            { value: '', size: 0, name: '评测' },
-            { value: '', size: 0, name: '作业' },
-            { value: '', size: 0, name: '课堂记录' },
-            { value: '', size: 0, name: '内容模块' },
-            { value: '', size: 0, name: '试题试卷' },
-            { value: '', size: 0, name: '其他应用数据' },
+            { value: '', size: 0, name: proxy.$t(`home.vote`) },
+            { value: '', size: 0, name: proxy.$t(`home.question`) },
+            { value: '', size: 0, name: proxy.$t(`home.syllabus`) },
+            { value: '', size: 0, name: proxy.$t(`home.exam`) },
+            { value: '', size: 0, name: proxy.$t(`home.homework`) },
+            { value: '', size: 0, name: proxy.$t(`home.lessonRecord`) },
+            { value: '', size: 0, name: proxy.$t(`home.contentModule`) },
+            { value: '', size: 0, name: proxy.$t(`home.paper`) },
+            { value: '', size: 0, name: proxy.$t(`home.otherAppData`) },
           ],
         }
         res.state === 200 ? ((dataArr.totalSize = res.totalSize), (allSize.value.all = res.totalSize)) : ''
@@ -3572,7 +3572,7 @@ export default {
           '23:00',]
         let serialDatas = [
           {
-            name: '上传课堂记录',
+            name: proxy.$t(`home.uploadLessonRecord`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             // showAllSymbol: true,
@@ -3599,7 +3599,7 @@ export default {
             data: nowTimeQuantum.value.todayUpload,
           },
           {
-            name: '开课',
+            name: proxy.$t(`home.offerClass`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             // showAllSymbol: true,
@@ -3637,7 +3637,7 @@ export default {
             data: nowTimeQuantum.value.classinToday,
           },
           {
-            name: '昨日上传课堂记录',
+            name: proxy.$t(`home.yeaterday`) + proxy.$t(`home.uploadLessonRecord`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             stack: 'yesterday',
@@ -3659,7 +3659,7 @@ export default {
             data: nowTimeQuantum.value.yesterdayUpload,
           },
           {
-            name: '昨日开课',
+            name: proxy.$t(`home.yeaterday`) + proxy.$t(`home.offerClass`),
             type: 'bar',
             // symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
             stack: 'yesterday',
@@ -3695,7 +3695,7 @@ export default {
             data: nowTimeQuantum.value.classinYesterday,
           },
         ]
-        totalArea.value.dynamic.legend.data = ['上传课堂记录', '开课', '昨日上传课堂记录', '昨日开课']
+        totalArea.value.dynamic.legend.data = [proxy.$t(`home.uploadLessonRecord`), proxy.$t(`home.offerClass`), proxy.$t(`home.yeaterday`) + proxy.$t(`home.uploadLessonRecord`), proxy.$t(`home.yeaterday`) + proxy.$t(`home.offerClass`)]
         totalArea.value.dynamic.xAxis.data = datas
         totalArea.value.dynamic.series = serialDatas
         totalArea.value.dynamic.series[0].data = nowTimeQuantum.value.todayUpload
@@ -3718,7 +3718,7 @@ export default {
         for (let u in nowTimeQuantum.value.monthuploaddta) {
           dataupload.push(nowTimeQuantum.value.monthuploaddta[u].value)
         }
-        totalArea.value.dynamic.legend.data = ['上传课堂记录', '开课']
+        totalArea.value.dynamic.legend.data = [proxy.$t(`home.uploadLessonRecord`), proxy.$t(`home.offerClass`)]
         totalArea.value.dynamic.xAxis.data = xdata
         totalArea.value.dynamic.series[0].data = dataupload
         totalArea.value.dynamic.series[1].data = statClass
@@ -3741,7 +3741,7 @@ export default {
         for (let u in nowTimeQuantum.value.daysuploaddata) {
           dataupload.push(nowTimeQuantum.value.daysuploaddata[u].value)
         }
-        totalArea.value.dynamic.legend.data = ['上传课堂记录', '开课']
+        totalArea.value.dynamic.legend.data = [proxy.$t(`home.uploadLessonRecord`), proxy.$t(`home.offerClass`)]
         totalArea.value.dynamic.xAxis.data = xdata
         totalArea.value.dynamic.series[0].data = dataupload
         totalArea.value.dynamic.series[1].data = statClass
@@ -3760,7 +3760,7 @@ export default {
         for (let u in nowTimeQuantum.value.yearuploaddata) {
           dataupload.push(nowTimeQuantum.value.yearuploaddata[u].value)
         }
-        totalArea.value.dynamic.legend.data = ['上传课堂记录', '开课']
+        totalArea.value.dynamic.legend.data = [proxy.$t(`home.uploadLessonRecord`), proxy.$t(`home.offerClass`)]
         totalArea.value.dynamic.xAxis.data = xdata
         totalArea.value.dynamic.series[0].data = dataupload
         totalArea.value.dynamic.series[1].data = statClass

+ 191 - 9
TEAMModelBI/ClientApp/src/view/issueCoupons/crteadCoupon.vue

@@ -10,14 +10,24 @@
                 </el-radio-group>
             </el-form-item>
             <el-form-item v-if="!detailSettingFlag" label="活動票券" prop="eventType">
-                <el-radio-group v-model="eventType" @change="setEventType" style="max-width: 1000px;">
-                    <el-radio label="hiteach50-3"  border>Hiteach 50 第三階段</el-radio>
-                    <el-radio label="hiteach333-1"  border>HiTeach 333 第一階段</el-radio>
-                    <el-radio label="hiteach333-3"  border>HiTeach 333 第三階段</el-radio>
+                <el-radio-group v-model="eventType" @change="setEventType" style="max-width: 1000px;max-height: 115px;overflow-y:scroll;">
+                    <el-radio class="event1" label="hiteach50-3"  border>Hiteach 50 第三階段</el-radio>
+                    <el-radio class="event1" label="hiteach333-1"  border>HiTeach 333 第一階段</el-radio>
+                    <el-radio class="event1" label="hiteach333-3"  border>HiTeach 333 第三階段</el-radio>                    
+                    <el-radio class="event2" label="giftWebIRS501M"  border>贈送WEBIRS50一個月</el-radio>
+                    <el-radio class="event2" label="giftWebIRS503M"  border>贈送WEBIRS50三個月</el-radio>
+                    <el-radio class="event2" label="giftWebIRS501Y"  border>贈送WEBIRS50一年</el-radio>
+                    <el-radio class="event3" label="giftSmart3M"  border>贈送智慧評分三個月</el-radio>
+                    <el-radio class="event3" label="giftSmart1Y"  border>贈送智慧評分一年</el-radio>
+                    <el-radio class="event4" label="gifCollaboration3M"  border>贈送協作三個月</el-radio>
+                    <el-radio class="event4" label="gifCollaboration1Y"  border>贈送協作一年</el-radio>
+                    <el-radio class="event5" label="gifAIGPT1Y"  border>贈送AI/GPT一年</el-radio>
+                    <el-radio class="event5" label="gifAIGPT3M"  border>贈送AI/GPT三個月</el-radio>
+                    <el-radio class="event5" label="gifAIGPT6M"  border>贈送AI/GPT六個月</el-radio>
+                    <el-radio label="gifVoiceToText1Y"  border>贈送語音轉錄文字一年</el-radio>
+                    <el-radio label="gifAITXTAnalysis3M"  border>贈送AI文句分析三個月</el-radio>
                     <el-radio label="hiteachBookSPLicense"  border>HiTeach專書贈送授權</el-radio>
                     <el-radio label="fbGroupOpening"  border>HiTeach社團開幕活動</el-radio>
-                    <el-radio label="giftWebIRS501M"  border>贈送WEBIRS50一個月</el-radio>
-                    <el-radio label="giftSmart1Y"  border>贈送智慧評分一年</el-radio>
                 </el-radio-group>
             </el-form-item>
             <el-form-item v-if="detailSettingFlag" label="票券類型" prop="couponType" >
@@ -204,6 +214,41 @@ const shortcuts = [
 const eventType= ref('')
 
 const setEventType = (type)=>{
+    
+    // 重置規則和資訊
+    crtCouponForm.info = [
+        {
+            "l": "zh-tw",
+            "n": "",
+            "u": ""
+        },
+        {
+            "l": "zh-cn",
+            "n": "",
+            "u": ""
+        },
+        {
+            "l": "en-us",
+            "n": "",
+            "u": ""
+        }
+    ]
+
+    crtCouponForm.rule = [
+        {
+            "q": [
+                {
+                    operator: '',
+                    type: '',
+                    how: '',
+                    val:''
+                }
+            ],
+            "b": "",
+            "p": "0"
+        }
+    ]
+
     switch(type){
         case 'hiteach50-3':
             crtCouponForm.couponType =  'Event'
@@ -334,6 +379,39 @@ const setEventType = (type)=>{
             crtCouponForm.info[2].l = 'en-us'
             crtCouponForm.info[2].u = 'https://www.habook.com/en/'
         break
+        case 'giftWebIRS503M':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'giftWebIRS503M'
+            crtCouponForm.rule[0].b = '901003'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
+        case 'giftWebIRS501Y':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'giftWebIRS501Y'
+            crtCouponForm.rule[0].b = '901013'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
+        case 'giftSmart3M':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'giftSmart3M'
+            crtCouponForm.rule[0].b = '901008'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
         case 'giftSmart1Y':
             crtCouponForm.couponType =  'Event'
             crtCouponForm.eventName = 'giftSmart1Y'
@@ -344,7 +422,84 @@ const setEventType = (type)=>{
             crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
             crtCouponForm.info[2].l = 'en-us'
             crtCouponForm.info[2].u = 'https://www.habook.com/en/'
-        break        
+        break
+        case 'gifCollaboration1Y':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'gifCollaboration1Y'
+            crtCouponForm.rule[0].b = '901006'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
+        case 'gifCollaboration3M':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'gifCollaboration3M'
+            crtCouponForm.rule[0].b = '901011'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
+        case 'gifAITXTAnalysis3M':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'gifAITXTAnalysis3M'
+            crtCouponForm.rule[0].b = '901012'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
+        case 'gifAIGPT1Y':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'gifAIGPT1Y'
+            crtCouponForm.rule[0].b = '901007'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
+        case 'gifAIGPT3M':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'gifAIGPT3M'
+            crtCouponForm.rule[0].b = '901014'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
+        case 'gifAIGPT6M':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'gifAIGPT6M'
+            crtCouponForm.rule[0].b = '901015'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
+        case 'gifVoiceToText1Y':
+            crtCouponForm.couponType =  'Event'
+            crtCouponForm.eventName = 'gifVoiceToText1Y'
+            crtCouponForm.rule[0].b = '901010'
+            crtCouponForm.info[0].l = 'zh-tw' 
+            crtCouponForm.info[0].u = 'https://www.habook.com/zh-tw'
+            crtCouponForm.info[1].l = 'zh-cn'
+            crtCouponForm.info[1].u = 'https://www.habook.com.cn/'
+            crtCouponForm.info[2].l = 'en-us'
+            crtCouponForm.info[2].u = 'https://www.habook.com/en/'
+        break
     }
 }
 
@@ -387,7 +542,7 @@ const howList = [
 const ruleBList = [
     { label: "AI文字分析模組(一年)", val: "901001"},
     { label: "AI蘇格拉底小數據(一年)", val: "901002"},
-    { label: "Web IRS 50人 (展延3個月)", val: "901003"},
+    { label: "Web IRS 50人 (給予或展延3個月)", val: "901003"},
     { label: "Web IRS 50人 (延長1個月)", val: "901004"},
     { label: "智慧評分 (一年)", val: "901005"},
     { label: "HiTeachCC-6任務數(展延)", val: "903001"},
@@ -396,8 +551,14 @@ const ruleBList = [
     { label: "HiTeachCC-200連線數(展延)", val: "903004"},
     { label: "小組協作(一年)", val: "901006"},
     { label: "AI GPT(一年)", val: "901007"},
+    { label: "語音轉錄文字(一年)", val: "901010"},
     { label: "智慧評分 (三個月)", val: "901008"},
-    { label: "Web IRS 50人(3個月+75天- 50券STEP3專用)", val: "901009"}    
+    { label: "Web IRS 50人(3個月+75天- 50券STEP3專用)", val: "901009"},
+    { label: "小組協作(三個月)", val: "901011"},
+    { label: "AI文句分析(三個月)", val: "901012"},
+    { label: "Web IRS 50人 (一年)", val: "901013"},
+    { label: "AI GPT(三個月)", val: "901014"},
+    { label: "AI GPT(六個月)", val: "901015"},
 ]
 
 const crtCouponForm = reactive({
@@ -874,6 +1035,7 @@ const resetForm = formEl => {
     eventType.value = ''
     consolidationFlag.value= false
     crtCouponForm.couponType = ''
+    crtCouponForm.eventName = ''
 }
 
 const copyDocument = (data) => {
@@ -891,6 +1053,26 @@ const copyDocument = (data) => {
 </script>
 
 <style scoped>
+.event1{
+    background-color: #03a9f4;
+    color: #fff;
+}
+.event2{
+    background-color: #26c6da;
+    color: #fff;
+}
+.event3{
+    background-color: #7986cb;
+    color: #fff;
+}
+.event4{
+    background-color: #66bb6a;
+    color: #fff;
+}
+.event5{
+    background-color: #607d8b;
+    color: #fff;
+}
 .ruleBox{
     display: flex;
     flex-direction: row;

+ 189 - 2
TEAMModelBI/ClientApp/src/view/issueCoupons/notice.vue

@@ -13,6 +13,52 @@
             <el-form-item label="內容" prop="body">
                 <el-input style="width: 500px;" :rows="6" type="textarea" v-model="noticeForm.body" placeholder="請輸入通知內容" />
             </el-form-item>
+            <el-form-item label="功能" prop="data">
+                <div style="display: flex;flex-direction: column;">
+                    <div style="display: flex;flex-direction: column;">
+                        <div style="width: 750px;display: flex;margin-bottom:3px;" v-for="(item, index) in noticeForm.data.img" :key="index">
+                            <div style="display: flex;align-items: center;">
+                                <img style="max-width: 150px;margin-right: 3px;" :src="item" alt="沒有圖片" >
+                            </div>
+                            <el-input style="width: 500px;    height: 161px;"  placeholder="請輸入圖片網址" v-model="noticeForm.data.img[index]" />
+                            <div style="display: flex;flex-direction: column;justify-content: space-between;padding: 7px 0px 7px 5px;">
+                                <el-button size="small" @click="delIMGItem(index)" :icon="Close" circle style="margin: 0;"/>
+                                <el-button size="small" @click="addIMGItem(index)" :icon="Plus" circle style="margin: 0;"/>
+                            </div>
+                        </div>
+                    </div>
+                    <div style="display: flex;flex-wrap: nowrap;overflow-x: scroll;max-width: 750px;">
+                        <div v-for="(item, index) in noticeForm.data.action" :key="index" style="min-width: 350px;margin: 6px;display: flex;">
+                            <div style="    padding: 7px;text-align: left;border: 1px solid rgb(189, 189, 189);border-radius: 3px;">
+                                <div>
+                                    <span style="margin-right: 3px;">類型:</span>
+                                    <el-radio-group v-model="item.type">
+                                        <el-radio label="click"  border>按鈕</el-radio>
+                                        <el-radio label="link"  border>超連結</el-radio>
+                                    </el-radio-group>
+                                </div>
+                                <div>
+                                    <span style="margin-right: 3px;">按鈕名稱:</span><el-input v-model="item.label"/>
+                                </div>
+                                <div>
+                                    <span style="margin-right: 3px;">網址:</span><el-input v-model="item.url"/>
+                                </div>
+                                <div>
+                                    <span style="margin-right: 3px;">是否連到產品:</span><el-switch active-text="是" inactive-text="否" v-model="item.quickLogin" />
+                                </div>
+                                <div>
+                                    <span style="margin-right: 3px;">預覽:</span>
+                                    <el-button @click="testButton(item)" :link="item.type == 'link'" size="small" type="primary">{{ item.label ? item.label : "按鈕名稱" }}</el-button>
+                                </div>
+                            </div>
+                            <div style="display: flex;flex-direction: column;justify-content: space-between;height: 100%;padding: 7px;">
+                                <el-button size="small" @click="delActionItem(index)" :icon="Close" circle style="margin: 0;"/>
+                                <el-button size="small" @click="addActionItem(index)" :icon="Plus" circle style="margin: 0;"/>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </el-form-item>
             <el-form-item label="醍摩豆ID" prop="targets">
                 <div style="display: flex;align-items: flex-end;">
                     <el-input style="width: 300px;" v-model="noticeForm.targets" :rows="6" type="textarea" placeholder="請填入教師ID, 並用換行分隔" />
@@ -24,6 +70,9 @@
                     <el-radio label="HiTeach" size="large" border>HiTeach</el-radio>
                     <el-radio label="IES" size="large" border>IES</el-radio>
                     <el-radio label="Sokrates" size="large" border>Sokrates</el-radio>
+                    <el-radio label="Auth" size="large" border>Auth</el-radio>
+                    <el-radio label="Event" size="large" border>Event</el-radio>
+                    <el-radio label="IES MGR" size="large" border>IES MGR</el-radio>
                     <!-- <el-radio label="HiTA" size="large" border>HiTA</el-radio> -->
                 </el-radio-group>
             </el-form-item>
@@ -36,7 +85,7 @@
 </template>
 <script setup>
 import { reactive, ref, computed, getCurrentInstance, markRaw } from 'vue'
-import { Warning, SuccessFilled } from '@element-plus/icons'
+import { Warning, SuccessFilled, Plus, Close } from '@element-plus/icons'
 import { ElMessageBox } from 'element-plus'
 let { proxy } = getCurrentInstance()
 const targetsCount = ref(0)
@@ -46,11 +95,68 @@ const noticeForm = reactive({
     srvAdr: '',
     title: '',
     body: '',
+    data: {
+        img: [""],
+        action:[
+            {
+                type: "click",
+                label: "",
+                url: "",
+                quickLogin: false
+            }
+        ],
+    },
     targets: "",
     sender: '',
     hubName: 'hita5' // 暫時固定
 })
 
+const testButton = (item) => {
+    let url = item.url
+    if(item.quickLogin) {
+        if(url.indexOf("?") >= 0){
+            url += "&code="
+        } else {
+            url += "?code="
+        }
+    }
+    window.open(url, "_blank")
+}
+
+const addIMGItem = (index) =>{
+    noticeForm.data.img.splice(index+1, 0, "")
+}
+
+const delIMGItem = (index) =>{
+    if(noticeForm.data.img.length == 1){
+        noticeForm.data.img.splice(index, 1, "")
+    } else {
+        noticeForm.data.img.splice(index, 1)
+    }
+}
+
+const addActionItem = (index) => {
+    noticeForm.data.action.splice(index+1, 0,  {
+        type: "click",
+        label: "",
+        url: "",
+        quickLogin: false
+    })   
+}
+
+const delActionItem = (index) =>{
+    if(noticeForm.data.action.length == 1){
+        noticeForm.data.action.splice(index, 1, {
+            type: "click",
+            label: "",
+            url: "",
+            quickLogin: false
+        })
+    } else {
+        noticeForm.data.action.splice(index, 1)
+    }
+}
+
 const checkTargets = (rule, value, callback) => {
     let isErr = false
     function isArrayRep(array){
@@ -110,12 +216,29 @@ const checkTargets = (rule, value, callback) => {
     callback()
 }
 
+const checkData = (rule, value, callback) => {
+    let action = value.action
+    let errFlag = false
+    action.forEach(item => {
+        if((item.label != "" &&  item.url == "") || (item.label == "" &&  item.url != "")){
+            errFlag = true
+        }
+    })
+
+    if(errFlag){
+        callback(new Error("請將按鈕設定完成"))
+    } else {
+        callback()
+    }
+}
+
 const rules = reactive({
     srvAdr: [{required: true, trigger: "blur", message: '請選擇一個站別' }],
     title: [{required: true, trigger: "blur", message: '請填寫標題' }],
     body: [{required: true, trigger: "blur", message: '請填寫通知內容' }],
     targets: [{required: true, validator: checkTargets, trigger: "blur"}],
     sender: [{required: true, trigger: "blur", message: '請選擇一個產品接收'}],
+    data: [{validator: checkData, trigger: "blur"}],
 })
 
 const submitForm = formEl => {
@@ -131,21 +254,73 @@ const submitForm = formEl => {
                 confirmButtonText: '發送'
             }
         ).then(async ()=>{
+            loading.value = true
             let request = {
                 srvAdr: noticeForm.srvAdr,
                 title: noticeForm.title,
                 body: noticeForm.body,
+                data: null,
                 tags: [],
                 sender: noticeForm.sender,
                 hubName: noticeForm.hubName,
             }
             
+            // 轉型成ARRAY
             noticeForm.targets.split('\n').forEach(e =>{
                 request.tags.push(e + '_' +request.sender)
             })
+            
+            //輸出圖片
+            let imgExist = false
+            noticeForm.data.img.forEach(item => {
+                if(item != "") {
+                    imgExist = true
+                }
+            })
+            if(imgExist){
+                // 宣告
+                if(request.data == null) request.data = {}
+                request.data.img = []
+                noticeForm.data.img.forEach(item => {
+                    if(item != "") {
+                        request.data.img.push(item)
+                    }
+                })
+            }
+
+            // 輸出按鈕
+            let actionExist = false
+            noticeForm.data.action.forEach(item => {
+                if(item.label != "" && item.url != "") {
+                    actionExist = true
+                }
+            })
+            if(actionExist){
+                // 宣告
+                if(request.data == null) request.data = {}
+                request.data.action = []
+                noticeForm.data.action.forEach(item => {
+                    if(item.label != "" && item.url != "") {
+                        if(item.quickLogin) {
+                            if(item.url.indexOf("?") >= 0){
+                                item.url += "&code="
+                            } else {
+                                item.url += "?code="
+                            }
+                        }
+                        // 新增全小寫的key給通知設定
+                        item.quickLogin ? item.quicklogin = 1 : item.quicklogin = 0
+                        request.data.action.push(item)
+                    }
+                })
+            }
+
+            if(request.data != null && Object.keys(request.data).length > 0){
+                request.data = JSON.stringify(request.data)
+            }
+            
             console.log(request)
 
-            loading.value = true
             await proxy.$api.pushNotify(request).then((res) => {
                 console.log(res, '發送成功')
                 ElMessageBox.alert('成功', '發送通知',
@@ -176,6 +351,18 @@ const submitForm = formEl => {
 const resetForm = formEl => {
     if (!formEl) return
     formEl.resetFields()
+
+    noticeForm.data = {
+        img: [""],
+        action:[
+            {
+                type: "click",
+                label: "",
+                url: "",
+                quickLogin: false
+            }
+        ],
+    }
 }
 
 </script>

+ 17 - 5
TEAMModelBI/ClientApp/src/view/login.vue

@@ -54,7 +54,7 @@ export default {
       background: '',
     })
     let loadings = ref(true)
-    let msgText = ref('钉钉扫码登录')
+    let msgText = ref(proxy.$t(`login.title`))
     onMounted(() => {
       if (window.location.href.indexOf('?code') != -1) {
         userCode = window.location.href.substring(window.location.href.indexOf('?') + 6, window.location.href.indexOf('&state'))
@@ -66,8 +66,8 @@ export default {
     //处理登录icon变化
     watch(loginModel, () => {
       loginModel.value == true
-        ? ((loginImg.value = require('../assets/img/erweima.png')), (msgText.value = '钉钉账号登录'))
-        : ((loginImg.value = require('../assets/img/mima.png')), (msgText.value = '钉钉扫码登录'))
+        ? ((loginImg.value = require('../assets/img/erweima.png')), (msgText.value = $t(`login.byAccount`)))
+        : ((loginImg.value = require('../assets/img/mima.png')), (msgText.value = $t(`login.byQrode`)))
     })
     let { editState } = test(proxy)
     function test (proxy) {
@@ -97,7 +97,7 @@ export default {
           res.state === 200 ? ElMessage.success(proxy.$t(`login.loginSuccess`), loginSuccess(res)) : res.state === 0 ? ElMessage.error(res.msg) : res.state === 403 ? ElMessage.error('该用户无权或被禁用登录,请联系平台管理人员') : ElMessage.error('登录失败')
           loading.close()
         }).catch((error) => {
-          ElMessage.error('API异常,登录失败')
+          ElMessage.error($t(`login.apiError`))
           loading.close()
         })
       }
@@ -117,7 +117,19 @@ export default {
         getOrganization()
         Allpermission()
         if (res.roles.includes('admin') || res.roles.includes('leader')) {
-          router.push('/home/index')
+          // 檢查是否為統構平台串接過來的用戶
+          let htype = localStorage.getItem('htype');
+          localStorage.removeItem("htype");
+          if(htype==="adminlogin"){            
+            //router.push({ name: 'adminpanel'}) 
+            // 因為目前網站的router模式為Hash 所以必須用window.location.href的方式轉跳網頁 不然會多代一些前頁的文字
+            window.location.href = window.location.origin+'/#/adminpanel'; 
+                
+            //router.push({ redirect: window.location.href = window.location.origin+'/#/adminpanel' });
+          }else{            
+            router.push('/home/index')
+          }
+          
         } else if (res.roles.includes('assist') || res.roles.includes('sales')) {
           router.push('/home/campus')
         }

+ 437 - 119
TEAMModelBI/ClientApp/src/view/product/details.vue

@@ -21,9 +21,11 @@
       </div>
       <div class="contentbox">
         <div class="school-name">
-          <div class="statistics-address">位于:{{schoolData.region}} {{schoolData.province}}{{schoolData.city}}{{schoolData.dist}}</div>
+          <div class="statistics-address">位于:{{schoolData.region}}
+            {{schoolData.province}}{{schoolData.city}}{{schoolData.dist}}</div>
           <span>{{schoolData.name ? schoolData.name:'暂无名称'}}</span>
-          <div class="statistics-time">统计时间:<span>{{statisticsTime.year}} 年 {{statisticsTime.month}} 月 {{statisticsTime.day}}日</span></div>
+          <div class="statistics-time">统计时间:<span>{{statisticsTime.year}} 年 {{statisticsTime.month}} 月
+              {{statisticsTime.day}}日</span></div>
         </div>
         <div class="basicsdata-box">
           <div class="basicadata-item" v-for="(item,index) in basicaList" :key="index">
@@ -35,8 +37,10 @@
                 </svg>
               </div>
             </div>
-            <div :class="[item.key === 'classtime' || item.key === 'participationnum' ? 'item-nums-special':'item-nums']">
-              <p v-if="item.key === 'classtime' || item.key === 'participationnum'">{{item.valueText}}<span class="timetag">Min</span><br /><span>{{item.valueHText}}<span class="timetag">H</span></span></p>
+            <div
+              :class="[item.key === 'classtime' || item.key === 'participationnum' ? 'item-nums-special':'item-nums']">
+              <p v-if="item.key === 'classtime' || item.key === 'participationnum'">{{item.valueText}}<span
+                  class="timetag">Min</span><br /><span>{{item.valueHText}}<span class="timetag">H</span></span></p>
               <p v-else>{{item.value}}</p>
             </div>
           </div>
@@ -113,6 +117,43 @@
             </div> -->
           </div>
         </div>
+        <div class="minxinbox" v-show="isShowAuth">
+          <div class="lessons-box-maxh">
+            <p class="inuse-title">服務授權</p>
+            <div v-for="(item,index) in serviceTableData" :key="index">
+              <el-card shadow="hover" class="custom-card">
+                <span class="card-column-icon" >
+                  <svg class="cardicon" aria-hidden="true" style="background-color: #ffffff;">
+                    <!-- <use xlink:href="#icon-laoshi1"></use> -->
+                    <use xlink:href="#icon-icon"></use>
+                    
+                    <!-- <use xlink:href="#icon-xuanzexuexiao-01"></use> -->
+                  </svg>
+                </span>                
+                <span class="card-column" style="width: 80%;">{{item.title}}<br/>{{item.expireDate}}</span>
+                <!-- <span class="card-column" style="width: 60%;">{{item.expireDate}}</span> -->
+              </el-card>
+              <el-divider />
+            </div>
+          </div>
+          <div class="inuse-right">
+            <p class="inuse-title">軟體授權</p>
+            <div v-for="(item,index) in softwareTableData" :key="index">
+              <el-card shadow="hover" class="custom-card">
+                <span class="card-column-icon" >
+                  <svg class="cardicon" aria-hidden="true" style="background-color: #ffffff;">
+                    <use xlink:href="#icon-icon-test2"></use>
+                    <!-- <use xlink:href="#icon-xuanzexuexiao-01"></use> -->
+                  </svg>
+                </span>                
+                <span class="card-column" style="width: 80%;">{{item.title}}<br/>{{item.expireDate}}</span>
+                <!-- <span class="card-column" style="width: 60%;">{{item.expireDate}}</span> -->
+              </el-card>
+              <el-divider />
+            </div>
+          </div>
+        </div>
+
       </div>
       <!--上一个或者下一个-->
       <!-- <div class="lastbtn">
@@ -147,97 +188,101 @@
           <div class="areaData">
             <div class="contentbox area-contentbox">
               <div class="header-select">
-        <div class="header-select-title">学区数据详情页</div>
-        <div class="header-select-box">
-          <div class="backbtn">
-            <el-button type="primary" @click="backbtn()">返回</el-button>
-          </div>
-        </div>
-      </div>
-      <div class="contentbox">
-        <div class="school-name">
-          <!-- <div class="statistics-address">位于:{{schoolData.region}} {{schoolData.province}}{{schoolData.city}}{{schoolData.dist}}</div> -->
-          <span>{{schoolData.name ? schoolData.name:'暂无名称'}}</span>
-          <div class="statistics-time">统计时间:<span>{{statisticsTime.year}} 年 {{statisticsTime.month}} 月 {{statisticsTime.day}}日</span></div>
-        </div>
-        <div class="basicsdata-box">
-          <div class="basicadata-item" v-for="(item,index) in basicaList" :key="index">
-            <div class="item-title-images">
-              <div class="item-title">{{item.title}}</div>
-              <div class="item-images">
-                <svg class="analysisicon" aria-hidden="true">
-                  <use :xlink:href="item.icon"></use>
-                </svg>
-              </div>
-            </div>
-            <div :class="[item.key === 'classtime' || item.key === 'participationnum' ? 'item-nums-special':'item-nums']">
-              <p v-if="item.key === 'classtime' || item.key === 'participationnum'">{{item.value}}<span class="timetag">Min</span><br /><span>{{Math.round(item.value/60)}}<span class="timetag">H</span></span></p>
-              <p v-else>{{item.value}}</p>
-            </div>
-          </div>
-        </div>
-        <div class="apparatusAndpower">
-          <div class="inuse-left">
-            <p class="inuse-title">课中互动</p>
-            <div class="inuse-item" v-for="(item,index) in inuseList" :key="index">
-              <div class="item-img">
-                <svg class="inuseicon" aria-hidden="true">
-                  <use :xlink:href="item.icon"></use>
-                </svg>
-              </div>
-              <div class="item-box">
-                <p>{{item.value}}</p>
-                <span>{{item.title}}</span>
-              </div>
-            </div>
-          </div>
-          <div class="apparatus-box">
-            <p class="apparatus-title">设备与授权</p>
-            <div class="apparatus-item" v-for="(item,index) in powerList.facility" :key="index">
-              <div class="item-num">{{item.value}}</div>
-              <span class="item-title">{{item.name}}</span>
-            </div>
-          </div>
-          <div class="power-box">
-            <p class="apparatus-title">课堂与授权</p>
-            <div class="power-item" v-for="(item,index) in powerList.class" :key="index">
-              <div class="item-num">{{item.value}}</div>
-              <span class="item-title">{{item.name}}</span>
-            </div>
-          </div>
-        </div>
-        <div class="minxinbox">
-          <div class="lessons-box">
-            <div class="lessons-item" v-for="(items,indexs) in lessonsList" :key="indexs">
-              <div class="lessons-img-title">
-                <div class="lessons-img">
-                  <svg class="lessonsicon" aria-hidden="true">
-                    <use :xlink:href="items.icon"></use>
-                  </svg>
+                <div class="header-select-title">学区数据详情页</div>
+                <div class="header-select-box">
+                  <div class="backbtn">
+                    <el-button type="primary" @click="backbtn()">返回</el-button>
+                  </div>
                 </div>
-                <!-- <div class="lesson-title">{{items.title}}</div> -->
-              </div>
-              <div class="inquirybox"><span>{{items.content}}</span></div>
-              <div class="less-value">
-                <span class="lessvalue-num">{{items.value}}</span>
-                <!-- {{indexs+1 === lessonsList.length ? items.value:items.value}} -->
-                <span v-if="indexs+1 !== lessonsList.length">/堂课</span>
-              </div>
-              <div class="result-box">
-                <svg class="lessRicon" aria-hidden="true">
-                  <use :xlink:href="items.value !==0 ? '#icon-zhengque2':'#icon-cuowu'"></use>
-                </svg>
               </div>
-            </div>
-          </div>
-          <div class="inuse-right">
-            <div class="inuse-total">
-              <div class="class-title">多形态课堂</div>
-            </div>
-            <div class="echartsX">
-              <Xlines :lineData="echartData.xlines"></Xlines>
-            </div>
-            <!-- <div class="inuse-below">
+              <div class="contentbox">
+                <div class="school-name">
+                  <!-- <div class="statistics-address">位于:{{schoolData.region}} {{schoolData.province}}{{schoolData.city}}{{schoolData.dist}}</div> -->
+                  <span>{{schoolData.name ? schoolData.name:'暂无名称'}}</span>
+                  <div class="statistics-time">统计时间:<span>{{statisticsTime.year}} 年 {{statisticsTime.month}} 月
+                      {{statisticsTime.day}}日</span></div>
+                </div>
+                <div class="basicsdata-box">
+                  <div class="basicadata-item" v-for="(item,index) in basicaList" :key="index">
+                    <div class="item-title-images">
+                      <div class="item-title">{{item.title}}</div>
+                      <div class="item-images">
+                        <svg class="analysisicon" aria-hidden="true">
+                          <use :xlink:href="item.icon"></use>
+                        </svg>
+                      </div>
+                    </div>
+                    <div
+                      :class="[item.key === 'classtime' || item.key === 'participationnum' ? 'item-nums-special':'item-nums']">
+                      <p v-if="item.key === 'classtime' || item.key === 'participationnum'">{{item.value}}<span
+                          class="timetag">Min</span><br /><span>{{Math.round(item.value/60)}}<span
+                            class="timetag">H</span></span></p>
+                      <p v-else>{{item.value}}</p>
+                    </div>
+                  </div>
+                </div>
+                <div class="apparatusAndpower">
+                  <div class="inuse-left">
+                    <p class="inuse-title">课中互动</p>
+                    <div class="inuse-item" v-for="(item,index) in inuseList" :key="index">
+                      <div class="item-img">
+                        <svg class="inuseicon" aria-hidden="true">
+                          <use :xlink:href="item.icon"></use>
+                        </svg>
+                      </div>
+                      <div class="item-box">
+                        <p>{{item.value}}</p>
+                        <span>{{item.title}}</span>
+                      </div>
+                    </div>
+                  </div>
+                  <div class="apparatus-box">
+                    <p class="apparatus-title">设备与授权</p>
+                    <div class="apparatus-item" v-for="(item,index) in powerList.facility" :key="index">
+                      <div class="item-num">{{item.value}}</div>
+                      <span class="item-title">{{item.name}}</span>
+                    </div>
+                  </div>
+                  <div class="power-box">
+                    <p class="apparatus-title">课堂与授权</p>
+                    <div class="power-item" v-for="(item,index) in powerList.class" :key="index">
+                      <div class="item-num">{{item.value}}</div>
+                      <span class="item-title">{{item.name}}</span>
+                    </div>
+                  </div>
+                </div>
+                <div class="minxinbox">
+                  <div class="lessons-box">
+                    <div class="lessons-item" v-for="(items,indexs) in lessonsList" :key="indexs">
+                      <div class="lessons-img-title">
+                        <div class="lessons-img">
+                          <svg class="lessonsicon" aria-hidden="true">
+                            <use :xlink:href="items.icon"></use>
+                          </svg>
+                        </div>
+                        <!-- <div class="lesson-title">{{items.title}}</div> -->
+                      </div>
+                      <div class="inquirybox"><span>{{items.content}}</span></div>
+                      <div class="less-value">
+                        <span class="lessvalue-num">{{items.value}}</span>
+                        <!-- {{indexs+1 === lessonsList.length ? items.value:items.value}} -->
+                        <span v-if="indexs+1 !== lessonsList.length">/堂课</span>
+                      </div>
+                      <div class="result-box">
+                        <svg class="lessRicon" aria-hidden="true">
+                          <use :xlink:href="items.value !==0 ? '#icon-zhengque2':'#icon-cuowu'"></use>
+                        </svg>
+                      </div>
+                    </div>
+                  </div>
+                  <div class="inuse-right">
+                    <div class="inuse-total">
+                      <div class="class-title">多形态课堂</div>
+                    </div>
+                    <div class="echartsX">
+                      <Xlines :lineData="echartData.xlines"></Xlines>
+                    </div>
+                    <!-- <div class="inuse-below">
               <div class="below-item" v-for="(itemA,index) in classType" :key="index">
                 <p>{{itemA.name}}</p>
                 <div class="valuebox">
@@ -246,9 +291,9 @@
                 <div :class="itemA.class"></div>
               </div>
             </div> -->
-          </div>
-        </div>
-      </div>
+                  </div>
+                </div>
+              </div>
             </div>
           </div>
         </el-tab-pane>
@@ -282,6 +327,7 @@ import * as echarts from 'echarts'
 let props = defineProps({
   detailsData: Object,
   pattern:Object,
+  authDetailsData:Object,
 })
 console.log(props.detailsData, '子组件')
 let value1 = ref('')
@@ -650,14 +696,21 @@ let schoolData = ref({
   city: '',
   dist: '',
 })
-let lessonsList = ref([
+let lessonsList = ref([    
   { icon: '#icon--caozuorizhi', title: 'IES课程', content: '使用IES课程', state: true, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'webIrs', content: '使用webIrs', state: true, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'IRS', content: '使用IRS', state: true, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'HiTA', content: '使用HiTA', state: false, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'HaBoard', content: '使用HaBoard', state: false, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'IES5资源', content: '使用IES5资源', state: true, value: 0 },
-  { icon: '#icon--caozuorizhi', title: 'T指数', content: '课程T绿灯数', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'webIrs', content: '使用webIrs', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'IRS', content: '使用IRS', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'HiTA', content: '使用HiTA', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'HaBoard', content: '使用HaBoard', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'HaBoard', content: '使用IES5资源', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'text', content: '使用文字云', state: false, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'ClouDAS', content: '使用ClouDAS', state: false, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'GPT', content: '使用GPT', state: false, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'IES5测验', content: '使用IES5卷测验', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'Excel测验', content: '使用Excel卷测验', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: '纸本测验', content: '使用纸本测验', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'T课堂', content: '符合T课堂数', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'T指数', content: '课程T绿灯数', state: true, value: 0 },
 ])
 let inuseList = ref([
   { title: '任务数', value: 15, icon: '#icon-renwu', percent: '41.2%', class: 'task', textClass: 'task-text' },
@@ -671,8 +724,10 @@ let classType = ref([
   { name: '任务型态课堂', value: 20, percent: '10%', class: 'topic', textClass: 'topic-text' },
   { name: '差异化形态课堂', value: 20, percent: '5%', class: 'interaction', textClass: 'interaction-text' },
   { name: '测验型态课堂', value: 30, percent: '15%', class: 'testclass', textClass: 'testclass-text' },
-  { name: '无型态课堂', value: 0, percent: '0%', class: 'noneclass', textClass: 'noneclassclass-text' },
-  { name: '未上课', value: 0, percent: '0%', class: 'noneclass', textClass: 'noneclassclass-text' },
+  { name: '协作型态课堂', value: 30, percent: '15%', class: 'testclass', textClass: 'testclass-text' },
+  { name: '互评型态课堂', value: 30, percent: '15%', class: 'testclass', textClass: 'testclass-text' },
+  { name: '教材展示', value: 0, percent: '0%', class: 'noneclass', textClass: 'noneclassclass-text' },
+  { name: '白板应用', value: 0, percent: '0%', class: 'noneclass', textClass: 'noneclassclass-text' },
 ])
 let echartData = ref({
   total: 0,
@@ -723,7 +778,7 @@ let echartData = ref({
         }
       },
       boundaryGap: true, // 坐标轴两边是否留白
-      data: ['合作型态', '互动型态', '任务型态', '差异化型态', '测验型态', '无型态', '未上课']
+      data: ['合作型态', '互动型态', '任务型态', '差异化型态', '测验型态', '协作', '互评', '教材展示', '白板应用']
     },
     yAxis: [
       {
@@ -787,6 +842,110 @@ let echartData = ref({
     ]
   }
 })
+let serviceTableData = ref([{}])
+let softwareTableData = ref([{}])
+let productData = ref([
+  {   
+    name: 'ezStation 2',
+    prodcode: '3222NIYD',    
+  },
+  {
+    name: 'HiTeach STD',
+    prodcode: 'J223IZ6M',    
+  },
+  {
+    name: 'HiTeach TBL',
+    prodcode: '3222C6D2',    
+  },
+  {
+    name: 'HiTeach PRO',
+    prodcode: 'J223IZAM',
+  },
+  {
+    name: 'HiTeach Lite',
+    prodcode: 'J2236ZCX',
+  },
+  {
+    name: 'HiTeach Mobile',
+    prodcode: '3222DNG2',
+  },
+  {
+    name: 'HiTeach Premium',
+    prodcode: '3222IAVN',
+  },
+  {
+    name: 'HiTeach5',
+    prodcode: 'BYJ6LZ6Z',
+  },
+  {
+    name: 'HiTeachCC',
+    prodcode: 'LZLL6ZEI',
+  },
+  {
+    name: proxy.$t(`auth.YMPCVCIM`),
+    prodcode: 'YMPCVCIM',
+  },
+  {
+    name: proxy.$t(`auth.IPDYZYLC`),
+    prodcode: 'IPDYZYLC',
+  },
+  {
+    name: proxy.$t(`auth._3CLYJ6NP`),
+    prodcode: '3CLYJ6NP',
+  },
+  {
+    name: proxy.$t(`auth.IPALJ6NY`),
+    prodcode: 'IPALJ6NY',
+  },
+  {
+    name: proxy.$t(`auth.VABAJ6NV`),
+    prodcode: 'VABAJ6NV',
+  },
+  {
+    name: proxy.$t(`auth._0VPBDZPG`),
+    prodcode: '0VPBDZPG',
+  },
+  {
+    name: proxy.$t(`auth.B9GPJ6NY`),
+    prodcode: 'B9GPJ6NY',
+  },
+  {
+    name: proxy.$t(`auth.LY9AJ6NY`),
+    prodcode: 'LY9AJ6NY',
+  },
+  {
+    name: proxy.$t(`auth.YL9CJ6NY`),
+    prodcode: 'YL9CJ6NY',
+  },
+  {
+    name: proxy.$t(`auth.LL9MJ6NY`),
+    prodcode: 'LL9MJ6NY',
+  },
+  {
+    name: proxy.$t(`auth.B6V5J6NP`),
+    prodcode: 'B6V5J6NP',
+  },
+  {
+    name: proxy.$t(`auth.LSZYJ6NA`),
+    prodcode: 'LSZYJ6NA',
+  },
+  {
+    name: proxy.$t(`auth.CVGPJ6NN`),
+    prodcode: 'CVGPJ6NN',
+  },
+  {
+    name: proxy.$t(`auth.VDPGJ6NC`),
+    prodcode: 'VDPGJ6NC',
+  },
+  {
+    name: proxy.$t(`auth.YPXSJ6NJ`),
+    prodcode: 'YPXSJ6NJ',
+  },
+])
+let isShowAuth = true
+
+  
+
 function init (againvalue) {
   console.log(againvalue,'是什么值')
   // let totalsArr = []
@@ -830,14 +989,39 @@ function init (againvalue) {
   basicaList.value[7].valueHText=proxy.$common.numberToTextWithUnit(Math.round(lessonLengMin/60))
 
   //处理课中使用数据
-  let { useIES, useWebIrs, useDeviceIrs, useHita, useHaboard, useIES5Resource, tGreen } = propsbox.detailsData
-  lessonsList.value[0].value = useIES
-  lessonsList.value[1].value = useWebIrs
-  lessonsList.value[2].value = useDeviceIrs
-  lessonsList.value[3].value = useHita
-  lessonsList.value[4].value = useHaboard
-  lessonsList.value[5].value = useIES5Resource
-  lessonsList.value[6].value = tGreen
+  // let { useIES, useWebIrs, useDeviceIrs, useHita, useHaboard, useIES5Resource, tGreen } = propsbox.detailsData
+  // lessonsList.value[0].value = useIES
+  // lessonsList.value[1].value = useWebIrs
+  // lessonsList.value[2].value = useDeviceIrs
+  // lessonsList.value[3].value = useHita
+  // lessonsList.value[4].value = useHaboard
+  // lessonsList.value[5].value = useIES5Resource
+  // lessonsList.value[6].value = tGreen
+
+  //处理课中使用数据
+  let { useIES, useWebIrs, useDeviceIrs, useHita, useHaboard, useIES5Resource, tGreen,useWordCloud,useClouDAS,useGPT,useIesTest,useExcelTest,usePaperTest,tLesson} = propsbox.detailsData
+    lessonsList.value[0].value = useIES ?useIES:0
+    lessonsList.value[1].value = useWebIrs ? useWebIrs:0
+    lessonsList.value[2].value = useDeviceIrs ? useDeviceIrs:0
+    lessonsList.value[3].value = useHita ? useHita:0
+    lessonsList.value[4].value = useHaboard ?  useHaboard:0
+    lessonsList.value[5].value =useIES5Resource ? useIES5Resource:0
+    //由hita 调整为 文字云
+    lessonsList.value[6].value = useWordCloud ?useWordCloud:0
+    //由HaBoard 调整为 ClouDAS
+    lessonsList.value[7].value = useClouDAS ? useClouDAS:0
+    //增加使用GPT
+    lessonsList.value[8].value = useGPT ?useGPT:0
+    //由IES5资源调整为 使用IES5卷测验
+    lessonsList.value[9].value = useIesTest ? useIesTest:0
+    //新增Excel
+    lessonsList.value[10].value=useExcelTest ? useExcelTest:0
+    //新增纸本
+    lessonsList.value[11].value=usePaperTest ?usePaperTest:0
+    //符合T课堂数
+    lessonsList.value[12].value=tLesson ? tLesson:0
+    // T綠燈
+    lessonsList.value[13].value=tGreen
 
   //授权占比
   let { deviceCnt, deviceNoAuth, deviceAuth, lessonCnt928, lessonCntId, lessonCntDevice, lessonCntIdDevice } = propsbox.detailsData
@@ -857,7 +1041,7 @@ function init (againvalue) {
   inuseList.value[3].value = proxy.$common.numberToTextWithUnit(interact)
 
   //处理多形态课堂
-  let { lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif, lTypeNone,lessonLeng0} = propsbox.detailsData
+  let { lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif, lTypeNone,lessonLeng0,learnCoop,learnPeer} = propsbox.detailsData
   let totalNum = [lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif].reduce((prev, cur) => { return prev + cur }, 0)
   echartData.value.total = totalNum
   console.log(totalNum)
@@ -875,7 +1059,7 @@ function init (againvalue) {
   classType.value[5].value = lessonLeng0 ? lessonLeng0:0
 
   //echarts占比
-  echartData.value.xlines.series[0].data = [lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif, lTypeNone, classType.value[5].value]
+  echartData.value.xlines.series[0].data = [lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif, learnCoop, learnPeer, lTypeNone, classType.value[5].value]
   // echartData.value.xlines.series[1].data = [classType.value[1].percent]
   // echartData.value.xlines.series[2].data = [classType.value[2].percent]
   // echartData.value.xlines.series[3].data = [classType.value[3].percent]
@@ -953,6 +1137,65 @@ function init (againvalue) {
      console.log(trimData,'清理过后的')
      tableData.value=trimData
   }
+
+  // 服務授權
+  // 取得指定學校的授權資料
+  let foundItem = propsbox.authDetailsData.find(item => item.schId === propsbox.detailsData.schoolId);
+  if (foundItem !== undefined) {
+    isShowAuth = true;
+    let serviceArr = [];
+    foundItem.authService.forEach((item) => {
+      //debugger;
+      // 依照對應的產品代碼取得產品名稱
+      let productDataItem = productData.value.find(itempd => itempd.prodcode === item.prodCode);
+      if (productDataItem !== undefined) {
+        let expireDate = "";
+        if (item.endDate === 0) {
+          expireDate = '服務到期日 : 無限期';
+        } else {
+          expireDate = '服務到期日 : ' + proxy.$common.timestampToTime(item.endDate, 'all')
+        }
+        let serviceItem = {
+          title: productDataItem.name,
+          //expireDate: '服務到期日 : ' + proxy.$common.timestampToTime(item.startDate, 'all') + ' - ' + proxy.$common.timestampToTime(item.endDate, 'all')
+          expireDate: expireDate
+        }
+        serviceArr.push(serviceItem);
+      }
+    })
+    serviceTableData.value = serviceArr;
+
+    // 軟體授權    
+    let softwareArr = [];
+    foundItem.authSerial.forEach((item) => {      
+      // 依照對應的產品代碼取得產品名稱
+      let productDataItem = productData.value.find(itempd => itempd.prodcode === item.prodCode);
+      if (productDataItem !== undefined) {
+        let expireDate = "";
+        if (item.endDate === 0) {
+          expireDate = '服務到期日 : 無限期';
+        } else {
+          expireDate = '服務到期日 : ' + proxy.$common.timestampToTime(item.endDate, 'all')
+        }
+        let softwareItem = {
+          title: productDataItem.name,
+          expireDate: expireDate
+        }
+        softwareArr.push(softwareItem);
+      }
+    })
+    softwareTableData.value = softwareArr;
+
+
+  }else{
+    isShowAuth = false;
+  }
+ 
+  
+
+
+
+
 }
 function detailsSchool(value){
   console.log(value,'查看要传的数据')
@@ -970,6 +1213,7 @@ init()
   width: 100%;
   position: relative;
 }
+
 .header-select {
   width: 100%;
   height: 60px;
@@ -977,6 +1221,7 @@ init()
   background-color: #fff;
   box-shadow: 0 2px 5px #e9e9e9;
 }
+
 .header-select-title,
 .header-select-box {
   display: inline-block;
@@ -986,14 +1231,17 @@ init()
   padding-left: 1%;
   line-height: 60px;
 }
+
 .header-select-title {
   font-size: 18px;
   font-weight: bold;
 }
+
 .header-select-box {
   text-align: right;
   padding-right: 1%;
 }
+
 .select-box-time,
 .select-box-area,
 .select-box-school {
@@ -1001,6 +1249,7 @@ init()
   vertical-align: top;
   padding-top: 1%;
 }
+
 .contentbox {
   width: 98%;
   /* padding: 1% 1%; */
@@ -1009,10 +1258,12 @@ init()
   margin: 0.5% 1%;
   padding-bottom: 0.5%;
 }
+
 .area-contentbox {
   width: 100%;
   margin: 0%;
 }
+
 .analysisicon {
   width: 2.3em;
   height: 2.3em;
@@ -1022,6 +1273,7 @@ init()
   margin-right: 25px;
   margin-left: 0px; */
 }
+
 .basicsdata-box {
   overflow: hidden;
   width: 100%;
@@ -1030,9 +1282,9 @@ init()
   flex-wrap: nowrap;
   justify-content: space-between;
 }
+
 .apparatusAndpower {
-  width: 100%;
-  display: flex;
+  width: 100%;display: flex;
   flex-wrap: nowrap;
   line-height: 60px;
   /* justify-content: space-between; */
@@ -1083,7 +1335,7 @@ init()
   border-bottom: 1px dashed #e9e9e9;
   font-size: 16px;
   font-weight: bold;
-  color: #fff;
+  color:black;
 }
 .item-num {
   font-size: 20px;
@@ -1144,6 +1396,16 @@ init()
   overflow: hidden;
   overflow-y: auto;
 }
+.lessons-box-maxh {
+  width: 50%;
+  
+  border-radius: 5px;
+  background: #fff;
+  box-shadow: 0 2px 5px #e9e9e9;
+  margin: 0.5% 1%;
+  overflow: hidden;
+  overflow-y: auto;
+}
 .lessons-item {
   width: 100%;
   padding: 0% 10%;
@@ -1503,5 +1765,61 @@ init()
 .contentbox .el-divider {
   margin: 10px 0;
 }
+.data-tables .header-class,
+  .data-tables 
+  .el-table-v2__row-cell 
+  {
+    /* width: v-bind(cellWidth + "%") !important; */
+    justify-content: center;
+    text-align: center;
+  }
+  .data-tables .general {
+    /* width: v-bind(cellWidth + "%") !important; */
+    justify-content: center;
+    text-align: center;
+  }
+  .data-tables .generalid {    
+    justify-content: left;
+    text-align: left;
+  }
+  .data-tables .btn-class {
+    /* width: v-bind(cellWidth + "%") !important; */
+    justify-content: center;
+    text-align: center;
+  }
+  .data-tables {
+    width: 93%;
+    padding: 0px 20px;
+    height: 100%;
+  }
+  .el-table__body, .el-scrollbar__view {
+    width: 100%;
+  }
+  .custom-card {
+  line-height: 60px;
+  width: 95%;
+  margin-top: 10px;
+  margin-left: 20px;
+  }
+  .card-column {
+    float:left;
+    text-align: left;   
+    /* margin-right: 80px;   */
+    /* width: 30%; */
+  }
+  .card-column-icon {
+    float:left;
+    text-align: left;   
+    margin-right: 40px;
+    width: 8%;  
+  }
+  .cardicon {
+  width: 3em;
+  height: 3em;
+  vertical-align: -0.5em;
+  fill: currentColor;
+}
+  
+  
 </style>
 

+ 191 - 185
TEAMModelBI/ClientApp/src/view/product/index.vue

@@ -1,9 +1,9 @@
 <template>
   <!--外层所有数据-->
-  <div class="productbox" v-loading="initLoading" v-if="showState==='default'"  element-loading-text="正在准备数据中...">
+  <div class="productbox" v-loading="initLoading" v-if="showState==='default'" :element-loading-text="$t(`product.prepareData`)+'...'">
     <div class="header-select">
       <el-collapse v-model="activeNames" accordion>
-        <el-collapse-item title="数据筛选" name="1">
+        <el-collapse-item :title="$t(`product.filterType`)" name="1">
           <div class="filtratebox">
             <!--产品类型-->
             <div class="filtratebox-phase">
@@ -26,7 +26,7 @@
             <!--结果类型end-->
             <!--产品类型end-->
             <div class="filtratebox-phase">
-              <span class="filtratebox-phase-title">筛选类型:</span>
+                <span class="filtratebox-phase-title">{{$t(`product.filterType`)}}:</span>
               <div class="filtratebox-phase-content">
                 <div class="phase-item" v-for="(items,index) in productData.filtrate" :key="items.value" :class="[index ===clickNum.filter ? 'filter-click':'' ]" @click="clickNum.filter=index">{{items.name}}</div>
               </div>
@@ -44,16 +44,16 @@
                   </div>
                 </div>
                 <div class="filtratebox-phase">
-                  <span class="filtratebox-phase-title subclass">时间范围:</span>
+                  <span class="filtratebox-phase-title subclass">{{$t(`product.timeRange`)}}:</span>
                   <div class="filtratebox-phase-content">
                     <div class="phase-item" v-for="(items,index) in productData.time" :key="items.value" :class="[index ===clickNum.time ? 'filter-click':'' ]" @click="(timeScope=items.timeV,clickNum.time=index,productData.timevalue='')">{{items.name}}</div>
                   </div>
                 </div>
                 <div class="filtratebox-phase">
-                  <span class="filtratebox-phase-title subclass">精准选择:</span>
+                  <span class="filtratebox-phase-title subclass">{{$t(`product.accurateSelect`)}}:</span>
                   <div class="filtratebox-phase-content precise">
                     <div v-if="(clickNum.subject === 0 || clickNum.subject === 2) && clickNum.filter===0" class="schoolclass">
-                      <el-cascader v-model="optionsValue" :options="options" :props="props2" :collapse-tags=true :collapse-tags-tooltip=true filterable :filter-method="keywords">
+                      <el-cascader v-model="optionsValue" :options="options" :props="props2" :collapse-tags=true :collapse-tags-tooltip=true filterable :filter-method="keywords" :placeholder="$t(`product.pleaseSelect`)">
                       </el-cascader>
                       <div class="addschoolbtn" @click="(adddialog=true,addvalue='',searchInit())">
                         <el-icon color="#606266">
@@ -62,16 +62,16 @@
                       </div>
                     </div>
                     <div v-else-if="clickNum.subject === 1" class="aresclass">
-                      <el-select v-model="optionsValue" multiple  filterable :filter-method="remoteMethod" collapse-tags collapse-tags-tooltip :max-collapse-tags="3" placeholder="选择相应的学区进行统计" clearable>
+                      <el-select v-model="optionsValue" multiple  filterable :filter-method="remoteMethod" collapse-tags collapse-tags-tooltip :max-collapse-tags="3" :placeholder="$t(`product.selectAreaForStatistics`)" clearable>
                         <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
                       </el-select>
                     </div>
                     <div class="timeselect-box">
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-if="timeScope ==='daterange'" @change="timeChange"  :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Day'" @change="timeChange"  :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Week'" @change="timeChange"  :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="monthrange" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Month'" @change="timeChange"  :disabled-date="monthOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="year" placeholder="请选择 某一年 来进行数据统计" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Year'" @change="timeChange" />
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-if="timeScope ==='daterange'" @change="timeChange"  :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Day'" @change="timeChange"  :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Week'" @change="timeChange"  :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="monthrange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startMonth`)" :end-placeholder="$t(`product.endMonth`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Month'" @change="timeChange"  :disabled-date="monthOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="year" :placeholder="$t(`product.selectOneYear`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Year'" @change="timeChange" />
                     </div>
                   </div>
                 </div>
@@ -86,33 +86,33 @@
                   </div>
                 </div>
                 <div class="filtratebox-phase">
-                  <span class="filtratebox-phase-title subclass">时间类型:</span>
+                    <span class="filtratebox-phase-title subclass">{{$t(`product.timeType`)}}:</span>
                   <div class="filtratebox-phase-content">
                     <div class="phase-item" v-for="(items,index) in productData.time" :key="items.value" :class="[index ===clickNum.time ? 'filter-click':'' ]" @click="(timeScope=items.timeV,clickNum.time=index,productData.timevalue='')">{{items.name}}</div>
                   </div>
                 </div>
                 <div class="filtratebox-phase">
-                  <span class="filtratebox-phase-title subclass">精准选择:</span>
+                    <span class="filtratebox-phase-title subclass">{{$t(`product.accurateSelect`)}}:</span>
                   <div class="filtratebox-phase-content precise">
                     <div v-if="clickNum.district ===1" class="schoolclass">
-                      <el-cascader v-model="optionsValue" :options="options" :props="areaProps" clearable   placeholder="请选择要统计的城市或区"/>
+                      <el-cascader v-model="optionsValue" :options="options" :props="areaProps" clearable :placeholder="$t(`product.selectStaCityOrArea`)"/>
                     </div>
                     <div v-else-if="clickNum.district ===0" class="aresclass">
-                      <el-select v-model="optionsValue" placeholder="请选择要统计的省份" clearable>
+                      <el-select v-model="optionsValue" :placeholder="$t(`product.selectStaProvince`)" clearable>
                         <el-option v-for="item in options" :key="item.code" :label="item.name" :value="item.name" />
                       </el-select>
                     </div>
                     <div v-else-if="clickNum.district ===2" class="aresclass">
-                      <el-select v-model="optionsValue" multiple placeholder="请选择要统计的学区" clearable>
+                      <el-select v-model="optionsValue" multiple :placeholder="$t(`product.selectStaArea`)" clearable>
                         <el-option v-for="item in options" :key="item.code" :label="item.name" :value="item.id" />
                       </el-select>
                     </div>
                     <div class="timeselect-box">
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-if="timeScope ==='daterange'" @change="timeChange"  :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Day'" @change="timeChange" :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Week'" @change="timeChange" :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="monthrange" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Month'" @change="timeChange"  :disabled-date="monthOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="year" placeholder="请选择 某一年 来进行数据统计" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Year'" @change="timeChange" />
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-if="timeScope ==='daterange'" @change="timeChange"  :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Day'" @change="timeChange" :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Week'" @change="timeChange" :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="monthrange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startMonth`)" :end-placeholder="$t(`product.endMonth`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Month'" @change="timeChange"  :disabled-date="monthOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="year" :placeholder="$t(`product.selectOneYear`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Year'" @change="timeChange" />
                     </div>
                   </div>
                 </div>
@@ -127,14 +127,14 @@
                   </div>
                 </div>
                 <div class="filtratebox-phase">
-                  <span class="filtratebox-phase-title subclass">精准选择:</span>
+                  <span class="filtratebox-phase-title subclass">{{$t(`product.accurateSelect`)}}:</span>
                   <div class="filtratebox-phase-content precise">
                     <div>
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-if="timeScope ==='daterange'" @change="timeChange" :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Day'" @change="timeChange" :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="截止时间" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Week'" @change="timeChange" :disabled-date="pickerOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="monthrange" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Month'" @change="timeChange" :disabled-date="monthOptions"/>
-                      <el-date-picker v-model="productData.timevalue" type="year" placeholder="请选择 某一年 来进行数据统计" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Year'" @change="timeChange" />
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-if="timeScope ==='daterange'" @change="timeChange" :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Day'" @change="timeChange" :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="daterange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startTime`)" :end-placeholder="$t(`product.endTime`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Week'" @change="timeChange" :disabled-date="pickerOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="monthrange" :range-separator="$t(`product.to`)" :start-placeholder="$t(`product.startMonth`)" :end-placeholder="$t(`product.endMonth`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Month'" @change="timeChange" :disabled-date="monthOptions"/>
+                      <el-date-picker v-model="productData.timevalue" type="year" :placeholder="$t(`product.selectOneYear`)" value-format="YYYY-MM-DD" v-else-if="timeScope ==='Year'" @change="timeChange" />
                     </div>
                   </div>
                 </div>
@@ -143,7 +143,7 @@
             </div>
             <!--确认搜索BTN-->
             <div class="search-btn">
-              <el-button type="primary" :icon="Search" @click="searchData()">搜索</el-button>
+              <el-button type="primary" :icon="Search" @click="searchData()">{{$t(`product.search`)}}</el-button>
             </div>
             <!--确认搜索BTN end-->
           </div>
@@ -158,15 +158,15 @@
           </div>
         </div>
         <div class="middlebox-right">
-          <div class="middlebox-right-title">共有<span class="middlebox-right-num">{{filterdata.length}}</span>条数据</div>
+          <div class="middlebox-right-title">{{$t(`product.thereAre`)}}<span class="middlebox-right-num">{{filterdata.length}}</span>{{$t(`product.records`)}}</div>
           <div class="exportbtn">
-            <el-button type="success" plain @click="exportstate=true">导出数据到Excel</el-button>
+            <el-button type="success" plain @click="exportstate=true">{{$t(`product.exportDataTo`)}}Excel</el-button>
             <!-- <el-button type="success" plain disabled>导出数据到Execl</el-button> -->
           </div>
         </div>
       </div>
     </div>
-    <div class="data-tables" v-loading="searchLoading" v-if="showState==='default'"  element-loading-text="正在准备数据中...">
+    <div class="data-tables" v-loading="searchLoading" v-if="showState==='default'" :element-loading-text="$t(`product.prepareData`)+'...'">
       <el-auto-resizer>
         <template #default="{ height, width }">
           <el-table-v2 v-model:sort-state="sortState" :columns="columns" :data="filterdata" :width="width" :height="height" @column-sort="onSort" fixed  :row-class="rowClassName" />
@@ -174,10 +174,10 @@
       </el-auto-resizer>
     </div>
     <div class="addschool-dialog">
-      <el-dialog v-model="adddialog" title="学校搜索" width="50%" :close-on-click-modal="false">
+      <el-dialog v-model="adddialog" :title="$t(`product.searchSchool`)" width="50%" :close-on-click-modal="false">
         <div class="addschool-box">
           <div>
-            <el-input v-model="addvalue" placeholder="搜索学校 名称/简码 " class="input-with-select">
+            <el-input v-model="addvalue" :placeholder="$t(`product.searchSchoolBy`) + ' ' + $t(`product.name`) + '/' + $t(`product.simpleCode`)" class="input-with-select">
               <template #append>
                 <el-button :icon="Search" />
               </template>
@@ -186,8 +186,8 @@
           <div class="school-list">
             <!-- <div class="notsearch-box" v-if="!tableData.length =="><img src="@/assets/img/notsearch.png" /></div> -->
             <div class="search-result">
-              <p>搜索结果:</p>
-              <div class="result-box" v-loading="filterloding" element-loading-text="加载中...">
+              <p>{{$t(`product.searchResult`)}}:</p>
+              <div class="result-box" v-loading="filterloding" :element-loading-text="$t(`product.loading`)+'...'">
                 <!-- <p><span>学校名称:</span><span class="result-text">{{addschool.name}}</span></p>
                 <p><span>学校简码:</span><span class="result-text">{{addschool.id}}</span></p>
                 <p><span>学校地址:</span><span class="result-text">{{addschool.region}}{{addschool.province}}{{addschool.city}}{{addschool.dist}}</span></p>
@@ -206,24 +206,20 @@
         </div>
         <template #footer>
           <span class="dialog-footer">
-            <el-button @click="adddialog = false">取消</el-button>
-            <el-button type="primary" @click="addschoolfn()" v-if="checkboxArr.length !==0">
-              确认
-            </el-button>
-            <el-button type="info" v-if="checkboxArr.length ===0" disabled>
-              确认
-            </el-button>
+            <el-button @click="adddialog = false">{{$t(`product.cancel`)}}</el-button>
+            <el-button type="primary" @click="addschoolfn()" v-if="checkboxArr.length !==0">{{$t(`product.confirm`)}}</el-button>
+            <el-button type="info" v-if="checkboxArr.length ===0" disabled>{{$t(`product.confirm`)}}</el-button>
           </span>
         </template>
       </el-dialog>
     </div>
   </div>
   <div v-else-if="showState==='details'">
-    <Details @myback="changStateshow" :detailsData="detailsData" :pattern="pattern"></Details>
+    <Details @myback="changStateshow" :detailsData="detailsData" :pattern="pattern" :authDetailsData="authDetailsData"></Details>
   </div>
   <div class="dialog-filter" v-if="exportstate">
-    <el-dialog v-model="exportstate" title="筛选导出" width="35%">
-      <div class="exports-title">导出筛选</div>
+    <el-dialog v-model="exportstate" :title="$t(`product.exportFilter`)" width="35%">
+      <div class="exports-title">{{$t(`product.exportFilter`)}}</div>
       <!-- <el-checkbox-group v-model="checkList">
         <div class="selectbox-ck">
           <div class="check-selectbox-item" v-for="(item,index) in  exportStandard" :key="index">
@@ -256,48 +252,46 @@
       </div>
       <template #footer>
         <span class="dialog-footer">
-          <el-button @click="exportstate = false">取消</el-button>
-          <el-button type="primary" @click="exportExcel(),exportstate = false">
-            确认
-          </el-button>
+          <el-button @click="exportstate = false">{{$t(`product.cancel`)}}</el-button>
+          <el-button type="primary" @click="exportExcel(),exportstate = false">{{$t(`product.confirm`)}}</el-button>
         </span>
       </template>
     </el-dialog>
   </div>
   <div class="dialog-teachlist" v-if="teachtableShow">
-      <el-dialog v-model="teachtableShow" title="教师详细列表" width="55%">
+      <el-dialog v-model="teachtableShow" :title="$t(`product.teacherList`)" width="55%">
       <div class="header-title">
         <div class="header-title-schoolname">{{touchNowteach.name}}</div>
         <div class="header-title-content">
-          <div class="header-title-num">共 <span style="color:#409EFF">{{teachData.length}}</span> 名用户</div>
+            <div class="header-title-num">{{$t(`product.thereAre`)}} <span style="color:#409EFF">{{teachData.length}}</span> {{$t(`product.users`)}}</div>
           <div class="header-title-btn">
-            <el-button size="small" type="primary" v-if="deleteSchoolArr.length >0" @click="seachAllteach"  :icon="Search">个人数据查询</el-button>
-            <el-button size="small" type="info" disabled :icon="Search" v-else>个人数据查询</el-button>
+            <el-button size="small" type="primary" v-if="deleteSchoolArr.length >0" @click="seachAllteach"  :icon="Search">{{$t(`product.personalData`)}}</el-button>
+            <el-button size="small" type="info" disabled :icon="Search" v-else>{{$t(`product.personalData`)}}</el-button>
           </div>
           <div class="header-title-hint" v-show="deleteSchoolArr.length >0">
-            <span>目前支持同时最多10名用户查询</span>
+            <span>{{$t(`product.nowSupportMax`)}}100{{$t(`product.usersForResearch`)}}</span>
           </div>
         </div>
       </div>
       <div class="teachlist-table">
         <el-table ref="multipleTableRef" :data="teachData" style="width: 100%"  height="50vh" @selection-change="selectTeach"  @sort-change="tablesrotChange">
           <el-table-column type="selection" />
-          <el-table-column label="头像" align="center">
+          <el-table-column :label="$t(`product.photo`)" align="center">
             <template #default="scope">
               <el-image style="width: 50px; height: 50px" :src="scope.row.picture" fit="fill" v-if="scope.row.picture"></el-image>
               <PersonalPhoto style="cursor: pointer;" :name="scope.row.name" width="50px" height="50px" v-else></PersonalPhoto>
             </template>
           </el-table-column>  
-          <el-table-column property="name" label="姓名" align="center"/>
+          <el-table-column property="name" :label="$t(`product.userName`)" align="center"/>
           <el-table-column property="id" label="ID" align="center" sortable />
-          <el-table-column property="schoolCode" label="弱归户" align="center" sortable>
+          <el-table-column property="schoolCode" :label="$t(`product.userRegist`)" align="center" sortable>
             <template #default="scope">
-              <div>{{scope.row.schoolCodeW ? scope.row.schoolCodeW:'无'}}</div>
+              <div>{{scope.row.schoolCodeW ? scope.row.schoolCodeW : $t(`product.none`)}}</div>
             </template>
           </el-table-column>
-          <el-table-column property="schoolCodeW" label="归户" align="center" sortable>
+          <el-table-column property="schoolCodeW" :label="$t(`product.weakUserRegist`)" align="center" sortable>
             <template #default="scope">
-              <div>{{scope.row.schoolCode ? scope.row.schoolCode:'无'}}</div>
+              <div>{{scope.row.schoolCode ? scope.row.schoolCode : $t(`product.none`)}}</div>
             </template>
           </el-table-column>
           <el-table-column label="所在地" property="city" align="center" sortable>
@@ -310,7 +304,7 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column property="levels" label="本学期积分"  align="center" sortable>
+          <el-table-column property="levels" :label="$t(`product.thisSemester`)+$t(`product.points`)"  align="center" sortable>
             <!-- <template #default="scope">
             <div>{{scope.row.points && scope.row.points.level ? scope.row.points.level:0}}</div>
             </template> -->
@@ -319,7 +313,7 @@
       </div>
       <template #footer>
         <span class="dialog-footer">
-          <el-button @click="teachtableShow = false">关闭</el-button>
+          <el-button @click="teachtableShow = false">{{$t(`product.close`)}}</el-button>
         </span>
       </template>  
     </el-dialog>
@@ -328,7 +322,7 @@
 <script setup>
 import option_cn from '@/static/regions/region_cn.json'
 import option_gl from '@/static/regions/region_gl.json'
-import { ref, getCurrentInstance, watch, h, nextTick } from 'vue'
+import { ref, getCurrentInstance, watch, h, nextTick, reactive } from 'vue'
 import { ElMessage, TableV2SortOrder, ElLoading, ElCheckbox,HeaderCellSlotProps,ElPopover,Column, RowClassNameGetter} from 'element-plus'
 import { Filter } from '@element-plus/icons'
 import { multipleSheetExport } from '@/until/multipleSheetExport'
@@ -346,12 +340,13 @@ let showState = ref('default')
 let findValue = ref()
 let test = ref([])
 let searchLoading=ref(false)
+let sortValue = reactive({});
 
 let columns = ref([
   {
     key: "name",
     dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "名称",//显示在单元格表头的文本
+    title: proxy.$t(`product.name`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     fixed: false,//是否固定列
     // sortable: true,
@@ -360,7 +355,7 @@ let columns = ref([
   {
     key: "date",
     dataKey: "date",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "時間",//显示在单元格表头的文本
+    title: proxy.$t(`product.time`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     fixed: false,//是否固定列
      sortable: true,
@@ -369,14 +364,14 @@ let columns = ref([
   {
     key: "schoolId",
     dataKey: "schoolId",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "简码",//显示在单元格表头的文本
+    title: proxy.$t(`product.simpleCode`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     headerClass: 'general',
   },
   {
     key: "deviceCnt",
     dataKey: "deviceCnt",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "教室数",//显示在单元格表头的文本
+    title: proxy.$t(`product.classroomNumber`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     headerClass: 'general',
     sortable:true
@@ -384,7 +379,7 @@ let columns = ref([
   {
     key: "tmidCnt",
     dataKey: "tmidCnt",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "教师数",//显示在单元格表头的文本
+    title: proxy.$t(`product.teacherNumber`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     headerClass: 'general',
     sortable:true
@@ -392,7 +387,7 @@ let columns = ref([
   {
     key: "stuShow",
     dataKey: "stuShow",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "学生人数",//显示在单元格表头的文本
+    title: proxy.$t(`product.studentNumber`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     headerClass: 'general',
     sortable:true
@@ -400,7 +395,7 @@ let columns = ref([
   {
     key: "lessonRecord",
     dataKey: "lessonRecord",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "课堂总数",//显示在单元格表头的文本
+    title: proxy.$t(`product.lessonNumber`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     headerClass: 'general',
     sortable:true
@@ -408,7 +403,7 @@ let columns = ref([
   {
     key: "lessonLengMin",
     dataKey: "lessonLengMin",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "课堂总时数",//显示在单元格表头的文本
+    title: proxy.$t(`product.lessonHours`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     headerClass: 'general',
     sortable:true
@@ -416,7 +411,7 @@ let columns = ref([
   {
     key: "tGreen",
     dataKey: "tGreen",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "T绿灯",//显示在单元格表头的文本
+    title: proxy.$t(`product.tGreen`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     headerClass: 'general',
     sortable:true
@@ -424,7 +419,7 @@ let columns = ref([
   {
     key: "tLesson",
     dataKey: "tLesson",
-    title: "T课堂",//显示在单元格表头的文本
+    title: proxy.$t(`product.tLesson`),//显示在单元格表头的文本
     width: 100,//当前列的宽度,必须设置
     headerClass: 'general',
     sortable:true
@@ -446,20 +441,20 @@ let columns = ref([
     cellRenderer: (data) =>
     (
       <>
-        <el-button type="primary"  onClick={examineAllteach.bind(this,data)}>查看所有教师</el-button>
+        <el-button type="primary" onClick={examineAllteach.bind(this, data)}>{proxy.$t(`product.viewAllTeacher`)}</el-button>
       </>
     )
   },
   {
     key: "handle",
-    title: "操作",
+    title: proxy.$t(`product.operate`),
     width: 150,
     align: "center",
     headerClass: 'btn-class',
     cellRenderer: (data) =>
     (
       <>
-        <el-button type="primary" onClick={changeState.bind(this, data)}>查看</el-button>
+        <el-button type="primary" onClick={changeState.bind(this, data)}>{proxy.$t(`product.view`)}</el-button>
       </>
     )
   },
@@ -467,6 +462,7 @@ let columns = ref([
 const popoverRef = ref()
 const siteValue = window.location.host === 'localhost:5001' ? 'cn' : window.location.host === 'bi.teammodel.cn' ? 'cn' : window.location.host === 'bitest.teammodel.cn' ? 'cn' : 'international'
 const optionsData = siteValue === 'cn' ? option_cn : option_gl
+//const optionsData = option_gl
 columns.value[0].headerCellRenderer = (props = HeaderCellSlotProps) => {
       return (
         <div class="items-center justify-center">
@@ -475,13 +471,13 @@ columns.value[0].headerCellRenderer = (props = HeaderCellSlotProps) => {
             {{
               default: () => (
                 <div class="filter-wrapper">
-                  <p class="filter-title">筛选查看结果:</p>
+                  <p class="filter-title">{proxy.$t(`product.seeFilterResult`)}:</p>
                   <div class="filter-group">
                     <ElCheckbox v-model={filterType.value.totalShow} onChange={filterSchooltype}>
-                      显示所有学校
+                      {proxy.$t(`product.showAllSchool`)}
                     </ElCheckbox>
                     <ElCheckbox v-model={filterType.value.unregistered} onChange={filterSchooltype}>
-                      显示未归区学校
+                      {proxy.$t(`product.showNoAreaSchool`)}
                     </ElCheckbox>
                   </div>
                 </div>
@@ -506,6 +502,7 @@ const sortState = ref({
   'date':TableV2SortOrder.ASC,
 })
 const onSort = ({key,order}) => {
+  sortValue = {key:key,order:order};
   console.log(key,order)
   sortState.value[key] = order
   let field=key;let modes=order;let allData=filterdata.value
@@ -540,7 +537,7 @@ const searchColumns = [
   {
     // key: "name",
     // dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
-    title: "校徽",
+    title: proxy.$t(`product.schoolEmblem`),
     width: 150,
     fixed: false,
     align: 'center',
@@ -555,7 +552,7 @@ const searchColumns = [
   {
     key: "name",
     dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
-    title: "名称",
+    title: proxy.$t(`product.name`),
     width: 200,
     fixed: false,
     headerClass: 'serachclass',
@@ -564,7 +561,7 @@ const searchColumns = [
   {
     // key: "name",
     // dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
-    title: "规模版本",
+    title: proxy.$t(`product.scaleVer`),
     width: 100,
     fixed: false,
     align: 'center',
@@ -581,7 +578,7 @@ const searchColumns = [
   {
     key: "id",
     dataKey: "id",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "学校简码",//显示在单元格表头的文本
+    title: proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`),//显示在单元格表头的文本
     width: 150,//当前列的宽度,必须设置
     align: 'center',
     headerClass: 'serachclass',
@@ -597,7 +594,7 @@ const searchColumns = [
   {
     key: "areaName",
     dataKey: "areaName",
-    title: "所属学区",
+    title: proxy.$t(`product.belongArea`),
     width: 150,
     align: 'center',
     headerClass: 'serachclass',
@@ -606,45 +603,45 @@ const searchColumns = [
 let tableData = ref([])
 let filterdata = ref([])
 let productData = ref({
-  dataType: '结果类型',
+  dataType: proxy.$t(`product.resultType`),
   datainfo: [
-    { name: '累计统计', value: 'aggregate' },
-    { name: '独立统计', value: 'onlyone' }
+    { name: proxy.$t(`product.sumStatistics`), value: 'aggregate' },
+    { name: proxy.$t(`product.soloStatistics`), value: 'onlyone' }
   ],
-  typeName: '产品类型',
+  typeName: proxy.$t(`product.productType`),
   type: [
     { name: 'HiTeach', value: 'HiTeach' },
     { name: 'HiTeachCC', value: 'HiTeachCC' },
     { name: 'HiTA', value: 'HiTA' },
   ],
-  filtrateName: '筛选类型',
+  filtrateName: proxy.$t(`product.filterType`),
   filtrate: [
-    { name: '来源类型', key: 'source' },
-    { name: '地区城市', key: 'areaCity' },
-    { name: '时间选择', key: 'areaCity' },
+    { name: proxy.$t(`product.sourceType`), key: 'source' },
+    { name: proxy.$t(`product.areaCity`), key: 'areaCity' },
+    { name: proxy.$t(`product.timeSelect`), key: 'areaCity' },
   ],
-  sourceName: '目标范围',
+  sourceName: proxy.$t(`product.targetRange`),
   source: [
     // { name: '全部', value: 'sourceAll' },
-    { name: '学校', value: 'school' },
-    { name: '学区', value: 'area' },
+    { name: proxy.$t(`product.school`), value: 'school' },
+    { name: proxy.$t(`product.area`), value: 'area' },
     // { name: '城市', value: 'city' }
   ],
-  districtName: '地区选择',
+  districtName: proxy.$t(`product.districtSelect`),
   district: [
     // { name: '所有', value: 'districtAll' },
-    { name: '省', value: 'province' },
-    { name: '城市', value: 'city' },
-    { name: '学区', value: 'area' },
+    { name: proxy.$t(`product.province`), value: 'province' },
+    { name: proxy.$t(`product.city`), value: 'city' },
+    { name: proxy.$t(`product.area`), value: 'area' },
   ],
-  timeName: '时间选择',
+  timeName: proxy.$t(`product.timeSelect`),
   timevalue: '',
   time: [
     // { name: '全部', value: 'timeAll', timeV: 'daterange' },
-    { name: '天', value: 'day', timeV: 'Day' ,state:true},
+    { name: proxy.$t(`product.day`), value: 'day', timeV: 'Day' ,state:true},
     // { name: '周', value: 'week', timeV: 'Week',state:false },
-    { name: '月', value: 'month', timeV: 'Month',state:true },
-    { name: '年', value: 'year', timeV: 'Year' ,state:true}
+    { name: proxy.$t(`product.month`), value: 'month', timeV: 'Month',state:true },
+    { name: proxy.$t(`product.year`), value: 'year', timeV: 'Year' ,state:true}
   ]
 })
 let clickNum = ref({
@@ -712,25 +709,26 @@ let dataForm = ref({
 })
 let checkList = ref([])
 let exportList = ref([
-  { label: '学校名称', key: 'name' },
-  { label: '学校简码', key: 'schoolId' },
-  { label: '教室数', key: 'deviceCnt' },
-  { label: '教师数', key: 'tmidCnt' },
-  { label: '学生人次', key: 'stuShow' },
-  { label: '学生参与总时数', key: 'stuLessonLengMin' },
-  { label: 'T绿灯', key: 'tGreen' },
-  { label: '课堂总数', key: 'lessonRecord' },
-  { label: '课堂总时数', key: 'lessonLengMin' },
-  { label: '时间', key: 'date' },
+  { label: proxy.$t(`product.school`) + proxy.$t(`product.name`), key: 'name' },
+  { label: proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), key: 'schoolId' },
+  { label: proxy.$t(`product.classroomNumber`), key: 'deviceCnt' },
+  { label: proxy.$t(`product.teacherNumber`), key: 'tmidCnt' },
+  { label: proxy.$t(`product.studentNumberUnique`), key: 'stuShow' },
+  { label: proxy.$t(`product.studentJoinHours`), key: 'stuLessonLengMin' },
+  { label: proxy.$t(`product.tGreen`), key: 'tGreen' },
+  { label: proxy.$t(`product.lessonNumber`), key: 'lessonRecord' },
+  { label: proxy.$t(`product.lessonHours`), key: 'lessonLengMin' },
+  { label: proxy.$t(`product.time`), key: 'date' },
 ])
-let fieldList = ref(['学校名称', '学校简码', '教室数', '教师数', '学生人次', '学生参与总时数', 'T绿灯', '课堂总数', '课堂总时数', '时间'])
+let fieldList = ref([proxy.$t(`product.school`) + proxy.$t(`product.name`), proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), proxy.$t(`product.classroomNumber`), proxy.$t(`product.teacherNumber`), proxy.$t(`product.studentNumberUnique`), proxy.$t(`product.studentJoinHours`), proxy.$t(`product.tGreen`), proxy.$t(`product.lessonNumber`), proxy.$t(`product.lessonHours`), proxy.$t(`product.time`)])
 let exportStandard = ref([
-  { title: '参与人次', value: 0, key: 'personnum', option: [{ name: '小于50', value: '50' }, { name: '大于50,小于100', value: '50-100' }, { name: '大于100', value: '101' }, { name: '大于300', value: '301' }] },
-  { title: '授课时间', value: 0, key: 'classtime', option: [{ name: '小于等于45分钟', value: '45' }, { name: '大于45分钟,小于90分钟', value: '45-90' }, { name: '小于90分钟', value: '91' }] },
-  { title: 'T指标数', value: 0, key: 'Tnum', option: [{ name: '无绿灯', value: '0' }, { name: '单绿灯', value: '1' }, { name: '双绿灯', value: '2' }] },
-  { title: '授权类型', value: 0, key: 'powertype', option: [{ name: '全部', value: 'all' }, { name: '试用', value: 'test' }, { name: '已授权', value: 'power' }] },
+  { title: proxy.$t(`product.joinNumberUnique`), value: 0, key: 'personnum', option: [{ name: proxy.$t(`product.smaller`) + '50', value: '50' }, { name: proxy.$t(`product.bigger`) + '50,' + proxy.$t(`product.smaller`) + '100', value: '50-100' }, { name: proxy.$t(`product.bigger`) + '100', value: '101' }, { name: proxy.$t(`product.bigger`) + '300', value: '301' }] },
+  { title: proxy.$t(`product.lessonTime`), value: 0, key: 'classtime', option: [{ name: proxy.$t(`product.smaller`) + proxy.$t(`product.equal`) + '45' + proxy.$t(`product.minute`), value: '45' }, { name: proxy.$t(`product.bigger`) + '45' + proxy.$t(`product.minute`) + ',' + proxy.$t(`product.smaller`) + '90' + proxy.$t(`product.minute`), value: '45-90' }, { name: proxy.$t(`product.smaller`) + '90' + proxy.$t(`product.minute`), value: '91' }] },
+  { title: proxy.$t(`product.tIndicator`), value: 0, key: 'Tnum', option: [{ name: proxy.$t(`product.tGreenZero`), value: '0' }, { name: proxy.$t(`product.tGreenOne`), value: '1' }, { name: proxy.$t(`product.tGreenTwo`), value: '2' }] },
+  { title: proxy.$t(`product.authType`), value: 0, key: 'powertype', option: [{ name: proxy.$t(`product.all`), value: 'all' }, { name: proxy.$t(`product.testUse`), value: 'test' }, { name: proxy.$t(`product.authorized`), value: 'power' }] },
 ])
 let detailsData = ref()
+let authDetailsData = ref()
 let pattern=ref({
    state:'school',
    data:''
@@ -769,31 +767,31 @@ let originalTeachdata=ref([])
 let deleteSchoolArr=ref([])
 let touchNowteach=ref()
 const pickerOptions=function disabledDate(time) {
-          return time.getTime() > Date.now();
+    return time.getTime() > Date.now();
 }
 const monthOptions=function disabledDate(time){
-   // 获取当前的月份信息
-              const date = new Date(); 
-                const year = date.getFullYear(); 
-                let month = date.getMonth() + 1; 
-                if (month >= 1 && month <= 9) {
-                  month = "0" + month;
-                }
-                const nowDate = year.toString() + month.toString(); 
-                // 获取时间选择器的月份信息
-                const timeyear = time.getFullYear(); // 获取时间选择器的年份(有很多)
-                let timemonth = time.getMonth(); // 与上面同理
-                if (timemonth >= 1 && timemonth <= 9) {
-                  timemonth = "0" + timemonth;
-                }
-                const elTimeData = timeyear.toString() + timemonth.toString();
-                return elTimeData >= nowDate; 
+    // 获取当前的月份信息
+    const date = new Date(); 
+    const year = date.getFullYear(); 
+    let month = date.getMonth() + 1; 
+    if (month >= 1 && month <= 9) {
+        month = "0" + month;
+    }
+    const nowDate = year.toString() + month.toString(); 
+    // 获取时间选择器的月份信息
+    const timeyear = time.getFullYear(); // 获取时间选择器的年份(有很多)
+    let timemonth = time.getMonth(); // 与上面同理
+    if (timemonth >= 1 && timemonth <= 9) {
+        timemonth = "0" + timemonth;
+    }
+    const elTimeData = timeyear.toString() + timemonth.toString();
+    return elTimeData >= nowDate; 
 }
 function rowClassName({rowIndex}) {  
-      if (filterdata.value[rowIndex].geoInfo) {
+    if (filterdata.value[rowIndex].geoInfo) {
         return 'highlight-row'; // 对第二行应用特定样式
-      }
-      return ''; // 其他行不做特殊处理
+    }
+    return ''; // 其他行不做特殊处理
     }
 function changeState (value) {
   console.log(value)
@@ -802,6 +800,7 @@ function changeState (value) {
   pattern.value.state=clickNum.value.subject === 0 ? 'school':clickNum.value.subject === 1 ? 'area':''
   clickNum.value.subject === 1 ? pattern.value.data=primevalData.value:''
   detailsData.value = value.rowData
+  //debugger
 }
 function changStateshow (value) {
   console.log(value, '状态改变')
@@ -839,18 +838,18 @@ function dataInit () {
       filterloding.value = false
       initLoading.value=false
     }).catch((err) => {
-      ElMessage.error('API异常,基础数据获取异常')
+      ElMessage.error(proxy.$t(`product.apiErrpr`) + ',' + proxy.$t(`product.basicDataError`))
       filterloding.value = false
       initLoading.value=false
     })
   }).catch((err) => {
-    ElMessage.error('API异常,基础数据获取异常')
+    ElMessage.error(proxy.$t(`product.apiErrpr`) + ',' + proxy.$t(`product.basicDataError`))
   })
 }
 function serachToresult(startTime, endTime, product, schools, unit) {
   // let data = { "dateFrom": "2023-04-12", "dateTo": "2023-04-19", "prod": "HiTeach", "schoolIds": ["tbslgb", "habook"], "dateUnit": "Day" }
   if (!startTime || !endTime) {
-    ElMessage.info('请选择时间进行数据搜索')
+    ElMessage.info(proxy.$t(`product.timeRangeSelectError`))
     return
   }
   searchLoading.value = true;
@@ -865,7 +864,7 @@ function serachToresult(startTime, endTime, product, schools, unit) {
       let adds = {
         key: "schoolId",
         dataKey: "schoolId",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-        title: "简码",//显示在单元格表头的文本
+        title: proxy.$t(`product.simpleCode`),//显示在单元格表头的文本
         width: 100,//当前列的宽度,必须设置
         headerClass: 'general',
       }
@@ -874,17 +873,17 @@ function serachToresult(startTime, endTime, product, schools, unit) {
       resultA === -1 ? columns.value.splice(1, 0, adds) : ''
       cellWidth.value = (100 / columns.value.length).toFixed(2)
       if (res.state === 200) {
-        res.data.forEach((item) => { item.name = item.school.name ? item.school.name : '暂无' });
+        res.data.forEach((item) => { item.name = item.school.name ? item.school.name : proxy.$t(`product.noneYet`) });
         res.geo.forEach((item) => {
-
           if (item.school.name || (item.school.name === "")) {
             item.name = item.school.name;
           } else if (item.geoInfo) {
             item.name = item.geoInfo;
-          } else { item.name = '暂无'; }
+          } else {
+            item.name = proxy.$t(`product.noneYet`);
+          }
         });
 
-
         filterdata.value = [...res.geo, ...res.data];
         primevalData.value = [...res.geo, ...res.data];
       }
@@ -1021,9 +1020,10 @@ function serachToresult(startTime, endTime, product, schools, unit) {
         item.name = item.geoInfo;
       }
     })
-    searchLoading.value = false;
+    authDetailsData.value = res.auth;
+    searchLoading.value = false;    
   }).catch((err) => {
-    ElMessage.error('API异常,数据获取失败')
+    ElMessage.error(proxy.$t(`product.apiErrpr`) + ',' + proxy.$t(`product.getDataError`))
   })
 }
 function timeChange (value) {
@@ -1110,7 +1110,7 @@ async function filterDistrict (state, valueArr) {
     console.log(res, 'filerBack')
     res.state === 200 && res.data.length !== 0 ? res.data.forEach((item) => { schoolList.push(item.id) }) : ''
   }).catch((err) => {
-    ElMessage.error('API异常,省市区数据获取异常')
+    ElMessage.error(proxy.$t(`product.apiErrpr`) + ',' + proxy.$t(`product.getRegionDataError`))
   })
   return schoolList
 }
@@ -1191,7 +1191,7 @@ function searchInit () {
 function addschoolfn () {
   let resultA = options.value.findIndex(item => item.id === 'notarea')
   console.log(resultA, '值')
-  resultA === -1 ? options.value.push({ id: 'notarea', name: '*手动添加学校*', province: '', city: '', children: [] }) : ''
+  resultA === -1 ? options.value.push({ id: 'notarea', name: '*' + proxy.$t(`product.addSchoolManually`) + '*', province: '', city: '', children: [] }) : ''
   console.log(checkboxArr.value, '选择的学校')
   let checkList = checkboxArr.value
   console.log(checkList, 'checkList')
@@ -1260,35 +1260,35 @@ function exportExcel () {
   //普通
   let headerArr = []; let keyArr = []
   //装置数据
-  let deviceArr = ['学校名称', '学校简码', '硬体装置', '无机器授权', '安装机器授权']; let deviceKey = ['name', 'schoolId', 'disposeDevice', 'deviceNoAuth', 'deviceAuth'];
+  let deviceArr = [proxy.$t(`product.school`) + proxy.$t(`product.name`), proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), proxy.$t(`product.device`), proxy.$t(`product.noDeviceAuth`), proxy.$t(`product.hasDeviceAuth`)]; let deviceKey = ['name', 'schoolId', 'disposeDevice', 'deviceNoAuth', 'deviceAuth'];
   //ID数据
-  let IDArr = ['学校名称', '学校简码', '教师ID']; let IDKey = ['name', 'schoolId', 'disposeId']
+    let IDArr = [proxy.$t(`product.school`) + proxy.$t(`product.name`), proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), proxy.$t(`product.teacher`)+'ID']; let IDKey = ['name', 'schoolId', 'disposeId']
   //处理普通
   let superaddition = [
-    { label: '任务数', key: 'mission' },
-    { label: '作品数', key: 'missionFin' },
-    { label: '题目数', key: 'item' },
-    { label: '互动数', key: 'interact' },
-    { label: '设备数量', key: 'deviceCnt' },
-    { label: '无授权设备', key: 'deviceNoAuth' },
-    { label: '授权设备', key: 'deviceAuth' },
-    { label: '928授权', key: 'lessonCnt928' },
-    { label: 'ID授权', key: 'lessonCntId' },
-    { label: '设备授权', key: 'lessonCntDevice' },
-    { label: '综合授权', key: 'lessonCntIdDevice' },
-    { label: '使用IES课程', key: 'useIES' },
-    { label: '使用webIrs', key: 'useWebIrs' },
-    { label: '使用IRS', key: 'useDeviceIrs' },
-    { label: '使用HiTA', key: 'useHita' },
-    { label: '使用HaBoard', key: 'useHaboard' },
-    { label: '使用IES5资源', key: 'useIES5Resource' },
-    { label: '合作型态', key: 'lTypeCoop' },
-    { label: '互动型态', key: 'lTypeIact' },
-    { label: '任务型态', key: 'lTypeMis' },
-    { label: '差异化型态', key: 'lTypeDif' },
-    { label: '测验型态', key: 'lTypeTst' },
-    { label: '无型态', key: 'lTypeNone' },
-    { label: '未上课', key: 'lTypeNone' },
+    { label: proxy.$t(`product.missionNumber`), key: 'mission' },
+    { label: proxy.$t(`product.workNumber`), key: 'missionFin' },
+    { label: proxy.$t(`product.itemNumber`), key: 'item' },
+    { label: proxy.$t(`product.interactionNumber`), key: 'interact' },
+    { label: proxy.$t(`product.equip`) + proxy.$t(`product.number`), key: 'deviceCnt' },
+    { label: proxy.$t(`product.noAuth`) + proxy.$t(`product.authed`), key: 'deviceNoAuth' },
+    { label: proxy.$t(`product.authed`) + proxy.$t(`product.equip`), key: 'deviceAuth' },
+    { label: '928' + proxy.$t(`product.authed`), key: 'lessonCnt928' },
+    { label: 'ID' + proxy.$t(`product.authed`), key: 'lessonCntId' },
+    { label: proxy.$t(`product.equip`) + proxy.$t(`product.authed`), key: 'lessonCntDevice' },
+    { label: proxy.$t(`product.comprehensive`) + proxy.$t(`product.authed`), key: 'lessonCntIdDevice' },
+    { label: proxy.$t(`product.use`) + 'IES' + proxy.$t(`product.lesson`), key: 'useIES' },
+    { label: proxy.$t(`product.use`) + 'webIrs', key: 'useWebIrs' },
+    { label: proxy.$t(`product.use`) + 'IRS', key: 'useDeviceIrs' },
+    { label: proxy.$t(`product.use`) + 'HiTA', key: 'useHita' },
+    { label: proxy.$t(`product.use`) + 'HaBoard', key: 'useHaboard' },
+    { label: proxy.$t(`product.use`) + 'IES5' + proxy.$t(`product.resource`), key: 'useIES5Resource' },
+    { label: proxy.$t(`product.cooperate`) + proxy.$t(`product.type`), key: 'lTypeCoop' },
+    { label: proxy.$t(`product.interaction`) + proxy.$t(`product.type`), key: 'lTypeIact' },
+    { label: proxy.$t(`product.mission`) + proxy.$t(`product.type`), key: 'lTypeMis' },
+    { label: proxy.$t(`product.difference`) + proxy.$t(`product.type`), key: 'lTypeDif' },
+    { label: proxy.$t(`product.exam`) + proxy.$t(`product.type`), key: 'lTypeTst' },
+    { label: proxy.$t(`product.teachMaterial`), key: 'lTypeNone' },
+    { label: proxy.$t(`product.whiteBoardApp`), key: 'lessonLeng0' },
   ]
   fieldList.value.forEach((item) => {
     exportList.value.forEach((items) => {
@@ -1401,23 +1401,23 @@ function multipleExports (header, key) {
       // 表一的整体json数据
       tableDatas: disposeArr,
       // 表一的sheet名字
-      sheetName: '产品使用分析全览'
+      sheetName: proxy.$t(`product.productAnalysisOverview`)
     },
     {
       tHeader: header.deviceH,
       filterVal: key.deviceK,
       tableDatas: deviceList,
-      sheetName: '装置数据'
+      sheetName: proxy.$t(`product.deviceData`)
     },
     {
       tHeader: header.IDheader,
       filterVal: key.IDkey,
       tableDatas: derivetmdList,
-      sheetName: 'ID列表'
+      sheetName: 'ID'+proxy.$t(`product.listTable`)
     }
   ]
   console.log(excelDatas,'导出内容')
-  multipleSheetExport(excelDatas, '产品使用分析表', true, 'xlsx')
+  multipleSheetExport(excelDatas, proxy.$t(`product.productAnalysisTable`), true, 'xlsx')
 }
 //拆分数组
 function arrayChunk(array,size){
@@ -1548,10 +1548,16 @@ function filterSchooltype(){
   let result=[]  
   console.log(primevalData.value,'原始值')
   console.log(filterValue,'状态值')
+  
   filterValue.totalShow ? result=primevalData.value:result=dataArr.filter((item)=>{return item.schoolId !=="allschool"})
-  filterValue.unregistered ? result=result:result=result.filter((item)=>{return item.school.areaId !== null})
+  filterValue.unregistered ? result=result:result=result.filter((item)=>{return item.schoolId !== "noschoolid"}) 
+  
   console.log(result,'赋值')
-  filterdata.value=result
+  filterdata.value=result;
+  //debugger
+  if(sortValue.key){
+    onSort(sortValue);  
+  }  
 }
 //获取查看所有老师BTN
 function examineAllteach(value){
@@ -1579,8 +1585,8 @@ function selectTeach (value) {
     console.log(deleteSchoolArr.value,'6666')
 }
 function seachAllteach(){
-  if(deleteSchoolArr.value.length >10){
-      ElMessage.info('当前查询人数仅支持小于或等于10名用户')
+  if(deleteSchoolArr.value.length >100){
+      ElMessage.info(proxy.$t(`product.message1_1`) + '100' + proxy.$t(`product.message1_2`))
       return
   }
   console.log(deleteSchoolArr.value,'传递出去的参数')

+ 85 - 13
TEAMModelBI/ClientApp/src/view/schoolmanage/schoolAnalyse.vue

@@ -215,10 +215,30 @@
       </div>
     </div>
     <div class="schoolList-all">
-      <div class="school-list-title">学校列表:</div>
+      <div class="school-list-title">学校列表:</div>    
       <div class="school-search">
+        <el-select  v-model="selectCity" placeholder="篩選城市" style="width: 240px;margin-bottom: 10px;display: flex;" @change="personnelSearch">
+         <el-option
+           v-for="item in schoolCitys"
+           :key="item.city"
+           :label="item.city"
+           :value="item.city"
+         />                 
+       </el-select>                             
         <el-input v-model="searchText.values" placeholder="搜索 学校名称/学校简码" class="input-with-select" size="small" clearable />
       </div>
+      <!-- <div >        
+        <el-select  v-model="selectCity" placeholder="篩選城市" style="width: 240px" @change="personnelSearch">
+         <el-option
+           v-for="item in schoolCitys"
+           :key="item.city"
+           :label="item.city"
+           :value="item.city"
+         />                 
+       </el-select>            
+      </div> -->
+      
+      
       <div class="school-tables" style="width: 100%; height: 60vh" v-loading="searchText.loading" element-loading-background="rgba(0, 0, 0, 0.5)">
         <!-- <el-table :data="schoolDefault" height="55vh" style="width: 100%" v-loading="searchText.loading" element-loading-background="rgba(0, 0, 0, 0.5)" empty-text="暂无数据">
           <el-table-column label="校徽" align="center">
@@ -373,7 +393,7 @@
     </div>
   </div>
 </template>
-<script>
+<script >
 import { ref, reactive, onMounted, getCurrentInstance, watch } from 'vue'
 import Bar from '@/components/echarts/commonBar.vue'
 import CommonLine from '@/components/echarts/commonLine.vue'
@@ -383,9 +403,12 @@ import Gradepie from '@/components/echarts/gradePie.vue'
 import ConventionPie from '@/components/echarts/conventionPie.vue'
 import { useRouter } from 'vue-router'
 import { useStore } from 'vuex'
-import { ElMessage, ElLoading } from 'element-plus'
+import { ElMessage, TableV2SortOrder, ElLoading, ElCheckbox,HeaderCellSlotProps,ElPopover,Column, RowClassNameGetter} from 'element-plus'
+import { Filter } from '@element-plus/icons'
+import { Search, CirclePlus } from '@element-plus/icons-vue'
 import jwt_decode from 'jwt-decode'
 import * as echarts from 'echarts'
+import { unique } from 'element-plus/es/utils'
 export default {
   components: {
     Bar,
@@ -396,6 +419,9 @@ export default {
     CommonBar
   },
   setup () {
+    const selectCity = ref('')
+    let schoolCitys = reactive([{city:'篩選城市'}])    
+    //let schoolDefault = ref([])
     let showState = ref('all')
     let router = useRouter()
     let { proxy } = getCurrentInstance()
@@ -445,7 +471,7 @@ export default {
         // key: "name",
         // dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
         title: "校徽",
-        width: 400,
+        width: 300,
         fixed: false,
         align: 'center',
         cellRenderer: (data) => (
@@ -455,11 +481,19 @@ export default {
           </>
         )
       },
+      {
+        key: "city",
+        dataKey: "city",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
+        title: "城市",
+        width: 300,
+        fixed: false,
+        align: 'center',
+      },
       {
         key: "name",
         dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
         title: "名称",
-        width: 400,
+        width: 300,
         fixed: false,
         align: 'center',
       },
@@ -483,12 +517,12 @@ export default {
         key: "schoolId",
         dataKey: "schoolId",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
         title: "学校简码",//显示在单元格表头的文本
-        width: 400,//当前列的宽度,必须设置
+        width: 300,//当前列的宽度,必须设置
         align: 'center',
       },
       {
         title: "",
-        width: 400,
+        width: 300,
         align: "center",
         // fixed: 'right',
         cellRenderer: (data) =>
@@ -1788,6 +1822,35 @@ export default {
           })
           allLoding.value.rankData = false
           schoolDefault.value = res.scInfos
+          
+          let cityarr = [];
+          res.scInfos.forEach((item) =>{
+            let citem = {
+              city:item.city
+            }
+            cityarr.push(citem);
+          })
+          
+           //cityarr = [...new Set(cityarr)];
+           cityarr = [...new Set(cityarr.map(item => item.city))];
+           
+          cityarr.forEach((item) => {
+            if (item !== "" && item !== null && item !== undefined) {
+              let citem = {
+                city: item
+              }
+              schoolCitys.push(citem)
+            }
+          })          
+
+          // //schoolCitys.value = cityarr;
+          // schoolCitys = [
+          //   {city:'111'},
+          //   {city:'222'},
+          //   {city:'333'},
+          // ]
+          
+
           searchText.original = res.scInfos
           searchText.loading = false
           serviceVersion(res.productGroup, res.scInfos)
@@ -1807,7 +1870,7 @@ export default {
       }).catch((error) => {
         ElMessage.error('数据获取API异常')
       })
-    }
+    }    
     function allAspects (val, state, behinddata) {
       console.log(val, state, behinddata)
       //let data = state === 'details' ? { schoolId: val } : { tmdId: val }
@@ -1969,8 +2032,7 @@ export default {
       // })
     }
     function detailsSchool (val) {
-      console.log(val);
-      // debugger;
+      console.log(val);      
       let schoolData = val
       schoolDeatilsInfo(schoolData.schoolId)
       showState.value = 'particular'
@@ -2359,6 +2421,14 @@ export default {
       let newArr = arr.filter((item) => {
         return item.name.includes(searchText.values) || item.id.includes(searchText.values)
       })
+      debugger
+      if (selectCity.value !== "" && selectCity.value !== "篩選城市") {
+        newArr = newArr.filter((item) => {
+          if (item.city !== null && item.city !== undefined && item.city !== "") {
+            return item.city.includes(selectCity.value)
+          }
+        })
+      }      
       schoolDefault.value = newArr
     }
     showInit()
@@ -2367,13 +2437,15 @@ export default {
       newdata.hasOwnProperty('name') ? (showState.value = 'particular', schoolDeatils.value = newdata, schoolDeatilsInfo(newdata.id), isAreaon.value = true) : ''
     }, { immediate: true, deep: true })
     watch(() => searchText.values, (newvalues) => {
-      if (newvalues.trim().length !== 0) {
+      if (newvalues.trim().length !== 0 || selectCity.value !== "篩選城市") {
         debounce(personnelSearch, 500)
-      } else {
+      } else {        
         schoolDefault.value = searchText.original
       }
     })
-    return {
+    return {            
+      schoolCitys,
+      selectCity,
       headerbasics,
       echartsData,
       imgdata,

+ 103 - 90
TEAMModelBI/ClientApp/src/view/userInquire/details.vue

@@ -31,7 +31,7 @@
                 </div>
             </div>
         </div>
-    <div class="userdetails" v-loading="loading" element-loading-text="数据加载中...">
+    <div class="userdetails" v-loading="loading" :element-loading-text="$t(`userInquire.details.dataLoading`)+'...'">
         <div class="topbox">
            <div class="img-name">
             <div class="topbox-images">
@@ -39,8 +39,8 @@
                 <el-image :src="randomImage" fit="contain" v-else/>
             </div>
             <div class="topbox-name">
-                <div class="topbox-name-text">{{usernames ? usernames :'暂无姓名'}} </div>
-                <div class="topbox-name-advance" @click="userdetailState=true">查看账户进阶数据<el-icon><MoreFilled /></el-icon></div>
+                <div class="topbox-name-text">{{usernames ? usernames : $t(`userInquire.details.noName`)}} </div>
+                <div class="topbox-name-advance" @click="userdetailState=true">{{$t(`userInquire.details.seeUserDetailData`)}}<el-icon><MoreFilled /></el-icon></div>
             </div>
            </div>
            <div class="information">
@@ -63,7 +63,7 @@
         <div class="product-list">
             <div class="product-title">
                 <el-button type="primary" size="small" @click="loginDialog=true">
-                    查看完整登入情况
+                    {{$t(`userInquire.details.seeLoginData`)}}
                     <el-icon class="el-icon--right"><Right /></el-icon>
                 </el-button>
             </div>
@@ -72,10 +72,10 @@
                     <p class="item-title">{{item.title}}</p>
                     <div class="item-content" v-show="item.state">
                         <div class="content-left">
-                            <span>上次登陆时间:{{item.valueText}}</span>
+                            <span>{{$t(`userInquire.details.lastLoginTime`)}}:{{item.valueText}}</span>
                         </div>
                     </div>
-                    <div class="notenabled-title" v-show="!item.state">近期未使用</div>
+                    <div class="notenabled-title" v-show="!item.state">{{$t(`userInquire.details.noUseRecently`)}}</div>
                 </div>
             </div>
         </div>
@@ -107,7 +107,7 @@
                 </div>
                 <el-divider />
                 <replaceHiTeach :detailsData="detailsIot" v-if="iotState"></replaceHiTeach>
-                <div v-else class="not-coupons">暂无数据</div>
+                <div v-else class="not-coupons">{{$t(`userInquire.details.noData`)}}</div>
             </div>
             <!-- <div class="hitadiv">
                 <div  class="common-header-title">
@@ -118,7 +118,7 @@
             </div> -->
             <div class="user-size">
                 <div  class="common-header-title">
-                    <div>空间与权益</div>
+                    <div>{{$t(`userInquire.details.spaceAndRights`)}}</div>
                     <!-- <div class="expire">到期日:XXXXX</div> -->
                 </div>
                 <el-divider /> 
@@ -234,17 +234,17 @@
                                         </div>
                                         <div class="rightsbox-item-time">
                                             <p>
-                                                <span>时间:</span>
+                                                <span>{{$t(`userInquire.details.time`)}}:</span>
                                                 <span class="rightsbox-item-time-num">{{item.startDateText}}~{{item.endDateText}}</span>
-                                                <span>共<span class="rightsbox-item-timenums">{{item.intervalTime}}</span>天</span>
+                                                <span>{{$t(`userInquire.details.total`)}}<span class="rightsbox-item-timenums">{{item.intervalTime}}</span>{{$t(`userInquire.details.day`)}}</span>
                                             </p>
                                             <p  v-if=" item.aprule &&item.aprule.hasOwnProperty('schoolinfo') ">
-                                                <span>学校:</span>
+                                                <span>{{$t(`userInquire.details.school`)}}:</span>
                                                 <span class="rightsbox-item-timenums">{{item.aprule.schoolinfo.name}}</span>
                                             </p>
                                         </div>
                                         <div class="rightsbox-item-expansion" v-show="item.prodCode ==='Z6ELB6EZ'">
-                                            <p class="expansion-title">产品扩充项</p>
+                                            <p class="expansion-title">{{$t(`userInquire.details.apRule`)}}</p>
                                             <!--产品扩充-->
                                             <div v-for="iteml in item.apruleArr" :key="iteml.key">
                                                 -<span :class="[iteml.state ? 'start-title':'error-title' ]">
@@ -255,29 +255,29 @@
                                             <!--产品扩充 end-->
                                         </div>
                                         <div class="rightsbox-item-expansion" v-show="item.prodCode ==='IPALB6EY'">
-                                            <p class="expansion-title">产品详细</p>
-                                            <div><span>空间大小:</span> <span class="expansion-sizenum">{{item.number}}   GB</span></div>
+                                            <p class="expansion-title">{{$t(`userInquire.details.productDetail`)}}</p>
+                                            <div><span>{{$t(`userInquire.details.spaceSize`)}}:</span> <span class="expansion-sizenum">{{item.number}}   GB</span></div>
                                         </div>
                                     </div>
                                     <el-divider /> 
                                 </div>
                                 </div>
-                                <div class="power-notdata" v-show =" powerList.length ==0">暂无权益内容</div>
+                                <div class="power-notdata" v-show=" powerList.length ==0">{{$t(`userInquire.details.noRights`)}}</div>
                                    <!--HiTeach 附加功能-->
                                 <div class="subjoin">
                                     <div class="subjoin-item" >
                                         <p class="subjoin-title">{{subjoinData.hiteachTitle}}</p>
                                             <div v-if="subjoinData.hiteach.length >0">
                                                 <div class="subjoin-content" v-for="item in subjoinData.hiteach" :key="item.key">
-                                                <div>
+                                                <div v-if="item.exps > 0 && item.gets > 0">
                                                     <span>{{item.title}}</span>
                                                     <span class="ccnums" v-show="item.key==='webirs'">{{item.value}}</span>
-                                                    <span class="endtimes" v-if="item.exps >= notTime">(到期日:{{item.end}})</span>
-                                                    <span class="endtimes-error" v-else>(到期日:{{item.end}})</span>
+                                                    <span class="endtimes" v-if="item.exps >= notTime">({{$t(`userInquire.details.endTime`)}}:{{item.end}})</span>
+                                                    <span class="endtimes-error" v-else>({{$t(`userInquire.details.endTime`)}}:{{item.end}})</span>
                                                 </div>
                                             </div>
                                             </div>
-                                            <div class="not-datas" v-else>暂无数据</div>
+                                            <div class="not-datas" v-else>{{$t(`userInquire.details.noData`)}}</div>
                                             <el-divider /> 
                                             </div>
                                     <div class="subjoin-item" >
@@ -287,11 +287,11 @@
                                                 <div>
                                                     <span>{{itemc.title}}</span>
                                                     <span class="ccnums">{{itemc.num}}</span>
-                                                    <span class="endtimes">(到期日:{{itemc.end}})</span>
+                                                    <span class="endtimes">({{$t(`userInquire.details.endTime`)}}:{{itemc.end}})</span>
                                                  </div>
                                             </div>
                                         </div>
-                                        <div class="not-datas" v-else>暂无数据</div>
+                                        <div class="not-datas" v-else>{{$t(`userInquire.details.noData`)}}</div>
                                     </div>
                                 </div>
                                         <!--HiTeach 附加功能 end-->
@@ -301,8 +301,8 @@
                 </div>
                  <!--权益 end-->
                 <div class="tab-state">
-                    <div :class="[sizeandequity !=='size' ? 'opts':'','tab-state-btn']" @click="sizeandequity='equity'">我的权益</div>
-                    <div :class="[sizeandequity ==='size' ? 'opts':'','tab-state-btn']" @click="sizeandequity='size'">我的空间</div>
+                    <div :class="[sizeandequity !=='size' ? 'opts':'','tab-state-btn']" @click="sizeandequity='equity'">{{$t(`userInquire.details.myRights`)}}</div>
+                    <div :class="[sizeandequity ==='size' ? 'opts':'','tab-state-btn']" @click="sizeandequity='size'">{{$t(`userInquire.details.mySpace`)}}</div>
                 </div>
             </div>
             <div class="iesdiv">
@@ -315,7 +315,7 @@
             </div>
             <div class="socratesdiv">
                 <div  class="common-header-title">
-                    <div>苏格拉底</div>
+                    <div>{{$t(`userInquire.details.sokrate`)}}</div>
                     <!-- <div class="expire">到期日:2023-11-22</div> -->
                 </div>
                 <el-divider />
@@ -330,7 +330,7 @@
             </div> -->
             <div class="ticketdiv">
                 <div  class="common-header-title">
-                    <div>积分与票卷</div>
+                    <div>{{$t(`userInquire.details.pointsAndTickets`)}}</div>
                 </div>
                 <el-divider />
                 <Ticket :pointsandcoupons="pointsData"></Ticket>
@@ -339,37 +339,37 @@
         <!--产品页面end-->
         <!--back-->
         <div class="back-btns">
-            <el-button type="primary" :icon="ArrowLeft" size="small" @click="backClick">返回搜索</el-button>
+            <el-button type="primary" :icon="ArrowLeft" size="small" @click="backClick">{{$t(`userInquire.details.baxkToSearch`)}}</el-button>
         </div>
         <!--back end-->
         <!--所有登入时间dialog-->
         <div class="login-total">
-            <el-dialog v-model="loginDialog" title="所有登入情况" width="70%" :before-close="handleClose">
+            <el-dialog v-model="loginDialog" :title="$t(`userInquire.details.loginLists`)" width="70%" :before-close="handleClose">
                 <div class="logintotal-box">
                     <div class="logintotal-box-list">
                         <div :class="[item.state ? item.key:'notenabled-total','listbox-item-total']" v-for="item in productdata" :key="item.id">
                             <p class="item-title">{{item.title}}</p>
                             <div class="item-content" v-show="item.state">
                                 <div class="content-left">
-                                    <p>上次登陆时间</p>
+                                    <p>{{$t(`userInquire.details.lastLoginTime`)}}</p>
                                     <span>{{item.valueText}}</span>
                                 </div>
                             </div>
-                            <div class="notenabled-title-total" v-show="!item.state">近期未使用</div>
+                            <div class="notenabled-title-total" v-show="!item.state">{{$t(`userInquire.details.noUseRecently`)}}</div>
                         </div>
                     </div>
                     <el-divider />
                     <div class="logintotal-box-table">
-                        <p class="logintotal-box-table-title">登入详细:</p>
+                        <p class="logintotal-box-table-title">{{$t(`userInquire.details.loginDetail`)}}:</p>
                         <el-table :data="logintotalTable" style="width: 100%" height="35vh" border >
-                            <el-table-column prop="nameText" label="平台" align="center"/>
-                            <el-table-column prop="timeText" label="时间" align="center"/>
+                            <el-table-column prop="nameText" :label="$t(`userInquire.details.platform`)" align="center"/>
+                            <el-table-column prop="timeText" :label="$t(`userInquire.details.time`)" align="center"/>
                         </el-table>
                     </div>
                 </div>
                 <template #footer>
                 <span class="dialog-footer">
-                    <el-button @click="loginDialog = false">关闭</el-button>
+                    <el-button @click="loginDialog = false">{{$t(`userInquire.details.close`)}}</el-button>
                 </span>
                 </template>
             </el-dialog>
@@ -419,20 +419,20 @@ let tabPosition = ref('left')
 let sizeandequity=ref('equity')
 let usernames=ref('')
 let userdata = ref([
-    { id: 1, icon: '#icon-ic_idcard', value: '0', title: '',key:'integral',check:false ,hint:'用户ID'},
-    { id: 2, icon: '#icon-shouji', value: '0', title: '',key:'phone',check:true,hint:'手机号码'},
-    { id: 3, icon: '#icon-dibudaohanglan-', value: '', title: '',key:'school',correlation:false,check:true,hint:'学校'},
-    { id: 4, icon: '#icon-youxiang', value: '', title: '', key: 'email', check: true, hint: '邮箱' },
-    { id: 5, icon: '#icon-weizhi', value: '', title: '',key:'local',check:false ,hint:'地区位置'},
-    { id: 6, icon: '#icon-shijian2', value: '0', title: '', key: 'time', check: false ,hint:'上次登录时间' },
+    { id: 1, icon: '#icon-ic_idcard', value: '0', title: '', key: 'integral', check: false, hint: proxy.$t(`userInquire.details.userID`)},
+    { id: 2, icon: '#icon-shouji', value: '0', title: '', key: 'phone', check: true, hint: proxy.$t(`userInquire.details.selfphoneNumber`)}, 
+    { id: 3, icon: '#icon-dibudaohanglan-', value: '', title: '', key: 'school', correlation: false, check: true, hint: proxy.$t(`userInquire.details.school`)},
+    { id: 4, icon: '#icon-youxiang', value: '', title: '', key: 'email', check: true, hint: proxy.$t(`userInquire.details.email`)},
+    { id: 5, icon: '#icon-weizhi', value: '', title: '', key: 'local', check: false, hint: proxy.$t(`userInquire.details.areaLocation`)},
+    { id: 6, icon: '#icon-shijian2', value: '0', title: '', key: 'time', check: false, hint: proxy.$t(`userInquire.details.lastLoginTime`)},
 ])
 let productdata = ref([
     { id: 1, title: 'HiTeach', value:0,valueText:'',key:'HiTeach',state: false },
     { id: 2, title: 'HiTA',value:0,valueText:'',key:'HiTA',state: false },
     { id: 3, title: 'IES', value:0,valueText:'',key:'IES5', state: false },
-    { id: 4, title: '苏格拉底', value:0,valueText:'',key:'Sokrates', state: false },
-    { id: 5, title: '观议課 APP', value:0,valueText:'',key:'SokAPP', state: false },
-    { id: 6, title: '通用账号', value:0,valueText:'',key:'Account', state: false },
+    { id: 4, title: proxy.$t(`aprule.sokrate`), value:0,valueText:'',key:'Sokrates', state: false },
+    { id: 5, title: proxy.$t(`aprule.sokapp`), value:0,valueText:'',key:'SokAPP', state: false },
+    { id: 6, title: proxy.$t(`userInquire.details.commonAccount`), value:0,valueText:'',key:'Account', state: false },
     { id: 7, title: 'HiTeachCC', value:0,valueText:'',key:'HiTeachCC', state: false },
     { id: 8, title: 'WebIRS5', value:0,valueText:'',key:'IRS', state: false },
 ])
@@ -503,7 +503,7 @@ let heatMapdata = ref({
     tooltip: {
         position: 'top',
         formatter: function(params) {
-            return yNames[params.data[1]] + params.name +  "登录总量:" + params.value[2];
+            return yNames[params.data[1]] + params.name + proxy.$t(`userInquire.aprule.loginSum`) + ":" + params.value[2];
         },
     },
     // animation: false,
@@ -538,7 +538,7 @@ let heatMapdata = ref({
     },
     yAxis: {
         type: 'category',
-        data: ["周一", "周二", "周三", "周四", "周五"],
+        data: [proxy.$t(`commonTimeName.monday`), proxy.$t(`commonTimeName.tuesday`), proxy.$t(`commonTimeName.wednesday`), proxy.$t(`commonTimeName.thursday`), proxy.$t(`commonTimeName.friday`)],
         axisLine: {
             show: false
         },
@@ -673,7 +673,7 @@ let gaugedata = ref({
             }
         },
         data: [{
-            name: "已使用总量",
+            name: proxy.$t(`userInquire.details.usedTotalValue`),
             value: 0
         }]
     }]
@@ -685,10 +685,10 @@ let gaugelabels = ref([
     // { id: 4, value: 0, title: '试卷', color:'#58D9F9' },
     // { id: 5, value: 0, title: 'Hiteach上传', color: '#58D9F9' },
     // {id:6,value:0,title:'其他',color:'#58D9F9'},
-     {id:1,value:0,title:'已使用',key:'use',color: '#58D9F9'},
-     {id:2,value:0,title:'已剩余',key:'residue',color: '#58D9F9'},
-     {id:3,value:0,title:'学校分配空间',key:'allocation',color: '#58D9F9'},
-     {id:4,value:0,title:'总大小',key:'total',color: '#58D9F9'},
+    { id: 1, value: 0, title: proxy.$t(`userInquire.details.used`),key:'use',color: '#58D9F9'},
+    { id: 2, value: 0, title: proxy.$t(`userInquire.details.left`),key:'residue',color: '#58D9F9'},
+    { id: 3, value: 0, title: proxy.$t(`userInquire.details.schoolAssignSpace`),key:'allocation',color: '#58D9F9'},
+    { id: 4, value: 0, title: proxy.$t(`userInquire.details.sumValue`),key:'total',color: '#58D9F9'},
 ])
 let rightsdata=ref([
     { name: 'XXXXXX', time: '2024/08/29', code: 'ais' },
@@ -714,44 +714,50 @@ let pointsData=ref(detailsData.value[transferNum.value])
 console.log(props.searchdata, '传输的值')
 console.log(detailsData.value, '最终数据')
 let powerExtension=ref([
-    {title:'USB錄影支援',key:'hdcam',state:false},
-    {title:'蘇格拉底議課APP',key:'sokapp',state:false},
-    {title:'蘇格拉底影片',key:'sokvdo',state:false},
-    {title:'蘇格拉底桌面',key:'sokdesk',state:false},
-    {title:'蘇格拉底報告',key:'sokrpt',state:false},
-    {title:'蘇格拉底小數據',key:'soksdata',state:false},
-    {title:'AI智能終端',key:'ezs',state:false},
-    {title:'AI文句分析',key:'wordanls',state:false},
-    {title:'電子學生證',key:'dgistuid',state:false},
-    {title:'雲端診斷分析系統',key:'cloudas',state:false},
-    {title:'分組數',key:'cligroup',value:0,state:false},
-    {title:'IRS連線授權數',key:'client_volume',value:0,state:false},
-    {title:'議課人數',key:'soknumber',value:0,state:false},
-    {title:'智慧評分系統',key:'scorsys',state:false},
-    {title:'IRS硬體遙控器',key:'irs',state:true},
+    { title: proxy.$t(`aprule.hdcam`),key:'hdcam',state:false},
+    { title: proxy.$t(`aprule.sokapp`),key:'sokapp',state:false},
+    { title: proxy.$t(`aprule.sokvdo`),key:'sokvdo',state:false},
+    { title: proxy.$t(`aprule.sokdesk`),key:'sokdesk',state:false},
+    { title: proxy.$t(`aprule.sokrpt`),key:'sokrpt',state:false},
+    { title: proxy.$t(`aprule.soksdata`),key:'soksdata',state:false},
+    { title: proxy.$t(`aprule.ezs`),key:'ezs',state:false},
+    { title: proxy.$t(`aprule.wordanls`),key:'wordanls',state:false},
+    { title: proxy.$t(`aprule.dgistuid`),key:'dgistuid',state:false},
+    { title: proxy.$t(`aprule.cloudas`),key:'cloudas',state:false},
+    { title: proxy.$t(`aprule.cligroup`),key:'cligroup',value:0,state:false},
+    { title: proxy.$t(`aprule.clientVolume`),key:'client_volume',value:0,state:false},
+    { title: proxy.$t(`aprule.soknumber`),key:'soknumber',value:0,state:false},
+    { title: proxy.$t(`aprule.scorsys`),key:'scorsys',state:false},
+    { title: proxy.$t(`aprule.irs`),key:'irs',state:true},
+    { title: proxy.$t(`aprule.sokvtt`),key:'sokvtt',state:false},
+    { title: proxy.$t(`aprule.cowork`),key:'cowork',state:false},
+    { title: proxy.$t(`aprule.aigpt`),key:'aigpt',state:false},
 ])
 let subjoinData=ref({
-    hiteachTitle:'HiTeach 附加功能',
+    hiteachTitle: 'HiTeach '+proxy.$t(`userInquire.details.extraFunction`), 
     hiteach:[
-        {title:'AI文句分析',key:'aitext',start:0,end:0,value:0,gets:0,exps:0},
-        {title:'AI苏格拉底小数据',key:'soklite',start:0,end:0,value:0,gets:0,exps:0},
-        {title:'智慧评分',key:'smartrating',start:0,end:0,value:0,gets:0,exps:0},
-        {title:'clouDAS诊断分析',key:'cloudas',start:0,end:0,value:0,gets:0,exps:0},
-        {title:'Web IRS连线数',key:'webirs',start:0,end:0,value:0,gets:0,exps:0}
+        { title: proxy.$t(`aprule.wordanls`),key:'aitext',start:0,end:0,value:0,gets:0,exps:0},
+        { title: 'AI'+proxy.$t(`aprule.soksdata`),key:'soklite',start:0,end:0,value:0,gets:0,exps:0},
+        { title: proxy.$t(`aprule.scorsys`),key:'smartrating',start:0,end:0,value:0,gets:0,exps:0},
+        { title: proxy.$t(`aprule.cloudas`),key:'cloudas',start:0,end:0,value:0,gets:0,exps:0},
+        { title: proxy.$t(`aprule.clientVolume`),key:'webirs',start:0,end:0,value:0,gets:0,exps:0},
+        { title: proxy.$t(`aprule.sokvtt`),key:'sokvtt',start:0,end:0,value:0,gets:0,exps:0},
+        { title: proxy.$t(`aprule.cowork`),key:'cowork',start:0,end:0,value:0,gets:0,exps:0},
+        { title: proxy.$t(`aprule.aigpt`),key:'aigpt',start:0,end:0,value:0,gets:0,exps:0},
     ],
-    hiteachCCTitle:'HiTeach CC 权限',
+    hiteachCCTitle: 'HiTeach CC ' + proxy.$t(`userInquire.details.rights`),
     hiteachCC:[
-        {title:'作品收集数',key:'works',start:0,end:0,num:0,gets:0,exps:0},
-        {title:'连线人数',key:'clients',start:0,end:0,num:0,gets:0,exps:0},
+        { title: proxy.$t(`userInquire.details.collectedWorks`),key:'works',start:0,end:0,num:0,gets:0,exps:0},
+        { title: proxy.$t(`userInquire.details.accessNumber`),key:'clients',start:0,end:0,num:0,gets:0,exps:0},
     ]
 })
 let notTime=ref(Math.floor(Date.now() / 1000))
 let powerList=ref([])
 let detailsIot=ref()
 let buttonSelect = ref([
-    { name: '天', value:'day', click: false,disabled:false},
-    { name: '月', value:'month', click: false,disabled:false},
-    {name:'年',value:'year',click:false,disabled:false}
+    { name: proxy.$t(`commonTimeName.day`), value:'day', click: false,disabled:false},
+    { name: proxy.$t(`commonTimeName.month`), value:'month', click: false,disabled:false},
+    { name: proxy.$t(`commonTimeName.year`), value:'year',click:false,disabled:false}
 ])
 let loginDialog=ref(false)
 let logintotalTable=ref([])
@@ -826,12 +832,12 @@ const searchIOT = ()=>{
             detailsData.value[transferNum.value].searchRange = searchRange.value
 
         }).catch((err) => {
-            ElMessage.error('API异常,查询失败')
+            ElMessage.error(proxy.$t(`userInquire.details.message1`))
         }).finally(() => {
             loading.value = false
         });
     } catch(e){
-        ElMessage.error('請先選擇查詢月份!!')
+        ElMessage.error(proxy.$t(`userInquire.details.message2`))
     }
 }
 
@@ -844,24 +850,25 @@ function initdata() {
     let { name,id,mobile, mail, schoolCode, schoolCodeW, points,country,province,city,picture,dist} = transmitData
     userPortrait.value=picture
     usernames.value=name
-    userdata.value[0].value = id ? id:'暂无'
-    userdata.value[1].value = mobile ?mobile:'暂无'
-    userdata.value[2].value = schoolCodeW ? schoolCodeW : schoolCode ? schoolCode:'无'
-    let schoolname= schoolCode ?schoolCode:'无'; let schoolnameW=schoolCodeW ? schoolCodeW:'无'
-    userdata.value[2].value = schoolCodeW || schoolCode ?  schoolnameW   + ' | '  +schoolname:'暂无'
+    userdata.value[0].value = id ? id : proxy.$t(`userInquire.details.null`)
+    userdata.value[1].value = mobile ? mobile : proxy.$t(`userInquire.details.null`)
+    userdata.value[2].value = schoolCodeW ? schoolCodeW : schoolCode ? schoolCode : proxy.$t(`userInquire.details.none`)
+    let schoolname = schoolCode ? schoolCode : proxy.$t(`userInquire.details.none`);
+    let schoolnameW = schoolCodeW ? schoolCodeW : proxy.$t(`userInquire.details.none`);
+    userdata.value[2].value = schoolCodeW || schoolCode ? schoolnameW + ' | ' + schoolname : proxy.$t(`userInquire.details.null`)
     schoolCodeW ? userdata.value[2].correlation=true:false
-    userdata.value[3].value = mail ? mail:'暂无'
+    userdata.value[3].value = mail ? mail : proxy.$t(`userInquire.details.null`)
     //userdata.value[4].value = country && province && city ? country+'-'+province+city:country && province ? country+'-'+province:'暂无'
     let locationName= country && province && city && dist ? country+'-'+province+city+dist:
                       country && province && city ? country +'-'+province+city:
                       country && city && dist  ? country+'-'+city+dist:
-                      country && province ? country+'-'+province:'暂无'
+                      country && province ? country + '-' + province : proxy.$t(`userInquire.details.null`)
     userdata.value[4].value = locationName
     //产品使用及安装情况 登入时间
     let {login}=transmitData
-    let logintimes = login.length >0 ? login.sort(function(a,b){return b.time-a.time}):'无'
+    let logintimes = login.length > 0 ? login.sort(function (a, b) { return b.time - a.time }) : proxy.$t(`userInquire.details.none`)
     console.log(logintimes,'时间!')
-    logintimes !=='无' ?  userdata.value[5].value=proxy.$common.timestampToTime(logintimes[0].time,'all'):userdata.value[5].value='暂无'
+    logintimes !== proxy.$t(`userInquire.details.none`) ? userdata.value[5].value = proxy.$common.timestampToTime(logintimes[0].time, 'all') : userdata.value[5].value = proxy.$t(`userInquire.details.null`)
     productdata.value.forEach((itema)=>{itema.value =0,itema.valueText='',itema.state=false})
     if(login.length >0){
        console.log('进入到多数组')
@@ -896,7 +903,7 @@ function initdata() {
     let {prod,benefits}=transmitData
     prod.forEach((item)=>{
         //处理名字
-        item.name=item.prodCode ==='Z6ELB6EZ' ? 'HiTeach 5':item.prodCode ==='IPALB6EY' ? 'IES 5 個人空間':''
+        item.name = item.prodCode === 'Z6ELB6EZ' ? 'HiTeach 5' : item.prodCode === 'IPALB6EY' ? proxy.$t(`auth.IPALB6EY`) : ''
         //处理扩展内容
         let apruleItem=item.aprule
         item.apruleArr=[]
@@ -916,6 +923,9 @@ function initdata() {
             apruleItem.soknumber !==0 ? (powerExtension.value[12].state=true,powerExtension.value[12].value=apruleItem.soknumber):powerExtension.value[12].state=false //議課人數
             apruleItem.scorsys ? (powerExtension.value[13].state=true,powerExtension.value[13].value=apruleItem.soknumber):powerExtension.value[13].state=false //智慧評分系統
             apruleItem.hasOwnProperty('irs') ? powerExtension.value[14].state=false:powerExtension.value[14].state=true  //IRS硬體遙控器
+            apruleItem.sokvtt ? powerExtension.value[15].state = true : powerExtension.value[15].state = false //蘇格拉底語音轉寫
+            apruleItem.cowork ? powerExtension.value[16].state = true : powerExtension.value[16].state = false //協作
+            apruleItem.aigpt ? powerExtension.value[17].state = true : powerExtension.value[17].state = false //AI GPT服務
             item.apruleArr=powerExtension.value
         }
         //处理时间
@@ -932,7 +942,10 @@ function initdata() {
     console.log(powerList.value,'权益内容')
     //处理权益内 附加功能(HITeach附加 CC权限)
     let hiteachData=benefits.hiteach !==null ?benefits.hiteach:[] ; let ccData=benefits.hiteachcc !==null  ?benefits.hiteachcc:[]
-    console.log(hiteachData,ccData)
+    console.log(hiteachData, ccData)
+    subjoinData.value.hiteach.forEach((items) => {
+        items.start = 0, items.end = 0, items.value = 0, items.gets = 0, items.exps = 0
+    })
     if(hiteachData.length >0){
         hiteachData.forEach((item)=>{
             let funcKey=item.func;let startTime=proxy.$common.timestampToTime(item.get);let endTime=proxy.$common.timestampToTime(item.exp)
@@ -1003,7 +1016,7 @@ function init(){
     //获取hiteach 版本号
      let versionsData=detailsData.value[transferNum.value].iot.hiteach ?.month ?.verList
     console.log(versionsData)
-     let hiteachV=versionsData ? versionsData.sort((a,b)=>{return b-a}):'暂无'
+    let hiteachV = versionsData ? versionsData.sort((a, b) => { return b - a }) : proxy.$t(`userInquire.details.null`)
      console.log(hiteachV,'版本号')
      store.commit('getHiteachv', hiteachV[0])
     loading.value=false

+ 71 - 381
TEAMModelBI/ClientApp/src/view/userInquire/idIncrement.vue

@@ -70,6 +70,9 @@
                 <td>
                   歸屬城市數
                 </td>
+                <td>
+                  T課堂
+                </td>
                 <td></td>
               </tr>
               <tr v-for="items in statisticsData" :key="items.time" class="troverview">
@@ -88,6 +91,9 @@
                 <td>
                   {{ items.geoInSeat }}
                 </td>
+                <td>
+                  {{ items.tLesson }}
+                </td>
                 <td>
                   <el-button type="primary" @click="schgeoData(items)">詳細統計</el-button>
                 </td>
@@ -126,6 +132,10 @@
                 <div class="socrates-item-title">歸屬城市數</div>
                 <div class="socrates-item-value">{{ detailData.geoInSeat }}</div>
               </div>
+              <div class="socrates-item">
+                <div class="socrates-item-title">T課堂</div>
+                <div class="socrates-item-value">{{ detailData.tLesson }}</div>
+              </div>
 
             </div>
             <div class="data-tables" style="height: 400px;width: 100%;">
@@ -168,6 +178,10 @@
                 <div class="socrates-item-title">歸屬城市數</div>
                 <div class="socrates-item-value">{{ detailData.geoInSeat }}</div>
               </div>
+              <div class="socrates-item">
+                <div class="socrates-item-title">T課堂</div>
+                <div class="socrates-item-value">{{ detailData.tLesson }}</div>
+              </div>
 
             </div>
             <div class="data-tables" style="height: 400px;width: 100%;">
@@ -186,12 +200,10 @@
 </template>
   <script setup>
   import option_cn from '@/static/regions/region_cn.json'
-  import option_gl from '@/static/regions/region_gl.json'
-  //import testAPIData from '@/static/regions/test.json'
+  import option_gl from '@/static/regions/region_gl.json'  
   import { ref, reactive , getCurrentInstance, watch, h, nextTick } from 'vue'
   import { ElMessage, TableV2SortOrder, ElLoading, ElCheckbox,HeaderCellSlotProps,ElPopover} from 'element-plus'
-  import { multipleSheetExport } from '@/until/multipleSheetExport'
-  import { Filter } from '@element-plus/icons'  
+  import { multipleSheetExport } from '@/until/multipleSheetExport'  
   import { Search, CirclePlus } from '@element-plus/icons-vue'
   import { useRouter } from 'vue-router'
   import { useStore } from 'vuex'  
@@ -200,9 +212,7 @@
   let router=useRouter()
   const store = useStore()    
   let activeNames = ref(['1','2','3','4'])
-  let showState = ref('default')
-  let findValue = ref()
-  let test = ref([])   
+  let showState = ref('default')       
   let productData = ref({
     dataType: '结果类型',
     datainfo: [
@@ -236,8 +246,7 @@
     time: 0,
     resultType: 0
   })
-  let timeScope = ref('Month')
-  let cellWidth = ref((100 / 10).toFixed(2))       
+  let timeScope = ref('Month')     
   let changeHight = ref(51)
   let initLoading = ref(false)
   let searchLoading = ref(false)
@@ -249,6 +258,7 @@
     alreadyInSeat: 0,
     schInSeat: 0,
     geoInSeat: 0,
+    tLesson:0
   })  
   let times=reactive({
     start:"",
@@ -261,119 +271,11 @@
   originalSchool: []
 })
   let options = ref([])
-  // 學校搜索選中的學校集合
-  let optionsValue = ref()
-  let geoOptionsValue = ref()  
-  let tableData = ref([])
-  let filterloding = ref(false)
-  let isFilter = ref(false)  
-  let adddialog = ref(false)
+  let tableData = ref([])  
   let addvalue = ref('')
-  let checkboxArr = ref([])
-  let addschool = ref({
-  name: '',
-  id: '',
-  region: '',
-  province: '',
-  city: '',
-  dist: '',
-  areaId: '',
-  isvirtual: false,
-})
   let timer = ref()
-  let columns = ref([
-  // {
-  //   key: "id",
-  //   dataKey: "id",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-  //   title: "id",//显示在单元格表头的文本
-  //   width: 100,//当前列的宽度,必须设置       
-  //   headerClass: 'general',
-  // },
-  {
-    key: "name",
-    dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "學校名稱",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "countryName",
-    dataKey: "countryName",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "國/省",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-    //show:
-  },
-  {
-    key: "cityName",
-    dataKey: "cityName",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "城市名稱",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "hiteach",
-    dataKey: "hiteach",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "hiteach",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "hiteachcc",
-    dataKey: "hiteachcc",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "hiteachcc",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "hita",
-    dataKey: "hita",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "hita",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "ies5",
-    dataKey: "ies5",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "ies5",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "account",
-    dataKey: "account",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "account",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "sokrates",
-    dataKey: "sokrates",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "sokrates",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "sokapp",
-    dataKey: "sokapp",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "sokapp",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  {
-    key: "irs",
-    dataKey: "irs",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "irs",//显示在单元格表头的文本
-    width: 100,//当前列的宽度,必须设置
-    headerClass: 'general',
-  },
-  
-])
-  let filterData = ref([])
   let allData = reactive([])
-  let statisticsData = reactive([])
-  let statisticsDatastr = reactive([])
-  //let statisticsDatastr = testAPIData
+  let statisticsData = reactive([])  
   let schDetailData = reactive([])
   let geoDetailData = reactive([])  
   let schDetailColumns = ref([
@@ -401,6 +303,14 @@
     headerClass: 'general',
     sortable:true
   },
+  {
+    key: "tLesson",
+    dataKey: "tLesson",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
+    title: "T課堂",//显示在单元格表头的文本
+    width: 300,//当前列的宽度,必须设置
+    headerClass: 'general',
+    sortable:true
+  },
   {
     key: "id",
     dataKey: "id",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
@@ -447,6 +357,14 @@
     headerClass: 'general',
     sortable:true
   },
+  {
+    key: "tLesson",
+    dataKey: "tLesson",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
+    title: "T課堂",//显示在单元格表头的文本
+    width: 300,//当前列的宽度,必须设置
+    headerClass: 'general',
+    sortable:true
+  },
   {
     key: "id",
     dataKey: "id",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
@@ -483,12 +401,14 @@
     'cityName': TableV2SortOrder.ASC,
     'name': TableV2SortOrder.ASC,
     'length': TableV2SortOrder.ASC,
+    'tLesson': TableV2SortOrder.ASC,
     'id': TableV2SortOrder.ASC,
   })
   const sortStategeo = ref({
     'cityName': TableV2SortOrder.ASC,
     'distName': TableV2SortOrder.ASC,
     'length': TableV2SortOrder.ASC,
+    'tLesson': TableV2SortOrder.ASC,
     'id': TableV2SortOrder.ASC,
   })
   const onSortsch = ({ key, order }) => {    
@@ -515,10 +435,6 @@
     }    
     geoDetailData = allDatas    
   }
-
-  const pickerOptions=function disabledDate(time) {
-            return time.getTime() > Date.now();
-  }
   const monthOptions=function disabledDate(time){
      // 获取当前的月份信息
                 const date = new Date(); 
@@ -536,103 +452,7 @@
                   }
                   const elTimeData = timeyear.toString() + timemonth.toString();
                   return elTimeData >= nowDate; 
-  }
-  const searchColumns = [
-  {
-    // cellRenderer: (data) =>
-    //   h(
-    //     ElCheckbox,
-    //     // { onClick: () => handleDelete(data), type: "danger", icon: "Delete" },
-    //     { onChange: () => selectChange(data.rowData) },
-    //     { modelValue: () => modelValue = data.rowData },
-    //     { default: () => "" }
-    //   ),
-    width: 50,//当前列的宽度,必须设置
-    // fixed: true,//是否固定列
-    align: 'center',
-    headerClass: 'cheboxclass',
-    // cellRenderer: ({ rowData }) => {
-    //   const onChange = (value: CheckboxValueType) => (rowData.checked = value)
-    //   return <SelectionCell value={rowData.checked} onChange={onChange} />
-    // },
-    cellRenderer: (data) => (
-      <>
-        <el-checkbox v-model={data.rowData.checkboxs} onChange={selectChange.bind(this, data.rowData)}></el-checkbox>
-      </>
-    )
-  },
-  {
-    // key: "name",
-    // dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
-    title: "校徽",
-    width: 150,
-    fixed: false,
-    align: 'center',
-    headerClass: 'serachclass',
-    cellRenderer: (data) => (
-      <>
-        <el-image style="width: 45px; height: 45px;margin:5px" src={data.rowData.picture} fit="contain" v-show={data.rowData.picture ? true : false}></el-image>
-        <div style=" width: 45px;height: 45px;line-height: 45px;text-align: center;background-color: #bdc3c7;font-size: 10px;color: #ecf0f1;margin:5px;" v-show={!data.rowData.picture ? true : false}>暂无图片</div>
-      </>
-    )
-  },
-  {
-    key: "name",
-    dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
-    title: "名称",
-    width: 200,
-    fixed: false,
-    headerClass: 'serachclass',
-    align: 'center',
-  },
-  {
-    // key: "name",
-    // dataKey: "name",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填name
-    title: "规模版本",
-    width: 100,
-    fixed: false,
-    align: 'center',
-    headerClass: 'serachclass',
-    // sortable: true,
-    cellRenderer: (data) => (
-      <>
-        <div style="color:#409EFF" v-show={data.rowData.scale === 0 && (data.rowData.size < 100 || data.rowData.size == 100) ? true : false}>基础版</div>
-        <div style="color:#67C23A" v-show={(data.rowData.scale === 300 && data.rowData.size === 500) || (data.rowData.size > 100 && (!data.rowData.service.includes('YMPCVCIM') && !data.rowData.service.includes('VLY6J6N6') && !data.rowData.service.includes('VABAJ6NV'))) ? true : false}>标准版</div>
-        <div style="color: #e6a23c;" v-show={data.rowData.service.includes('YMPCVCIM') || data.rowData.service.includes('VLY6J6N6') || data.rowData.service.includes('VABAJ6NV') ? true : false}>专业版</div>
-      </>
-    ),
-  },
-  {
-    key: "id",
-    dataKey: "id",//需要渲染当前列的数据字段,如{id:9527,name:'Mike'},则填id
-    title: "学校简码",//显示在单元格表头的文本
-    width: 150,//当前列的宽度,必须设置
-    align: 'center',
-    headerClass: 'serachclass',
-  },
-  // {
-  //   key: "location",
-  //   dataKey: "location",
-  //   title: "位置",
-  //   align: 'center',
-  //   width: 200,
-  //   headerClass: 'serachclass',
-  // },
-  {
-    key: "areaName",
-    dataKey: "areaName",
-    title: "所属学区",
-    width: 150,
-    align: 'center',
-    headerClass: 'serachclass',
-  },
-  ];
-  const areaProps = {
-    multiple: false,
-    checkStrictly:true,
-    label: "name",
-    value: "name",
-  }  
+  } 
   function copyId(value){    
      // 建立一個臨時的input元素
      const tempInput = document.createElement("input");
@@ -654,7 +474,6 @@
         ElMessage.success("已複製歸戶id:" + value.rowData.id);
       }             
   }
-
   function serachToresult (startTime, endTime) {        
     // 清空陣列
     statisticsData.splice(0, statisticsData.length);
@@ -671,33 +490,7 @@
     
     let data = { 
       dateList:montharr
-    }    
-    
-    //  for (let i = 0; i < statisticsDatastr.length; i++) {
-    //    let item = {
-    //      dateFrom: "",
-    //      dateTo: "",
-    //      newInSeat: 0,
-    //      alreadyInSeat: 0,
-    //      schInSeat: 0,
-    //      geoInSeat: 0,
-    //    }
-
-    //    statisticsDatastr[i].sch.forEach(function (school, index2) {
-    //      if (school.name) {
-    //        item.alreadyInSeat += school.tmids.length;
-    //      }
-    //    })
-    //    item.dateFrom = statisticsDatastr[i].dateFrom;
-    //    item.dateTo = statisticsDatastr[i].dateTo;
-    //    item.newInSeat = statisticsDatastr[i].tmid.length;
-    //    item.schInSeat = statisticsDatastr[i].sch.length;
-    //    item.geoInSeat = statisticsDatastr[i].geo.length;
-    //    statisticsData.push(item);
-    //  }
-     
-    //  searchLoading.value = false;    
-    //  console.log("statisticsData : "+statisticsData);         
+    }         
 
     proxy.$api.getTmidUseprod(data).then(async(res) => {      
       if(res.length > 0){
@@ -709,6 +502,7 @@
             alreadyInSeat: 0,
             schInSeat: 0,
             geoInSeat: 0,
+            tLesson:0
           }
 
           res[i].sch.forEach(function (school, index2) {
@@ -721,12 +515,11 @@
           item.newInSeat = res[i].tmid.length;          
           item.schInSeat = res[i].sch.length;
           item.geoInSeat = res[i].geo.length;
+          item.tLesson = res[i].iot.tLesson;          
           statisticsData.push(item);
         }                
       }
-      allData = res;
-      statisticsDatastr = res;
-      //await FilterData();          
+      allData = res;                 
       searchLoading.value=false;
     }).catch((err) => {
       ElMessage.error('API异常,数据获取失败')
@@ -806,72 +599,13 @@
   return ranges;
   } 
 
-  function serarchInit (value) {
-  let filterKey = value  
-  if (filterKey === 2) {
-    options.value = optionsData;
-  }
-}
-//搜索清空
-function searchInit () {
-  // checkboxArr.value = checkboxArr.value.length > 0 ? checkboxArr.value : []
-  addschool.value.name = ''
-  addschool.value.id = ''
-  addschool.value.region = ''
-  addschool.value.province = ''
-  addschool.value.city = ''
-  addschool.value.dist = ''
-  addschool.value.isvirtual = false
-  checkboxArr.value = []
-  tableData.value.forEach(item => item.checkboxs = false)
-  res.sch = []
-  // console.log(checkboxArr.value)
-}
-function dataInit () {
-  initLoading.value=true
-  let dataList = []
-  proxy.$api.getCapacity({}).then((res) => {
-    console.log(res, 'areList')
-    dataSource.value.area = res.areas
-    res.areas.forEach((item) => {
-      dataList.push({ id: item.id, name: item.name, province: item.provName, city: item.cityName, children: [] })
-    })
-    filterloding.value = true
-    proxy.$api.getSchool({}).then((res) => {
-      console.log(res, 'schoolList')
-      dataSource.value.school = res.scInfos
-      res.scInfos.forEach((items) => {
-        let areId = items.areaId
-        items.checkboxs = false
-        dataList.forEach((itemA) => {
-          areId === itemA.id ? itemA.children.push(items) : ''
-        })
-      })
-      console.log(dataList, 'result!')
-      options.value = dataList
-      dataSource.value.composite = dataList
-      dataSource.value.originalSchool = res.scInfos    
-      tableData.value = res.scInfos      
-      console.log(dataSource.value.composite, '检查是否是所有学校')
-      filterloding.value = false
-      initLoading.value=false
-    }).catch((err) => {
-      ElMessage.error('API异常,基础数据获取异常')
-      filterloding.value = false
-      initLoading.value=false
-    })
-  }).catch((err) => {
-    ElMessage.error('API异常,基础数据获取异常')
-  })
-}
-function keywords (node, keyword) { 
-  console.log(node, keyword)
-  if (node.data.name.indexOf(keyword) !== -1 || node.data.id === keyword) {
-    return true
-  } else {
-    return false
+  function serarchInit(value) {
+    let filterKey = value
+    if (filterKey === 2) {
+      options.value = optionsData;
+    }
   }
-}
+
 function debounce (fn, wait) {
   if (timer.value !== null) {
     clearTimeout(timer.value)
@@ -886,87 +620,40 @@ function beforefilter () {
   })
   tableData.value = newArr
 }
-//添加虚拟学校
-function addschoolfn () {
-  let resultA = options.value.findIndex(item => item.id === 'notarea')
-  console.log(resultA, '值')
-  resultA === -1 ? options.value.push({ id: 'notarea', name: '*手动添加学校*', province: '', city: '', children: [] }) : ''
-  console.log(checkboxArr.value, '选择的学校')
-  let checkList = checkboxArr.value
-  console.log(checkList, 'checkList')
-  let dataArr = options.value
-  optionsValue.value = typeof (optionsValue.value) === 'object' ? optionsValue.value : []
-  checkList.forEach((item) => {
-    for (let i in optionsValue.value) {
-      if (item.id === optionsValue.value[i][1]) { return }
-    }
-    item.areaId && item.id ? optionsValue.value.push([item.areaId, item.id]) : ''
-    !item.areaId ? (dataArr.forEach((itemArea) => { itemArea.id === 'notarea' ? itemArea.children.push(item) : '' }), optionsValue.value.push(['notarea', item.id])) : ''
-  }) 
-  options.value = dataArr
-  adddialog.value = false    
-}
-//获取所有学校列表 5.18日 调整搜索为 学校列表的形式 
-function selectChange (value) {
-  console.log(value)
-  if (checkboxArr.value.length === 0) {
-    checkboxArr.value.push(value)
-  } else {
-    let indexNums = checkboxArr.value.findIndex(item => item.id === value.id)
-    if (indexNums === -1) {
-      checkboxArr.value.push(value)
-    } else {
-      checkboxArr.value.splice(indexNums, 1)
-    }
-  }
-}
-function FilterData () {  
-  if (clickNum.value.filter === 1) {
-    if (allData.sch.length > 0) {            
-      if (optionsValue.value) {
-      } else {
-        filterData.value = allData.sch;
-      }
-    }
-  } else if (clickNum.value.filter === 2) {
-    if (allData.geo.length > 0) {            
-      if (geoOptionsValue.value) {
-      } else {
-        filterData.value = allData.geo;
-      }
-    }
-  }  
-}
+
   function schgeoData(items) {
     activeNames.value = ['2','3','4'];
     showDetail.value = true;    
     console.log("dateFrom : " + items.dateFrom);
     console.log("dateTo : " + items.dateTo);
-    for (let i = 0; i < statisticsDatastr.length; i++) {      
-      if (statisticsDatastr[i].dateFrom === items.dateFrom && statisticsDatastr[i].dateTo === items.dateTo) {
+    for (let i = 0; i < allData.length; i++) {      
+      if (allData[i].dateFrom === items.dateFrom && allData[i].dateTo === items.dateTo) {
         detailData.dateFrom = items.dateFrom;
         detailData.dateTo = items.dateTo;
         detailData.newInSeat = items.newInSeat;
         detailData.geoInSeat = items.geoInSeat;
         detailData.alreadyInSeat = items.alreadyInSeat;
         detailData.schInSeat = items.schInSeat;
+        detailData.tLesson = items.tLesson;
+        
         schDetailData.splice(0, schDetailData.length);
         geoDetailData.splice(0, geoDetailData.length);   
         
-        statisticsDatastr[i].sch.forEach((item) => { // 列出學校資料
+        allData[i].sch.forEach((item) => { // 列出學校資料
           //if (item.name) {            
             let schitem = {
               //id: item.id,
               provinceName: item.provinceName === null ? "" : item.provinceName,// 字串如果是null 替換為空字串  才可以進行排序
               cityName: item.cityName === null ? "" : item.cityName,
               name: item.name === null ? "" : item.name,
+              tLesson: item.tLesson,              
               length: item.tmids.length,
               id: item.tmids.toString()
             }
             schDetailData.push(schitem);
           //}
         })
-        statisticsDatastr[i].geo.forEach((item) => { // 列出城市資料
+        allData[i].geo.forEach((item) => { // 列出城市資料
           //if (item.cityName) {
             let geoitem = {
               //id: item.id,
@@ -974,6 +661,7 @@ function FilterData () {
               cityName: item.cityName === null ? "" : item.cityName,
               distName: item.distName === null ? "" : item.distName,
               length: item.tmids.length,
+              tLesson: item.tLesson,
               id: item.tmids.toString()
             }
             geoDetailData.push(geoitem);
@@ -989,12 +677,12 @@ function FilterData () {
   function exportExcel(){
 
     if (statisticsData) {
-      let headerarr = ["統計期間", "新增ID數", "已歸戶數", "歸戶學校數", "歸屬城市數"];
-      let keyarr = ["date", "newInSeat", "alreadyInSeat", "schInSeat", "geoInSeat"];
-      let headerscharr = ["城市", "學校名稱", "歸戶數", "歸戶id"];
-      let keyscharr = ["cityName", "name", "length", "id"];
-      let headergeoarr = ["城市", "行政區", "歸戶數", "歸戶id"];
-      let keygeoarr = ["cityName", "distName", "length", "id"];
+      let headerarr = ["統計期間", "新增ID數", "已歸戶數", "歸戶學校數", "歸屬城市數", "T課堂"];
+      let keyarr = ["date", "newInSeat", "alreadyInSeat", "schInSeat", "geoInSeat", "tLesson"];
+      let headerscharr = ["城市", "學校名稱", "歸戶數", "T課堂", "歸戶id"];
+      let keyscharr = ["cityName", "name", "length", "tLesson", "id"];
+      let headergeoarr = ["城市", "行政區", "歸戶數", "T課堂", "歸戶id"];
+      let keygeoarr = ["cityName", "distName", "length", "tLesson", "id"];
       let tableDatasarr = [];
       const excelDatas = [];
 
@@ -1005,6 +693,7 @@ function FilterData () {
           "alreadyInSeat": item.alreadyInSeat,
           "schInSeat": item.schInSeat,
           "geoInSeat": item.geoInSeat,
+          "tLesson": item.tLesson,
         }
         tableDatasarr.push(ditem);
       })
@@ -1022,14 +711,14 @@ function FilterData () {
       excelDatas.push(excelData);
 
 
-      statisticsDatastr.forEach((item) => {    
+      allData.forEach((item) => {    
         let schData =[];
         let geoData =[];
-        item.sch.forEach((itemsch) => {// 學校統計資料
-          debugger
+        item.sch.forEach((itemsch) => {// 學校統計資料          
           let schItemata = {
             cityName: itemsch.cityName === null ? "" : itemsch.cityName,
             name: itemsch.name === null ? "" : itemsch.name,
+            tLesson: itemsch.tLesson ,
             length: itemsch.tmids.length,
             id: itemsch.tmids.toString()
           }
@@ -1039,6 +728,7 @@ function FilterData () {
           let geoItemData = {
             cityName: itemgeo.cityName === null ? "" : itemgeo.cityName,
             distName: itemgeo.distName === null ? "" : itemgeo.distName,
+            tLesson: itemgeo.tLesson,
             length: itemgeo.tmids.length,
             id: itemgeo.tmids.toString()
           }
@@ -1066,7 +756,7 @@ function FilterData () {
       multipleSheetExport(excelDatas, '用戶增量統計表', true, 'xlsx')            
     }
   }
-  dataInit()
+  
   watch(activeNames, (newdata) => {
     if (newdata.length === 0) {
       changeHight.value = 80

+ 16 - 16
TEAMModelBI/ClientApp/src/view/userInquire/index.vue

@@ -1,20 +1,20 @@
 <template>
     <div class="inquirebox" >
         <div class="inquire-title">
-            <p>TEAM Model 智慧教育</p>
+            <p>TEAM Model {{$t(`userInquire.index.smartEducation`)}}</p>
         </div>
         <el-tabs v-if="pageShow ==='default'" style="width: 100%;height:100%;" type="card" class="demo-tabs" v-model="activeTab">
-            <el-tab-pane label="用户查询" style="padding: 1%;display: flex;justify-content: center;" name="tab1">
-                <div class="searchbox" v-loading="searchLoading" element-loading-text="数据搜索中...">
+            <el-tab-pane :label="$t(`userInquire.index.userSearch`)" style="padding: 1%;display: flex;justify-content: center;" name="tab1">
+                <div class="searchbox" v-loading="searchLoading" :element-loading-text="$t(`userInquire.index.dataSearching`)+'...'">
                     <div class="searchbox-title">
-                        <p>用户查询</p>
+                        <p>{{$t(`userInquire.index.userSearch`)}}</p>
                     </div>
                     <el-divider border-style="dashed" />
                     <div class="searchbox-item">
-                        <el-input v-model="searchvalue" placeholder="输入手机号码/醍摩豆账号 进行搜索" class="input-with-select">
+                        <el-input v-model="searchvalue" :placeholder="$t(`userInquire.index.input`)+$t(`userInquire.index.selfphoneNumber`)+'/'+$t(`userInquire.index.tmid`)+' '+$t(`userInquire.index.doSearch`)" class="input-with-select">
                         <template #prepend>
                             <el-select v-model="selecttypes" placeholder="Select" style="width: 120px">
-                            <el-option label="精准查询" value="precise" />
+                            <el-option :label="$t(`userInquire.index.refinedQuery`)" value="precise" />
                             <!-- <el-option label="批量查询/操作" value="batch" /> -->
                             </el-select>
                         </template>
@@ -24,7 +24,7 @@
                         </el-input>
                     </div>
                     <div class="recordbox" v-if="selecttypes==='precise'">
-                        <p>搜索记录:</p>
+                        <p>{{$t(`userInquire.index.searchRecord`)}}:</p>
                         <div class="recordbox-item">
                             <el-tag v-for="tag in searchRecordsArr"  class="mx-1" closable type="''"  effect="light" @close="deleteLog(tag)" @click="searchvalue=tag">
                                 {{ tag }}
@@ -35,14 +35,14 @@
                         </div>
                     </div>
                     <div class="recordbox" v-else="selecttypes ==='batch'">
-                        <p>搜索结果:</p>
+                        <p>{{$t(`userInquire.index.searchResult`)}}:</p>
                     </div>
                 </div>
             </el-tab-pane>
-            <el-tab-pane label="弱歸戶" style="padding: 1%" name="tab2">
+            <el-tab-pane :label="$t(`userInquire.index.weakUserRegist`)" style="padding: 1%" name="tab2">
                 <UpdCodeW />
             </el-tab-pane>
-            <el-tab-pane label="ID歸戶增量統計"  name="tab3">
+            <el-tab-pane :label="$t(`userInquire.index.idUserRegistSta`)"  name="tab3">
                 <IdIncrement />
             </el-tab-pane>
         </el-tabs>
@@ -88,7 +88,7 @@ transmitModel.value ? transmitinit():''
 provide('transmitShow',transmitModel.value)
 function seachSole(datavalue) {
     if(!searchvalue.value){
-        ElMessage.info('请输入手机号码/ 醍魔豆账号 进行搜索!')
+        ElMessage.info(proxy.$t(`userInquire.index.message4`))
         return
     }
     //处理TW用户 ID可能是以0开头的情况。删除掉开头的0
@@ -101,9 +101,9 @@ function seachSole(datavalue) {
         searchvalue.value=searchvalue.value.replace(/,/g, ',');
         userArr = searchvalue.value.split(',');
     }
-    if(userArr.length >10){
-            ElMessage.info('同时查询人员不能大于10,请调整查询范围')
-            return
+    if(userArr.length >100){
+        ElMessage.info(proxy.$t(`userInquire.index.message1_1`) + '100' + proxy.$t(`userInquire.index.message1_2`));
+        return;
     }
     //let testdata=['1524738018','1595321354']
     let data = ''
@@ -130,12 +130,12 @@ function seachSole(datavalue) {
         console.log(res, 'user back')
         res.length >0 ? 
         (searchResult.value=res,searchLoading.value=false,pageShow.value='details',defDate.value=[new Date(nowYear, 0), new Date(nowYear, nowMonth)]):
-        (ElMessage.error('暂无搜索到相关人员,请检查信息搜索'),searchLoading.value=false)
+        (ElMessage.error(proxy.$t(`userInquire.index.message2`)),searchLoading.value=false)
         //搜索记录
         if(res.length >0){saveSearchRecord(searchvalue.value)}
     }).catch((err) => {
         searchLoading.value=false
-        ElMessage.error('API异常,查询失败')
+        ElMessage.error(proxy.$t(`userInquire.index.message3`))
     })
     // pageShow.value='details'
 }

+ 7 - 4
TEAMModelBI/ClientApp/src/view/userInquire/iot.vue

@@ -488,7 +488,7 @@
     city: '',
     dist: '',
   })
-  let lessonsList = ref([
+  let lessonsList = ref([  
     { icon: '#icon--caozuorizhi', title: 'IES课程', content: '使用IES课程', state: true, value: 0 },
     { icon: '#icon--caozuorizhi', title: 'webIrs', content: '使用webIrs', state: true, value: 0 },
     { icon: '#icon--caozuorizhi', title: 'IRS', content: '使用IRS', state: true, value: 0 },
@@ -502,6 +502,7 @@
     { icon: '#icon--caozuorizhi', title: 'Excel测验', content: '使用Excel卷测验', state: true, value: 0 },
     { icon: '#icon--caozuorizhi', title: '纸本测验', content: '使用纸本测验', state: true, value: 0 },
     { icon: '#icon--caozuorizhi', title: 'T课堂', content: '符合T课堂数', state: true, value: 0 },
+    { icon: '#icon--caozuorizhi', title: 'T指数', content: '课程T绿灯数', state: true, value: 0 },
   ])
   let inuseList = ref([
     { title: '学习任务数', value: 15, icon: '#icon-renwu', percent: '41.2%', class: 'task', textClass: 'task-text' },
@@ -516,8 +517,8 @@
     { name: '差异化形态课堂', value: 20, percent: '5%', class: 'interaction', textClass: 'interaction-text' },
     { name: '协作型态课堂', value: 30, percent: '15%', class: 'testclass', textClass: 'testclass-text' },
     { name: '互评型态课堂', value: 30, percent: '15%', class: 'testclass', textClass: 'testclass-text' },
-    { name: '无型态课堂', value: 0, percent: '0%', class: 'noneclass', textClass: 'noneclassclass-text' },
-    { name: '未上课', value: 0, percent: '0%', class: 'noneclass', textClass: 'noneclassclass-text' },
+    { name: '教材展示', value: 0, percent: '0%', class: 'noneclass', textClass: 'noneclassclass-text' },
+    { name: '白板应用', value: 0, percent: '0%', class: 'noneclass', textClass: 'noneclassclass-text' },
   ])
   let echartData = ref({
     total: 0,
@@ -568,7 +569,7 @@
           }
         },
         boundaryGap: true, // 坐标轴两边是否留白
-        data: ['合作', '互动', '任务', '差异化', '协作','互评', '无型态', '未上课']
+        data: ['合作', '互动', '任务', '差异化', '协作','互评', '教材展示', '白板应用']
       },
       yAxis: [
         {
@@ -691,6 +692,8 @@
     lessonsList.value[11].value=usePaperTest ?usePaperTest:0
     //符合T课堂数
     lessonsList.value[12].value=tLesson ? tLesson:0
+    // T綠燈
+    lessonsList.value[13].value=tGreen
   
     //授权内容
     let {lessonCnt928,lessonCntId, lessonCntDevice, lessonCntIdDevice,deviceCnt } = propsbox.detailsData

+ 1 - 1
TEAMModelBI/Controllers/BICommon/BICouponController.cs

@@ -201,5 +201,5 @@ namespace TEAMModelBI.Controllers.BICommon
 
     public record GenerateCouponRequest([Required] string srvAdr, [Required] string CouponType, List<string> targets, string couponName, int quantity, [Required] long expire, [Required] List<CouponRule> rule, string eventName, List<info> info, int maxTaker = -1);
     public record ConsolidationCouponRequest([Required] string srvAdr, [Required] string coupon, [Required] List<string> ids);
-    public record PushNotifyRequest([Required] string srvAdr, [Required] string title, [Required] string body, [Required] List<string> tags, [Required] string sender, [Required] string hubName);
+    public record PushNotifyRequest([Required] string srvAdr, [Required] string title, [Required] string body, [Required] List<string> tags, [Required] string sender, [Required] string hubName, string data = null);
 }

+ 6 - 8
TEAMModelBI/Controllers/BICommon/BINoticeController.cs

@@ -17,14 +17,12 @@ using TEAMModelBI.Models;
 using System.Linq;
 using TEAMModelBI.Filter;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System;
 using TEAMModelOS.SDK.Models.Service.BI;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BISchool;
 using TEAMModelBI.Tool.Extension;
 using TEAMModelOS.SDK.Models;
-using DocumentFormat.OpenXml.Spreadsheet;
-using System.Net.Http.Json;
 
 namespace TEAMModelBI.Controllers.BICommon
 {
@@ -105,7 +103,7 @@ namespace TEAMModelBI.Controllers.BICommon
             List<IdInfo> idInfos = new();
             var cosmosClient = _azureCosmos.GetCosmosClient();
 
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<IdInfo>(queryText: "select c.id,c.name,c.picture from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<IdInfo>(queryText: "select c.id,c.name,c.picture from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
             {
                 idInfos.Add(item);
             }
@@ -176,7 +174,7 @@ namespace TEAMModelBI.Controllers.BICommon
                     if (tmdIds.Count > 0)
                     {
                         tchSql.Append(BICommonWay.ManyScSql(" where c.id ", tmdIds.Select(s => s.id).ToList()));
-                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<IdNameCode>(queryText: tchSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<IdNameCode>(queryText: tchSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                         {
                             var tempId = idNameCodes.FindAll(fa => fa.id.Equals(item.id)).ToList();
                             if (tempId.Count == 0)
@@ -191,7 +189,7 @@ namespace TEAMModelBI.Controllers.BICommon
                     if (schoolIds.Count > 0)
                     {
                         scAreaSql.Append(BICommonWay.ManyScSql(" where c.areaId", areaIds.Select(s => s.id).ToList()));
-                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<string>(queryText: scAreaSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<string>(queryText: scAreaSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                         {
                             var tempScId = schoolIds.FindAll(fa => fa.Equals(item)).ToList();
                             if (tempScId.Count == 0)
@@ -206,7 +204,7 @@ namespace TEAMModelBI.Controllers.BICommon
                     if (schoolIds.Count > 0)
                     {
                         scTchSql.Append(BICommonWay.ManyScSql(" and c.code", schoolIds.Select(s => s.id).ToList(), $"Teacher-"));
-                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<IdNameCode>(queryText: scTchSql.ToString(), requestOptions: new QueryRequestOptions() { }))
+                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<IdNameCode>(queryText: scTchSql.ToString(), requestOptions: new QueryRequestOptions() { }))
                         {
                             var tempId = idNameCodes.FindAll(fa => fa.id.Equals(item.id)).ToList();
                             if (tempId.Count == 0)
@@ -268,7 +266,7 @@ namespace TEAMModelBI.Controllers.BICommon
                 sql.Append($" where c.id='{id}'");
 
             sql.Append($" order by c.sendTime desc ");
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<BINotice>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BINotice") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIteratorSql<BINotice>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BINotice") }))
             {
                 bINotices.Add(item);
             }

+ 3 - 3
TEAMModelBI/Controllers/BICommon/BIProductUseRecordController.cs

@@ -12,7 +12,7 @@ using TEAMModelOS.SDK.Context.Constant;
 using System.Threading.Tasks;
 using System;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BICommon;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using TEAMModelOS.SDK.Extension;
 using System.Collections.Generic;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
@@ -70,9 +70,9 @@ namespace TEAMModelBI.Controllers.BICommon
             ProductUseRecord productUseRecord = null;
             UseRecord useRecord = new();
             var resUseRecord = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{year}", new PartitionKey("ProductUseRecord"));
-            if (resUseRecord.Status == 200)
+            if (resUseRecord.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var fileJson = await JsonDocument.ParseAsync(resUseRecord.ContentStream);
+                using var fileJson = await JsonDocument.ParseAsync(resUseRecord.Content);
                 productUseRecord = fileJson.ToObject<ProductUseRecord>();
             }
 

+ 6 - 9
TEAMModelBI/Controllers/BICommon/JointlyController.cs

@@ -1,5 +1,4 @@
-using Azure.Cosmos;
-using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
 using System.Collections.Generic;
@@ -8,7 +7,7 @@ using System.Threading.Tasks;
 using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
-
+using Microsoft.Azure.Cosmos;
 namespace TEAMModelBI.Controllers.BICommon
 {
     [Route("jointly")]
@@ -49,9 +48,9 @@ namespace TEAMModelBI.Controllers.BICommon
             {
                 foreach (var temp in types)
                 {
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", _containers[temp]).GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{id}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", _containers[temp]).GetItemQueryStreamIteratorSql(queryText: $"select value(c) from c where c.id='{id}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                     {
-                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(item.Content);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                         {
                             foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -66,9 +65,9 @@ namespace TEAMModelBI.Controllers.BICommon
             {
                 foreach (var contaoner in _containers)
                 {
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", contaoner).GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{id}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", contaoner).GetItemQueryStreamIteratorSql(queryText: $"select value(c) from c where c.id='{id}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                     {
-                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(item.Content);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                         {
                             foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -79,9 +78,7 @@ namespace TEAMModelBI.Controllers.BICommon
                     }
                 }
             }
-
             return Ok(new { state = 200, infos = objs });
         }
-
     }
 }

+ 2 - 3
TEAMModelBI/Controllers/BICommon/StatsNoticeController.cs

@@ -11,12 +11,11 @@ using System.Text.Json;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Context.Constant;
 using System;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BICommon;
 using System.Collections.Generic;
 using System.Text;
-using DocumentFormat.OpenXml.Office2010.Excel;
 
 namespace TEAMModelBI.Controllers.BICommon
 {
@@ -81,7 +80,7 @@ namespace TEAMModelBI.Controllers.BICommon
                 }
                 List<StatsNotice> statsNotices = new();
 
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<StatsNotice>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("StatsNotice") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIteratorSql<StatsNotice>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("StatsNotice") }))
                 {
                     statsNotices.Add(item);
                 }

+ 10 - 10
TEAMModelBI/Controllers/BIHome/HomeStatisController.cs

@@ -6,7 +6,7 @@ using System.Linq;
 using System.Threading.Tasks;
 using System.Text.Json;
 using TEAMModelOS.SDK.DI;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.Extensions.Options;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.Models;
@@ -88,9 +88,9 @@ namespace TEAMModelBI.Controllers.BIHome
                 //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
                 List<ProvinceStandard> standards = new();
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryStreamIterator(queryText: $"select c.provCode,c.provName,c.standard from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryStreamIteratorSql(queryText: $"select c.provCode,c.provName,c.standard from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
                         var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
@@ -199,7 +199,7 @@ namespace TEAMModelBI.Controllers.BIHome
 
                 List<CityStandard> standards = new();
                 //查询省份区域
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select c.id,c.cityCode,c.cityName,c.standard from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select c.id,c.cityCode,c.cityName,c.standard from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
                 {
                     CityStandard Citystics = new CityStandard
                     {
@@ -268,7 +268,7 @@ namespace TEAMModelBI.Controllers.BIHome
 
                 List<DistrictStandard> districtStandards = new();
                 //查询省份区域
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select c.id,c.name,c.cityName,c.standard from c where c.cityCode='{_cityCode}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select c.id,c.name,c.cityName,c.standard from c where c.cityCode='{_cityCode}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
                 {
                     DistrictStandard districtStandard = new()
                     {
@@ -340,7 +340,7 @@ namespace TEAMModelBI.Controllers.BIHome
 
                 List<AllCityStics> tempAllCityStics = new();
                 //查询省份区域
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select c.id,c.name,c.cityCode,c.cityName,c.standard from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select c.id,c.name,c.cityCode,c.cityName,c.standard from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
                 {
                     AllCityStics Citystics = new()
                     {
@@ -473,10 +473,10 @@ namespace TEAMModelBI.Controllers.BIHome
                 //查询学校已使用空间大小
                 foreach (var itemId in schoolId)
                 {
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT sum(c.size) as size FROM c ",
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT sum(c.size) as size FROM c ",
                         requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{itemId}") }))
                     {
-                        var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        var json = await JsonDocument.ParseAsync(item.Content);
                         foreach (var elmt in json.RootElement.GetProperty("Documents").EnumerateArray())
                         {
                             if (elmt.TryGetProperty("size", out JsonElement _size) && _size.ValueKind.Equals(JsonValueKind.Number))
@@ -591,9 +591,9 @@ namespace TEAMModelBI.Controllers.BIHome
                 ////教师数据
                 //List<string> teacherId = new List<string>(); //教师Id集合
                 ////查询教师的大小和教师集合信息
-                //await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIterator(queryText: $"select c.id,c.size from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                //await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIteratorSql(queryText: $"select c.id,c.size from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 //{
-                //    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                //    using var json = await JsonDocument.ParseAsync(item.Content);
                 //    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                 //    {
                 //        totalSize += obj.GetProperty("size").GetInt64();

+ 3 - 3
TEAMModelBI/Controllers/BIHome/OnLineController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Azure.Storage.Blobs;
 using Azure.Storage.Blobs.Models;
 using Microsoft.AspNetCore.Http;
@@ -521,12 +521,12 @@ namespace TEAMModelBI.Controllers.BIHome
          
 
             var ScSql = $"select c.id,c.name,c.size,c.scale, c.edition, c.service from c";
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<RecScEd>(queryText: ScSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<RecScEd>(queryText: ScSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
             {
                 scEdCnt.Add(item);
             }
             
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<RecScEd>(queryText: ScSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("VirtualBase") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<RecScEd>(queryText: ScSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("VirtualBase") }))
             {
                 scEdCnt.Add(item);
             }          

+ 7 - 8
TEAMModelBI/Controllers/BINormal/AbilityMgmtController.cs

@@ -10,14 +10,13 @@ using TEAMModelOS.SDK.Models;
 using TEAMModelOS.Models;
 using Microsoft.Extensions.Options;
 using System.Text.Json;
-using Azure.Cosmos;
-using HTEXLib.COMM.Helpers;
+using Microsoft.Azure.Cosmos;
 using System.Text;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelBI.Filter;
 using TEAMModelBI.Tool.Extension;
 using TEAMModelOS.SDK.Context.BI;
-
+using TEAMModelOS.SDK;
 namespace TEAMModelBI.Controllers.BINormal
 {
     [Route("biabilitymgmt")]
@@ -63,7 +62,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
                 List<Ability> abilities = new();
                 string sqltxt = "select value(c) from c";
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{standard}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{standard}") }))
                 {
                     abilities.Add(item);
                 }
@@ -141,7 +140,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 List<AbilityTask> syllabus = new();
                 string sql = $"select value(c) from c where c.abilityId='{id}'";
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"Ability-{standard}"));
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{standard}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{standard}") }))
                 {
                     syllabus.Add(item);
                 }
@@ -150,14 +149,14 @@ namespace TEAMModelBI.Controllers.BINormal
                     var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(syllabus.Select(x => x.id).ToList(), $"AbilityTask-{standard}");
                 }
 
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     //保存操作记录
                     await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "abilityTask-del", $"{_tmdName}【{_tmdId}】删除册别,删除ID:{id}", _dingDing, httpContext: HttpContext);
 
                     return Ok(new { state = 200 });
                 }
-                else return Ok(new { state = response.Status });
+                else return Ok(new { state = response.StatusCode });
             }
             catch (Exception ex)
             {
@@ -214,7 +213,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     {
                         sqltxt.Append($" and c.dimension = '{ability.dimension}' and c.name = '{ability.name}'  and c.no = '{ability.no}' ");
                         List<Ability> abilities = new List<Ability>();
-                        await foreach (var item in azureClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: sqltxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(ability.code) }))
+                        await foreach (var item in azureClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: sqltxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(ability.code) }))
                         {
                             abilities.Add(item);
                         }

+ 9 - 9
TEAMModelBI/Controllers/BINormal/AbilityTaskMgmtController.cs

@@ -10,8 +10,6 @@ using TEAMModelOS.Models;
 using Microsoft.Extensions.Options;
 using System.Text.Json;
 using TEAMModelOS.SDK.Models;
-using Azure.Cosmos;
-using HTEXLib.COMM.Helpers;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using System.Text;
 using TEAMModelBI.Filter;
@@ -19,6 +17,8 @@ using TEAMModelOS.SDK.Services;
 using TEAMModelBI.Tool.Extension;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Context.BI;
+using TEAMModelOS.SDK;
+using Microsoft.Azure.Cosmos;
 
 namespace TEAMModelBI.Controllers.BINormal
 {
@@ -76,7 +76,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 {
                     return Ok(new { state = 400,message="该ID未找到章节" });
                 }
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c where c.abilityId='{abilityId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{standard}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c where c.abilityId='{abilityId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{standard}") }))
                 {
                     var rns = item.children.Select(x => x.rnodes);
                     if (rns != null)
@@ -174,7 +174,7 @@ namespace TEAMModelBI.Controllers.BINormal
                             abilityTask.scope = abilityTaskTree.scope;
                             abilityTask.codeval = $"{recordAbilityTask.standard}";
                             abilityTask.standard = $"{recordAbilityTask.standard}";
-                            await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Normal").CreateItemAsync<AbilityTask>(abilityTask, new Azure.Cosmos.PartitionKey($"AbilityTask-{recordAbilityTask.standard}"));
+                            await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Normal").CreateItemAsync<AbilityTask>(abilityTask, new PartitionKey($"AbilityTask-{recordAbilityTask.standard}"));
                             msgBuilder.Append($"新增章节功能,章节ID:{abilityTask.id} 分区键:{abilityTask.code}");
                             type = "abilityTask-add";
                         }
@@ -188,7 +188,7 @@ namespace TEAMModelBI.Controllers.BINormal
                             AbilityService.TreeToList(abilityTaskTree.trees, nodes, now);
                             abilityTask.children = nodes;
                             abilityTaskTree.auth = abilityTask.auth;
-                            await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Normal").ReplaceItemAsync<AbilityTask>(abilityTask, abilityTask.id, new Azure.Cosmos.PartitionKey($"AbilityTask-{recordAbilityTask.standard}"));
+                            await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Normal").ReplaceItemAsync<AbilityTask>(abilityTask, abilityTask.id, new PartitionKey($"AbilityTask-{recordAbilityTask.standard}"));
                             msgBuilder.Append($"修改章节功能,章节ID:{abilityTask.id} 分区键:{abilityTask.code}");
                             type = "abilityTask-update";
                         }
@@ -215,7 +215,7 @@ namespace TEAMModelBI.Controllers.BINormal
                             codeval = $"{recordAbilityTask.standard}",
                             standard = $"{recordAbilityTask.standard}"
                         };
-                        await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Normal").CreateItemAsync<AbilityTask>(abilityTask, new Azure.Cosmos.PartitionKey($"AbilityTask-{recordAbilityTask.standard}"));
+                        await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Normal").CreateItemAsync<AbilityTask>(abilityTask, new PartitionKey($"AbilityTask-{recordAbilityTask.standard}"));
 
                         msgBuilder.Append($"新增章节功能,章节ID:{abilityTask.id} 分区键:{abilityTask.code}");
                         type = "abilityTask-add";
@@ -263,14 +263,14 @@ namespace TEAMModelBI.Controllers.BINormal
                 //}
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"AbilityTask-{standard}"));
 
-                string msg = $"{_tmdName}【{_tmdId}】删除册别,删除状态:{response.Status},删除ID:{id}";
+                string msg = $"{_tmdName}【{_tmdId}】删除册别,删除状态:{response.StatusCode},删除ID:{id}";
 
                 //保存操作记录
                 await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "abilitytask-del", msg, _dingDing, httpContext: HttpContext);
-                if (response.Status == 204)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     return Ok(new { state = 200 });
                 else
-                    return Ok(new { state = response.Status });
+                    return Ok(new { state = response.StatusCode });
             }
             catch (Exception ex)
             {

+ 21 - 21
TEAMModelBI/Controllers/BINormal/AreaRelevantController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Configuration;
@@ -79,9 +79,9 @@ namespace TEAMModelBI.Controllers.BINormal
                     sqltxt = $"SELECT c.code,c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c join m in c.manyAreas WHERE (c.areaId ='{_areaId}' or m.areaId='{_areaId}')";
                 }
                 //IES5實體學校
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")})) 
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: sqltxt, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")})) 
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0) 
                     {
                         foreach(var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -118,9 +118,9 @@ namespace TEAMModelBI.Controllers.BINormal
                     }
                 }
                 //虛擬學校
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("VirtualBase") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("VirtualBase") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -185,9 +185,9 @@ namespace TEAMModelBI.Controllers.BINormal
                 //}
 
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("AreaSetting"));
-                if (responseSet.Status == 200)
+                if (responseSet.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                    using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                     AreaSetting delSet = fileJson.ToObject<AreaSetting>();
                     if (!string.IsNullOrEmpty(delSet.accessConfig))
                         return Ok(new { state = 401, msg = "区域已经规定了,不能切换能能力" });
@@ -200,7 +200,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     tempSchool.standard = null;
 
                     List<Teacher> teachers = new();
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Teacher>(queryText: $"SELECT value(c) FROM c join s in c.schools where s.schoolId ='{schoolId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<Teacher>(queryText: $"SELECT value(c) FROM c join s in c.schools where s.schoolId ='{schoolId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                     {
                         teachers.Add(item);
                     }
@@ -291,9 +291,9 @@ namespace TEAMModelBI.Controllers.BINormal
 
             Teacher teacher = new();
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 teacher = json.ToObject<Teacher>();
                 var existArea = teacher.areas.Find(f => f.areaId.Equals($"{areaId}"));
                 if (existArea == null)
@@ -331,13 +331,13 @@ namespace TEAMModelBI.Controllers.BINormal
                         foreach (var item in schoolMs)
                         {
                             var resSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{item.id}", new PartitionKey($"Base"));
-                            if (resSc.Status == 200)
+                            if (resSc.StatusCode == System.Net.HttpStatusCode.OK)
                             {
                                 SchoolTeacher schoolTeacher = null;
                                 var resScTch = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{item.id}"));
-                                if (resScTch.Status == 200)
+                                if (resScTch.StatusCode == System.Net.HttpStatusCode.OK)
                                 {
-                                    using var json = await JsonDocument.ParseAsync(resScTch.ContentStream);
+                                    using var json = await JsonDocument.ParseAsync(resScTch.Content);
                                     schoolTeacher = json.ToObject<SchoolTeacher>();
                                     if (!schoolTeacher.roles.Contains("admin"))
                                     {
@@ -414,7 +414,7 @@ namespace TEAMModelBI.Controllers.BINormal
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             
             List<BaseInfo> areaManages = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<BaseInfo>(queryText:$"select c.id,c.name,c.picture from c join a in c.areas where a.areaId ='{areaId}' and c.code='Base'",requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<BaseInfo>(queryText:$"select c.id,c.name,c.picture from c join a in c.areas where a.areaId ='{areaId}' and c.code='Base'",requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
             {
                 areaManages.Add(item);
             }
@@ -443,9 +443,9 @@ namespace TEAMModelBI.Controllers.BINormal
 
             Teacher teacher = null;
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 teacher = json.ToObject<Teacher>();
                 var existArea = teacher.areas.Find(f => f.areaId.Equals($"{areaId}"));
                 if (existArea != null)
@@ -488,7 +488,7 @@ namespace TEAMModelBI.Controllers.BINormal
             else
                 areaScSql.Append(" where c.areaId = null or c.areaId = ''");
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AreaSchool>(queryText: areaScSql.ToString(),requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<AreaSchool>(queryText: areaScSql.ToString(),requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
             {
                 areaSchool.Add(item);
             }
@@ -496,9 +496,9 @@ namespace TEAMModelBI.Controllers.BINormal
             areaSchool.ForEach(async areaSc =>
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(areaSc.id, new PartitionKey("ProductSum"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                     {
                         areaSc.serial = serial.ToObject<List<SchoolProductSumData>>().Count;//.Select(x => x.prodCode).ToList();
@@ -551,7 +551,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 scIdsSql = "select value(c.id) from c where c.areaId = null or c.areaId = ''";
             scIds = await CommonFind.GetValueSingle(cosmosClient, "School", scIdsSql, "Base");
 
-            //await foreach (var itemId in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: scIdsSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") })) 
+            //await foreach (var itemId in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: scIdsSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") })) 
             //{
             //    scIds.Add(itemId);
             //}
@@ -559,7 +559,7 @@ namespace TEAMModelBI.Controllers.BINormal
             foreach (var scId in scIds)
             {
                 string tchIdSql = $"select value(c.id) from c where array_contains(c.roles,'assist',true) and c.pk='Teacher'";
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: tchIdSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: tchIdSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
                 {
                     tchIds.Add(item);
                 }

+ 61 - 63
TEAMModelBI/Controllers/BINormal/BatchAreaController.cs

@@ -9,9 +9,8 @@ using System.Threading.Tasks;
 using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Models;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System.Text.Json;
-using HTEXLib.COMM.Helpers;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
 using Azure.Messaging.ServiceBus;
@@ -28,7 +27,6 @@ using System.Net;
 using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.Context.BI;
 using System.Text;
-using DocumentFormat.OpenXml.Bibliography;
 using Microsoft.Extensions.Hosting;
 using Microsoft.AspNetCore.Hosting;
 using TEAMModelOS.SDK.Context.Constant;
@@ -133,9 +131,9 @@ namespace TEAMModelBI.Controllers.BINormal
                     }
                 }
 
-                await foreach (var itemArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryStreamIterator(queryText: areaSql.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base-Area") })) 
+                await foreach (var itemArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryStreamIteratorSql(queryText: areaSql.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base-Area") })) 
                 {
-                    using var json = await JsonDocument.ParseAsync(itemArea.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(itemArea.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0) 
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -143,9 +141,9 @@ namespace TEAMModelBI.Controllers.BINormal
                             areas.Add(obj.ToObject<RecArea>());
                         }
 
-                        if (iscontinuation) 
+                        if (iscontinuation)
                         {
-                            continuationToken = itemArea.GetContinuationToken();
+                            continuationToken = itemArea.ContinuationToken;
                             break;
                         }
                     } 
@@ -159,7 +157,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 //    //List<AreaQuoteRecord> aqr = await table.QueryWhereString<AreaQuoteRecord>($"PartitionKey eq 'QuoteRecord' and  areaId eq '{area.id}'");
                 //    //aqr.Sort((x, y) => y.RowKey.CompareTo(x.RowKey));
 
-                //    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<string>(queryText: $"select value(c.accessConfig) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
+                //    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<string>(queryText: $"select value(c.accessConfig) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
                 //    {
                 //        if (string.IsNullOrEmpty(item))
                 //            area.cutArea = false;
@@ -178,7 +176,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     //List<AreaQuoteRecord> aqr = await table.QueryWhereString<AreaQuoteRecord>($"PartitionKey eq 'QuoteRecord' and  areaId eq '{area.id}'");
                     //aqr.Sort((x, y) => y.RowKey.CompareTo(x.RowKey));
 
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<string>(queryText: $"select value(c.accessConfig) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<string>(queryText: $"select value(c.accessConfig) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
                     {
                         if (string.IsNullOrEmpty(item))
                             area.cutArea = false;
@@ -249,7 +247,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 queryText += $"WHERE c.standard='{standard}'";
                 queryText += $" OR c.name='{name}'";
                 if(!string.IsNullOrWhiteSpace(shortCode)) queryText += $" OR c.shortCode='{shortCode}'";
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"{queryText}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"{queryText}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
                 {
                     //查询新的是否存在
                     if (item.standard.Equals($"{standard}"))
@@ -263,14 +261,14 @@ namespace TEAMModelBI.Controllers.BINormal
                 }
 
                 //查询新的是否存在
-                //await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c where c.standard='{standard}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+                //await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select value(c) from c where c.standard='{standard}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
                 //{
                 //    if (item.standard.Equals($"{standard}"))
                 //        return Ok(new { state = 1, message = "新创区的standard已存在请检查" });
                 //}
 
                 //查询新的区级名称是否存在
-                //await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c where c.name='{name}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+                //await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select value(c) from c where c.name='{name}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
                 //{
                 //    if (item.name.Equals($"{name}"))
                 //        return Ok(new { state = 1, message = "区级名称相同,请检测区级名称!" });
@@ -370,7 +368,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 if (!string.IsNullOrEmpty($"{oldStandard}") && !string.IsNullOrEmpty($"{_oldId}"))
                 {
                     //查询要复制区域的能力标准点 
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{oldStandard}") }))
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{oldStandard}") }))
                     {
                         if (!string.IsNullOrEmpty(item.blob))
                         {
@@ -408,7 +406,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     try
                     {
                         //微能力点
-                        await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{oldStandard}") }))
+                        await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{oldStandard}") }))
                         {
                             List<Tnode> tnodes = new List<Tnode>();
                             foreach (Tnode tnode in atask.children)
@@ -454,7 +452,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     //}
 
                     //新政策文件
-                    await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where  c.id='{_oldId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
+                    await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<StandardFile>(queryText: $"select value(c) from c where  c.id='{_oldId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
                     {
                         if (standardFile != null)
                         {
@@ -465,7 +463,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     }
 
                     //新的区域设置
-                    await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: $"select value(c) from c where c.id='{_oldId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
+                    await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AreaSetting>(queryText: $"select value(c) from c where c.id='{_oldId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
                     {
                         if (areaSetting != null)
                         {
@@ -478,14 +476,14 @@ namespace TEAMModelBI.Controllers.BINormal
                 else
                 {
                     Area area = null;
-                    await foreach (var tempArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c where c.standard='standard2'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+                    await foreach (var tempArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select value(c) from c where c.standard='standard2'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
                     {
                         area = tempArea;
                     }
                     if (area != null)
                     {
                         //查询要复制区域的能力标准点 
-                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
+                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
                         {
                             if (!string.IsNullOrEmpty(item.blob))
                             {
@@ -524,7 +522,7 @@ namespace TEAMModelBI.Controllers.BINormal
                         try
                         {
                             //微能力点
-                            await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
+                            await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
                             {
                                 List<Tnode> tnodes = new List<Tnode>();
                                 foreach (Tnode tnode in atask.children)
@@ -571,7 +569,7 @@ namespace TEAMModelBI.Controllers.BINormal
                         //}
 
                         //新政策文件
-                        await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where  c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
+                        await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<StandardFile>(queryText: $"select value(c) from c where  c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
                         {
                             if (standardFile != null)
                             {
@@ -582,7 +580,7 @@ namespace TEAMModelBI.Controllers.BINormal
                         }
 
                         //新的区域设置
-                        await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: $"select value(c) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
+                        await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AreaSetting>(queryText: $"select value(c) from c where c.id='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
                         {
                             if (areaSetting != null)
                             {
@@ -669,7 +667,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 }
                 queryWhere = $"WHERE ({queryWhere}) AND c.id != '{id}'";
                 queryText = $"{queryText}{queryWhere}";
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"{queryText}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"{queryText}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
                 {
                     //查询区级名称是否存在
                     if (item.name.Equals($"{name}"))
@@ -689,18 +687,18 @@ namespace TEAMModelBI.Controllers.BINormal
                 var _azureCosmosClientCsv2Read = _azureCosmos.GetCosmosClient(name: "CoreServiceV2CnRead");
                 //學校資料庫驗證 [式樣待確認,先封印]
                 ///學區簡碼重複驗證
-                //await foreach (var item in _azureCosmosClientCsv2Read.GetContainer("Core", "School").GetItemQueryStreamIterator(queryText: sqlCheckRep, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("district") })) 
+                //await foreach (var item in _azureCosmosClientCsv2Read.GetContainer("Core", "School").GetItemQueryStreamIteratorSql(queryText: sqlCheckRep, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("district") })) 
                 //{
-                //    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                //    using var json = await JsonDocument.ParseAsync(item.Content);
                 //    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
                 //    {
                 //        return Ok(new { state = 1, message = "此学区简码与其他 [学区] 简码相同请检查!" });
                 //    }                    
                 //}
                 ///學校簡碼重複驗證
-                //await foreach (var item in _azureCosmosClientCsv2Read.GetContainer("Core", "School").GetItemQueryStreamIterator(queryText: sqlCheckRep, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base") }))
+                //await foreach (var item in _azureCosmosClientCsv2Read.GetContainer("Core", "School").GetItemQueryStreamIteratorSql(queryText: sqlCheckRep, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base") }))
                 //{
-                //    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                //    using var json = await JsonDocument.ParseAsync(item.Content);
                 //    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
                 //    {
                 //        return Ok(new { state = 1, message = "此学区简码与其他 [学校] 简码相同请检查!" });
@@ -768,9 +766,9 @@ namespace TEAMModelBI.Controllers.BINormal
                 var table = tableClient.GetTableReference("IESLogin");
 
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_oldId}", new PartitionKey("AreaSetting"));
-                if (responseSet.Status == 200)
+                if (responseSet.StatusCode == HttpStatusCode.OK)
                 {
-                    using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                    using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                     AreaSetting delSet = fileJson.ToObject<AreaSetting>();
                     if (!string.IsNullOrEmpty(delSet.accessConfig))
                         return Ok(new { state = 401, msg = "区域已经规定了,不能切换能能力" });
@@ -782,7 +780,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 List<string> abilityIds = new();  //册别的ID集合
 
                 //查询册别信息
-                await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_oldStandard}") }))
+                await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_oldStandard}") }))
                 {
                     abilityIds.Add(tempAbility.id);  //查询出来册别ID添加册别ID集合
                 }
@@ -793,7 +791,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 }
 
                 List<string> abilityTaskIds = new();  //章节ID集合
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
                 {
                     abilityTaskIds.Add(item.id);   //查询出来的章节信息ID添加到战绩集合
                 }
@@ -807,7 +805,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 List<Task<ItemResponse<AbilityTask>>> abilityTasks = new();  //存储章节
 
                 //查询要复制区域的能力标准点 
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_newStandard}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_newStandard}") }))
                 {
                     if (!string.IsNullOrEmpty(item.blob))
                     {
@@ -846,7 +844,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 try
                 {
                     //微能力点
-                    await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_newStandard}") }))
+                    await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_newStandard}") }))
                     {
                         List<Tnode> tnodes = new();
                         foreach (Tnode tnode in atask.children)
@@ -885,7 +883,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 StandardFile saveFile = new();
 
                 //新政策文件
-                await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where  c.id='{_newId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
+                await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<StandardFile>(queryText: $"select value(c) from c where  c.id='{_newId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
                 {
                     if (standardFile != null)
                     {
@@ -899,9 +897,9 @@ namespace TEAMModelBI.Controllers.BINormal
                 if (saveFile.id != null)
                 {
                     var respFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(saveFile.id, new PartitionKey("StandardFile"));
-                    if (respFile.Status == 200)
+                    if (respFile.StatusCode == HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(respFile.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(respFile.Content);
                         tempFile = json.ToObject<StandardFile>();
                         await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<StandardFile>(tempFile.id, new PartitionKey("StandardFile"));
                     }
@@ -911,7 +909,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
                 //新的区域设置
                 AreaSetting saveSetting = new AreaSetting();
-                await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: $"select value(c) from c where c.id='{_newId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
+                await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AreaSetting>(queryText: $"select value(c) from c where c.id='{_newId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
                 {
                     if (areaSetting != null)
                     {
@@ -926,9 +924,9 @@ namespace TEAMModelBI.Controllers.BINormal
                 if (saveSetting.id != null)
                 {
                     var respSetting = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(saveSetting.id, new PartitionKey("AreaSetting"));
-                    if (respSetting.Status == 200)
+                    if (respSetting.StatusCode == HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(respSetting.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(respSetting.Content);
                         tempSetting = json.ToObject<AreaSetting>();
                         await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<AreaSetting>(tempFile.id, new PartitionKey("AreaSetting"));
                     }
@@ -1005,16 +1003,16 @@ namespace TEAMModelBI.Controllers.BINormal
             //}
 
             var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("Base-Area"));
-            if (response.Status == 200)
+            if (response.StatusCode == HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 Area area = json.ToObject<Area>();
                 if (area.standard == $"{standard}") 
                 {
                     await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<Area>(area.id, new PartitionKey("Base-Area")); //删除区
 
                     List<Teacher> teachers = new();
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Teacher>(queryText: $"SELECT distinct value(c) FROM c join a in c.areas join s in c.schools where a.areaId='{area.id}' or s.areaId='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") })) 
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<Teacher>(queryText: $"SELECT distinct value(c) FROM c join a in c.areas join s in c.schools where a.areaId='{area.id}' or s.areaId='{area.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") })) 
                     {
                         teachers.Add(item);
                     }
@@ -1044,7 +1042,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     List<string> abilityTaskIds = new();  //章节ID集合
 
                     //查询册别信息
-                    await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
+                    await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
                     {
                         abilityIds.Add(tempAbility.id);  //查询出来册别ID添加册别ID集合
                     }
@@ -1054,7 +1052,7 @@ namespace TEAMModelBI.Controllers.BINormal
                         var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityIds, $"Ability-{area.standard}");
                     }
 
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
                     {
                         abilityTaskIds.Add(item.id);   //查询出来的章节信息ID添加到战绩集合
                     }
@@ -1066,9 +1064,9 @@ namespace TEAMModelBI.Controllers.BINormal
                     //区域政策文件
                     StandardFile delFile = new();
                     var responseFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(area.id, new PartitionKey("StandardFile"));
-                    if(responseFile.Status == 200)
+                    if(responseFile.StatusCode == HttpStatusCode.OK)
                     {
-                        using var fileJson = await JsonDocument.ParseAsync(responseFile.ContentStream);
+                        using var fileJson = await JsonDocument.ParseAsync(responseFile.Content);
                         delFile = fileJson.ToObject<StandardFile>();
                         await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<StandardFile>(delFile.id, new PartitionKey("StandardFile"));
                     }
@@ -1076,16 +1074,16 @@ namespace TEAMModelBI.Controllers.BINormal
                     //区域设置
                     AreaSetting delSet = new();
                     var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(area.id, new PartitionKey("AreaSetting"));
-                    if (responseSet.Status == 200)
+                    if (responseSet.StatusCode == HttpStatusCode.OK)
                     {
-                        using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                        using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                         delSet = fileJson.ToObject<AreaSetting>();
                         await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<AreaSetting>(delSet.id, new PartitionKey("AreaSetting"));
                     }
 
                     List<object> fileobj = new();
                     //先删除原有的文件
-                    List<Task<Response<bool>>> DelList = new();
+                    List<Task<Azure.Response<bool>>> DelList = new();
                     await foreach (BlobItem blobItem in blobClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, $"yxpt/{area.standard}/"))
                     {
                         fileobj.Add(blobItem.Name);
@@ -1101,7 +1099,7 @@ namespace TEAMModelBI.Controllers.BINormal
                         int pages = (DelList.Count + 255) / 256;
                         for (int i = 0; i < pages; i++)
                         {
-                            List<Task<Response<bool>>> delList = DelList.Skip((i) * 256).Take(256).ToList();
+                            List<Task<Azure.Response<bool>>> delList = DelList.Skip((i) * 256).Take(256).ToList();
                             await Task.WhenAll(delList);
                         }
                     }
@@ -1150,9 +1148,9 @@ namespace TEAMModelBI.Controllers.BINormal
                 if (area != null)
                 {
                     var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_oldId}", new PartitionKey("AreaSetting"));
-                    if (responseSet.Status == 200)
+                    if (responseSet.StatusCode == HttpStatusCode.OK)
                     {
-                        using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                        using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                         AreaSetting delSet = fileJson.ToObject<AreaSetting>();
                         if (!string.IsNullOrEmpty(delSet.accessConfig))
                             return Ok(new { state = 401, msg = "区域已经规定了,不能切换能能力" });
@@ -1161,7 +1159,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     List<string> abilityIds = new();  //册别的ID集合
 
                     //查询册别信息
-                    await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
+                    await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
                     {
                         abilityIds.Add(tempAbility.id);  //查询出来册别ID添加册别ID集合
                     }
@@ -1172,7 +1170,7 @@ namespace TEAMModelBI.Controllers.BINormal
                     }
 
                     List<string> abilityTaskIds = new List<string>();  //章节ID集合
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
                     {
                         abilityTaskIds.Add(item.id);   //查询出来的章节信息ID添加到战绩集合
                     }
@@ -1192,7 +1190,7 @@ namespace TEAMModelBI.Controllers.BINormal
                         try
                         {
                             //查询要复制区域的能力标准点 
-                            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{newstand.standard}") }))
+                            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{newstand.standard}") }))
                             {
                                 if (!string.IsNullOrEmpty(item.blob))
                                     item.blob = item.blob.Replace($"/{newstand.standard}/", $"/{area.standard}/");
@@ -1206,7 +1204,7 @@ namespace TEAMModelBI.Controllers.BINormal
                                 //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(item, new PartitionKey($"Ability-{_oldStandard}"));
 
                                 var respond = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(item.id, new PartitionKey(item.code));
-                                if (respond.Status != 200)
+                                if (respond.StatusCode != HttpStatusCode.OK)
                                     abilities.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(item, new PartitionKey($"Ability-{area.standard}")));
                                 else
                                     repeatAbilityId.Add(item.id);
@@ -1241,7 +1239,7 @@ namespace TEAMModelBI.Controllers.BINormal
                         try
                         {
                             //微能力点
-                            await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{newstand.standard}") }))
+                            await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{newstand.standard}") }))
                             {
                                 List<Tnode> tnodes = new();
                                 foreach (Tnode tnode in atask.children)
@@ -1268,7 +1266,7 @@ namespace TEAMModelBI.Controllers.BINormal
                                 atask.codeval = $"{area.standard}";
 
                                 var respond = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(atask.id, new PartitionKey(atask.code));
-                                if (respond.Status != 200)
+                                if (respond.StatusCode != HttpStatusCode.OK)
                                     ////添加区能力标准点中的节点 
                                     //abilityTasks.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{_oldStandard}")));
                                     await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").CreateItemAsync(atask, new PartitionKey($"AbilityTask-{area.standard}"));
@@ -1309,7 +1307,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
                     StandardFile saveFile = new();
                     //新政策文件
-                    await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where  c.id='{standardFileId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
+                    await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<StandardFile>(queryText: $"select value(c) from c where  c.id='{standardFileId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
                     {
                         if (standardFile != null)
                         {
@@ -1324,9 +1322,9 @@ namespace TEAMModelBI.Controllers.BINormal
                     if (saveFile.id != null)
                     {
                         var respFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(saveFile.id, new PartitionKey("StandardFile"));
-                        if (respFile.Status == 200)
+                        if (respFile.StatusCode == HttpStatusCode.OK)
                         {
-                            using var json = await JsonDocument.ParseAsync(respFile.ContentStream);
+                            using var json = await JsonDocument.ParseAsync(respFile.Content);
                             tempFile = json.ToObject<StandardFile>();
                             await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<StandardFile>(tempFile.id, new PartitionKey("StandardFile"));
                         }
@@ -1344,7 +1342,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
                     //新的区域设置
                     AreaSetting saveSetting = new();
-                    await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: $"select value(c) from c where c.id='{standardFileId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
+                    await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AreaSetting>(queryText: $"select value(c) from c where c.id='{standardFileId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
                     {
                         if (areaSetting != null)
                         {
@@ -1359,9 +1357,9 @@ namespace TEAMModelBI.Controllers.BINormal
                     if (saveSetting.id != null)
                     {
                         var respSetting = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync(saveSetting.id, new PartitionKey("AreaSetting"));
-                        if (respSetting.Status == 200)
+                        if (respSetting.StatusCode == HttpStatusCode.OK)
                         {
-                            using var json = await JsonDocument.ParseAsync(respSetting.ContentStream);
+                            using var json = await JsonDocument.ParseAsync(respSetting.Content);
                             tempSetting = json.ToObject<AreaSetting>();
                             await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemAsync<AreaSetting>(saveSetting.id, new PartitionKey("AreaSetting"));
                         }

+ 14 - 14
TEAMModelBI/Controllers/BINormal/BusinessConfigController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -71,7 +71,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
                 await cosmosClient.GetContainer("TEAMModelOS", "Normal").CreateItemAsync<BizConfig>(bizConfig, new PartitionKey("BizConfig"));
 
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<BizUsers>(queryText: $"select value(c) from c where c.mobile ={bizConfig.mobile}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") })) 
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<BizUsers>(queryText: $"select value(c) from c where c.mobile ={bizConfig.mobile}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") })) 
                 {
                     bizUsers.Add(item);
                 }
@@ -103,9 +103,9 @@ namespace TEAMModelBI.Controllers.BINormal
             else
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync(bizConfig.id, new PartitionKey("BizConfig"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     BizConfig tempBizConfig = json.ToObject<BizConfig>();
 
                     bizConfig.pk = "BizConfig";
@@ -146,7 +146,7 @@ namespace TEAMModelBI.Controllers.BINormal
             }
 
             List<Business> businesses = new();
-            await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<Business>(queryText: sqlTxt.ToString(), requestOptions:  new QueryRequestOptions() { PartitionKey = new PartitionKey("BizConfig") }))
+            await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<Business>(queryText: sqlTxt.ToString(), requestOptions:  new QueryRequestOptions() { PartitionKey = new PartitionKey("BizConfig") }))
             {
                 businesses.Add(items);
             }
@@ -172,14 +172,14 @@ namespace TEAMModelBI.Controllers.BINormal
                 //企業聯絡人 刪除該企業聯絡資訊
                 List<string> bizUsersIdList = new List<string>();
                 StringBuilder sql = new($"SELECT VALUE c.id FROM c JOIN r IN c.relation WHERE r.bizId = '{id}'");
-                await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<string>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") })) {
+                await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<string>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") })) {
                     bizUsersIdList.Add(items);
                 }
                 if(bizUsersIdList.Count > 0)
                 {
                     string bizUsersIdListStr = JsonSerializer.Serialize(bizUsersIdList);
                     sql = new($"SELECT * FROM c WHERE ARRAY_CONTAINS({bizUsersIdListStr}, c.id, true)");
-                    await foreach (BizUsers item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<BizUsers>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
+                    await foreach (BizUsers item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<BizUsers>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
                     {
                         item.relation.RemoveAll(r => r.bizId == $"{id}");
                         await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReplaceItemAsync<BizUsers>(item, item.id, new PartitionKey("BizUsers"));
@@ -229,9 +229,9 @@ namespace TEAMModelBI.Controllers.BINormal
             BizConfig bizConfig = new();
 
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 bizConfig = json.ToObject<BizConfig>();
                 var auth_token = JwtAuthExtension.CreateBusinessApiToken(_option.Location, bizConfig.id, _option.JwtSecretKey, bizConfig.isCustomize);
                 bizConfig.jti = auth_token.jti;
@@ -284,9 +284,9 @@ namespace TEAMModelBI.Controllers.BINormal
             List<BizSchool> noBizSc = new();
             BizConfig bizConfig = new();
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
-            if (response.Status == RespondCode.Ok)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 bizConfig = json.ToObject<BizConfig>();
                 foreach (var item in bizSchool)
                 {
@@ -345,7 +345,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
             List<OpenSchool> openSchools = new();
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<OpenSchool>(queryText: "select c.id,c.code,c.name,c.picture from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<OpenSchool>(queryText: "select c.id,c.code,c.name,c.picture from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 openSchools.Add(item);
             }
@@ -353,9 +353,9 @@ namespace TEAMModelBI.Controllers.BINormal
             if (!string.IsNullOrEmpty($"id"))
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
-                if (response.Status == RespondCode.Ok)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     bizConfig = json.ToObject<BizConfig>();
                     if (bizConfig.schools.Count > 0)
                     {

+ 11 - 11
TEAMModelBI/Controllers/BINormal/BusinessUsersController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Configuration;
@@ -64,7 +64,7 @@ namespace TEAMModelBI.Controllers.BINormal
             }
 
             List<BizUsers> bizUsers = new();
-            await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<BizUsers>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
+            await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<BizUsers>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
             {
                 bizUsers.Add(items);
             }
@@ -112,9 +112,9 @@ namespace TEAMModelBI.Controllers.BINormal
             else 
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync(bizUsers.id, new PartitionKey("BizUsers"));
-                if (response.Status == RespondCode.Ok)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     BizUsers tempbizUsers = json.ToObject<BizUsers>();
 
                     bizUsers.pk = "BizUsers";
@@ -152,7 +152,7 @@ namespace TEAMModelBI.Controllers.BINormal
             string sql = $"select value(c) from c where c.mobile ={mobile}";
 
             List<BizUsers> bizUsers = new();
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS,"Normal").GetItemQueryIterator<BizUsers>(queryText:sql,requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS,"Normal").GetItemQueryIteratorSql<BizUsers>(queryText:sql,requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
             {
                 bizUsers.Add(item);
             }
@@ -193,9 +193,9 @@ namespace TEAMModelBI.Controllers.BINormal
             StringBuilder strMsg = new($"{tmdName}[{tmdId}]操作:");
             string salt = Utils.CreatSaltString(8);
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizUsers"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 bizUsers = json.ToObject<BizUsers>();
                 bizUsers.salt = salt;
                 bizUsers.pwd = Utils.HashedPassword(bizUsers.mobile.ToString(), salt);
@@ -279,9 +279,9 @@ namespace TEAMModelBI.Controllers.BINormal
             else { return Ok(new { state = RespondCode.ParamsError, msg = "类型错误" }); }
 
             var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizUsers"));
-            if (response.Status == RespondCode.Ok)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 bizUsers = json.ToObject<BizUsers>();
             }
 
@@ -310,7 +310,7 @@ namespace TEAMModelBI.Controllers.BINormal
                 }
             }
 
-            if (response.Status == RespondCode.Ok) 
+            if (response.StatusCode == System.Net.HttpStatusCode.OK) 
             {
                 bizUsers = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReplaceItemAsync<BizUsers>(bizUsers, bizUsers.id, new PartitionKey("BizUsers"));
             }
@@ -345,7 +345,7 @@ namespace TEAMModelBI.Controllers.BINormal
 
             List<BizUsers> businessUsers = new();
             string sql = $"select value(c) from c join s in c.relation  where c.code='BizUsers' and s.bizId = '{id}'";
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<BizUsers>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<BizUsers>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
             {
                 businessUsers.Add(item);
             }

Разлика између датотеке није приказан због своје велике величине
+ 153 - 16
TEAMModelBI/Controllers/BIProductAnalysis/ProductAnalysisController.cs


+ 63 - 69
TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs

@@ -1,5 +1,4 @@
-using Azure.Cosmos;
-using HTEXLib.COMM.Helpers;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -32,13 +31,8 @@ using TEAMModelOS.SDK.Context.Constant;
 using Pipelines.Sockets.Unofficial.Arenas;
 using Microsoft.Identity.Client;
 using TEAMModelOS.SDK.Models.Dtos;
-using DocumentFormat.OpenXml.Spreadsheet;
-using DocumentFormat.OpenXml.Wordprocessing;
-using DocumentFormat.OpenXml.Bibliography;
-using HTEXLib;
 using TEAMModelOS.SDK.Models.Service.BI;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BISchool;
-using DocumentFormat.OpenXml.Vml.Office;
 using System.Net.Http.Headers;
 using System.Text.Encodings.Web;
 using System.ComponentModel.DataAnnotations;
@@ -118,7 +112,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     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;
+                    if (schoolStatu.StatusCode != HttpStatusCode.OK) tempStaus = false;
                     else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
                 } while (tempStaus);
                 createScInfo.Add(createSchoolInfo);
@@ -167,9 +161,9 @@ namespace TEAMModelBI.Controllers.BISchool
                         Area area = null;
                         //查询区是否存在
                         var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bischool.areaId}", new PartitionKey("Base-Area"));
-                        if (respAreaId.Status == 200)
+                        if (respAreaId.StatusCode == HttpStatusCode.OK)
                         {
-                            using var areaBase = await JsonDocument.ParseAsync(respAreaId.ContentStream);
+                            using var areaBase = await JsonDocument.ParseAsync(respAreaId.Content);
                             area = areaBase.ToObject<Area>();
                         }
 
@@ -189,7 +183,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         {
                             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;
+                            if (schoolStatu.StatusCode != HttpStatusCode.OK) tempStaus = false;
                             else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
                         } while (tempStaus);
 
@@ -250,9 +244,9 @@ namespace TEAMModelBI.Controllers.BISchool
                             {
                                 Teacher teacher = new();
                                 var resTeache = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{tmdIndo.id}", new PartitionKey("Base"));
-                                if (resTeache.Status == 200)
+                                if (resTeache.StatusCode == HttpStatusCode.OK)
                                 {
-                                    using var tchJson = await JsonDocument.ParseAsync(resTeache.ContentStream);
+                                    using var tchJson = await JsonDocument.ParseAsync(resTeache.Content);
                                     teacher = tchJson.ToObject<Teacher>();
                                     Teacher.TeacherSchool tchSc = null;
                                     //var tempTch = teacher.schools.Select(x => x.schoolId.Equals(upSchool.id)).ToString();
@@ -332,7 +326,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     //{
                     //    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") }))
+                    //    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: $"select value(c.name) from c where c.name='{bischool.name}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                     //    {
                     //        scName.Add(item);
                     //    }
@@ -342,7 +336,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     //    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);
+                    //        using var areaBase = await JsonDocument.ParseAsync(respAreaId.Content);
                     //        area = areaBase.ToObject<Area>();
                     //    }
 
@@ -351,7 +345,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     //    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);
+                    //        using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                     //        AreaSetting delSet = fileJson.ToObject<AreaSetting>();
                     //        if (!string.IsNullOrEmpty(delSet.accessConfig))
                     //            isSYNCArea = true;
@@ -423,7 +417,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     //                    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);
+                    //                        using var tchJson = await JsonDocument.ParseAsync(resTeache.Content);
                     //                        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() });
@@ -616,7 +610,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         else
                             sqlTxt.Append(" order by c.createTime asc");
 
-                        await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                        await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                         {
                             schoolAssists.Add(itemSchool);
                         }
@@ -626,9 +620,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
 
-                    await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
+                    await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: stringBuilder.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
                     {
-                        using var json = await JsonDocument.ParseAsync(itemSchool.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(itemSchool.Content);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
                         {
                             foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -637,7 +631,7 @@ namespace TEAMModelBI.Controllers.BISchool
                             }
                             if (iscontinuation)
                             {
-                                continuationToken = itemSchool.GetContinuationToken();
+                                continuationToken = itemSchool.ContinuationToken;
                                 break;
                             }
                         }
@@ -654,7 +648,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 //        if ($"{order}".Equals("desc"))
                 //            sqlTxt.Append(" order by c.createTime desc");
 
-                //        await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                //        await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 //        {
                 //            schoolAssists.Add(itemSchool);
                 //        }
@@ -693,9 +687,9 @@ namespace TEAMModelBI.Controllers.BISchool
 
                 //    scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
 
-                //    await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
+                //    await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: stringBuilder.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
                 //    {
-                //        using var json = await JsonDocument.ParseAsync(itemSchool.ContentStream);
+                //        using var json = await JsonDocument.ParseAsync(itemSchool.Content);
                 //        if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
                 //        {
                 //            foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -704,7 +698,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 //            }
                 //            if (iscontinuation)
                 //            {
-                //                continuationToken = itemSchool.GetContinuationToken();
+                //                continuationToken = itemSchool.ContinuationToken;
                 //                break;
                 //            }
                 //        }
@@ -714,9 +708,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 foreach (var item in schoolAssists)
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(item.id, new PartitionKey("ProductSum"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                             item.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
                         if (json.RootElement.TryGetProperty("service", out JsonElement service) && !service.ValueKind.Equals(JsonValueKind.Null))
@@ -735,7 +729,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 //    var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey("ProductSum"));
                 //    if (response.Status == 200)
                 //    {
-                //        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                //        using var json = await JsonDocument.ParseAsync(response.Content);
                 //        if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                 //        {
                 //            school.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
@@ -836,7 +830,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         if ($"{order}".Equals("desc"))
                             sqlTxt.Append(" order by c.createTime desc");
 
-                        await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                        await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<AssistSchool>(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                         {
                             schoolAssists.Add(itemSchool);
                         }
@@ -849,9 +843,9 @@ namespace TEAMModelBI.Controllers.BISchool
 
                     scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", scCntSql.ToString(), "Base");
 
-                    await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                    await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: stringBuilder.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                     {
-                        using var json = await JsonDocument.ParseAsync(itemSchool.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(itemSchool.Content);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
                         {
                             foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -865,9 +859,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 foreach (var item in schoolAssists)
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(item.id, new PartitionKey("ProductSum"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                             item.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
                         if (json.RootElement.TryGetProperty("service", out JsonElement service) && !service.ValueKind.Equals(JsonValueKind.Null))
@@ -902,9 +896,9 @@ namespace TEAMModelBI.Controllers.BISchool
             foreach (var temp in schoolAssists)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(temp.id, new PartitionKey("ProductSum"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                     {
                         temp.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
@@ -947,9 +941,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 var cosmosClient = _azureCosmos.GetCosmosClient();
                 //if ($"{site}".Equals(BIConst.Global))
                 //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: managerSql, requestOptions: new QueryRequestOptions() { }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: managerSql, requestOptions: new QueryRequestOptions() { }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         string id = obj.GetProperty("id").GetString(); //管理员ID
@@ -974,9 +968,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 //管理模组学校
                 List<string> baseModuleSchoos = new List<string>();
                 string baseWhereOption = (!string.IsNullOrEmpty(schoolId)) ? $" and c.id='{schoolId}'" : string.Empty;
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"select c.id from c join serviceProduct in c.service.product where serviceProduct.prodCode = 'IPDYZYLC' {baseWhereOption}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Product") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"select c.id from c join serviceProduct in c.service.product where serviceProduct.prodCode = 'IPDYZYLC' {baseWhereOption}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Product") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         string tempSchoolId = obj.GetProperty("id").GetString();  //学校ID
@@ -987,9 +981,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 //学校信息
                 List<object> schools = new List<object>();
                 string schoolWhereOption = (!string.IsNullOrEmpty(schoolId)) ? $" where c.id='{schoolId}'" : string.Empty;
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"select c.id,c.name,c.period,c.schoolCode,c.region,c.province,c.city,c.picture from c {schoolWhereOption}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"select c.id,c.name,c.period,c.schoolCode,c.region,c.province,c.city,c.picture from c {schoolWhereOption}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         dynamic schoolExpando = new ExpandoObject();
@@ -1110,8 +1104,8 @@ namespace TEAMModelBI.Controllers.BISchool
                         
                         //計算學校版本
                         List<SchoolProductSumData> services = new List<SchoolProductSumData>();
-                        Azure.Response productSumResponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{_schoolId}", new PartitionKey("ProductSum"));
-                        if (productSumResponse.Status == 200)
+                        ResponseMessage productSumResponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{_schoolId}", new PartitionKey("ProductSum"));
+                        if (productSumResponse.StatusCode == HttpStatusCode.OK)
                         {
                             var doc = JsonDocument.Parse(productSumResponse.Content);
                             if (doc.RootElement.TryGetProperty("service", out JsonElement service))
@@ -1132,7 +1126,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         //修改学校教师关联的信息
                         string sql = $"SELECT distinct value(c) FROM c join A1 in c.schools where A1.schoolId='{tempShool.id}'";
                         List<Teacher> teachers = new();
-                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
+                        await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<Teacher>(sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
                         {
                             teachers.Add(item);
                         }
@@ -1151,9 +1145,9 @@ namespace TEAMModelBI.Controllers.BISchool
                         //学校信息中间件更新
                         BIRelation biRel = new();
                         var respRel = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(tempShool.id, new PartitionKey("BIRel"));
-                        if (respRel.Status == 200)
+                        if (respRel.StatusCode == HttpStatusCode.OK)
                         {
-                            using var fileJson = await JsonDocument.ParseAsync(respRel.ContentStream);
+                            using var fileJson = await JsonDocument.ParseAsync(respRel.Content);
                             biRel = fileJson.ToObject<BIRelation>();
                         }
                         else
@@ -1194,7 +1188,7 @@ namespace TEAMModelBI.Controllers.BISchool
                             biRel.assists = idInfos;
                         }
 
-                        if (respRel.Status == 200)
+                        if (respRel.StatusCode == HttpStatusCode.OK)
                         {
                             await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<BIRelation>(biRel, biRel.id, new PartitionKey("BIRel"));
                         }
@@ -1267,7 +1261,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
                 List<School> schools = new List<School>();
 
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<School>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<School>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 {
                     schools.Add(item);
                 }
@@ -1301,7 +1295,7 @@ namespace TEAMModelBI.Controllers.BISchool
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             string sqltxt = $"SELECT * FROM c order by c.id offset {endPosition} limit {pageSize}";
 
-            await foreach (var itemSchool in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<School>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var itemSchool in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<School>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 AssistSchool schoolAssist = new()
                 {
@@ -1365,7 +1359,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 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") }))
+                    await foreach (var sc in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: $"select value(c.name) from c where c.name='{item}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                     {
                         existScNames.Add(item);
                     }
@@ -1405,16 +1399,16 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     //查询区是否存在
                     var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{item}", new PartitionKey("Base-Area"));
-                    if (respAreaId.Status != 200)
+                    if (respAreaId.StatusCode != HttpStatusCode.OK)
                     {
                         noAreaIds.Add(item);
                     }
 
                     //查询去是否同步省平台
                     var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{item}", new PartitionKey("AreaSetting"));
-                    if (responseSet.Status == 200)
+                    if (responseSet.StatusCode == HttpStatusCode.OK)
                     {
-                        using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                        using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                         AreaSetting delSet = fileJson.ToObject<AreaSetting>();
                         if (!string.IsNullOrEmpty(delSet.accessConfig))
                             synPro.Add(item);
@@ -1431,7 +1425,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     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;
+                    if (schoolStatu.StatusCode != HttpStatusCode.OK) tempStaus = false;
                     else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
                 } while (tempStaus);
                 createScInfo.Add(createSchoolInfo);
@@ -1465,7 +1459,7 @@ namespace TEAMModelBI.Controllers.BISchool
             foreach (BISchool bISchool in bISchools)
             {
                 //查询学校名称是否全字段匹配
-                await foreach (var sc 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") }))
+                await foreach (var sc in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: $"select value(c.name) from c where c.name='{bISchool.name}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 {
                     existScNames.Add(bISchool);
                 }
@@ -1498,16 +1492,16 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     //查询区是否存在
                     var respAreaId = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bISchool.areaId}", new PartitionKey("Base-Area"));
-                    if (respAreaId.Status != 200)
+                    if (respAreaId.StatusCode != HttpStatusCode.OK)
                     {
                         noAreaIds.Add(bISchool);
                     }
 
                     //查询去是否同步省平台
                     var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{bISchool.areaId}", new PartitionKey("AreaSetting"));
-                    if (responseSet.Status == 200)
+                    if (responseSet.StatusCode == HttpStatusCode.OK)
                     {
-                        using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                        using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                         AreaSetting delSet = fileJson.ToObject<AreaSetting>();
                         if (!string.IsNullOrEmpty(delSet.accessConfig))
                             synPro.Add(bISchool);
@@ -1530,7 +1524,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     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;
+                    if (schoolStatu.StatusCode != HttpStatusCode.OK) tempStaus = false;
                     else createSchoolInfo.createCount = createSchoolInfo.createCount >= 3 ? createSchoolInfo.createCount = 3 : createSchoolInfo.createCount += 1;
                 } while (tempStaus);
                 bISchool.id = createSchoolInfo.id;
@@ -1572,9 +1566,9 @@ namespace TEAMModelBI.Controllers.BISchool
                         if (tempTeacher != null)
                         {
                             var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{msId}", new PartitionKey($"Teacher-{scId}"));
-                            if (response.Status == 200)
+                            if (response.StatusCode == HttpStatusCode.OK)
                             {
-                                using var tchJson = await JsonDocument.ParseAsync(response.ContentStream);
+                                using var tchJson = await JsonDocument.ParseAsync(response.Content);
                                 SchoolTeacher tchSc = tchJson.ToObject<SchoolTeacher>();
                                 if (tchSc.roles.Contains("admin"))
                                 {
@@ -1620,9 +1614,9 @@ namespace TEAMModelBI.Controllers.BISchool
 
                             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)
+                            if (responseSc.StatusCode == HttpStatusCode.OK)
                             {
-                                using var tchJson = await JsonDocument.ParseAsync(responseSc.ContentStream);
+                                using var tchJson = await JsonDocument.ParseAsync(responseSc.Content);
                                 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 });
                             }
@@ -1674,9 +1668,9 @@ namespace TEAMModelBI.Controllers.BISchool
             {
                 School school = new();
                 var resSc = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{item.id}", new PartitionKey("Base"));
-                if (resSc.Status == 200)
+                if (resSc.StatusCode == HttpStatusCode.OK)
                 {
-                    using var sJson = await JsonDocument.ParseAsync(resSc.ContentStream);
+                    using var sJson = await JsonDocument.ParseAsync(resSc.Content);
                     school = sJson.ToObject<School>();
                     //CoreUser coreUser = await _coreAPIHttpService.GetUserInfo(new Dictionary<string, string> { { "key", $"19940828843" } }, _option.Location, _configuration);
                     var content = new StringContent(item.mobiles.ToArray().ToJsonString(), Encoding.UTF8, "application/json");
@@ -1686,14 +1680,14 @@ namespace TEAMModelBI.Controllers.BISchool
                     foreach (var tmd in tmdInfos)
                     {
                         var respone = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{tmd.id}", new PartitionKey("Base"));
-                        if (respone.Status == 200)
+                        if (respone.StatusCode == HttpStatusCode.OK)
                         {
-                            using var tchJson = await JsonDocument.ParseAsync(respone.ContentStream);
+                            using var tchJson = await JsonDocument.ParseAsync(respone.Content);
                             teacher = tchJson.ToObject<Teacher>();
                             var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{tmd.id}", new PartitionKey($"Teacher-{item.id}"));
-                            if (response.Status == 200)
+                            if (response.StatusCode == HttpStatusCode.OK)
                             {
-                                using var scTchJson = await JsonDocument.ParseAsync(response.ContentStream);
+                                using var scTchJson = await JsonDocument.ParseAsync(response.Content);
                                 SchoolTeacher tchSc = scTchJson.ToObject<SchoolTeacher>();
                                 if (tchSc.roles.Contains("admin"))
                                 {

+ 3 - 3
TEAMModelBI/Controllers/BISchool/RoomController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Configuration;
@@ -70,9 +70,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 //}
 
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{roomId}", new PartitionKey($"{roomCode}"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     Room roomInfo = json.ToObject<Room>();
                     roomInfo.serial = string.IsNullOrEmpty($"{serial}") ? null : $"{serial}";
 

+ 183 - 90
TEAMModelBI/Controllers/BISchool/SchoolController.cs

@@ -1,5 +1,4 @@
-using Azure.Cosmos;
-using HTEXLib.COMM.Helpers;
+using Microsoft.Azure.Cosmos;
 using MathNet.Numerics.LinearAlgebra.Double;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
@@ -107,9 +106,9 @@ namespace TEAMModelBI.Controllers.BISchool
                     sqltxt.Append($" WHERE c.pk='School' and (c.areaId = '' or c.areaId = null or IS_DEFINED(c.areaId) = false)");
 
                 List<NotAreaSchool> tempNotAreaSchools = new();
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: sqltxt.ToString(), continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -137,7 +136,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
                         if (iscontinuation)
                         {
-                            continuationToken = item.GetContinuationToken();
+                            continuationToken = item.ContinuationToken;
                             break;
                         }
                     }
@@ -187,9 +186,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 List<NotAreaSchool> notAreaSchools = new();
                 foreach (string pk in partitionKeys)
                 {
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{pk}") }))
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{pk}") }))
                     {
-                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(item.Content);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                         {
                             foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -276,9 +275,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 //}
 
                 var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_areaId}", new PartitionKey("AreaSetting"));
-                if (responseSet.Status == 200)
+                if (responseSet.StatusCode == HttpStatusCode.OK)
                 {
-                    using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
+                    using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
                     AreaSetting delSet = fileJson.ToObject<AreaSetting>();
                     if (!string.IsNullOrEmpty(delSet.accessConfig))
                         return Ok(new { state = 401, msg = "区域已经规定了,不能切换能能力" });
@@ -309,7 +308,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
                             msg.Append($"{school.name}【{school.id}】学校移除多区域的名单:");
                             List<Teacher> teachers = new();
-                            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Teacher>(queryText: $"SELECT value(c) FROM c join s in c.schools where s.schoolId ='{school.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<Teacher>(queryText: $"SELECT value(c) FROM c join s in c.schools where s.schoolId ='{school.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                             {
                                 teachers.Add(item);
                             }
@@ -369,7 +368,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
                 AssistSchool schoolAssists = new(); //返回学校列表集合
                 string sqlTxt = $"select c.id,c.code,c.schoolCode,c.name,c.region,c.province,c.city,c.dist,c.size,c.address,c.picture,c.type,c.scale,c.areaId,c.standard,c.period,c.campuses from c where c.id='{schoolId}'";
-                await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<AssistSchool>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 {
                     schoolAssists = itemSchool;
                 }
@@ -377,9 +376,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (schoolAssists.id != null)
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolAssists.id, new PartitionKey("ProductSum"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                         {
                             schoolAssists.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
@@ -402,7 +401,7 @@ namespace TEAMModelBI.Controllers.BISchool
                 //無實體學校 => 取得虛擬學校
                 else
                 {
-                    await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AssistSchool>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("VirtualBase") }))
+                    await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<AssistSchool>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("VirtualBase") }))
                     {
                         schoolAssists = itemSchool;
                     }
@@ -443,11 +442,11 @@ namespace TEAMModelBI.Controllers.BISchool
                 string _auth = HttpContext.GetXAuth("AuthToken");
                 var (tmdId, tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(_auth, _option);
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey($"Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     string sql = $"SELECT distinct value(c) FROM c join A1 in c.schools where A1.schoolId='{school.id}'";
                     List<Teacher> teachers = new();
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Teacher>(sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<Teacher>(sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
                     {
                         teachers.Add(item);
                     }
@@ -500,16 +499,16 @@ namespace TEAMModelBI.Controllers.BISchool
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(sid, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
                 }
 
                 long teach = 0;
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT sum(c.size) as size FROM c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{sid}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT sum(c.size) as size FROM c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{sid}") }))
                 {
-                    var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var elmt in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         if (elmt.TryGetProperty("size", out JsonElement _size) && _size.ValueKind.Equals(JsonValueKind.Number))
@@ -720,7 +719,7 @@ namespace TEAMModelBI.Controllers.BISchool
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
             List<BaseInfo> scManages = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<BaseInfo>(queryText: $"select c.id,c.name,c.picture from c where ARRAY_CONTAINS(c.roles,'admin',true) and c.code='Teacher-{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<BaseInfo>(queryText: $"select c.id,c.name,c.picture from c where ARRAY_CONTAINS(c.roles,'admin',true) and c.code='Teacher-{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
             {
                 scManages.Add(item);
             }
@@ -768,9 +767,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 {
                     var resScInfo = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
 
-                    if (resScInfo.Status == 200)
+                    if (resScInfo.StatusCode == HttpStatusCode.OK)
                     {
-                        using var tchJson = await JsonDocument.ParseAsync(resScInfo.ContentStream);
+                        using var tchJson = await JsonDocument.ParseAsync(resScInfo.Content);
                         School scInfo = tchJson.ToObject<School>();
                         areaId = scInfo.areaId;
                     }
@@ -781,9 +780,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 Teacher teacher = new();
                 SchoolTeacher schoolTeacher = new();
                 var resTeacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
-                if (resTeacher.Status == 200)
+                if (resTeacher.StatusCode == HttpStatusCode.OK)
                 {
-                    using var tchJson = await JsonDocument.ParseAsync(resTeacher.ContentStream);
+                    using var tchJson = await JsonDocument.ParseAsync(resTeacher.Content);
                     teacher = tchJson.ToObject<Teacher>();
 
                     var existArea = teacher.schools.Find(f => f.schoolId.Equals($"{schoolId}"));
@@ -812,9 +811,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (teacher != null)
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{schoolId}"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         schoolTeacher = json.ToObject<SchoolTeacher>();
                         if (!schoolTeacher.roles.Contains("admin"))
                         {
@@ -894,9 +893,9 @@ namespace TEAMModelBI.Controllers.BISchool
             if (rmvFromSc) //從老師的學校列表移除該學校
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     Teacher teacher = json.ToObject<Teacher>();
                     teacher.schools.RemoveAll(s => scIds.Contains(s.schoolId));
                     await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
@@ -907,7 +906,7 @@ namespace TEAMModelBI.Controllers.BISchool
             foreach (var scId in scIds)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     if (rmvFromSc) //將該老師從學校的老師名單中移除
                     {
@@ -917,7 +916,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     }
                     else
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         scTeacher = json.ToObject<SchoolTeacher>();
                         if (scTeacher.roles.Contains("admin"))
                         {
@@ -969,9 +968,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 if (schools.Count > 0)
                 {
                     var resTeacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
-                    if (resTeacher.Status == 200)
+                    if (resTeacher.StatusCode == HttpStatusCode.OK)
                     {
-                        using var tchJson = await JsonDocument.ParseAsync(resTeacher.ContentStream);
+                        using var tchJson = await JsonDocument.ParseAsync(resTeacher.Content);
                         teacher = tchJson.ToObject<Teacher>();
                     }
                     else
@@ -998,9 +997,9 @@ namespace TEAMModelBI.Controllers.BISchool
                             existSchool.name = school.name;
 
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{school.id}"));
-                        if (response.Status == 200)
+                        if (response.StatusCode == HttpStatusCode.OK)
                         {
-                            using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                            using var json = await JsonDocument.ParseAsync(response.Content);
                             schoolTeacher = json.ToObject<SchoolTeacher>();
                             if (!schoolTeacher.roles.Contains("admin"))
                             {
@@ -1031,7 +1030,7 @@ namespace TEAMModelBI.Controllers.BISchool
                         msg.Append($"{school.name}[{school.id}]");
                     }
 
-                    if (resTeacher.Status == 200)
+                    if (resTeacher.StatusCode == HttpStatusCode.OK)
                         teacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
                     else
                         teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
@@ -1098,44 +1097,44 @@ namespace TEAMModelBI.Controllers.BISchool
                         List<string> scTchIds = new();
                         List<string> scStuIds = new();
                         string scTecSql = $"select value(c.id) from c where ARRAY_LENGTH(c.roles) > 0 and c.status = 'join'";
-                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: scTecSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{tempId}") }))
+                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: scTecSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{tempId}") }))
                         {
                             scTchIds.Add(item);
                         }
 
                         string scStuSql = $"select value(c.id) from c";
-                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<string>(queryText: scStuSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{tempId}") }))
+                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Student").GetItemQueryIteratorSql<string>(queryText: scStuSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{tempId}") }))
                         {
                             scStuIds.Add(item);
                         }
 
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"Base"));
-                        if (response.Status == 204)
-                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.Status},删除ID:{tempId}");
+                        if (response.StatusCode == HttpStatusCode.NoContent)
+                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.StatusCode},删除ID:{tempId}");
                         else
-                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = response.Status });
+                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = (int)HttpStatusCode.NoContent });
 
                         //删除学校信息中间
                         var resBiRel = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"BIRel"));
-                        if (resBiRel.Status == 204)
-                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校信息中间件,删除状态:{resBiRel.Status},删除ID:{tempId}");
+                        if (resBiRel.StatusCode == HttpStatusCode.NoContent)
+                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校信息中间件,删除状态:{resBiRel.StatusCode},删除ID:{tempId}");
                         else
-                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = response.Status });
+                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = (int)response.StatusCode });
 
                         foreach (var item in scTchIds)
                         {
                             //学校教师信息
                             var tchRespnse = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{item}", new PartitionKey($"Teacher-{tempId}"));
-                            if (tchRespnse.Status == 204)
-                                msg.AppendLine($"删除教师,删除状态:{tchRespnse.Status},删除ID:{item}");
+                            if (tchRespnse.StatusCode == HttpStatusCode.NoContent)
+                                msg.AppendLine($"删除教师,删除状态:{tchRespnse.StatusCode},删除ID:{item}");
                             else
-                                delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Teacher-{tempId}", type = 2, status = response.Status });
+                                delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Teacher-{tempId}", type = 2, status = (int)response.StatusCode });
 
                             //教师基础信息
                             var tchBaseResponse = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{item}", new PartitionKey("Base"));
-                            if (tchBaseResponse.Status == 200)
+                            if (tchBaseResponse.StatusCode == HttpStatusCode.OK)
                             {
-                                using var json = await JsonDocument.ParseAsync(tchBaseResponse.ContentStream);
+                                using var json = await JsonDocument.ParseAsync(tchBaseResponse.Content);
                                 Teacher teacher = json.ToObject<Teacher>();
                                 var tempSc = teacher.schools.Find(f => f.schoolId.Equals($"{tempId}"));
                                 if (tempSc != null)
@@ -1145,38 +1144,38 @@ namespace TEAMModelBI.Controllers.BISchool
                                 }
                             }
                             else
-                                delSchoolRels.Add(new DelSchoolRel { id = $"{item}", code = "Base", type = 2, status = response.Status });
+                                delSchoolRels.Add(new DelSchoolRel { id = $"{item}", code = "Base", type = 2, status = (int)response.StatusCode });
                         }
                         //删除学校学生
                         foreach (var item in scStuIds)
                         {
                             var stuRespnse = await cosmosClient.GetContainer("TEAMModelOS", "Student").DeleteItemStreamAsync($"{item}", new PartitionKey($"Base-{tempId}"));
-                            if (stuRespnse.Status == 204)
-                                msg.AppendLine($"删除学生,删除状态:{stuRespnse.Status},删除ID:{item}");
+                            if (stuRespnse.StatusCode == HttpStatusCode.NoContent)
+                                msg.AppendLine($"删除学生,删除状态:{stuRespnse.StatusCode},删除ID:{item}");
                             else
-                                delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Base-{tempId}", type = 3, status = response.Status });
+                                delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Base-{tempId}", type = 3, status = (int)response.StatusCode });
                         }
                     }
                     //虛擬學校刪除
                     else
                     {
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"VirtualBase"));
-                        if (response.Status == 204)
-                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.Status},删除ID:{tempId}");
+                        if (response.StatusCode == HttpStatusCode.NoContent)
+                            msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.StatusCode},删除ID:{tempId}");
                         else
-                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "VirtualBase", type = 1, status = response.Status });
+                            delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "VirtualBase", type = 1, status = (int)response.StatusCode });
                     }
                 }
 
 
                 //string scTecSql = $"select value(c.id) from c where ARRAY_LENGTH(c.roles) > 0 and c.status = 'join'";
-                //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: scTecSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{schoolId}") }))
+                //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: scTecSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{schoolId}") }))
                 //{
                 //    scTchIds.Add(item);
                 //}
 
                 //string scStuSql = $"select value(c.id) from c";
-                //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: scStuSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
+                //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: scStuSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
                 //{
                 //    scStuIds.Add(item);
                 //}
@@ -1268,9 +1267,9 @@ namespace TEAMModelBI.Controllers.BISchool
             if (schoolInfo != null)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolInfo.id, new PartitionKey("ProductSum"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                         schoolInfo.serial = serial.ToObject<List<ProductSumInfos>>();
 
@@ -1345,9 +1344,9 @@ namespace TEAMModelBI.Controllers.BISchool
 
             RecSchool recSchool = new();
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
-            if (response.Status == 200)
+            if (response.StatusCode == HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 recSchool = json.ToObject<RecSchool>();
             }
             else return Ok(new { state = RespondCode.NotFound, msg = "未找到该学校" });
@@ -1458,7 +1457,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
             //获取当前学期所有的课程记录
             List<LessAnalyse> records = new List<LessAnalyse>();
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<LessAnalyse>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{schoolId}") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<LessAnalyse>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{schoolId}") }))
             {
                 records.Add(item);
             }
@@ -1471,7 +1470,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
             List<LessonCount> scount = new();
             List<LessonCount> tcount = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<LessonCount>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{schoolId}-{year}") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<LessonCount>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{schoolId}-{year}") }))
             {
                 scount.Add(item);
             }
@@ -1480,7 +1479,7 @@ namespace TEAMModelBI.Controllers.BISchool
             foreach (var tId in teacIds)
             {
                 var sqlTxtt = $"select value(c) from c where c.id='{tId}'";
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<LessonCount>(queryText: sqlTxtt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{year}") }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<LessonCount>(queryText: sqlTxtt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{year}") }))
                 {
                     tcount.Add(item);
                 }
@@ -1865,15 +1864,15 @@ namespace TEAMModelBI.Controllers.BISchool
             AnSchool school = new();  //学校基础基础信息
 
             var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
-            if (response.Status == 200)
+            if (response.StatusCode == HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 school = json.ToObject<AnSchool>();
             }
             else return Ok(new { state = RespondCode.NotFound, msg = "未找到该学校" });
             List<LessAnalyse> lessAnalyses = new();
 
-            await foreach (var lessItem in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<LessAnalyse>(queryText: "select c.id,c.code,c.periodId,c.subjectId,c.grade from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school.id}") }))
+            await foreach (var lessItem in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<LessAnalyse>(queryText: "select c.id,c.code,c.periodId,c.subjectId,c.grade from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school.id}") }))
             {
                 lessAnalyses.Add(lessItem);
             }
@@ -1884,9 +1883,9 @@ namespace TEAMModelBI.Controllers.BISchool
             var subCnt = subs.Select(x => new { name = x.key, value = x.count });
 
             var responseProduct = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey("ProductSum"));
-            if (responseProduct.Status == 200)
+            if (responseProduct.StatusCode == HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(responseProduct.ContentStream);
+                using var json = await JsonDocument.ParseAsync(responseProduct.Content);
                 if (json.RootElement.TryGetProperty("serial", out JsonElement _serial) && !_serial.ValueKind.Equals(JsonValueKind.Null))
                 {
                     school.serial = _serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
@@ -1921,7 +1920,7 @@ namespace TEAMModelBI.Controllers.BISchool
             if (!string.IsNullOrEmpty($"{areaId}"))
                 sql.Append($" where c.areaId = '{areaId}'");
 
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS,"School").GetItemQueryIterator<ScBriefInfo>(queryText: sql.ToString(), requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS,"School").GetItemQueryIteratorSql<ScBriefInfo>(queryText: sql.ToString(), requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
             {
                 scBriefs.Add(item);
             }
@@ -1987,9 +1986,9 @@ namespace TEAMModelBI.Controllers.BISchool
                         allCnt += await CommonFind.GetSqlValueCount(cosmosClient, "School", serialAllSql, $"Product-{scProd.id}");
 
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scProd.id, new PartitionKey("ProductSum"));
-                        if (response.Status == 200)
+                        if (response.StatusCode == HttpStatusCode.OK)
                         {
-                            using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                            using var json = await JsonDocument.ParseAsync(response.Content);
                             if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                             {
                                 List<string> serials = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
@@ -2016,7 +2015,7 @@ namespace TEAMModelBI.Controllers.BISchool
                     //    var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scProd.id, new PartitionKey("ProductSum"));
                     //    if (response.Status == 200)
                     //    {
-                    //        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    //        using var json = await JsonDocument.ParseAsync(response.Content);
                     //        if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                     //        {
                     //            scProd.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList(); 
@@ -2062,9 +2061,9 @@ namespace TEAMModelBI.Controllers.BISchool
 
             List<School> schools = new();
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -2108,9 +2107,9 @@ namespace TEAMModelBI.Controllers.BISchool
 
                 foreach (var school in schools)
                 {
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"SELECT sum(c.size) as size FROM c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school}") }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT sum(c.size) as size FROM c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school}") }))
                     {
-                        var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        var json = await JsonDocument.ParseAsync(item.Content);
                         foreach (var elmt in json.RootElement.GetProperty("Documents").EnumerateArray())
                         {
                             if (elmt.TryGetProperty("size", out JsonElement _size) && _size.ValueKind.Equals(JsonValueKind.Number))
@@ -2303,7 +2302,7 @@ namespace TEAMModelBI.Controllers.BISchool
             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() { }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: mScSql, requestOptions: new QueryRequestOptions() { }))
             {
                 scIds.Add(item);
             }
@@ -2351,7 +2350,7 @@ namespace TEAMModelBI.Controllers.BISchool
 
             List<ScSimple> scSimple = new();
 
-            await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ScSimple>(queryText: scSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<ScSimple>(queryText: scSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 scSimple.Add(itemSchool);
             }
@@ -2418,9 +2417,9 @@ namespace TEAMModelBI.Controllers.BISchool
 
                 ////取得各產品目前可得數量
                 var response = await db.ReadItemStreamAsync(school_code.ToString(), new PartitionKey($"ProductSum"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     productSum = json.ToObject<SchoolProductSum>();
                     prodinfo = productSum.prodinfo;
                     serviceSum = productSum.service;
@@ -2430,9 +2429,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 List<string> serialPermitList = getSerialPermitProdcodeList();
                 string serialPermitJsonStr = JsonConvert.SerializeObject(serialPermitList);
                 string serialQueryText = $"SELECT * FROM c WHERE c.dataType = 'serial' AND ARRAY_CONTAINS({serialPermitJsonStr}, c.prodCode)";
-                await foreach (var itemsr in db.GetItemQueryStreamIterator(queryText: serialQueryText, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{school_code}") }))
+                await foreach (var itemsr in db.GetItemQueryStreamIteratorSql(queryText: serialQueryText, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{school_code}") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(itemsr.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(itemsr.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
                         deviceForCoreService uuidForCore;
@@ -2446,9 +2445,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 //服務
                 List<SchoolProductSumDataService> service = new List<SchoolProductSumDataService>();
                 SchoolProductSum schoolProductSum;
-                await foreach (var items in db.GetItemQueryStreamIterator(queryText: $"SELECT * FROM c WHERE c.id = '{school_code}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ProductSum") }))
+                await foreach (var items in db.GetItemQueryStreamIteratorSql(queryText: $"SELECT * FROM c WHERE c.id = '{school_code}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ProductSum") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(items.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(items.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -2473,9 +2472,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 }
 
                 //硬體
-                await foreach (var itemhd in db.GetItemQueryStreamIterator(queryText: $"SELECT * FROM c WHERE c.dataType = 'hard'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{school_code}") }))
+                await foreach (var itemhd in db.GetItemQueryStreamIteratorSql(queryText: $"SELECT * FROM c WHERE c.dataType = 'hard'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{school_code}") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(itemhd.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(itemhd.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -2489,9 +2488,9 @@ namespace TEAMModelBI.Controllers.BISchool
                 ////取得教師分配空間
                 long teach = 0;
                 var querysp = $"SELECT SUM(c.size) as size FROM c";
-                await foreach (var item in db.GetItemQueryStreamIterator(queryText: querysp, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school_code}") }))
+                await foreach (var item in db.GetItemQueryStreamIteratorSql(queryText: querysp, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school_code}") }))
                 {
-                    var jsonts = await JsonDocument.ParseAsync(item.ContentStream);
+                    var jsonts = await JsonDocument.ParseAsync(item.Content);
                     foreach (var obj in jsonts.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         teach = obj.GetProperty("size").GetInt64() * 1073741824; //G換算
@@ -2606,6 +2605,100 @@ namespace TEAMModelBI.Controllers.BISchool
 
         #endregion
 
+        #region 統購平台用
+        /// <summary>
+        /// 取得CoreBB學校訂單履歷資訊  暂时这样处理
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-bbpurchase")]
+        public async Task<IActionResult> GetBBpurchase(JsonElement jsonElement)
+        {
+            List<object> result = new List<object>();
+            try
+            {
+                var client = _azureCosmos.GetCosmosClient(name:"CoreServiceV2");
+                string sqlPurchase = $"SELECT * FROM c ";
+                List<PurchaseSeats> purchaseSeatsList = new List<PurchaseSeats>();
+                await foreach (PurchaseSeats item in client.GetContainer("Habb", "Auth").GetItemQueryIteratorSql<PurchaseSeats>(queryText: sqlPurchase, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("purchase") }))
+                {
+                    purchaseSeatsList.Add(item);
+                }
+                Dictionary<string, List<PurchaseSchoolSeats>> purchaseSchoolSeatsDic = new Dictionary<string, List<PurchaseSchoolSeats>>();
+                string sqlSchool = $"SELECT * FROM c ";
+                await foreach (PurchaseSchoolSeats item in client.GetContainer("Habb", "Auth").GetItemQueryIteratorSql<PurchaseSchoolSeats>(queryText: sqlSchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("purchaseSchool") }))
+                {
+                    if(!purchaseSchoolSeatsDic.ContainsKey(item.purchaseId))
+                    {
+                        purchaseSchoolSeatsDic.Add(item.purchaseId, new List<PurchaseSchoolSeats>() { item });
+                    }
+                    else
+                    {
+                        purchaseSchoolSeatsDic[item.purchaseId].Add(item);
+                    }
+                }
+
+                return Ok(new { geo = purchaseSeatsList, school = purchaseSchoolSeatsDic });
+            }
+            catch (Exception ex)
+            {
+                return BadRequest();
+            }
+        }
+        /// <summary>
+        /// 取得CoreService縣市所屬學校
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-school-geo")]
+        public async Task<IActionResult> GetCsSchoolByGeo(JsonElement jsonElement)
+        {
+            List<CsSchoolBase> result = new List<CsSchoolBase>();
+            try
+            {
+                string err = string.Empty;
+                string countryId = (jsonElement.TryGetProperty("countryId", out JsonElement _countryId)) ? _countryId.GetString() : string.Empty;
+                string provinceId = (jsonElement.TryGetProperty("provinceId", out JsonElement _provinceId)) ? _provinceId.GetString() : string.Empty;
+                string cityId = (jsonElement.TryGetProperty("cityId", out JsonElement _cityId)) ? _cityId.GetString() : string.Empty;
+                string distId = (jsonElement.TryGetProperty("distId", out JsonElement _distId)) ? _distId.GetString() : string.Empty;
+                //輸入項檢驗
+                if (string.IsNullOrWhiteSpace(countryId)) { err = "Invalid countryId."; }
+                else if(countryId.Equals("CN"))
+                {
+                    if (string.IsNullOrWhiteSpace(provinceId)) { err = "Invalid provinceId."; }
+                    else if (string.IsNullOrWhiteSpace(cityId)) { err = "Invalid cityId."; }
+                }
+                else if (countryId.Equals("TW"))
+                {
+                    if (string.IsNullOrWhiteSpace(cityId)) { err = "Invalid cityId."; }
+                }
+                if(!string.IsNullOrWhiteSpace(err)) ///錯誤訊息輸出
+                {
+                    return Ok(new { err = err, data = result });
+                }
+                //取得CS學校
+                var client = _azureCosmos.GetCosmosClient(name:"CoreServiceV2CnRead");
+                string sql = $"SELECT * FROM c WHERE c.countryId = '{countryId}'";
+                if (!string.IsNullOrWhiteSpace(provinceId)) sql += $" AND c.provinceId = '{provinceId}'";
+                if (!string.IsNullOrWhiteSpace(cityId)) sql += $" AND c.cityId = '{cityId}'";
+                if (!string.IsNullOrWhiteSpace(distId)) sql += $" AND c.distId = '{distId}'";
+                await foreach (CsSchoolBase item in client.GetContainer("Core", "School").GetItemQueryIteratorSql<CsSchoolBase>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("base") }))
+                {
+                    result.Add(item);
+                }
+
+                return Ok(new { err = err, data = result });
+            }
+            catch (Exception ex)
+            {
+                return BadRequest();
+            }
+        }
+
+        #endregion
+
         /// <summary>
         /// 未加入区域的学校
         /// </summary>

+ 0 - 1
TEAMModelBI/Controllers/BIServer/BiServersController.cs

@@ -13,7 +13,6 @@ using System.Net.Http;
 using TEAMModelOS.SDK.Extension;
 using System.Text;
 using System.Net;
-using HTEXLib.COMM.Helpers;
 using System.Net.Http.Json;
 using TEAMModelOS.SDK;
 using TEAMModelBI.Filter;

+ 1 - 1
TEAMModelBI/Controllers/BIStudent/StuActivityController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;

+ 7 - 7
TEAMModelBI/Controllers/BIStudent/StudentController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -48,9 +48,9 @@ namespace TEAMModelBI.Controllers.BIStudent
             //if ($"{site}".Equals(BIConst.Global))
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> objs = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{studentId}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIteratorSql(queryText: $"select value(c) from c where c.id='{studentId}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0) 
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -83,9 +83,9 @@ namespace TEAMModelBI.Controllers.BIStudent
                 //string sqlTxt = "SELECT select c.id,c.code,c.classIds FROM c  where c.pk='Activity' and c.classIds <> []";
                 string sqlTxt = "select c.id,c.code,c.classIds from c where c.school='cswznb' and c.classIds <> []";
                 List<CorrectStu> correctStus = new();
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         obj.TryGetProperty("id", out JsonElement tempTd);
@@ -106,7 +106,7 @@ namespace TEAMModelBI.Controllers.BIStudent
 
                 if (correctStus.Count > 0)
                 {
-                    foreach (var correct in correctStus)
+                    /*foreach (var correct in correctStus)
                     {
                         StuActivity stuActivity = await cosmosClient.GetContainer("TEAMModelOS", "Student").ReadItemAsync<StuActivity>(correct.id, new PartitionKey(correct.code));
                         if (stuActivity != null)
@@ -115,7 +115,7 @@ namespace TEAMModelBI.Controllers.BIStudent
 
                             await cosmosClient.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync<StuActivity>(stuActivity, stuActivity.id, new PartitionKey(stuActivity.code));
                         }
-                    }
+                    }*/
 
                     return Ok(new { state = 200, msg = "去重成功" });
                 }

+ 4 - 4
TEAMModelBI/Controllers/BITable/BIOpenApiController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -57,9 +57,9 @@ namespace TEAMModelBI.Controllers.BITable
             }
 
             List<ReadApi> openApis = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryStreamIterator(queryText:sqlTxt.ToString(),requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Api")}))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryStreamIteratorSql(queryText:sqlTxt.ToString(),requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Api")}))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt32() > 0) 
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -124,7 +124,7 @@ namespace TEAMModelBI.Controllers.BITable
                 else
                 {
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync(openApi.id, new PartitionKey("Api"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         openApi.ttl = -1;
                         openApi.pk = "Api";

+ 9 - 10
TEAMModelBI/Controllers/BITable/DDStructController.cs

@@ -14,11 +14,10 @@ using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models.Service;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using TEAMModelOS.SDK.Models;
 using TEAMModelBI.Controllers.BISchool;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
-using Microsoft.Azure.Cosmos.Table;
 using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.Context.BI;
 
@@ -282,7 +281,7 @@ namespace TEAMModelBI.Controllers.BITable
                         //string sqltxt = $"select distinct value(c) from c join A1 in c.ddbinds where A1.userid ='{itemUser.Userid}'";
                         //try
                         //{
-                        //    await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                        //    await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<Teacher>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                         //    {
                         //        dDAndTmdInfo.tmdId = item.id;
                         //        dDAndTmdInfo.isexist = true;
@@ -292,7 +291,7 @@ namespace TEAMModelBI.Controllers.BITable
                         //            var schoolRoles = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(item.id, new PartitionKey($"Teacher-{item.defaultSchool}"));
                         //            if (schoolRoles.Status == 200)
                         //            {
-                        //                using var json = await JsonDocument.ParseAsync(schoolRoles.ContentStream);
+                        //                using var json = await JsonDocument.ParseAsync(schoolRoles.Content);
                         //                if (json.RootElement.TryGetProperty("roles", out JsonElement _roles) && _roles.ValueKind != JsonValueKind.Null)
                         //                {
                         //                    foreach (var obj in _roles.EnumerateArray())
@@ -371,7 +370,7 @@ namespace TEAMModelBI.Controllers.BITable
                                         string sqltxt = $"select distinct value(c) from c join A1 in c.ddbinds where A1.userid ='{itemUser2.Userid}'";
                                         try
                                         {
-                                            await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                                            await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<Teacher>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                                             {
                                                 dDAndTmdInfo2.tmdId = item.id;
                                                 dDAndTmdInfo2.isexist = true;
@@ -379,9 +378,9 @@ namespace TEAMModelBI.Controllers.BITable
                                                 if (!string.IsNullOrEmpty($"{item.defaultSchool}"))
                                                 {
                                                     var schoolRoles = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(item.id, new PartitionKey($"Teacher-{item.defaultSchool}"));
-                                                    if (schoolRoles.Status == 200)
+                                                    if (schoolRoles.StatusCode == System.Net.HttpStatusCode.OK)
                                                     {
-                                                        using var json = await JsonDocument.ParseAsync(schoolRoles.ContentStream);
+                                                        using var json = await JsonDocument.ParseAsync(schoolRoles.Content);
                                                         if (json.RootElement.TryGetProperty("roles", out JsonElement _roles) && _roles.ValueKind != JsonValueKind.Null)
                                                         {
                                                             foreach (var obj in _roles.EnumerateArray())
@@ -503,7 +502,7 @@ namespace TEAMModelBI.Controllers.BITable
                             string sqltxt = $"select distinct value(c) from c join A1 in c.ddbinds where A1.userid ='{tempid}'";
                             try
                             {
-                                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<Teacher>(queryText: sqltxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                                 {
                                     dDUserInfoAndTMD.tmdId = item.id;
                                     dDUserInfoAndTMD.isexist = true;
@@ -511,9 +510,9 @@ namespace TEAMModelBI.Controllers.BITable
                                     if (!string.IsNullOrEmpty($"{item.defaultSchool}"))
                                     {
                                         var schoolRoles = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(item.id, new PartitionKey($"Teacher-{item.defaultSchool}"));
-                                        if (schoolRoles.Status == 200)
+                                        if (schoolRoles.StatusCode == System.Net.HttpStatusCode.OK)
                                         {
-                                            using var json = await JsonDocument.ParseAsync(schoolRoles.ContentStream);
+                                            using var json = await JsonDocument.ParseAsync(schoolRoles.Content);
                                             if (json.RootElement.TryGetProperty("roles", out JsonElement _roles) && _roles.ValueKind != JsonValueKind.Null)
                                             {
                                                 foreach (var obj in _roles.EnumerateArray())

+ 2 - 3
TEAMModelBI/Controllers/BITable/IES5OAuthController.cs

@@ -1,6 +1,5 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Azure.Storage.Blobs;
-using DocumentFormat.OpenXml.Spreadsheet;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -123,7 +122,7 @@ namespace TEAMModelBI.Controllers.BITable
                     if (oAuthShow.Type.Equals("art")) 
                     {
                         var isExist = await cosmosClinet.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{oAuthShow.Code}", new PartitionKey("ArtSetting"));
-                        if (isExist.Status != 200)
+                        if (isExist.StatusCode != System.Net.HttpStatusCode.OK)
                         {
                             artSetting = await cosmosClinet.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<ArtSetting>("default", new PartitionKey("ArtSetting"));
                             artSetting.id = oAuthShow.Code;

+ 2 - 2
TEAMModelBI/Controllers/BITable/OperateLogController.cs

@@ -1,6 +1,5 @@
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.Azure.Cosmos.Table;
 using Microsoft.Extensions.Options;
 using System;
 using System.Collections.Generic;
@@ -17,6 +16,7 @@ using TEAMModelBI.Tool.Extension;
 using TEAMModelOS.SDK.Extension;
 
 using TEAMModelOS.SDK.Context.BI;
+using Microsoft.Azure.Cosmos.Table;
 
 namespace TEAMModelBI.Controllers.BITable
 {
@@ -138,7 +138,7 @@ namespace TEAMModelBI.Controllers.BITable
                 //保存操作记录
                 await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "operatelog-del", operateStr?.ToString(), _dingDing, httpContext: HttpContext);
 
-                if (temp.Count > 0)
+                if (temp.Count() > 0)
                 {
                     return Ok(new { state = 200 });
                 }

+ 18 - 20
TEAMModelBI/Controllers/BITable/TableDingDingInfoController.cs

@@ -17,10 +17,8 @@ using System.Net.Http.Json;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
 using System.Net;
 using TEAMModelOS.SDK.Extension;
-using OpenXmlPowerTools;
 using System.Text;
-using Azure.Cosmos;
-using Microsoft.Azure.Cosmos.Table;
+using Microsoft.Azure.Cosmos;
 using TEAMModelBI.Filter;
 using TEAMModelBI.Tool.Extension;
 using TEAMModelBI.Models;
@@ -30,8 +28,8 @@ using TEAMModelOS.SDK.Context.BI;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Context.Constant;
 using TEAMModelOS.SDK.Models.Dtos;
-using DocumentFormat.OpenXml.Bibliography;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BISchool;
+using Microsoft.Azure.Cosmos.Table;
 
 namespace TEAMModelBI.Controllers.BITable
 {
@@ -186,7 +184,7 @@ namespace TEAMModelBI.Controllers.BITable
                 var users = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", $"{divide}" } });
 
                 List<DingDingUserInfo> noExisits = new();
-                if (users.Count > 0)
+                if (users.Count() > 0)
                 {
                     //var temps = users.Union(tempddUserInfos).Except(users.Intersect(tempddUserInfos));
                     List<DingDingUserInfo> existsUserInfo = users.Where(u => !tempddUserInfos.Exists(e => u.userId.Equals(e.userId) && u.PartitionKey.Equals(e.PartitionKey))).ToList();
@@ -418,7 +416,7 @@ namespace TEAMModelBI.Controllers.BITable
                         {
                             string tempSql = $"select value(c) from c join a in c.sales where a.id='{itemR}'";
 
-                            await foreach (var itemRel in cosmosCliet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<BIRelation>(queryText: tempSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
+                            await foreach (var itemRel in cosmosCliet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<BIRelation>(queryText: tempSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
                             {
                                 var tempRel = itemRel.sales.Find(f => f.id.Equals(itemR));
                                 itemRel.sales.Remove(tempRel);
@@ -428,7 +426,7 @@ namespace TEAMModelBI.Controllers.BITable
                             }
 
                             //string sql = $"select value(c) from c where c.pk='Teacher' and c.id='{item.tmdId}'";
-                            //await foreach (var scTch in cosmosCliet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<SchoolTeacher>(queryText: sql, requestOptions: new QueryRequestOptions() { })) 
+                            //await foreach (var scTch in cosmosCliet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<SchoolTeacher>(queryText: sql, requestOptions: new QueryRequestOptions() { })) 
                             //{
                             //    if (scTch.roles.Contains("sales"))
                             //    {
@@ -455,7 +453,7 @@ namespace TEAMModelBI.Controllers.BITable
 
                             string tempSql = $"select value(c) from c join a in c.assists where a.id='{itemR}'";
 
-                            await foreach (var itemRel in cosmosCliet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<BIRelation>(queryText: tempSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
+                            await foreach (var itemRel in cosmosCliet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<BIRelation>(queryText: tempSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
                             {
                                 var tempRel = itemRel.sales.Find(f => f.id.Equals(itemR));
                                 itemRel.assists.Remove(tempRel);
@@ -465,7 +463,7 @@ namespace TEAMModelBI.Controllers.BITable
                             }
 
                             //string sql = $"select value(c) from c where c.pk='Teacher' and c.id='{item.tmdId}'";
-                            //await foreach (var scTch in cosmosCliet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<SchoolTeacher>(queryText: sql, requestOptions: new QueryRequestOptions() { }))
+                            //await foreach (var scTch in cosmosCliet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<SchoolTeacher>(queryText: sql, requestOptions: new QueryRequestOptions() { }))
                             //{
                             //    if (scTch.roles.Contains("assist"))
                             //    {
@@ -869,7 +867,7 @@ namespace TEAMModelBI.Controllers.BITable
                     var userInfos = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", $"{partitionKey}" } });
 
                     var adminInfos = userInfos.FindAll(x => x.roles.Contains("admin"));
-                    if (adminInfos.Count == 1)
+                    if (adminInfos.Count() == 1)
                     {
                         return Ok(new { state = 403, msg = "已经是最后一个管理员了" });
                     }
@@ -1037,11 +1035,11 @@ namespace TEAMModelBI.Controllers.BITable
                 var users = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", $"{divide}" } });
 
                 List<DingDingUserInfo> noExisits = new();
-                if (users.Count > 0)
+                if (users.Count() > 0)
                 {
                     //var temps = users.Union(tempddUserInfos).Except(users.Intersect(tempddUserInfos));
                     List<DingDingUserInfo> existsUserInfo = users.Where(u => !tempddUserInfos.Exists(e => u.userId.Equals(e.userId) && u.PartitionKey.Equals(e.PartitionKey))).ToList();
-                    if (users.Count >= tempddUserInfos.Count)
+                    if (users.Count() >= tempddUserInfos.Count)
                     {
                         existsUserInfo.AddRange(tempddUserInfos.Where(e => !users.Exists(u => e.userId.Equals(u.userId) && e.PartitionKey.Equals(u.PartitionKey))).ToList());
                     }
@@ -1435,7 +1433,7 @@ namespace TEAMModelBI.Controllers.BITable
                 string reole = null;
 
                 var tempUser = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", $"{partKey}" }, { "RowKey", $"{rowKey}" } });
-                if (tempUser.Count > 0)
+                if (tempUser.Count() > 0)
                 {
                     foreach (var item in tempUser)
                     {
@@ -1462,9 +1460,9 @@ namespace TEAMModelBI.Controllers.BITable
 
                     Teacher teacher = new();
                     var respone = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync(coreUser.id, new PartitionKey("Base"));
-                    if (respone.Status == 200)
+                    if (respone.StatusCode == HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(respone.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(respone.Content);
                         teacher = json.ToObject<Teacher>();
                     }
                     else
@@ -1480,7 +1478,7 @@ namespace TEAMModelBI.Controllers.BITable
                     }
 
                     List<Task<ItemResponse<BIRelation>>> scRole = new();
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<BIRelation>(queryText: $"select value(c) from c join a in c.assists join s in c.sales  where c.code='BIRel' and  s.id='{oldTmdId}' or a.id='{oldTmdId}'", requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<BIRelation>(queryText: $"select value(c) from c join a in c.assists join s in c.sales  where c.code='BIRel' and  s.id='{oldTmdId}' or a.id='{oldTmdId}'", requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
                     {
                         var tempAss = item.assists.Find(f => f.id.Equals($"{oldTmdId}"));
                         if (tempAss != null)
@@ -1515,13 +1513,13 @@ namespace TEAMModelBI.Controllers.BITable
                     }
 
                     //List<Task<ItemResponse<SchoolTeacher>>> schoolTeachers = new();
-                    //await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<SchoolTeacher>($"select value(c) from c where c.pk='Teacher' and c.id='{oldTmdId}'"))
+                    //await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<SchoolTeacher>($"select value(c) from c where c.pk='Teacher' and c.id='{oldTmdId}'"))
                     //{
                     //    item.id = coreUser.id;
                     //    var resp = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{coreUser.id}", new PartitionKey($"{item.code}"));
                     //    if (resp.Status == 200)
                     //    {
-                    //        using var json = await JsonDocument.ParseAsync(resp.ContentStream);
+                    //        using var json = await JsonDocument.ParseAsync(resp.Content);
                     //        SchoolTeacher scTeacher = json.ToObject<SchoolTeacher>();
                     //        if (scTeacher.roles.Contains("sales"))
                     //            scTeacher.roles.Remove("sales");
@@ -1570,7 +1568,7 @@ namespace TEAMModelBI.Controllers.BITable
                     //    }
                     //}
 
-                    if (respone.Status == 200)
+                    if (respone.StatusCode == HttpStatusCode.OK)
                         await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
                     else
                         await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
@@ -1676,7 +1674,7 @@ namespace TEAMModelBI.Controllers.BITable
                     {
                         var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
                         var users = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", $"{partitionKey}" }, { "userId", $"{itemUser.Userid}" }, { "unionId", $"{itemUser.Unionid}" } });
-                        if (users.Count > 0)
+                        if (users.Count() > 0)
                         {
                             foreach (var user in users)
                             {

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

@@ -1,7 +1,7 @@
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System.Text.Json;
 using System.Threading.Tasks;
 using System.Collections.Generic;
@@ -58,9 +58,9 @@ namespace TEAMModelBI.Controllers.BITeacher
                 sqlTxt = $"select c.id,c.name,c.code,c.picture from c join a1 in c.schools where a1.schoolId='{schoolCode}'";
             }
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0) 
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -97,9 +97,9 @@ namespace TEAMModelBI.Controllers.BITeacher
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> objs = new();
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id='{teacherId}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIteratorSql(queryText: $"select value(c) from c where c.id='{teacherId}'", requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0) 
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray()) 

+ 13 - 12
TEAMModelBI/Controllers/BITest/Ies5TestController.cs

@@ -2,6 +2,7 @@
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Azure.Cosmos;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Options;
 using StackExchange.Redis;
@@ -103,7 +104,7 @@ namespace TEAMModelBI.Controllers.BITest
 
             if ($"{actType}".Equals("Study"))
             {
-                study = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Study>($"{id}", new Azure.Cosmos.PartitionKey($"Study-{code}"));
+                study = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Study>($"{id}", new PartitionKey($"Study-{code}"));
                 if (study.groupLists.Count > 0)
                 {
                     var group = study.groupLists;
@@ -122,7 +123,7 @@ namespace TEAMModelBI.Controllers.BITest
             }
             else if ($"{actType}".Equals("Vote"))
             {
-                vote = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>($"{id}", new Azure.Cosmos.PartitionKey($"Vote-{code}"));
+                vote = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>($"{id}", new PartitionKey($"Vote-{code}"));
                 classes = vote.classes;
                 stuLists = vote.stuLists;
                 tchLists = vote.tchLists;
@@ -130,7 +131,7 @@ namespace TEAMModelBI.Controllers.BITest
             }
             else if ($"{actType}".Equals("Homework"))
             {
-                work = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Homework>($"{id}", new Azure.Cosmos.PartitionKey($"Homework-{code}"));
+                work = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Homework>($"{id}", new PartitionKey($"Homework-{code}"));
                 classes = work.classes;
                 stuLists = work.stuLists;
                 tchLists = work.tchLists;
@@ -138,7 +139,7 @@ namespace TEAMModelBI.Controllers.BITest
             }
             else if ($"{actType}".Equals("Survey")) 
             {
-                survey = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>($"{id}", new Azure.Cosmos.PartitionKey($"Survey-{code}"));
+                survey = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>($"{id}", new PartitionKey($"Survey-{code}"));
                 classes = survey.classes;
                 stuLists = survey.stuLists;
                 tchLists = survey.tchLists;
@@ -146,7 +147,7 @@ namespace TEAMModelBI.Controllers.BITest
             }
             else if ($"{actType}".Equals("ExamLite")) 
             {
-                examLite = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamLite>($"{id}", new Azure.Cosmos.PartitionKey($"ExamLite-{code}"));
+                examLite = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamLite>($"{id}", new PartitionKey($"ExamLite-{code}"));
                 classes = examLite.classes;
                 stuLists = examLite.stuLists;
                 tchLists = examLite.tchLists;
@@ -154,7 +155,7 @@ namespace TEAMModelBI.Controllers.BITest
             }
             else if ($"{actType}".Equals("Exam"))
             {
-                examInfo = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>($"{id}", new Azure.Cosmos.PartitionKey($"Exam-{code}"));
+                examInfo = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>($"{id}", new PartitionKey($"Exam-{code}"));
                 classes = examInfo.classes;
                 stuLists = examInfo.stuLists;
                 school = examInfo.school;
@@ -165,37 +166,37 @@ namespace TEAMModelBI.Controllers.BITest
             if ($"{actType}".Equals("Study"))
             {
                 study.staffIds = idsList;
-                study = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Study>(study, study.id, new Azure.Cosmos.PartitionKey($"Study-{code}"));
+                study = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Study>(study, study.id, new PartitionKey($"Study-{code}"));
                 showAct = study;
             }
             else if ($"{actType}".Equals("Vote"))
             {
                 vote.staffIds = idsList;
-                vote = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Vote>(vote, vote.id, new Azure.Cosmos.PartitionKey($"Vote-{code}")); 
+                vote = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Vote>(vote, vote.id, new PartitionKey($"Vote-{code}")); 
                 showAct = vote;
             }
             else if ($"{actType}".Equals("Homework"))
             {
                 work.staffIds = idsList;
-                work = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Homework>(work, work.id, new Azure.Cosmos.PartitionKey($"Homework-{code}"));
+                work = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Homework>(work, work.id, new PartitionKey($"Homework-{code}"));
                 showAct = work;
             }
             else if ($"{actType}".Equals("Survey"))
             {
                 survey.staffIds = idsList;
-                survey = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Survey>(survey, survey.id, new Azure.Cosmos.PartitionKey($"Survey-{code}"));
+                survey = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<Survey>(survey, survey.id, new PartitionKey($"Survey-{code}"));
                 showAct = work;
             }
             else if ($"{actType}".Equals("ExamLite"))
             {
                 examLite.staffIds = idsList;
-                examLite = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<ExamLite>(examLite, examLite.id, new Azure.Cosmos.PartitionKey($"ExamLite-{code}"));
+                examLite = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<ExamLite>(examLite, examLite.id, new PartitionKey($"ExamLite-{code}"));
                 showAct = work;
             }
             else if ($"{actType}".Equals("Exam"))
             {
                 examInfo.staffIds = idsList;
-                examInfo = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<ExamInfo>(examInfo, examInfo.id, new Azure.Cosmos.PartitionKey($"Exam-{code}"));
+                examInfo = await cosmosClient.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<ExamInfo>(examInfo, examInfo.id, new PartitionKey($"Exam-{code}"));
                 showAct = work;
             }
 

+ 32 - 36
TEAMModelBI/Controllers/BITest/TestController.cs

@@ -1,12 +1,10 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using DingTalk.Api;
 using DingTalk.Api.Request;
 using DingTalk.Api.Response;
-using HTEXLib.COMM.Helpers;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.Azure.Cosmos.Table;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Options;
 using System;
@@ -53,15 +51,13 @@ using Azure.Storage.Blobs;
 using Azure.Storage.Blobs.Specialized;
 using System.Web;
 using Azure.Storage.Sas;
-using DocumentFormat.OpenXml.Drawing.Diagrams;
-using DocumentFormat.OpenXml.Bibliography;
 using TEAMModelOS.SDK.Models.Service.BIStatsWay;
 using MathNet.Numerics.LinearAlgebra.Double;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BISchool;
-using DocumentFormat.OpenXml.Drawing;
 using Microsoft.OData.Edm;
 using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BICommon;
+using Microsoft.Azure.Cosmos.Table;
 
 namespace TEAMModelBI.Controllers.BITest
 {
@@ -108,7 +104,7 @@ namespace TEAMModelBI.Controllers.BITest
             List<string> abilityIds = new();  //册别的ID集合
 
             //查询册别信息
-            await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_oldStandard}") }))
+            await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_oldStandard}") }))
             {
                 abilityIds.Add(tempAbility.id);  //查询出来册别ID添加册别ID集合
             }
@@ -120,7 +116,7 @@ namespace TEAMModelBI.Controllers.BITest
 
             List<string> abilityTaskIds = new();  //章节ID集合
 
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
             {
                 abilityTaskIds.Add(item.id);   //查询出来的章节信息ID添加到战绩集合
             }
@@ -464,7 +460,7 @@ namespace TEAMModelBI.Controllers.BITest
                     stringBuilder.Append($" where c.id='{_schoolCode}'");
                 }
 
-                //await foreach (var itemSchool in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<School>(queryText: stringBuilder.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                //await foreach (var itemSchool in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<School>(queryText: stringBuilder.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 //{
                 //    SchoolAssist schoolAssist = new()
                 //    {
@@ -488,7 +484,7 @@ namespace TEAMModelBI.Controllers.BITest
                 //    var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(itemSchool.id, new PartitionKey("ProductSum"));
                 //    if (response.Status == 200)
                 //    {
-                //        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                //        using var json = await JsonDocument.ParseAsync(response.Content);
 
                 //        if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                 //        {
@@ -510,9 +506,9 @@ namespace TEAMModelBI.Controllers.BITest
                 //}
                 //return Ok(new { state = 200, schoolAssists });
 
-                await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: stringBuilder.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                await foreach (var itemSchool in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: stringBuilder.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 {
-                    using var jsonSchool = await JsonDocument.ParseAsync(itemSchool.ContentStream);
+                    using var jsonSchool = await JsonDocument.ParseAsync(itemSchool.Content);
                     foreach (var objSchool in jsonSchool.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         var schoolId = objSchool.GetProperty("id").GetString();
@@ -539,9 +535,9 @@ namespace TEAMModelBI.Controllers.BITest
                         catch { schoolAssist.scale = 0; }
 
                         var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("ProductSum"));
-                        if (response.Status == 200)
+                        if (response.StatusCode == HttpStatusCode.OK)
                         {
-                            using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                            using var json = await JsonDocument.ParseAsync(response.Content);
                             if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                             {
                                 schoolAssist.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
@@ -589,9 +585,9 @@ namespace TEAMModelBI.Controllers.BITest
             foreach (var temp in schoolAssists)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(temp.id, new PartitionKey("ProductSum"));
-                if (response.Status == 200)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                     {
                         temp.serial = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
@@ -669,10 +665,10 @@ namespace TEAMModelBI.Controllers.BITest
 
                 //string sqlText = $"select value(c.id) from c where c.pk='Item' and c.field={i}";
                 string sqlText = $"select value(COUNT(c.id)) from c where c.pk='Item' and c.field={i}";
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<int>(queryText: sqlText, requestOptions: new QueryRequestOptions() { }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<int>(queryText: sqlText, requestOptions: new QueryRequestOptions() { }))
                 {
                     total += item;
-                    //using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    //using var json = await JsonDocument.ParseAsync(item.Content);
                     //if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
                     //{
                     //    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -684,10 +680,10 @@ namespace TEAMModelBI.Controllers.BITest
                     //}
                 }
 
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<int>(queryText: sqlText, requestOptions: new QueryRequestOptions() { }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<int>(queryText: sqlText, requestOptions: new QueryRequestOptions() { }))
                 {
                     total += item;
-                    //using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    //using var json = await JsonDocument.ParseAsync(item.Content);
                     //if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt64() > 0)
                     //{
                     //    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -784,9 +780,9 @@ namespace TEAMModelBI.Controllers.BITest
             {
                 var start = 00022222330;
                 long tempCount = 0;
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"SELECT c._ts,c.name,c.id FROM c WHERE c._ts>={start}L", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT c._ts,c.name,c.id FROM c WHERE c._ts>={start}L", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt64() > 0)
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -1031,9 +1027,9 @@ namespace TEAMModelBI.Controllers.BITest
             List<School> schools = new List<School>();
             //string sqlTxt = $"SELECT * FROM c where c.code='Base' order by c.id offset {endPosition} limit {pageSize}";
             string sqlTxt = $"SELECT * FROM c order by c.id offset {pageSize} limit {endPosition}";
-            await foreach (var tempPage in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var tempPage in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
             {
-                using var json = await JsonDocument.ParseAsync(tempPage.ContentStream);
+                using var json = await JsonDocument.ParseAsync(tempPage.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -1081,9 +1077,9 @@ namespace TEAMModelBI.Controllers.BITest
 
             List<School> schools = new();
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: "select value(c) from c", continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: "select value(c) from c", continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -1093,7 +1089,7 @@ namespace TEAMModelBI.Controllers.BITest
 
                     if (iscontinuation)
                     {
-                        continuationToken = item.GetContinuationToken();
+                        continuationToken = item.ContinuationToken;
                         break;
                     }
                 }
@@ -1325,13 +1321,13 @@ namespace TEAMModelBI.Controllers.BITest
 
             var cosmosDefaulat = _azureCosmos.GetCosmosClient(); //默认数据库
             List<School> schools = new();
-            await foreach (var item in cosmosDefaulat.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<School>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosDefaulat.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<School>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 schools.Add(item);
             }
             var cosmosGlobal = _azureCosmos.GetCosmosClient(name: "Global"); //默认数据库
             List<School> schoolGlobals = new();
-            await foreach (var item in cosmosGlobal.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<School>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosGlobal.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<School>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 schoolGlobals.Add(item);
             }
@@ -1357,7 +1353,7 @@ namespace TEAMModelBI.Controllers.BITest
             //School school = new();
             //if (response.Status == 200)
             //{
-            //    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+            //    using var json = await JsonDocument.ParseAsync(response.Content);
             //    school = json.ToObject<School>();
             //}
 
@@ -1407,7 +1403,7 @@ namespace TEAMModelBI.Controllers.BITest
             //        }
             //    }
             //}
-            var (an, saveUrl) = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, $"{path}", BIConst.LogChina, timeType: $"{jTimeType}");
+            var (an, saveUrl) = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _dingDing, $"{path}", BIConst.LogChina, timeType: $"{jTimeType}");
 
             return Ok(new { state = RespondCode.Ok, cnt = filename.Count, filename, an, saveUrl });
         }
@@ -1433,13 +1429,13 @@ namespace TEAMModelBI.Controllers.BITest
 
 
             string path = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={y}/m={m}/d={d}/h={h}/m=00/PT1H.json";
-            var retn = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, path, BIConst.LogChina);
+            var retn = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _dingDing, path, BIConst.LogChina);
             if (retn.recCnts.IsNotEmpty())
             {
                 //https://teammodelos.blob.core.chinacloudapi.cn/0-public/pie-borderRadius.html
                 string publishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(retn.saveUrls.First(), Encoding.UTF8)}&time={HttpUtility.UrlEncode(datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时"), Encoding.UTF8)}";
                 string ulrs = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={retn.saveUrls.First()}&time={datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时")}";
-                string ulr = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(ulrs, Encoding.UTF8)}&delay=6000";
+                string ulr = $"http://52.130.252.100:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(ulrs, Encoding.UTF8)}&delay=6000";
                 string image = "";
 
                 try
@@ -1469,14 +1465,14 @@ namespace TEAMModelBI.Controllers.BITest
                 var ptD = pastTime.Day >= 10 ? $"{pastTime.Day}" : $"0{pastTime.Day}";
 
                 string dayPath = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={ptY}/m={ptM}/d={ptD}";
-                var dayRetn = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, dayPath, BIConst.LogChina, timeType: "Day");
+                var dayRetn = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _dingDing, dayPath, BIConst.LogChina, timeType: "Day");
 
                 if (dayRetn.recCnts.IsNotEmpty())
                 {
                     //一天的统计
                     string dayPublishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(dayRetn.saveUrls.First(), Encoding.UTF8)}&time={HttpUtility.UrlEncode(pastTime.ToString("yyyy年MM月dd日"), Encoding.UTF8)}";
                     string dayUrls = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={dayRetn.saveUrls.First()}&time={pastTime.ToString("yyyy年MM月dd日")}";
-                    string dayUrl = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(dayUrls, Encoding.UTF8)}&delay=6000";
+                    string dayUrl = $"http://52.130.252.100:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(dayUrls, Encoding.UTF8)}&delay=6000";
                     string dayImage = "";
 
                     string dayStr = await _httpClient.CreateClient().GetStringAsync(dayUrl);
@@ -1569,7 +1565,7 @@ namespace TEAMModelBI.Controllers.BITest
                 string newurl = $"{blobItem.Name}".Replace($"doc/", $"/SourceFiles/");//替换成新的容器路径
                 var urlSas = _azureStorage.GetBlobSAS($"1636016499", blobItem.Name, BlobSasPermissions.Read | BlobSasPermissions.List);   //获取容器sas和有效期
                 //await azureClient.GetBlobClient(newurl).StartCopyFromUriAsync(new Uri(urlSas));
-                await azureClient.GetBlobClient(newurl).StartCopyFromUriAsync(new Uri(urlSas));
+                await azureClient.GetBlobClient(newurl).StartCopyFromUriAsync(new Uri(urlSas.fullUri));
                 //await azureClient.GetBlobClient(newurl).SyncCopyFromUriAsync(new Uri(urlSas));  //添加复制文件到集合执行复制操作
             }
 

Разлика између датотеке није приказан због своје велике величине
+ 278 - 156
TEAMModelBI/Controllers/BITmid/TmidController.cs


+ 18 - 18
TEAMModelBI/Controllers/Census/ActivitySticsController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -66,7 +66,7 @@ namespace TEAMModelBI.Controllers.Census
                 if (!string.IsNullOrEmpty($"{areaId}"))
                 {
                     string areaSc = $"select value(c.id) from c where c.pk='School' and c.areaId='{areaId}'";
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: areaSc, requestOptions: new QueryRequestOptions() { }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: areaSc, requestOptions: new QueryRequestOptions() { }))
                     {
                         scIds.Add(item);
                     }
@@ -260,9 +260,9 @@ namespace TEAMModelBI.Controllers.Census
                 //string stSql = $"{oftenSql} join s in c.currency where c.TeacherTrain and {comSql} and s.submitTime = 0 or s.submitTime >= {setting.submitTime}";
                 //submitCount = await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", ctSql);
 
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: $"select c.id,c.code,c.totalTime,c.onlineTime,c.offlineTime,c.classTime,c.currency from c where c.pk='TeacherTrain' and {comSql}", requestOptions: new QueryRequestOptions() { })) 
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIteratorSql(queryText: $"select c.id,c.code,c.totalTime,c.onlineTime,c.offlineTime,c.classTime,c.currency from c where c.pk='TeacherTrain' and {comSql}", requestOptions: new QueryRequestOptions() { })) 
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -319,7 +319,7 @@ namespace TEAMModelBI.Controllers.Census
             //    scSqlTxt.Append($" where c.areaId='{areaId}'");
             //}
 
-            //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<RecSchool>(queryText: scSqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<RecSchool>(queryText: scSqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             //{
             //    schools.Add(item);
             //}
@@ -340,7 +340,7 @@ namespace TEAMModelBI.Controllers.Census
             //{
             //    int count = 0;
             //    int appraise = 0;
-            //    await foreach (var info in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<bool>(queryText: $"select value(array_contains(c.permissions,'train-appraise')) from c", requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Teacher-{school.id}") }))
+            //    await foreach (var info in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<bool>(queryText: $"select value(array_contains(c.permissions,'train-appraise')) from c", requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Teacher-{school.id}") }))
             //    {
             //        if (info)
             //        {
@@ -367,7 +367,7 @@ namespace TEAMModelBI.Controllers.Census
             //    else basics += 1;
 
             //    string sqlTxtSchool = $"select value(c) from c where c.code='LessonRecord-{school}'";
-            //    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<LessonRecord>(queryText: sqlTxtSchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school}") }))
+            //    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<LessonRecord>(queryText: sqlTxtSchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school}") }))
             //    {
             //        records.Add(item);
             //    }
@@ -433,7 +433,7 @@ namespace TEAMModelBI.Controllers.Census
             //foreach (var tecId in tecIds)
             //{
             //    string sqlTxt = $"select value(c) from c where c.id='{tecId}'";
-            //    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<LessonRecord>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord") }))
+            //    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<LessonRecord>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord") }))
             //    {
             //        records.Add(item);
             //    }
@@ -565,7 +565,7 @@ namespace TEAMModelBI.Controllers.Census
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
             List<AreaInfo> areaInfos = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<AreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<AreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
             {
                 areaInfos.Add(item);
             }
@@ -686,9 +686,9 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -750,9 +750,9 @@ namespace TEAMModelBI.Controllers.Census
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
                 }
                 ActivityCount activityCount = new() { id = itemId, name = school.name != null ? school.name : itemId };
@@ -795,9 +795,9 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
                     ActivityCount activityCount = new() { id = schoolId, name = school.name != null ? school.name : schoolId };
@@ -846,7 +846,7 @@ namespace TEAMModelBI.Controllers.Census
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<RecSchool> schools = new();
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<RecSchool>(queryText: $"select c.id,c.name,c.picture,c.scale from c where c.areaId='{areaId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<RecSchool>(queryText: $"select c.id,c.name,c.picture,c.scale from c where c.areaId='{areaId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 schools.Add(item);
             }
@@ -928,9 +928,9 @@ namespace TEAMModelBI.Controllers.Census
                 }
             }
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIteratorSql(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                 {
                     infos.Add(obj.ToObject<object>());

+ 2 - 2
TEAMModelBI/Controllers/Census/BlobLogController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -145,7 +145,7 @@ namespace TEAMModelBI.Controllers.Census
             {
                 foreach (var teacherId in teacherIds)
                 {
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<RecBlobFile>(queryText: $"SELECT c.id,c.code,c.name,c.size,c.type FROM c where c.pk='Bloblog'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{teacherId}") }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<RecBlobFile>(queryText: $"SELECT c.id,c.code,c.name,c.size,c.type FROM c where c.pk='Bloblog'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{teacherId}") }))
                     {
                         blobFiles.Add(item);
                     }

+ 21 - 22
TEAMModelBI/Controllers/Census/ItemSticsController.cs

@@ -5,7 +5,7 @@ using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
 using System.Threading.Tasks;
 using System.Collections.Generic;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System.Text.Json;
 using TEAMModelBI.Tool;
 using System;
@@ -16,7 +16,6 @@ using TEAMModelOS.SDK.Context.BI;
 using Azure.Core;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Context.Constant;
-using DocumentFormat.OpenXml.Wordprocessing;
 using TEAMModelOS.SDK.Models.Service.BI;
 
 namespace TEAMModelBI.Controllers.Census
@@ -88,9 +87,9 @@ namespace TEAMModelBI.Controllers.Census
             List<object> items = new();
             if (scope.ToString().Equals("private"))
             {
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIteratorQuery(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
 
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
@@ -103,9 +102,9 @@ namespace TEAMModelBI.Controllers.Census
             }
             else if (scope.ToString().Equals("school"))
             {
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorQuery(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
 
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
@@ -118,9 +117,9 @@ namespace TEAMModelBI.Controllers.Census
             }
             else
             {
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryStreamIteratorQuery(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
 
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
@@ -131,9 +130,9 @@ namespace TEAMModelBI.Controllers.Census
                     }
                 }
 
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorQuery(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{code}") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
 
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
@@ -173,9 +172,9 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var rsponse = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scid, new PartitionKey("Base"));
-                    if (rsponse.Status == 200)
+                    if (rsponse.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(rsponse.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(rsponse.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -226,9 +225,9 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var rsponse = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (rsponse.Status == 200) 
+                    if (rsponse.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
-                        using var json = await JsonDocument.ParseAsync(rsponse.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(rsponse.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -295,9 +294,9 @@ namespace TEAMModelBI.Controllers.Census
                     School school = new();
 
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200) 
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -362,9 +361,9 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200) 
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -431,9 +430,9 @@ namespace TEAMModelBI.Controllers.Census
                     tableName = "Teacher";
                 }
 
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", tableName).GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", tableName).GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         objItems.Add(obj.ToObject<object>());
@@ -445,9 +444,9 @@ namespace TEAMModelBI.Controllers.Census
                 List<string> tableName = new() { "School", "Teacher" };
                 foreach (string key in tableName) 
                 {
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", key).GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", key).GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
                     {
-                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(item.Content);
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                         {
                             objItems.Add(obj.ToObject<object>());

+ 35 - 35
TEAMModelBI/Controllers/Census/LessonSticsController.cs

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
 using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
 using Microsoft.Extensions.Options;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System.Text.Json;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using TEAMModelOS.SDK.Models;
@@ -73,7 +73,7 @@ namespace TEAMModelBI.Controllers.Census
             else
                 scSql.Append($" where c.areaId = null or c.areaId = ''");
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AreaSchools>(queryText: scSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<AreaSchools>(queryText: scSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
             {
                 areaSchools.Add(item);
             }
@@ -132,7 +132,7 @@ namespace TEAMModelBI.Controllers.Census
 
             foreach (var sId in schools)
             {
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<LessonCount>(queryText: sqlTxts, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{sId}-{year}") }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<LessonCount>(queryText: sqlTxts, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{sId}-{year}") }))
                 {
                     scount.Add(item);
                 }
@@ -142,7 +142,7 @@ namespace TEAMModelBI.Controllers.Census
             foreach (var tId in teacIds)
             {
                 var sqlTxtt = $"select value(c) from c where c.id='{tId}'";
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<LessonCount>(queryText: sqlTxtt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{year}") }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<LessonCount>(queryText: sqlTxtt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{year}") }))
                 {
                     tcount.Add(item);
                 }
@@ -229,7 +229,7 @@ namespace TEAMModelBI.Controllers.Census
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
             List<AllAreaInfo> areaInfos = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<AllAreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<AllAreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
             {
                 areaInfos.Add(item);
             }
@@ -289,9 +289,9 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -354,9 +354,9 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -405,16 +405,16 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
                     SchoolLen schoolLen = new() { id = schoolId, name = school != null ? school.name : schoolId };
 
                     List<List<double>> begin = new();
-                    await foreach (var lcount in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<LessonCount>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{schoolId}-{years}") }))
+                    await foreach (var lcount in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<LessonCount>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{schoolId}-{years}") }))
                     {
                         begin.Add(lcount.beginCount);
                     }
@@ -427,7 +427,7 @@ namespace TEAMModelBI.Controllers.Census
             else
             {
                 List<List<double>> begin = new();
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<LessonCount>(queryText: "select value(c) from c where c.pk='LessonCount'", requestOptions: new QueryRequestOptions() { }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<LessonCount>(queryText: "select value(c) from c where c.pk='LessonCount'", requestOptions: new QueryRequestOptions() { }))
                 {
                     begin.Add(item.beginCount);
                 }
@@ -459,9 +459,9 @@ namespace TEAMModelBI.Controllers.Census
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(scid, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
                 }
 
@@ -485,13 +485,13 @@ namespace TEAMModelBI.Controllers.Census
                 List<LessonCount> tcount = new();
                 DenseMatrix dense = null;
                 var queryClass = $"select value(c) from c ";
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<LessonCount>(queryText: queryClass, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{scid}-{syear}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<LessonCount>(queryText: queryClass, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{scid}-{syear}") }))
                 {
                     scount.Add(item);
                 }
                 if (tyear > syear)
                 {
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<LessonCount>(queryText: queryClass, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{scid}-{tyear}") }))
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<LessonCount>(queryText: queryClass, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonCount-{scid}-{tyear}") }))
                     {
                         tcount.Add(item);
                     }
@@ -573,7 +573,7 @@ namespace TEAMModelBI.Controllers.Census
             foreach (var school in schools)
             {
                 string sqlTxt = $"select value(c) from c where c.code='LessonRecord-{school}'";
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<LessonRecord>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<LessonRecord>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school}") }))
                 {
                     records.Add(item);
                 }
@@ -583,7 +583,7 @@ namespace TEAMModelBI.Controllers.Census
             foreach (var tecId in tecIds)
             {
                 string sqlTxt = $"select value(c) from c where c.id='{tecId}'";
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<LessonRecord>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<LessonRecord>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord") }))
                 {
                     records.Add(item);
                 }
@@ -630,9 +630,9 @@ namespace TEAMModelBI.Controllers.Census
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<object> lessons = new();
             string sqlTxt = $"select * from c where c.id='{lessonId}'";
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { })) 
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { })) 
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                 {
                     lessons.Add(obj.ToObject<object>());
@@ -760,9 +760,9 @@ namespace TEAMModelBI.Controllers.Census
             List<double> yHours = new(daHours);
 
             var openRes = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{year}", new PartitionKey("LessonYear"));
-            if (openRes.Status == 200)
+            if (openRes.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(openRes.ContentStream);
+                using var json = await JsonDocument.ParseAsync(openRes.Content);
                 LessonStats lessonYear = json.ToObject<LessonStats>();
                 if (type == 0)
                 {
@@ -794,9 +794,9 @@ namespace TEAMModelBI.Controllers.Census
             }
 
             var lessRes = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{hourId}", new PartitionKey("LessonHour"));
-            if (lessRes.Status == 200)
+            if (lessRes.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(lessRes.ContentStream);
+                using var json = await JsonDocument.ParseAsync(lessRes.Content);
                 LessonStats lessonHour = json.ToObject<LessonStats>();
                 if (type == 0)
                 {
@@ -831,9 +831,9 @@ namespace TEAMModelBI.Controllers.Census
             if (!string.IsNullOrEmpty(schoolId))
             {
                 var openResSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{year}", new PartitionKey($"LessonYear-{schoolId}"));
-                if (openResSc.Status == 200)
+                if (openResSc.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var jsonSc = await JsonDocument.ParseAsync(openResSc.ContentStream);
+                    using var jsonSc = await JsonDocument.ParseAsync(openResSc.Content);
                     LessonStats lessonYearSc = jsonSc.ToObject<LessonStats>();
                     if (type == 0)
                         if (lessonYearSc.open.Count == 0)
@@ -863,9 +863,9 @@ namespace TEAMModelBI.Controllers.Census
                 }
 
                 var lessResSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{hourId}", new PartitionKey($"LessonHour-{schoolId}"));
-                if (lessResSc.Status == 200)
+                if (lessResSc.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var jsonSc = await JsonDocument.ParseAsync(lessResSc.ContentStream);
+                    using var jsonSc = await JsonDocument.ParseAsync(lessResSc.Content);
                     LessonStats lessonHourSc = jsonSc.ToObject<LessonStats>();
                     if (type == 0)
                         if (lessonHourSc.open.Count == 0)
@@ -915,12 +915,12 @@ namespace TEAMModelBI.Controllers.Census
 
             List<LessonRecord> allLesson = new();
 
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<LessonRecord>(queryText: $"select value(c) from c where c.pk='LessonRecord'", requestOptions: new QueryRequestOptions() { }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<LessonRecord>(queryText: $"select value(c) from c where c.pk='LessonRecord'", requestOptions: new QueryRequestOptions() { }))
             {
                 allLesson.Add(item);
             }
 
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<LessonRecord>(queryText: $"select value(c) from c where c.pk='LessonRecord'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("LessonRecord") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<LessonRecord>(queryText: $"select value(c) from c where c.pk='LessonRecord'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("LessonRecord") }))
             {
                 allLesson.Add(item);
             }
@@ -930,9 +930,9 @@ namespace TEAMModelBI.Controllers.Census
             foreach (var itemY in lessYears)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(itemY.id, new PartitionKey($"{itemY.code}"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     LessonStats lessonYear = json.ToObject<LessonStats>();
                     lessonYear.open = itemY.open;
                     lessonYear.lesson = itemY.lesson;
@@ -946,9 +946,9 @@ namespace TEAMModelBI.Controllers.Census
             foreach (var itemH in lessHours)
             {
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(itemH.id, new PartitionKey($"{itemH.code}"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     LessonStats lessonHour = json.ToObject<LessonStats>();
                     lessonHour.open = itemH.open;
                     lessonHour.lesson = itemH.lesson;

+ 19 - 21
TEAMModelBI/Controllers/Census/PaperController.cs

@@ -1,8 +1,7 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Azure.Storage.Blobs;
 using Azure.Storage.Blobs.Models;
 using Azure.Storage.Sas;
-using DocumentFormat.OpenXml.Drawing.Diagrams;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -23,7 +22,6 @@ using TEAMModelOS.Models;
 using TEAMModelOS.SDK.Context.BI;
 using TEAMModelOS.SDK.Context.Constant;
 using TEAMModelOS.SDK.DI;
-using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
@@ -106,7 +104,7 @@ namespace TEAMModelBI.Controllers.Census
             List<Paper> papers = new();
             if (scope.ToString().Equals("school"))
             {
-                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Paper>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{code}") }))
+                await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<Paper>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{code}") }))
                 {
                     papers.Add(item);
                 }
@@ -152,11 +150,11 @@ namespace TEAMModelBI.Controllers.Census
                         paper.code = $"Paper-{itemSc.newSc}";
 
                         var resState = await cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(paper.id, new PartitionKey(paper.code));
-                        if (resState.Status == 200)
+                        if (resState.StatusCode == System.Net.HttpStatusCode.OK)
                             paper.id = Guid.NewGuid().ToString();
 
                         msg.Append($"将学校[{cItem.oldSc}]中的[{cItem.oldId}]试卷复制到新学校试卷新id:{paper.id}");
-                        await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<string>(queryText: $"select value(c.name) from c where c.name='{paper.name}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{itemSc.newSc}") }))
+                        await foreach (var item in cosmosClinet.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<string>(queryText: $"select value(c.name) from c where c.name='{paper.name}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{itemSc.newSc}") }))
                         {
                             existPaper.Add(item);
                         }
@@ -177,7 +175,7 @@ namespace TEAMModelBI.Controllers.Census
                             await foreach (BlobItem blobItem in oldBobCilent.GetBlobsAsync(BlobTraits.None, BlobStates.None, blobUrl))
                             {
                                 var urlSas = _azureStorage.GetBlobSAS($"{cItem.oldSc}", blobItem.Name, BlobSasPermissions.Read | BlobSasPermissions.List);   //获取容器sas和有效期
-                                filelist.Add(newBobCilent.GetBlobClient(blobItem.Name).StartCopyFromUriAsync(new Uri(urlSas)));
+                                filelist.Add(newBobCilent.GetBlobClient(blobItem.Name).StartCopyFromUriAsync(new Uri(urlSas.fullUri)));
                                 ////序列化数据修改数据
                                 //if (blobItem.Name.EndsWith(".json"))
                                 //{
@@ -293,9 +291,9 @@ namespace TEAMModelBI.Controllers.Census
                     };
                     School school = new();
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -365,9 +363,9 @@ namespace TEAMModelBI.Controllers.Census
             {
                 School school = new();
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                if (response.Status == 200) 
+                if (response.StatusCode == System.Net.HttpStatusCode.OK) 
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
                 }
 
@@ -420,9 +418,9 @@ namespace TEAMModelBI.Controllers.Census
                 {
                     School school = new();
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if (response.Status == 200) 
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -471,9 +469,9 @@ namespace TEAMModelBI.Controllers.Census
                     School school = new();
 
                     var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
-                    if(response.Status == 200) 
+                    if(response.StatusCode == System.Net.HttpStatusCode.OK) 
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
@@ -483,9 +481,9 @@ namespace TEAMModelBI.Controllers.Census
 
                     schoolPaper.totals += await CommonFind.GetSqlValueCount(cosmosClient, "School", sqlTxt, $"Paper-{schoolId}");
 
-                    //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText:sqlTxt.ToString(),requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{schoolId}")}))
+                    //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText:sqlTxt.ToString(),requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{schoolId}")}))
                     //{
-                    //    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    //    using var json = await JsonDocument.ParseAsync(item.Content);
                     //    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
                     //    {
                     //        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -538,9 +536,9 @@ namespace TEAMModelBI.Controllers.Census
                     tableName = "Teacher";
                 }
 
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", tableName).GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", tableName).GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         paperInfos.Add(obj.ToObject<object>());
@@ -552,9 +550,9 @@ namespace TEAMModelBI.Controllers.Census
                 List<string> tableName = new(){ "School", "Teacher" };
                 foreach (var temp in tableName)
                 {
-                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", temp).GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
+                    await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", temp).GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { }))
                     {
-                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(item.Content);
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                         {
                             paperInfos.Add(obj.ToObject<object>());

+ 26 - 26
TEAMModelBI/Controllers/Census/ProductStatisController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Options;
@@ -58,9 +58,9 @@ namespace TEAMModelBI.Controllers.Census
             //if ($"{site}".Equals(BIConst.Global))
             //    cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
             List<ProductStatis> productStatis = new List<ProductStatis>();
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT c.serial,c.service FROM c",requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT c.serial,c.service FROM c",requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var itemCount in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -195,9 +195,9 @@ namespace TEAMModelBI.Controllers.Census
 
             //取产品的数量
             var response = await clientContainer.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolCode.ToString(), new PartitionKey($"ProductSum"));
-            if (response.Status == 200)
+            if (response.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                using var json = await JsonDocument.ParseAsync(response.Content);
                 productSum = json.ToObject<SchoolProductSum>();
                 prodinfo = productSum.prodinfo;
                 serialRecord = productSum.serial;
@@ -206,9 +206,9 @@ namespace TEAMModelBI.Controllers.Census
             }
 
             //软体
-            await foreach (var item in clientContainer.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: "SELECT * FROM c WHERE c.dataType='serial'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{schoolCode}") }))
+            await foreach (var item in clientContainer.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: "SELECT * FROM c WHERE c.dataType='serial'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{schoolCode}") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -219,9 +219,9 @@ namespace TEAMModelBI.Controllers.Census
             }
 
             //服务
-            await foreach (var item in clientContainer.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: "SELECT * FROM c WHERE c.dataType='service'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{schoolCode}") }))
+            await foreach (var item in clientContainer.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: "SELECT * FROM c WHERE c.dataType='service'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{schoolCode}") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -232,9 +232,9 @@ namespace TEAMModelBI.Controllers.Census
             }
 
             //硬体
-            await foreach (var item in clientContainer.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: "SELECT * FROM c WHERE c.dataType='hard'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{schoolCode}") }))
+            await foreach (var item in clientContainer.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: "SELECT * FROM c WHERE c.dataType='hard'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Product-{schoolCode}") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -246,7 +246,7 @@ namespace TEAMModelBI.Controllers.Census
 
             //学校教室
             List<Room> rooms = new();
-            await foreach (var item in clientContainer.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<Room>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Room-{schoolCode}") }))
+            await foreach (var item in clientContainer.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<Room>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Room-{schoolCode}") }))
             {
                 rooms.Add(item);
             }
@@ -277,9 +277,9 @@ namespace TEAMModelBI.Controllers.Census
                 School school = new();
 
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(scid, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
                 }
 
@@ -287,9 +287,9 @@ namespace TEAMModelBI.Controllers.Census
 
                 List<ProductStatis> productStatis = new();
 
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT c.serial,c.service FROM c where c.id='{scid}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT c.serial,c.service FROM c where c.id='{scid}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var itemCount in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         ////所有的产品信息
@@ -407,15 +407,15 @@ namespace TEAMModelBI.Controllers.Census
                     List<SchoolProductSumData> Services = new();
                     School school = new();
                     var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(scId, new PartitionKey("Base"));
-                    if (response.Status == 200)
+                    if (response.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(response.Content);
                         school = json.ToObject<School>();
                     }
 
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT c.serial,c.service FROM c where c.id='{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT c.serial,c.service FROM c where c.id='{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
                     {
-                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        using var json = await JsonDocument.ParseAsync(item.Content);
                         foreach (var itemCount in json.RootElement.GetProperty("Documents").EnumerateArray())
                         {
                             //软体产品
@@ -457,9 +457,9 @@ namespace TEAMModelBI.Controllers.Census
                 //软体产品
                 List<SchoolProductSumData> Services = new();
 
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT c.serial,c.service FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT c.serial,c.service FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var itemCount in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         //软体产品
@@ -526,15 +526,15 @@ namespace TEAMModelBI.Controllers.Census
                 List<SchoolProductSumData> Services = new();
                 School school = new();
                 var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(scId, new PartitionKey("Base"));
-                if (response.Status == 200)
+                if (response.StatusCode == System.Net.HttpStatusCode.OK)
                 {
-                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(response.Content);
                     school = json.ToObject<School>();
                 }
 
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: $"SELECT c.serial,c.service FROM c where c.id='{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: $"SELECT c.serial,c.service FROM c where c.id='{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var itemCount in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         //软体产品

Разлика између датотеке није приказан због своје велике величине
+ 55 - 57
TEAMModelBI/Controllers/Census/SchoolController.cs


+ 3 - 4
TEAMModelBI/Controllers/LoginController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using DingTalk.Api;
 using DingTalk.Api.Request;
 using DingTalk.Api.Response;
@@ -12,7 +12,6 @@ using System.Text.Json;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Models;
-using HTEXLib.COMM.Helpers;
 using TEAMModelOS.Models;
 using Microsoft.Extensions.Options;
 using TEAMModelOS.SDK.Extension;
@@ -560,7 +559,7 @@ namespace TEAMModelBI.Controllers
             else return Ok(new { state = RespondCode.ParamsError, msg = "手机号/和邮箱为空" });
 
             List<BizUsers> bizUsers = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<BizUsers>(queryText:loginSql,requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<BizUsers>(queryText:loginSql,requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
             {
                 bizUsers.Add(item);
             }
@@ -631,7 +630,7 @@ namespace TEAMModelBI.Controllers
             else return Ok(new { state = RespondCode.ParamsError, msg = "手机号/和邮箱为空" });
 
             List<BizUsers> tempBizUsers = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<BizUsers>(queryText: loginSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIteratorSql<BizUsers>(queryText: loginSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BizUsers") }))
             {
                 tempBizUsers.Add(item);
             }

+ 8 - 11
TEAMModelBI/Controllers/RepairApi/InitialAreaController.cs

@@ -14,15 +14,12 @@ using TEAMModelBI.Tool.Extension;
 using TEAMModelOS.SDK.Extension;
 using Microsoft.AspNetCore.Hosting;
 using TEAMModelOS.SDK.Models;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System;
 using System.Collections.Generic;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using System.Linq;
 using Pipelines.Sockets.Unofficial.Arenas;
-using TEAMModelOS.SDK.Models.Cosmos.BI;
-using TEAMModelBI.Filter;
-using HTEXLib.COMM.Helpers;
 using TEAMModelBI.Models;
 
 namespace TEAMModelBI.Controllers.RepairApi
@@ -97,7 +94,7 @@ namespace TEAMModelBI.Controllers.RepairApi
             var table = tableClient.GetTableReference("IESLogin");
 
             //查询新的是否存在
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c where c.standard='{standard}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select value(c) from c where c.standard='{standard}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
             {
                 if (item.standard.Equals($"{standard}"))
                     return Ok(new { state = 1, message = "新创区的standard已存在请检查" });
@@ -172,13 +169,13 @@ namespace TEAMModelBI.Controllers.RepairApi
             Area AreaS2 = null;
             List<Area> areas = new();
 
-            await foreach (var itemArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c where c.standard='standard2'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+            await foreach (var itemArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select value(c) from c where c.standard='standard2'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
             {
                 areas.Add(itemArea);
                 AreaS2 = itemArea;
             }
 
-            await foreach (var itemArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: $"select value(c) from c where c.standard='standard3'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
+            await foreach (var itemArea in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: $"select value(c) from c where c.standard='standard3'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-Area") }))
             {
                 areas.Add(itemArea);
             }
@@ -186,7 +183,7 @@ namespace TEAMModelBI.Controllers.RepairApi
             foreach (var area in areas)
             {
                 //查询要复制区域的能力标准点 
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{area.standard}") }))
                 {
                     if (!string.IsNullOrEmpty(item.blob))
                     {
@@ -225,7 +222,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                 try
                 {
                     //微能力点
-                    await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
+                    await foreach (var atask in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AbilityTask>(queryText: $"select value(c) from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{area.standard}") }))
                     {
                         List<Tnode> tnodes = new();
                         foreach (Tnode tnode in atask.children)
@@ -288,7 +285,7 @@ namespace TEAMModelBI.Controllers.RepairApi
             if (AreaS2 != null)
             {
                 //新政策文件
-                await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<StandardFile>(queryText: $"select value(c) from c where  c.id='{AreaS2.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
+                await foreach (StandardFile standardFile in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<StandardFile>(queryText: $"select value(c) from c where  c.id='{AreaS2.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StandardFile") }))
                 {
                     if (standardFile != null)
                     {
@@ -299,7 +296,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                 }
 
                 //新的区域设置
-                await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AreaSetting>(queryText: $"select value(c) from c where c.id='{AreaS2.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
+                await foreach (AreaSetting areaSetting in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<AreaSetting>(queryText: $"select value(c) from c where c.id='{AreaS2.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("AreaSetting") }))
                 {
                     if (areaSetting != null)
                     {

+ 2 - 2
TEAMModelBI/Controllers/RepairApi/NormalController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using DinkToPdf;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
@@ -61,7 +61,7 @@ namespace TEAMModelBI.Controllers.RepairApi
             string sql = $"select value(c) from c where c.name = '{oldName}'";
 
             Area area = new();
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Area>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<Area>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
             {
                 area = item;
             };

+ 31 - 19
TEAMModelBI/Controllers/RepairApi/SchoolRepController.cs

@@ -16,16 +16,14 @@ using System.Text;
 using TEAMModelOS.SDK.Extension;
 using System;
 using TEAMModelOS.SDK.Models;
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System.Linq;
 using TEAMModelOS.SDK.Context.Constant;
 using Pipelines.Sockets.Unofficial.Arenas;
 using TEAMModelBI.Tool;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BISchool;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
-using DocumentFormat.OpenXml.Math;
 using TEAMModelOS.SDK.Models.Service.BI;
-using TEAMModelBI.Tool.CosmosBank;
 using TEAMModelOS.SDK.Models.Service.BIStatsWay;
 using StackExchange.Redis;
 using System.Text.RegularExpressions;
@@ -161,12 +159,12 @@ namespace TEAMModelBI.Controllers.RepairApi
             if (!string.IsNullOrEmpty($"{periodName}"))
                 scName = $"{periodName}";
 
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<School>(queryText: "select value(c) from c where c.code='Base' and c.period=[]", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<School>(queryText: "select value(c) from c where c.code='Base' and c.period=[]", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 allSc.Add(item);
             }
 
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<School>(queryText: noPeriodScSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<School>(queryText: noPeriodScSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 allSc.Add(item);
             }
@@ -420,10 +418,10 @@ namespace TEAMModelBI.Controllers.RepairApi
                 {
                     BIRelation bIRelation = null;
                     var resRel = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("BIRel"));
-                    if (resRel.Status == 200)
+                    if (resRel.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         continue;
-                        //using var fileJson = await JsonDocument.ParseAsync(resRel.ContentStream);
+                        //using var fileJson = await JsonDocument.ParseAsync(resRel.Content);
                         //bIRelation = fileJson.ToObject<BIRelation>();
                     }
                     else
@@ -432,7 +430,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                         string areaName = null;
                         if (!string.IsNullOrEmpty(scBaseInfo.areaId))
                         {
-                            await foreach (var itemName in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<string>(queryText: $"select value(c.name) from c where c.pk='Area' and c.id='{scBaseInfo.areaId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
+                            await foreach (var itemName in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIteratorSql<string>(queryText: $"select value(c.name) from c where c.pk='Area' and c.id='{scBaseInfo.areaId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))
                             {
                                 areaName = itemName;
                             }
@@ -457,9 +455,9 @@ namespace TEAMModelBI.Controllers.RepairApi
                         };
 
                         var response = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(itemId, new PartitionKey("ProductSum"));
-                        if (response.Status == 200)
+                        if (response.StatusCode == System.Net.HttpStatusCode.OK)
                         {
-                            using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                            using var json = await JsonDocument.ParseAsync(response.Content);
                             if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
                             {
                                 List<string> serials = serial.ToObject<List<SchoolProductSumData>>().Select(x => x.prodCode).ToList();
@@ -529,9 +527,9 @@ namespace TEAMModelBI.Controllers.RepairApi
                     id = sc;
                     StatsInfo statsInfo = new();
                     var scDataStats = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{year}-{sc}", new PartitionKey("Statistics"));
-                    if (scDataStats.Status == 200)
+                    if (scDataStats.StatusCode == System.Net.HttpStatusCode.OK)
                     {
-                        using var fileJson = await JsonDocument.ParseAsync(scDataStats.ContentStream);
+                        using var fileJson = await JsonDocument.ParseAsync(scDataStats.Content);
                         statsInfo = fileJson.ToObject<StatsInfo>();
                     }
                     else
@@ -542,7 +540,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                     statsInfo = await SchoolStatsWay.GetSingleSc(cosmosClient, redisClinet, sc, year);
                     statsInfo.witRoom = ((int)await SchoolStatsWay.GetShoolWisdomRoomCount(_azureCosmos, _azureRedis, _configuration, _httpClient, _dingDing, statsInfo.schoolId));
 
-                    if (scDataStats.Status == 200)
+                    if (scDataStats.StatusCode == System.Net.HttpStatusCode.OK)
                         taskStss.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<StatsInfo>(statsInfo, $"{year}-{sc}", new PartitionKey("Statistics")));
                     else
                         taskStss.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").CreateItemAsync<StatsInfo>(statsInfo, new PartitionKey("Statistics")));
@@ -578,19 +576,33 @@ namespace TEAMModelBI.Controllers.RepairApi
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("set-allProdAnalysis")]
-        public async Task<IActionResult> SetAllProdAnalysis()
+        public async Task<IActionResult> SetAllProdAnalysis(JsonElement jsonElement)
         {
             var _azureCosmosClient = _azureCosmos.GetCosmosClient();
             var _azureCosmosClientCsv2 = _azureCosmos.GetCosmosClient(name: "CoreServiceV2");
             var _azureCosmosClientCsv2Read = _azureCosmos.GetCosmosClient(name: "CoreServiceV2CnRead");
             var datetime = DateTimeOffset.UtcNow;
             var y = $"{datetime.Year}";
+            string month = (jsonElement.TryGetProperty("month", out JsonElement _month)) ? $"{_month}" : string.Empty;
+            string day = (jsonElement.TryGetProperty("day", out JsonElement _day)) ? $"{_day}" : string.Empty;
             var redisClinet2 = _azureRedis.GetRedisClient(2);
             var keys = new HashSet<RedisKey>();
             int nextCursor = 0;
             do
             {
-                RedisResult redisResult = redisClinet2.Execute("SCAN", nextCursor.ToString(), "MATCH", "TeachingData:*", "COUNT", "1000");
+                string sql = "TeachingData:*";
+                if (!string.IsNullOrWhiteSpace(month)) {
+                    int _m = 0;
+                    string mString = (Int32.TryParse(month, out _m) && _m > 0 && _m < 10) ? $"0{_m}" : $"{_m}";
+                    sql = $"TeachingData:{mString}*"; //[例]TeachingData:08*
+                    if(!string.IsNullOrWhiteSpace(day))
+                    {
+                        int _d = 0;
+                        string dString = (Int32.TryParse(day, out _d) && _d > 0 && _d < 10) ? $"0{_d}" : $"{_d}";
+                        sql = $"TeachingData:{mString}{dString}"; //[例]TeachingData:0801
+                    }
+                }
+                RedisResult redisResult = redisClinet2.Execute("SCAN", nextCursor.ToString(), "MATCH", $"{sql}", "COUNT", "1000");
                 var innerResult = (RedisResult[])redisResult;
                 nextCursor = int.Parse((string)innerResult[0]);
                 List<RedisKey> resultLines = ((RedisKey[])innerResult[1]).ToList();
@@ -640,9 +652,9 @@ namespace TEAMModelBI.Controllers.RepairApi
                 where += $"ARRAY_CONTAINS({schIdListStr}, c.id, true)";
             }
             qry = $"{qry}{where}";
-            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: qry, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: qry, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -664,9 +676,9 @@ namespace TEAMModelBI.Controllers.RepairApi
                     whereBIRel += $"ARRAY_CONTAINS({schIdListStr}, c.id, true)";
                 }
                 qryBIRel = $"{qryBIRel}{whereBIRel}";
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: qryBIRel, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"BIRel") }))
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIteratorSql(queryText: qryBIRel, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"BIRel") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())

+ 5 - 5
TEAMModelBI/Controllers/RepairApi/TeacherREPController.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Pipelines.Sockets.Unofficial.Arenas;
@@ -41,7 +41,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                 School school = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemAsync<School>($"{item}", new PartitionKey("Base"));
 
                 List<Teacher> teachers = new();
-                await foreach (var tch in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Teacher>(queryText: $"SELECT value(c) FROM c join s in c.schools where s.schoolId='dghznx' and c.code='Base'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                await foreach (var tch in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<Teacher>(queryText: $"SELECT value(c) FROM c join s in c.schools where s.schoolId='dghznx' and c.code='Base'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 {
                     teachers.Add(tch);
                 }
@@ -75,7 +75,7 @@ namespace TEAMModelBI.Controllers.RepairApi
                 tchSql.Append($" where c.id='{tmdId}'");
 
             List<Teacher> tchs = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Teacher>(queryText: tchSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<Teacher>(queryText: tchSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 tchs.Add(item);
             }
@@ -90,9 +90,9 @@ namespace TEAMModelBI.Controllers.RepairApi
                     foreach (var teacher in tch.schools)
                     {
                         var resSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{teacher.schoolId}", new PartitionKey("Base"));
-                        if (resSc.Status == 200)
+                        if (resSc.StatusCode == System.Net.HttpStatusCode.OK)
                         {
-                            using var areaBase = await JsonDocument.ParseAsync(resSc.ContentStream);
+                            using var areaBase = await JsonDocument.ParseAsync(resSc.Content);
                             School school = areaBase.ToObject<School>();
                             if (teacher.areaId != school.areaId)
                                 teacher.areaId = school.areaId;

+ 2 - 5
TEAMModelBI/Filter/RequestAuditFilter.cs

@@ -11,14 +11,11 @@ using System.Linq;
 using Azure.Core;
 using TEAMModelOS.SDK.DI;
 using Microsoft.Extensions.Primitives;
-using HTEXLib.Helpers.ShapeHelpers;
 using System.Net.Http;
-using System.ServiceModel.Channels;
 using System.Net;
 using System.Net.Http.Json;
 using Microsoft.Extensions.Options;
 using TEAMModelOS.Models;
-using OpenXmlPowerTools;
 
 namespace TEAMModelOS.Filter
 {
@@ -197,14 +194,14 @@ namespace TEAMModelOS.Filter
                 var httpclient = _httpClient.CreateClient();
                 httpclient.Timeout=  TimeSpan.FromSeconds(10);
 #if DEBUG
-                var response = await httpclient.PostAsJsonAsync("http://cdhabook.teammodel.cn:8805/api/http-log", data);
+                var response = await httpclient.PostAsJsonAsync("http://52.130.252.100:8806/api/http-log", data);
                 //if (response.StatusCode==HttpStatusCode.OK) 
                 //{
                 //    string result =   await response.Content.ReadAsStringAsync();
 
                 //}
 #else
-            _=  httpclient.PostAsJsonAsync("http://cdhabook.teammodel.cn:8805/api/http-log",data);
+            _=  httpclient.PostAsJsonAsync("http://52.130.252.100:8806/api/http-log",data);
 #endif
                 //   _ = _httpTrigger.RequestHttpTrigger(data, "China", "http-log");
             }

+ 23 - 0
TEAMModelBI/Models/AssistSchool.cs

@@ -131,6 +131,29 @@ namespace TEAMModelBI.Models
     {
         public string areaId { get; set; }
     }
+    //CoreService學校基本資料
+    public class CsSchoolBase
+    {
+        public string id { get; set; }
+        public string code { get; set; } //學校教育部代碼
+        public string name { get; set; }
+        public string countryId { get; set; }
+        public string countryName { get; set; }
+        public string provinceId { get; set; }
+        public string provinceName { get; set; }
+        public string cityId { get; set; }
+        public string cityName { get; set; }
+        public string distId { get; set; }
+        public string distName { get; set; }
+        public string address { get; set; }
+        public string source { get; set; }
+        public string shortCode { get; set; } //學校簡碼
+        public string lang { get; set; }
+        public string unitType { get; set; }
+        public string tel { get; set; }
+        public string type { get; set; }
+    }
+
     #region api解析
     /// <summary>
     /// api解析

+ 1 - 2
TEAMModelBI/Models/ItemInfo.cs

@@ -1,5 +1,4 @@
-using DocumentFormat.OpenXml.Office2010.ExcelAc;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using TEAMModelOS.SDK.Models;
 
 namespace TEAMModelBI.Models

+ 41 - 0
TEAMModelBI/Models/Purchase.cs

@@ -0,0 +1,41 @@
+using System.Collections.Generic;
+
+namespace TEAMModelBI.Models
+{
+    /// <summary>
+    /// 統購授權 縣市名額
+    /// </summary>
+    public class PurchaseSeats
+    {
+        public string id { get; set; } //統購縣市名額ID 格式:{countryId}-{provinceId}-{cityId}-{districtId}-{產品代碼}
+        public string countryId { get; set; } //[String]國家代碼
+        public string provinceId { get; set; } //[String]省代碼
+        public string cityId { get; set; } //[String]市代碼
+        public string districtId { get; set; } //[String]區代碼
+        public string geoName { get; set; } //行政區名稱
+        public string prodCode { get; set; } //產品代碼
+        public long startDate { get; set; } //授權起始日期 unixtimestamp
+        public long endDate { get; set; } //授權終止日期 unixtimestamp
+        public int seats { get; set; } //名額數
+        public int number { get; set; } //產品數量、空間數
+        public int used { get; set; } //已領用名額數 (document並無此欄位,各校名額加總累計用)
+        public object aprule { get; set; } //產品擴充項
+        public string dataType { get; set; } //分區鍵:purchase
+    }
+    /// <summary>
+    /// 統購授權 各校名額
+    /// </summary>
+    public class PurchaseSchoolSeats
+    {
+        public string schoolCode { get; set; }
+        public string shortCode { get; set; }
+        public string schoolName { get; set; }
+        public int seats { get; set; }
+        public string id { get; set; } //統購學校名額ID 格式:{countryId}-{provinceId}-{cityId}-{districtId}-{產品代碼}-{學校簡碼}
+        public string purchaseId { get; set; } //統購縣市名額ID 格式:{countryId}-{provinceId}-{cityId}-{districtId}-{產品代碼}
+        public List<string> tmids { get; set; } = new List<string>(); //已申請的TMID
+        public int used { get; set; } //已領用名額數
+        public int ttl { get; set; } = -1;
+        public string dataType { get; set; } //分區鍵:purchaseSchool
+    }
+}

+ 12 - 2
TEAMModelBI/Models/RearEndMiddle.cs

@@ -27,7 +27,17 @@ namespace TEAMModelBI.Models
         public List<string> serial { get; set; }
         public List<string> service { get; set; }
         public List<string> hard { get; set; }
-
-
+        /// <summary>
+        /// 城市
+        /// </summary>
+        public string city { get; set; }
+        /// <summary>
+        /// 区/县/郡
+        /// </summary>
+        public string dist { get; set; }
+        /// <summary>
+        /// 區碼
+        /// </summary>
+        public string areaId { get; set; }     
     }
 }

+ 0 - 1
TEAMModelBI/Startup.cs

@@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.SpaServices;
-using Microsoft.Azure.Cosmos.Table;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;

+ 4 - 4
TEAMModelBI/TEAMModelBI.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
 	<PropertyGroup>
-		<TargetFramework>net6.0</TargetFramework>
+		<TargetFramework>net8.0</TargetFramework>
 		<RootNamespace>TEAMModelBI</RootNamespace>
 	</PropertyGroup>
 
@@ -65,9 +65,9 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>5.2403.20</Version>
-		<AssemblyVersion>5.2403.20.1</AssemblyVersion>
-		<FileVersion>5.2403.20.1</FileVersion>
+		<Version>5.2409.4</Version>
+		<AssemblyVersion>5.2409.4.1</AssemblyVersion>
+		<FileVersion>5.2409.4.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记2022000908</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>

+ 22 - 23
TEAMModelBI/Tool/CommonFind.cs

@@ -1,13 +1,12 @@
-using Azure.Cosmos;
-using DocumentFormat.OpenXml.Spreadsheet;
+using Microsoft.Azure.Cosmos;
 using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Text.Json;
 using System.Threading.Tasks;
 using TEAMModelBI.Models;
+using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Models;
-using TEAMModelOS.SDK.Models.Cosmos.Common;
 
 namespace TEAMModelBI.Tool
 {
@@ -26,9 +25,9 @@ namespace TEAMModelBI.Tool
             try
             {
                 string managerSql = $"SELECT DISTINCT REPLACE(c.code, 'Teacher-', '') AS schoolId, c.id, c.name FROM c WHERE ARRAY_CONTAINS(c.roles, '{roles}', true) AND c.pk = 'Teacher' AND c.status = 'join' AND c.code = 'Teacher-{schoolId}'";
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: managerSql, requestOptions: new QueryRequestOptions() { }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: managerSql, requestOptions: new QueryRequestOptions() { }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         SchoolTeacherRoles str = new()
@@ -59,9 +58,9 @@ namespace TEAMModelBI.Tool
         {
             List<string> schoolIds = new();
             //string schoolSql = $"SELECT DISTINCT REPLACE(c.code,'Teacher-','') AS schoolId,c.code,c.roles,c.id,c.name From c where ARRAY_CONTAINS(c.roles,'assist',true) AND c.status = 'join' AND c.id='{tmdId}'";
-            //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: schoolSql, requestOptions: new QueryRequestOptions() { }))
+            //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: schoolSql, requestOptions: new QueryRequestOptions() { }))
             //{
-            //    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+            //    using var json = await JsonDocument.ParseAsync(item.Content);
             //    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
             //    {
             //        schoolIds.Add(obj.GetProperty("schoolId").GetString());
@@ -73,7 +72,7 @@ namespace TEAMModelBI.Tool
                 schoolSql.Append($" and (array_contains(c.roles,'assist',true) or array_contains(c.roles,'sales',true))");
             else
                 schoolSql.Append($" and array_contains(c.roles,'{roles}',true)");
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: schoolSql.ToString(), requestOptions: new QueryRequestOptions() { }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: schoolSql.ToString(), requestOptions: new QueryRequestOptions() { }))
             {
                 schoolIds.Add(item);
             }
@@ -92,7 +91,7 @@ namespace TEAMModelBI.Tool
         public static async Task<List<string>> GetValueSingle(CosmosClient cosmosClient, string container, string sqlTxt, string code = null)
         {
             List<string> ids = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<string>(queryText: sqlTxt, requestOptions: !string.IsNullOrEmpty(code) ? new QueryRequestOptions() { PartitionKey = new PartitionKey(code) } : new QueryRequestOptions() { })) 
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<string>(queryText: sqlTxt, requestOptions: !string.IsNullOrEmpty(code) ? new QueryRequestOptions() { PartitionKey = new PartitionKey(code) } : new QueryRequestOptions() { })) 
             {
                 ids.Add(item);
             }
@@ -112,9 +111,9 @@ namespace TEAMModelBI.Tool
         public async Task<List<string>> GetStreamSingle(CosmosClient cosmosClient, string container, string sqlTxt, string single = "id", string code = null)
         {
             List<string> ids = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: !string.IsNullOrEmpty(code) ? new QueryRequestOptions() { PartitionKey = new PartitionKey(code) } : new QueryRequestOptions() { }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: !string.IsNullOrEmpty(code) ? new QueryRequestOptions() { PartitionKey = new PartitionKey(code) } : new QueryRequestOptions() { }))
             {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                using var json = await JsonDocument.ParseAsync(item.Content);
                 foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                 {
                     ids.Add(obj.GetProperty(single).GetString());
@@ -134,14 +133,14 @@ namespace TEAMModelBI.Tool
         public static async Task<List<string>> FindScIds(CosmosClient cosmosClient, string sqlTxt, string code)
         {
             List<string> schoolIds = new();
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
             {
                 schoolIds.Add(item);
             }
 
-            //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+            //await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
             //{
-            //    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+            //    using var json = await JsonDocument.ParseAsync(item.Content);
             //    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
             //    {
             //        schoolIds.Add(obj.GetProperty("id").GetString());
@@ -170,14 +169,14 @@ namespace TEAMModelBI.Tool
             foreach (var school in schools) 
             {
                 string sqlTxt = $"select value(c.id) from c where ARRAY_CONTAINS(c.roles,'{rolesName}',true) and c.status = 'join'";
-                await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school}") }))
+                await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school}") }))
                 {
                     teachers.Add(itemTeac);
                 }
                 //string sqlTxt = $"select c.id from c where ARRAY_CONTAINS(c.roles,'{rolesName}',true) and c.status = 'join'";
-                //await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() {PartitionKey =new PartitionKey($"Teacher-{school}") }))
+                //await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() {PartitionKey =new PartitionKey($"Teacher-{school}") }))
                 //{
-                //    using var json = await JsonDocument.ParseAsync(itemTeac.ContentStream);
+                //    using var json = await JsonDocument.ParseAsync(itemTeac.Content);
                 //    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                 //    {
                 //        teachers.Add(obj.GetProperty("id").GetString());
@@ -200,7 +199,7 @@ namespace TEAMModelBI.Tool
             int totals = 0;
             try
             {
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<int>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                 {
                     totals = item;
                 }
@@ -223,7 +222,7 @@ namespace TEAMModelBI.Tool
             int totals = 0;
             foreach (var container in containers)
             {
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<int>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
                 {
                     totals += item;
                 }
@@ -243,7 +242,7 @@ namespace TEAMModelBI.Tool
         public static async Task<double> GetSqlValueDoubleCounnt(CosmosClient cosmosClient, string container, string SqlTxt, string code = null)
         {
             double totals = 0;
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<double>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<double>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
             {
                 totals = item;
             }
@@ -264,7 +263,7 @@ namespace TEAMModelBI.Tool
             double totals = 0;
             foreach (var container in containers)
             {
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<double>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<double>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
                 {
                     totals += item;
                 }
@@ -287,7 +286,7 @@ namespace TEAMModelBI.Tool
             List<T> temps = new();
             foreach (var container in containers)
             {
-                await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<T>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+                await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<T>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
                 {
                     temps.Add(items);
                 }
@@ -307,7 +306,7 @@ namespace TEAMModelBI.Tool
         public static async Task<List<T>> GetObject<T>(CosmosClient cosmosClient, string containers, string sqlTxt, string code = null)
         {
             List<T> temps = new();
-            await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", containers).GetItemQueryIterator<T>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+            await foreach (var items in cosmosClient.GetContainer("TEAMModelOS", containers).GetItemQueryIteratorSql<T>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
             {
                 temps.Add(items);
             }

+ 8 - 7
TEAMModelBI/Tool/CosmosBank/ActivityWay.cs

@@ -1,7 +1,8 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System.Collections.Generic;
 using System.Text.Json;
 using System.Threading.Tasks;
+using TEAMModelOS.SDK.DI;
 
 namespace TEAMModelBI.Tool.CosmosBank
 {
@@ -28,9 +29,9 @@ namespace TEAMModelBI.Tool.CosmosBank
                     {
                         foreach (string sc in scIds)
                         {
-                            await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{sc}") }))
+                            await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{sc}") }))
                             {
-                                using var json = await JsonDocument.ParseAsync(itemTeac.ContentStream);
+                                using var json = await JsonDocument.ParseAsync(itemTeac.Content);
                                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
                                 {
                                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -46,9 +47,9 @@ namespace TEAMModelBI.Tool.CosmosBank
                     {
                         foreach (string sc in scIds)
                         {
-                            await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{sc}") }))
+                            await foreach (var itemTeac in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIteratorSql(queryText: sqlTxt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{sc}") }))
                             {
-                                using var json = await JsonDocument.ParseAsync(itemTeac.ContentStream);
+                                using var json = await JsonDocument.ParseAsync(itemTeac.Content);
                                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
                                 {
                                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
@@ -81,7 +82,7 @@ namespace TEAMModelBI.Tool.CosmosBank
                 foreach (string type in types)
                 {
                     string sqlTxt = $"select value(count(c.id)) from c where c.pk='{type}' {condSql}";
-                    await foreach (var cnt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                    await foreach (var cnt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<int>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                     {
                         total += cnt;
                     }
@@ -110,7 +111,7 @@ namespace TEAMModelBI.Tool.CosmosBank
                     foreach (string type in types)
                     {
                         string sqlTxt = $"select value(count(c.id)) from c where c.pk='{type}' {condSql}";
-                        await foreach (var cnt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                        await foreach (var cnt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<int>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                         {
                             total += cnt;
                         }

+ 5 - 4
TEAMModelBI/Tool/CosmosBank/JointlySingleQuery1.cs

@@ -1,6 +1,7 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System.Collections.Generic;
 using System.Threading.Tasks;
+using TEAMModelOS.SDK.DI;
 
 namespace TEAMModelBI.Tool.CosmosBank
 {
@@ -25,7 +26,7 @@ namespace TEAMModelBI.Tool.CosmosBank
 
             foreach (string conId in containerId) 
             {
-                await foreach (var itemInt in cosmosClient.GetContainer("TEAMModelOS", conId).GetItemQueryIterator<int>(queryText: sql, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                await foreach (var itemInt in cosmosClient.GetContainer("TEAMModelOS", conId).GetItemQueryIteratorSql<int>(queryText: sql, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                 {
                     totals += itemInt;
                 }
@@ -51,7 +52,7 @@ namespace TEAMModelBI.Tool.CosmosBank
                 sql = sqlTxt;
             }
 
-            await foreach (var itemInt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: sql, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+            await foreach (var itemInt in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIteratorSql<int>(queryText: sql, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
             {
                 totals += itemInt;
             }
@@ -71,7 +72,7 @@ namespace TEAMModelBI.Tool.CosmosBank
         {
             List<string> strList = new();
 
-            await foreach (var itemInt in cosmosClient.GetContainer("TEAMModelOS", containerId).GetItemQueryIterator<string>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+            await foreach (var itemInt in cosmosClient.GetContainer("TEAMModelOS", containerId).GetItemQueryIteratorSql<string>(queryText: sqlTxt, requestOptions: string.IsNullOrEmpty($"{code}") ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
             {
                 strList.Add(itemInt);
             }

+ 4 - 3
TEAMModelBI/Tool/CosmosBank/ProductWay.cs

@@ -1,8 +1,9 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System.Collections.Generic;
 using System.Text.Json;
 using System.Threading.Tasks;
 using TEAMModelBI.Models;
+using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Models;
 
 namespace TEAMModelBI.Tool.CosmosBank
@@ -25,9 +26,9 @@ namespace TEAMModelBI.Tool.CosmosBank
             foreach (var sc in scIds) 
             {
                 string sqlTxt = $"select array_length(c.service) as totals from c where c.id='{sc.id}'";
-                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
+                await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIteratorSql(queryText: sqlTxt.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("ProductSum") }))
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
                     {
                         foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())

+ 4 - 3
TEAMModelBI/Tool/CosmosBank/SchoolWay.cs

@@ -1,10 +1,11 @@
-using Azure.Cosmos;
+using Microsoft.Azure.Cosmos;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text.Json;
 using System.Threading.Tasks;
 using TEAMModelBI.Models;
+using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
@@ -25,7 +26,7 @@ namespace TEAMModelBI.Tool.CosmosBank
             List<BaseInfo> advSchools = new();
             foreach (var item in schoolIds)
             {
-                await foreach (var info in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<BaseInfo>(queryText: $"select c.id,c.name,c.picture,c.areaId from c where c.id='{item}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+                await foreach (var info in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<BaseInfo>(queryText: $"select c.id,c.name,c.picture,c.areaId from c where c.id='{item}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
                 {
                     advSchools.Add(info);
                 }
@@ -51,7 +52,7 @@ namespace TEAMModelBI.Tool.CosmosBank
             {
                 BIRelation bIRelation = new();
                 var resBiRel = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(item, new PartitionKey($"BIRel"));
-                if (resBiRel.Status == 200)
+                if (resBiRel.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     JsonDocument jsonD = JsonDocument.Parse(resBiRel.Content);
                     bIRelation = jsonD.RootElement.ToObject<BIRelation>();

+ 11 - 20
TEAMModelBI/Tool/CosmosBank/StatsWay.cs

@@ -1,23 +1,14 @@
-using Azure.Cosmos;
-using DocumentFormat.OpenXml.Bibliography;
-using DocumentFormat.OpenXml.Math;
-using DocumentFormat.OpenXml.Office2010.Excel;
-using Microsoft.OData.Edm;
-using NUnit.Framework.Constraints;
-using OpenXmlPowerTools;
+using Microsoft.Azure.Cosmos;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text.Json;
 using System.Threading.Tasks;
-using TEAMModelBI.Models;
+using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
-using TEAMModelOS.SDK.Models.Cosmos.BI.BITable;
 using TEAMModelOS.SDK.Models.Service.BI;
-using TEAMModelOS.SDK.Models.Service.BIStatsWay;
-using static TEAMModelBI.Tool.CosmosBank.StatsWay;
 
 namespace TEAMModelBI.Tool.CosmosBank
 {
@@ -118,7 +109,7 @@ namespace TEAMModelBI.Tool.CosmosBank
 
             List<LessRelStats> lessRelStats = new();
             string sql = $"select c.id,c.code,c.startTime,c.clientInteractionCount from c where c.pk='LessonRecord' and c.startTime >= {lastYearS} and c.startTime <= {yearE}";
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<LessRelStats>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{id}") })) 
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<LessRelStats>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{id}") })) 
             {
                 lessRelStats.Add(item);
             }
@@ -257,14 +248,14 @@ namespace TEAMModelBI.Tool.CosmosBank
                 {
                     case "Exam":
                         exam = await JointlySingleQuery.GetValueInt(cosmosClient, "Common", currSql, $"Exam-{scId}");
-                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ArtRelStats>(queryText: yearSql, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{scId}")}))
+                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryIteratorSql<ArtRelStats>(queryText: yearSql, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{scId}")}))
                         {
                             examSts.Add(item);
                         }
                         break;
                     case "Survey":
                         survey = await JointlySingleQuery.GetValueInt(cosmosClient, "Common", currSql, $"Survey-{scId}");
-                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ArtRelStats>(queryText: yearSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Survey-{scId}") }))
+                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryIteratorSql<ArtRelStats>(queryText: yearSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Survey-{scId}") }))
                         {
                             surveySts.Add(item);
                         }
@@ -272,14 +263,14 @@ namespace TEAMModelBI.Tool.CosmosBank
                         break;
                     case "Vote":
                         vote = await JointlySingleQuery.GetValueInt(cosmosClient, "Common", currSql, $"Vote-{scId}");
-                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ArtRelStats>(queryText: yearSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Vote-{scId}") }))
+                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryIteratorSql<ArtRelStats>(queryText: yearSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Vote-{scId}") }))
                         {
                             voteSts.Add(item);
                         }
                         break;
                     case "Homework":
                         homework = await JointlySingleQuery.GetValueInt(cosmosClient, "Common", currSql, $"Homework-{scId}");
-                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ArtRelStats>(queryText: yearSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{scId}") }))
+                        await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Common").GetItemQueryIteratorSql<ArtRelStats>(queryText: yearSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{scId}") }))
                         {
                             homeworkSts.Add(item);
                         }
@@ -441,13 +432,13 @@ namespace TEAMModelBI.Tool.CosmosBank
             List<AreaStudy> trains = new();
 
             School school = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemAsync<School>($"{scId}", new PartitionKey("Base"));
-            //cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText:$"select value(c.areaId) from c where c.id='{scId}'", requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")});
+            //cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIteratorSql<string>(queryText:$"select value(c.areaId) from c where c.id='{scId}'", requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")});
 
             AreaSetting setting = null;
             var responSett = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{school.areaId}", new PartitionKey("AreaSetting"));
-            if (responSett.Status == 200)
+            if (responSett.StatusCode == System.Net.HttpStatusCode.OK)
             {
-                using var fileJson = await JsonDocument.ParseAsync(responSett.ContentStream);
+                using var fileJson = await JsonDocument.ParseAsync(responSett.Content);
                 setting = fileJson.ToObject<AreaSetting>();
             }
             if (setting == null)
@@ -463,7 +454,7 @@ namespace TEAMModelBI.Tool.CosmosBank
                 };
             }
 
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<AreaStudy>(queryText: $"select c.id,c.code,c.totalTime,c.onlineTime,c.offlineTime,c.classTime,c.currency from c where c.pk='TeacherTrain' and c.school='{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TeacherTrain-{scId}") }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIteratorSql<AreaStudy>(queryText: $"select c.id,c.code,c.totalTime,c.onlineTime,c.offlineTime,c.classTime,c.currency from c where c.pk='TeacherTrain' and c.school='{scId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TeacherTrain-{scId}") }))
             {
                 trains.Add(item);
             }

+ 4 - 2
TEAMModelBI/Tool/Extension/JwtAuth.cs

@@ -50,7 +50,8 @@ namespace TEAMModelBI.Models.Extension
             var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(salt));
             // HmacSha256 有要求必须要大于 128 bits,所以 salt 不能太短,至少要 16 字元以上
             // https://stackoverflow.com/questions/47279947/idx10603-the-algorithm-hs256-requires-the-securitykey-keysize-to-be-greater
-            var signingCredentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256Signature);
+            //var signingCredentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256Signature);
+            var signingCredentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);
             var header = new JwtHeader(signingCredentials);
             var secToken = new JwtSecurityToken(header, payload);
             // 產出所需要的 JWT securityToken 物件,並取得序列化後的 Token 結果(字串格式)
@@ -93,7 +94,8 @@ namespace TEAMModelBI.Models.Extension
             var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(salt));
             // HmacSha256 有要求必须要大于 128 bits,所以 salt 不能太短,至少要 16 字元以上
             // https://stackoverflow.com/questions/47279947/idx10603-the-algorithm-hs256-requires-the-securitykey-keysize-to-be-greater
-            var signingCredentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256Signature);
+            //var signingCredentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256Signature);
+            var signingCredentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);
             var header = new JwtHeader(signingCredentials);
             var secToken = new JwtSecurityToken(header, payload);
             // 产出所需要的 JWT securityToken 物件,并取得序列化后的 Token 结果(字串格式)

+ 1 - 2
TEAMModelBI/Tool/TimeHelper1.cs

@@ -1,5 +1,4 @@
-using DocumentFormat.OpenXml.Bibliography;
-using System;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;

+ 11 - 0
TEAMModelOS.Extension/Contest.Client/.eslintrc.cjs

@@ -0,0 +1,11 @@
+/* eslint-env node */
+module.exports = {
+  root: true,
+  'extends': [
+    'plugin:vue/vue3-essential',
+    'eslint:recommended'
+  ],
+  parserOptions: {
+    ecmaVersion: 'latest'
+  }
+}

+ 30 - 0
TEAMModelOS.Extension/Contest.Client/.gitignore

@@ -0,0 +1,30 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+.DS_Store
+dist
+dist-ssr
+coverage
+*.local
+
+/cypress/videos/
+/cypress/screenshots/
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
+*.tsbuildinfo

+ 11 - 0
TEAMModelOS.Extension/Contest.Client/Contest.Client.esproj

@@ -0,0 +1,11 @@
+<Project Sdk="Microsoft.VisualStudio.JavaScript.Sdk/0.5.128-alpha">
+  <PropertyGroup>
+    <StartupCommand>npm run dev</StartupCommand>
+    <JavaScriptTestRoot>.\</JavaScriptTestRoot>
+    <JavaScriptTestFramework>Jest</JavaScriptTestFramework>
+    <!-- Allows the build (or compile) script located on package.json to run on Build -->
+    <ShouldRunBuildScript>false</ShouldRunBuildScript>
+    <!-- Folder where production build objects will be placed -->
+    <PublishAssetsDirectory>$(MSBuildProjectDirectory)\dist</PublishAssetsDirectory>
+  </PropertyGroup>
+</Project>

+ 35 - 0
TEAMModelOS.Extension/Contest.Client/README.md

@@ -0,0 +1,35 @@
+# contest.client
+
+This template should help get you started developing with Vue 3 in Vite.
+
+## Recommended IDE Setup
+
+[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
+
+## Customize configuration
+
+See [Vite Configuration Reference](https://vitejs.dev/config/).
+
+## Project Setup
+
+```sh
+npm install
+```
+
+### Compile and Hot-Reload for Development
+
+```sh
+npm run dev
+```
+
+### Compile and Minify for Production
+
+```sh
+npm run build
+```
+
+### Lint with [ESLint](https://eslint.org/)
+
+```sh
+npm run lint
+```

+ 5 - 0
TEAMModelOS.Extension/Contest.Client/babel.config.js

@@ -0,0 +1,5 @@
+module.exports = {
+  presets: [
+    '@vue/cli-plugin-babel/preset'
+  ]
+}

+ 13 - 0
TEAMModelOS.Extension/Contest.Client/index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8">
+    <link rel="icon" href="/favicon.ico">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Vite App</title>
+  </head>
+  <body>
+    <div id="app"></div>
+    <script type="module" src="/src/main.js"></script>
+  </body>
+</html>

+ 8 - 0
TEAMModelOS.Extension/Contest.Client/jsconfig.json

@@ -0,0 +1,8 @@
+{
+  "compilerOptions": {
+    "paths": {
+      "@/*": ["./src/*"]
+    }
+  },
+  "exclude": ["node_modules", "dist"]
+}

+ 10 - 0
TEAMModelOS.Extension/Contest.Client/nuget.config

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <packageSources>
+    <clear />
+    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
+  </packageSources>
+  <disabledPackageSources>
+    <clear />
+  </disabledPackageSources>
+</configuration>

+ 56 - 0
TEAMModelOS.Extension/Contest.Client/package.json

@@ -0,0 +1,56 @@
+{
+  "name": "activity",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
+    "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
+    "lint": "vue-cli-service lint"
+  },
+  "dependencies": {
+    "@azure/storage-blob": "^12.17.0",
+    "@element-plus/icons-vue": "^2.1.0",
+    "axios": "^1.5.1",
+    "core-js": "^3.6.5",
+    "element-plus": "^2.3.9",
+    "jwt-decode": "^3.1.2",
+    "less": "^4.2.0",
+    "less-loader": "^7.3.0",
+    "pinia": "^2.1.7",
+    "spark-md5": "^3.0.2",
+    "vue": "^3.0.0",
+    "vue-i18n": "next",
+    "vue-router": "^4.2.4",
+    "vuex": "^4.1.0"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "~4.5.13",
+    "@vue/cli-plugin-eslint": "~4.5.13",
+    "@vue/cli-service": "~4.5.13",
+    "@vue/compiler-sfc": "^3.0.0",
+    "babel-eslint": "^10.1.0",
+    "eslint": "^6.7.2",
+    "eslint-plugin-vue": "^7.0.0"
+  },
+  "eslintConfig": {
+    "root": true,
+    "env": {
+      "node": true
+    },
+    "extends": [
+      "plugin:vue/vue3-essential",
+      "eslint:recommended"
+    ],
+    "parserOptions": {
+      "parser": "babel-eslint"
+    },
+    "rules": {
+      "no-unused-vars": "off"
+    }
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not dead"
+  ]
+}

BIN
TEAMModelOS.Extension/Contest.Client/public/favicon.ico


+ 22 - 0
TEAMModelOS.Extension/Contest.Client/public/index.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="">
+    <head>
+        <meta charset="utf-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge">
+        <meta name="viewport" content="width=device-width,initial-scale=1.0">
+        <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+        <link id="theme" type="text/css" rel="stylesheet" href="<%= BASE_URL %>reset.css" />
+        <title>赛课系统</title>
+    </head>
+    <body>
+        <noscript>
+            <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
+        </noscript>
+        <div id="app"></div>
+        <!-- built files will be auto injected -->
+    </body>
+    <script>
+        let blobHost = "https://teammodelos.blob.core.chinacloudapi.cn"
+        document.write('<script id="mediaInfo"  src="' + blobHost + '/0-public/js/checkMedia.js"><\/script>')
+    </script>
+</html>

+ 48 - 0
TEAMModelOS.Extension/Contest.Client/public/reset.css

@@ -0,0 +1,48 @@
+/* http://meyerweb.com/eric/tools/css/reset/ 
+   v2.0 | 20110126
+   License: none (public domain)
+*/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed, 
+figure, figcaption, footer, header, hgroup, 
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+	margin: 0;
+	padding: 0;
+	border: 0;
+	/*font-size: 100%;*/
+	/*font: inherit;*/
+	vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure, 
+footer, header, hgroup, menu, nav, section {
+	display: block;
+}
+body {
+	line-height: 1;
+}
+ol, ul {
+	list-style: none;
+}
+blockquote, q {
+	quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+	content: '';
+	content: none;
+}
+table {
+	border-collapse: collapse;
+	border-spacing: 0;
+}

+ 27 - 0
TEAMModelOS.Extension/Contest.Client/src/App.vue

@@ -0,0 +1,27 @@
+<template>
+    <Suspense>
+        <router-view></router-view>
+    </Suspense>
+</template>
+
+<script>
+
+export default {
+    name: "App",
+}
+</script>
+
+<style>
+html,
+body,
+#app {
+    height: 100%;
+    margin: 0;
+}
+.el-button:focus {
+    outline: none;
+}
+.el-empty {
+    margin: auto;
+}
+</style>

+ 296 - 0
TEAMModelOS.Extension/Contest.Client/src/api/http.js

@@ -0,0 +1,296 @@
+import axios from 'axios';
+import {ElLoading, ElMessage} from 'element-plus'
+import { useRouter } from "vue-router"
+import config from '@/store/module/config'
+import { reactive } from 'vue';
+
+// 不需携带access_token
+const NO_ACCESS_API = [
+    '/activity/get-website',
+    '/activity/login-portal',
+    '/activity/list-portal',
+]
+// 需要携带access_token 不需要auth-token
+const NO_AUTH_API = []
+// 不进行错误提示白名单
+const NO_WARNING = []
+
+const router = useRouter()
+
+// token刷新中,挂载的请求
+let requestStack = []
+// 记录token刷新中发起的请求
+function track(prms) {
+    requestStack.push(prms)
+}
+// token刷新完成触发挂起的请求继续请求
+function trigger() {
+    let index = requestStack.length
+    while(index > 0) {
+        requestStack[index - 1]()
+        requestStack.pop()
+        index--
+    }
+}
+
+let refreshing = false //是否刷新token中
+axios.defaults.timeout = 30000 //设置超时时长
+axios.defaults.baseURL = ''
+
+let loading = reactive({
+    lock: true,
+    text: '加载中',
+    background: 'rgba(0, 0, 0, 0.7)'
+})
+
+// http request 拦截器
+axios.interceptors.request.use(config => {
+    loading = ElLoading.service({
+        lock: true,
+        text: '加载中',
+        background: 'rgba(0, 0, 0, 0.7)'
+    })
+    let isNeedAccess = true
+    // 1. 登录及登录前,不检查API是否需要accesstoken
+    for (let apiUrl of NO_ACCESS_API) {
+        if(config.url.includes(apiUrl)) {
+            isNeedAccess = false
+            break
+        }
+    }
+    if(!isNeedAccess) return config
+
+    // 2. 登录后,
+    // 检查操作时间
+    let webEndTime = localStorage.getItem('webEndTime')
+    let time_now = new Date().getTime()
+    if(webEndTime && time_now > webEndTime) {
+        loginOut()
+        sessionStorage.setItem('loginOut', '长时间未操作,重新登录')
+        return
+    }
+    // 检查是否有access_token
+    let access_token = localStorage.getItem('access_token')
+    if(!access_token) {
+        loginOut()
+        sessionStorage.setItem('loginOut', 'token无效')
+        return
+    }
+    // 检查是否快到期
+    let isExpired = checkToken()
+    // token未过期
+    if(!isExpired) {
+        return handleHeader(config)
+    }
+    // 刷新token
+    let handleRefresh = new Promise((resolve, reject) => {
+        track(() => {
+            handleHeader(config)
+            resolve(config)
+        })
+    })
+    sessionStorage.setItem('apiCount', requestStack.length)
+    if(!refreshing) {
+        refreshing = true
+        refreshToken()
+    }
+    return handleRefresh
+}, error => {
+    return Promise.reject(error)
+})
+
+// http response 拦截器
+axios.interceptors.response.use(response => {
+    if(response.data.errCode === 2) {
+        /* router.push({
+            path: '/login',
+            query: {
+                redirect: router.currentRoute.fullPath
+            }
+        }) */
+        console.log('errCode');
+    }
+    // 保存最新的服务端时间
+    if(response.headers.date) {
+        localStorage.setItem('serverTime', new Date(response.headers.date).getTime())
+    }
+    // 四小时没操作过则需重新登录
+    let endTime = (new Date().getTime() + (4 * 60 * 60 * 1000))
+    localStorage.setItem('webEndTime', endTime)
+    setTimeout(() => {
+        loading.close()
+    }, 1500)
+    return response
+}, error => {
+    console.log('vbfbbtfnt', error);
+    if(!error.response) {
+        if(!NO_WARNING.includes(error.config.url)) {
+            ElMessage({
+                type: 'error',
+                message: 'http.error'
+            })
+        }
+    } else if(error.response && error.response.status === 401) {
+        localStorage.clear()
+        sessionStorage.setItem('loginOut', error.config.url + ':API401,重新登录')
+        sessionStorage.setItem('APIInfo', JSON.stringify(error))
+        console.log('loginOut', error.config.url + ':API401,重新登录');
+        window.location.href = '/home/homePage'
+        ElMessage({
+            type: 'error',
+            message: 'http.error401'
+        })
+    } else if(error.response.status === 500) {
+        ElMessage({
+            type: 'error',
+            message: 'http.error500'
+        })
+    } else if(error.response.status === 404) {
+        ElMessage({
+            type: 'error',
+            message: 'http.error404'
+        })
+    } else if(error.response.status === 501) {
+        ElMessage({
+            type: 'error',
+            message: 'http.error501'
+        })
+    } else {
+        ElMessage({
+            type: 'error',
+            message: 'http.error400'
+        })
+    }
+    loading.close()
+    return Promise.reject(error)
+})
+
+function handleHeader(config) {
+    config.headers['Authorization'] = 'Bearer ' + localStorage.getItem('access_token')
+    config.headers['Content-Type'] = 'application/json'
+    config.headers['lang'] = localStorage.getItem('local') || navigator.language.toLowerCase()
+
+    let isNeedAuth = true
+    for (let apiUrl of NO_AUTH_API) {
+        if(config.url.includes(apiUrl)) {
+            console.log('auth-token无效', config)
+            isNeedAuth = false
+            break
+        }
+    }
+    if(!isNeedAuth) return config
+
+    // 检查auth-token是否存在
+    let identity = sessionStorage.getItem('identity')
+    // 正式使用要调整为个人和专家
+    let auth_token = identity === 'student' ? localStorage.getItem('stu_auth_token') : localStorage.getItem('auth_token')
+    if(!auth_token) {
+        console.log('auth_token失败', config)
+        loginOut()
+        sessionStorage.setItem('loginOut', 'localStorage没有auth_token:auth_token失败,重新登录')
+        return
+    }
+    // 通过验证,设置对应参数
+    config.headers['X-Auth-AuthToken'] = auth_token
+    return config
+}
+
+// 检查token是否快过期
+function checkToken() {
+    if(!localStorage.getItem('expires_in')) return false
+
+    var nowTime = new Date()
+    var offset = nowTime.getTimezoneOffset() / 60
+    let cT = Date.parse(nowTime)
+    let eT = Date.parse(localStorage.getItem('expires_in'))
+    let oT = 0
+    let btw = eT - oT - cT
+    if(btw > 10 * 60 * 1000) {
+        return false
+    } else {
+        return true
+    }
+}
+
+// 刷新token
+function refreshToken() {
+    refreshing = true
+    let areaRoute = window.location.pathname.split('/')
+    axios.post('/activity/login-portal', {
+        "route": areaRoute[1],
+        "token": localStorage.getItem('auth_token')
+    }).then(res => {
+        if(res.data.code === 200) {
+            localStorage.setItem("auth_token", res.data.token)
+            localStorage.setItem("access_token", res.data.auth_token.access_token)
+            localStorage.setItem("expires_in", res.data.auth_token.expires_in)
+            // token刷新完成,触发挂载的API
+            trigger()
+            refreshing = false
+        } else {
+            refreshing = false
+            requestStack = []
+            loginOut()
+            sessionStorage.setItem('loginOut', 'Token验证失败')
+        }
+    },err => {
+        refreshing = false
+        requestStack = []
+        loginOut()
+        sessionStorage.setItem('loginOut', 'token刷新失败,退出重新登录')
+    })
+}
+
+// 超时退出重新登录
+function loginOut() {
+    localStorage.clear()
+    console.log('超时退出');
+    // router.push({path: '/home/homePage'})
+    window.location.href = window.location.origin + '/home/homePage'
+}
+
+/**
+ * 封装get方法
+ * @param url
+ * @param data
+ * @returns {Promise}
+ */
+export function fetch(url, params) {
+    let data = {}
+    data.method = url
+    data.params = params
+    data.lang = localStorage.getItem('local')
+    return new Promise((resolve, reject) => {
+        axios.get(url, data).then(response => {
+            resolve(response.data)
+            ElMessage({
+                type: 'success',
+                message: '数据访问成功!'
+            })
+        }).catch(err => {
+            reject(err)
+        })
+    })
+}
+
+/**
+ * 封装post请求
+ * @param url
+ * @param data
+ * @returns {Promise}
+ */
+export function post(url, params) {
+    let data = {}
+    data.method = url
+    data.params = params
+    data.lang = localStorage.getItem('local')
+    return new Promise((resolve, reject) => {
+        axios.post(url, params).then(response => {
+            if(response) {
+                resolve(response.data)
+            }
+        }, err => {
+            reject(err)
+        })
+    })
+}

+ 39 - 0
TEAMModelOS.Extension/Contest.Client/src/api/index.js

@@ -0,0 +1,39 @@
+import { post } from '@/api/http'
+
+export default {
+    loginPortal(data) {
+        return post('/activity/login-portal', data)
+    },
+    getWebsite(data) {
+        return post('/activity/get-website', data)
+    },
+    getActivityList(data) {
+        return post('/activity/list-portal', data)
+    },
+    teaContest(data) {
+        return post('/activity/teacher-contest', data)
+    },
+    actManage(data) {
+        return post('/activity/manage', data)
+    },
+    getActInfo(data) {
+        return post('/activity/read-activity', data)
+    },
+    getInfoInWeb(data) {
+        return post('/activity/get-activity-website', data)
+    },
+    getTaskList(data) {
+        return post('/activity/expert-contest', data)
+    },
+
+
+
+    //获取blob容器读写创建
+    blobSasRCW(data) {
+        return post('/blob/sas-rcwld', data)
+    },
+    // 删除blob指定目录下的所有文件
+    deletePrefix(data) {
+        return post('/blob/delete-prefix', data)
+    },
+}

BIN
TEAMModelOS.Extension/Contest.Client/src/assets/img/events.jpg


BIN
TEAMModelOS.Extension/Contest.Client/src/assets/img/fengj.jpg


+ 0 - 0
TEAMModelOS.Extension/Contest.Client/src/assets/img/fengjing.jpg


Неке датотеке нису приказане због велике количине промена