QueryDataServiceClient.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using Aitex.Core.RT.Event;
  5. using Aitex.Core.RT.IOCore;
  6. using Aitex.Core.RT.SCCore;
  7. using Aitex.Core.UI.ControlDataContext;
  8. using Aitex.Core.Util;
  9. using Aitex.Core.WCF;
  10. using Aitex.Sorter.Common;
  11. using MECF.Framework.Common.CommonData;
  12. using MECF.Framework.Common.IOCore;
  13. namespace MECF.Framework.Common.DataCenter
  14. {
  15. public class QueryDataClient : Singleton<QueryDataClient>
  16. {
  17. public bool InProcess { get; set; }
  18. private IQueryDataService _service;
  19. public IQueryDataService Service
  20. {
  21. get
  22. {
  23. if (_service == null)
  24. {
  25. if (InProcess)
  26. _service = new QueryDataService();
  27. else
  28. _service = new QueryDataServiceClient();
  29. }
  30. return _service;
  31. }
  32. }
  33. }
  34. public class QueryDataServiceClient : ServiceClientWrapper<IQueryDataService>, IQueryDataService
  35. {
  36. public QueryDataServiceClient()
  37. : base("Client_IQueryDataService", "QueryDataService")
  38. {
  39. }
  40. public Dictionary<string, object> PollData(IEnumerable<string> keys)
  41. {
  42. Dictionary<string, object> result = null;
  43. Invoke(svc => {
  44. result = svc.PollData(keys); });
  45. return result;
  46. }
  47. public Dictionary<string, object> PollConfig(IEnumerable<string> keys)
  48. {
  49. Dictionary<string, object> result = null;
  50. Invoke(svc => { result = svc.PollConfig(keys); });
  51. return result;
  52. }
  53. public Dictionary<string, object> PollConfigByModule(string module, IEnumerable<string> keys)
  54. {
  55. Dictionary<string, object> result = null;
  56. Invoke(svc => { result = svc.PollConfigByModule(module, keys); });
  57. return result;
  58. }
  59. public object GetData(string key)
  60. {
  61. object result = null;
  62. Invoke(svc => { result = svc.GetData(key); });
  63. return result;
  64. }
  65. public object GetConfig(string key)
  66. {
  67. object result = null;
  68. Invoke(svc => { result = svc.GetConfig(key); });
  69. return result;
  70. }
  71. public void SetItemValue(string key,int value)
  72. {
  73. Invoke(svc => { svc.SetItemValue(key,value); });
  74. }
  75. public object GetConfigByModule(string module, string key)
  76. {
  77. object result = null;
  78. Invoke(svc => { result = svc.GetConfigByModule(module, key); });
  79. return result;
  80. }
  81. public string GetConfigFileContent()
  82. {
  83. string result = null;
  84. Invoke(svc => { result = svc.GetConfigFileContent(); });
  85. return result;
  86. }
  87. public string GetConfigFileContentByModule(string module)
  88. {
  89. string result = null;
  90. Invoke(svc => { result = svc.GetConfigFileContentByModule(module); });
  91. return result;
  92. }
  93. public List<SCConfigItem> GetConfigItemList()
  94. {
  95. List<SCConfigItem> result = null;
  96. Invoke(svc => { result = svc.GetConfigItemList(); });
  97. return result;
  98. }
  99. public List<EventItem> QueryDBEvent(string sql)
  100. {
  101. List<EventItem> result = null;
  102. Invoke(svc => { result = svc.QueryDBEvent(sql); });
  103. return result;
  104. }
  105. public int GetCount(string sql)
  106. {
  107. int result = 0;
  108. Invoke(svc => { result = svc.GetCount(sql); });
  109. return result;
  110. }
  111. public List<HistoryCarrierData> QueryDBCarrier(string sql)
  112. {
  113. List<HistoryCarrierData> result = null;
  114. Invoke(svc => { result = svc.QueryDBCarrier(sql); });
  115. return result;
  116. }
  117. public List<HistoryProcessData> QueryDBProcessCarrier(string sql)
  118. {
  119. List<HistoryProcessData> result = null;
  120. Invoke(svc => { result = svc.QueryDBProcessCarrier(sql); });
  121. return result;
  122. }
  123. public List<HistoryProcessData> QueryDBProcessLot(string sql)
  124. {
  125. List<HistoryProcessData> result = null;
  126. Invoke(svc => { result = svc.QueryDBProcessLot(sql); });
  127. return result;
  128. }
  129. public List<HistoryStatisticsOCRData> QueryDBOCRStatistics(string sql)
  130. {
  131. List<HistoryStatisticsOCRData> result = null;
  132. Invoke(svc => { result = svc.QueryDBOCRStatistics(sql); });
  133. return result;
  134. }
  135. public List<HistoryOCRData> QueryDBOCRHistory(string sql)
  136. {
  137. List<HistoryOCRData> result = null;
  138. Invoke(svc => { result = svc.QueryDBOCRHistory(sql); });
  139. return result;
  140. }
  141. public List<HistoryFfuDiffPressureData> QueryDBFfuDiffPressureStatistics(string sql)
  142. {
  143. List<HistoryFfuDiffPressureData> result = null;
  144. Invoke(svc => { result = svc.QueryDBFfuDiffPressureStatistics(sql); });
  145. return result;
  146. }
  147. public List<StatsStatisticsData> QueryStatsDBStatistics(string sql)
  148. {
  149. List<StatsStatisticsData> result = null;
  150. Invoke(svc => { result = svc.QueryStatsDBStatistics(sql); });
  151. return result;
  152. }
  153. public List<HistoryProcessData> QueryDBProcess(string sql)
  154. {
  155. List<HistoryProcessData> result = null;
  156. Invoke(svc => { result = svc.QueryDBProcess(sql); });
  157. return result;
  158. }
  159. public List<HistoryWaferData> QueryDBWafer(string sql)
  160. {
  161. List<HistoryWaferData> result = null;
  162. Invoke(svc => { result = svc.QueryDBWafer(sql); });
  163. return result;
  164. }
  165. public List<HistoryMoveData> QueryDBMovement(string sql)
  166. {
  167. List<HistoryMoveData> result = null;
  168. Invoke(svc => { result = svc.QueryDBMovement(sql); });
  169. return result;
  170. }
  171. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuid(string jobGuid)
  172. {
  173. List<HistoryJobMoveData> result = null;
  174. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuid(jobGuid); });
  175. return result;
  176. }
  177. public List<HistoryJobMoveData> QueryDBJobMovementByJobGuidAndStationName(string jobGuid, string stationName)
  178. {
  179. List<HistoryJobMoveData> result = null;
  180. Invoke(svc => { result = svc.QueryDBJobMovementByJobGuidAndStationName(jobGuid, stationName); });
  181. return result;
  182. }
  183. public List<HistoryDataItem> GetOneDayHistoryData(IEnumerable<string> keys, DateTime begin, string module)
  184. {
  185. List<HistoryDataItem> result = null;
  186. Invoke(svc => { result = svc.GetOneDayHistoryData(keys, begin, module); });
  187. return result;
  188. }
  189. public List<HistoryDataItem> GetHistoryDataFromStartToEnd(IEnumerable<string> keys, DateTime begin, DateTime end, string module)
  190. {
  191. List<HistoryDataItem> result = null;
  192. Invoke(svc => { result = svc.GetHistoryDataFromStartToEnd(keys, begin, end, module); });
  193. return result;
  194. }
  195. public DataTable QueryData(string sql)
  196. {
  197. DataTable result = null;
  198. Invoke(svc => { result = svc.QueryData(sql); });
  199. return result;
  200. }
  201. public List<HistoryDataItem> GetHistoryData(IEnumerable<string> keys, string recipeRunGuid, string module)
  202. {
  203. List<HistoryDataItem> result = null;
  204. Invoke(svc => { result = svc.GetHistoryData(keys, recipeRunGuid, module); });
  205. return result;
  206. }
  207. public List<NotifiableIoItem> GetDiList(string key)
  208. {
  209. List<NotifiableIoItem> result = null;
  210. Invoke(svc => { result = svc.GetDiList(key); });
  211. return result;
  212. }
  213. public List<NotifiableIoItem> GetDoList(string key)
  214. {
  215. List<NotifiableIoItem> result = null;
  216. Invoke(svc => { result = svc.GetDoList(key); });
  217. return result;
  218. }
  219. public List<NotifiableIoItem> GetAiList(string key)
  220. {
  221. List<NotifiableIoItem> result = null;
  222. Invoke(svc => { result = svc.GetAiList(key); });
  223. return result;
  224. }
  225. public List<NotifiableIoItem> GetAoList(string key)
  226. {
  227. List<NotifiableIoItem> result = null;
  228. Invoke(svc => { result = svc.GetAoList(key); });
  229. return result;
  230. }
  231. public List<WaferHistoryWafer> GetWaferHistoryWafers(string id)
  232. {
  233. List<WaferHistoryWafer> result = null;
  234. Invoke(svc => { result = svc.GetWaferHistoryWafers(id); });
  235. return result;
  236. }
  237. public WaferHistoryRecipe GetWaferHistoryRecipe(string id)
  238. {
  239. WaferHistoryRecipe result = null;
  240. Invoke(svc => { result = svc.GetWaferHistoryRecipe(id); });
  241. return result;
  242. }
  243. public List<WaferHistoryRecipe> GetWaferHistoryRecipes(string id)
  244. {
  245. List<WaferHistoryRecipe> result = null;
  246. Invoke(svc => { result = svc.GetWaferHistoryRecipes(id); });
  247. return result;
  248. }
  249. public List<WaferHistoryMovement> GetWaferHistoryMovements(string id)
  250. {
  251. List<WaferHistoryMovement> result = null;
  252. Invoke(svc => { result = svc.GetWaferHistoryMovements(id); });
  253. return result;
  254. }
  255. public List<WaferHistoryLot> QueryWaferHistoryLotsBySql(string sql)
  256. {
  257. List<WaferHistoryLot> result = null;
  258. Invoke(svc => { result = svc.QueryWaferHistoryLotsBySql(sql); });
  259. return result;
  260. }
  261. public List<WaferHistoryLot> GetWaferHistoryLots(DateTime startTime, DateTime endTime, string keyWord)
  262. {
  263. List<WaferHistoryLot> result = null;
  264. Invoke(svc => { result = svc.GetWaferHistoryLots(startTime, endTime, keyWord); });
  265. return result;
  266. }
  267. public string GetTypedConfigContent(string type, string contentPath)
  268. {
  269. string result = null;
  270. Invoke(svc => { result = svc.GetTypedConfigContent(type, contentPath); });
  271. return result;
  272. }
  273. public void SetTypedConfigContent(string type, string contentPath, string content)
  274. {
  275. Invoke(svc => { svc.SetTypedConfigContent(type, contentPath, content); });
  276. }
  277. public List<WaferHistorySecquence> GetWaferHistorySecquences(string id)
  278. {
  279. List<WaferHistorySecquence> result = null;
  280. Invoke(svc => { result = svc.GetWaferHistorySecquences(id); });
  281. return result;
  282. }
  283. public List<LeakCheckResultItem> GetHistoryLeakCheck(string Module)
  284. {
  285. List<LeakCheckResultItem> result = null;
  286. Invoke(svc =>
  287. {
  288. result = svc.GetHistoryLeakCheck(Module);
  289. });
  290. return result;
  291. }
  292. }
  293. }