ImportUserController.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using LeaRun.Application.Busines.InstallManage;
  2. using LeaRun.Application.Entity.InstallManage;
  3. using LeaRun.Util;
  4. using LeaRun.Util.WebControl;
  5. using Newtonsoft.Json;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Web;
  10. using System.Web.Mvc;
  11. namespace LeaRun.Application.Web.Areas.InstallManage.Controllers
  12. {
  13. public class ImportUserController : MvcControllerBase
  14. {
  15. private InstallApplyBLL InstallApplybll = new InstallApplyBLL();
  16. //
  17. // GET: /InstallManage/ImportUser/
  18. public ActionResult Index()
  19. {
  20. return View();
  21. }
  22. public ActionResult GetListJson(string startTime, string endTime, String type, Pagination pagination)
  23. {
  24. InstallApplyEntity entity = new InstallApplyEntity();
  25. if (type == null)
  26. {
  27. entity.SurveyType = 1;
  28. entity.budgetType = 1;
  29. entity.MasterVerifyType = 1;
  30. entity.PayMentType = 1;
  31. entity.ConstructionType = 2;
  32. entity.AcceptType = 1;
  33. entity.ThroughWaterType = 1;
  34. entity.CreateCusInfoType = 0;
  35. }
  36. else
  37. {
  38. entity.SurveyType = 1;
  39. entity.budgetType = 1;
  40. entity.MasterVerifyType = 1;
  41. entity.PayMentType = 1;
  42. entity.ConstructionType = 2;
  43. entity.AcceptType = 1;
  44. entity.ThroughWaterType = 1;
  45. entity.CreateCusInfoType = int.Parse(type);
  46. }
  47. if (!string.IsNullOrEmpty(startTime) && !string.IsNullOrEmpty(endTime))
  48. {
  49. var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination, entity);
  50. var watch = CommonHelper.TimerStart();
  51. var JsonData = new
  52. {
  53. rows = JsonConvert.DeserializeObject(data),
  54. total = pagination.total,
  55. page = pagination.page,
  56. records = pagination.records,
  57. costtime = CommonHelper.TimerEnd(watch)
  58. };
  59. return Content(JsonData.ToJson());
  60. }
  61. else
  62. {
  63. entity.SurveyType = 1;
  64. entity.budgetType = 1;
  65. entity.MasterVerifyType = 1;
  66. entity.PayMentType = 1;
  67. entity.ConstructionType = 2;
  68. entity.AcceptType = 1;
  69. entity.ThroughWaterType = 1;
  70. entity.CreateCusInfoType = 0;
  71. var data = InstallApplybll.getInstallApplyList(startTime, endTime, pagination, entity);
  72. var watch = CommonHelper.TimerStart();
  73. var JsonData = new
  74. {
  75. rows = JsonConvert.DeserializeObject(data),
  76. total = pagination.total,
  77. page = pagination.page,
  78. records = pagination.records,
  79. costtime = CommonHelper.TimerEnd(watch)
  80. };
  81. return Content(JsonData.ToJson());
  82. }
  83. return Content("");
  84. }
  85. public ActionResult UpdateType(String appId, String type)
  86. {
  87. InstallApplybll.UpdateCreateCus(appId, type);
  88. return Success("成功");
  89. }
  90. }
  91. }