Sfoglia il codice sorgente

Merge branch 'master' of http://192.168.1.222:3000/zhengbingbing/GXQGWH_API

zhengbingbing 5 anni fa
parent
commit
74d5846f3c

+ 28 - 7
codegit/CallCenterApi/CallCenterApi.DAL/T_Rec_RegRecords.cs

@@ -41,9 +41,9 @@ namespace CallCenterApi.DAL
41 41
         {
42 42
             StringBuilder strSql = new StringBuilder();
43 43
             strSql.Append("insert into T_Rec_RegRecords(");
44
-            strSql.Append("F_RecCode,F_CusID,F_Type,F_Direction,F_Complained,F_Content,F_Remark,F_CreateBy,F_CreateOn,F_IsDelete,F_DeleteOn,F_DeleteBy)");
44
+            strSql.Append("F_RecCode,F_CusID,F_Type,F_Direction,F_Complained,F_Content,F_Remark,F_CreateBy,F_CreateOn,F_IsDelete,F_DeleteOn,F_DeleteBy,F_Tel,F_CallId)");
45 45
             strSql.Append(" values (");
46
-            strSql.Append("@F_RecCode,@F_CusID,@F_Type,@F_Direction,@F_Complained,@F_Content,@F_Remark,@F_CreateBy,@F_CreateOn,@F_IsDelete,@F_DeleteOn,@F_DeleteBy)");
46
+            strSql.Append("@F_RecCode,@F_CusID,@F_Type,@F_Direction,@F_Complained,@F_Content,@F_Remark,@F_CreateBy,@F_CreateOn,@F_IsDelete,@F_DeleteOn,@F_DeleteBy,@F_Tel,@F_CallId)");
47 47
             strSql.Append(";select @@IDENTITY");
48 48
             SqlParameter[] parameters = {
49 49
                     new SqlParameter("@F_RecCode", SqlDbType.NVarChar,50),
@@ -57,7 +57,11 @@ namespace CallCenterApi.DAL
57 57
                     new SqlParameter("@F_CreateOn", SqlDbType.DateTime),
58 58
                     new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
59 59
                     new SqlParameter("@F_DeleteOn", SqlDbType.VarChar,50),
60
-                    new SqlParameter("@F_DeleteBy", SqlDbType.DateTime)};
60
+                    new SqlParameter("@F_DeleteBy", SqlDbType.DateTime),
61
+                     new SqlParameter("@F_Tel", SqlDbType.VarChar,200),
62
+                      new SqlParameter("@F_CallId", SqlDbType.VarChar,50)
63
+                     
64
+            };
61 65
             parameters[0].Value = model.F_RecCode;
62 66
             parameters[1].Value = model.F_CusID;
63 67
             parameters[2].Value = model.F_Type;
@@ -70,7 +74,8 @@ namespace CallCenterApi.DAL
70 74
             parameters[9].Value = model.F_IsDelete;
71 75
             parameters[10].Value = model.F_DeleteOn;
72 76
             parameters[11].Value = model.F_DeleteBy;
73
-
77
+            parameters[12].Value = model.F_Tel;
78
+            parameters[13].Value = model.F_CallId;
74 79
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
75 80
             if (obj == null)
