CrazyIter_Bin преди 3 години
родител
ревизия
548a407eac

+ 10 - 5
TEAMModelOS.FunctionV4/HttpTrigger/IESHttpTrigger.cs

@@ -464,12 +464,17 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                         }
                         await table.SaveOrUpdateAll(DayLoginSchools);//保存学校当月在线数据
                     }
+                    string tbScHourSql = "";
+                    string tbScDaySql = "";
+                    try {
 
-                    string tbScHourSql = $"PartitionKey eq 'HourLogin-{school}' and RowKey le '{delTbHour}'";
-                    await table.DeleteStringWhere<HourLogin>(rowKey: tbScHourSql); //删除学校168小时前的数据
-
-                    string tbScDaySql = $"PartitionKey eq 'DayLogin-{school}' and RowKey le '{delTbDay}'";
-                    await table.DeleteStringWhere<DayLogin>(rowKey: tbScDaySql); //删除学校180天前的数据
+                          tbScHourSql = $"PartitionKey eq 'HourLogin-{school}' and RowKey le '{delTbHour}'";
+                          tbScDaySql = $"PartitionKey eq 'DayLogin-{school}' and RowKey le '{delTbDay}'";
+                        await table.DeleteStringWhere<HourLogin>(rowKey: tbScHourSql); //删除学校168小时前的数据
+                        await table.DeleteStringWhere<DayLogin>(rowKey: tbScDaySql); //删除学校180天前的数据
+                    } catch (Exception ex) {
+                        await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-online-record 人数记录异常{ex.Message}\n{ex.StackTrace}\ntbScHourSql:{tbScHourSql}\ntbScDaySql:{tbScDaySql}", GroupNames.成都开发測試群組);
+                    }
                 }
 
                 await response.WriteAsJsonAsync(new { data = json });

+ 157 - 157
TEAMModelOS.SDK/Context/Constant/ContentTypeDict.cs

@@ -10,163 +10,163 @@ namespace TEAMModelOS.SDK
             //{ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".xlsx"},
             { "audio/x-ms-wma",".wma"},
             {"video/3gpp",".3g2"},
