瀏覽代碼

患者回访记录及工单的搜索

liyuanyuan 3 年之前
父節點
當前提交
0fae0089e6

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj

@@ -89,6 +89,7 @@
89 89
     <Compile Include="T_RegionCategory.cs" />
90 90
     <Compile Include="T_RepositoryCategory.cs" />
91 91
     <Compile Include="T_RepositoryInformation.cs" />
92
+    <Compile Include="T_ReturnVisitRecord.cs" />
92 93
     <Compile Include="T_SMS_List.cs" />
93 94
     <Compile Include="T_SMS_Receive.cs" />
94 95
     <Compile Include="T_SMS_RecvSMS.cs" />

+ 195 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_ReturnVisitRecord.cs

@@ -0,0 +1,195 @@
1
+/**  版本信息模板在安装目录下,可自行修改。
2
+* T_ReturnVisitRecord.cs
3
+*
4
+* 功 能: N/A
5
+* 类 名: T_ReturnVisitRecord
6
+*
7
+* Ver    变更日期             负责人  变更内容
8
+* ───────────────────────────────────
9
+* V0.01  2022/4/22 14:10:32   N/A    初版
10
+*
11
+* Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
12
+*┌──────────────────────────────────┐
13
+*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
14
+*│ 版权所有:动软卓越(北京)科技有限公司              │
15
+*└──────────────────────────────────┘
16
+*/
17
+using System;
18
+using System.Data;
19
+using System.Collections.Generic;
20
+ 
21
+using CallCenterApi.Model;
22
+namespace CallCenterApi.BLL
23
+{
24
+	/// <summary>
25
+	/// T_ReturnVisitRecord
26
+	/// </summary>
27
+	public partial class T_ReturnVisitRecord
28
+	{
29
+		private readonly CallCenterApi.DAL.T_ReturnVisitRecord dal=new CallCenterApi.DAL.T_ReturnVisitRecord();
30
+		public T_ReturnVisitRecord()
31
+		{}
32
+		#region  BasicMethod
33
+
34
+		/// <summary>
35
+		/// 得到最大ID
36
+		/// </summary>
37
+		public int GetMaxId()
38
+		{
39
+			return dal.GetMaxId();
40
+		}
41
+
42
+		/// <summary>
43
+		/// 是否存在该记录
44
+		/// </summary>
45
+		public bool Exists(int F_ID)
46
+		{
47
+			return dal.Exists(F_ID);
48
+		}
49
+
50
+		/// <summary>
51
+		/// 增加一条数据
52
+		/// </summary>
53
+		public int  Add(CallCenterApi.Model.T_ReturnVisitRecord model)
54
+		{
55
+			return dal.Add(model);
56
+		}
57
+
58
+		/// <summary>
59
+		/// 更新一条数据
60
+		/// </summary>
61
+		public bool Update(CallCenterApi.Model.T_ReturnVisitRecord model)
62
+		{
63
+			return dal.Update(model);
64
+		}
65
+
66
+		/// <summary>
67
+		/// 删除一条数据
68
+		/// </summary>
69
+		public bool Delete(int F_ID)
70
+		{
71
+			
72
+			return dal.Delete(F_ID);
73
+		}
74
+		/// <summary>
75
+		/// 删除一条数据
76
+		/// </summary>
77
+		public bool DeleteList(string F_IDlist )
78
+		{
79
+			return dal.DeleteList(F_IDlist );
80
+		}
81
+
82
+		/// <summary>
83
+		/// 得到一个对象实体
84
+		/// </summary>
85
+		public CallCenterApi.Model.T_ReturnVisitRecord GetModel(int F_ID)
86
+		{
87
+			
88
+			return dal.GetModel(F_ID);
89
+		}
90
+
91
+		///// <summary>
92
+		///// 得到一个对象实体,从缓存中
93
+		///// </summary>
94
+		//public CallCenterApi.Model.T_ReturnVisitRecord GetModelByCache(int F_ID)
95
+		//{
96
+			
97
+		//	string CacheKey = "T_ReturnVisitRecordModel-" + F_ID;
98
+		//	object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
99
+		//	if (objModel == null)
100
+		//	{
101
+		//		try
102
+		//		{
103
+		//			objModel = dal.GetModel(F_ID);
104
+		//			if (objModel != null)
105
+		//			{
106
+		//				int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
107
+		//				Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
108
+		//			}
109
+		//		}
110
+		//		catch{}
111
+		//	}
112
+		//	return (CallCenterApi.Model.T_ReturnVisitRecord)objModel;
113
+		//}
114
+
115
+		/// <summary>
116
+		/// 获得数据列表
117
+		/// </summary>
118
+		public DataSet GetList(string strWhere)
119
+		{
120
+			return dal.GetList(strWhere);
121
+		}
122
+		/// <summary>
123
+		/// 获得前几行数据
124
+		/// </summary>
125
+		public DataSet GetList(int Top,string strWhere,string filedOrder)
126
+		{
127
+			return dal.GetList(Top,strWhere,filedOrder);
128
+		}
129
+		/// <summary>
130
+		/// 获得数据列表
131
+		/// </summary>
132
+		public List<CallCenterApi.Model.T_ReturnVisitRecord> GetModelList(string strWhere)
133
+		{
134
+			DataSet ds = dal.GetList(strWhere);
135
+			return DataTableToList(ds.Tables[0]);
136
+		}
137
+		/// <summary>
138
+		/// 获得数据列表
139
+		/// </summary>
140
+		public List<CallCenterApi.Model.T_ReturnVisitRecord> DataTableToList(DataTable dt)
141
+		{
142
+			List<CallCenterApi.Model.T_ReturnVisitRecord> modelList = new List<CallCenterApi.Model.T_ReturnVisitRecord>();
143
+			int rowsCount = dt.Rows.Count;
144
+			if (rowsCount > 0)
145
+			{
146
+				CallCenterApi.Model.T_ReturnVisitRecord model;
147
+				for (int n = 0; n < rowsCount; n++)
148
+				{
149
+					model = dal.DataRowToModel(dt.Rows[n]);
150
+					if (model != null)
151
+					{
152
+						modelList.Add(model);
153
+					}
154
+				}
155
+			}
156
+			return modelList;
157
+		}
158
+
159
+		/// <summary>
160
+		/// 获得数据列表
161
+		/// </summary>
162
+		public DataSet GetAllList()
163
+		{
164
+			return GetList("");
165
+		}
166
+
167
+		/// <summary>
168
+		/// 分页获取数据列表
169
+		/// </summary>
170
+		public int GetRecordCount(string strWhere)
171
+		{
172
+			return dal.GetRecordCount(strWhere);
173
+		}
174
+		/// <summary>
175
+		/// 分页获取数据列表
176
+		/// </summary>
177
+		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
178
+		{
179
+			return dal.GetListByPage( strWhere,  orderby,  startIndex,  endIndex);
180
+		}
181
+		/// <summary>
182
+		/// 分页获取数据列表
183
+		/// </summary>
184
+		//public DataSet GetList(int PageSize,int PageIndex,string strWhere)
185
+		//{
186
+			//return dal.GetList(PageSize,PageIndex,strWhere);
187
+		//}
188
+
189
+		#endregion  BasicMethod
190
+		#region  ExtensionMethod
191
+
192
+		#endregion  ExtensionMethod
193
+	}
194
+}
195
+

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.DAL/CallCenterApi.DAL.csproj

