| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Web.Http;
- namespace CallCenterApi.Interface.Controllers.api
- {
- public class SetController : BaseApiController
- {
- [HttpGet]
- public string Info()
- {
- return "setvalue";
- }
- // GET: api/Set
- public IEnumerable<string> Get()
- {
- return new string[] { "value1", "value2" };
- }
- // GET: api/Set/5
- public string Get(int id)
- {
- return "value";
- }
- // POST: api/Set
- public void Post([FromBody]string value)
- {
- }
- //添加
- [HttpPost]
- public object Save(Model.T_Rec_RegRecordsCallOut dModel)
- {
- #region 验证身份 验证参数有效性
- if (string.IsNullOrEmpty(dModel.F_userPhone))
- {
- return Error("手机号为空");
- }
- #endregion
- BLL.T_Rec_RegRecordsCallOut dBLL = new BLL.T_Rec_RegRecordsCallOut();
- #region 验证1分钟内是否重复添加
- int n=dBLL.GetRecordCount(string.Format(" F_userPhone ='{0}' and datediff(ss,getdate(),F_CreateOn) <= 60", dModel.F_userPhone));
- if (n > 0)
- {
- return Error("频率太高,请稍后再试");
- }
- #endregion
- //dModel.F_Tel = tel;
- //dModel.F_CusID = cusid;
- //dModel.F_Type = type;
- //dModel.F_Direction = direction;
- //dModel.F_Complained = complained;
- //dModel.F_Content = content;
- //dModel.F_Remark = remark;
- //dModel.F_CallId = callid;
- //dModel.F_userName = userName;
- //dModel.F_userPhone = userPhone;
- //dModel.F_userSex = userSex;
- //dModel.F_userProvince = userProvince;
- //dModel.F_userCity = userCity;
- //dModel.F_userArea = userArea;
- //dModel.F_ProblemType = problemType;
- //dModel.F_Unit = unit;
- //dModel.F_UnitOffice = unitOffice;
- //dModel.F_CaseParty = caseParty;
- //dModel.F_CitizensType = citizensType;
- //dModel.F_PutRecord = putRecord;
- //dModel.F_ZXZType = zXZType;
- //dModel.F_CasePartyId = CasePartyId;
- //dModel.F_ProblemTypeB = ProblemTypeB;
- //dModel.F_userAddress = userAddress;
- var res = false;
- dModel.F_RecCode = "0";// 0未外呼 1已执行外呼
- //dModel.F_CreateBy = "0";
- dModel.F_CreateOn = DateTime.Now;
- res = dBLL.Add(dModel) > 0;
- if (res)
- {
- return Success("成功");
- }
- else
- {
- return Error("失败");
- }
- }
- }
- }
|