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.

WfConfluenceService.cs 3.1 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using Learun.DataBase.Repository;
  2. using Learun.Util;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace Learun.Application.WorkFlow
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  9. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  10. /// 创建人:陈彬彬
  11. /// 日 期:2017.04.17
  12. /// 描 述:会签记录操作
  13. /// </summary>
  14. public class WfConfluenceService : RepositoryFactory
  15. {
  16. #region 获取数据
  17. /// <summary>
  18. /// 获取会签记录
  19. /// </summary>
  20. /// <param name="processId">流程实例主键</param>
  21. /// <param name="nodeId">节点主键</param>
  22. /// <returns></returns>
  23. public IEnumerable<WfConfluenceEntity> GetList(string processId, string nodeId)
  24. {
  25. try
  26. {
  27. return this.BaseRepository().FindList<WfConfluenceEntity>(t => t.F_ProcessId == processId && t.F_NodeId == nodeId);
  28. }
  29. catch (Exception ex)
  30. {
  31. if (ex is ExceptionEx)
  32. {
  33. throw;
  34. }
  35. else
  36. {
  37. throw ExceptionEx.ThrowServiceException(ex);
  38. }
  39. }
  40. }
  41. #endregion
  42. #region 提交数据
  43. /// <summary>
  44. /// 保存成功的会前记录
  45. /// </summary>
  46. /// <param name="entity">实体</param>
  47. public void SaveEntity(WfConfluenceEntity entity)
  48. {
  49. try
  50. {
  51. string processId = entity.F_ProcessId;
  52. string nodeId = entity.F_NodeId;
  53. string formNodeId = entity.F_FormNodeId;
  54. WfConfluenceEntity oldEntity = this.BaseRepository().FindEntity<WfConfluenceEntity>(t => t.F_ProcessId == processId && t.F_NodeId == nodeId && t.F_FormNodeId == formNodeId);
  55. if (oldEntity == null)
  56. {
  57. entity.Create();
  58. this.BaseRepository().Insert(entity);
  59. }
  60. }
  61. catch (Exception ex)
  62. {
  63. if (ex is ExceptionEx)
  64. {
  65. throw;
  66. }
  67. else
  68. {
  69. throw ExceptionEx.ThrowServiceException(ex);
  70. }
  71. }
  72. }
  73. /// <summary>
  74. /// 删除会签节点数据
  75. /// </summary>
  76. /// <param name="processId">实例主键</param>
  77. /// <param name="nodeId">节点主键</param>
  78. public void DeleteEntity(string processId, string nodeId)
  79. {
  80. try
  81. {
  82. this.BaseRepository().Delete<WfConfluenceEntity>(t => t.F_ProcessId == processId && t.F_NodeId == nodeId);
  83. }
  84. catch (Exception ex)
  85. {
  86. if (ex is ExceptionEx)
  87. {
  88. throw;
  89. }
  90. else
  91. {
  92. throw ExceptionEx.ThrowServiceException(ex);
  93. }
  94. }
  95. }
  96. #endregion
  97. }
  98. }