@@ -89,6 +89,7 @@
89 89
     <Compile Include="T_RegionCategory.cs" />
90 90
     <Compile Include="T_RepositoryCategory.cs" />
91 91
     <Compile Include="T_RepositoryInformation.cs" />
92
+    <Compile Include="T_ReturnVisitRecord.cs" />
92 93
     <Compile Include="T_SMS_List.cs" />
93 94
     <Compile Include="T_SMS_Receive.cs" />
94 95
     <Compile Include="T_SMS_RecvSMS.cs" />

+ 427 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_ReturnVisitRecord.cs

@@ -0,0 +1,427 @@
1
+/**  版本信息模板在安装目录下,可自行修改。
2
+* T_ReturnVisitRecord.cs
3
+*
4
+* 功 能: N/A
5
+* 类 名: T_ReturnVisitRecord
6
+*
7
+* Ver    变更日期             负责人  变更内容
8
+* ───────────────────────────────────
9
+* V0.01  2022/4/22 14:10:32   N/A    初版
10
+*
11
+* Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
12
+*┌──────────────────────────────────┐
13
+*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
14
+*│ 版权所有:动软卓越(北京)科技有限公司              │
15
+*└──────────────────────────────────┘
16
+*/
17
+using System;
18
+using System.Data;
19
+using System.Text;
20
+using System.Data.SqlClient;
21
+ 
22
+using CallCenterApi.DB;
23
+
24
+namespace CallCenterApi.DAL
25
+{
26
+	/// <summary>
27
+	/// 数据访问类:T_ReturnVisitRecord
28
+	/// </summary>
29
+	public partial class T_ReturnVisitRecord
30
+	{
31
+		public T_ReturnVisitRecord()
32
+		{}
33
+		#region  BasicMethod
34
+
35
+		/// <summary>
36
+		/// 得到最大ID
37
+		/// </summary>
38
+		public int GetMaxId()
39
+		{
40
+		return DbHelperSQL.GetMaxID("F_ID", "T_ReturnVisitRecord"); 
41
+		}
42
+
43
+		/// <summary>
44
+		/// 是否存在该记录
45
+		/// </summary>
46
+		public bool Exists(int F_ID)
47
+		{
48
+			StringBuilder strSql=new StringBuilder();
49
+			strSql.Append("select count(1) from T_ReturnVisitRecord");
50
+			strSql.Append(" where F_ID=@F_ID");
51
+			SqlParameter[] parameters = {
52
+					new SqlParameter("@F_ID", SqlDbType.Int,4)
53
+			};
54
+			parameters[0].Value = F_ID;
55
+
56
+			return DbHelperSQL.Exists(strSql.ToString(),parameters);
57
+		}
58
+
59
+
60
+		/// <summary>
61
+		/// 增加一条数据
62
+		/// </summary>
63
+		public int Add(CallCenterApi.Model.T_ReturnVisitRecord model)
64
+		{
65
+			StringBuilder strSql=new StringBuilder();
66
+			strSql.Append("insert into T_ReturnVisitRecord(");
67
+			strSql.Append("Name,Sex,Age,Address,Tel,Admdoc,Admloc,DinoseT,HealthCondition,Advice,ProcessingResults,RevisitDays,CallResult,EpisodID)");
68
+			strSql.Append(" values (");
69
+			strSql.Append("@Name,@Sex,@Age,@Address,@Tel,@Admdoc,@Admloc,@DinoseT,@HealthCondition,@Advice,@ProcessingResults,@RevisitDays,@CallResult,@EpisodID)");
70
+			strSql.Append(";select @@IDENTITY");
71
+			SqlParameter[] parameters = {
72
+					new SqlParameter("@Name", SqlDbType.NVarChar,50),
73
+					new SqlParameter("@Sex", SqlDbType.NVarChar,50),
74
+					new SqlParameter("@Age", SqlDbType.NVarChar,50),
75
+					new SqlParameter("@Address", SqlDbType.NVarChar,200),
76
+					new SqlParameter("@Tel", SqlDbType.NVarChar,50),
77
+					new SqlParameter("@Admdoc", SqlDbType.NVarChar,50),
78
+					new SqlParameter("@Admloc", SqlDbType.NVarChar,200),
79
+					new SqlParameter("@DinoseT", SqlDbType.NChar,10),
80
+					new SqlParameter("@HealthCondition", SqlDbType.NVarChar,500),
81
+					new SqlParameter("@Advice", SqlDbType.NVarChar,500),
82
+					new SqlParameter("@ProcessingResults", SqlDbType.NVarChar,500),
83
+					new SqlParameter("@RevisitDays", SqlDbType.DateTime),
84
+					new SqlParameter("@CallResult", SqlDbType.NVarChar,100),
85
+			     new SqlParameter("@EpisodID", SqlDbType.NVarChar,100)
86
+			};
87
+			parameters[0].Value = model.Name;
88
+			parameters[1].Value = model.Sex;
89
+			parameters[2].Value = model.Age;
90
+			parameters[3].Value = model.Address;
91
+			parameters[4].Value = model.Tel;
92
+			parameters[5].Value = model.Admdoc;
93
+			parameters[6].Value = model.Admloc;
94
+			parameters[7].Value = model.DinoseT;
95
+			parameters[8].Value = model.HealthCondition;
96
+			parameters[9].Value = model.Advice;
97
+			parameters[10].Value = model.ProcessingResults;
98
+			parameters[11].Value = model.RevisitDays;
99
+			parameters[12].Value = model.CallResult;
100
+			parameters[13].Value = model.EpisodID;
101
+
102
+			object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
103
+			if (obj == null)
104
+			{
105
+				return 0;
106
+			}
107
+			else
108
+			{
109
+				return Convert.ToInt32(obj);
110
+			}
111
+		}
112
+		/// <summary>
113
+		/// 更新一条数据
114
+		/// </summary>
115
+		public bool Update(CallCenterApi.Model.T_ReturnVisitRecord model)
116
+		{
117
+			StringBuilder strSql=new StringBuilder();
118
+			strSql.Append("update T_ReturnVisitRecord set ");
119
+			strSql.Append("Name=@Name,");
120
+			strSql.Append("Sex=@Sex,");
121
+			strSql.Append("Age=@Age,");
122
+			strSql.Append("Address=@Address,");
123
+			strSql.Append("Tel=@Tel,");
124
+			strSql.Append("Admdoc=@Admdoc,");
125
+			strSql.Append("Admloc=@Admloc,");
126
+			strSql.Append("DinoseT=@DinoseT,");
127
+			strSql.Append("HealthCondition=@HealthCondition,");
128
+			strSql.Append("Advice=@Advice,");
129
+			strSql.Append("ProcessingResults=@ProcessingResults,");
130
+			strSql.Append("RevisitDays=@RevisitDays,");
131
+			strSql.Append("CallResult=@CallResult");
132
+			strSql.Append(" where F_ID=@F_ID");
133
+			SqlParameter[] parameters = {
134
+					new SqlParameter("@Name", SqlDbType.NVarChar,50),
135
+					new SqlParameter("@Sex", SqlDbType.NVarChar,50),
136
+					new SqlParameter("@Age", SqlDbType.NVarChar,50),
137
+					new SqlParameter("@Address", SqlDbType.NVarChar,200),
138
+					new SqlParameter("@Tel", SqlDbType.NVarChar,50),
139
+					new SqlParameter("@Admdoc", SqlDbType.NVarChar,50),
140
+					new SqlParameter("@Admloc", SqlDbType.NVarChar,200),
141
+					new SqlParameter("@DinoseT", SqlDbType.NChar,10),
142
+					new SqlParameter("@HealthCondition", SqlDbType.NVarChar,500),
143
+					new SqlParameter("@Advice", SqlDbType.NVarChar,500),
144
+					new SqlParameter("@ProcessingResults", SqlDbType.NVarChar,500),
145
+					new SqlParameter("@RevisitDays", SqlDbType.DateTime),
146
+					new SqlParameter("@CallResult", SqlDbType.NVarChar,100),
147
+					new SqlParameter("@F_ID", SqlDbType.Int,4)};
148
+			parameters[0].Value = model.Name;
149
+			parameters[1].Value = model.Sex;
150
+			parameters[2].Value = model.Age;
151
+			parameters[3].Value = model.Address;
152
+			parameters[4].Value = model.Tel;
153
+			parameters[5].Value = model.Admdoc;
154
+			parameters[6].Value = model.Admloc;
155
+			parameters[7].Value = model.DinoseT;
156
+			parameters[8].Value = model.HealthCondition;
157
+			parameters[9].Value = model.Advice;
158
+			parameters[10].Value = model.ProcessingResults;
159
+			parameters[11].Value = model.RevisitDays;
160
+			parameters[12].Value = model.CallResult;
161
+			parameters[13].Value = model.F_ID;
162
+
163
+			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
164
+			if (rows > 0)
165
+			{
166
+				return true;
167
+			}
168
+			else
169
+			{
170
+				return false;
171
+			}
172
+		}
173
+
174
+		/// <summary>
175
+		/// 删除一条数据
176
+		/// </summary>
177
+		public bool Delete(int F_ID)
178
+		{
179
+			
180
+			StringBuilder strSql=new StringBuilder();
181
+			strSql.Append("delete from T_ReturnVisitRecord ");
182
+			strSql.Append(" where F_ID=@F_ID");
183
+			SqlParameter[] parameters = {
184
+					new SqlParameter("@F_ID", SqlDbType.Int,4)
185
+			};
186
+			parameters[0].Value = F_ID;
187
+
188
+			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
189
+			if (rows > 0)
190
+			{
191
+				return true;
192
+			}
193
+			else
194
+			{
195
+				return false;
196
+			}
197
+		}
198
+		/// <summary>
199
+		/// 批量删除数据
200
+		/// </summary>
201
+		public bool DeleteList(string F_IDlist )
202
+		{
203
+			StringBuilder strSql=new StringBuilder();
204
+			strSql.Append("delete from T_ReturnVisitRecord ");
205
+			strSql.Append(" where F_ID in ("+F_IDlist + ")  ");
206
+			int rows=DbHelperSQL.ExecuteSql(strSql.ToString());
207
+			if (rows > 0)
208
+			{
209
+				return true;
210
+			}
211
+			else
212
+			{
213
+				return false;
214
+			}
215
+		}
216
+
217
+
218
+		/// <summary>
219
+		/// 得到一个对象实体
220
+		/// </summary>
221
+		public CallCenterApi.Model.T_ReturnVisitRecord GetModel(int F_ID)
222
+		{
223
+			
224
+			StringBuilder strSql=new StringBuilder();
225
+			strSql.Append("select  top 1 F_ID,Name,Sex,Age,Address,Tel,Admdoc,Admloc,DinoseT,HealthCondition,Advice,ProcessingResults,RevisitDays,CallResult from T_ReturnVisitRecord ");
226
+			strSql.Append(" where F_ID=@F_ID");
227
+			SqlParameter[] parameters = {
228
+					new SqlParameter("@F_ID", SqlDbType.Int,4)
229
+			};
230
+			parameters[0].Value = F_ID;
231
+
232
+			CallCenterApi.Model.T_ReturnVisitRecord model=new CallCenterApi.Model.T_ReturnVisitRecord();
233
+			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
234
+			if(ds.Tables[0].Rows.Count>0)
235
+			{
236
+				return DataRowToModel(ds.Tables[0].Rows[0]);
237
+			}
238
+			else
239
+			{
240
+				return null;
241
+			}
242
+		}
243
+
244
+
245
+		/// <summary>
246
+		/// 得到一个对象实体
247
+		/// </summary>
248
+		public CallCenterApi.Model.T_ReturnVisitRecord DataRowToModel(DataRow row)
249
+		{
250
+			CallCenterApi.Model.T_ReturnVisitRecord model=new CallCenterApi.Model.T_ReturnVisitRecord();
251
+			if (row != null)
252
+			{
253
+				if(row["F_ID"]!=null && row["F_ID"].ToString()!="")
254
+				{
255
+					model.F_ID=int.Parse(row["F_ID"].ToString());
256
+				}
257
+				if(row["Name"]!=null)
258
+				{
259
+					model.Name=row["Name"].ToString();
260
+				}
261
+				if(row["Sex"]!=null)
262
+				{
263
+					model.Sex=row["Sex"].ToString();
264
+				}
265
+				if(row["Age"]!=null)
266
+				{
267
+					model.Age=row["Age"].ToString();
268
+				}
269
+				if(row["Address"]!=null)
270
+				{
271
+					model.Address=row["Address"].ToString();
272
+				}
273
+				if(row["Tel"]!=null)
274
+				{
275
+					model.Tel=row["Tel"].ToString();
276
+				}
277
+				if(row["Admdoc"]!=null)
278
+				{
279
+					model.Admdoc=row["Admdoc"].ToString();
280
+				}
281
+				if(row["Admloc"]!=null)
282
+				{
283
+					model.Admloc=row["Admloc"].ToString();
284
+				}
285
+				if(row["DinoseT"]!=null)
286
+				{
287
+					model.DinoseT=row["DinoseT"].ToString();
288
+				}
289
+				if(row["HealthCondition"]!=null)
290
+				{
291
+					model.HealthCondition=row["HealthCondition"].ToString();
292
+				}
293
+				if(row["Advice"]!=null)
294
+				{
295
+					model.Advice=row["Advice"].ToString();
296
+				}
297
+				if(row["ProcessingResults"]!=null)
298
+				{
299
+					model.ProcessingResults=row["ProcessingResults"].ToString();
300
+				}
301
+				if(row["RevisitDays"]!=null && row["RevisitDays"].ToString()!="")
302
+				{
303
+					model.RevisitDays=DateTime.Parse(row["RevisitDays"].ToString());
304
+				}
305
+				if(row["CallResult"]!=null)
306
+				{
307
+					model.CallResult=row["CallResult"].ToString();
308
+				}
309
+			}
310
+			return model;
311
+		}
312
+
313
+		/// <summary>
314
+		/// 获得数据列表
315
+		/// </summary>
316
+		public DataSet GetList(string strWhere)
317
+		{
318
+			StringBuilder strSql=new StringBuilder();
319
+			strSql.Append("select F_ID,Name,Sex,Age,Address,Tel,Admdoc,Admloc,DinoseT,HealthCondition,Advice,ProcessingResults,RevisitDays,CallResult ");
320
+			strSql.Append(" FROM T_ReturnVisitRecord ");
321
+			if(strWhere.Trim()!="")
322
+			{
323
+				strSql.Append(" where "+strWhere);
324
+			}
325
+			return DbHelperSQL.Query(strSql.ToString());
326
+		}
327
+
328
+		/// <summary>
329
+		/// 获得前几行数据
330
+		/// </summary>
331
+		public DataSet GetList(int Top,string strWhere,string filedOrder)
332
+		{
333
+			StringBuilder strSql=new StringBuilder();
334
+			strSql.Append("select ");
335
+			if(Top>0)
336
+			{
337
+				strSql.Append(" top "+Top.ToString());
338
+			}
339
+			strSql.Append(" F_ID,Name,Sex,Age,Address,Tel,Admdoc,Admloc,DinoseT,HealthCondition,Advice,ProcessingResults,RevisitDays,CallResult ");
340
+			strSql.Append(" FROM T_ReturnVisitRecord ");
341
+			if(strWhere.Trim()!="")
342
+			{
343
+				strSql.Append(" where "+strWhere);
344
+			}
345
+			strSql.Append(" order by " + filedOrder);
346
+			return DbHelperSQL.Query(strSql.ToString());
347
+		}
348
+
349
+		/// <summary>
350
+		/// 获取记录总数
351
+		/// </summary>
352
+		public int GetRecordCount(string strWhere)
353
+		{
354
+			StringBuilder strSql=new StringBuilder();
355
+			strSql.Append("select count(1) FROM T_ReturnVisitRecord ");
356
+			if(strWhere.Trim()!="")
357
+			{
358
+				strSql.Append(" where "+strWhere);
359
+			}
360
+			object obj = DbHelperSQL.GetSingle(strSql.ToString());
361
+			if (obj == null)
362
+			{
363
+				return 0;
364
+			}
365
+			else
366
+			{
367
+				return Convert.ToInt32(obj);
368
+			}
369
+		}
370
+		/// <summary>
371
+		/// 分页获取数据列表
372
+		/// </summary>
373
+		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
374
+		{
375
+			StringBuilder strSql=new StringBuilder();
376
+			strSql.Append("SELECT * FROM ( ");
377
+			strSql.Append(" SELECT ROW_NUMBER() OVER (");
378
+			if (!string.IsNullOrEmpty(orderby.Trim()))
379
+			{
380
+				strSql.Append("order by T." + orderby );
381
+			}
382
+			else
383
+			{
384
+				strSql.Append("order by T.F_ID desc");
385
+			}
386
+			strSql.Append(")AS Row, T.*  from T_ReturnVisitRecord T ");
387
+			if (!string.IsNullOrEmpty(strWhere.Trim()))
388
+			{
389
+				strSql.Append(" WHERE " + strWhere);
390
+			}
391
+			strSql.Append(" ) TT");
392
+			strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
393
+			return DbHelperSQL.Query(strSql.ToString());
394
+		}
395
+
396
+		/*
397
+		/// <summary>
398
+		/// 分页获取数据列表
399
+		/// </summary>
400
+		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
401
+		{
402
+			SqlParameter[] parameters = {
403
+					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
404
+					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
405
+					new SqlParameter("@PageSize", SqlDbType.Int),
406
+					new SqlParameter("@PageIndex", SqlDbType.Int),
407
+					new SqlParameter("@IsReCount", SqlDbType.Bit),
408
+					new SqlParameter("@OrderType", SqlDbType.Bit),
409
+					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
410
+					};
411
+			parameters[0].Value = "T_ReturnVisitRecord";
412
+			parameters[1].Value = "F_ID";
413
+			parameters[2].Value = PageSize;
414
+			parameters[3].Value = PageIndex;
415
+			parameters[4].Value = 0;
416
+			parameters[5].Value = 0;
417
+			parameters[6].Value = strWhere;	
418
+			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
419
+		}*/
420
+
421
+		#endregion  BasicMethod
422
+		#region  ExtensionMethod
423
+
424
+		#endregion  ExtensionMethod
425
+	}
426
+}
427
+

