callingDoor_main.aspx.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using HNWD.Pregrant.WebService;
  8. using HNWD.Pregrant.Model;
  9. using System.Text;
  10. using HNWD.Pregrant.DataAccess;
  11. using HNWD.Pregrant.Common;
  12. namespace HNWD.Pregrant.WebService.WDMK_I
  13. {
  14. /// <summary>
  15. /// 主界面
  16. /// </summary>
  17. public partial class callingDoor_main : PageBase
  18. {
  19. ////////测试可用列表
  20. ///deviceId
  21. ///791
  22. ///797
  23. ///804
  24. ///811
  25. ///////////////////////////////
  26. protected void Page_Load(object sender, EventArgs e)
  27. {
  28. string deviceID = this.GetValueByKey("deviceId");
  29. if (string.IsNullOrEmpty(deviceID))
  30. {
  31. this.ResponseDefaultError();
  32. return;
  33. }
  34. /////////////////////////////////////////
  35. /////////////////////////////////////////
  36. if (!this.InitializeDataAccess())
  37. {
  38. this.ResponseDefaultError(PromptingMessage.Error_Data_Initialized);
  39. return;
  40. }
  41. ///找门口机
  42. ///
  43. ///获取数据区域
  44. ///
  45. if(!wd_PartInfoDataAccess.ext.bSuccess || wd_PartInfoDataAccess.ext.messageDataList.Count == 0)
  46. {
  47. this.ResponseDefaultError(PromptingMessage.Error_PartInfo);
  48. return;
  49. }
  50. WD_DeviceInfo wd_DeviceInfo = wd_DeviceInfoDataAccess.ext.messageDataList.Find(f => f.ID == deviceID);
  51. if (wd_DeviceInfo == null)
  52. {
  53. this.ResponseDefaultError(PromptingMessage.Error_DeviceInfo);
  54. return;
  55. }
  56. else
  57. {
  58. wd_PartInfoDataAccess.ext.messageDataList.ForEach(f => f.wardNum = wd_DeviceInfo.deviceRoomNum);
  59. wd_PartInfoDataAccess.ext.messageDataList.ForEach(f => f.roomByname = wd_DeviceInfo.DEVICE_NAME);
  60. }
  61. List<WD_DeviceInfo> listBedDevice = wd_DeviceInfoDataAccess.ext.messageDataList.FindAll(f => f.DEVICE_ROOM_ID == deviceID).OrderBy(f=>f.DEVICE_BED_NUM).ToList() ;
  62. /////////////////////////////////////////////////
  63. ////////////////////////////////////////////////
  64. foreach (WD_DeviceInfo wd in listBedDevice)
  65. {
  66. bedInfo bedInfo = new bedInfo();
  67. WD_PatientInfo wd_PatientInfo = wd_PatientInfoDataAccess.ext.messageDataList.Find(f => f.ID == wd.DEVICE_HUMAN_ID);
  68. if(wd_PatientInfo == null)
  69. {
  70. wd_PartInfoDataAccess.ext.messageDataList.ForEach(f => f.bedInfoList.Add(bedInfo));
  71. }
  72. else
  73. {
  74. bedInfo.DoctorID = wd_PatientInfo.PATIENT_DOCTOR_ID;
  75. bedInfo.NurseID = wd_PatientInfo.PATIENT_NURSE_ID;
  76. bedInfo.bedNum = wd.deviceBedNum;
  77. bedInfo.bedName = wd.DEVICE_BED_NAME;
  78. bedInfo.roomNum = wd.DEVICE_ROOM_NUM;
  79. bedInfo.bedStatus = Convert.ToInt32(wd.deviceHumanId) > 0 ? "1" : "0";
  80. bedInfo.HumanID = wd.deviceHumanId;
  81. bedInfo.babyName = wd_PatientInfo.PATIENT_BABYNAME;
  82. bedInfo.name = wd_PatientInfo.PATIENT_NAME;
  83. bedInfo.babySex = wd_PatientInfo.PATIENT_BABYSEX;
  84. bedInfo.avoidCertainFood = wd_PatientInfo.PATIENT_ILLNESS;
  85. List<WD_UrgeInfo> listUrgeInfo = wd_UrgeInfoDataAccess.ext.messageDataList.FindAll(f => f.URGE_PATIENT_ID == wd.DEVICE_HUMAN_ID);
  86. if (listUrgeInfo == null || listUrgeInfo.Count == 0)
  87. {
  88. }
  89. else
  90. {
  91. listUrgeInfo.ForEach(f => bedInfo.carefulMatter.Add(new CarefulMatter(){ item = f.URGE_VALUE }));
  92. }
  93. bedInfo.roomByname = wd.DEVICE_NAME;
  94. WD_StaffInfo wdStaffdoc = wd_StaffInfoDataAccess.ext.messageDataList.Find(f => f.ID == bedInfo.DoctorID);
  95. if (wdStaffdoc == null)
  96. {
  97. bedInfo.doctorName = "";
  98. bedInfo.doctorHeadIcon = "";
  99. }
  100. else
  101. {
  102. bedInfo.doctorName = wdStaffdoc.STAFF_NAME;
  103. bedInfo.doctorHeadIcon = wdStaffdoc.STAFF_PICTURE;
  104. }
  105. WD_StaffInfo wdStaffnur = wd_StaffInfoDataAccess.ext.messageDataList.Find(f => f.ID == bedInfo.NurseID);
  106. if (wdStaffnur == null)
  107. {
  108. bedInfo.nurseName = "";
  109. bedInfo.nurseHeadIcon = "";
  110. }
  111. else
  112. {
  113. bedInfo.nurseName = wdStaffnur.STAFF_NAME;
  114. bedInfo.nurseHeadIcon = wdStaffnur.STAFF_PICTURE;
  115. }
  116. wd_PartInfoDataAccess.ext.messageDataList.ForEach(f => f.bedInfoList.Add(bedInfo));
  117. }
  118. }
  119. ///////////////////////////////////////////////
  120. ////////////////////////////////////////////////
  121. Response.Write(JsonHelper.SerializeWithSuffix(wd_PartInfoDataAccess.ext.messageDataList[0]));
  122. WD_SysLogInfo wd_SysLogInfo = new WD_SysLogInfo();
  123. wd_SysLogInfo.LOG_TYPE = "3";
  124. wd_SysLogInfo.LOG_SOURCE = "门口机ID号【" + deviceID + "】";
  125. wd_SysLogInfo.LOG_CONTENT = "请求【设备配置】数据!" ;
  126. }
  127. }
  128. }