76 81
             {
@@ -99,7 +104,9 @@ namespace CallCenterApi.DAL
99 104
             strSql.Append("F_CreateOn=@F_CreateOn,");
100 105
             strSql.Append("F_IsDelete=@F_IsDelete,");
101 106
             strSql.Append("F_DeleteOn=@F_DeleteOn,");
102
-            strSql.Append("F_DeleteBy=@F_DeleteBy");
107
+            strSql.Append("F_DeleteBy=@F_DeleteBy,");
108
+            strSql.Append("F_Tel=@F_Tel,");
109
+            strSql.Append("F_CallId=@F_CallId");
103 110
             strSql.Append(" where F_ID=@F_ID");
104 111
             SqlParameter[] parameters = {
105 112
                     new SqlParameter("@F_RecCode", SqlDbType.NVarChar,50),
@@ -114,6 +121,9 @@ namespace CallCenterApi.DAL
114 121
                     new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
115 122
                     new SqlParameter("@F_DeleteOn", SqlDbType.VarChar,50),
116 123
                     new SqlParameter("@F_DeleteBy", SqlDbType.DateTime),
124
+                      new SqlParameter("@F_Tel", SqlDbType.VarChar,200),
125
+                       new SqlParameter("@F_CallId", SqlDbType.VarChar,50),
126
+                      
117 127
                     new SqlParameter("@F_ID", SqlDbType.Int,4)};
118 128
             parameters[0].Value = model.F_RecCode;
119 129
             parameters[1].Value = model.F_CusID;
@@ -127,8 +137,10 @@ namespace CallCenterApi.DAL
127 137
             parameters[9].Value = model.F_IsDelete;
128 138
             parameters[10].Value = model.F_DeleteOn;
129 139
             parameters[11].Value = model.F_DeleteBy;
130
-            parameters[12].Value = model.F_ID;
131
-
140
+            parameters[12].Value = model.F_Tel;
141
+            parameters[13].Value = model.F_CallId;
142
+            parameters[14].Value = model.F_ID;
143
+            
132 144
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
133 145
             if (rows > 0)
134 146
             {
@@ -270,6 +282,15 @@ namespace CallCenterApi.DAL
270 282
                 {
271 283
                     model.F_DeleteBy = DateTime.Parse(row["F_DeleteBy"].ToString());
272 284
                 }
285
+                if (row["F_Tel"] != null && row["F_Tel"].ToString() != "")
286
+                {
287
+                    model.F_Tel = row["F_Tel"].ToString();
288
+                }
289
+                if (row["F_CallId"] != null && row["F_CallId"].ToString() != "")
290
+                {
291
+                    model.F_CallId = row["F_CallId"].ToString();
292
+                }
293
+                
273 294
 
274 295
             }
275 296
             return model;

+ 36 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/RegRecords/RegRecordsController.cs

@@ -13,7 +13,7 @@ namespace CallCenterApi.Interface.Controllers.RegRecords
13 13
     public class RegRecordsController : BaseController
14 14
     {
15 15
         //获取列表
16
-        public ActionResult GetList(string key, string starttime,string endtime,string usercode, int direction=-1, int type=0, int pageindex = 1, int pagesize = 10)
16
+        public ActionResult GetList(string key,string tel, string starttime,string endtime,string usercode, int direction=-1, int type=0, int pageindex = 1, int pagesize = 10)
17 17
         {
18 18
             if (!Request.IsAuthenticated)
19 19
                 return NoToken("未知错误,请重新登录");
@@ -28,6 +28,11 @@ namespace CallCenterApi.Interface.Controllers.RegRecords
28 28
             {
29 29
                 sql += " and (F_RecCode like '%" + key.Trim() + "%' or F_Complained like '%" + key.Trim() + "%' or F_Content like '%" + key.Trim() + "%' or F_Remark like '%" + key.Trim() + "%')";
30 30
             }
31
+            if (!string.IsNullOrWhiteSpace(tel))
32
+            {
33
+                sql += " and F_Tel like '%" + tel.Trim() + "%' ";
34
+            }
35
+            
31 36
             if (!string.IsNullOrWhiteSpace(usercode))
32 37
                 sql += " and F_CreateBy='"+usercode+"'";
33 38
             if(type>0)
@@ -94,9 +99,35 @@ namespace CallCenterApi.Interface.Controllers.RegRecords
94 99
             return Success("获取成功", newobj);
95 100
            
96 101
         }
102
+        /// <summary>
103
+        /// 查询工单详情
104
+        /// </summary>
105
+        public ActionResult GetCallidDetails(string callid)
106
+        {
107
+            if (!Request.IsAuthenticated)
108
+                return NoToken("未知错误,请重新登录");
97 109
 
110
+
111
+            if (string.IsNullOrEmpty(callid))
112
+                {
113
+                    return Error("请输入正确的id");
114
+                }
115
+            BLL.T_Rec_RegRecords dBLL = new BLL.T_Rec_RegRecords();
116
+            var model = dBLL.GetModelList("F_CallId='" + callid + "'").FirstOrDefault();
117
+            if (model == null)
118
+                return Error("获取登记信息失败");
119
+            var cusmodel = new BLL.T_Cus_Customer().GetModel(model.F_CusID);
120
+            if (cusmodel == null)
121
+                return Error("获取档案信息失败");
122
+            var newobj = new
123
+            {
124
+                model = model,
125
+                cusmodel
126
+            };
127
+            return Success("获取成功", newobj);
128
+        }
98 129
         //添加
99
-        public ActionResult Save(int cusid,int type,int direction,string complained, string content, string remark, int id=0)
130
+        public ActionResult Save(string tel,string callid,int cusid,int type,int direction,string complained, string content, string remark, int id=0)
100 131
         {
101 132
             if (!Request.IsAuthenticated)
102 133
                 return NoToken("未知错误,请重新登录");
@@ -115,17 +146,19 @@ namespace CallCenterApi.Interface.Controllers.RegRecords
115 146
                 if (dModel == null)
116 147
                     return Error("获取信息失败");   
117 148
             }
149
+            dModel.F_Tel = tel;
118 150
             dModel.F_CusID = cusid;
119 151
             dModel.F_Type = type;
120 152
             dModel.F_Direction = direction;
121 153
             dModel.F_Complained = complained;
122 154
             dModel.F_Content = content;
123 155
             dModel.F_Remark = remark;
124
-
156
+            dModel.F_CallId = callid;
125 157
             var res = false;
126 158
             if(id>0)
127 159
             {
128 160
                 res = dBLL.Update(dModel);
161
+                
129 162
             }
130 163
             else
131 164
             {

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -84,7 +84,7 @@ namespace CallCenterApi.Interface.Controllers.tel
84 84
             DataTable dt = BLL.PagerBLL.GetListPager(
85 85
                 "T_Call_CallRecords WITH(NOLOCK) left join T_Sys_UserAccount on UserCode=F_UserCode  ",
86 86
                 "CallRecordsId",
87
-                "T_Call_CallRecords.*,T_Sys_UserAccount.F_UserName as UserName,T_Sys_UserAccount.F_SeartGroup,T_Sys_UserAccount.F_DeptId,(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName",
87
+                "T_Call_CallRecords.*,T_Sys_UserAccount.F_UserName as UserName,T_Sys_UserAccount.F_SeartGroup,T_Sys_UserAccount.F_DeptId,(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName,(select COUNT(1) from dbo.T_Rec_RegRecords where F_CallId = T_Call_CallRecords.CallId) as IsWorkeorder",
88 88
                 sql,
89 89
                 "ORDER BY CallRecordsId desc",
90 90
                 pagesize,

+ 13 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Rec_RegRecords.cs

@@ -28,6 +28,8 @@ namespace CallCenterApi.Model
28 28
         private int? _f_isdelete;
29 29
         private string _f_deleteon;
30 30
         private DateTime? _f_deleteby;
31
+        private string _f_tel;
32
+        private string _f_callid;
31 33
         /// <summary>
32 34
         /// 
33 35
         /// </summary>
@@ -36,6 +38,17 @@ namespace CallCenterApi.Model
36 38
             set { _f_id = value; }
37 39
             get { return _f_id; }
38 40
         }
41
+        
42
+        public string F_CallId
43
+        {
44
+            set { _f_callid = value; }
45
+            get { return _f_callid; }
46
+        }
47
+        public string F_Tel
48
+        {
49
+            set { _f_tel = value; }
50
+            get { return _f_tel; }
51
+        }
39 52
         /// <summary>
40 53
         /// 登记编号
41 54
         /// </summary>