Browse Source

三方通话一键转接,客户档案,工单

duhongyu 6 years ago
parent
commit
77bf54d6fb
19 changed files with 3598 additions and 1765 deletions
  1. 133 0
      codegit/CallCenterApi/CallCenterApi.BLL/T_Con_Conversation.cs
  2. 138 0
      codegit/CallCenterApi/CallCenterApi.BLL/T_Wo_WorkOrderNew.cs
  3. 313 0
      codegit/CallCenterApi/CallCenterApi.DAL/T_Con_Conversation.cs
  4. 25 7
      codegit/CallCenterApi/CallCenterApi.DAL/T_Cus_CustomerBaseNew.cs
  5. 15 6
      codegit/CallCenterApi/CallCenterApi.DAL/T_SMS_List.cs
  6. 1 1
      codegit/CallCenterApi/CallCenterApi.DAL/T_SMS_Template.cs
  7. 16 7
      codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrder.cs
  8. 583 0
      codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrderNew.cs
  9. 364 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/ConversationController.cs
  10. 430 930
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs
  11. 527 810
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs
  12. 14 2
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallOutScreenController.cs
  13. 552 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs
  14. 2 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Enum/EnumWorkOrderState.cs
  15. 99 0
      codegit/CallCenterApi/CallCenterApi.Model/T_Con_Conversation.cs
  16. 20 2
      codegit/CallCenterApi/CallCenterApi.Model/T_Cus_CustomerBaseNew.cs
  17. 9 0
      codegit/CallCenterApi/CallCenterApi.Model/T_SMS_List.cs
  18. 7 0
      codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrder.cs
  19. 350 0
      codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrderNew.cs

+ 133 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Con_Conversation.cs

@@ -0,0 +1,133 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+namespace CallCenterApi.BLL
8
+{
9
+    /// <summary>
10
+    /// T_Con_Conversation
11
+    /// </summary>
12
+    public partial class T_Con_Conversation
13
+    {
14
+        private readonly CallCenterApi.DAL.T_Con_Conversation dal = new CallCenterApi.DAL.T_Con_Conversation();
15
+        public T_Con_Conversation()
16
+        { }
17
+        #region  BasicMethod
18
+
19
+        /// <summary>
20
+        /// 增加一条数据
21
+        /// </summary>
22
+        public int  Add(CallCenterApi.Model.T_Con_Conversation model)
23
+        {
24
+            return dal.Add(model);
25
+        }
26
+
27
+        /// <summary>
28
+        /// 更新一条数据
29
+        /// </summary>
30
+        public bool Update(CallCenterApi.Model.T_Con_Conversation model)
31
+        {
32
+            return dal.Update(model);
33
+        }
34
+
35
+        /// <summary>
36
+        /// 删除一条数据
37
+        /// </summary>
38
+        public bool Delete()
39
+        {
40
+            //该表无主键信息,请自定义主键/条件字段
41
+            return dal.Delete();
42
+        }
43
+
44
+        /// <summary>
45
+        /// 得到一个对象实体
46
+        /// </summary>
47
+        public CallCenterApi.Model.T_Con_Conversation GetModel(int id)
48
+        {
49
+            return dal.GetModel( id);
50
+        }
51
+
52
+
53
+        /// <summary>
54
+        /// 获得数据列表
55
+        /// </summary>
56
+        public DataSet GetList(string strWhere)
57
+        {
58
+            return dal.GetList(strWhere);
59
+        }
60
+        /// <summary>
61
+        /// 获得前几行数据
62
+        /// </summary>
63
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
64
+        {
65
+            return dal.GetList(Top, strWhere, filedOrder);
66
+        }
67
+        /// <summary>
68
+        /// 获得数据列表
69
+        /// </summary>
70
+        public List<CallCenterApi.Model.T_Con_Conversation> GetModelList(string strWhere)
71
+        {
72
+            DataSet ds = dal.GetList(strWhere);
73
+            return DataTableToList(ds.Tables[0]);
74
+        }
75
+        /// <summary>
76
+        /// 获得数据列表
77
+        /// </summary>
78
+        public List<CallCenterApi.Model.T_Con_Conversation> DataTableToList(DataTable dt)
79
+        {
80
+            List<CallCenterApi.Model.T_Con_Conversation> modelList = new List<CallCenterApi.Model.T_Con_Conversation>();
81
+            int rowsCount = dt.Rows.Count;
82
+            if (rowsCount > 0)
83
+            {
84
+                CallCenterApi.Model.T_Con_Conversation model;
85
+                for (int n = 0; n < rowsCount; n++)
86
+                {
87
+                    model = dal.DataRowToModel(dt.Rows[n]);
88
+                    if (model != null)
89
+                    {
90
+                        modelList.Add(model);
91
+                    }
92
+                }
93
+            }
94
+            return modelList;
95
+        }
96
+
97
+        /// <summary>
98
+        /// 获得数据列表
99
+        /// </summary>
100
+        public DataSet GetAllList()
101
+        {
102
+            return GetList("");
103
+        }
104
+
105
+        /// <summary>
106
+        /// 分页获取数据列表
107
+        /// </summary>
108
+        public int GetRecordCount(string strWhere)
109
+        {
110
+            return dal.GetRecordCount(strWhere);
111
+        }
112
+        /// <summary>
113
+        /// 分页获取数据列表
114
+        /// </summary>
115
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
116
+        {
117
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
118
+        }
119
+        /// <summary>
120
+        /// 分页获取数据列表
121
+        /// </summary>
122
+        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
123
+        //{
124
+        //return dal.GetList(PageSize,PageIndex,strWhere);
125
+        //}
126
+
127
+        #endregion  BasicMethod
128
+        #region  ExtensionMethod
129
+
130
+        #endregion  ExtensionMethod
131
+    }
132
+}
133
+

+ 138 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Wo_WorkOrderNew.cs

@@ -0,0 +1,138 @@
1
+using System;
2
+using System.Data;
3
+using System.Collections.Generic;
4
+using CallCenterApi.Model;
5
+namespace CallCenterApi.BLL
6
+{
7
+    /// <summary>
8
+    /// T_Wo_WorkOrderNew
9
+    /// </summary>
10
+    public partial class T_Wo_WorkOrderNew
11
+    {
12
+        private readonly CallCenterApi.DAL.T_Wo_WorkOrderNew dal = new CallCenterApi.DAL.T_Wo_WorkOrderNew();
13
+        public T_Wo_WorkOrderNew()
14
+        { }
15
+        #region  BasicMethod
16
+
17
+        /// <summary>
18
+        /// 增加一条数据
19
+        /// </summary>
20
+        public int  Add(CallCenterApi.Model.T_Wo_WorkOrderNew model)
21
+        {
22
+            return dal.Add(model);
23
+        }
24
+
25
+        /// <summary>
26
+        /// 更新一条数据
27
+        /// </summary>
28
+        public bool Update(CallCenterApi.Model.T_Wo_WorkOrderNew model)
29
+        {
30
+            return dal.Update(model);
31
+        }
32
+
33
+        /// <summary>
34
+        /// 删除一条数据
35
+        /// </summary>
36
+        public bool Delete()
37
+        {
38
+            //该表无主键信息,请自定义主键/条件字段
39
+            return dal.Delete();
40
+        }
41
+        /// <summary>
42
+        /// 删除一条数据
43
+        /// </summary>
44
+        public bool DeleteList(string IDlist)
45
+        {
46
+            return dal.DeleteList(IDlist);
47
+        }
48
+        /// <summary>
49
+        /// 得到一个对象实体
50
+        /// </summary>
51
+        public CallCenterApi.Model.T_Wo_WorkOrderNew GetModel(long ID)
52
+        {
53
+            
54
+            return dal.GetModel(ID);
55
+        }
56
+
57
+
58
+        /// <summary>
59
+        /// 获得数据列表
60
+        /// </summary>
61
+        public DataSet GetList(string strWhere)
62
+        {
63
+            return dal.GetList(strWhere);
64
+        }
65
+        /// <summary>
66
+        /// 获得前几行数据
67
+        /// </summary>
68
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
69
+        {
70
+            return dal.GetList(Top, strWhere, filedOrder);
71
+        }
72
+        /// <summary>
73
+        /// 获得数据列表
74
+        /// </summary>
75
+        public List<CallCenterApi.Model.T_Wo_WorkOrderNew> GetModelList(string strWhere)
76
+        {
77
+            DataSet ds = dal.GetList(strWhere);
78
+            return DataTableToList(ds.Tables[0]);
79
+        }
80
+        /// <summary>
81
+        /// 获得数据列表
82
+        /// </summary>
83
+        public List<CallCenterApi.Model.T_Wo_WorkOrderNew> DataTableToList(DataTable dt)
84
+        {
85
+            List<CallCenterApi.Model.T_Wo_WorkOrderNew> modelList = new List<CallCenterApi.Model.T_Wo_WorkOrderNew>();
86
+            int rowsCount = dt.Rows.Count;
87
+            if (rowsCount > 0)
88
+            {
89
+                CallCenterApi.Model.T_Wo_WorkOrderNew model;
90
+                for (int n = 0; n < rowsCount; n++)
91
+                {
92
+                    model = dal.DataRowToModel(dt.Rows[n]);
93
+                    if (model != null)
94
+                    {
95
+                        modelList.Add(model);
96
+                    }
97
+                }
98
+            }
99
+            return modelList;
100
+        }
101
+
102
+        /// <summary>
103
+        /// 获得数据列表
104
+        /// </summary>
105
+        public DataSet GetAllList()
106
+        {
107
+            return GetList("");
108
+        }
109
+
110
+        /// <summary>
111
+        /// 分页获取数据列表
112
+        /// </summary>
113
+        public int GetRecordCount(string strWhere)
114
+        {
115
+            return dal.GetRecordCount(strWhere);
116
+        }
117
+        /// <summary>
118
+        /// 分页获取数据列表
119
+        /// </summary>
120
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
121
+        {
122
+            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
123
+        }
124
+        /// <summary>
125
+        /// 分页获取数据列表
126
+        /// </summary>
127
+        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
128
+        //{
129
+        //return dal.GetList(PageSize,PageIndex,strWhere);
130
+        //}
131
+
132
+        #endregion  BasicMethod
133
+        #region  ExtensionMethod
134
+
135
+        #endregion  ExtensionMethod
136
+    }
137
+}
138
+

+ 313 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Con_Conversation.cs

