高新区管委会,以5.0标准版为基准,从双汇项目拷贝

SetController.cs 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Net.Http;
  6. using System.Web.Http;
  7. namespace CallCenterApi.Interface.Controllers.api
  8. {
  9. public class SetController : BaseApiController
  10. {
  11. [HttpGet]
  12. public string Info()
  13. {
  14. return "setvalue";
  15. }
  16. // GET: api/Set
  17. public IEnumerable<string> Get()
  18. {
  19. return new string[] { "value1", "value2" };
  20. }
  21. // GET: api/Set/5
  22. public string Get(int id)
  23. {
  24. return "value";
  25. }
  26. // POST: api/Set
  27. public void Post([FromBody]string value)
  28. {
  29. }
  30. //添加
  31. [HttpPost]
  32. public object Save(Model.T_Rec_RegRecordsCallOut dModel)
  33. {
  34. #region 验证身份 验证参数有效性
  35. if (string.IsNullOrEmpty(dModel.F_userPhone))
  36. {
  37. return Error("手机号为空");
  38. }
  39. #endregion
  40. BLL.T_Rec_RegRecordsCallOut dBLL = new BLL.T_Rec_RegRecordsCallOut();
  41. #region 验证1分钟内是否重复添加
  42. int n=dBLL.GetRecordCount(string.Format(" F_userPhone ='{0}' and datediff(ss,getdate(),F_CreateOn) <= 60", dModel.F_userPhone));
  43. if (n > 0)
  44. {
  45. return Error("频率太高,请稍后再试");
  46. }
  47. #endregion
  48. //dModel.F_Tel = tel;
  49. //dModel.F_CusID = cusid;
  50. //dModel.F_Type = type;
  51. //dModel.F_Direction = direction;
  52. //dModel.F_Complained = complained;
  53. //dModel.F_Content = content;
  54. //dModel.F_Remark = remark;
  55. //dModel.F_CallId = callid;
  56. //dModel.F_userName = userName;
  57. //dModel.F_userPhone = userPhone;
  58. //dModel.F_userSex = userSex;
  59. //dModel.F_userProvince = userProvince;
  60. //dModel.F_userCity = userCity;
  61. //dModel.F_userArea = userArea;
  62. //dModel.F_ProblemType = problemType;
  63. //dModel.F_Unit = unit;
  64. //dModel.F_UnitOffice = unitOffice;
  65. //dModel.F_CaseParty = caseParty;
  66. //dModel.F_CitizensType = citizensType;
  67. //dModel.F_PutRecord = putRecord;
  68. //dModel.F_ZXZType = zXZType;
  69. //dModel.F_CasePartyId = CasePartyId;
  70. //dModel.F_ProblemTypeB = ProblemTypeB;
  71. //dModel.F_userAddress = userAddress;
  72. var res = false;
  73. dModel.F_RecCode = "0";// 0未外呼 1已执行外呼
  74. //dModel.F_CreateBy = "0";
  75. dModel.F_CreateOn = DateTime.Now;
  76. res = dBLL.Add(dModel) > 0;
  77. if (res)
  78. {
  79. return Success("成功");
  80. }
  81. else
  82. {
  83. return Error("失败");
  84. }
  85. }
  86. }
  87. }