vitalServicePack.m.dart 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. import 'liveConsultation.m.dart';
  2. import 'vitalContractRecord.m.dart';
  3. import 'notification.m.dart';
  4. import 'device.m.dart';
  5. class CreateServicePackRequest extends TokenRequest{
  6. String? code;
  7. String? name;
  8. ServicePackTypeEnum servicePackType;
  9. String? content;
  10. CreateServicePackRequest({
  11. this.code,
  12. this.name,
  13. this.servicePackType = ServicePackTypeEnum.BasePack,
  14. this.content,
  15. String? token,
  16. }) : super(
  17. token: token,
  18. );
  19. factory CreateServicePackRequest.fromJson(Map<String, dynamic> map) {
  20. return CreateServicePackRequest(
  21. code: map['Code'],
  22. name: map['Name'],
  23. servicePackType: ServicePackTypeEnum.values.firstWhere((e) => e.index == map['ServicePackType']),
  24. content: map['Content'],
  25. token: map['Token'],
  26. );
  27. }
  28. Map<String, dynamic> toJson() {
  29. final map = super.toJson();
  30. if (code != null)
  31. map['Code'] = code;
  32. if (name != null)
  33. map['Name'] = name;
  34. map['ServicePackType'] = servicePackType.index;
  35. if (content != null)
  36. map['Content'] = content;
  37. return map;
  38. }
  39. }
  40. class GetServicePackRequest extends TokenRequest{
  41. String? code;
  42. GetServicePackRequest({
  43. this.code,
  44. String? token,
  45. }) : super(
  46. token: token,
  47. );
  48. factory GetServicePackRequest.fromJson(Map<String, dynamic> map) {
  49. return GetServicePackRequest(
  50. code: map['Code'],
  51. token: map['Token'],
  52. );
  53. }
  54. Map<String, dynamic> toJson() {
  55. final map = super.toJson();
  56. if (code != null)
  57. map['Code'] = code;
  58. return map;
  59. }
  60. }
  61. class ServicePackPageRequest extends PageRequest{
  62. ServicePackPageRequest({
  63. int pageIndex = 0,
  64. int pageSize = 0,
  65. String? token,
  66. }) : super(
  67. pageIndex: pageIndex,
  68. pageSize: pageSize,
  69. token: token,
  70. );
  71. factory ServicePackPageRequest.fromJson(Map<String, dynamic> map) {
  72. return ServicePackPageRequest(
  73. pageIndex: map['PageIndex'],
  74. pageSize: map['PageSize'],
  75. token: map['Token'],
  76. );
  77. }
  78. Map<String, dynamic> toJson() {
  79. final map = super.toJson();
  80. return map;
  81. }
  82. }
  83. class RemovetServicePackRequest extends TokenRequest{
  84. String? code;
  85. RemovetServicePackRequest({
  86. this.code,
  87. String? token,
  88. }) : super(
  89. token: token,
  90. );
  91. factory RemovetServicePackRequest.fromJson(Map<String, dynamic> map) {
  92. return RemovetServicePackRequest(
  93. code: map['Code'],
  94. token: map['Token'],
  95. );
  96. }
  97. Map<String, dynamic> toJson() {
  98. final map = super.toJson();
  99. if (code != null)
  100. map['Code'] = code;
  101. return map;
  102. }
  103. }
  104. class UpdateServicePackRequest extends TokenRequest{
  105. String? code;
  106. String? name;
  107. ServicePackTypeEnum servicePackType;
  108. String? content;
  109. UpdateServicePackRequest({
  110. this.code,
  111. this.name,
  112. this.servicePackType = ServicePackTypeEnum.BasePack,
  113. this.content,
  114. String? token,
  115. }) : super(
  116. token: token,
  117. );
  118. factory UpdateServicePackRequest.fromJson(Map<String, dynamic> map) {
  119. return UpdateServicePackRequest(
  120. code: map['Code'],
  121. name: map['Name'],
  122. servicePackType: ServicePackTypeEnum.values.firstWhere((e) => e.index == map['ServicePackType']),
  123. content: map['Content'],
  124. token: map['Token'],
  125. );
  126. }
  127. Map<String, dynamic> toJson() {
  128. final map = super.toJson();
  129. if (code != null)
  130. map['Code'] = code;
  131. if (name != null)
  132. map['Name'] = name;
  133. map['ServicePackType'] = servicePackType.index;
  134. if (content != null)
  135. map['Content'] = content;
  136. return map;
  137. }
  138. }
  139. class UpdateServicePackForItemsRequest extends TokenRequest{
  140. String? code;
  141. List<String>? items;
  142. UpdateServicePackForItemsRequest({
  143. this.code,
  144. this.items,
  145. String? token,
  146. }) : super(
  147. token: token,
  148. );
  149. factory UpdateServicePackForItemsRequest.fromJson(Map<String, dynamic> map) {
  150. return UpdateServicePackForItemsRequest(
  151. code: map['Code'],
  152. items: map['Items']?.cast<String>().toList(),
  153. token: map['Token'],
  154. );
  155. }
  156. Map<String, dynamic> toJson() {
  157. final map = super.toJson();
  158. if (code != null)
  159. map['Code'] = code;
  160. if (items != null)
  161. map['Items'] = items;
  162. return map;
  163. }
  164. }
  165. enum ServiceItemTypeEnum {
  166. LimitCount,
  167. UnlimitedCount,
  168. }
  169. class CreateServiceItemRequest extends TokenRequest{
  170. String? name;
  171. String? content;
  172. ServiceItemTypeEnum serviceItemType;
  173. String? serviceNumber;
  174. String? department;
  175. String? guidancePrice;
  176. String? adjustedPrice;
  177. String? totalPrice;
  178. String? priceExplanation;
  179. CreateServiceItemRequest({
  180. this.name,
  181. this.content,
  182. this.serviceItemType = ServiceItemTypeEnum.LimitCount,
  183. this.serviceNumber,
  184. this.department,
  185. this.guidancePrice,
  186. this.adjustedPrice,
  187. this.totalPrice,
  188. this.priceExplanation,
  189. String? token,
  190. }) : super(
  191. token: token,
  192. );
  193. factory CreateServiceItemRequest.fromJson(Map<String, dynamic> map) {
  194. return CreateServiceItemRequest(
  195. name: map['Name'],
  196. content: map['Content'],
  197. serviceItemType: ServiceItemTypeEnum.values.firstWhere((e) => e.index == map['ServiceItemType']),
  198. serviceNumber: map['ServiceNumber'],
  199. department: map['Department'],
  200. guidancePrice: map['GuidancePrice'],
  201. adjustedPrice: map['AdjustedPrice'],
  202. totalPrice: map['TotalPrice'],
  203. priceExplanation: map['PriceExplanation'],
  204. token: map['Token'],
  205. );
  206. }
  207. Map<String, dynamic> toJson() {
  208. final map = super.toJson();
  209. if (name != null)
  210. map['Name'] = name;
  211. if (content != null)
  212. map['Content'] = content;
  213. map['ServiceItemType'] = serviceItemType.index;
  214. if (serviceNumber != null)
  215. map['ServiceNumber'] = serviceNumber;
  216. if (department != null)
  217. map['Department'] = department;
  218. if (guidancePrice != null)
  219. map['GuidancePrice'] = guidancePrice;
  220. if (adjustedPrice != null)
  221. map['AdjustedPrice'] = adjustedPrice;
  222. if (totalPrice != null)
  223. map['TotalPrice'] = totalPrice;
  224. if (priceExplanation != null)
  225. map['PriceExplanation'] = priceExplanation;
  226. return map;
  227. }
  228. }
  229. class ServiceItemDTO extends BaseDTO{
  230. String? code;
  231. String? name;
  232. String? content;
  233. ServiceItemTypeEnum serviceItemType;
  234. String? serviceNumber;
  235. String? department;
  236. String? guidancePrice;
  237. String? adjustedPrice;
  238. String? totalPrice;
  239. String? priceExplanation;
  240. ServiceItemDTO({
  241. this.code,
  242. this.name,
  243. this.content,
  244. this.serviceItemType = ServiceItemTypeEnum.LimitCount,
  245. this.serviceNumber,
  246. this.department,
  247. this.guidancePrice,
  248. this.adjustedPrice,
  249. this.totalPrice,
  250. this.priceExplanation,
  251. DateTime? createTime,
  252. DateTime? updateTime,
  253. }) : super(
  254. createTime: createTime,
  255. updateTime: updateTime,
  256. );
  257. factory ServiceItemDTO.fromJson(Map<String, dynamic> map) {
  258. return ServiceItemDTO(
  259. code: map['Code'],
  260. name: map['Name'],
  261. content: map['Content'],
  262. serviceItemType: ServiceItemTypeEnum.values.firstWhere((e) => e.index == map['ServiceItemType']),
  263. serviceNumber: map['ServiceNumber'],
  264. department: map['Department'],
  265. guidancePrice: map['GuidancePrice'],
  266. adjustedPrice: map['AdjustedPrice'],
  267. totalPrice: map['TotalPrice'],
  268. priceExplanation: map['PriceExplanation'],
  269. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  270. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  271. );
  272. }
  273. Map<String, dynamic> toJson() {
  274. final map = super.toJson();
  275. if (code != null)
  276. map['Code'] = code;
  277. if (name != null)
  278. map['Name'] = name;
  279. if (content != null)
  280. map['Content'] = content;
  281. map['ServiceItemType'] = serviceItemType.index;
  282. if (serviceNumber != null)
  283. map['ServiceNumber'] = serviceNumber;
  284. if (department != null)
  285. map['Department'] = department;
  286. if (guidancePrice != null)
  287. map['GuidancePrice'] = guidancePrice;
  288. if (adjustedPrice != null)
  289. map['AdjustedPrice'] = adjustedPrice;
  290. if (totalPrice != null)
  291. map['TotalPrice'] = totalPrice;
  292. if (priceExplanation != null)
  293. map['PriceExplanation'] = priceExplanation;
  294. return map;
  295. }
  296. }
  297. class GetServiceItemRequest extends TokenRequest{
  298. String? code;
  299. GetServiceItemRequest({
  300. this.code,
  301. String? token,
  302. }) : super(
  303. token: token,
  304. );
  305. factory GetServiceItemRequest.fromJson(Map<String, dynamic> map) {
  306. return GetServiceItemRequest(
  307. code: map['Code'],
  308. token: map['Token'],
  309. );
  310. }
  311. Map<String, dynamic> toJson() {
  312. final map = super.toJson();
  313. if (code != null)
  314. map['Code'] = code;
  315. return map;
  316. }
  317. }
  318. class GetServiceItemListRequest extends TokenRequest{
  319. List<String>? codes;
  320. GetServiceItemListRequest({
  321. this.codes,
  322. String? token,
  323. }) : super(
  324. token: token,
  325. );
  326. factory GetServiceItemListRequest.fromJson(Map<String, dynamic> map) {
  327. return GetServiceItemListRequest(
  328. codes: map['Codes']?.cast<String>().toList(),
  329. token: map['Token'],
  330. );
  331. }
  332. Map<String, dynamic> toJson() {
  333. final map = super.toJson();
  334. if (codes != null)
  335. map['Codes'] = codes;
  336. return map;
  337. }
  338. }
  339. class RemovetServiceItemRequest extends TokenRequest{
  340. String? code;
  341. RemovetServiceItemRequest({
  342. this.code,
  343. String? token,
  344. }) : super(
  345. token: token,
  346. );
  347. factory RemovetServiceItemRequest.fromJson(Map<String, dynamic> map) {
  348. return RemovetServiceItemRequest(
  349. code: map['Code'],
  350. token: map['Token'],
  351. );
  352. }
  353. Map<String, dynamic> toJson() {
  354. final map = super.toJson();
  355. if (code != null)
  356. map['Code'] = code;
  357. return map;
  358. }
  359. }
  360. class UpdateServiceItemRequest extends TokenRequest{
  361. String? code;
  362. String? name;
  363. String? content;
  364. ServiceItemTypeEnum serviceItemType;
  365. String? serviceNumber;
  366. String? department;
  367. String? guidancePrice;
  368. String? adjustedPrice;
  369. String? totalPrice;
  370. String? priceExplanation;
  371. UpdateServiceItemRequest({
  372. this.code,
  373. this.name,
  374. this.content,
  375. this.serviceItemType = ServiceItemTypeEnum.LimitCount,
  376. this.serviceNumber,
  377. this.department,
  378. this.guidancePrice,
  379. this.adjustedPrice,
  380. this.totalPrice,
  381. this.priceExplanation,
  382. String? token,
  383. }) : super(
  384. token: token,
  385. );
  386. factory UpdateServiceItemRequest.fromJson(Map<String, dynamic> map) {
  387. return UpdateServiceItemRequest(
  388. code: map['Code'],
  389. name: map['Name'],
  390. content: map['Content'],
  391. serviceItemType: ServiceItemTypeEnum.values.firstWhere((e) => e.index == map['ServiceItemType']),
  392. serviceNumber: map['ServiceNumber'],
  393. department: map['Department'],
  394. guidancePrice: map['GuidancePrice'],
  395. adjustedPrice: map['AdjustedPrice'],
  396. totalPrice: map['TotalPrice'],
  397. priceExplanation: map['PriceExplanation'],
  398. token: map['Token'],
  399. );
  400. }
  401. Map<String, dynamic> toJson() {
  402. final map = super.toJson();
  403. if (code != null)
  404. map['Code'] = code;
  405. if (name != null)
  406. map['Name'] = name;
  407. if (content != null)
  408. map['Content'] = content;
  409. map['ServiceItemType'] = serviceItemType.index;
  410. if (serviceNumber != null)
  411. map['ServiceNumber'] = serviceNumber;
  412. if (department != null)
  413. map['Department'] = department;
  414. if (guidancePrice != null)
  415. map['GuidancePrice'] = guidancePrice;
  416. if (adjustedPrice != null)
  417. map['AdjustedPrice'] = adjustedPrice;
  418. if (totalPrice != null)
  419. map['TotalPrice'] = totalPrice;
  420. if (priceExplanation != null)
  421. map['PriceExplanation'] = priceExplanation;
  422. return map;
  423. }
  424. }
  425. class UpdateServicePackForLabelsRequest extends TokenRequest{
  426. String? code;
  427. List<String>? labels;
  428. UpdateServicePackForLabelsRequest({
  429. this.code,
  430. this.labels,
  431. String? token,
  432. }) : super(
  433. token: token,
  434. );
  435. factory UpdateServicePackForLabelsRequest.fromJson(Map<String, dynamic> map) {
  436. return UpdateServicePackForLabelsRequest(
  437. code: map['Code'],
  438. labels: map['Labels']?.cast<String>().toList(),
  439. token: map['Token'],
  440. );
  441. }
  442. Map<String, dynamic> toJson() {
  443. final map = super.toJson();
  444. if (code != null)
  445. map['Code'] = code;
  446. if (labels != null)
  447. map['Labels'] = labels;
  448. return map;
  449. }
  450. }