@@ -0,0 +1,313 @@
1
+
2
+using System;
3
+using System.Data;
4
+using System.Text;
5
+using System.Data.SqlClient;
6
+using CallCenterApi.DB;
7
+
8
+namespace CallCenterApi.DAL
9
+{
10
+    /// <summary>
11
+    /// 数据访问类:T_Con_Conversation
12
+    /// </summary>
13
+    public partial class T_Con_Conversation
14
+    {
15
+        public T_Con_Conversation()
16
+        { }
17
+        #region  BasicMethod
18
+
19
+
20
+
21
+        /// <summary>
22
+        /// 增加一条数据
23
+        /// </summary>
24
+        public int  Add(CallCenterApi.Model.T_Con_Conversation model)
25
+        {
26
+            StringBuilder strSql = new StringBuilder();
27
+            strSql.Append("insert into T_Con_Conversation(");
28
+            strSql.Append("F_Type,F_Department,F_Section,F_Telephone,F_Physician,F_Title,F_IsDelete,F_FileId)");
29
+            strSql.Append(" values (");
30
+            strSql.Append("@F_Type,@F_Department,@F_Section,@F_Telephone,@F_Physician,@F_Title,@F_IsDelete,@F_FileId)");
31
+            strSql.Append(";select @@IDENTITY");
32
+            SqlParameter[] parameters = {
33
+                    new SqlParameter("@F_Type", SqlDbType.Int,4),
34
+                    new SqlParameter("@F_Department", SqlDbType.VarChar,200),
35
+                    new SqlParameter("@F_Section", SqlDbType.VarChar,200),
36
+                    new SqlParameter("@F_Telephone", SqlDbType.VarChar,200),
37
+                    new SqlParameter("@F_Physician", SqlDbType.VarChar,200),
38
+                    new SqlParameter("@F_Title", SqlDbType.VarChar,200),
39
+                    new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
40
+                    new SqlParameter("@F_FileId", SqlDbType.Int,4)};
41
+            parameters[0].Value = model.F_Type;
42
+            parameters[1].Value = model.F_Department;
43
+            parameters[2].Value = model.F_Section;
44
+            parameters[3].Value = model.F_Telephone;
45
+            parameters[4].Value = model.F_Physician;
46
+            parameters[5].Value = model.F_Title;
47
+            parameters[6].Value = model.F_IsDelete;
48
+            parameters[7].Value = model.F_FileId;
49
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
50
+            return rows;
51
+          
52
+        }
53
+        /// <summary>
54
+        /// 更新一条数据
55
+        /// </summary>
56
+        public bool Update(CallCenterApi.Model.T_Con_Conversation model)
57
+        {
58
+            StringBuilder strSql = new StringBuilder();
59
+            strSql.Append("update T_Con_Conversation set ");
60
+            strSql.Append("F_Type=@F_Type,");
61
+            strSql.Append("F_Department=@F_Department,");
62
+            strSql.Append("F_Section=@F_Section,");
63
+            strSql.Append("F_Telephone=@F_Telephone,");
64
+            strSql.Append("F_Physician=@F_Physician,");
65
+            strSql.Append("F_Title=@F_Title,");
66
+            strSql.Append("F_IsDelete=@F_IsDelete,");
67
+            strSql.Append("F_FileId=@F_FileId");
68
+            strSql.Append(" where ID=@ID ");
69
+            SqlParameter[] parameters = {
70
+                    new SqlParameter("@F_Type", SqlDbType.Int,4),
71
+                    new SqlParameter("@F_Department", SqlDbType.VarChar,200),
72
+                    new SqlParameter("@F_Section", SqlDbType.VarChar,200),
73
+                    new SqlParameter("@F_Telephone", SqlDbType.VarChar,200),
74
+                    new SqlParameter("@F_Physician", SqlDbType.VarChar,200),
75
+                    new SqlParameter("@F_Title", SqlDbType.VarChar,200),
76
+                    new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
77
+                    new SqlParameter("@F_FileId", SqlDbType.Int,4),
78
+              new SqlParameter("@ID", SqlDbType.Int,4)};
79
+
80
+            parameters[0].Value = model.F_Type;
81
+            parameters[1].Value = model.F_Department;
82
+            parameters[2].Value = model.F_Section;
83
+            parameters[3].Value = model.F_Telephone;
84
+            parameters[4].Value = model.F_Physician;
85
+            parameters[5].Value = model.F_Title;
86
+            parameters[6].Value = model.F_IsDelete;
87
+            parameters[7].Value = model.F_FileId;
88
+            parameters[8].Value = model.ID;
89
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
90
+            if (rows > 0)
91
+            {
92
+                return true;
93
+            }
94
+            else
95
+            {
96
+                return false;
97
+            }
98
+        }
99
+
100
+        /// <summary>
101
+        /// 删除一条数据
102
+        /// </summary>
103
+        public bool Delete()
104
+        {
105
+            //该表无主键信息,请自定义主键/条件字段
106
+            StringBuilder strSql = new StringBuilder();
107
+            strSql.Append("delete from T_Con_Conversation ");
108
+            strSql.Append(" where ");
109
+            SqlParameter[] parameters = {
110
+            };
111
+
112
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
113
+            if (rows > 0)
114
+            {
115
+                return true;
116
+            }
117
+            else
118
+            {
119
+                return false;
120
+            }
121
+        }
122
+
123
+
124
+        /// <summary>
125
+        /// 得到一个对象实体
126
+        /// </summary>
127
+           
128
+        public CallCenterApi.Model.T_Con_Conversation GetModel(int id)
129
+        {
130
+            //该表无主键信息,请自定义主键/条件字段
131
+            StringBuilder strSql = new StringBuilder();
132
+            strSql.Append("select  top 1  from T_Con_Conversation ");
133
+            strSql.Append(" where ID=@ID");
134
+            SqlParameter[] parameters = {
135
+                 new SqlParameter("@ID", SqlDbType.Int,4)
136
+            };
137
+            parameters[0].Value = id;
138
+            CallCenterApi.Model.T_Con_Conversation model = new CallCenterApi.Model.T_Con_Conversation();
139
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
140
+            if (ds.Tables[0].Rows.Count > 0)
141
+            {
142
+                return DataRowToModel(ds.Tables[0].Rows[0]);
143
+            }
144
+            else
145
+            {
146
+                return null;
147
+            }
148
+        }
149
+
150
+
151
+        /// <summary>
152
+        /// 得到一个对象实体
153
+        /// </summary>
154
+        public CallCenterApi.Model.T_Con_Conversation DataRowToModel(DataRow row)
155
+        {
156
+            CallCenterApi.Model.T_Con_Conversation model = new CallCenterApi.Model.T_Con_Conversation();
157
+            if (row != null)
158
+            {
159
+                if (row["ID"] != null && row["ID"].ToString() != "")
160
+                {
161
+                    model.ID = long.Parse(row["ID"].ToString());
162
+                }
163
+                if (row["F_Type"] != null && row["F_Type"].ToString() != "")
164
+                {
165
+                    model.F_Type = int.Parse(row["F_Type"].ToString());
166
+                }
167
+                if (row["F_Department"] != null)
168
+                {
169
+                    model.F_Department = row["F_Department"].ToString();
170
+                }
171
+                if (row["F_Section"] != null)
172
+                {
173
+                    model.F_Section = row["F_Section"].ToString();
174
+                }
175
+                if (row["F_Telephone"] != null)
176
+                {
177
+                    model.F_Telephone = row["F_Telephone"].ToString();
178
+                }
179
+                if (row["F_Physician"] != null)
180
+                {
181
+                    model.F_Physician = row["F_Physician"].ToString();
182
+                }
183
+                if (row["F_Title"] != null)
184
+                {
185
+                    model.F_Title = row["F_Title"].ToString();
186
+                }
187
+                if (row["F_IsDelete"] != null && row["F_IsDelete"].ToString() != "")
188
+                {
189
+                    model.F_IsDelete = int.Parse(row["F_IsDelete"].ToString());
190
+                }
191
+                if (row["F_FileId"] != null && row["F_FileId"].ToString() != "")
192
+                {
193
+                    model.F_FileId = int.Parse(row["F_FileId"].ToString());
194
+                }
195
+            }
196
+            return model;
197
+        }
198
+
199
+        /// <summary>
200
+        /// 获得数据列表
201
+        /// </summary>
202
+        public DataSet GetList(string strWhere)
203
+        {
204
+            StringBuilder strSql = new StringBuilder();
205
+            strSql.Append("select ID,F_Type,F_Department,F_Section,F_Telephone,F_Physician,F_Title,F_IsDelete,F_FileId ");
206
+            strSql.Append(" FROM T_Con_Conversation ");
207
+            if (strWhere.Trim() != "")
208
+            {
209
+                strSql.Append(" where " + strWhere);
210
+            }
211
+            return DbHelperSQL.Query(strSql.ToString());
212
+        }
213
+
214
+        /// <summary>
215
+        /// 获得前几行数据
216
+        /// </summary>
217
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
218
+        {
219
+            StringBuilder strSql = new StringBuilder();
220
+            strSql.Append("select ");
221
+            if (Top > 0)
222
+            {
223
+                strSql.Append(" top " + Top.ToString());
224
+            }
225
+            strSql.Append(" ID,F_Type,F_Department,F_Section,F_Telephone,F_Physician,F_Title,F_IsDelete,F_FileId ");
226
+            strSql.Append(" FROM T_Con_Conversation ");
227
+            if (strWhere.Trim() != "")
228
+            {
229
+                strSql.Append(" where " + strWhere);
230
+            }
231
+            strSql.Append(" order by " + filedOrder);
232
+            return DbHelperSQL.Query(strSql.ToString());
233
+        }
234
+
235
+        /// <summary>
236
+        /// 获取记录总数
237
+        /// </summary>
238
+        public int GetRecordCount(string strWhere)
239
+        {
240
+            StringBuilder strSql = new StringBuilder();
241
+            strSql.Append("select count(1) FROM T_Con_Conversation ");
242
+            if (strWhere.Trim() != "")
243
+            {
244
+                strSql.Append(" where " + strWhere);
245
+            }
246
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
247
+            if (obj == null)
248
+            {
249
+                return 0;
250
+            }
251
+            else
252
+            {
253
+                return Convert.ToInt32(obj);
254
+            }
255
+        }
256
+        /// <summary>
257
+        /// 分页获取数据列表
258
+        /// </summary>
259
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
260
+        {
261
+            StringBuilder strSql = new StringBuilder();
262
+            strSql.Append("SELECT * FROM ( ");
263
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
264
+            if (!string.IsNullOrEmpty(orderby.Trim()))
265
+            {
266
+                strSql.Append("order by T." + orderby);
267
+            }
268
+            else
269
+            {
270
+                strSql.Append("order by T. desc");
271
+            }
272
+            strSql.Append(")AS Row, T.*  from T_Con_Conversation T ");
273
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
274
+            {
275
+                strSql.Append(" WHERE " + strWhere);
276
+            }
277
+            strSql.Append(" ) TT");
278
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
279
+            return DbHelperSQL.Query(strSql.ToString());
280
+        }
281
+
282
+        /*
283
+		/// <summary>
284
+		/// 分页获取数据列表
285
+		/// </summary>
286
+		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
287
+		{
288
+			SqlParameter[] parameters = {
289
+					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
290
+					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
291
+					new SqlParameter("@PageSize", SqlDbType.Int),
292
+					new SqlParameter("@PageIndex", SqlDbType.Int),
293
+					new SqlParameter("@IsReCount", SqlDbType.Bit),
294
+					new SqlParameter("@OrderType", SqlDbType.Bit),
295
+					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
296
+					};
297
+			parameters[0].Value = "T_Con_Conversation";
298
+			parameters[1].Value = "";
299
+			parameters[2].Value = PageSize;
300
+			parameters[3].Value = PageIndex;
301
+			parameters[4].Value = 0;
302
+			parameters[5].Value = 0;
303
+			parameters[6].Value = strWhere;	
304
+			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
305
+		}*/
306
+
307
+        #endregion  BasicMethod
308
+        #region  ExtensionMethod
309
+
310
+        #endregion  ExtensionMethod
311
+    }
312
+}
313
+

File diff suppressed because it is too large
+ 25 - 7
codegit/CallCenterApi/CallCenterApi.DAL/T_Cus_CustomerBaseNew.cs


+ 15 - 6
codegit/CallCenterApi/CallCenterApi.DAL/T_SMS_List.cs

