PowerMettersService.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. using System;
  2. using System.Collections.Generic;
  3. using Winsoft.GOV.Framework;
  4. using Winsoft.GOV.Framework.Model;
  5. using Winsoft.GOV.Framework.Provider;
  6. namespace Winsoft.GOV.WCF
  7. {
  8. // 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码和配置文件中的类名“Service1”。
  9. public class PowerMettersService : IPowerMettersService
  10. {
  11. public PagedResult<NotificationOfAction> GetNotifysPagedResultEx(int itemIndex, int size, County c = County.LS)
  12. {
  13. try
  14. {
  15. return ProvidersFactory.GetNotificationOfActionProvider(c).FindByPage(itemIndex, size);
  16. }
  17. catch (Exception e)
  18. {
  19. FunLib.Log(e.Message);
  20. return new PagedResult<NotificationOfAction>()
  21. {
  22. Data = new List<NotificationOfAction>()
  23. };
  24. }
  25. }
  26. public PagedResult<NotificationOfAction> GetUnreadNotifysPagedResultEx(int itemIndex, int size, County c = County.LS)
  27. {
  28. try
  29. {
  30. return ProvidersFactory.GetNotificationOfActionProvider(c).FindUnreadByPage(itemIndex, size);
  31. }
  32. catch (Exception e)
  33. {
  34. FunLib.Log(e.Message);
  35. return new PagedResult<NotificationOfAction>()
  36. {
  37. Data = new List<NotificationOfAction>()
  38. };
  39. }
  40. }
  41. public void ReadNotify(string ql_inner_code, County c = County.LS)
  42. {
  43. try
  44. {
  45. ProvidersFactory.GetNotificationOfActionProvider(c).Read(ql_inner_code);
  46. }
  47. catch (Exception e)
  48. {
  49. FunLib.Log(e.Message);
  50. }
  51. }
  52. public PagedResult<NotificationOfAction> GetUnreadNotifysPagedResultByQL_KindEx(string key, int itemIndex, int size, string[] ql_kinds, bool isHidRead, County c = County.LS)
  53. {
  54. try
  55. {
  56. return ProvidersFactory.GetNotificationOfActionProvider(c).FindByPage(key, itemIndex, size, ql_kinds, isHidRead);
  57. }
  58. catch (Exception e)
  59. {
  60. FunLib.Log(e.Message);
  61. return new PagedResult<NotificationOfAction>()
  62. {
  63. Data = new List<NotificationOfAction>()
  64. };
  65. }
  66. }
  67. public int GetUnreadCount(County c = County.LS)
  68. {
  69. try
  70. {
  71. return ProvidersFactory.GetNotificationOfActionProvider(c).UnreadCount();
  72. }
  73. catch (Exception e)
  74. {
  75. FunLib.Log(e.Message);
  76. return 0;
  77. }
  78. }
  79. public PagedResult<PowerMattersBase> SearchByKeyPagedResultEx(string key, int itemIndex, int size, County c = County.LS)
  80. {
  81. try
  82. {
  83. return ProvidersFactory.GetPowerMettersBaseProvider(c).FindByPage(key, itemIndex, size);
  84. }
  85. catch (Exception e)
  86. {
  87. FunLib.Log(e.Message);
  88. return new PagedResult<PowerMattersBase>()
  89. {
  90. Data = new List<PowerMattersBase>()
  91. };
  92. }
  93. }
  94. public PagedResult<PowerMattersBase> GetPowerMatterBasesByQL_KindEx(string key, int itemIndex, int size, string[] ql_kinds, County c = County.LS)
  95. {
  96. try
  97. {
  98. return ProvidersFactory.GetPowerMettersBaseProvider(c).FindByPage(key, itemIndex, size, ql_kinds);
  99. }
  100. catch (Exception e)
  101. {
  102. FunLib.Log(e.Message);
  103. return new PagedResult<PowerMattersBase>()
  104. {
  105. Data = new List<PowerMattersBase>()
  106. };
  107. }
  108. }
  109. public PagedResult<PowerMattersBase> GetPowerMatterBasesEx(int itemIndex, int size, County c = County.LS)
  110. {
  111. try
  112. {
  113. return ProvidersFactory.GetPowerMettersBaseProvider(c).FindByPage(itemIndex, size);
  114. }
  115. catch (Exception e)
  116. {
  117. FunLib.Log(e.Message);
  118. return new PagedResult<PowerMattersBase>()
  119. {
  120. Data = new List<PowerMattersBase>()
  121. };
  122. }
  123. }
  124. /// <summary>
  125. /// 获取所有部门
  126. /// </summary>
  127. /// <returns></returns>
  128. public IEnumerable<Branch> GetBranchsEx(County c)
  129. {
  130. IEnumerable<Branch> r = null;
  131. try
  132. {
  133. r = ProvidersFactory.GetBranchProvider(c).FindAll();
  134. if (r == null)
  135. return new List<Branch>();
  136. return r;
  137. }
  138. catch (Exception e)
  139. {
  140. FunLib.Log(e.Message);
  141. if (r == null)
  142. return new List<Branch>();
  143. return r;
  144. }
  145. }
  146. /// <summary>
  147. /// 获取所有部门及部门事项统计出数量
  148. /// </summary>
  149. /// <returns></returns>
  150. public IEnumerable<Branch> GetBranchsAndSumMattersEx(County c)
  151. {
  152. IEnumerable<Branch> r = null;
  153. try
  154. {
  155. r = ProvidersFactory.GetBranchProvider(c).FindBranchsAndSumMatters();
  156. if (r == null)
  157. return new List<Branch>();
  158. return r;
  159. }
  160. catch (Exception e)
  161. {
  162. FunLib.Log(e.Message);
  163. if (r == null)
  164. return new List<Branch>();
  165. return r;
  166. }
  167. }
  168. /// <summary>
  169. /// 获取最多跑一次部门
  170. /// </summary>
  171. /// <returns></returns>
  172. public IEnumerable<Branch> GetOnceRunBranchsEx(County c)
  173. {
  174. IEnumerable<Branch> r = null;
  175. try
  176. {
  177. r = ProvidersFactory.GetBranchProvider(c).FindOnceRunBranch();
  178. if (r == null)
  179. return new List<Branch>();
  180. return r;
  181. }
  182. catch (Exception e)
  183. {
  184. FunLib.Log(e.Message);
  185. if (r == null)
  186. return new List<Branch>();
  187. return r;
  188. }
  189. }
  190. /// <summary>
  191. /// 按实现方式获取部门,数据来源实现方式表
  192. /// </summary>
  193. /// <param name="type"></param>
  194. /// <returns></returns>
  195. public IEnumerable<Branch> GetBranchsByApplyTypeEx(int type, County c)
  196. {
  197. IEnumerable<Branch> r = null;
  198. try
  199. {
  200. r = ProvidersFactory.GetBranchProvider(c).FindByApplyType(type);
  201. if (r == null)
  202. return new List<Branch>();
  203. return r;
  204. }
  205. catch (Exception e)
  206. {
  207. FunLib.Log(e.Message);
  208. if (r == null)
  209. return new List<Branch>();
  210. return r;
  211. }
  212. }
  213. /// <summary>
  214. /// 通过部门guid获取部门的权力清单,来源于权力清单(全部)表
  215. /// </summary>
  216. /// <param name="guid"></param>
  217. /// <returns></returns>
  218. public IEnumerable<PowerMattersBase> GetPowerMattersByBranchGuidEx(string guid, County c)
  219. {
  220. IEnumerable<PowerMattersBase> r = null;
  221. try
  222. {
  223. r = ProvidersFactory.GetPowerMettersBaseProvider(c).FindByBranchGUID(guid);
  224. if (r == null)
  225. return new List<PowerMattersBase>();
  226. return r;
  227. }
  228. catch (Exception e)
  229. {
  230. FunLib.Log(e.Message);
  231. if (r == null)
  232. return new List<PowerMattersBase>();
  233. return r;
  234. }
  235. }
  236. public PagedResult<PowerMattersBase> GetPowerMattersByBranchGuidPagedResultEx(string guid, int itemIndex, int size, County c = County.LS)
  237. {
  238. try
  239. {
  240. return ProvidersFactory.GetPowerMettersBaseProvider(c).FindByPage(itemIndex, size, guid);
  241. }
  242. catch (Exception e)
  243. {
  244. FunLib.Log(e.Message);
  245. return new PagedResult<PowerMattersBase>()
  246. {
  247. Data = new List<PowerMattersBase>()
  248. };
  249. }
  250. }
  251. /// <summary>
  252. /// 通过部门guid,获取最多跑一次事项
  253. /// </summary>
  254. /// <param name="guid"></param>
  255. /// <returns></returns>
  256. public IEnumerable<PowerMattersBase> GetOnceRunPowerMattersByBranchGuidEx(string guid, County c)
  257. {
  258. IEnumerable<PowerMattersBase> r = null;
  259. try
  260. {
  261. r = ProvidersFactory.GetOnceRunPowerMattersProvider(c).FindOnceRunPowerMattersByBranchGUID(guid);
  262. if (r == null)
  263. return new List<PowerMattersBase>();
  264. return r;
  265. }
  266. catch(Exception e)
  267. {
  268. FunLib.Log(e.Message);
  269. if (r == null)
  270. return new List<PowerMattersBase>();
  271. return r;
  272. }
  273. }
  274. public PagedResult<PowerMattersBase> GetOnceRunPowerMattersByBranchGuidPagedResultEx(string guid, int itemIndex, int size, County c = County.LS)
  275. {
  276. try
  277. {
  278. return ProvidersFactory.GetOnceRunPowerMattersProvider(c).FindByPage(itemIndex, size, guid);
  279. }
  280. catch (Exception e)
  281. {
  282. FunLib.Log(e.Message);
  283. return new PagedResult<PowerMattersBase>()
  284. {
  285. Data = new List<PowerMattersBase>()
  286. };
  287. }
  288. }
  289. /// <summary>
  290. /// 通过部门guid和实现方式type,获取权力事项,数据来源实现方式表
  291. /// </summary>
  292. /// <param name="guid"></param>
  293. /// <param name="type"></param>
  294. /// <returns></returns>
  295. public IEnumerable<PowerMattersBase> GetPowerMattersByBranchGuidAndApplyTypeEx(string guid, int type, County c)
  296. {
  297. IEnumerable<PowerMattersBase> r = null;
  298. try
  299. {
  300. r = ProvidersFactory.GetOnceRunPowerMattersProvider(c).FindByBranchGUIDAndApplyType(guid, type);
  301. if (r == null)
  302. return new List<PowerMattersBase>();
  303. return r;
  304. }
  305. catch (Exception e)
  306. {
  307. FunLib.Log(e.Message);
  308. if (r == null)
  309. return new List<PowerMattersBase>();
  310. return r;
  311. }
  312. }
  313. /// <summary>
  314. /// 通过部门guid和权力类型kind,获取权力事项,数据来源权力清单(全部)表
  315. /// </summary>
  316. /// <param name="guid"></param>
  317. /// <param name="ql_kind"></param>
  318. /// <returns></returns>
  319. public IEnumerable<PowerMattersBase> GetPowerMattersEx(string guid, string ql_kind, County c)
  320. {
  321. IEnumerable<PowerMattersBase> r = null;
  322. try
  323. {
  324. r = ProvidersFactory.GetPowerMettersBaseProvider(c).Find(guid, ql_kind);
  325. if (r == null)
  326. return new List<PowerMattersBase>();
  327. return r;
  328. }
  329. catch (Exception e)
  330. {
  331. FunLib.Log(e.Message);
  332. if (r == null)
  333. return new List<PowerMattersBase>();
  334. return r;
  335. }
  336. }
  337. public PowerMattersDetail GetPowerMattersDetailByRowIDEx(string rowID, County c)
  338. {
  339. PowerMattersDetail r = null;
  340. try
  341. {
  342. r = ProvidersFactory.GetPowerMettersDetailProvider(c).FindByRowID(rowID);
  343. //if (r == null)
  344. // r = new PowerMattersDetail();
  345. return r;
  346. }
  347. catch (Exception e)
  348. {
  349. FunLib.Log(e.Message);
  350. //if (r == null)
  351. // r = new PowerMattersDetail();
  352. return null;
  353. }
  354. }
  355. public IEnumerable<PowerMattersBase> SearchByQLNameEx(string ql_name, int itemIndex, int size, County c)
  356. {
  357. try
  358. {
  359. return ProvidersFactory.GetPowerMettersBaseProvider(c).Search(ql_name, itemIndex, size);
  360. }
  361. catch (Exception e)
  362. {
  363. FunLib.Log(e.Message);
  364. return new List<PowerMattersBase>();
  365. }
  366. }
  367. public IEnumerable<Branch> GetBranchs()
  368. {
  369. return GetBranchsEx(County.LS);
  370. }
  371. public IEnumerable<PowerMattersBase> GetPowerMattersByBranchGuid(string guid)
  372. {
  373. return GetPowerMattersByBranchGuidEx(guid, County.LS);
  374. }
  375. public PowerMattersDetail GetPowerMattersDetailByRowID(string rowID)
  376. {
  377. return GetPowerMattersDetailByRowIDEx(rowID, County.LS);
  378. }
  379. public IEnumerable<PowerMattersBase> GetPowerMatters(string guid, string ql_kind)
  380. {
  381. return GetPowerMattersEx(guid, ql_kind, County.LS);
  382. }
  383. public IEnumerable<Branch> GetBranchsByApplyType(int type)
  384. {
  385. return GetBranchsByApplyTypeEx(type, County.LS);
  386. }
  387. public IEnumerable<PowerMattersBase> GetPowerMattersByBranchGuidAndApplyType(string guid, int type)
  388. {
  389. return GetPowerMattersByBranchGuidAndApplyTypeEx(guid, type, County.LS);
  390. }
  391. public IEnumerable<PowerMattersBase> SearchByQLName(string ql_name, int itemIndex, int size)
  392. {
  393. return SearchByQLNameEx(ql_name, itemIndex, size, County.LS);
  394. }
  395. public IEnumerable<Branch> GetOnceRunBranchs()
  396. {
  397. return GetOnceRunBranchsEx(County.LS);
  398. }
  399. public IEnumerable<PowerMattersBase> GetOnceRunPowerMattersByBranchGuid(string guid)
  400. {
  401. return GetOnceRunPowerMattersByBranchGuidEx(guid, County.LS);
  402. }
  403. }
  404. }