using System.Web; using System.Data; using System; using System.IO; using System.Collections.Generic; namespace FangYar.WebUI.Handle { /// /// VISGDT 的摘要说明 根据人证机设备编号 获取部门、人员Tree /// public class LSTQYZVIShostDept : IHttpHandler { private FangYar.BLL.FIRE.FIRE_ORG dbll = new FangYar.BLL.FIRE.FIRE_ORG(); private FangYar.BLL.OA.TBL_EPUIP_ORG eobll = new FangYar.BLL.OA.TBL_EPUIP_ORG(); public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string returnStr = ""; returnStr = ReceiveAlarmInfoPlate(context); context.Response.Write(returnStr); } //硬件接口: //根据人证机设备编号 获取Tree 本机构下-部门-员工(获取UID) private string ReceiveAlarmInfoPlate(HttpContext context) { string returnstr = ""; try { string EpuId = context.Request.Params["deviceNumber"]; string OrgId = ""; WriteLog("EpuId:"+ EpuId); FangYar.Model.OA.TBL_EPUIP_ORG eoModel = eobll.EpuIdGetModel(EpuId); if (eoModel.ORG_ID == null || eoModel.ORG_ID == "") { OrgId = "021933cc9b11441c920a431eeffe60c2"; } if (OrgId != null || OrgId != "") { returnstr = "{\"code\":200,\"msg\":\"success\",\"data\":["; DataTable data = dbll.HardGetDeptListTreeByOrgId(OrgId); for (int i= 0; i /// 记录日志 /// /// private void WriteLog(string msg) { FangYar.Common.MyLogHelper.WriteMsg(new FangYar.Common.LogInfoMo() { message = msg, msgType = FangYar.Common.EnumLogMsgTypeEnum.Error, path = "VIShostDept" }); //string path = AppDomain.CurrentDomain.BaseDirectory + "log\\VIShostDept\\"; //string filename = DateTime.Now.ToString("yyyyMMdd") + ".txt"; //if (Directory.Exists(path) == false)//如果不存在就创建文件夹 //{ // Directory.CreateDirectory(path); //} //FileInfo file = new FileInfo(path + filename); //if (!file.Exists) //{ // FileStream fs; // fs = File.Create(path + filename); // fs.Close(); //} //using (FileStream fs = new FileStream(path + filename, FileMode.Append, FileAccess.Write)) //{ // using (StreamWriter sw = new StreamWriter(fs)) // { // sw.WriteLine("时间:" + DateTime.Now.ToString() + " 信息:" + msg); // } //} } public bool IsReusable { get { return false; } } } }