SchoolProduct.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Text;
  5. using System.Text.Json.Serialization;
  6. using TEAMModelOS.SDK.Context.Attributes.Azure;
  7. using TEAMModelOS.SDK.DI;
  8. namespace TEAMModelOS.SDK.Models
  9. {
  10. //產品購買紀錄
  11. public class SchoolProductCommon : CosmosEntity
  12. {
  13. public SchoolProductCommon()
  14. {
  15. pk = "Product";
  16. }
  17. public string dataType { get; set; }
  18. public string prodCode { get; set; }
  19. }
  20. //產品購買紀錄-序號
  21. public class SchoolProductSerial : SchoolProductCommon
  22. {
  23. public string serial { get; set; }
  24. public List<deviceBound> deviceBound { get; set; }
  25. public int clientQty { get; set; }
  26. public long orderDate { get; set; }
  27. public long regDate { get; set; }
  28. public long startDate { get; set; }
  29. public long endDate { get; set; }
  30. public int deviceMax { get; set; }
  31. public object aprule { get; set; }
  32. public string expireStatus { get; set; }
  33. public int status { get; set; }
  34. }
  35. //產品購買紀錄-服務
  36. public class SchoolProductService : SchoolProductCommon
  37. {
  38. public long orderDate { get; set; }
  39. public long startDate { get; set; }
  40. public long endDate { get; set; }
  41. public int number { get; set; }
  42. public string unit { get; set; }
  43. }
  44. //產品購買紀錄-硬體
  45. public class SchoolProductHard : SchoolProductCommon
  46. {
  47. public long orderDate { get; set; }
  48. public string model { get; set; }
  49. public string serial { get; set; }
  50. }
  51. //產品一覽
  52. public class SchoolProductSum
  53. {
  54. public SchoolProductSum()
  55. {
  56. pk = "ProductSum";
  57. code = "ProductSum";
  58. prodinfo = new List<SchoolProductSumProdInfo>();
  59. serial = new List<SchoolProductSumData>();
  60. service = new List<SchoolProductSumDataService>();
  61. hard = new List<SchoolProductSumDataHard>();
  62. }
  63. public string pk { get; set; }
  64. public string code { get; set; }
  65. public string id { get; set; }
  66. public List<SchoolProductSumProdInfo> prodinfo { get; set; }
  67. public List<SchoolProductSumData> serial { get; set; }
  68. public List<SchoolProductSumDataService> service { get; set; }
  69. public List<SchoolProductSumDataHard> hard { get; set; }
  70. //public Aclassone aclassone { get; set; } //是否獨立出來,未定
  71. }
  72. public class SchoolProductSumProdInfo
  73. {
  74. public string prodCode { get; set; }
  75. public string prodName { get; set; }
  76. public string dataType { get; set; }
  77. public ServiceType serviceType { get; set; }
  78. }
  79. public enum ServiceType
  80. {
  81. number = 0,
  82. module = 1,
  83. space = 2
  84. }
  85. //產品一覽 產品內容 基本項
  86. public class SchoolProductSumData
  87. {
  88. public SchoolProductSumData()
  89. {
  90. ids = new List<string>();
  91. }
  92. public string prodCode { get; set; }
  93. public List<string> ids { get; set; }
  94. public int avaliable { get; set; }
  95. }
  96. //產品一覽 產品內容 服務
  97. public class SchoolProductSumDataService : SchoolProductSumData
  98. {
  99. public long startDate { get; set; }
  100. public long endDate { get; set; }
  101. }
  102. //產品一覽 產品內容 硬體
  103. public class SchoolProductSumDataHard : SchoolProductSumData
  104. {
  105. public string model { get; set; }
  106. }
  107. //服務各產品資訊可用資訊(前端用)
  108. public class SchoolProductOrder
  109. {
  110. public string prodCode { get; set; }
  111. public int avaliable { get; set; }
  112. public long avaliableStartDate { get; set; }
  113. public long avaliableEndDate { get; set; }
  114. }
  115. //IES5 學校產品購買紀錄 前端顯示用
  116. public class SchoolOrder
  117. {
  118. public string id { get; set; }
  119. public long date { get; set; }
  120. public List<SchoolOrderSerial> serial { get; set; }
  121. public List<SchoolOrderService> service { get; set; }
  122. public List<SchoolOrderHard> hard { get; set; }
  123. }
  124. //IES5 學校產品購買紀錄 前端顯示用 序號部分
  125. public class SchoolOrderSerial
  126. {
  127. public string prodCode { get; set; }
  128. public string type { get; set; }
  129. public string ymwd { get; set; }
  130. public long sdate { get; set; }
  131. public long edate { get; set; }
  132. public int cqty { get; set; }
  133. public int device { get; set; }
  134. public object aprule { get; set; }
  135. public List<string> sn { get; set; }
  136. }
  137. //IES5 學校產品購買紀錄 前端顯示用 服務部分
  138. public class SchoolOrderService
  139. {
  140. public string prodCode { get; set; }
  141. public string type { get; set; }
  142. public long sdate { get; set; }
  143. public long edate { get; set; }
  144. public int number { get; set; }
  145. public string unit { get; set; }
  146. }
  147. //IES5 學校產品購買紀錄 前端顯示用 硬體部分
  148. public class SchoolOrderHard
  149. {
  150. public string prodCode { get; set; }
  151. public List<string> sn { get; set; }
  152. }
  153. //序號資訊(含deviceId、classId、OS等硬體資訊)
  154. public class SerialInfoBaseWithdeviceBoundExt : SchoolProductSerial
  155. {
  156. public new List<deviceBoundExt> deviceBound { get; set; }
  157. }
  158. //服務授權期限(主週期資訊) ※code='Product' code='Product-{SchoolID}' dataType='servicePeriod'
  159. public class SchoolProductServicePeriod : SchoolProductCommon
  160. {
  161. public int type { get; set; } //授權週期類型 0:銷售 1:試用
  162. public long startDate { get; set; }
  163. public long endDate { get; set; }
  164. public int number { get; set; }
  165. public string unit { get; set; }
  166. }
  167. /////////////////////////////////////////////////////////
  168. public class SchoolProduct : CosmosEntity
  169. {
  170. public SchoolProduct()
  171. {
  172. pk = "Base";
  173. }
  174. public List<SerialInfoBaseWithdeviceBound> serial { get; set; }
  175. public ProductService service { get; set; }
  176. public List<ProductHard> hard { get; set; }
  177. public Aclassone aclassone { get; set; }
  178. }
  179. public class Aclassone
  180. {
  181. public List<string> ids { get; set; } //固定分配的學生ID
  182. public List<string> outids { get; set; } //過期被回收的學生ID(無法使用,待數量購足後回復移至ids)
  183. public int total { get; set; }
  184. public int used { get; set; }
  185. }
  186. public class SerialInfoBase
  187. {
  188. public string id { get; set; }
  189. public string serial { get; set; }
  190. public string prodCode { get; set; }
  191. public int clientQty { get; set; }
  192. public long regDate { get; set; }
  193. public long startDate { get; set; }
  194. public long endDate { get; set; }
  195. public int deviceMax { get; set; }
  196. public object aprule { get; set; }
  197. public string expireStatus { get; set; }
  198. public int status { get; set; }
  199. }
  200. public class SerialInfoBaseWithdeviceBound : SerialInfoBase
  201. {
  202. public List<deviceBound> deviceBound { get; set; }
  203. }
  204. //public class SerialInfoBaseWithdeviceBoundExt : SerialInfoBase
  205. //{
  206. // public List<deviceBoundExt> deviceBound { get; set; }
  207. //}
  208. public class deviceBound
  209. {
  210. public string uuid { get; set; }
  211. public string uuid2 { get; set; }
  212. public string deviceId { get; set; }
  213. public string classId { get; set; }
  214. }
  215. public class deviceBoundRich : deviceBound
  216. {
  217. public string serial { get; set; }
  218. }
  219. public class deviceForCoreService
  220. {
  221. public string uuid1 { get; set; }
  222. public string uuid2 { get; set; }
  223. public string device_id { get; set; }
  224. public string class_id { get; set; }
  225. public string sn { get; set; }
  226. }
  227. public class deviceFromCoreService
  228. {
  229. public string uuid1 { get; set; }
  230. public string uuid2 { get; set; }
  231. public string device_id { get; set; }
  232. public string sn { get; set; }
  233. public string os { get; set; }
  234. public string os_ver { get; set; }
  235. public string local_ip { get; set; }
  236. public string product_ver { get; set; }
  237. public string cpu { get; set; }
  238. public string pc_name { get; set; }
  239. }
  240. public class deviceBoundExt : deviceBound
  241. {
  242. public string ip { get; set; }
  243. public string pcname { get; set; }
  244. public string os { get; set; }
  245. public string cpu { get; set; }
  246. public string osver { get; set; }
  247. }
  248. public class ProductService
  249. {
  250. public List<ServiceMainPeriod> mainperiod { get; set; }
  251. public List<ServicePeriod> period { get; set; }
  252. public List<ServiceProduct> product { get; set; }
  253. }
  254. public class ServiceMainPeriod
  255. {
  256. public string mainPeriodId { get; set; }
  257. public string mainPeriodtype { get; set; }
  258. public long startDate { get; set; }
  259. public long endDate { get; set; }
  260. public bool active { get; set; }
  261. }
  262. public class ServicePeriod
  263. {
  264. public string mainPeriodId { get; set; }
  265. public string periodId { get; set; }
  266. public long startDate { get; set; }
  267. public long endDate { get; set; }
  268. public bool active { get; set; }
  269. }
  270. public class ServiceProduct
  271. {
  272. public string prodCode { get; set; }
  273. public bool noperiod { get; set; }
  274. public string serviceType { get; set; }
  275. public List<ServiceProductAuth> auth { get; set; }
  276. public int avaliable { get; set; }
  277. }
  278. public class ServiceProductResult
  279. {
  280. public string prodCode { get; set; }
  281. public bool noperiod { get; set; }
  282. public string serviceType { get; set; }
  283. public long startDate { get; set; }
  284. public long endDate { get; set; }
  285. public int avaliable { get; set; }
  286. }
  287. public class ServiceProductAclassoneResult : ServiceProductResult
  288. {
  289. public int staUsed { get; set; }
  290. public int dynUsed { get; set; }
  291. }
  292. public class ServiceProductAuth
  293. {
  294. public string orderId { get; set; }
  295. public string periodId { get; set; }
  296. public int number { get; set; }
  297. public string unit { get; set; }
  298. }
  299. public class ServiceProductAuthHistoryBasic
  300. {
  301. public string orderId { get; set; }
  302. public long orderDate { get; set; }
  303. public int number { get; set; }
  304. public string unit { get; set; }
  305. }
  306. public class ServiceProductAuthHistory : ServiceProductAuthHistoryBasic
  307. {
  308. public List<string> periodIdList { get; set; }
  309. }
  310. public class ServiceProductAuthHistoryStartEnd : ServiceProductAuthHistoryBasic
  311. {
  312. public long startDate { get; set; }
  313. public long endDate { get; set; }
  314. }
  315. public class ProductHard
  316. {
  317. public string prodCode { get; set; }
  318. public string model { get; set; }
  319. public string serial { get; set; }
  320. }
  321. public class CoreUuid
  322. {
  323. public string serial { get; set; }
  324. public string os { get; set; }
  325. public string ip { get; set; }
  326. public string uuid { get; set; }
  327. public string uuid2 { get; set; }
  328. public string deviceId { get; set; }
  329. public string pcname { get; set; }
  330. public string cpu { get; set; }
  331. public int ram { get; set; }
  332. }
  333. public class periodZone
  334. {
  335. public long startDate { get; set; }
  336. public long endDate { get; set; }
  337. }
  338. }