+ 135 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerNewController.cs

@@ -964,6 +964,7 @@ namespace CallCenterApi.Interface.Controllers.customer
964 964
         public ActionResult GetHzinfo(string stime,string etime ,string deptname,int PageIndex=1,int PageSize=10)
965 965
         {
966 966
             ServiceGethzinfo.WebService1SoapClient client = new ServiceGethzinfo.WebService1SoapClient();
967
+           //getinfo 改成人家的接口名
967 968
             var a = client.Getinfo(stime+","+etime);
968 969
             //var obj = DeserializeObject<Models.Dto.xml>(a);
969 970
             var obj = Getxml(a);
@@ -1036,6 +1037,140 @@ namespace CallCenterApi.Interface.Controllers.customer
1036 1037
             }
1037 1038
             return adminfolist;
1038 1039
         }
1040
+
1041
+        /// <summary>
1042
+        /// 根据id读取信息
1043
+        /// </summary>
1044
+        /// <param name="stime"></param>
1045
+        /// <param name="etime"></param>
1046
+        /// <param name="ID"></param>
1047
+        /// <returns></returns>
1048
+        public ActionResult GetHzByIdinfo(string stime, string etime, string ID)
1049
+        {
1050
+            ServiceGethzinfo.WebService1SoapClient client = new ServiceGethzinfo.WebService1SoapClient();
1051
+            //getinfo 改成人家的接口名
1052
+            var a = client.Getinfo(stime + "," + etime);
1053
+            var obj = Getxml(a);
1054
+            if (!string.IsNullOrEmpty(ID))
1055
+            {
1056
+                obj = obj.Where(p => p.EpisodID.Equals(ID)).ToList();
1057
+            }           
1058
+ 
1059
+            return Success("成功", obj);
1060
+        }
1061
+
1062
+
1063
+
1064
+        public ActionResult AddReturnVisitRecord(string ID,string HealthCondition,string Advice,string ProcessingResults,string CallResult)
1065
+        {
1066
+            BLL.T_ReturnVisitRecord BLL = new BLL.T_ReturnVisitRecord();
1067
+
1068
+            ServiceGethzinfo.WebService1SoapClient client = new ServiceGethzinfo.WebService1SoapClient();
1069
+            //getinfo 改成人家的接口名
1070
+
1071
+            string stime="";
1072
+            string etime="";
1073
+            var a = client.Getinfo(stime + "," + etime);
1074
+            var obj = Getxml(a);
1075
+            if (!string.IsNullOrEmpty(ID))
1076
+            {
1077
+                obj = obj.Where(p => p.EpisodID.Equals(ID)).ToList();
1078
+            }         
1079
+            Model.T_ReturnVisitRecord model = new Model.T_ReturnVisitRecord();
1080
+            model.EpisodID = ID;
1081
+            model.HealthCondition = HealthCondition;
1082
+            model.Advice = Advice;
1083
+            model.ProcessingResults = ProcessingResults;
1084
+            model.CallResult = CallResult;
1085
+            model.RevisitDays = DateTime.Now;
1086
+            if (obj != null && obj.Count > 0)
1087
+            {
1088
+                model.Tel = obj[0].TelH;
1089
+                model.Sex = obj[0].Sex;
1090
+                model.Name = obj[0].Name;
1091
+                model.Age = obj[0].Age;
1092
+                model.Address = obj[0].Add;
1093
+                model.Admdoc = obj[0].Admdoc;
1094
+                model.Admloc = obj[0].Admloc;
1095
+                model.DinoseT = obj[0].DinoseT;
1096
+            }
1097
+
1098
+            int n = BLL.Add(model);
1099
+            if (n > 0)
1100
+            {
1101
+                return Success("回访成功");
1102
+            }
1103
+
1104
+            return Error("回访失败");
1105
+
1106
+        }
1107
+
1108
+        /// <summary>
1109
+        /// 筛选条件:回访时间、就诊科室、就诊内容、呼叫结果
1110
+        /// </summary>
1111
+        /// <param name="PageIndex"></param>
1112
+        /// <param name="PageSize"></param>
1113
+        /// <returns></returns>
1114
+
1115
+        public ActionResult ReturnVisitRecordList(string starttime,string endtime,string admloc,string dinoseT, string callresult,int PageIndex = 1, int PageSize = 10)
1116
+        {
1117
+            BLL.T_ReturnVisitRecord rBLL = new BLL.T_ReturnVisitRecord();
1118
+            string sql = " and 1=1 ";
1119
+
1120
+            if (!string.IsNullOrWhiteSpace(starttime))
1121
+            {
1122
+                starttime = starttime + " 00:00:00";
1123
+                sql += " and  RevisitDays>'" + starttime + "' ";
1124
+            }
1125
+
1126
+            if (!string.IsNullOrWhiteSpace(endtime))
1127
+            {
1128
+                endtime = endtime + " 23:59:59";
1129
+                sql += " and  RevisitDays <= '" + endtime + "'  ";
1130
+            }
1131
+
1132
+            //就诊keshi
1133
+            if (!string.IsNullOrWhiteSpace(admloc))
1134
+                sql += " and  Admloc like '%" + admloc + "%'";
1135
+
1136
+            //就诊内容
1137
+            if (!string.IsNullOrWhiteSpace(dinoseT))
1138
+                sql += " and DinoseT like '%" + dinoseT + "%'";
1139
+
1140
+           // sql += " and DinoseT ='" + dinoseT + "'";
1141
+
1142
+            if (!string.IsNullOrWhiteSpace(callresult))
1143
+                sql += " and Callresult ='" + callresult + "'";
1144
+
1145
+            DataTable dt = new DataTable();
1146
+            int recordCount = 0;
1147
+            if (!string.IsNullOrWhiteSpace(sql))
1148
+            {           
1149
+                dt = BLL.PagerBLL.GetListPager(
1150
+                    "T_ReturnVisitRecord",
1151
+                    "F_Id",
1152
+                    "*",
1153
+                    sql,
1154
+                    "ORDER BY RevisitDays desc",
1155
+                    PageSize,
1156
+                    PageIndex,
1157
+                    true,
1158
+                    out recordCount);
1159
+            }
1160
+            var obj = new
1161
+            {
1162
+                state = "success",
1163
+                message = "成功",
1164
+                rows = dt,
1165
+                total = recordCount
1166
+            };
1167
+
1168
+            return Content(obj.ToJson());
1169
+
1170
+        }
1171
+
1039 1172
         #endregion
