You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WfSchemeService.cs 23 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. 
  2. using Learun.DataBase.Repository;
  3. using Learun.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Text;
  8. namespace Learun.Application.WorkFlow
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创建人:陈彬彬
  14. /// 日 期:2017.04.17
  15. /// 描 述:工作流模板处理
  16. /// </summary>
  17. public class WfSchemeService : RepositoryFactory
  18. {
  19. #region 属性 构造函数
  20. private string schemeInfoFieldSql;
  21. private string schemeFieldSql;
  22. public WfSchemeService()
  23. {
  24. schemeInfoFieldSql = @"
  25. t.F_Id,
  26. t.F_Code,
  27. t.F_Name,
  28. t.F_Category,
  29. t.F_Kind,
  30. t.F_SchemeId,
  31. t.F_DeleteMark,
  32. t.F_EnabledMark,
  33. t.F_Description
  34. ";
  35. schemeFieldSql = @"
  36. t.F_Id,
  37. t.F_SchemeInfoId,
  38. t.F_Type,
  39. t.F_CreateDate,
  40. t.F_CreateUserId,
  41. t.F_CreateUserName
  42. ";
  43. }
  44. #endregion
  45. #region 获取数据
  46. /// <summary>
  47. /// 获取流程分页列表
  48. /// </summary>
  49. /// <param name="pagination">分页参数</param>
  50. /// <param name="keyword">关键字</param>
  51. /// <param name="category">分类</param>
  52. /// <returns></returns>
  53. public IEnumerable<WfSchemeInfoEntity> GetSchemeInfoPageList(Pagination pagination, string keyword, string category)
  54. {
  55. try
  56. {
  57. var strSql = new StringBuilder();
  58. strSql.Append("SELECT ");
  59. strSql.Append(schemeInfoFieldSql);
  60. strSql.Append(",t1.F_Type,t1.F_CreateDate,t1.F_CreateUserId,t1.F_CreateUserName ");
  61. strSql.Append(" FROM LR_WF_SchemeInfo t LEFT JOIN LR_WF_Scheme t1 ON t.F_SchemeId = t1.F_Id WHERE 1=1 AND t.F_DeleteMark = 0 ");
  62. if (!string.IsNullOrEmpty(keyword))
  63. {
  64. strSql.Append(" AND ( t.F_Name like @keyword OR t.F_Code like @keyword ) ");
  65. keyword = "%" + keyword + "%";
  66. }
  67. if (!string.IsNullOrEmpty(category))
  68. {
  69. strSql.Append(" AND t.F_Category = @category ");
  70. }
  71. return this.BaseRepository().FindList<WfSchemeInfoEntity>(strSql.ToString(), new { keyword = keyword, category = category }, pagination);
  72. }
  73. catch (Exception ex)
  74. {
  75. if (ex is ExceptionEx)
  76. {
  77. throw;
  78. }
  79. else
  80. {
  81. throw ExceptionEx.ThrowServiceException(ex);
  82. }
  83. }
  84. }
  85. /// <summary>
  86. /// 获取流程模板分页列表
  87. /// </summary>
  88. /// <param name="pagination">分页参数</param>
  89. /// <param name="userInfo">登录者信息</param>
  90. /// <param name="queryJson">查询参数</param>
  91. /// <returns></returns>
  92. public IEnumerable<WfSchemeInfoEntity> GetAppSchemeInfoPageList(Pagination pagination, UserInfo userInfo, string queryJson)
  93. {
  94. try
  95. {
  96. string userId = userInfo.userId;
  97. string postIds = userInfo.postIds;
  98. string roleIds = userInfo.roleIds;
  99. List<WfSchemeAuthorizeEntity> list = (List<WfSchemeAuthorizeEntity>)this.BaseRepository().FindList<WfSchemeAuthorizeEntity>(t => t.F_ObjectId == null
  100. || userId.Contains(t.F_ObjectId)
  101. || postIds.Contains(t.F_ObjectId)
  102. || roleIds.Contains(t.F_ObjectId)
  103. );
  104. string schemeinfoIds = "";
  105. foreach (var item in list)
  106. {
  107. schemeinfoIds += "'" + item.F_SchemeInfoId + "',";
  108. }
  109. schemeinfoIds = "(" + schemeinfoIds.Remove(schemeinfoIds.Length - 1, 1) + ")";
  110. var strSql = new StringBuilder();
  111. strSql.Append("SELECT ");
  112. strSql.Append(schemeInfoFieldSql);
  113. strSql.Append(" FROM LR_WF_SchemeInfo t WHERE 1=1 AND t.F_DeleteMark = 0 AND t.F_EnabledMark = 1 AND t.F_Kind = 1 AND F_IsApp = 1 AND t.F_Id in " + schemeinfoIds);
  114. var queryParam = queryJson.ToJObject();
  115. string keyword = "";
  116. if (!queryParam["keyword"].IsEmpty())
  117. {
  118. strSql.Append(" AND ( t.F_Name like @keyword OR t.F_Code like @keyword ) ");
  119. keyword = "%" + queryParam["keyword"].ToString() + "%";
  120. }
  121. return this.BaseRepository().FindList<WfSchemeInfoEntity>(strSql.ToString(), new { keyword }, pagination);
  122. }
  123. catch (Exception ex)
  124. {
  125. if (ex is ExceptionEx)
  126. {
  127. throw;
  128. }
  129. else
  130. {
  131. throw ExceptionEx.ThrowServiceException(ex);
  132. }
  133. }
  134. }
  135. /// <summary>
  136. /// 获取自定义流程列表
  137. /// </summary>
  138. /// <param name="userInfo">用户信息</param>
  139. /// <returns></returns>
  140. public IEnumerable<WfSchemeInfoEntity> GetCustmerSchemeInfoList(UserInfo userInfo)
  141. {
  142. try
  143. {
  144. string userId = userInfo.userId;
  145. string postIds = userInfo.postIds;
  146. string roleIds = userInfo.roleIds;
  147. List<WfSchemeAuthorizeEntity> list = (List<WfSchemeAuthorizeEntity>)this.BaseRepository().FindList<WfSchemeAuthorizeEntity>(t => t.F_ObjectId == null
  148. || userId.Contains(t.F_ObjectId)
  149. || postIds.Contains(t.F_ObjectId)
  150. || roleIds.Contains(t.F_ObjectId)
  151. );
  152. string schemeinfoIds = "";
  153. foreach (var item in list)
  154. {
  155. schemeinfoIds += "'" + item.F_SchemeInfoId + "',";
  156. }
  157. schemeinfoIds = "(" + schemeinfoIds.Remove(schemeinfoIds.Length - 1, 1) + ")";
  158. var strSql = new StringBuilder();
  159. strSql.Append("SELECT ");
  160. strSql.Append(schemeInfoFieldSql);
  161. strSql.Append(" FROM LR_WF_SchemeInfo t WHERE 1=1 AND t.F_DeleteMark = 0 AND t.F_EnabledMark = 1 AND t.F_Kind = 1 AND t.F_Id in " + schemeinfoIds);
  162. return this.BaseRepository().FindList<WfSchemeInfoEntity>(strSql.ToString());
  163. }
  164. catch (Exception ex)
  165. {
  166. if (ex is ExceptionEx)
  167. {
  168. throw;
  169. }
  170. else
  171. {
  172. throw ExceptionEx.ThrowServiceException(ex);
  173. }
  174. }
  175. }
  176. /// <summary>
  177. /// 获取自定义流程列表
  178. /// </summary>
  179. /// <param name="userInfo">用户信息</param>
  180. /// <returns></returns>
  181. public IEnumerable<WfSchemeInfoEntity> GetAppCustmerSchemeInfoList(UserInfo userInfo)
  182. {
  183. try
  184. {
  185. string userId = userInfo.userId;
  186. string postIds = userInfo.postIds;
  187. string roleIds = userInfo.roleIds;
  188. List<WfSchemeAuthorizeEntity> list = (List<WfSchemeAuthorizeEntity>)this.BaseRepository().FindList<WfSchemeAuthorizeEntity>(t => t.F_ObjectId == null
  189. || userId.Contains(t.F_ObjectId)
  190. || postIds.Contains(t.F_ObjectId)
  191. || roleIds.Contains(t.F_ObjectId)
  192. );
  193. string schemeinfoIds = "";
  194. foreach (var item in list)
  195. {
  196. schemeinfoIds += "'" + item.F_SchemeInfoId + "',";
  197. }
  198. schemeinfoIds = "(" + schemeinfoIds.Remove(schemeinfoIds.Length - 1, 1) + ")";
  199. var strSql = new StringBuilder();
  200. strSql.Append("SELECT ");
  201. strSql.Append(schemeInfoFieldSql);
  202. strSql.Append(" FROM LR_WF_SchemeInfo t WHERE 1=1 AND t.F_DeleteMark = 0 AND t.F_EnabledMark = 1 AND t.F_Kind = 1 AND F_IsApp = 1 AND t.F_Id in " + schemeinfoIds);
  203. return this.BaseRepository().FindList<WfSchemeInfoEntity>(strSql.ToString());
  204. }
  205. catch (Exception ex)
  206. {
  207. if (ex is ExceptionEx)
  208. {
  209. throw;
  210. }
  211. else
  212. {
  213. throw ExceptionEx.ThrowServiceException(ex);
  214. }
  215. }
  216. }
  217. /// <summary>
  218. /// 获取模板列表
  219. /// </summary>
  220. /// <param name="schemeInfoId">模板信息主键</param>
  221. /// <returns></returns>
  222. public IEnumerable<WfSchemeEntity> GetWfSchemeList(string schemeInfoId)
  223. {
  224. try
  225. {
  226. var strSql = new StringBuilder();
  227. strSql.Append("SELECT ");
  228. strSql.Append(schemeFieldSql);
  229. strSql.Append(" FROM LR_WF_Scheme t WHERE 1=1 ");
  230. strSql.Append(" AND t.F_SchemeInfoId = @schemeInfoId ");
  231. return this.BaseRepository().FindList<WfSchemeEntity>(strSql.ToString(), new { schemeInfoId = schemeInfoId });
  232. }
  233. catch (Exception ex)
  234. {
  235. if (ex is ExceptionEx)
  236. {
  237. throw;
  238. }
  239. else
  240. {
  241. throw ExceptionEx.ThrowServiceException(ex);
  242. }
  243. }
  244. }
  245. /// <summary>
  246. /// 获取模板列表
  247. /// </summary>
  248. /// <param name="pagination">分页参数</param>
  249. /// <param name="schemeInfoId">模板信息主键</param>
  250. /// <returns></returns>
  251. public IEnumerable<WfSchemeEntity> GetSchemePageList(Pagination pagination, string schemeInfoId)
  252. {
  253. try
  254. {
  255. var strSql = new StringBuilder();
  256. strSql.Append("SELECT ");
  257. strSql.Append(schemeFieldSql);
  258. strSql.Append(" FROM LR_WF_Scheme t WHERE 1=1 ");
  259. strSql.Append(" AND t.F_SchemeInfoId = @schemeInfoId ");
  260. return this.BaseRepository().FindList<WfSchemeEntity>(strSql.ToString(), new { schemeInfoId = schemeInfoId }, pagination);
  261. }
  262. catch (Exception ex)
  263. {
  264. if (ex is ExceptionEx)
  265. {
  266. throw;
  267. }
  268. else
  269. {
  270. throw ExceptionEx.ThrowServiceException(ex);
  271. }
  272. }
  273. }
  274. /// <summary>
  275. /// 获取模板基础信息的实体
  276. /// </summary>
  277. /// <param name="keyValue">主键</param>
  278. /// <returns></returns>
  279. public WfSchemeInfoEntity GetWfSchemeInfoEntity(string keyValue)
  280. {
  281. try
  282. {
  283. return this.BaseRepository().FindEntity<WfSchemeInfoEntity>(keyValue);
  284. }
  285. catch (Exception ex)
  286. {
  287. if (ex is ExceptionEx)
  288. {
  289. throw;
  290. }
  291. else
  292. {
  293. throw ExceptionEx.ThrowServiceException(ex);
  294. }
  295. }
  296. }
  297. /// <summary>
  298. /// 获取模板基础信息的实体
  299. /// </summary>
  300. /// <param name="code">流程编号</param>
  301. /// <returns></returns>
  302. public WfSchemeInfoEntity GetWfSchemeInfoEntityByCode(string code)
  303. {
  304. try
  305. {
  306. return this.BaseRepository().FindEntity<WfSchemeInfoEntity>(t => t.F_Code == code && t.F_DeleteMark == 0);
  307. }
  308. catch (Exception ex)
  309. {
  310. if (ex is ExceptionEx)
  311. {
  312. throw;
  313. }
  314. else
  315. {
  316. throw ExceptionEx.ThrowServiceException(ex);
  317. }
  318. }
  319. }
  320. /// <summary>
  321. /// 获取模板的实体
  322. /// </summary>
  323. /// <param name="keyValue">主键</param>
  324. /// <returns></returns>
  325. public WfSchemeEntity GetWfSchemeEntity(string keyValue)
  326. {
  327. try
  328. {
  329. return this.BaseRepository().FindEntity<WfSchemeEntity>(keyValue);
  330. }
  331. catch (Exception ex)
  332. {
  333. if (ex is ExceptionEx)
  334. {
  335. throw;
  336. }
  337. else
  338. {
  339. throw ExceptionEx.ThrowServiceException(ex);
  340. }
  341. }
  342. }
  343. /// <summary>
  344. /// 获取流程模板权限列表
  345. /// </summary>
  346. /// <param name="schemeInfoId">模板信息主键</param>
  347. /// <returns></returns>
  348. public IEnumerable<WfSchemeAuthorizeEntity> GetWfSchemeAuthorizeList(string schemeInfoId)
  349. {
  350. try
  351. {
  352. return this.BaseRepository().FindList<WfSchemeAuthorizeEntity>(t => t.F_SchemeInfoId == schemeInfoId);
  353. }
  354. catch (Exception ex)
  355. {
  356. if (ex is ExceptionEx)
  357. {
  358. throw;
  359. }
  360. else
  361. {
  362. throw ExceptionEx.ThrowServiceException(ex);
  363. }
  364. }
  365. }
  366. #endregion
  367. #region 提交数据
  368. /// <summary>
  369. /// 虚拟删除模板信息
  370. /// </summary>
  371. /// <param name="keyValue">主键</param>
  372. public void VirtualDelete(string keyValue)
  373. {
  374. try
  375. {
  376. WfSchemeInfoEntity entity = new WfSchemeInfoEntity()
  377. {
  378. F_Id = keyValue,
  379. F_DeleteMark = 1
  380. };
  381. this.BaseRepository().Update(entity);
  382. }
  383. catch (Exception ex)
  384. {
  385. if (ex is ExceptionEx)
  386. {
  387. throw;
  388. }
  389. else
  390. {
  391. throw ExceptionEx.ThrowServiceException(ex);
  392. }
  393. }
  394. }
  395. /// <summary>
  396. /// 保存模板信息
  397. /// </summary>
  398. /// <param name="keyValue">主键</param>
  399. /// <param name="wfSchemeInfoEntity">模板基础信息</param>
  400. /// <param name="wfSchemeEntity">模板信息</param>
  401. public void SaveEntity(string keyValue, WfSchemeInfoEntity wfSchemeInfoEntity, WfSchemeEntity wfSchemeEntity, List<WfSchemeAuthorizeEntity> wfSchemeAuthorizeList)
  402. {
  403. IRepository db = new RepositoryFactory().BaseRepository().BeginTrans();
  404. try
  405. {
  406. if (string.IsNullOrEmpty(keyValue))
  407. {
  408. wfSchemeInfoEntity.Create();
  409. }
  410. else
  411. {
  412. wfSchemeInfoEntity.Modify(keyValue);
  413. }
  414. #region 模板信息
  415. if (wfSchemeEntity != null)
  416. {
  417. wfSchemeEntity.F_SchemeInfoId = wfSchemeInfoEntity.F_Id;
  418. wfSchemeEntity.Create();
  419. db.Insert(wfSchemeEntity);
  420. wfSchemeInfoEntity.F_SchemeId = wfSchemeEntity.F_Id;
  421. }
  422. #endregion
  423. #region 模板基础信息
  424. if (!string.IsNullOrEmpty(keyValue))
  425. {
  426. db.Update(wfSchemeInfoEntity);
  427. }
  428. else
  429. {
  430. db.Insert(wfSchemeInfoEntity);
  431. }
  432. #endregion
  433. #region 流程模板权限信息
  434. string schemeInfoId = wfSchemeInfoEntity.F_Id;
  435. db.Delete<WfSchemeAuthorizeEntity>(t => t.F_SchemeInfoId == schemeInfoId);
  436. foreach (var wfSchemeAuthorize in wfSchemeAuthorizeList)
  437. {
  438. wfSchemeAuthorize.F_SchemeInfoId = schemeInfoId;
  439. db.Insert(wfSchemeAuthorize);
  440. }
  441. #endregion
  442. db.Commit();
  443. }
  444. catch (Exception ex)
  445. {
  446. db.Rollback();
  447. if (ex is ExceptionEx)
  448. {
  449. throw;
  450. }
  451. else
  452. {
  453. throw ExceptionEx.ThrowServiceException(ex);
  454. }
  455. }
  456. }
  457. /// <summary>
  458. /// 更新流程模板
  459. /// </summary>
  460. /// <param name="schemeInfoId">模板信息主键</param>
  461. /// <param name="schemeId">模板主键</param>
  462. public void UpdateScheme(string schemeInfoId, string schemeId)
  463. {
  464. try
  465. {
  466. WfSchemeEntity wfSchemeEntity = GetWfSchemeEntity(schemeId);
  467. WfSchemeInfoEntity entity = new WfSchemeInfoEntity
  468. {
  469. F_Id = schemeInfoId,
  470. F_SchemeId = schemeId
  471. };
  472. if (wfSchemeEntity.F_Type != 1)
  473. {
  474. entity.F_EnabledMark = 0;
  475. }
  476. this.BaseRepository().Update(entity);
  477. }
  478. catch (Exception ex)
  479. {
  480. if (ex is ExceptionEx)
  481. {
  482. throw;
  483. }
  484. else
  485. {
  486. throw ExceptionEx.ThrowServiceException(ex);
  487. }
  488. }
  489. }
  490. /// <summary>
  491. /// 保存模板基础信息
  492. /// </summary>
  493. /// <param name="keyValue">主键</param>
  494. /// <param name="schemeInfoEntity">模板基础信息</param>
  495. public void SaveSchemeInfoEntity(string keyValue, WfSchemeInfoEntity schemeInfoEntity)
  496. {
  497. try
  498. {
  499. if (!string.IsNullOrEmpty(keyValue))
  500. {
  501. schemeInfoEntity.Modify(keyValue);
  502. this.BaseRepository().Update(schemeInfoEntity);
  503. }
  504. else
  505. {
  506. schemeInfoEntity.Create();
  507. this.BaseRepository().Insert(schemeInfoEntity);
  508. }
  509. }
  510. catch (Exception ex)
  511. {
  512. if (ex is ExceptionEx)
  513. {
  514. throw;
  515. }
  516. else
  517. {
  518. throw ExceptionEx.ThrowServiceException(ex);
  519. }
  520. }
  521. }
  522. /// <summary>
  523. /// 更新自定义表单模板状态
  524. /// </summary>
  525. /// <param name="schemeInfoId">模板信息主键</param>
  526. /// <param name="state">状态1启用0禁用</param>
  527. public void UpdateState(string schemeInfoId, int state)
  528. {
  529. try
  530. {
  531. WfSchemeInfoEntity entity = new WfSchemeInfoEntity
  532. {
  533. F_Id = schemeInfoId,
  534. F_EnabledMark = state
  535. };
  536. this.BaseRepository().Update(entity);
  537. }
  538. catch (Exception ex)
  539. {
  540. if (ex is ExceptionEx)
  541. {
  542. throw;
  543. }
  544. else
  545. {
  546. throw ExceptionEx.ThrowServiceException(ex);
  547. }
  548. }
  549. }
  550. #endregion
  551. #region 扩展数据
  552. /// <summary>
  553. /// 获取流程模板使用次数列表
  554. /// </summary>
  555. /// <param name="queryJson">查询参数</param>
  556. /// <returns></returns>
  557. public IEnumerable<WfProcessInstanceEntity> GetWfSchemeUseList(string queryJson)
  558. {
  559. try
  560. {
  561. //var dp = new DynamicParameters(new { });
  562. var dp = new object();
  563. var strSql = new StringBuilder();
  564. strSql.Append("select si.F_Category,si.F_Name,si.F_Code,si.F_Kind,p.F_Id,p.F_CreateDate from");
  565. strSql.Append(" [dbo].[LR_WF_SchemeInfo] si left join [dbo].[LR_WF_Scheme] s on si.F_Id=s.F_SchemeInfoId left join [dbo].[LR_WF_ProcessInstance] p on s.F_Id=p.F_SchemeId ");
  566. strSql.Append(" where si.F_DeleteMark=0 and si.F_EnabledMark=1 and s.F_Type=1");
  567. var queryParam = queryJson.ToJObject();
  568. if (!queryParam["year"].IsEmpty())
  569. {
  570. //dp.Add("year", queryParam["year"].ToInt(), DbType.Int32);
  571. dp = new { year = queryParam["year"].ToInt() };
  572. strSql.Append(" and DATEPART(yyyy,p.F_CreateDate) = @year ");
  573. }
  574. return this.BaseRepository().FindList<WfProcessInstanceEntity>(strSql.ToString(), dp);
  575. }
  576. catch (Exception ex)
  577. {
  578. if (ex is ExceptionEx)
  579. {
  580. throw;
  581. }
  582. else
  583. {
  584. throw ExceptionEx.ThrowServiceException(ex);
  585. }
  586. }
  587. }
  588. public IEnumerable<WfProcessInstanceEntity> GetWfSchemeStart()
  589. {
  590. try
  591. {
  592. var strSql = new StringBuilder();
  593. // strSql.Append(@"select si.F_Category,si.F_Name,si.F_Code,si.F_Id,count(p.F_Id) from
  594. //[dbo].[LR_WF_SchemeInfo] si left join [dbo].[LR_WF_Scheme] s on si.F_Id=s.F_SchemeInfoId left join [dbo].[LR_WF_ProcessInstance] p on s.F_Id=p.F_SchemeId
  595. // where si.F_DeleteMark=0 and si.F_EnabledMark=1 and s.F_Type=1 and si.F_Kind=1
  596. // group by si.F_Category,si.F_Name,si.F_Code,si.F_Id order by count(p.F_Id) desc");
  597. strSql.Append(@"SELECT t.F_Category,t.F_Name,t.F_Code,t.F_Id,COUNT(t.F_Id)
  598. FROM LR_NWF_SchemeInfo t LEFT JOIN LR_NWF_Scheme t1 ON t.F_SchemeId = t1.F_Id WHERE t.F_EnabledMark=1 AND t1.F_Type=1
  599. GROUP BY t.F_Category,t.F_Name,t.F_Code,t.F_Id ORDER BY COUNT(t.F_Id) DESC");
  600. return this.BaseRepository().FindList<WfProcessInstanceEntity>(strSql.ToString());
  601. }
  602. catch (Exception ex)
  603. {
  604. if (ex is ExceptionEx)
  605. {
  606. throw;
  607. }
  608. else
  609. {
  610. throw ExceptionEx.ThrowServiceException(ex);
  611. }
  612. }
  613. }
  614. #endregion
  615. }
  616. }