using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using Cosmos.UserFrame; using Cosmos.BaseFrame; using Cosmos.ServiceProvider; using Cosmos.Common; using Cosmos.CommonManager; /*-----------------------------------------------------------------------------------------------*/ // 설 명 : 점착정보 조회 // 작 성 자 : // 변경 이력 : /*-----------------------------------------------------------------------------------------------*/ namespace Cosmos.Service { class SchStorArrvInfo : IStorArrvList { private SManager sManager = new SManager(); // 이 객체를 통해 업무 Service 호출 private StateServer StateObject = (StateServer)StateServer.GetInstance(); // StateObject : StateServer Object (객체) private PosStatus m_cPosStatus = new PosStatus(); // 기본정보 참조 private TranStatus m_cTrnStatus = new TranStatus(); // 거래정보 참조 private IMasterUs m_cMstService = null; // 마스터 인터페이스 private INetworkHttp m_cNetworkHttp = null; private IPosPrinterUs m_cPrinterUs = null; private IDataServiceUs m_cWebBiz = null; // WEB 정보 서비스 /// /// 생성자 /// public SchStorArrvInfo() { m_cPosStatus = (PosStatus)StateObject.POS; // POS 기본정보 m_cNetworkHttp = (INetworkHttp)sManager.InitServiceInstance(ServiceLists.AGENT_NETWORK.DLL, ServiceLists.AGENT_NETWORK.NETWORK_HTTP); m_cPrinterUs = (IPosPrinterUs)sManager.InitServiceInstance(ServiceLists.AGENT_OLEDEVICE.DLL, ServiceLists.AGENT_OLEDEVICE.DEVICE_POSPRINTER); m_cMstService = (IMasterUs)sManager.InitServiceInstance(ServiceLists.ASV_MASTER.DLL, ServiceLists.ASV_MASTER.POS_MASTER); m_cWebBiz = (IDataServiceUs)sManager.InitServiceInstance(ServiceLists.BSV_BASIC.DLL, ServiceLists.BSV_BASIC.WEB_POS); } /// /// 점착정보 Http 통신 /// /// /// public string SendReceiveForStorArrInfo(object[] aParam, ref DataTable htResponse, ref int iReturn) { string sUrl; string sWorkType; Hashtable htRequest; Hashtable[] htReturn = null; int iRet = BaseCom.NG; string sArrInfo = string.Empty; string sArrInfoURL = string.Empty; string sArrInfoParm = string.Empty; string[] sCol = null; iReturn = -99; try { sArrInfo = (string)m_cWebBiz.GetData(new string[] { PosKey.MENU_KEY.WEB_STOR_ARRV_INFO }); if (sArrInfo != null && sArrInfo != "") { sArrInfoURL = CmUtil.MidH(sArrInfo, 31, 100).Trim(); sArrInfoParm = CmUtil.MidH(sArrInfo, 131, 100).Trim(); if (sArrInfoParm.StartsWith("?") == true) { sArrInfoParm = CmUtil.MidH(sArrInfo, 132, 99).Trim(); } } string sResp = string.Empty; //if ((iRet = m_cNetworkHttp.HttpGET_SendReceive("http://upos.paris.co.kr", "/EXEC_WPOS/ORDR/ORDR2000L0.jsp", "gubun=2&store_cd=0000013666", PosConst.ENCODING_FLAG.KSC, ref sResp)) == BaseCom.OK) if ((iRet = m_cNetworkHttp.HttpGET_SendReceive(sArrInfoURL, "", sArrInfoParm, PosConst.ENCODING_FLAG.KSC, ref sResp)) == BaseCom.OK) { //htReturn = JsonConvert.DeserializeObject(sResp); sCol = sResp.Split(new string[] { "" }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < sCol.Count() - 1 ; i++) { DataRow dr = htResponse.NewRow(); dr["cnt"] = i + 1; int nStartIndex = sCol[i].IndexOf("") + 7; int nEndIndex = sCol[i].IndexOf(""); dr["d_day"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["cust_name"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["car_code"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["car_number"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["driver_name"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["hand_phone"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["center_name"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["center_departure_time"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["center_arrival_time"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["course_name"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["course_type"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["last_location"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["last_location_time"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["cust_pre_arrival_time"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["cust_arrival_time"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["cust_departure_time"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["last_via_cust_name"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["last_via_cust_arrival_time"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["last_via_cust_departure_time"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["current_car_status"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); nStartIndex = sCol[i].IndexOf("") + "".Length; nEndIndex = sCol[i].IndexOf(""); dr["current_cust_status"] = sCol[i].Substring(nStartIndex, nEndIndex - nStartIndex); htResponse.Rows.Add(dr); } //htResponse.Rows.Add(dr); } iReturn = iRet; } catch (Exception ex) { UserLog.WriteLogFile(UserCom.LOG_ERROR, System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, // Project Name (프로젝트명) System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + // Class Name (Class Name (클래스명)) System.Reflection.MethodBase.GetCurrentMethod().Name + "()", // Function Name (Function Name (함수명)) ex.Message); } return ""; } /// /// 웹 업무 URL 가져오기 /// /// /// public object GetData(string[] aParam) { string sQuery = ""; try { sQuery += " SELECT CMP_CD"; sQuery += " , STOR_CD"; sQuery += " , SEQ_NO"; sQuery += " , DIV"; sQuery += " , DISP_SEQ"; sQuery += " , DISP_YN"; sQuery += " , MENU_NM"; sQuery += " , WEB_MENU_ID"; sQuery += " , FUNC_ID"; sQuery += " , PARAM"; sQuery += " , FILLER1"; sQuery += " , FILLER2"; sQuery += " , FILLER3"; sQuery += " , FILLER4"; sQuery += " , FILLER5"; sQuery += " FROM POSMST..MST_WEB_LNKAGE "; sQuery += " WHERE CMP_CD = '" + m_cPosStatus.Base.CmpCd + "'"; sQuery += " AND STOR_CD = '" + m_cPosStatus.Base.StoreNo + "'"; sQuery += " AND FUNC_ID = '" + aParam[0] + "'"; DataTable dtDataInfo = m_cMstService.Select(new string[] { sQuery }); return dtDataInfo; } catch (Exception ex) { WinManager.ExceptionMessage(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.Name, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name + "()", ex.Message); } return null; } } }