1173
+
1174
+
1040 1175
     }
1041 1176
 }

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -51,7 +51,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
51 51
                     int pagesize = 10;
52 52
                     if (keyword.Trim() != "" && keyword != "undefined")
53 53
                     {
54
-                        sql += $"  and CustomerName like '%" + keyword.Trim() + "%' or CustomerTel like '%" + keyword.Trim() + "%'or Location like '%" + keyword.Trim() + "%'  or Reservation like '%" + keyword.Trim() + "%'";
54
+                        sql += $"  and CustomerName like '%" + keyword.Trim() + "%' or CustomerTel like '%" + keyword.Trim() + "%'or Location like '%" + keyword.Trim() + "%'  or Reservation like '%" + keyword.Trim() + "%'  or Problem like '%" + keyword.Trim() + "%' ";
55 55
                     }
56 56
                     if (state.Trim() != "" && state != "undefined")
57 57
                     {
@@ -68,7 +68,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
68 68
                         sql += "and  WorkOrderID like'%" + workOrderID+ "%'";
69 69
                     }
70 70
                     if (customerTel.Trim() != "" && customerTel != "undefined")
71
-                    {
71
+                    { 
72 72
                         sql += "and  CustomerTel like'%" + customerTel+"%'";
73 73
                     }
74 74
                     if (!string.IsNullOrEmpty(starttime))

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.Model/CallCenterApi.Model.csproj

@@ -95,6 +95,7 @@
95 95
     <Compile Include="T_RegionCategory.cs" />
96 96
     <Compile Include="T_RepositoryCategory.cs" />
97 97
     <Compile Include="T_RepositoryInformation.cs" />
98
+    <Compile Include="T_ReturnVisitRecord.cs" />
98 99
     <Compile Include="T_SMS_List.cs" />
99 100
     <Compile Include="T_SMS_Receive.cs" />
100 101
     <Compile Include="T_SMS_RecvSMS.cs" />

+ 169 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_ReturnVisitRecord.cs

@@ -0,0 +1,169 @@
1
+/**  版本信息模板在安装目录下,可自行修改。
2
+* T_ReturnVisitRecord.cs
3
+*
4
+* 功 能: N/A
5
+* 类 名: T_ReturnVisitRecord
6
+*
7
+* Ver    变更日期             负责人  变更内容
8
+* ───────────────────────────────────
9
+* V0.01  2022/4/22 14:10:32   N/A    初版
10
+*
11
+* Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
12
+*┌──────────────────────────────────┐
13
+*│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
14
+*│ 版权所有:动软卓越(北京)科技有限公司              │
15
+*└──────────────────────────────────┘
16
+*/
17
+using System;
18
+namespace CallCenterApi.Model
19
+{
20
+	/// <summary>
21
+	/// T_ReturnVisitRecord:实体类(属性说明自动提取数据库字段的描述信息)
22
+	/// </summary>
23
+	[Serializable]
24
+	public partial class T_ReturnVisitRecord
25
+	{
26
+		public T_ReturnVisitRecord()
27
+		{}
28
+		#region Model
29
+		private int _f_id;
30
+		private string _name;
31
+		private string _sex;
32
+		private string _age;
33
+		private string _address;
34
+		private string _tel;
35
+		private string _admdoc;
36
+		private string _admloc;
37
+		private string _dinoset;
38
+		private string _healthcondition;
39
+		private string _advice;
40
+		private string _processingresults;
41
+		private DateTime? _revisitdays;
42
+		private string _callresult;
43
+
44
+		private string _episodID;
45
+
46
+		public string EpisodID
47
+		{
48
+			set { _episodID = value; }
49
+			get { return _episodID; }
50
+		}
51
+
52
+
53
+		/// <summary>
54
+		/// 
55
+		/// </summary>
56
+		public int F_ID
57
+		{
58
+			set{ _f_id=value;}
59
+			get{return _f_id;}
60
+		}
61
+		/// <summary>
62
+		/// 
63
+		/// </summary>
64
+		public string Name
65
+		{
66
+			set{ _name=value;}
67
+			get{return _name;}
68
+		}
69
+		/// <summary>
70
+		/// 
71
+		/// </summary>
72
+		public string Sex
73
+		{
74
+			set{ _sex=value;}
75
+			get{return _sex;}
76
+		}
77
+		/// <summary>
78
+		/// 
79
+		/// </summary>
80
+		public string Age
81
+		{
82
+			set{ _age=value;}
83
+			get{return _age;}
84
+		}
85
+		/// <summary>
86
+		/// 
87
+		/// </summary>
88
+		public string Address
89
+		{
90
+			set{ _address=value;}
91
+			get{return _address;}
92
+		}
93
+		/// <summary>
94
+		/// 
95
+		/// </summary>
96
+		public string Tel
97
+		{
98
+			set{ _tel=value;}
99
+			get{return _tel;}
100
+		}
101
+		/// <summary>
102
+		/// 就诊医生
103
+		/// </summary>
104
+		public string Admdoc
105
+		{
106
+			set{ _admdoc=value;}
107
+			get{return _admdoc;}
108
+		}
109
+		/// <summary>
110
+		/// 就诊科室
111
+		/// </summary>
112
+		public string Admloc
113
+		{
114
+			set{ _admloc=value;}
115
+			get{return _admloc;}
116
+		}
117
+		/// <summary>
118
+		/// 就诊内容
119
+		/// </summary>
120
+		public string DinoseT
121
+		{
122
+			set{ _dinoset=value;}
123
+			get{return _dinoset;}
124
+		}
125
+		/// <summary>
126
+		/// 
127
+		/// </summary>
128
+		public string HealthCondition
129
+		{
130
+			set{ _healthcondition=value;}
131
+			get{return _healthcondition;}
132
+		}
133
+		/// <summary>
134
+		/// 
135
+		/// </summary>
136
+		public string Advice
137
+		{
138
+			set{ _advice=value;}
139
+			get{return _advice;}
140
+		}
141
+		/// <summary>
142
+		/// 
143
+		/// </summary>
144
+		public string ProcessingResults
145
+		{
146
+			set{ _processingresults=value;}
147
+			get{return _processingresults;}
148
+		}
149
+		/// <summary>
150
+		/// 
151
+		/// </summary>
152
+		public DateTime? RevisitDays
153
+		{
154
+			set{ _revisitdays=value;}
155
+			get{return _revisitdays;}
156
+		}
157
+		/// <summary>
158
+		/// 
159
+		/// </summary>
160
+		public string CallResult
161
+		{
162
+			set{ _callresult=value;}
163
+			get{return _callresult;}
164
+		}
165
+		#endregion Model
166
+
167
+	}
168
+}
169
+