-{"audio/mp4",".aac"},
-{"audio/ac3",".ac3"},
-{"text/x-adasrc",".adb"},
-{"image/x-applix-graphics",".ag"},
-{"audio/amr",".amr"},
-{"audio/x-ape",".ape"},
-{"image/x-sony-arw",".arw"},
-{"text/plain",".asc"},
-{"video/x-ms-asf",".asf"},
-{"text/x-ssa",".ass"},
-{"video/x-msvideo",".avi"},
-{"text/x-bibtex",".bib"},
-{"image/bmp",".bmp"},
-{"text/x-csrc",".c"},
-{"text/x-c++src",".c++"},
-{"image/cgm",".cgm"},
-{"text/x-tex",".cls"},
-{"text/x-cmake",".cmake"},
-{"image/x-canon-cr2",".cr2"},
-{"image/x-canon-crw",".crw"},
-{"text/x-csharp",".cs"},
-{"text/css",".css"},
-{"text/csv",".csv"},
-{"image/x-win-bitmap",".cur"},
-{"text/x-dsrc",".d"},
-{"text/x-dcl",".dcl"},
-{"image/x-kodak-dcr",".dcr"},
-{"image/x-dds",".dds"},
-{"text/x-patch",".diff"},
-{"image/vnd.djvu",".djv"},
-{"image/x-adobe-dng",".dng"},
-{"text/vnd.graphviz",".dot"},
-{"text/x-dsl",".dsl"},
-{"image/vnd.dwg",".dwg"},
-{"image/vnd.dxf",".dxf"},
-{"text/x-eiffel",".e"},
-{"text/x-emacs-lisp",".el"},
-{"image/x-emf",".emf"},
-{"image/x-eps",".eps"},
-{"image/x-bzeps",".eps.bz2"},
-{"image/x-gzeps",".eps.gz"},
-{"text/x-erlang",".erl"},
-{"text/x-setext",".etx"},
-{"image/x-exr",".exr"},
-{"text/x-fortran",".f"},
-{"image/x-xfig",".fig"},
-{"image/fits",".fits"},
-{"video/x-flv",".flv"},
-{"text/x-xslfo",".fo"},
-{"image/fax-g3",".g3"},
-{"text/directory",".gcrd"},
-{"image/gif",".gif"},
-{"text/x-google-video-pointer",".gvp"},
-{"text/x-chdr",".h"},
-{"text/x-c++hdr",".h++"},
-{"text/x-haskell",".hs"},
-{"text/html",".htm"},
-{"image/x-tga",".icb"},
-{"image/x-icns",".icns"},
-{"image/x-icon",".ico"},
-{"text/calendar",".ics"},
-{"text/x-idl",".idl"},
-{"image/ief",".ief"},
-{"image/x-iff",".iff"},
-{"image/x-ilbm",".ilbm"},
-{"text/x-imelody",".ime"},
-{"text/x-iptables",".iptables"},
-{"image/jp2",".j2k"},
-{"text/vnd.sun.j2me.app-descriptor",".jad"},
-{"text/x-java",".java"},
-{"image/x-jng",".jng"},
-{"image/jpeg",".jpeg"},
-{"application/javascript",".js"},
-{"application/json",".json"},
-{"application/jsonp",".jsonp"},
-{"image/x-kodak-k25",".k25"},
-{"image/x-kodak-kdc",".kdc"},
-{"text/x-ldif",".ldif"},
-{"text/x-literate-haskell",".lhs"},
-{"text/x-log",".log"},
-{"text/x-lua",".lua"},
-{"image/x-lwo",".lwo"},
-{"image/x-lws",".lws"},
-{"text/x-lilypond",".ly"},
-{"text/x-matlab",".m"},
-{"video/mpeg",".m2t"},
-{"audio/x-mpegurl",".m3u"},
-{"application/vnd.apple.mpegurl",".m3u8"},
-{"text/x-troff-me",".me"},
-{"video/x-matroska",".mkv"},
-{"text/x-ocaml",".ml"},
-{"text/x-troff-mm",".mm"},
-{"text/mathml",".mml"},
-{"text/x-moc",".moc"},
-{"text/x-mof",".mof"},
-{"audio/mpeg",".mp3"},
-{"video/mp4",".mp4"},
-{"text/x-mrml",".mrl"},
-{"image/x-minolta-mrw",".mrw"},
-{"text/x-troff-ms",".ms"},
-{"image/x-msod",".msod"},
-{"text/x-mup",".mup"},
-{"image/x-nikon-nef",".nef"},
-{"text/x-nfo",".nfo"},
-{"text/x-ocl",".ocl"},
-{"text/x-opml+xml",".opml"},
-{"image/openraster",".ora"},
-{"image/x-olympus-orf",".orf"},
-{"text/x-pascal",".p"},
-{"image/x-portable-bitmap",".pbm"},
-{"image/x-photo-cd",".pcd"},
-{"image/x-pcx",".pcx"},
-{"application/pdf",".pdf"},
-{"image/x-pentax-pef",".pef"},
-{"image/x-portable-graymap",".pgm"},
-{"image/x-pict",".pict"},
-{"image/png",".png"},
-{"image/x-portable-anymap",".pnm"},
-{"image/x-macpaint",".pntg"},
-{"text/x-gettext-translation",".po"},
-{"text/x-gettext-translation-template",".pot"},
-{"text/x-python",".py"},
-{"image/x-quicktime",".qif"},
-{"image/x-fuji-raf",".raf"},
-{"image/x-cmu-raster",".ras"},
-{"image/x-panasonic-raw",".raw"},
-{"text/x-ms-regedit",".reg"},
-{"image/x-rgb",".rgb"},
-{"image/rle",".rle"},
-{"text/troff",".roff"},
-{"image/vnd.rn-realpix",".rp"},
-{"text/vnd.rn-realtext",".rt"},
-{"text/richtext",".rtx"},
-{"text/x-scheme",".scm"},
-{"image/x-sgi",".sgi"},
-{"text/sgml",".sgm"},
-{"image/x-skencil",".sk"},
-{"text/spreadsheet",".slk"},
-{"text/x-rpm-spec",".spec"},
-{"text/x-sql",".sql"},
-{"image/x-sony-sr2",".sr2"},
-{"image/x-sony-srf",".srf"},
-{"text/x-subviewer",".sub"},
-{"image/x-sun-raster",".sun"},
-{"image/svg+xml",".svg"},
-{"image/svg+xml-compressed",".svgz"},
-{"text/x-txt2tags",".t2t"},
-{"text/x-tcl",".tcl"},
-{"text/x-texinfo",".texi"},
-{"image/tiff",".tif"},
-{"audio/x-voc",".voc"},
-{"image/x-wmf",".wmf"},
-{"text/vnd.wap.wml",".wml"},
-{"text/vnd.wap.wmlscript",".wmls"},
-{"video/x-ms-wmv",".wmv"},
-{"application/xhtml+xml",".xhtml"},
-{"application/xml",".xml"}
+            {"audio/mp4",".aac"},
+            {"audio/ac3",".ac3"},
+            {"text/x-adasrc",".adb"},
+            {"image/x-applix-graphics",".ag"},
+            {"audio/amr",".amr"},
+            {"audio/x-ape",".ape"},
+            {"image/x-sony-arw",".arw"},
+            {"text/plain",".asc"},
+            {"video/x-ms-asf",".asf"},
+            {"text/x-ssa",".ass"},
+            {"video/x-msvideo",".avi"},
+            {"text/x-bibtex",".bib"},
+            {"image/bmp",".bmp"},
+            {"text/x-csrc",".c"},
+            {"text/x-c++src",".c++"},
+            {"image/cgm",".cgm"},
+            {"text/x-tex",".cls"},
+            {"text/x-cmake",".cmake"},
+            {"image/x-canon-cr2",".cr2"},
+            {"image/x-canon-crw",".crw"},
+            {"text/x-csharp",".cs"},
+            {"text/css",".css"},
+            {"text/csv",".csv"},
+            {"image/x-win-bitmap",".cur"},
+            {"text/x-dsrc",".d"},
+            {"text/x-dcl",".dcl"},
+            {"image/x-kodak-dcr",".dcr"},
+            {"image/x-dds",".dds"},
+            {"text/x-patch",".diff"},
+            {"image/vnd.djvu",".djv"},
+            {"image/x-adobe-dng",".dng"},
+            {"text/vnd.graphviz",".dot"},
+            {"text/x-dsl",".dsl"},
+            {"image/vnd.dwg",".dwg"},
+            {"image/vnd.dxf",".dxf"},
+            {"text/x-eiffel",".e"},
+            {"text/x-emacs-lisp",".el"},
+            {"image/x-emf",".emf"},
+            {"image/x-eps",".eps"},
+            {"image/x-bzeps",".eps.bz2"},
+            {"image/x-gzeps",".eps.gz"},
+            {"text/x-erlang",".erl"},
+            {"text/x-setext",".etx"},
+            {"image/x-exr",".exr"},
+            {"text/x-fortran",".f"},
+            {"image/x-xfig",".fig"},
+            {"image/fits",".fits"},
+            {"video/x-flv",".flv"},
+            {"text/x-xslfo",".fo"},
+            {"image/fax-g3",".g3"},
+            {"text/directory",".gcrd"},
+            {"image/gif",".gif"},
+            {"text/x-google-video-pointer",".gvp"},
+            {"text/x-chdr",".h"},
+            {"text/x-c++hdr",".h++"},
+            {"text/x-haskell",".hs"},
+            {"text/html",".htm"},
+            {"image/x-tga",".icb"},
+            {"image/x-icns",".icns"},
+            {"image/x-icon",".ico"},
+            {"text/calendar",".ics"},
+            {"text/x-idl",".idl"},
+            {"image/ief",".ief"},
+            {"image/x-iff",".iff"},
+            {"image/x-ilbm",".ilbm"},
+            {"text/x-imelody",".ime"},
+            {"text/x-iptables",".iptables"},
+            {"image/jp2",".j2k"},
+            {"text/vnd.sun.j2me.app-descriptor",".jad"},
+            {"text/x-java",".java"},
+            {"image/x-jng",".jng"},
+            {"image/jpeg",".jpeg"},
+            {"application/javascript",".js"},
+            {"application/json",".json"},
+            {"application/jsonp",".jsonp"},
+            {"image/x-kodak-k25",".k25"},
+            {"image/x-kodak-kdc",".kdc"},
+            {"text/x-ldif",".ldif"},
+            {"text/x-literate-haskell",".lhs"},
+            {"text/x-log",".log"},
+            {"text/x-lua",".lua"},
+            {"image/x-lwo",".lwo"},
+            {"image/x-lws",".lws"},
+            {"text/x-lilypond",".ly"},
+            {"text/x-matlab",".m"},
+            {"video/mpeg",".m2t"},
+            {"audio/x-mpegurl",".m3u"},
+            {"application/vnd.apple.mpegurl",".m3u8"},
+            {"text/x-troff-me",".me"},
+            {"video/x-matroska",".mkv"},
+            {"text/x-ocaml",".ml"},
+            {"text/x-troff-mm",".mm"},
+            {"text/mathml",".mml"},
+            {"text/x-moc",".moc"},
+            {"text/x-mof",".mof"},
+            {"audio/mpeg",".mp3"},
+            {"video/mp4",".mp4"},
+            {"text/x-mrml",".mrl"},
+            {"image/x-minolta-mrw",".mrw"},
+            {"text/x-troff-ms",".ms"},
+            {"image/x-msod",".msod"},
+            {"text/x-mup",".mup"},
+            {"image/x-nikon-nef",".nef"},
+            {"text/x-nfo",".nfo"},
+            {"text/x-ocl",".ocl"},
+            {"text/x-opml+xml",".opml"},
+            {"image/openraster",".ora"},
+            {"image/x-olympus-orf",".orf"},
+            {"text/x-pascal",".p"},
+            {"image/x-portable-bitmap",".pbm"},
+            {"image/x-photo-cd",".pcd"},
+            {"image/x-pcx",".pcx"},
+            {"application/pdf",".pdf"},
+            {"image/x-pentax-pef",".pef"},
+            {"image/x-portable-graymap",".pgm"},
+            {"image/x-pict",".pict"},
+            {"image/png",".png"},
+            {"image/x-portable-anymap",".pnm"},
+            {"image/x-macpaint",".pntg"},
+            {"text/x-gettext-translation",".po"},
+            {"text/x-gettext-translation-template",".pot"},
+            {"text/x-python",".py"},
+            {"image/x-quicktime",".qif"},
+            {"image/x-fuji-raf",".raf"},
+            {"image/x-cmu-raster",".ras"},
+            {"image/x-panasonic-raw",".raw"},
+            {"text/x-ms-regedit",".reg"},
+            {"image/x-rgb",".rgb"},
+            {"image/rle",".rle"},
+            {"text/troff",".roff"},
+            {"image/vnd.rn-realpix",".rp"},
+            {"text/vnd.rn-realtext",".rt"},
+            {"text/richtext",".rtx"},
+            {"text/x-scheme",".scm"},
+            {"image/x-sgi",".sgi"},
+            {"text/sgml",".sgm"},
+            {"image/x-skencil",".sk"},
+            {"text/spreadsheet",".slk"},
+            {"text/x-rpm-spec",".spec"},
+            {"text/x-sql",".sql"},
+            {"image/x-sony-sr2",".sr2"},
+            {"image/x-sony-srf",".srf"},
+            {"text/x-subviewer",".sub"},
+            {"image/x-sun-raster",".sun"},
+            {"image/svg+xml",".svg"},
+            {"image/svg+xml-compressed",".svgz"},
+            {"text/x-txt2tags",".t2t"},
+            {"text/x-tcl",".tcl"},
+            {"text/x-texinfo",".texi"},
+            {"image/tiff",".tif"},
+            {"audio/x-voc",".voc"},
+            {"image/x-wmf",".wmf"},
+            {"text/vnd.wap.wml",".wml"},
+            {"text/vnd.wap.wmlscript",".wmls"},
+            {"video/x-ms-wmv",".wmv"},
+            {"application/xhtml+xml",".xhtml"},
+            {"application/xml",".xml"}
         };
 
         public static readonly Dictionary<string, string> dict = new Dictionary<string, string> {

+ 156 - 0
TEAMModelOS/Controllers/Third/Xkw/Sdk/XkwConstant.cs

@@ -0,0 +1,156 @@
+using System.Collections.Generic;
+
+namespace TEAMModelOS.Controllers.Third.Xkw.Sdk
+{
+    public static class XkwConstant
+    {
+        public static readonly List<XkwDto> xkwStages = new List<XkwDto>() {
+            new XkwDto{ id=1,name="学前",code="PRESCHOOL"},
+            new XkwDto{ id=2,name="小学",code="PRIMARY"},
+            new XkwDto{ id=3,name="初中",code="JUNIOR_MIDDLE"},
+            new XkwDto{ id=4,name="高中",code="SENIOR_MIDDLE"},
+            new XkwDto{ id=5,name="大学",code="COLLEGE"},
+            new XkwDto{ id=6,name="中职",code="SECONDARY_VOCATIONAL"},
+        };
+        public static readonly List<XkwDto> xkwGrades = new List<XkwDto>() {
+            new XkwDto{ id=1,name="一年级"},
+            new XkwDto{ id=2,name="二年级"},
+            new XkwDto{ id=3,name="三年级"},
+            new XkwDto{ id=4,name="四年级"},
+            new XkwDto{ id=5,name="五年级"},
+            new XkwDto{ id=6,name="六年级"},
+            new XkwDto{ id=7,name="七年级"},
+            new XkwDto{ id=8,name="八年级"},
+            new XkwDto{ id=9,name="九年级"},
+            new XkwDto{ id=10,name="高一"},
+            new XkwDto{ id=11,name="高二"},
+            new XkwDto{ id=12,name="高三"},
+        };
+        public static readonly List<XkwDto> xkwTerms = new List<XkwDto>() {
+            new XkwDto{ id=1,name="上学期",code="LAST"},
+            new XkwDto{ id=2,name="下学期",code="NEXT"},
+        };
+        public static readonly List<XkwDto> xkwSubjects = new List<XkwDto>() {
+            new XkwDto{ id=1,name="语文"},
+            new XkwDto{ id=2,name="数学"},
+            new XkwDto{ id=3,name="英语"},
+            new XkwDto{ id=4,name="物理"},
+            new XkwDto{ id=5,name="化学"},
+            new XkwDto{ id=6,name="生物"},
+            new XkwDto{ id=7,name="政治(品德)"},
+            new XkwDto{ id=8,name="历史"},
+            new XkwDto{ id=9,name="地理"},
+            new XkwDto{ id=10,name="科学"},
+            new XkwDto{ id=11,name="历史与社会"},
+            new XkwDto{ id=12,name="信息技术"},
+            new XkwDto{ id=13,name="音乐"},
+            new XkwDto{ id=14,name="美术"},
+            new XkwDto{ id=15,name="体育与健康"},
+            new XkwDto{ id=16,name="通用技术"},
+            new XkwDto{ id=17,name="劳动技术"},
+            new XkwDto{ id=18,name="拓展"},
+            new XkwDto{ id=19,name="心理健康"},
+            new XkwDto{ id=20,name="综合实践活动"},
+            new XkwDto{ id=21,name="日语"},
+            new XkwDto{ id=22,name="俄语"},
+            new XkwDto{ id=23,name="书法"},
+            new XkwDto{ id=24,name="社会"},
+        };
+        public static readonly List<XkwDto> xkwCourses = new List<XkwDto>() {
+            new XkwDto{  id=1,name="小学语文", stage_id=2,stage_name ="小学",subject_id=1,subject_name="语文"   },
+            new XkwDto{ id=2,name="小学数学", stage_id=2,stage_name ="小学",subject_id=2,subject_name="数学"   },
+            new XkwDto{ id=3,name="小学英语", stage_id=2,stage_name ="小学",subject_id=3,subject_name="英语"   },
+            new XkwDto{ id=4,name="小学道德与法治", stage_id=2,stage_name ="小学",subject_id=7,subject_name="道德与法治" },
+            new XkwDto{ id=5,name="小学科学", stage_id=2,stage_name ="小学",subject_id=10,subject_name="科学"  },
+            new XkwDto{ id=6,name="小学信息技术", stage_id=2,stage_name ="小学",subject_id=12,subject_name="信息技术"  },
+            new XkwDto{ id=7,name="小学音乐", stage_id=2,stage_name ="小学",subject_id=13,subject_name="音乐"  },
+            new XkwDto{ id=8,name="小学美术", stage_id=2,stage_name ="小学",subject_id=14,subject_name="美术"  },
+            new XkwDto{ id=9,name="小学体育", stage_id=2,stage_name ="小学",subject_id=15,subject_name="体育"  },
+            new XkwDto{ id=10,name="初中语文", stage_id=3,stage_name ="初中",subject_id=1,subject_name="语文"    },
+            new XkwDto{ id=11,name="初中数学", stage_id=3,stage_name ="初中",subject_id=2,subject_name="数学"    },
+            new XkwDto{ id=12,name="初中英语", stage_id=3,stage_name ="初中",subject_id=3,subject_name="英语"    },
+            new XkwDto{ id=13,name="初中物理", stage_id=3,stage_name ="初中",subject_id=4,subject_name="物理"    },
+            new XkwDto{ id=14,name="初中化学", stage_id=3,stage_name ="初中",subject_id=5,subject_name="化学"    },
+            new XkwDto{ id=15,name="初中生物", stage_id=3,stage_name ="初中",subject_id=6,subject_name="生物"    },
+            new XkwDto{ id=16,name="初中道德与法治", stage_id=3,stage_name ="初中",subject_id=7,subject_name="道德与法治"  },
+            new XkwDto{ id=17,name="初中历史", stage_id=3,stage_name ="初中",subject_id=8,subject_name="历史"    },
+            new XkwDto{ id=18,name="初中地理", stage_id=3,stage_name ="初中",subject_id=9,subject_name="地理"    },
+            new XkwDto{ id=19,name="初中科学", stage_id=3,stage_name ="初中",subject_id=10,subject_name="科学"   },
+            new XkwDto{ id=20,name="初中信息技术", stage_id=3,stage_name ="初中",subject_id=12,subject_name="信息技术"   },
+            new XkwDto{ id=21,name="初中历史与社会", stage_id=3,stage_name ="初中",subject_id=11,subject_name="历史与社会" },
+            new XkwDto{ id=22,name="初中音乐", stage_id=3,stage_name ="初中",subject_id=13,subject_name="音乐"   },
+            new XkwDto{ id=23,name="初中美术", stage_id=3,stage_name ="初中",subject_id=14,subject_name="美术"   },
+            new XkwDto{ id=24,name="初中体育与健康", stage_id=3,stage_name ="初中",subject_id=15,subject_name="体育与健康" },
+            new XkwDto{ id=25,name="初中劳动技术", stage_id=3,stage_name ="初中",subject_id=17,subject_name="劳动技术"   },
+            new XkwDto{ id=26,name="高中语文", stage_id=4,stage_name ="高中",subject_id=1,subject_name="语文"    },
+            new XkwDto{ id=27,name="高中数学", stage_id=4,stage_name ="高中",subject_id=2,subject_name="数学"    },
+            new XkwDto{ id=28,name="高中英语", stage_id=4,stage_name ="高中",subject_id=3,subject_name="英语"    },
+            new XkwDto{ id=29,name="高中物理", stage_id=4,stage_name ="高中",subject_id=4,subject_name="物理"    },
+            new XkwDto{ id=30,name="高中化学", stage_id=4,stage_name ="高中",subject_id=5,subject_name="化学"    },
+            new XkwDto{ id=31,name="高中生物", stage_id=4,stage_name ="高中",subject_id=6,subject_name="生物"    },
+            new XkwDto{ id=32,name="高中政治", stage_id=4,stage_name ="高中",subject_id=7,subject_name="政治"    },
+            new XkwDto{ id=33,name="高中历史", stage_id=4,stage_name ="高中",subject_id=8,subject_name="历史"    },
+            new XkwDto{ id=34,name="高中地理", stage_id=4,stage_name ="高中",subject_id=9,subject_name="地理"    },
+            new XkwDto{ id=35,name="高中信息技术", stage_id=4,stage_name ="高中",subject_id=12,subject_name="信息技术"   },
+            new XkwDto{ id=36,name="高中音乐", stage_id=4,stage_name ="高中",subject_id=13,subject_name="音乐"   },
+            new XkwDto{ id=37,name="高中美术", stage_id=4,stage_name ="高中",subject_id=14,subject_name="美术"   },
+            new XkwDto{ id=38,name="高中体育与健康", stage_id=4,stage_name ="高中",subject_id=15,subject_name="体育与健康" },
+            new XkwDto{ id=39,name="高中通用技术", stage_id=4,stage_name ="高中",subject_id=16,subject_name="通用技术"   },
+            new XkwDto{ id=40,name="高中劳动技术", stage_id=4,stage_name ="高中",subject_id=17,subject_name="劳动技术"   },
+            new XkwDto{ id=41,name="小学心理健康", stage_id=2,stage_name ="小学",subject_id=19,subject_name="心理健康"    },
+            new XkwDto{ id=42,name="小学综合实践活动", stage_id=2,stage_name ="小学",subject_id=20,subject_name="综合实践活动"    },
+            new XkwDto{ id=43,name="初中日语", stage_id=3,stage_name ="初中",subject_id=21,subject_name="日语"   },
+            new XkwDto{ id=44,name="高中日语", stage_id=4,stage_name ="高中",subject_id=21,subject_name="日语"   },
+            new XkwDto{ id=45,name="初中俄语", stage_id=3,stage_name ="初中",subject_id=22,subject_name="俄语"   },
+            new XkwDto{ id=46,name="高中俄语", stage_id=4,stage_name ="高中",subject_id=22,subject_name="俄语"   },
+            new XkwDto{ id=50,name="中职语文", stage_id=6,stage_name ="中职",subject_id=1,subject_name="语文" },
+            new XkwDto{ id=51,name="中职数学", stage_id=6,stage_name ="中职",subject_id=2,subject_name="数学" },
+            new XkwDto{ id=52,name="中职英语", stage_id=6,stage_name ="中职",subject_id=3,subject_name="英语" },
+            new XkwDto{ id=53,name="初中社会", stage_id=3,stage_name ="初中",subject_id=24,subject_name="社会"   },
+            new XkwDto{ id=54,name="中职拓展", stage_id=6,stage_name ="中职",subject_id=18,subject_name="拓展" },
+            new XkwDto{ id=111,name="小学拓展", stage_id=2,stage_name ="小学",subject_id=18,subject_name="拓展"   },
+            new XkwDto{ id=112,name="初中拓展", stage_id=3,stage_name ="初中",subject_id=18,subject_name="拓展"  },
+            new XkwDto{ id=113,name="高中拓展", stage_id=4,stage_name ="高中",subject_id=18,subject_name="拓展"  },
+            new XkwDto{ id=114,name="小学书法", stage_id=2,stage_name ="小学",subject_id=23,subject_name="书法"  },
+        };
+        public static readonly List<XkwDifficulty> xkwDifficulties = new List<XkwDifficulty>()
+        {
+            //new XkwDifficulty{ id=17,name="容易",ceiling=0.99,flooring=0.9  },
+            new XkwDifficulty{ id=17,name="容易",ceiling=1.0,flooring=0.9  },
+            new XkwDifficulty{ id=18,name="较易",ceiling=0.9,flooring=0.8  },
+            new XkwDifficulty{ id=19,name="一般",ceiling=0.8,flooring=0.5  },
+            new XkwDifficulty{ id=20,name="较难",ceiling=0.5,flooring=0.3  },
+            new XkwDifficulty{ id=21,name="困难",ceiling=0.3,flooring=0.0  },
+        };
+    }
+    public class XkwQuestionType
+    {
+        public string id { get; set; }
+        public string name { get; set; }
+        public bool objective { get; set; }
+        public int course_id { get; set; }
+    }
+
+
+    /// <summary>
+    /// 
+    /// </summary>
+    public class XkwDifficulty
+    {
+        public int id { get; set; }
+        public string name { get; set; }
+        public double ceiling { get; set; }
+        public double flooring { get; set; }
+    }
+    public class XkwDto { 
+        public int id { get; set; }
+        public string name  { get; set; }
+        public string  code  { get; set; }
+        public int stage_id { get; set; }
+
+        public string stage_name { get; set; }
+        public int  subject_id { get; set; }
+
+        public string subject_name { get; set; }
+    }
+}

+ 20 - 2
TEAMModelOS/Controllers/Third/Xkw/XkwServiceController.cs

@@ -34,6 +34,7 @@ using TEAMModelOS.Controllers.Third.Xkw;
 using Microsoft.Extensions.Primitives;
 using System.Net.Http;
 using TEAMModelOS.Controllers.Third.Xkw.Sdk;
+using TEAMModelOS.SDK.Models.Table;
 
 namespace TEAMModelOS.Controllers.Third.Xkw
 { 
@@ -85,9 +86,26 @@ namespace TEAMModelOS.Controllers.Third.Xkw
         //[AuthToken(Roles = "teacher,admin,area,student")]
         public async Task<IActionResult> PaperNotice([FromQuery] OAuthCode authCode)
         {
+
+            //var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
+            //string tbScHourSql = $"PartitionKey eq 'HourLogin-ylgxxx' and RowKey le '2022052006'";
+            //string tbScDaySql = $"PartitionKey eq 'DayLogin-ylgxxx' and RowKey le '20211128'";
+            //await table.DeleteStringWhere<HourLogin>(rowKey: tbScHourSql); //删除学校168小时前的数据
+            //await table.DeleteStringWhere<DayLogin>(rowKey: tbScDaySql); //删除学校180天前的数据
             var courses = _xkwAPIHttpService.Get<JsonElement>("/xopqbm/courses/all", null);
-            await _dingDing.SendBotMsg($"学科网推送消息:{authCode.ToJsonString()}", GroupNames.成都开发測試群組);
-            return Ok(courses);
+
+            //await _dingDing.SendBotMsg($"学科网推送消息:{authCode.ToJsonString()}", GroupNames.成都开发測試群組);
+            List<XkwQuestionType> questionTypes = new List<XkwQuestionType>();
+            XkwConstant.xkwCourses.ForEach(x =>
+            {
+                Dictionary<string, string> dict = new Dictionary<string, string>() { { "course_id",$"{x.id}" } };
+                var question_types = _xkwAPIHttpService.Get<JsonElement>($"/xopqbm/question-types", dict);
+                if (question_types.TryGetProperty("code", out JsonElement code) && $"{code}".Equals("2000000"))
+                {
+                    questionTypes.AddRange(question_types.GetProperty("data").ToObject<List<XkwQuestionType>>());
+                }
+            });
+            return Ok(questionTypes);
         }
     }
 }