ICodeRuleService.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using LeaRun.Application.Entity.SystemManage;
  2. using LeaRun.Data.Repository;
  3. using LeaRun.Util.WebControl;
  4. using System.Collections.Generic;
  5. namespace LeaRun.Application.IService.SystemManage
  6. {
  7. /// <summary>
  8. /// 版 本 6.1
  9. /// Copyright (c) 2013-2016 上海力软信息技术有限公司
  10. /// 创建人:佘赐雄
  11. /// 日 期:2015.12.21 16:19
  12. /// 描 述:编号规则
  13. /// </summary>
  14. public interface ICodeRuleService
  15. {
  16. #region 获取数据
  17. /// <summary>
  18. /// 规则列表
  19. /// </summary>
  20. /// <param name="pagination">分页</param>
  21. /// <param name="queryJson">查询参数</param>
  22. /// <returns></returns>
  23. IEnumerable<CodeRuleEntity> GetPageList(Pagination pagination, string queryJson);
  24. /// <summary>
  25. /// 规则实体
  26. /// </summary>
  27. /// <param name="keyValue">主键值</param>
  28. /// <returns></returns>
  29. CodeRuleEntity GetEntity(string keyValue);
  30. #endregion
  31. #region 验证数据
  32. /// <summary>
  33. /// 规则编号不能重复
  34. /// </summary>
  35. /// <param name="enCode">编号</param>
  36. /// <param name="keyValue">主键</param>
  37. /// <returns></returns>
  38. bool ExistEnCode(string enCode, string keyValue);
  39. /// <summary>
  40. /// 规则名称不能重复
  41. /// </summary>
  42. /// <param name="fullName">名称</param>
  43. /// <param name="keyValue">主键</param>
  44. /// <returns></returns>
  45. bool ExistFullName(string fullName, string keyValue);
  46. #endregion
  47. #region 提交数据
  48. /// <summary>
  49. /// 删除规则
  50. /// </summary>
  51. /// <param name="keyValue">主键</param>
  52. void RemoveForm(string keyValue);
  53. /// <summary>
  54. /// 保存规则表单(新增、修改)
  55. /// </summary>
  56. /// <param name="keyValue">主键值</param>
  57. /// <param name="codeRuleEntity">规则实体</param>
  58. /// <returns></returns>
  59. void SaveForm(string keyValue, CodeRuleEntity codeRuleEntity);
  60. #endregion
  61. #region 单据编码处理
  62. /// <summary>
  63. /// 获得指定模块或者编号的单据号
  64. /// </summary>
  65. /// <param name="userId">用户ID</param>
  66. /// <param name="moduleId">模块ID</param>
  67. /// <param name="enCode">模板编码</param>
  68. /// <returns>单据号</returns>
  69. string GetBillCode(string userId, string moduleId, string enCode);
  70. /// <summary>
  71. /// 占用单据号
  72. /// </summary>
  73. /// <param name="userId">用户ID</param>
  74. /// <param name="moduleId">模块ID</param>
  75. /// <param name="enCode">模板编码</param>
  76. /// <returns>true/false</returns>
  77. bool UseRuleSeed(string userId, string moduleId, string enCode, IRepository db = null);
  78. /// <summary>
  79. /// 获得指定模块或者编号的单据号(直接使用)
  80. /// </summary>
  81. /// <param name="userId">用户ID</param>
  82. /// <param name="moduleId">模块ID</param>
  83. /// <param name="enCode">模板编码</param>
  84. /// <returns>单据号</returns>
  85. string SetBillCode(string userId, string moduleId, string enCode, IRepository db = null);
  86. #endregion
  87. }
  88. }