ExternalManageBuiness.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using PMS.BusinessModels;
  2. using PMS.BusinessModels.ExternalManage;
  3. using PMS.DBService.ExternalManage;
  4. using PMS.DBService.Search;
  5. using PMS.EntityModels.ExternalManage;
  6. using PMS.Interface.ExternalManage;
  7. using QWPlatform.IService;
  8. using QWPlatform.SystemLibrary;
  9. using QWPlatform.SystemLibrary.Utils;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Linq;
  14. using System.Runtime.InteropServices;
  15. using System.Text;
  16. using System.Threading.Tasks;
  17. using System.Web.UI;
  18. namespace PMS.BusinessService.ExternalManage
  19. {
  20. public class ExternalManageBuiness : IExternalManage
  21. {
  22. //提供ProService的数据服务
  23. private ExternalManageService DB_ExterManageService = DataServiceBase.Instance<ExternalManageService>();
  24. /// <summary>
  25. /// 关键字查询外部服务分类
  26. /// </summary>
  27. /// <param name="keyword"></param>
  28. /// <returns></returns>
  29. public string GetMenu(string keyword, string productId, int type)
  30. {
  31. var dt = Strings.ObjectToJson(DB_ExterManageService.GetMenu(keyword, productId, type));
  32. return dt;
  33. }
  34. /// <summary>
  35. /// 根据产品ID获取分类
  36. /// </summary>
  37. /// <param name="productIds"></param>
  38. /// <returns></returns>
  39. public string GetMenuByProduct(List<string> productIds)
  40. {
  41. var dt = Strings.ObjectToJson(DB_ExterManageService.GetMenuByProduct(productIds));
  42. return dt;
  43. }
  44. //// <summary>
  45. /// 获取编码
  46. /// </summary>
  47. /// <param name="tableName">表名</param>
  48. /// <returns></returns>
  49. public string GetMaxClassCode(string parent_id, int type, string productId)
  50. {
  51. var dt = DB_ExterManageService.GetMaxClassCode(parent_id, type, productId);
  52. return dt;
  53. }
  54. /// <summary>
  55. /// 保存服务分类
  56. /// </summary>
  57. /// <param name="model"></param>
  58. /// <returns></returns>
  59. public bool SaveExternalClass(ExternalClass model)
  60. {
  61. var dt = DB_ExterManageService.SaveExternalClass(model);
  62. return dt;
  63. }
  64. /// <summary>
  65. /// 删除服务分类
  66. /// </summary>
  67. /// <param name="id"></param>
  68. /// <returns></returns>
  69. public bool DeleteClass(string id)
  70. {
  71. var dt = DB_ExterManageService.DeleteClass(id);
  72. return dt;
  73. }
  74. /// <summary>
  75. /// 获取服务目录
  76. /// </summary>
  77. /// <param name="class_id">分类id</param>
  78. /// <param name="keyword">关键字</param>
  79. /// <returns></returns>
  80. public string GetExternal(string class_id, string keyword, int pageSize, int pageNum)
  81. {
  82. int total = 0;
  83. DataTable dt = DB_ExterManageService.GetExternal(class_id, keyword, pageSize, pageNum, out total);
  84. return dt.ToEasyUIGridJson(total);
  85. }
  86. /// <summary>
  87. /// 保存服务
  88. /// </summary>
  89. /// <param name="model"></param>
  90. /// <returns></returns>
  91. public bool SaveExternal(External model)
  92. {
  93. var dt = DB_ExterManageService.SaveExternal(model);
  94. return dt;
  95. }
  96. /// <summary>
  97. /// 获取参数
  98. /// </summary>
  99. /// <param name="type"></param>
  100. /// <param name="id"></param>
  101. /// <returns></returns>
  102. public string GetParameter(string tyep, string id)
  103. {
  104. var dt = Strings.ObjectToJson(DB_ExterManageService.GetParameter(tyep, id));
  105. return dt;
  106. }
  107. /// <summary>
  108. /// 参数设置
  109. /// </summary>
  110. /// <param name="id"></param>
  111. /// <returns></returns>
  112. public string GetExternalParameter(string id)
  113. {
  114. var dt = Strings.ObjectToJson(DB_ExterManageService.GetExternalParameter(id));
  115. return dt;
  116. }
  117. /// <summary>
  118. /// 保存参数设置
  119. /// </summary>
  120. /// <param name="model"></param>
  121. /// <returns></returns>
  122. public bool SavaExternalSet(v_parameter model)
  123. {
  124. var dt = DB_ExterManageService.SavaExternalSet(model);
  125. return dt;
  126. }
  127. /// <summary>
  128. /// 删除服务和出入参信息
  129. /// </summary>
  130. /// <param name="id"></param>
  131. /// <returns></returns>
  132. public bool deleteExternal(string id)
  133. {
  134. var dt = DB_ExterManageService.deleteExternal(id);
  135. return dt;
  136. }
  137. /// <summary>
  138. /// 复制
  139. /// </summary>
  140. /// <param name="model"></param>
  141. /// <returns></returns>
  142. public bool CopyExternalByClass(dto_copy_class model)
  143. {
  144. var dt = DB_ExterManageService.CopyExternalByClass(model);
  145. return dt;
  146. }
  147. /// <summary>
  148. /// 复制
  149. /// </summary>
  150. /// <param name="model"></param>
  151. /// <returns></returns>
  152. public bool CopyExternal(dto_copy_external model)
  153. {
  154. var dt = DB_ExterManageService.CopyExternal(model);
  155. return dt;
  156. }
  157. /// <summary>
  158. /// 查询授权接口
  159. /// </summary>
  160. /// <param name="keyword"></param>
  161. /// <param name="pageSize"></param>
  162. /// <param name="pageNum"></param>
  163. /// <returns></returns>
  164. public string GetAccredit(string keyword, int pageSize, int pageNum, int is_stop)
  165. {
  166. int total = 0;
  167. DataTable dt = DB_ExterManageService.GetAccredit(keyword, pageSize, pageNum, is_stop, out total);
  168. return dt.ToEasyUIGridJson(total);
  169. }
  170. /// <summary>
  171. /// 保存授权信息
  172. /// </summary>
  173. /// <param name="model"></param>
  174. /// <returns></returns>
  175. public bool SavaAccredit(ExternalAccredit model)
  176. {
  177. return DB_ExterManageService.SavaAccredit(model);
  178. }
  179. public string GetAccredView(string id, string channel_id, string project_id, int pageSize, int pageNum, int is_stop)
  180. {
  181. int total = 0;
  182. DataTable dt = DB_ExterManageService.GetAccredView(id, channel_id, project_id, pageSize, pageNum, is_stop, out total);
  183. return dt.ToEasyUIGridJson(total);
  184. }
  185. public string GetRecords(dto_records_in model)
  186. {
  187. int total = 0;
  188. DataTable dt = DB_ExterManageService.GetRecords(model, out total);
  189. return dt.ToEasyUIGridJson(total); ;
  190. }
  191. }
  192. }