人民医院API

WorkCommonController.cs 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. using RMYY_CallCenter_Api.DB;
  2. using RMYY_CallCenter_Api.Models.Dto;
  3. using RMYY_CallCenter_Api.Models.Enum;
  4. using RMYY_CallCenter_Api.Utility;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Data;
  8. using System.Linq;
  9. using System.Web.Mvc;
  10. namespace RMYY_CallCenter_Api.Controllers.WorkOrder
  11. {
  12. public class WorkCommonController : BaseController
  13. {
  14. /// <summary>
  15. /// 我的提交
  16. /// </summary>
  17. /// <param name="keyword"></param>
  18. /// <param name="starttime"></param>
  19. /// <param name="endtime"></param>
  20. /// <param name="pageindex"></param>
  21. /// <param name="pagesize"></param>
  22. /// <param name="state"></param>
  23. /// <returns></returns>
  24. public ActionResult GetSubmitList(string starttime = "", string endtime = "", int pageindex = 1, int pagesize = 10, int state = -1, int type = 0, int loweltype = 0)
  25. {
  26. if (User != null)
  27. {
  28. int recordCount = 0;
  29. string sql = "";// $" and F_Proposer='{User.F_UserCode}' and F_IsDelete = 0";
  30. //if (type > 0)
  31. //{
  32. // sql += $" and F_Type={type}";
  33. //}
  34. //if (loweltype > 0)
  35. //{
  36. // sql += $" and F_SonType={loweltype}";
  37. //}
  38. //if (state >= 0)
  39. //{
  40. // sql += $" and F_Status={state}";
  41. //}
  42. //if (!string.IsNullOrEmpty(starttime))
  43. //{
  44. // sql += $" and F_CreateTime>='{starttime}'";
  45. //}
  46. //if (!string.IsNullOrEmpty(endtime))
  47. //{
  48. // sql += $" and F_CreateTime<'{endtime}'";
  49. //}
  50. DataTable datatable = Bll.PagerBll.GetListPager
  51. ("T_Wo_CommonBase ",
  52. "F_WoCode",
  53. "*,[dbo].[GetUserName](F_Proposer) F_ProposerName,[dbo].[GetUserName](F_DealUser) F_DealUserName",
  54. sql,
  55. "order by F_CreateTime desc",
  56. pagesize,
  57. pageindex,
  58. true,
  59. out recordCount
  60. );
  61. datatable = WorkOrderBase.SetOtherField(datatable, MENUENUM.我的提交);
  62. var obj = new
  63. {
  64. state = "success",
  65. message = "成功",
  66. rows = datatable,
  67. total = recordCount
  68. };
  69. return Content(obj.ToJson());
  70. }
  71. return Error("无操作权限!");
  72. }
  73. /// <summary>
  74. /// 综合查询
  75. /// </summary>
  76. /// <param name="keyword"></param>
  77. /// <param name="starttime"></param>
  78. /// <param name="endtime"></param>
  79. /// <param name="pageindex"></param>
  80. /// <param name="pagesize"></param>
  81. /// <param name="state"></param>
  82. /// <returns></returns>
  83. public ActionResult GetComList(string starttime = "", string endtime = "", int pageindex = 1, int pagesize = 10, int state = -1, int type = 0, int loweltype = 0)
  84. {
  85. if (User != null)
  86. {
  87. int recordCount = 0;
  88. string sql = ""; //$" and F_Proposer='{User.F_UserCode}' and F_IsDelete = 0";
  89. //if (type > 0)
  90. //{
  91. // sql += $" and F_Type={type}";
  92. //}
  93. //if (loweltype > 0)
  94. //{
  95. // sql += $" and F_SonType={loweltype}";
  96. //}
  97. //if (state >= 0)
  98. //{
  99. // sql += $" and F_Status={state}";
  100. //}
  101. //if (!string.IsNullOrEmpty(starttime))
  102. //{
  103. // sql += $" and F_CreateTime>='{starttime}'";
  104. //}
  105. //if (!string.IsNullOrEmpty(endtime))
  106. //{
  107. // sql += $" and F_CreateTime<'{endtime}'";
  108. //}
  109. DataTable datatable = Bll.PagerBll.GetListPager
  110. ("T_Wo_CommonBase ",
  111. "F_WoCode",
  112. "*,[dbo].[GetUserName](F_Proposer) F_ProposerName,[dbo].[GetUserName](F_DealUser) F_DealUserName",
  113. sql,
  114. "order by F_CreateTime desc",
  115. pagesize,
  116. pageindex,
  117. true,
  118. out recordCount
  119. );
  120. //datatable.Columns.Add("GapTime", typeof(string));//执行时限
  121. //datatable.Columns.Add("AssistanceState", typeof(string));//协作工单的状态
  122. //datatable.Columns.Add("StateName", typeof(string));//协作工单的状态
  123. //datatable.Columns.Add("Buttons", typeof(object));//操作按钮
  124. datatable = WorkOrderBase.SetOtherField(datatable, MENUENUM.工单列表);
  125. var obj = new
  126. {
  127. state = "success",
  128. message = "成功",
  129. rows = datatable,
  130. total = recordCount
  131. };
  132. return Content(obj.ToJson());
  133. }
  134. return Error("无操作权限!");
  135. }
  136. }
  137. }