@@ -38,9 +38,9 @@ namespace CallCenterApi.DAL
38 38
         {
39 39
             StringBuilder strSql = new StringBuilder();
40 40
             strSql.Append("insert into T_SMS_List(");
41
-            strSql.Append("Type,SendWay,DSSendTime,SendTime,IsSend,Telephone,Detail,MBID,MID,MName,CreateDate,BatchNo)");
41
+            strSql.Append("Type,SendWay,DSSendTime,SendTime,IsSend,Telephone,Detail,MBID,MID,MName,CreateDate,BatchNo,F_IsDelete)");
42 42
             strSql.Append(" values (");
43
-            strSql.Append("@Type,@SendWay,@DSSendTime,@SendTime,@IsSend,@Telephone,@Detail,@MBID,@MID,@MName,@CreateDate,@BatchNo)");
43
+            strSql.Append("@Type,@SendWay,@DSSendTime,@SendTime,@IsSend,@Telephone,@Detail,@MBID,@MID,@MName,@CreateDate,@BatchNo,@F_IsDelete)");
44 44
             strSql.Append(";select @@IDENTITY");
45 45
             SqlParameter[] parameters = {
46 46
                     new SqlParameter("@Type", SqlDbType.Int,4),
@@ -54,6 +54,7 @@ namespace CallCenterApi.DAL
54 54
                     new SqlParameter("@MID", SqlDbType.VarChar,50),
55 55
                     new SqlParameter("@MName", SqlDbType.VarChar,50),
56 56
                     new SqlParameter("@CreateDate", SqlDbType.DateTime),
57
+                     new SqlParameter("@F_IsDelete",SqlDbType.Int,4),
57 58
                     new SqlParameter("@BatchNo", SqlDbType.VarChar,50)};
58 59
             parameters[0].Value = model.Type;
59 60
             parameters[1].Value = model.SendWay;
@@ -66,7 +67,8 @@ namespace CallCenterApi.DAL
66 67
             parameters[8].Value = model.MID;
67 68
             parameters[9].Value = model.MName;
68 69
             parameters[10].Value = model.CreateDate;
69
-            parameters[11].Value = model.BatchNo;
70
+            parameters[11].Value = model.F_IsDelete;
71
+            parameters[12].Value = model.BatchNo;
70 72
 
71 73
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
72 74
             if (obj == null)
@@ -96,6 +98,7 @@ namespace CallCenterApi.DAL
96 98
             strSql.Append("MID=@MID,");
97 99
             strSql.Append("MName=@MName,");
98 100
             strSql.Append("CreateDate=@CreateDate,");
101
+            strSql.Append("F_IsDelete=@F_IsDelete,");
99 102
             strSql.Append("BatchNo=@BatchNo");
100 103
             strSql.Append(" where ID=@ID");
101 104
             SqlParameter[] parameters = {
@@ -110,6 +113,7 @@ namespace CallCenterApi.DAL
110 113
                     new SqlParameter("@MID", SqlDbType.VarChar,50),
111 114
                     new SqlParameter("@MName", SqlDbType.VarChar,50),
112 115
                     new SqlParameter("@CreateDate", SqlDbType.DateTime),
116
+                     new SqlParameter("@F_IsDelete", SqlDbType.Int,4),
113 117
                     new SqlParameter("@BatchNo", SqlDbType.VarChar,50),
114 118
                     new SqlParameter("@ID", SqlDbType.Int,4)};
115 119
             parameters[0].Value = model.Type;
@@ -123,8 +127,9 @@ namespace CallCenterApi.DAL
123 127
             parameters[8].Value = model.MID;
124 128
             parameters[9].Value = model.MName;
125 129
             parameters[10].Value = model.CreateDate;
126
-            parameters[11].Value = model.BatchNo;
127
-            parameters[12].Value = model.ID;
130
+            parameters[11].Value = model.F_IsDelete;
131
+            parameters[12].Value = model.BatchNo;
132
+            parameters[13].Value = model.ID;
128 133
 
129 134
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
130 135
             if (rows > 0)
@@ -167,7 +172,7 @@ namespace CallCenterApi.DAL
167 172
         public bool DeleteList(string IDlist)
168 173
         {
169 174
             StringBuilder strSql = new StringBuilder();
170
-            strSql.Append("delete from T_SMS_List ");
175
+            strSql.Append("update T_SMS_List set F_IsDelete=1 ");
171 176
             strSql.Append(" where ID in (" + IDlist + ")  ");
172 177
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
173 178
             if (rows > 0)
@@ -240,6 +245,10 @@ namespace CallCenterApi.DAL
240 245
                 {
241 246
                     model.IsSend = int.Parse(row["IsSend"].ToString());
242 247
                 }
248
+                if (row["F_IsDelete"] != null && row["F_IsDelete"].ToString() != "")
249
+                {
250
+                    model.F_IsDelete = int.Parse(row["F_IsDelete"].ToString());
251
+                }
243 252
                 if (row["Telephone"] != null)
244 253
                 {
245 254
                     model.Telephone = row["Telephone"].ToString();

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.DAL/T_SMS_Template.cs

@@ -156,7 +156,7 @@ namespace CallCenterApi.DAL
156 156
         public bool DeleteList(string IDlist)
157 157
         {
158 158
             StringBuilder strSql = new StringBuilder();
159
-            strSql.Append("delete from T_SMS_Template ");
159
+            strSql.Append("update T_SMS_Template set IsEnable=1  ");
160 160
             strSql.Append(" where ID in (" + IDlist + ")  ");
161 161
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
162 162
             if (rows > 0)

File diff suppressed because it is too large
+ 16 - 7
codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrder.cs


+ 583 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Wo_WorkOrderNew.cs

@@ -0,0 +1,583 @@
1
+using System;
2
+using System.Data;
3
+using System.Text;
4
+using System.Data.SqlClient;
5
+using CallCenterApi.DB;
6
+
7
+namespace CallCenterApi.DAL
8
+{
9
+    /// <summary>
10
+    /// 数据访问类:T_Wo_WorkOrderNew
11
+    /// </summary>
12
+    public partial class T_Wo_WorkOrderNew
13
+    {
14
+        public T_Wo_WorkOrderNew()
15
+        { }
16
+        #region  BasicMethod
17
+
18
+
19
+
20
+        /// <summary>
21
+        /// 增加一条数据
22
+        /// </summary>
23
+        public int Add(CallCenterApi.Model.T_Wo_WorkOrderNew model)
24
+        {
25
+            StringBuilder strSql = new StringBuilder();
26
+            strSql.Append("insert into T_Wo_WorkOrderNew(");
27
+            strSql.Append("WorkOrderID,CustomerName,CustomerTel,Gender,Location,Reservation,IDnumber,Department,Expert,AppointmentTime,IsMedical,Project,TranDepartment,DriveoutTime,AboutcarMan,CarTel,Condition,IsCar,TreatmentAddress,ComplaintDepartment,ComplaintTarget,IsRelevant,Remarks,Problem,IsOver,DealContents,DealTime,F_State,Files,CreateTime,Createby,CallID,IsDelete,DelTime,TypeClass,DealBy)");
28
+            strSql.Append(" values (");
29
+            strSql.Append("@WorkOrderID,@CustomerName,@CustomerTel,@Gender,@Location,@Reservation,@IDnumber,@Department,@Expert,@AppointmentTime,@IsMedical,@Project,@TranDepartment,@DriveoutTime,@AboutcarMan,@CarTel,@Condition,@IsCar,@TreatmentAddress,@ComplaintDepartment,@ComplaintTarget,@IsRelevant,@Remarks,@Problem,@IsOver,@DealContents,@DealTime,@F_State,@Files,@CreateTime,@Createby,@CallID,@IsDelete,@DelTime,@TypeClass,@DealBy)");
30
+            strSql.Append(";select @@IDENTITY");
31
+            SqlParameter[] parameters = {
32
+                   
33
+                    new SqlParameter("@WorkOrderID", SqlDbType.VarChar,-1),
34
+                    new SqlParameter("@CustomerName", SqlDbType.VarChar,200),
35
+                    new SqlParameter("@CustomerTel", SqlDbType.VarChar,200),
36
+                    new SqlParameter("@Gender", SqlDbType.Int,4),
37
+                    new SqlParameter("@Location", SqlDbType.VarChar,-1),
38
+                    new SqlParameter("@Reservation", SqlDbType.VarChar,200),
39
+                    new SqlParameter("@IDnumber", SqlDbType.VarChar,-1),
40
+                    new SqlParameter("@Department", SqlDbType.VarChar,200),
41
+                    new SqlParameter("@Expert", SqlDbType.VarChar,-1),
42
+                    new SqlParameter("@AppointmentTime", SqlDbType.DateTime),
43
+                    new SqlParameter("@IsMedical", SqlDbType.Int,4),
44
+                    new SqlParameter("@Project", SqlDbType.VarChar,-1),
45
+                    new SqlParameter("@TranDepartment", SqlDbType.VarChar,200),
46
+                    new SqlParameter("@DriveoutTime", SqlDbType.DateTime),
47
+                    new SqlParameter("@AboutcarMan", SqlDbType.VarChar,-1),
48
+                    new SqlParameter("@CarTel", SqlDbType.VarChar,-1),
49
+                    new SqlParameter("@Condition", SqlDbType.VarChar,-1),
50
+                    new SqlParameter("@IsCar", SqlDbType.Int,4),
51
+                    new SqlParameter("@TreatmentAddress", SqlDbType.VarChar,-1),
52
+                    new SqlParameter("@ComplaintDepartment", SqlDbType.VarChar,200),
53
+                    new SqlParameter("@ComplaintTarget", SqlDbType.VarChar,200),
54
+                    new SqlParameter("@IsRelevant", SqlDbType.Int,4),
55
+                    new SqlParameter("@Remarks", SqlDbType.VarChar,-1),
56
+                    new SqlParameter("@Problem", SqlDbType.VarChar,-1),
57
+                    new SqlParameter("@IsOver", SqlDbType.Int,4),
58
+                    new SqlParameter("@DealContents", SqlDbType.VarChar,-1),
59
+                    new SqlParameter("@DealTime", SqlDbType.DateTime),
60
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
61
+                    new SqlParameter("@Files", SqlDbType.VarChar,-1),
62
+                    new SqlParameter("@CreateTime", SqlDbType.DateTime),
63
+                    new SqlParameter("@Createby", SqlDbType.VarChar,100),
64
+                    new SqlParameter("@CallID", SqlDbType.VarChar,100),
65
+                    new SqlParameter("@IsDelete", SqlDbType.Int,4),
66
+                    new SqlParameter("@DelTime", SqlDbType.DateTime),
67
+                    new SqlParameter("@TypeClass", SqlDbType.NVarChar,200),
68
+            new SqlParameter("@DealBy", SqlDbType.NVarChar,200)};
69
+            parameters[0].Value = model.WorkOrderID;
70
+            parameters[1].Value = model.CustomerName;
71
+            parameters[2].Value = model.CustomerTel;
72
+            parameters[3].Value = model.Gender;
73
+            parameters[4].Value = model.Location;
74
+            parameters[5].Value = model.Reservation;
75
+            parameters[6].Value = model.IDnumber;
76
+            parameters[7].Value = model.Department;
77
+            parameters[8].Value = model.Expert;
78
+            parameters[9].Value = model.AppointmentTime;
79
+            parameters[10].Value = model.IsMedical;
80
+            parameters[11].Value = model.Project;
81
+            parameters[12].Value = model.TranDepartment;
82
+            parameters[13].Value = model.DriveoutTime;
83
+            parameters[14].Value = model.AboutcarMan;
84
+            parameters[15].Value = model.CarTel;
85
+            parameters[16].Value = model.Condition;
86
+            parameters[17].Value = model.IsCar;
87
+            parameters[18].Value = model.TreatmentAddress;
88
+            parameters[19].Value = model.ComplaintDepartment;
89
+            parameters[20].Value = model.ComplaintTarget;
90
+            parameters[21].Value = model.IsRelevant;
91
+            parameters[22].Value = model.Remarks;
92
+            parameters[23].Value = model.Problem;
93
+            parameters[24].Value = model.IsOver;
94
+            parameters[25].Value = model.DealContents;
95
+            parameters[26].Value = model.DealTime;
96
+            parameters[27].Value = model.F_State;
97
+            parameters[28].Value = model.Files;
98
+            parameters[29].Value = model.CreateTime;
99
+            parameters[30].Value = model.Createby;
100
+            parameters[31].Value = model.CallID;
101
+            parameters[32].Value = model.IsDelete;
102
+            parameters[33].Value = model.DelTime;
103
+            parameters[34].Value = model.TypeClass;
104
+            parameters[35].Value = model.DealBy;
105
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
106
+            return rows;
107
+           
108
+        }
109
+        /// <summary>
110
+        /// 更新一条数据
111
+        /// </summary>
112
+        public bool Update(CallCenterApi.Model.T_Wo_WorkOrderNew model)
113
+        {
114
+            StringBuilder strSql = new StringBuilder();
115
+            strSql.Append("update T_Wo_WorkOrderNew set ");
116
+          
117
+            strSql.Append("WorkOrderID=@WorkOrderID,");
118
+            strSql.Append("CustomerName=@CustomerName,");
119
+            strSql.Append("CustomerTel=@CustomerTel,");
120
+            strSql.Append("Gender=@Gender,");
121
+            strSql.Append("Location=@Location,");
122
+            strSql.Append("Reservation=@Reservation,");
123
+            strSql.Append("IDnumber=@IDnumber,");
124
+            strSql.Append("Department=@Department,");
125
+            strSql.Append("Expert=@Expert,");
126
+            strSql.Append("AppointmentTime=@AppointmentTime,");
127
+            strSql.Append("IsMedical=@IsMedical,");
128
+            strSql.Append("Project=@Project,");
129
+            strSql.Append("TranDepartment=@TranDepartment,");
130
+            strSql.Append("DriveoutTime=@DriveoutTime,");
131
+            strSql.Append("AboutcarMan=@AboutcarMan,");
132
+            strSql.Append("CarTel=@CarTel,");
133
+            strSql.Append("Condition=@Condition,");
134
+            strSql.Append("IsCar=@IsCar,");
135
+            strSql.Append("TreatmentAddress=@TreatmentAddress,");
136
+            strSql.Append("ComplaintDepartment=@ComplaintDepartment,");
137
+            strSql.Append("ComplaintTarget=@ComplaintTarget,");
138
+            strSql.Append("IsRelevant=@IsRelevant,");
139
+            strSql.Append("Remarks=@Remarks,");
140
+            strSql.Append("Problem=@Problem,");
141
+            strSql.Append("IsOver=@IsOver,");
142
+            strSql.Append("DealContents=@DealContents,");
143
+            strSql.Append("DealTime=@DealTime,");
144
+            strSql.Append("F_State=@F_State,");
145
+            strSql.Append("Files=@Files,");
146
+            strSql.Append("CreateTime=@CreateTime,");
147
+            strSql.Append("Createby=@Createby,");
148
+            strSql.Append("CallID=@CallID,");
149
+            strSql.Append("IsDelete=@IsDelete,");
150
+            strSql.Append("DelTime=@DelTime,");
151
+            strSql.Append("TypeClass=@TypeClass,");
152
+            strSql.Append("DealBy=@DealBy");
153
+            strSql.Append(" where ID=@ID");
154
+            SqlParameter[] parameters = {
155
+                  
156
+                    new SqlParameter("@WorkOrderID", SqlDbType.VarChar,-1),
157
+                    new SqlParameter("@CustomerName", SqlDbType.VarChar,200),
158
+                    new SqlParameter("@CustomerTel", SqlDbType.VarChar,200),
159
+                    new SqlParameter("@Gender", SqlDbType.Int,4),
160
+                    new SqlParameter("@Location", SqlDbType.VarChar,-1),
161
+                    new SqlParameter("@Reservation", SqlDbType.VarChar,200),
162
+                    new SqlParameter("@IDnumber", SqlDbType.VarChar,-1),
163
+                    new SqlParameter("@Department", SqlDbType.VarChar,200),
164
+                    new SqlParameter("@Expert", SqlDbType.VarChar,-1),
165
+                    new SqlParameter("@AppointmentTime", SqlDbType.DateTime),
166
+                    new SqlParameter("@IsMedical", SqlDbType.Int,4),
167
+                    new SqlParameter("@Project", SqlDbType.VarChar,-1),
168
+                    new SqlParameter("@TranDepartment", SqlDbType.VarChar,200),
169
+                    new SqlParameter("@DriveoutTime", SqlDbType.DateTime),
170
+                    new SqlParameter("@AboutcarMan", SqlDbType.VarChar,-1),
171
+                    new SqlParameter("@CarTel", SqlDbType.VarChar,-1),
172
+                    new SqlParameter("@Condition", SqlDbType.VarChar,-1),
173
+                    new SqlParameter("@IsCar", SqlDbType.Int,4),
174
+                    new SqlParameter("@TreatmentAddress", SqlDbType.VarChar,-1),
175
+                    new SqlParameter("@ComplaintDepartment", SqlDbType.VarChar,200),
176
+                    new SqlParameter("@ComplaintTarget", SqlDbType.VarChar,200),
177
+                    new SqlParameter("@IsRelevant", SqlDbType.Int,4),
178
+                    new SqlParameter("@Remarks", SqlDbType.VarChar,-1),
179
+                    new SqlParameter("@Problem", SqlDbType.VarChar,-1),
180
+                    new SqlParameter("@IsOver", SqlDbType.Int,4),
181
+                    new SqlParameter("@DealContents", SqlDbType.VarChar,-1),
182
+                    new SqlParameter("@DealTime", SqlDbType.DateTime),
183
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
184
+                    new SqlParameter("@Files", SqlDbType.VarChar,-1),
185
+                    new SqlParameter("@CreateTime", SqlDbType.DateTime),
186
+                    new SqlParameter("@Createby", SqlDbType.VarChar,100),
187
+                    new SqlParameter("@CallID", SqlDbType.VarChar,100),
188
+                    new SqlParameter("@IsDelete", SqlDbType.Int,4),
189
+                    new SqlParameter("@DelTime", SqlDbType.DateTime),
190
+                    new SqlParameter("@TypeClass", SqlDbType.NVarChar,200),
191
+             new SqlParameter("@DealBy", SqlDbType.NVarChar,200),
192
+              new SqlParameter("@ID", SqlDbType.BigInt,8)};
193
+           
194
+            parameters[0].Value = model.WorkOrderID;
195
+            parameters[1].Value = model.CustomerName;
196
+            parameters[2].Value = model.CustomerTel;
197
+            parameters[3].Value = model.Gender;
198
+            parameters[4].Value = model.Location;
199
+            parameters[5].Value = model.Reservation;
200
+            parameters[6].Value = model.IDnumber;
201
+            parameters[7].Value = model.Department;
202
+            parameters[8].Value = model.Expert;
203
+            parameters[9].Value = model.AppointmentTime;
204
+            parameters[10].Value = model.IsMedical;
205
+            parameters[11].Value = model.Project;
206
+            parameters[12].Value = model.TranDepartment;
207
+            parameters[13].Value = model.DriveoutTime;
208
+            parameters[14].Value = model.AboutcarMan;
209
+            parameters[15].Value = model.CarTel;
210
+            parameters[16].Value = model.Condition;
211
+            parameters[17].Value = model.IsCar;
212
+            parameters[18].Value = model.TreatmentAddress;
213
+            parameters[19].Value = model.ComplaintDepartment;
214
+            parameters[20].Value = model.ComplaintTarget;
215
+            parameters[21].Value = model.IsRelevant;
216
+            parameters[22].Value = model.Remarks;
217
+            parameters[23].Value = model.Problem;
218
+            parameters[24].Value = model.IsOver;
219
+            parameters[25].Value = model.DealContents;
220
+            parameters[26].Value = model.DealTime;
221
+            parameters[27].Value = model.F_State;
222
+            parameters[28].Value = model.Files;
223
+            parameters[29].Value = model.CreateTime;
224
+            parameters[30].Value = model.Createby;
225
+            parameters[31].Value = model.CallID;
226
+            parameters[32].Value = model.IsDelete;
227
+            parameters[33].Value = model.DelTime;
228
+            parameters[34].Value = model.TypeClass;
229
+            parameters[35].Value = model.DealBy;
230
+            parameters[36].Value = model.ID;
231
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
232
+            if (rows > 0)
233
+            {
234
+                return true;
235
+            }
236
+            else
237
+            {
238
+                return false;
239
+            }
240
+        }
241
+
242
+        /// <summary>
243
+        /// 删除一条数据
244
+        /// </summary>
245
+        public bool Delete()
246
+        {
247
+            //该表无主键信息,请自定义主键/条件字段
248
+            StringBuilder strSql = new StringBuilder();
249
+            strSql.Append("delete from T_Wo_WorkOrderNew ");
250
+            strSql.Append(" where ");
251
+            SqlParameter[] parameters = {
252
+            };
253
+
254
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
255
+            if (rows > 0)
256
+            {
257
+                return true;
258
+            }
259
+            else
260
+            {
261
+                return false;
262
+            }
263
+        }
264
+        /// <summary>
265
+        /// 批量删除数据
266
+        /// </summary>
267
+        public bool DeleteList(string IDlist)
268
+        {
269
+            StringBuilder strSql = new StringBuilder();
270
+            strSql.Append("update T_Wo_WorkOrderNew set IsDelete=1 ");
271
+            //  strSql.Append("delete from T_Wo_WorkOrder ");
272
+            strSql.Append(" where ID in (" + IDlist + ")  ");
273
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
274
+            if (rows > 0)
275
+            {
276
+                return true;
277
+            }
278
+            else
279
+            {
280
+                return false;
281
+            }
282
+        }
283
+
284
+        /// <summary>
285
+        /// 得到一个对象实体
286
+        /// </summary>
287
+        public CallCenterApi.Model.T_Wo_WorkOrderNew GetModel(long ID)
288
+        {
289
+            //该表无主键信息,请自定义主键/条件字段
290
+            StringBuilder strSql = new StringBuilder();
291
+            strSql.Append("select  top 1 ID,WorkOrderID,CustomerName,CustomerTel,Gender,Location,Reservation,IDnumber,Department,Expert,AppointmentTime,IsMedical,Project,TranDepartment,DriveoutTime,AboutcarMan,CarTel,Condition,IsCar,TreatmentAddress,ComplaintDepartment,ComplaintTarget,IsRelevant,Remarks,Problem,IsOver,DealContents,DealTime,F_State,Files,CreateTime,Createby,CallID,IsDelete,DelTime,TypeClass from T_Wo_WorkOrderNew ");
292
+            strSql.Append(" where ID=@ID");
293
+            SqlParameter[] parameters = {
294
+                 new SqlParameter("@ID", SqlDbType.BigInt)
295
+            };
296
+            parameters[0].Value = ID;
297
+            CallCenterApi.Model.T_Wo_WorkOrderNew model = new CallCenterApi.Model.T_Wo_WorkOrderNew();
298
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
299
+            if (ds.Tables[0].Rows.Count > 0)
300
+            {
301
+                return DataRowToModel(ds.Tables[0].Rows[0]);
302
+            }
303
+            else
304
+            {
305
+                return null;
306
+            }
307
+        }
308
+
309
+
310
+        /// <summary>
311
+        /// 得到一个对象实体
312
+        /// </summary>
313
+        public CallCenterApi.Model.T_Wo_WorkOrderNew DataRowToModel(DataRow row)
314
+        {
315
+            CallCenterApi.Model.T_Wo_WorkOrderNew model = new CallCenterApi.Model.T_Wo_WorkOrderNew();
316
+            if (row != null)
317
+            {
318
+                if (row["ID"] != null && row["ID"].ToString() != "")
319
+                {
320
+                    model.ID = long.Parse(row["ID"].ToString());
321
+                }
322
+                if (row["WorkOrderID"] != null)
323
+                {
324
+                    model.WorkOrderID = row["WorkOrderID"].ToString();
325
+                }
326
+                if (row["CustomerName"] != null)
327
+                {
328
+                    model.CustomerName = row["CustomerName"].ToString();
329
+                }
330
+                if (row["CustomerTel"] != null)
331
+                {
332
+                    model.CustomerTel = row["CustomerTel"].ToString();
333
+                }
334
+                if (row["Gender"] != null && row["Gender"].ToString() != "")
335
+                {
336
+                    model.Gender = int.Parse(row["Gender"].ToString());
337
+                }
338
+                if (row["Location"] != null)
339
+                {
340
+                    model.Location = row["Location"].ToString();
341
+                }
342
+                if (row["Reservation"] != null)
343
+                {
344
+                    model.Reservation = row["Reservation"].ToString();
345
+                }
346
+                if (row["IDnumber"] != null)
347
+                {
348
+                    model.IDnumber = row["IDnumber"].ToString();
349
+                }
350
+                if (row["Department"] != null)
351
+                {
352
+                    model.Department = row["Department"].ToString();
353
+                }
354
+                if (row["Expert"] != null)
355
+                {
356
+                    model.Expert = row["Expert"].ToString();
357
+                }
358
+                if (row["AppointmentTime"] != null && row["AppointmentTime"].ToString() != "")
359
+                {
360
+                    model.AppointmentTime = DateTime.Parse(row["AppointmentTime"].ToString());
361
+                }
362
+                if (row["IsMedical"] != null && row["IsMedical"].ToString() != "")
363
+                {
364
+                    model.IsMedical = int.Parse(row["IsMedical"].ToString());
365
+                }
366
+                if (row["Project"] != null)
367
+                {
368
+                    model.Project = row["Project"].ToString();
369
+                }
370
+                if (row["TranDepartment"] != null)
371
+                {
372
+                    model.TranDepartment = row["TranDepartment"].ToString();
373
+                }
374
+                if (row["DriveoutTime"] != null && row["DriveoutTime"].ToString() != "")
375
+                {
376
+                    model.DriveoutTime = DateTime.Parse(row["DriveoutTime"].ToString());
377
+                }
378
+                if (row["AboutcarMan"] != null)
379
+                {
380
+                    model.AboutcarMan = row["AboutcarMan"].ToString();
381
+                }
382
+                if (row["CarTel"] != null)
383
+                {
384
+                    model.CarTel = row["CarTel"].ToString();
385
+                }
386
+                if (row["Condition"] != null)
387
+                {
388
+                    model.Condition = row["Condition"].ToString();
389
+                }
390
+                if (row["IsCar"] != null && row["IsCar"].ToString() != "")
391
+                {
392
+                    model.IsCar = int.Parse(row["IsCar"].ToString());
393
+                }
394
+                if (row["TreatmentAddress"] != null)
395
+                {
396
+                    model.TreatmentAddress = row["TreatmentAddress"].ToString();
397
+                }
398
+                if (row["ComplaintDepartment"] != null)
399
+                {
400
+                    model.ComplaintDepartment = row["ComplaintDepartment"].ToString();
401
+                }
402
+                if (row["ComplaintTarget"] != null)
403
+                {
404
+                    model.ComplaintTarget = row["ComplaintTarget"].ToString();
405
+                }
406
+                if (row["IsRelevant"] != null && row["IsRelevant"].ToString() != "")
407
+                {
408
+                    model.IsRelevant = int.Parse(row["IsRelevant"].ToString());
409
+                }
410
+                if (row["Remarks"] != null)
411
+                {
412
+                    model.Remarks = row["Remarks"].ToString();
413
+                }
414
+                if (row["Problem"] != null)
415
+                {
416
+                    model.Problem = row["Problem"].ToString();
417
+                }
418
+                if (row["IsOver"] != null && row["IsOver"].ToString() != "")
419
+                {
420
+                    model.IsOver = int.Parse(row["IsOver"].ToString());
421
+                }
422
+                if (row["DealContents"] != null)
423
+                {
424
+                    model.DealContents = row["DealContents"].ToString();
425
+                }
426
+                if (row["DealTime"] != null && row["DealTime"].ToString() != "")
427
+                {
428
+                    model.DealTime = DateTime.Parse(row["DealTime"].ToString());
429
+                }
430
+                if (row["F_State"] != null && row["F_State"].ToString() != "")
431
+                {
432
+                    model.F_State = int.Parse(row["F_State"].ToString());
433
+                }
434
+                if (row["Files"] != null)
435
+                {
436
+                    model.Files = row["Files"].ToString();
437
+                }
438
+                if (row["CreateTime"] != null && row["CreateTime"].ToString() != "")
439
+                {
440
+                    model.CreateTime = DateTime.Parse(row["CreateTime"].ToString());
441
+                }
442
+                if (row["Createby"] != null)
443
+                {
444
+                    model.Createby = row["Createby"].ToString();
445
+                }
446
+                if (row["CallID"] != null)
447
+                {
448
+                    model.CallID = row["CallID"].ToString();
449
+                }
450
+                if (row["IsDelete"] != null && row["IsDelete"].ToString() != "")
451
+                {
452
+                    model.IsDelete = int.Parse(row["IsDelete"].ToString());
453
+                }
454
+                if (row["DelTime"] != null && row["DelTime"].ToString() != "")
455
+                {
456
+                    model.DelTime = DateTime.Parse(row["DelTime"].ToString());
457
+                }
458
+                if (row["TypeClass"] != null)
459
+                {
460
+                    model.TypeClass = row["TypeClass"].ToString();
461
+                }
462
+                if (row["DealBy"] != null)
463
+                {
464
+                    model.DealBy = row["DealBy"].ToString();
465
+                }
466
+            }
467
+            return model;
468
+        }
469
+
470
+        /// <summary>
471
+        /// 获得数据列表
472
+        /// </summary>
473
+        public DataSet GetList(string strWhere)
474
+        {
475
+            StringBuilder strSql = new StringBuilder();
476
+            strSql.Append("select ID,WorkOrderID,CustomerName,CustomerTel,Gender,Location,Reservation,IDnumber,Department,Expert,AppointmentTime,IsMedical,Project,TranDepartment,DriveoutTime,AboutcarMan,CarTel,Condition,IsCar,TreatmentAddress,ComplaintDepartment,ComplaintTarget,IsRelevant,Remarks,Problem,IsOver,DealContents,DealTime,F_State,Files,CreateTime,Createby,CallID,IsDelete,DelTime,TypeClass ");
477
+            strSql.Append(" FROM T_Wo_WorkOrderNew ");
478
+            if (strWhere.Trim() != "")
479
+            {
480
+                strSql.Append(" where " + strWhere);
481
+            }
482
+            return DbHelperSQL.Query(strSql.ToString());
483
+        }
484
+
485
+        /// <summary>
486
+        /// 获得前几行数据
487
+        /// </summary>
488
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
489
+        {
490
+            StringBuilder strSql = new StringBuilder();
491
+            strSql.Append("select ");
492
+            if (Top > 0)
493
+            {
494
+                strSql.Append(" top " + Top.ToString());
495
+            }
496
+            strSql.Append(" ID,WorkOrderID,CustomerName,CustomerTel,Gender,Location,Reservation,IDnumber,Department,Expert,AppointmentTime,IsMedical,Project,TranDepartment,DriveoutTime,AboutcarMan,CarTel,Condition,IsCar,TreatmentAddress,ComplaintDepartment,ComplaintTarget,IsRelevant,Remarks,Problem,IsOver,DealContents,DealTime,F_State,Files,CreateTime,Createby,CallID,IsDelete,DelTime,TypeClass ");
497
+            strSql.Append(" FROM T_Wo_WorkOrderNew ");
498
+            if (strWhere.Trim() != "")
499
+            {
500
+                strSql.Append(" where " + strWhere);
501
+            }
502
+            strSql.Append(" order by " + filedOrder);
503
+            return DbHelperSQL.Query(strSql.ToString());
504
+        }
505
+
506
+        /// <summary>
507
+        /// 获取记录总数
508
+        /// </summary>
509
+        public int GetRecordCount(string strWhere)
510
+        {
511
+            StringBuilder strSql = new StringBuilder();
512
+            strSql.Append("select count(1) FROM T_Wo_WorkOrderNew ");
513
+            if (strWhere.Trim() != "")
514
+            {
515
+                strSql.Append(" where " + strWhere);
516
+            }
517
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
518
+            if (obj == null)
519
+            {
520
+                return 0;
521
+            }
522
+            else
523
+            {
524
+                return Convert.ToInt32(obj);
525
+            }
526
+        }
527
+        /// <summary>
528
+        /// 分页获取数据列表
529
+        /// </summary>
530
+        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
531
+        {
532
+            StringBuilder strSql = new StringBuilder();
533
+            strSql.Append("SELECT * FROM ( ");
534
+            strSql.Append(" SELECT ROW_NUMBER() OVER (");
535
+            if (!string.IsNullOrEmpty(orderby.Trim()))
536
+            {
537
+                strSql.Append("order by T." + orderby);
538
+            }
539
+            else
540
+            {
541
+                strSql.Append("order by T. desc");
542
+            }
543
+            strSql.Append(")AS Row, T.*  from T_Wo_WorkOrderNew T ");
544
+            if (!string.IsNullOrEmpty(strWhere.Trim()))
545
+            {
546
+                strSql.Append(" WHERE " + strWhere);
547
+            }
548
+            strSql.Append(" ) TT");
549
+            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
550
+            return DbHelperSQL.Query(strSql.ToString());
551
+        }
552
+
553
+        /*
554
+		/// <summary>
555
+		/// 分页获取数据列表
556
+		/// </summary>
557
+		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
558
+		{
559
+			SqlParameter[] parameters = {
560
+					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
561
+					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
562
+					new SqlParameter("@PageSize", SqlDbType.Int),
563
+					new SqlParameter("@PageIndex", SqlDbType.Int),
564
+					new SqlParameter("@IsReCount", SqlDbType.Bit),
565
+					new SqlParameter("@OrderType", SqlDbType.Bit),
566
+					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
567
+					};
568
+			parameters[0].Value = "T_Wo_WorkOrderNew";
569
+			parameters[1].Value = "";
570
+			parameters[2].Value = PageSize;
571
+			parameters[3].Value = PageIndex;
572
+			parameters[4].Value = 0;
573
+			parameters[5].Value = 0;
574
+			parameters[6].Value = strWhere;	
575
+			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
576
+		}*/
577
+
578
+        #endregion  BasicMethod
579
+        #region  ExtensionMethod
580
+
581
+        #endregion  ExtensionMethod
582
+    }
583
+}

+ 364 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/ConversationController.cs

@@ -0,0 +1,364 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+using System.Web.Mvc;
6
+using CallCenterApi.Interface.Controllers.Base;
7
+using System.Data;
8
+using CallCenter.Utility;
9
+using CallCenterApi.Common;
10
+using CallCenterApi.DB;
11
+using System.IO;
12
+using NPOI.XSSF.UserModel;
13
+using NPOI.HSSF.UserModel;
14
+using NPOI.SS.UserModel;
15
+using Newtonsoft.Json;
16
+using CallCenterApi.Interface.Models.Input;
17
+using System.Text.RegularExpressions;
18
+
19
+namespace CallCenterApi.Interface.Controllers
20
+{
21
+    public class ConversationController : BaseController
22
+    {
23
+        BLL.T_Con_Conversation bll = new BLL.T_Con_Conversation();
24
+        /// <summary>
25
+        /// 获取内外线列表
26
+        /// </summary>
27
+        /// <returns></returns>
28
+        public ActionResult GetList()
29
+        {
30
+            ActionResult res = NoToken("未知错误,请重新登录");
31
+            if (Request.IsAuthenticated)
32
+            {
33
+                string sql = " and F_IsDelete=0";
34
+                DataTable dt = new DataTable();
35
+
36
+                string keyword = RequestString.GetQueryString("keyword");
37
+                //电话
38
+                string strtel = RequestString.GetQueryString("tel");
39
+                ////部门
40
+               string department = RequestString.GetQueryString("department");
41
+                ////科室
42
+                string section = RequestString.GetQueryString("section");
43
+                ////医师
44
+                string physician = RequestString.GetQueryString("physician");
45
+                string stringtype = RequestString.GetQueryString("type");
46
+                int type = 0;
47
+                string strpageindex = RequestString.GetQueryString("pageindex");
48
+                int pageindex = 1;
49
+                string strpagesize = RequestString.GetQueryString("pagesize");
50
+                int pagesize = 10;
51
+
52
+                if (keyword.Trim() != "" && keyword != "undefined")
53
+                {
54
+                    sql += $"  and F_Telephone like '%" + keyword.Trim() + "%' or F_Department like '%" + keyword.Trim() + "%'or F_Section like '%" + keyword.Trim() + "%'  or F_Physician like '%" + keyword.Trim() + "%' or F_Title like '%" + keyword.Trim() + "%'";
55
+                }
56
+                if (strtel.Trim() != "" && strtel != "undefined")
57
+                {
58
+                    sql += "and  F_Telephone=" + strtel;
59
+                }
60
+                if (department.Trim() != "" && department != "undefined")
61
+                {
62
+                    sql += "and  F_Department=" + department;
63
+                }
64
+                if (section.Trim() != "" && section != "undefined")
65
+                {
66
+                    sql += "and  F_Section=" + section;
67
+                }
68
+                if (physician.Trim() != "" && physician != "undefined")
69
+                {
70
+                    sql += "and  F_Physician=" + physician;
71
+                }
72
+                if (strpageindex.Trim() != "")
73
+                {
74
+                    pageindex = Convert.ToInt32(strpageindex);
75
+                }
76
+                if (strpagesize.Trim() != "")
77
+                {
78
+                    pagesize = Convert.ToInt32(strpagesize);
79
+                }
80
+                if (stringtype .Trim() != "")
81
+                {
82
+                    type  = Convert.ToInt32(stringtype);
83
+                    sql += "and  F_Type=" + type;
84
+                }
85
+                int recordCount = 0;
86
+                dt = BLL.PagerBLL.GetListPager(
87
+                        "T_Con_Conversation",
88
+                        "ID",
89
+                        "*",
90
+                        sql,
91
+                       "ORDER BY T_Con_Conversation.ID desc",
92
+                        pagesize,
93
+                        pageindex,
94
+                        true,
95
+                        out recordCount);
96
+                List<Model.T_Con_Conversation> modlelist = new BLL.T_Con_Conversation().DataTableToList(dt);
97
+                var obj = new
98
+                {
99
+                    state = "success",
100
+                    message = "成功",
101
+                    rows = modlelist,
102
+                    total = recordCount
103
+                };
104
+                res = Content(obj.ToJson());
105
+            }
106
+            return res;
107
+        }
108
+        /// <summary>
109
+        /// 获取内外线列表详情
110
+        /// </summary>
111
+        /// <returns></returns>
112
+        public ActionResult GetDetails()
113
+        {
114
+            ActionResult res = NoToken("未知错误,请重新登录");
115
+            if (Request.IsAuthenticated)
116
+            {
117
+
118
+                int cid = Utils.StrToInt(RequestString.GetQueryString("id"), 0);
119
+                if (cid != 0)
120
+                {
121
+
122
+            
123
+                    Model.T_Con_Conversation model = new BLL.T_Con_Conversation().GetModel(cid);
124
+                 
125
+                    if (model != null)
126
+                    {
127
+                        res = Success("获取成功", model);
128
+                    }
129
+                    else
130
+                    {
131
+                        res = Error("获取失败");
132
+                    }
133
+                }
134
+                else
135
+                {
136
+                    res = Error("参数传输失败");
137
+                }
138
+            }
139
+            return res;
140
+        }
141
+        public class Conversation
142
+        {
143
+            public int ID { get; set; }
144
+            public int  F_Type { get; set; }// 1内线2外线
145
+            public string F_Department { get; set; }// 部门
146
+            public string F_Section { get; set; }//科室
147
+            public string F_Telephone { get; set; }//电话
148
+            public string F_Physician { get; set; }//医师
149
+            public string F_Title { get; set; }//职称
150
+        }
151
+        /// <summary>
152
+        /// 验证客户电话是否唯一
153
+        /// </summary>
154
+        private bool getunphone(int id, string phone)
155
+        {
156
+            var sql = " F_DeleteFlag=0 ";
157
+            sql += "and (F_LegalTel='" + phone + "')";
158
+            if (id > 0)
159
+                sql += " and F_CustomerId<>" + id;
160
+            var count = bll.GetModelList(sql).Count();
161
+
162
+            return count > 0;
163
+        }
164
+        /// <summary>
165
+        /// 添加一键转接三方通话
166
+        /// </summary>
167
+        /// <returns></returns>
168
+        public ActionResult Add(Conversation input)
169
+        {
170
+            #region 添加验证判断
171
+            if (string.IsNullOrEmpty(input.F_Telephone))
172
+                return Error("电话不能为空!");
173
+            if (getunphone(0, input.F_Telephone))
174
+                return Error("已存在该客户请勿重复添加");
175
+            if (input.F_Type<=0)
176
+                return Error("请选择电话类别");
177
+            #endregion
178
+            var model = new Model.T_Con_Conversation();
179
+            model.F_Type = input.F_Type;    //1内线2外线
180
+            model.F_Department = input.F_Department;    //部门
181
+            model.F_Section = input.F_Section;    // 科室
182
+            model.F_Telephone = input.F_Telephone;  // 电话
183
+            model.F_Physician = input.F_Physician;      //医师
184
+            model.F_Title = input.F_Title;//职称
185
+            model.F_IsDelete  = 0;
186
+            int   n = bll.Add(model);
187
+            if (n > 0)
188
+                return Success("新增成功!", model);
189
+            else
190
+                return Error("新增失败!");
191
+        }
192
+        /// <summary>
193
+        /// 修改一键转接三方通话
194
+        /// </summary>
195
+        /// <returns></returns>
196
+        public ActionResult Update(Conversation input)
197
+        {
198
+            int userId = CurrentUser.UserData.F_UserId;
199
+
200
+            #region 添加验证判断
201
+            if (input.ID <= 0)
202
+                return Error("参数错误!");
203
+            if (string.IsNullOrEmpty(input.F_Telephone))
204
+                return Error("电话不能为空!");
205
+            if (input.F_Type <= 0)
206
+                return Error("请选择电话类别");
207
+            #endregion
208
+            var model = bll.GetModel(input.ID );
209
+            model.F_Type = input.F_Type;    //1内线2外线
210
+            model.F_Department = input.F_Department;    //部门
211
+            model.F_Section = input.F_Section;    // 科室
212
+            model.F_Telephone = input.F_Telephone;  // 电话
213
+            model.F_Physician = input.F_Physician;      //医师
214
+            model.F_Title = input.F_Title;//职称
215
+            model.F_IsDelete = 0;
216
+            bool n = bll.Update(model);
217
+            if (n)
218
+                return Success("保存成功!", model);
219
+            else
220
+                return Error("保存失败!");
221
+        }
222
+        /// <summary>
223
+        /// 删除一键转接三方通话
224
+        /// </summary>
225
+        /// <param name="ids"></param>
226
+        /// <returns></returns>
227
+        public ActionResult DelConver(string[] ids)
228
+        {
229
+            ActionResult res = NoToken("未知错误,请重新登录");
230
+            if (Request.IsAuthenticated)
231
+            {
232
+
233
+                if (ids != null && ids.Length > 0)
234
+                {
235
+                    string idd = " ";
236
+                    foreach (string str in ids)
237
+                    {
238
+                        idd += str + ",";
239
+                    }
240
+                    string sql = "update T_Con_Conversation set F_IsDelete=1 where ID in (" + idd.TrimEnd(',') + ")";
241
+                    if (!string.IsNullOrEmpty(idd.Trim()))
242
+                    {
243
+                        if (DbHelperSQL.ExecuteSql(sql) > 0)
244
+                        {
245
+                            res = Success("设置成功");
246
+                        }
247
+                        else
248
+                        {
249
+                            res = Error("设置失败");
250
+                        }
251
+                    }
252
+                    else
253
+                    {
254
+                        res = Error("请选择用户");
255
+                    }
256
+                }
257
+                else
258
+                {
259
+                    res = Error("获取参数失败");
260
+                }
261
+
262
+            }
263
+            return res;
264
+        }
265
+        /// <summary>
266
+        /// 导入excel
267
+        /// </summary>
268
+        /// <param name="areaid">区域id</param>
269
+        /// <param name="regionid">项目id</param>
270
+        /// <param name="buldingid">楼号id</param>
271
+        /// <returns></returns>
272
+        public ActionResult ImportExcel(int type=0)
273
+        {
274
+            string usercode = CurrentUser.UserData.F_UserCode;
275
+            string ip = DTRequest.GetIP();
276
+            if (!string.IsNullOrWhiteSpace(usercode))
277
+            {
278
+                HttpPostedFile _upFile = RequestString.GetFile("upFile");
279
+                if (_upFile != null)
280
+                {
281
+                    if (type <= 0)
282
+                        return Error("请选择上传类别");
283
+                    int headrow = 0;
284
+                    #region 上传文件
285
+                    string filepath = "";
286
+                    string datepath = DateTime.Now.ToString("yyyyMMddHHMMss");
287
+                    string aLastName = Path.GetExtension(_upFile.FileName);
288
+                    string oriname = Path.GetFileNameWithoutExtension(_upFile.FileName);
289
+                    if (aLastName != ".xls" && aLastName != ".xlsx")
290
+                    {
291
+                        return Error("文件类型错误,请选择Excel文件");
292
+                    }
293
+                    string newpath = datepath + "_" + _upFile.FileName;
294
+                    if (!Directory.Exists(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData")))
295
+                    {
296
+                        Directory.CreateDirectory(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData"));
297
+                    }
298
+                    filepath = this.Request.ApplicationPath + "/ExcelData/" + newpath;
299
+                    string PhysicalPath = Server.MapPath(filepath);
300
+                    _upFile.SaveAs(PhysicalPath);
301
+                    #endregion
302
+                    #region 添加附件日志
303
+                    Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
304
+                    model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
305
+                    model_T_Sys_Accessories.F_FileName = newpath;//附件名称
306
+                    model_T_Sys_Accessories.F_FileType = aLastName;//附件类型
307
+                    model_T_Sys_Accessories.F_FileUrl = filepath;//附件地址
308
+                    model_T_Sys_Accessories.F_UserCode = usercode;//上传人  
309
+                    int fid = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
310
+                    #endregion
311
+                    NPOIHelper np = new NPOIHelper();
312
+                    DataTable dt = np.ExcelToTable(_upFile, headrow);
313
+                    string msg = string.Empty;
314
+                    if (dt == null || dt.Rows.Count == 0)
315
+                        return Error("文件没有数据");
316
+                    else
317
+                    {
318
+                        Model.T_Con_Conversation dModel = new Model.T_Con_Conversation();
319
+                        dModel.F_IsDelete  = 0;
320
+                        dModel.F_FileId = fid;
321
+                        dModel.F_Type  = type ;
322
+                        foreach (DataRow dr in dt.Rows)
323
+                        {
324
+                          
325
+                            headrow = headrow + 1;
326
+                           
327
+                            if (dr["电话"].ToString() != "" )
328
+                            {
329
+                                if (!getunphone(0, dr["电话"].ToString()))
330
+                                {
331
+                                    dModel.F_Department = dr["部门"].ToString();
332
+                                    dModel.F_Section = dr["科室"].ToString();
333
+                                    dModel.F_Telephone = dr["电话"].ToString();
334
+
335
+                                    if (type == 2)
336
+                                    {
337
+                                        dModel.F_Physician = dr["医师"].ToString();
338
+                                        dModel.F_Title = dr["职称"].ToString();
339
+                                        var res = bll.Add(dModel);
340
+                                        if (res <= 0)
341
+                                        {
342
+                                            msg = msg + "第" + headrow + "行,导入失败<br>";
343
+                                        }
344
+                                    }
345
+                                }
346
+                                else
347
+                                    msg = msg + "第" + headrow + "行,电话重复,未导入<br>";
348
+                            }
349
+                            else
350
+                                msg = msg + "第" + headrow + "行,电话为空,未导入<br>";
351
+
352
+                        }
353
+                        if (string.IsNullOrEmpty(msg))
354
+                            return Success("导入成功 ");
355
+                        else
356
+                            return Error(msg);
357
+                    }
358
+                }
359
+                return Error("数据源上传失败");
360
+            }
361
+            return Error("用户登录失败,请重新登录");
362
+        }
363
+    }
364
+}

File diff suppressed because it is too large
+ 430 - 930
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs


File diff suppressed because it is too large
+ 527 - 810
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs


+ 14 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallOutScreenController.cs

@@ -82,10 +82,22 @@ namespace CallCenterApi.Interface.Controllers.tel
82 82
                             true,
83 83
                             out recordCount);
84 84
 
85
-                        dt.Columns.Add("F_CustomerName");
85
+                     //   dt.Columns.Add("F_CustomerName");
86
+                        dt.Columns.Add("F_Department");
87
+                        dt.Columns.Add("F_Section");
88
+                        dt.Columns.Add("F_Physician");
89
+                        dt.Columns.Add("F_Title");
86 90
                         foreach (DataRow dr in dt.Rows)
87 91
                         {
88
-                            dr["F_CustomerName"] = new BLL.T_Cus_CustomerBase().GetModel(dr["CallNumber"].ToString()) == null ? "" : new BLL.T_Cus_CustomerBase().GetModel(dr["CallNumber"].ToString()).F_CustomerName;
92
+                         //   dr["F_CustomerName"] = new BLL.T_Cus_CustomerBase().GetModel(dr//["CallNumber"].ToString()) == null ? "" : new BLL.T_Cus_CustomerBase().GetModel(dr["CallNumber"].ToString()).F_CustomerName;
93
+                            var userModel = new BLL.T_Con_Conversation().GetModelList(" F_Telephone = 0 " + dr["CallNumber"].ToString()).FirstOrDefault(); ;
94
+                            if (userModel!=null )
95
+                            {
96
+                                dr["F_Department"] = userModel.F_Department;
97
+                                dr["F_Section"] = userModel.F_Section;
98
+                                dr["F_Physician"] = userModel.F_Physician;
99
+                                dr["F_Title"] = userModel.F_Title;
100
+                            }
89 101
                         }
90 102
 
91 103
                         var obj = new

+ 552 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -0,0 +1,552 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.DB;
3
+using CallCenterApi.Interface.Controllers.Base;
4
+using CallCenterApi.Interface.Models.Enum;
5
+using CallCenterAPI.WechatSDK;
6
+using System;
7
+using System.Collections.Generic;
8
+using System.Data;
9
+using System.Linq;
10
+using System.Web;
11
+using System.Web.Mvc;
12
+
13
+namespace CallCenterApi.Interface.Controllers.workorder
14
+{
15
+    public class WorkOrderNewController : BaseController
16
+    {
17
+        BLL.T_Wo_WorkOrderNew workOrder = new BLL.T_Wo_WorkOrderNew();
18
+        BLL.T_Wo_WorkOrderItem_New itembll = new BLL.T_Wo_WorkOrderItem_New();
19
+        BLL.T_Sys_Department departmentBLL = new BLL.T_Sys_Department();
20
+        BLL.T_Sys_UserAccount sysUserAccountBll = new BLL.T_Sys_UserAccount();
21
+        BLL.T_Sys_DictionaryValue dicvalueBll = new BLL.T_Sys_DictionaryValue();
22
+        public ActionResult GetList()
23
+        {
24
+            int userId = CurrentUser.UserData.F_UserId;
25
+            if (userId != 0)
26
+            {
27
+                Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
28
+                if (ua != null)
29
+                {
30
+                    DataTable dt = new DataTable();
31
+                    string sql = " and IsDelete=0";
32
+                    //工单状态
33
+                    string  state = RequestString.GetQueryString("state");
34
+                    //反馈类型
35
+                    string typeClass = RequestString.GetQueryString("typeClass");
36
+                    //工单编号
37
+                    string workOrderID = RequestString.GetQueryString("workOrderID");
38
+                    //客户电话
39
+                    string customerTel = RequestString.GetQueryString("customerTel");
40
+                    //关键字
41
+                    string keyword = RequestString.GetQueryString("keyword");
42
+                    string strpageindex = RequestString.GetQueryString("pageindex");
43
+                    int pageindex = 1;
44
+                    string strpagesize = RequestString.GetQueryString("pagesize");
45
+                    int pagesize = 10;
46
+                    if (keyword.Trim() != "" && keyword != "undefined")
47
+                    {
48
+                        sql += $"  and CustomerName like '%" + keyword.Trim() + "%' or CustomerTel like '%" + keyword.Trim() + "%'or Location like '%" + keyword.Trim() + "%'  or Reservation like '%" + keyword.Trim() + "%'";
49
+                    }
50
+                    if (state.Trim() != "" && state != "undefined")
51
+                    {
52
+                        sql += "and  F_State=" + state;
53
+                        if (state=="10")
54
+                            sql += "and  Createby=" + ua .F_UserCode ;
55
+                    }
56
+                    if (typeClass.Trim() != "" && typeClass != "undefined")
57
+                    {
58
+                        sql += "and  TypeClass=" + typeClass;
59
+                    }
60
+                    if (workOrderID.Trim() != "" && workOrderID != "undefined")
61
+                    {
62
+                        sql += "and  WorkOrderID=" + workOrderID;
63
+                    }
64
+                    if (customerTel.Trim() != "" && customerTel != "undefined")
65
+                    {
66
+                        sql += "and  CustomerTel=" + customerTel;
67
+                    }
68
+                    if (strpageindex.Trim() != "")
69
+                    {
70
+                        pageindex = Convert.ToInt32(strpageindex);
71
+                    }
72
+                    if (strpagesize.Trim() != "")
73
+                    {
74
+                        pagesize = Convert.ToInt32(strpagesize);
75
+                    }
76
+                    int recordCount = 0;
77
+                    dt = BLL.PagerBLL.GetListPager(
78
+                            "T_Wo_WorkOrderNew",
79
+                            "T_Wo_WorkOrderNew.ID",
80
+                            "*",
81
+                            sql,
82
+                           "ORDER BY T_Wo_WorkOrderNew.ID desc",
83
+                            pagesize,
84
+                            pageindex,
85
+                            true,
86
+                            out recordCount);
87
+                    List<Model.T_Wo_WorkOrderNew> modlelist = new BLL.T_Wo_WorkOrderNew().DataTableToList(dt);
88
+                    var obj = new
89
+                    {
90
+                        state = "success",
91
+                        message = "成功",
92
+                        rows = modlelist,
93
+                        total = recordCount
94
+                    };
95
+                return  Content(obj.ToJson());
96
+                }
97
+                }
98
+                return Error("无操作权限!");
99
+        }
100
+        /// <summary>
101
+        /// 添加工单
102
+        /// </summary>
103
+        /// <returns></returns>
104
+        public ActionResult Add(WorkOrder input)
105
+        {
106
+            int userId = CurrentUser.UserData.F_UserId;
107
+            if (userId != 0)
108
+            {
109
+                string usercode = CurrentUser.UserData.F_UserCode;
110
+                Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
111
+
112
+                if (!(input.TypeClass > 0 && input.TypeClass < 5))
113
+                    return Error("反馈类型错误!");
114
+                if (string.IsNullOrEmpty(input.CustomerName))
115
+                    return Error("请输入客户姓名!");
116
+                if (string.IsNullOrEmpty(input.CustomerTel))
117
+                    return Error("请输入客户电话!");
118
+                var model = new Model.T_Wo_WorkOrderNew();
119
+                #region 保存
120
+                model = inputtoobj(model, input, 1);
121
+                #endregion
122
+                model.Createby = ua.F_UserCode;
123
+                model.CreateTime = DateTime.Now;
124
+                model.F_State = 0;
125
+                long n = workOrder.Add(model);
126
+                string deptname = "";
127
+                var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
128
+                if (deptmodel != null)
129
+                {
130
+                    deptname = deptmodel.F_DeptName + "-";
131
+                }
132
+                if (n > 0)
133
+                {
134
+                    AddLog(n, (int)EnumWorkOrderState.neworder, deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "添加工单", (int)EnumItemType.neworder, (int)EnumItemOpt.create, "", 0, ua);
135
+                    if (input.IsOver == 1)
136
+                    {
137
+                        Model.T_Wo_WorkOrderNew WorkOrder = workOrder.GetModel(n);
138
+                        if (WorkOrder==null )
139
+                            return Error("处理失败!");
140
+                        else
141
+                        {
142
+                         bool b=   DealWO(ua, WorkOrder, input.DealContents, 1);
143
+                            if (b )
144
+                            {
145
+                                return Success("处理成功!");
146
+                            }
147
+                            else
148
+                            {
149
+                                return Error("处理失败!");
150
+                            }
151
+                        }
152
+                       
153
+                      }
154
+                    else
155
+                    {
156
+                        return Success("添加成功!");
157
+                    }
158
+                }
159
+                else 
160
+                return Error("添加失败!");
161
+
162
+            }
163
+            else
164
+                return Error("无操作权限!");
165
+        }
166
+        public ActionResult Update(WorkOrder input)
167
+        {
168
+            int userId = CurrentUser.UserData.F_UserId;
169
+            if (userId != 0)
170
+            {
171
+                string usercode = CurrentUser.UserData.F_UserCode;
172
+                Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
173
+                if (string.IsNullOrEmpty(input.CustomerName))
174
+                    return Error("请输入客户姓名!");
175
+                if (string.IsNullOrEmpty(input.CustomerTel))
176
+                    return Error("请输入客户电话!");
177
+                var model = workOrder.GetModel(input.ID);
178
+                if (model == null)
179
+                    return Error("查询不到此工单!");
180
+                #region 保存
181
+                model = inputtoobj(model, input, 2);
182
+                #endregion
183
+                bool  n = workOrder.Update(model);
184
+                string deptname = "";
185
+                var deptmodel = departmentBLL.GetModel(ua.F_DeptId);
186
+                if (deptmodel != null)
187
+                {
188
+                    deptname = deptmodel.F_DeptName + "-";
189
+                }
190
+                if (n)
191
+                {
192
+                    AddLog((int )model.ID ,(int ) model.F_State , deptname + ua.F_UserName + "(" + ua.F_UserCode + ")" + "修改工单", (int)EnumItemType.update, (int)EnumItemOpt.update, "", 0, ua);
193
+                    return Success ("修改成功!");
194
+                }
195
+                else
196
+                    return Error("修改失败!");
197
+
198
+            }
199
+            else
200
+                return Error("无操作权限!");
201
+        }
202
+        /// <summary>
203
+        /// 删除工单
204
+        /// </summary>
205
+        /// <param name="ids"></param>
206
+        /// <returns></returns>
207
+        public ActionResult DelWorkOrder(string[] ids)
208
+        {
209
+            int userId = CurrentUser.UserData.F_UserId;
210
+            if (userId != 0)
211
+            {
212
+
213
+                if (ids != null && ids.Length > 0)
214
+                {
215
+                    bool res = true;
216
+                    string idd = " ";
217
+                    foreach (string str in ids)
218
+                    {
219
+                        idd += str + ",";
220
+                    }
221
+
222
+                    if (!string.IsNullOrEmpty(idd.Trim()))
223
+                    {
224
+                        if (itembll.DeleteList(idd.TrimEnd(',')))
225
+                        {
226
+                            if (workOrder.DeleteList(idd.TrimEnd(',')))
227
+                            {
228
+
229
+                                return Success("设置成功");
230
+
231
+                            }
232
+                            else
233
+                            {
234
+                                return Error("设置失败");
235
+                            }
236
+                        }
237
+                        else
238
+                        {
239
+                            return Error("设置失败");
240
+                        }
241
+
242
+                    }
243
+                    else
244
+                    {
245
+                        return Error("请选择工单");
246
+                    }
247
+                }
248
+                else
249
+                {
250
+                    return Error("获取参数失败");
251
+                }
252
+            }
253
+            else
254
+            {
255
+                return Error("无操作权限!");
256
+            }
257
+        }
258
+        /// <summary>
259
+        /// 查询工单详情
260
+        /// </summary>
261
+        public ActionResult GetDetails(int id)
262
+        {
263
+            int userId = CurrentUser.UserData.F_UserId;
264
+            if (userId != 0)
265
+            {
266
+                Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
267
+
268
+                if (id <= 0)
269
+                {
270
+                    return Error("请输入正确的id");
271
+                }
272
+                var list = new List<Model.T_Wo_WorkOrderNew>();
273
+                var model = workOrder.GetModel(id);
274
+                if (model != null)
275
+                    list.Add(model);
276
+                var itemlasts = itembll.GetModelList("  F_WoID=" + +id + " ");
277
+                if (list.Count > 0)
278
+                {
279
+                    var obj = new
280
+                    {
281
+                        state = "success",
282
+                        message = "成功",
283
+                        rows = list,
284
+                        total = itemlasts,
285
+                    };
286
+                    return Content(obj.ToJson());
287
+                }
288
+                else
289
+                    return Error("没有查询到此工单");
290
+
291
+            }
292
+            else
293
+            {
294
+                return Error("无操作权限!");
295
+            }
296
+        }
297
+        public ActionResult DealWorkOrder(long id, string cont,
298
+          int isover = 0)
299
+        {
300
+            int userId = CurrentUser.UserData.F_UserId;
301
+            if (userId != 0)
302
+            {
303
+                Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
304
+                if (ua !=null )
305
+                {
306
+                    Model.T_Wo_WorkOrderNew model = workOrder.GetModel(id);
307
+                    if (model!=null  )
308
+                    {
309
+                        var res = DealWO(ua, model,  cont, isover);
310
+                        if (res)
311
+                            return Success("处理成功");
312
+                        else
313
+                            return Error("处理失败!");
314
+                    }
315
+                    else
316
+                    {
317
+                        return Error("工单不存在");
318
+
319
+                    }
320
+                }
321
+            }
322
+            return Error("无操作权限");
323
+        }
324
+        /// <summary>
325
+        /// 处理工单
326
+        /// </summary>
327
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrderNew model,  string cont, int isover = 0)
328
+        {
329
+            #region 工单处理
330
+            var opt = "处理";
331
+            if (isover == 1)
332
+            {
333
+                opt = "处理";
334
+                model.DealBy = nowUser.F_UserCode;
335
+                model.DealTime = DateTime.Now;
336
+            }
337
+            #region 读取当前登录人部门
338
+            string deptname = "";
339
+            var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
340
+            if (deptmodel != null)
341
+            {
342
+                deptname = deptmodel.F_DeptName + "-";
343
+            }
344
+            #endregion
345
+            var optcont = "";
346
+            if (!string.IsNullOrEmpty(cont))
347
+                optcont = ",处理内容:" + cont;
348
+            var content = deptname + nowUser.F_UserName + "(" + nowUser.F_WorkNumber + ")" + opt + "工单" + optcont;
349
+            
350
+            var itemid = AddLog((int)model.ID, (int)EnumWorkOrderState.finish, content, (int)EnumItemType.deal, (int)EnumItemOpt.end, "", 0, nowUser);
351
+            if (itemid > 0)
352
+            {
353
+                #region 处理工单
354
+                model.F_State = (int)EnumWorkOrderState.finish;
355
+                //处理内容
356
+                if (!string.IsNullOrEmpty(cont))
357
+                    model.DealContents += cont + ";";
358
+                model.DealTime = DateTime.Now;
359
+                workOrder.Update(model);
360
+                #endregion
361
+                #region 推送消息
362
+                #region 推送消息给添加的坐席 -处理情况
363
+                if (nowUser.F_UserCode != model.Createby )
364
+                {
365
+                    sendsysmsg(model, nowUser, model.Createby, (int)model.ID, opt);//推送系统消息
366
+                    var createmodel = sysUserAccountBll.GetModel(model.Createby);  //被指派人
367
+                    if (createmodel != null)
368
+                    {
369
+                        if (!string.IsNullOrEmpty(createmodel.F_WxOpenId))
370
+                        {
371
+                            sendwxmsg(model, createmodel.F_WxOpenId, nowUser, opt);
372
+                        }
373
+                    }
374
+                }
375
+                #endregion
376
+                #region 向上一级操作人员推送消息
377
+                var itemlast = itembll.GetModelList(" F_ItemType=" + (int)EnumItemType.deal + " and  F_WoID='" + model.ID + "' and F_NextUser='" + nowUser.F_UserCode + "' order by F_CreateTime desc").FirstOrDefault();
378
+                if (itemlast != null)
379
+                {
380
+                    if (itemlast.F_CreateUser != model.Createby )
381
+                    {
382
+                        sendsysmsg(model, nowUser, itemlast.F_CreateUser, (int)itemid, opt);
383
+                        var lastUser = sysUserAccountBll.GetModel(itemlast.F_CreateUser);
384
+                        if (lastUser != null && !string.IsNullOrEmpty(lastUser.F_WxOpenId))
385
+                            sendwxmsg(model, lastUser.F_WxOpenId, nowUser, opt);
386
+                    }
387
+                }
388
+                #endregion
389
+             
390
+                #endregion
391
+                return true;
392
+            }
393
+            else
394
+                return false;
395
+            #endregion
396
+        }
397
+
398
+        /// <summary>
399
+        /// 根据传入的对象和input的内容返回对象(添加修改使用)
400
+        /// </summary>
401
+        private Model.T_Wo_WorkOrderNew inputtoobj(Model.T_Wo_WorkOrderNew model, WorkOrder input, int type)
402
+        {
403
+            string usercode = CurrentUser.UserData.F_UserCode;
404
+            var newmodel = model;
405
+            if (type ==1)
406
+            {
407
+                model.WorkOrderID = DateTime.Now.ToString("yyyyMMddHHmmssfff");  //工单编号 
408
+                model.TypeClass = input.TypeClass.ToString();//工单来源
409
+            }
410
+            else
411
+            {
412
+                model.WorkOrderID = model.WorkOrderID;//工单编号
413
+                model.TypeClass = model.TypeClass.ToString();//工单来源
414
+                model.ID = model.ID;//工单ID
415
+            }
416
+            model.CustomerName = input.CustomerName;//客户姓名
417
+            model.CustomerTel = input.CustomerTel;//客户电话
418
+            model.Gender = int .Parse (input.Gender);//性别
419
+            model.Location = input.Location;//客户地址
420
+            model.Reservation = input.Reservation;//预约类型(预约挂号,预约检查,预约床位,预约车辆)
421
+            model.IDnumber = input.IDnumber;//身份证
422
+            model.Department = input.Department;//预约科室
423
+            model.Expert = input.Expert;//身份证
424
+            if (!string .IsNullOrEmpty (input.AppointmentTime))
425
+            model.AppointmentTime =DateTime .Parse ( input.AppointmentTime);//预约时间
426
+            model.IsMedical = input.IsMedical;//是否来院就医
427
+            model.Project = input.Project;//预约项目
428
+            model.TranDepartment = input.TranDepartment;//一键转接科室
429
+            if (!string.IsNullOrEmpty(input.DriveoutTime))
430
+                model.DriveoutTime = DateTime.Parse(input.DriveoutTime);//预约出车时间
431
+            model.AboutcarMan = input.AboutcarMan;//约车人
432
+            model.CarTel = input.CarTel;//约车人电话
433
+            model.Condition = input.Condition;//患者病情
434
+            model.IsCar = input.IsCar;//是否出车
435
+            model.TreatmentAddress = input.TreatmentAddress;//接诊地址
436
+            model.ComplaintDepartment = input.ComplaintDepartment;//被投诉科室
437
+            model.ComplaintTarget = input.ComplaintTarget;//被投诉对象
438
+            model.IsRelevant = input.IsRelevant;//是否专至相关部门
439
+            model.Remarks = input.Remarks;//备注
440
+            model.Problem = input.Problem;//问题描述
441
+            model.IsDelete  = 0;//问题描述
442
+            return model;
443
+        }
444
+        public long AddLog(long woid, int wostate, string content, int itemtype, int opttype, string nextuser, int nextdept, Model.T_Sys_UserAccount nowUser)
445
+        {
446
+            Model.T_Wo_WorkOrderItem_New itemModel = new Model.T_Wo_WorkOrderItem_New();
447
+            #region 
448
+            //处理当前工单的记录之前的记录过期
449
+            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_ItemType=" + itemtype + " and  F_WoID=" + woid + " ");
450
+            if (itemlast.Count > 0)
451
+            {
452
+                foreach (var it in itemlast)
453
+                {
454
+                    it.F_IsUsed = 1;
455
+                    itembll.Update(it);
456
+                }
457
+            }
458
+            #endregion
459
+            itemModel.F_WoID = woid;
460
+            itemModel.F_WoState = wostate;
461
+            itemModel.F_ItemType = itemtype;
462
+            itemModel.F_OptType = opttype;
463
+            itemModel.F_OptContent = content;
464
+            itemModel.F_NextUser = nextuser;
465
+            itemModel.F_NextDept = nextdept;
466
+            itemModel.F_IsUsed = 0;
467
+            itemModel.F_CreateUser = nowUser.F_UserCode;
468
+            itemModel.F_CreateTime = DateTime.Now;
469
+            var res = itembll.Add(itemModel);
470
+            return res;
471
+        }
472
+        //推送系统提醒
473
+        public void sendsysmsg(Model.T_Wo_WorkOrderNew womodel, Model.T_Sys_UserAccount nowUser, string touser, int toid, string opt)
474
+        {
475
+            #region 消息提醒
476
+            string strmsg = string.Empty;
477
+            strmsg = nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + "操作" + opt + "工单";
478
+            Model.T_Msg_List msg = new Model.T_Msg_List();
479
+            msg.Type = (int)Model.MSGType.workorder;//处理
480
+            msg.ToUser = touser;
481
+            msg.ToID = toid;
482
+            msg.Detail = strmsg;
483
+            msg.State = 0;
484
+            msg.IsDel = 0;
485
+            msg.CreateUser = nowUser.F_UserCode;
486
+            msg.CreateDate = DateTime.Now;
487
+
488
+            new BLL.T_Msg_List().Add(msg);
489
+            #endregion
490
+        }
491
+        //推送微信消息
492
+        public void sendwxmsg(Model.T_Wo_WorkOrderNew womodel, string openid, Model.T_Sys_UserAccount nowUser, string opt)
493
+        {
494
+            #region 推送微信
495
+            try
496
+            {
497
+                if (!string.IsNullOrEmpty(openid))
498
+                {
499
+                    var dicv = dicvalueBll.GetModel(int .Parse (womodel.TypeClass));
500
+                    string content = string.Empty;
501
+                    var wotype = "";
502
+                    if (dicv != null)
503
+                    {
504
+                        wotype = dicv.F_Name;
505
+                    }
506
+                    content = "编号" + womodel.WorkOrderID + "的工单已" + opt + ",操作人:" + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")";
507
+                    var msg = WxHelper.SendWechatMsg1(womodel.WorkOrderID, "你有工单已" + opt, wotype, womodel.F_State .ToString(), content, womodel.ID.ToString(), openid, "");
508
+                    Error("推送微信::::::" + msg.ToString());
509
+                }
510
+            }
511
+            catch { }
512
+            #endregion
513
+        }
514
+        public class WorkOrder
515
+        {
516
+            public int ID { get; set; }
517
+            public string WorkOrderID { get; set; }//工单编号
518
+            public int TypeClass { get; set; }//工单类型(1就医咨询2预约诊疗3投诉4建议)
519
+            public string CustomerName { get; set; }//客户姓名
520
+            public string CustomerTel { get; set; }//客户电话
521
+            public string Gender { get; set; }//性别
522
+            public string Location { get; set; }//客户地址
523
+            public string Reservation { get; set; }//预约类型(预约挂号,预约检查,预约床位,预约车辆)
524
+            public string IDnumber { get; set; }//身份证
525
+            public string  Department { get; set; }//预约科室
526
+            public string Expert { get; set; }//预约专家
527
+            public string AppointmentTime { get; set; }//预约时间
528
+            public int IsMedical { get; set; }//是否来院就医
529
+            public string Project { get; set; }//预约项目
530
+            public string TranDepartment { get; set; }//一键转接科室
531
+            public string DriveoutTime { get; set; }//预约出车时间
532
+            public string AboutcarMan { get; set; }//约车人
533
+            public string CarTel { get; set; }//约车人电话
534
+            public string Condition { get; set; }//患者病情
535
+            public int IsCar { get; set; }//是否出车
536
+            public string TreatmentAddress { get; set; }//接诊地址
537
+            public string ComplaintDepartment { get; set; }//被投诉科室
538
+            public string ComplaintTarget { get; set; }//被投诉对象
539
+            public int IsRelevant { get; set; }//是否转至相关部门
540
+            public string Remarks { get; set; }//备注
541
+            public string Problem { get; set; }//问题描述
542
+            public int IsOver { get; set; }//是否处理
543
+            public string DealContents { get; set; }//处理结果
544
+            public string DealBy { get; set; }//处理人
545
+            public string DealTime { get; set; }//处理时间
546
+            public int F_State { get; set; }//工单状态
547
+            public string CreateTime { get; set; }//创建时间
548
+            public string Createby { get; set; }//创建人
549
+            public string DelTime { get; set; }//删除时间
550
+        }
551
+    }
552
+}

+ 2 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Enum/EnumWorkOrderState.cs

@@ -33,6 +33,8 @@ namespace CallCenterApi.Interface.Models.Enum
33 33
     /// </summary>
34 34
     public enum EnumItemType
35 35
     {
36
+        [Description("添加")]
37
+        neworder = 0,
36 38
         [Description("办理")]
37 39
         deal = 1,
38 40
         [Description("催办")]

+ 99 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Con_Conversation.cs

@@ -0,0 +1,99 @@
1
+using System;
2
+
3
+namespace CallCenterApi.Model
4
+{
5
+    /// <summary>
6
+    /// T_Con_Conversation:实体类(属性说明自动提取数据库字段的描述信息)
7
+    /// </summary>
8
+    [Serializable]
9
+    public partial class T_Con_Conversation
10
+    {
11
+        public T_Con_Conversation()
12
+        { }
13
+        #region Model
14
+        private long? _id;
15
+        private int? _f_type;
16
+        private string _f_department;
17
+        private string _f_section;
18
+        private string _f_telephone;
19
+        private string _f_physician;
20
+        private string _f_title;
21
+        private int? _f_isdelete;
22
+        private int? _f_fileid;
23
+        /// <summary>
24
+        /// ID
25
+        /// </summary>
26
+        public long? ID
27
+        {
28
+            set { _id = value; }
29
+            get { return _id; }
30
+        }
31
+        /// <summary>
32
+        /// 1内线2外线
33
+        /// </summary>
34
+        public int? F_Type
35
+        {
36
+            set { _f_type = value; }
37
+            get { return _f_type; }
38
+        }
39
+        /// <summary>
40
+        /// 部门
41
+        /// </summary>
42
+        public string F_Department
43
+        {
44
+            set { _f_department = value; }
45
+            get { return _f_department; }
46
+        }
47
+        /// <summary>
48
+        /// 科室
49
+        /// </summary>
50
+        public string F_Section
51
+        {
52
+            set { _f_section = value; }
53
+            get { return _f_section; }
54
+        }
55
+        /// <summary>
56
+        /// 电话
57
+        /// </summary>
58
+        public string F_Telephone
59
+        {
60
+            set { _f_telephone = value; }
61
+            get { return _f_telephone; }
62
+        }
63
+        /// <summary>
64
+        /// 医师
65
+        /// </summary>
66
+        public string F_Physician
67
+        {
68
+            set { _f_physician = value; }
69
+            get { return _f_physician; }
70
+        }
71
+        /// <summary>
72
+        /// 职称
73
+        /// </summary>
74
+        public string F_Title
75
+        {
76
+            set { _f_title = value; }
77
+            get { return _f_title; }
78
+        }
79
+        /// <summary>
80
+        /// 是否删除
81
+        /// </summary>
82
+        public int? F_IsDelete
83
+        {
84
+            set { _f_isdelete = value; }
85
+            get { return _f_isdelete; }
86
+        }
87
+        /// <summary>
88
+        /// 上传
89
+        /// </summary>
90
+        public int? F_FileId
91
+        {
92
+            set { _f_fileid = value; }
93
+            get { return _f_fileid; }
94
+        }
95
+        #endregion Model
96
+
97
+    }
98
+}
99
+

+ 20 - 2
codegit/CallCenterApi/CallCenterApi.Model/T_Cus_CustomerBaseNew.cs

@@ -59,6 +59,16 @@ namespace CallCenterApi.Model
59 59
         private string _f_charges;
60 60
         private string _f_taxnumber;
61 61
         private DateTime? _f_feeexpires;
62
+        private int? _f_gender;
63
+        private int? _f_fileId;
64
+        /// <summary>
65
+        ///附件id
66
+        /// </summary>
67
+        public int?  F_FileId
68
+        {
69
+            set { _f_fileId = value; }
70
+            get { return _f_fileId; }
71
+        }
62 72
         /// <summary>
63 73
         /// 自增ID
64 74
         /// </summary>
@@ -68,6 +78,14 @@ namespace CallCenterApi.Model
68 78
             get { return _f_customerid; }
69 79
         }
70 80
         /// <summary>
81
+        /// 性别
82
+        /// </summary>
83
+        public int? F_Gender
84
+        {
85
+            set { _f_gender = value; }
86
+            get { return _f_gender; }
87
+        }
88
+        /// <summary>
71 89
         /// 客户编号
72 90
         /// </summary>
73 91
         public string F_CustomerCode
@@ -108,7 +126,7 @@ namespace CallCenterApi.Model
108 126
             get { return _f_registeredaddress; }
109 127
         }
110 128
         /// <summary>
111
-        /// 法人姓名
129
+        ///客户姓名
112 130
         /// </summary>
113 131
         public string F_LegalName
114 132
         {
@@ -124,7 +142,7 @@ namespace CallCenterApi.Model
124 142
             get { return _f_legalidcards; }
125 143
         }
126 144
         /// <summary>
127
-        /// 法人电话
145
+        /// 客户电话
128 146
         /// </summary>
129 147
         public string F_LegalTel
130 148
         {

+ 9 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_SMS_List.cs

@@ -23,6 +23,7 @@ namespace CallCenterApi.Model
23 23
         private string _mname;
24 24
         private DateTime? _createdate;
25 25
         private string _batchno;
26
+        private int _f_isdelete  ;
26 27
         /// <summary>
27 28
         /// 短信ID
28 29
         /// </summary>
@@ -127,6 +128,14 @@ namespace CallCenterApi.Model
127 128
             set { _batchno = value; }
128 129
             get { return _batchno; }
129 130
         }
131
+        /// <summary>
132
+        /// 是否删除
133
+        /// </summary>
134
+        public int  F_IsDelete
135
+        {
136
+            set { _f_isdelete = value; }
137
+            get { return _f_isdelete; }
138
+        }
130 139
         #endregion Model
131 140
 
132 141
     }

+ 7 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrder.cs

@@ -56,6 +56,13 @@ namespace CallCenterApi.Model
56 56
         private string _createuserid;
57 57
         private string _buildingnum;
58 58
         private string _unitnum;
59
+        private string _f_gender;
60
+        public string F_Gender
61
+        {
62
+            set { _f_gender = value; }
63
+            get { return _f_gender; }
64
+
65
+        }
59 66
         /// <summary>
60 67
         /// 工单ID
61 68
         /// </summary>

+ 350 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrderNew.cs

@@ -0,0 +1,350 @@
1
+using System;
2
+namespace CallCenterApi.Model
3
+{
4
+    /// <summary>
5
+    /// T_Wo_WorkOrderNew:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_Wo_WorkOrderNew
9
+    {
10
+        public T_Wo_WorkOrderNew()
11
+        { }
12
+        #region Model
13
+        private long? _id;
14
+        private string _workorderid;
15
+        private string _customername;
16
+        private string _customertel;
17
+        private int? _gender;
18
+        private string _location;
19
+        private string _reservation;
20
+        private string _idnumber;
21
+        private string _department;
22
+        private string _expert;
23
+        private DateTime? _appointmenttime;
24
+        private int? _ismedical;
25
+        private string _project;
26
+        private string _trandepartment;
27
+        private DateTime? _driveouttime;
28
+        private string _aboutcarman;
29
+        private string _cartel;
30
+        private string _condition;
31
+        private int? _iscar;
32
+        private string _treatmentaddress;
33
+        private string _complaintdepartment;
34
+        private string _complainttarget;
35
+        private int? _isrelevant;
36
+        private string _remarks;
37
+        private string _problem;
38
+        private int? _isover;
39
+        private string _dealcontents;
40
+        private DateTime? _dealtime;
41
+        private int? _f_state;
42
+        private string _files;
43
+        private DateTime? _createtime;
44
+        private string _createby;
45
+        private string _callid;
46
+        private int? _isdelete;
47
+        private DateTime? _deltime;
48
+        private string _typeclass;
49
+        public string _dealBy;
50
+        /// <summary>
51
+        /// 
52
+        /// </summary>
53
+        public long? ID
54
+        {
55
+            set { _id = value; }
56
+            get { return _id; }
57
+        }
58
+        /// <summary>
59
+        /// 工单编号
60
+        /// </summary>
61
+        public string WorkOrderID
62
+        {
63
+            set { _workorderid = value; }
64
+            get { return _workorderid; }
65
+        }
66
+        /// <summary>
67
+        /// 客户姓名
68
+        /// </summary>
69
+        public string CustomerName
70
+        {
71
+            set { _customername = value; }
72
+            get { return _customername; }
73
+        }
74
+        /// <summary>
75
+        /// 客户电话
76
+        /// </summary>
77
+        public string CustomerTel
78
+        {
79
+            set { _customertel = value; }
80
+            get { return _customertel; }
81
+        }
82
+        /// <summary>
83
+        /// 性别
84
+        /// </summary>
85
+        public int? Gender
86
+        {
87
+            set { _gender = value; }
88
+            get { return _gender; }
89
+        }
90
+        /// <summary>
91
+        /// 客户地址
92
+        /// </summary>
93
+        public string Location
94
+        {
95
+            set { _location = value; }
96
+            get { return _location; }
97
+        }
98
+        /// <summary>
99
+        /// 预约类型(预约挂号,预约检查,预约床位,预约车辆)
100
+        /// </summary>
101
+        public string Reservation
102
+        {
103
+            set { _reservation = value; }
104
+            get { return _reservation; }
105
+        }
106
+        /// <summary>
107
+        /// 身份证
108
+        /// </summary>
109
+        public string IDnumber
110
+        {
111
+            set { _idnumber = value; }
112
+            get { return _idnumber; }
113
+        }
114
+        /// <summary>
115
+        /// 预约科室
116
+        /// </summary>
117
+        public string Department
118
+        {
119
+            set { _department = value; }
120
+            get { return _department; }
121
+        }
122
+        /// <summary>
123
+        /// 预约专家
124
+        /// </summary>
125
+        public string Expert
126
+        {
127
+            set { _expert = value; }
128
+            get { return _expert; }
129
+        }
130
+        /// <summary>
131
+        /// 预约时间
132
+        /// </summary>
133
+        public DateTime? AppointmentTime
134
+        {
135
+            set { _appointmenttime = value; }
136
+            get { return _appointmenttime; }
137
+        }
138
+        /// <summary>
139
+        /// 是否来院就医
140
+        /// </summary>
141
+        public int? IsMedical
142
+        {
143
+            set { _ismedical = value; }
144
+            get { return _ismedical; }
145
+        }
146
+        /// <summary>
147
+        /// 预约项目
148
+        /// </summary>
149
+        public string Project
150
+        {
151
+            set { _project = value; }
152
+            get { return _project; }
153
+        }
154
+        /// <summary>
155
+        /// 一键转接科室
156
+        /// </summary>
157
+        public string TranDepartment
158
+        {
159
+            set { _trandepartment = value; }
160
+            get { return _trandepartment; }
161
+        }
162
+        /// <summary>
163
+        /// 预约出车时间
164
+        /// </summary>
165
+        public DateTime? DriveoutTime
166
+        {
167
+            set { _driveouttime = value; }
168
+            get { return _driveouttime; }
169
+        }
170
+        /// <summary>
171
+        /// 约车人
172
+        /// </summary>
173
+        public string AboutcarMan
174
+        {
175
+            set { _aboutcarman = value; }
176
+            get { return _aboutcarman; }
177
+        }
178
+        /// <summary>
179
+        /// 约车人电话
180
+        /// </summary>
181
+        public string CarTel
182
+        {
183
+            set { _cartel = value; }
184
+            get { return _cartel; }
185
+        }
186
+        /// <summary>
187
+        /// 患者病情
188
+        /// </summary>
189
+        public string Condition
190
+        {
191
+            set { _condition = value; }
192
+            get { return _condition; }
193
+        }
194
+        /// <summary>
195
+        /// 是否出车
196
+        /// </summary>
197
+        public int? IsCar
198
+        {
199
+            set { _iscar = value; }
200
+            get { return _iscar; }
201
+        }
202
+        /// <summary>
203
+        /// 接诊地址
204
+        /// </summary>
205
+        public string TreatmentAddress
206
+        {
207
+            set { _treatmentaddress = value; }
208
+            get { return _treatmentaddress; }
209
+        }
210
+        /// <summary>
211
+        /// 被投诉科室
212
+        /// </summary>
213
+        public string ComplaintDepartment
214
+        {
215
+            set { _complaintdepartment = value; }
216
+            get { return _complaintdepartment; }
217
+        }
218
+        /// <summary>
219
+        /// 被投诉对象
220
+        /// </summary>
221
+        public string ComplaintTarget
222
+        {
223
+            set { _complainttarget = value; }
224
+            get { return _complainttarget; }
225
+        }
226
+        /// <summary>
227
+        /// 是否转至相关部门
228
+        /// </summary>
229
+        public int? IsRelevant
230
+        {
231
+            set { _isrelevant = value; }
232
+            get { return _isrelevant; }
233
+        }
234
+        /// <summary>
235
+        /// 备注
236
+        /// </summary>
237
+        public string Remarks
238
+        {
239
+            set { _remarks = value; }
240
+            get { return _remarks; }
241
+        }
242
+        /// <summary>
243
+        /// 问题描述
244
+        /// </summary>
245
+        public string Problem
246
+        {
247
+            set { _problem = value; }
248
+            get { return _problem; }
249
+        }
250
+        /// <summary>
251
+        /// 是否处理
252
+        /// </summary>
253
+        public int? IsOver
254
+        {
255
+            set { _isover = value; }
256
+            get { return _isover; }
257
+        }
258
+        /// <summary>
259
+        /// 处理结果
260
+        /// </summary>
261
+        public string DealContents
262
+        {
263
+            set { _dealcontents = value; }
264
+            get { return _dealcontents; }
265
+        }
266
+        /// <summary>
267
+        /// 处理时间
268
+        /// </summary>
269
+        public DateTime? DealTime
270
+        {
271
+            set { _dealtime = value; }
272
+            get { return _dealtime; }
273
+        }
274
+        /// <summary>
275
+        /// 工单状态
276
+        /// </summary>
277
+        public int? F_State
278
+        {
279
+            set { _f_state = value; }
280
+            get { return _f_state; }
281
+        }
282
+        /// <summary>
283
+        /// 
284
+        /// </summary>
285
+        public string Files
286
+        {
287
+            set { _files = value; }
288
+            get { return _files; }
289
+        }
290
+        /// <summary>
291
+        /// 创建时间
292
+        /// </summary>
293
+        public DateTime? CreateTime
294
+        {
295
+            set { _createtime = value; }
296
+            get { return _createtime; }
297
+        }
298
+        /// <summary>
299
+        /// 创建人
300
+        /// </summary>
301
+        public string Createby
302
+        {
303
+            set { _createby = value; }
304
+            get { return _createby; }
305
+        }
306
+        /// <summary>
307
+        /// 
308
+        /// </summary>
309
+        public string CallID
310
+        {
311
+            set { _callid = value; }
312
+            get { return _callid; }
313
+        }
314
+        /// <summary>
315
+        /// 
316
+        /// </summary>
317
+        public int? IsDelete
318
+        {
319
+            set { _isdelete = value; }
320
+            get { return _isdelete; }
321
+        }
322
+        /// <summary>
323
+        /// 删除时间
324
+        /// </summary>
325
+        public DateTime? DelTime
326
+        {
327
+            set { _deltime = value; }
328
+            get { return _deltime; }
329
+        }
330
+        /// <summary>
331
+        /// 
332
+        /// </summary>
333
+        public string TypeClass
334
+        {
335
+            set { _typeclass = value; }
336
+            get { return _typeclass; }
337
+        }
338
+        /// <summary>
339
+        /// 处理人
340
+        /// </summary>
341
+        public string DealBy
342
+        {
343
+            set { _dealBy = value; }
344
+            get { return _dealBy; }
345
+        }
346
+        #endregion Model
347
+
348
+    }
349
+}
350
+