| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System.Collections.Generic;
- namespace DRG.DRGInterfaceClient
- {
- /// <summary>根据机构信息 + 默认值构建业务 session。</summary>
- internal static class SessionBuilder
- {
- /// <summary>完整 session:机构字段来自 hospital,其余来自默认值。</summary>
- public static Dictionary<string, object> Build(HospitalInfoItem hosp, SessionDefaults d)
- {
- hosp = hosp ?? new HospitalInfoItem();
- d = d ?? new SessionDefaults();
- return new Dictionary<string, object>
- {
- { "userID", d.userID ?? "" },
- { "userCode", d.userCode ?? "" },
- { "userName", d.userName ?? "" },
- { "locID", d.locID ?? "" },
- { "locDesc", d.locDesc ?? "" },
- { "groupID", d.groupID ?? "" },
- { "groupDesc", d.groupDesc ?? "" },
- { "hospID", hosp.id ?? "" },
- { "hospCode", hosp.hospCode ?? "" },
- { "hospDesc", hosp.descripts ?? "" },
- { "langID", d.langID },
- { "langDesc", d.langDesc ?? "" },
- { "changeFlag", d.changeFlag ?? "N" },
- { "changeDesc", d.changeDesc ?? "" },
- { "lastLoginDate", d.lastLoginDate ?? "" },
- { "lastLoginTime", d.lastLoginTime ?? "" },
- { "directorAuth", d.directorAuth ?? "N" },
- { "defaultMenuType", d.defaultMenuType ?? "" },
- { "titleDesc", d.titleDesc ?? "" },
- { "userYBCode", d.userYBCode ?? "" },
- { "hospYBCode", hosp.code ?? "" },
- { "provID", d.provID ?? "" },
- { "cityID", d.cityID ?? "" },
- { "areaCode", d.areaCode ?? "" },
- { "medinsLv", hosp.MedinsLv ?? "" },
- { "path", d.path ?? "" },
- { "sessionID", d.sessionID ?? "" },
- { "errorMessageTime", d.errorMessageTime ?? "" },
- { "language", d.language ?? "CN" },
- { "messageTime", d.messageTime }
- };
- }
- /// <summary>默认 session(机构字段为空),用于首次加载机构列表 01010064。</summary>
- public static Dictionary<string, object> BuildDefault(SessionDefaults d)
- {
- return Build(new HospitalInfoItem(), d);
- }
- }
- }
|