1550076451 3 lat temu
rodzic
commit
7bd131a4ee

+ 1 - 0
RMYY_CallCenter_Api.Bll/RMYY_CallCenter_Api.Bll.csproj

@@ -88,6 +88,7 @@
88 88
     <Compile Include="T_Sys_Class.cs" />
89 89
     <Compile Include="T_Sys_CustomFiled.cs" />
90 90
     <Compile Include="T_Sys_Department.cs" />
91
+    <Compile Include="T_Sys_DictDrug.cs" />
91 92
     <Compile Include="T_Sys_DictionaryBase.cs" />
92 93
     <Compile Include="T_Sys_DictionaryValue.cs" />
93 94
     <Compile Include="T_Sys_GongDan.cs" />

+ 155 - 0
RMYY_CallCenter_Api.Bll/T_Sys_DictDrug.cs

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

+ 1 - 0
RMYY_CallCenter_Api.Dal/RMYY_CallCenter_Api.Dal.csproj

@@ -86,6 +86,7 @@
86 86
     <Compile Include="T_Sys_Class.cs" />
87 87
     <Compile Include="T_Sys_CustomFiled.cs" />
88 88
     <Compile Include="T_Sys_Department.cs" />
89
+    <Compile Include="T_Sys_DictDrug.cs" />
89 90
     <Compile Include="T_Sys_DictionaryBase.cs" />
90 91
     <Compile Include="T_Sys_DictionaryValue.cs" />
91 92
     <Compile Include="T_Sys_GongDan.cs" />

+ 406 - 0
RMYY_CallCenter_Api.Dal/T_Sys_DictDrug.cs

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

+ 1 - 0
RMYY_CallCenter_Api.Model/RMYY_CallCenter_Api.Model.csproj

@@ -87,6 +87,7 @@
87 87
     <Compile Include="T_Sys_Class.cs" />
88 88
     <Compile Include="T_Sys_CustomFiled.cs" />
89 89
     <Compile Include="T_Sys_Department.cs" />
90
+    <Compile Include="T_Sys_DictDrug.cs" />
90 91
     <Compile Include="T_Sys_DictionaryBase.cs" />
91 92
     <Compile Include="T_Sys_DictionaryValue.cs" />
92 93
     <Compile Include="T_Sys_GongDan.cs" />

+ 142 - 0
RMYY_CallCenter_Api.Model/T_Sys_DictDrug.cs

@@ -0,0 +1,142 @@
1
+using System;
2
+namespace RMYY_CallCenter_Api.Model
3
+{
4
+    /// <summary>
5
+    /// T_Sys_DictDrug:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_Sys_DictDrug
9
+    {
10
+        public T_Sys_DictDrug()
11
+        { }
12
+        #region Model
13
+        private int _f_id;
14
+        private int? _f_dictdrugid;
15
+        private string _cdgdispcode;
16
+        private string _cdgname;
17
+        private string _cdgnamecode;
18
+        private string _cdggeneralname;
19
+        private string _cdgspecification;
20
+        private decimal? _idgmaxstock;
21
+        private decimal? _idgminstock;
22
+        private string _cdgdescription;
23
+        private decimal? _idgstdprice;
24
+        private decimal? _idglocalstdprice;
25
+        private DateTime? _f_createtime;
26
+        private int? _f_isdelete;
27
+        /// <summary>
28
+        /// 
29
+        /// </summary>
30
+        public int F_ID
31
+        {
32
+            set { _f_id = value; }
33
+            get { return _f_id; }
34
+        }
35
+        /// <summary>
36
+        /// 药品id
37
+        /// </summary>
38
+        public int? F_DictDrugid
39
+        {
40
+            set { _f_dictdrugid = value; }
41
+            get { return _f_dictdrugid; }
42
+        }
43
+        /// <summary>
44
+        /// 药品编码
45
+        /// </summary>
46
+        public string cDgDispCode
47
+        {
48
+            set { _cdgdispcode = value; }
49
+            get { return _cdgdispcode; }
50
+        }
51
+        /// <summary>
52
+        /// 通用名
53
+        /// </summary>
54
+        public string cDgName
55
+        {
56
+            set { _cdgname = value; }
57
+            get { return _cdgname; }
58
+        }
59
+        /// <summary>
60
+        /// 输入编码(拼音名)
61
+        /// </summary>
62
+        public string cDgNameCode
63
+        {
64
+            set { _cdgnamecode = value; }
65
+            get { return _cdgnamecode; }
66
+        }
67
+        /// <summary>
68
+        /// 商品名
69
+        /// </summary>
70
+        public string cDgGeneralName
71
+        {
72
+            set { _cdggeneralname = value; }
73
+            get { return _cdggeneralname; }
74
+        }
75
+        /// <summary>
76
+        /// 规格
77
+        /// </summary>
78
+        public string cDgSpecification
79
+        {
80
+            set { _cdgspecification = value; }
81
+            get { return _cdgspecification; }
82
+        }
83
+        /// <summary>
84
+        /// 最高库存
85
+        /// </summary>
86
+        public decimal? iDgMaxstock
87
+        {
88
+            set { _idgmaxstock = value; }
89
+            get { return _idgmaxstock; }
90
+        }
91
+        /// <summary>
92
+        /// 最低库存
93
+        /// </summary>
94
+        public decimal? iDgMinstock
95
+        {
96
+            set { _idgminstock = value; }
97
+            get { return _idgminstock; }
98
+        }
99
+        /// <summary>
100
+        /// 药品说明
101
+        /// </summary>
102
+        public string cDgDescription
103
+        {
104
+            set { _cdgdescription = value; }
105
+            get { return _cdgdescription; }
106
+        }
107
+        /// <summary>
108
+        /// 国家限价
109
+        /// </summary>
110
+        public decimal? iDgStdPrice
111
+        {
112
+            set { _idgstdprice = value; }
113
+            get { return _idgstdprice; }
114
+        }
115
+        /// <summary>
116
+        /// 地区限价
117
+        /// </summary>
118
+        public decimal? iDgLocalStdPrice
119
+        {
120
+            set { _idglocalstdprice = value; }
121
+            get { return _idglocalstdprice; }
122
+        }
123
+        /// <summary>
124
+        /// 
125
+        /// </summary>
126
+        public DateTime? F_CreateTime
127
+        {
128
+            set { _f_createtime = value; }
129
+            get { return _f_createtime; }
130
+        }
131
+        /// <summary>
132
+        /// 
133
+        /// </summary>
134
+        public int? F_IsDelete
135
+        {
136
+            set { _f_isdelete = value; }
137
+            get { return _f_isdelete; }
138
+        }
139
+        #endregion Model
140
+
141
+    }
142
+}

+ 599 - 0
RMYY_CallCenter_Api.Utility/Http/HttpMethods.cs

@@ -0,0 +1,599 @@
1
+using System;
2
+using System.Collections;
3
+using System.Collections.Generic;
4
+using System.IO;
5
+using System.Net;
6
+using System.Net.Http;
7
+using System.Net.Security;
8
+using System.Security.Cryptography.X509Certificates;
9
+using System.Text;
10
+
11
+
12
+namespace RMYY_CallCenter_Api.Utility
13
+{
14
+    public class HttpMethods
15
+    {
16
+        #region POST
17
+        /// <summary>
18
+        /// HTTP POST方式请求数据
19
+        /// </summary>
20
+        /// <param name="url">URL.</param>
21
+        /// <param name="param">POST的数据</param>
22
+        /// <returns></returns>
23
+        public static string HttpPost(string url, string param = null, string contentType = "application/x-www-form-urlencoded"
24
+            )
25
+        {
26
+            HttpWebRequest request;
27
+
28
+            //如果是发送HTTPS请求  
29
+            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
30
+            {
31
+                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
32
+                request = WebRequest.Create(url) as HttpWebRequest;
33
+                request.ProtocolVersion = HttpVersion.Version10;
34
+            }
35
+            else
36
+            {
37
+                request = WebRequest.Create(url) as HttpWebRequest;
38
+            }
39
+
40
+
41
+            request.Method = "POST";
42
+            request.ContentType = contentType;
43
+            request.Accept = "*/*";
44
+            request.Timeout = 15000;
45
+            request.AllowAutoRedirect = false;
46
+
47
+            StreamWriter requestStream = null;
48
+            WebResponse response = null;
49
+            string responseStr = null;
50
+
51
+            try
52
+            {
53
+                requestStream = new StreamWriter(request.GetRequestStream());
54
+                requestStream.Write(param);
55
+                requestStream.Close();
56
+
57
+                response = request.GetResponse();
58
+                if (response != null)
59
+                {
60
+                    StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
61
+                    responseStr = reader.ReadToEnd();
62
+                    reader.Close();
63
+                }
64
+
65
+              
66
+            }
67
+            catch (Exception ex)
68
+            {
69
+                LogHelper.Error(url + "\r\n" + param + "\r\n" + ex.ToString());
70
+            }
71
+            finally
72
+            {
73
+                request = null;
74
+                requestStream = null;
75
+                response = null;
76
+            }
77
+
78
+            return responseStr;
79
+        }
80
+
81
+
82
+        private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
83
+        {
84
+            return true; //总是接受  
85
+        }
86
+        public static string BuildRequest(string strUrl, Dictionary<string, string> dicPara, string fileName)
87
+        {
88
+            string contentType = "image/jpeg";
89
+            //待请求参数数组
90
+            FileStream Pic = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
91
+            byte[] PicByte = new byte[Pic.Length];
92
+            Pic.Read(PicByte, 0, PicByte.Length);
93
+            int lengthFile = PicByte.Length;
94
+
95
+            //构造请求地址
96
+
97
+            //设置HttpWebRequest基本信息
98
+            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(strUrl);
99
+            //设置请求方式:get、post
100
+            request.Method = "POST";
101
+            //设置boundaryValue
102
+            string boundaryValue = DateTime.Now.Ticks.ToString("x");
103
+            string boundary = "--" + boundaryValue;
104
+            request.ContentType = "\r\nmultipart/form-data; boundary=" + boundaryValue;
105
+            //设置KeepAlive
106
+            request.KeepAlive = true;
107
+            //设置请求数据,拼接成字符串
108
+            StringBuilder sbHtml = new StringBuilder();
109
+            foreach (KeyValuePair<string, string> key in dicPara)
110
+            {
111
+                sbHtml.Append(boundary + "\r\nContent-Disposition: form-data; name=\"" + key.Key + "\"\r\n\r\n" + key.Value + "\r\n");
112
+            }
113
+            sbHtml.Append(boundary + "\r\nContent-Disposition: form-data; name=\"pic\"; filename=\"");
114
+            sbHtml.Append(fileName);
115
+            sbHtml.Append("\"\r\nContent-Type: " + contentType + "\r\n\r\n");
116
+            string postHeader = sbHtml.ToString();
117
+            //将请求数据字符串类型根据编码格式转换成字节流
118
+            Encoding code = Encoding.GetEncoding("UTF-8");
119
+            byte[] postHeaderBytes = code.GetBytes(postHeader);
120
+            byte[] boundayBytes = Encoding.ASCII.GetBytes("\r\n" + boundary + "--\r\n");
121
+            //设置长度
122
+            long length = postHeaderBytes.Length + lengthFile + boundayBytes.Length;
123
+            request.ContentLength = length;
124
+
125
+            //请求远程HTTP
126
+            Stream requestStream = request.GetRequestStream();
127
+            Stream myStream = null;
128
+            try
129
+            {
130
+                //发送数据请求服务器
131
+                requestStream.Write(postHeaderBytes, 0, postHeaderBytes.Length);
132
+                requestStream.Write(PicByte, 0, lengthFile);
133
+                requestStream.Write(boundayBytes, 0, boundayBytes.Length);
134
+                HttpWebResponse HttpWResp = (HttpWebResponse)request.GetResponse();
135
+                myStream = HttpWResp.GetResponseStream();
136
+            }
137
+            catch (WebException e)
138
+            {
139
+                //LogResult(e.Message);
140
+                return "";
141
+            }
142
+            finally
143
+            {
144
+                if (requestStream != null)
145
+                {
146
+                    requestStream.Close();
147
+                }
148
+            }
149
+
150
+            //读取处理结果
151
+            StreamReader reader = new StreamReader(myStream, code);
152
+            StringBuilder responseData = new StringBuilder();
153
+
154
+            String line;
155
+            while ((line = reader.ReadLine()) != null)
156
+            {
157
+                responseData.Append(line);
158
+            }
159
+            myStream.Close();
160
+            Pic.Close();
161
+
162
+            return responseData.ToString();
163
+        }
164
+        #endregion
165
+
166
+        #region Put
167
+        /// <summary>
168
+        /// HTTP Put方式请求数据.
169
+        /// </summary>
170
+        /// <param name="url">URL.</param>
171
+        /// <returns></returns>
172
+        public static string HttpPut(string url, string param = null)
173
+        {
174
+            HttpWebRequest request;
175
+
176
+            //如果是发送HTTPS请求  
177
+            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
178
+            {
179
+                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
180
+                request = WebRequest.Create(url) as HttpWebRequest;
181
+                request.ProtocolVersion = HttpVersion.Version10;
182
+            }
183
+            else
184
+            {
185
+                request = WebRequest.Create(url) as HttpWebRequest;
186
+            }
187
+            request.Method = "PUT";
188
+            request.ContentType = "application/x-www-form-urlencoded";
189
+            request.Accept = "*/*";
190
+            request.Timeout = 15000;
191
+            request.AllowAutoRedirect = false;
192
+
193
+            StreamWriter requestStream = null;
194
+            WebResponse response = null;
195
+            string responseStr = null;
196
+
197
+            try
198
+            {
199
+                requestStream = new StreamWriter(request.GetRequestStream());
200
+                requestStream.Write(param);
201
+                requestStream.Close();
202
+
203
+                response = request.GetResponse();
204
+                if (response != null)
205
+                {
206
+                    StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
207
+                    responseStr = reader.ReadToEnd();
208
+                    reader.Close();
209
+                }
210
+            }
211
+            catch (Exception)
212
+            {
213
+                throw;
214
+            }
215
+            finally
216
+            {
217
+                request = null;
218
+                requestStream = null;
219
+                response = null;
220
+            }
221
+
222
+            return responseStr;
223
+        }
224
+        #endregion
225
+
226
+        #region Delete
227
+        /// <summary>
228
+        /// HTTP Delete方式请求数据.
229
+        /// </summary>
230
+        /// <param name="url">URL.</param>
231
+        /// <returns></returns>
232
+        public static string HttpDelete(string url, string param = null)
233
+        {
234
+            HttpWebRequest request;
235
+
236
+            //如果是发送HTTPS请求  
237
+            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
238
+            {
239
+                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
240
+                request = WebRequest.Create(url) as HttpWebRequest;
241
+                request.ProtocolVersion = HttpVersion.Version10;
242
+            }
243
+            else
244
+            {
245
+                request = WebRequest.Create(url) as HttpWebRequest;
246
+            }
247
+            request.Method = "Delete";
248
+            request.ContentType = "application/x-www-form-urlencoded";
249
+            request.Accept = "*/*";
250
+            request.Timeout = 15000;
251
+            request.AllowAutoRedirect = false;
252
+
253
+            StreamWriter requestStream = null;
254
+            WebResponse response = null;
255
+            string responseStr = null;
256
+
257
+            try
258
+            {
259
+                requestStream = new StreamWriter(request.GetRequestStream());
260
+                requestStream.Write(param);
261
+                requestStream.Close();
262
+
263
+                response = request.GetResponse();
264
+                if (response != null)
265
+                {
266
+                    StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
267
+                    responseStr = reader.ReadToEnd();
268
+                    reader.Close();
269
+                }
270
+            }
271
+            catch (Exception)
272
+            {
273
+                throw;
274
+            }
275
+            return responseStr;
276
+        }
277
+        #endregion
278
+
279
+        #region Get
280
+        /// <summary>
281
+        /// HTTP GET方式请求数据.
282
+        /// </summary>
283
+        /// <param name="url">URL.</param>
284
+        /// <returns></returns>
285
+        public static string HttpGet(string url, Hashtable headht = null)
286
+        {
287
+            HttpWebRequest request;
288
+
289
+            //如果是发送HTTPS请求  
290
+            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
291
+            {
292
+                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
293
+                request = WebRequest.Create(url) as HttpWebRequest;
294
+                request.ProtocolVersion = HttpVersion.Version10;
295
+            }
296
+            else
297
+            {
298
+                request = WebRequest.Create(url) as HttpWebRequest;
299
+            }
300
+            request.Method = "GET";
301
+            //request.ContentType = "application/x-www-form-urlencoded";
302
+            request.Accept = "*/*";
303
+            request.Timeout = 15000;
304
+            request.AllowAutoRedirect = false;
305
+            WebResponse response = null;
306
+            string responseStr = null;
307
+            if (headht != null)
308
+            {
309
+                foreach (DictionaryEntry item in headht)
310
+                {
311
+                    request.Headers.Add(item.Key.ToString(), item.Value.ToString());
312
+                }
313
+            }
314
+
315
+            try
316
+            {
317
+                response = request.GetResponse();
318
+
319
+                if (response != null)
320
+                {
321
+                    StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
322
+                    responseStr = reader.ReadToEnd();
323
+                    reader.Close();
324
+                }
325
+            }
326
+            catch (Exception)
327
+            {
328
+                throw;
329
+            }
330
+            return responseStr;
331
+        }
332
+        public static string HttpGet(string url, Encoding encodeing, Hashtable headht = null)
333
+        {
334
+            HttpWebRequest request;
335
+
336
+            //如果是发送HTTPS请求  
337
+            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
338
+            {
339
+                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
340
+                request = WebRequest.Create(url) as HttpWebRequest;
341
+                request.ProtocolVersion = HttpVersion.Version10;
342
+            }
343
+            else
344
+            {
345
+                request = WebRequest.Create(url) as HttpWebRequest;
346
+            }
347
+            request.Method = "GET";
348
+            //request.ContentType = "application/x-www-form-urlencoded";
349
+            request.Accept = "*/*";
350
+            request.Timeout = 15000;
351
+            request.AllowAutoRedirect = false;
352
+            WebResponse response = null;
353
+            string responseStr = null;
354
+            if (headht != null)
355
+            {
356
+                foreach (DictionaryEntry item in headht)
357
+                {
358
+                    request.Headers.Add(item.Key.ToString(), item.Value.ToString());
359
+                }
360
+            }
361
+
362
+            try
363
+            {
364
+                response = request.GetResponse();
365
+
366
+                if (response != null)
367
+                {
368
+                    StreamReader reader = new StreamReader(response.GetResponseStream(), encodeing);
369
+                    responseStr = reader.ReadToEnd();
370
+                    reader.Close();
371
+                }
372
+            }
373
+            catch (Exception)
374
+            {
375
+                throw;
376
+            }
377
+            return responseStr;
378
+        }
379
+        #endregion
380
+
381
+        #region Post With Pic
382
+        private string HttpPost(string url, IDictionary<object, object> param, string filePath)
383
+        {
384
+            string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
385
+            byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
386
+
387
+            HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
388
+            wr.ContentType = "multipart/form-data; boundary=" + boundary;
389
+            wr.Method = "POST";
390
+            wr.KeepAlive = true;
391
+            wr.Credentials = System.Net.CredentialCache.DefaultCredentials;
392
+
393
+            Stream rs = wr.GetRequestStream();
394
+            string responseStr = null;
395
+
396
+            string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";
397
+            foreach (string key in param.Keys)
398
+            {
399
+                rs.Write(boundarybytes, 0, boundarybytes.Length);
400
+                string formitem = string.Format(formdataTemplate, key, param[key]);
401
+                byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem);
402
+                rs.Write(formitembytes, 0, formitembytes.Length);
403
+            }
404
+            rs.Write(boundarybytes, 0, boundarybytes.Length);
405
+
406
+            string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n";
407
+            string header = string.Format(headerTemplate, "pic", filePath, "text/plain");
408
+            byte[] headerbytes = System.Text.Encoding.UTF8.GetBytes(header);
409
+            rs.Write(headerbytes, 0, headerbytes.Length);
410
+
411
+            FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
412
+            byte[] buffer = new byte[4096];
413
+            int bytesRead = 0;
414
+            while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)
415
+            {
416
+                rs.Write(buffer, 0, bytesRead);
417
+            }
418
+            fileStream.Close();
419
+
420
+            byte[] trailer = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n");
421
+            rs.Write(trailer, 0, trailer.Length);
422
+            rs.Close();
423
+
424
+            WebResponse wresp = null;
425
+            try
426
+            {
427
+                wresp = wr.GetResponse();
428
+                Stream stream2 = wresp.GetResponseStream();
429
+                StreamReader reader2 = new StreamReader(stream2);
430
+                responseStr = reader2.ReadToEnd();
431
+                //logger.Debug(string.Format("File uploaded, server response is: {0}", responseStr));
432
+            }
433
+            catch (Exception ex)
434
+            {
435
+                //logger.Error("Error uploading file", ex);
436
+                if (wresp != null)
437
+                {
438
+                    wresp.Close();
439
+                    wresp = null;
440
+                }
441
+                throw;
442
+            }
443
+            return responseStr;
444
+        }
445
+        #endregion
446
+
447
+        #region Post With Pic
448
+        /// <summary>
449
+        /// HTTP POST方式请求数据(带图片)
450
+        /// </summary>
451
+        /// <param name="url">URL</param>        
452
+        /// <param name="param">POST的数据</param>
453
+        /// <param name="fileByte">图片</param>
454
+        /// <returns></returns>
455
+        public static string HttpPost(string url, IDictionary<object, object> param, byte[] fileByte)
456
+        {
457
+            string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
458
+            byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
459
+
460
+            HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
461
+            wr.ContentType = "multipart/form-data; boundary=" + boundary;
462
+            wr.Method = "POST";
463
+            wr.KeepAlive = true;
464
+            wr.Credentials = System.Net.CredentialCache.DefaultCredentials;
465
+
466
+            Stream rs = wr.GetRequestStream();
467
+            string responseStr = null;
468
+
469
+            string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";
470
+            foreach (string key in param.Keys)
471
+            {
472
+                rs.Write(boundarybytes, 0, boundarybytes.Length);
473
+                string formitem = string.Format(formdataTemplate, key, param[key]);
474
+                byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem);
475
+                rs.Write(formitembytes, 0, formitembytes.Length);
476
+            }
477
+            rs.Write(boundarybytes, 0, boundarybytes.Length);
478
+
479
+            string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n";
480
+            string header = string.Format(headerTemplate, "pic", fileByte, "text/plain");//image/jpeg
481
+            byte[] headerbytes = System.Text.Encoding.UTF8.GetBytes(header);
482
+            rs.Write(headerbytes, 0, headerbytes.Length);
483
+
484
+            rs.Write(fileByte, 0, fileByte.Length);
485
+
486
+            byte[] trailer = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n");
487
+            rs.Write(trailer, 0, trailer.Length);
488
+            rs.Close();
489
+
490
+            WebResponse wresp = null;
491
+            try
492
+            {
493
+                wresp = wr.GetResponse();
494
+                Stream stream2 = wresp.GetResponseStream();
495
+                StreamReader reader2 = new StreamReader(stream2);
496
+                responseStr = reader2.ReadToEnd();
497
+                // logger.Error(string.Format("File uploaded, server response is: {0}", responseStr));
498
+            }
499
+            catch (Exception ex)
500
+            {
501
+                //logger.Error("Error uploading file", ex);
502
+                if (wresp != null)
503
+                {
504
+                    wresp.Close();
505
+                    wresp = null;
506
+                }
507
+                throw;
508
+            }
509
+            return responseStr;
510
+        }
511
+        #endregion
512
+
513
+        #region HttpsClient
514
+        /// <summary>
515
+        /// 创建HttpClient
516
+        /// </summary>
517
+        /// <returns></returns>
518
+        public static HttpClient CreateHttpClient(string url)
519
+        {
520
+            HttpClient httpclient;
521
+            //如果是发送HTTPS请求  
522
+            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
523
+            {
524
+                ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
525
+                httpclient = new HttpClient();
526
+            }
527
+            else
528
+            {
529
+                httpclient = new HttpClient();
530
+            }
531
+            return httpclient;
532
+        }
533
+        #endregion
534
+
535
+        #region Post Json
536
+        /// <summary>
537
+        /// HTTP POST方式请求数据
538
+        /// </summary>
539
+        /// <param name="url">URL.</param>
540
+        /// <param name="param">POST的数据</param>
541
+        /// <returns></returns>
542
+        public static string HttpPostByJson(string url, object param = null)
543
+        {
544
+            HttpWebRequest request;
545
+
546
+            //如果是发送HTTPS请求  
547
+            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
548
+            {
549
+                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
550
+                request = WebRequest.Create(url) as HttpWebRequest;
551
+                request.ProtocolVersion = HttpVersion.Version10;
552
+            }
553
+            else
554
+            {
555
+                request = WebRequest.Create(url) as HttpWebRequest;
556
+            }
557
+
558
+            request.Method = "POST";
559
+            request.ContentType = "application/json";
560
+            request.Accept = "*/*";
561
+            request.Timeout = 15000;
562
+            request.AllowAutoRedirect = false;
563
+
564
+
565
+
566
+            StreamWriter requestStream = null;
567
+            WebResponse response = null;
568
+            string responseStr = null;
569
+
570
+            try
571
+            {
572
+                requestStream = new StreamWriter(request.GetRequestStream());
573
+                requestStream.Write(param);
574
+                requestStream.Close();
575
+
576
+                response = request.GetResponse();
577
+                if (response != null)
578
+                {
579
+                    StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
580
+                    responseStr = reader.ReadToEnd();
581
+                    reader.Close();
582
+                }
583
+            }
584
+            catch (Exception ex)
585
+            {
586
+                throw;
587
+            }
588
+            finally
589
+            {
590
+                request = null;
591
+                requestStream = null;
592
+                response = null;
593
+            }
594
+
595
+            return responseStr;
596
+        }
597
+        #endregion
598
+    }
599
+}

+ 211 - 75
RMYY_CallCenter_Api/Controllers/HospitalUserController.cs

@@ -22,70 +22,7 @@ namespace RMYY_CallCenter_Api.Controllers
22 22
         private string ip = "";
23 23
         private string port = "";
24 24
         private string master = "";
25
-        #region http
26
-        /// <summary>
27
-        /// HTTP POST方式请求数据
28
-        /// </summary>
29
-        /// <param name="url">URL.</param>
30
-        /// <param name="param">POST的数据</param>
31
-        /// <returns></returns>
32
-        public static string HttpPost(string url, string param = null, string contentType = "application/json;charset=utf-8"
33
-            )
34
-        {
35
-            HttpWebRequest request;
36
-
37
-            //如果是发送HTTPS请求  
38
-            if (url.StartsWith("https", StringComparison.OrdinalIgnoreCase))
39
-            {
40
-                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
41
-                request = WebRequest.Create(url) as HttpWebRequest;
42
-                request.ProtocolVersion = HttpVersion.Version10;
43
-            }
44
-            else
45
-            {
46
-                request = WebRequest.Create(url) as HttpWebRequest;
47
-            }
48
-            request.Method = "POST";
49
-            request.ContentType = contentType;
50
-            request.Accept = "*/*";
51
-            request.Timeout = 15000;
52
-            request.AllowAutoRedirect = false;
53
-
54
-            StreamWriter requestStream = null;
55
-            WebResponse response = null;
56
-            string responseStr = null;
57
-
58
-            try
59
-            {
60
-                requestStream = new StreamWriter(request.GetRequestStream());
61
-                requestStream.Write(param);
62
-                requestStream.Close();
63
-
64
-                response = request.GetResponse();
65
-                if (response != null)
66
-                {
67
-                    StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
68
-                    responseStr = reader.ReadToEnd();
69
-                    reader.Close();
70
-                }
71
-            }
72
-            catch (Exception ex)
73
-            {
74
-            }
75
-            finally
76
-            {
77
-                request = null;
78
-                requestStream = null;
79
-                response = null;
80
-            }
81
-
82
-            return responseStr;
83
-        }
84
-        private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
85
-        {
86
-            return true; //总是接受  
87
-        }
88
-        #endregion
25
+       
89 26
         #region 术语查询接口
90 27
         public class Term
91 28
         {
@@ -97,7 +34,7 @@ namespace RMYY_CallCenter_Api.Controllers
97 34
         }
98 35
         public ActionResult TermQuery()
99 36
         {
100
-            var responseString = HttpPost ($"http://{ip}:{port}/mdm/domain",null );
37
+            var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/mdm/domain",null );
101 38
             List <Term> jo = JsonConvert.DeserializeObject<List<Term>>(responseString);
102 39
             return Success("获取成功", jo);
103 40
         }
@@ -115,7 +52,7 @@ namespace RMYY_CallCenter_Api.Controllers
115 52
         }
116 53
         public ActionResult TermrangeQuery()
117 54
         {
118
-            var responseString = HttpPost($"http://{ip}:{port}/mdm/domain", null);
55
+            var responseString =HttpMethods . HttpPost($"http://{ip}:{port}/mdm/domain", null);
119 56
             List<Termrange> jo = JsonConvert.DeserializeObject<List<Termrange>>(responseString);
120 57
             return Success("获取成功", jo);
121 58
         }
@@ -139,7 +76,7 @@ namespace RMYY_CallCenter_Api.Controllers
139 76
         {
140 77
             Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
141 78
             keyValuePairs.Add("pubDictHospital", "pubDictHospital");
142
-            var responseString = HttpPost($"http://{ip}:{port}/{master}/webApi/pubDictHospital", keyValuePairs.ToJson());
79
+            var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/pubDictHospital", keyValuePairs.ToJson());
143 80
             List<pubDictHospital> jo = JsonConvert.DeserializeObject<List<pubDictHospital>>(responseString);
144 81
             return jo;
145 82
         }
@@ -165,7 +102,7 @@ namespace RMYY_CallCenter_Api.Controllers
165 102
         {
166 103
             Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
167 104
             keyValuePairs.Add("DictHospitals", "DictHospitals");
168
-            var responseString = HttpPost($"http://{ip}:{port}/{master}/webApi/DictHospitals", keyValuePairs.ToJson());
105
+            var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictHospitals", keyValuePairs.ToJson());
169 106
             List<DictHospitals> jo = JsonConvert.DeserializeObject<List<DictHospitals>>(responseString);
170 107
             var Hospitals = jo.Where  (x => x.cHosCode == cHosCode && x.useFlag == 1);
171 108
             var list = new T_Wowo_repairyqbll().GetListall();
@@ -193,6 +130,59 @@ namespace RMYY_CallCenter_Api.Controllers
193 130
             
194 131
             return Hospitals;
195 132
         }
133
+
134
+        #endregion
135
+
136
+        #region 获取药品
137
+        /// <summary>
138
+        /// 院区
139
+        /// </summary>
140
+        public class DictDrug
141
+        {
142
+            public int id { set; get; }//主键id
143
+            public string cDgDispCode { set; get; }//药品编码
144
+            public string cDgName { set; get; }//通用名
145
+            public string cDgNameCode { set; get; }//拼音码
146
+            public string cDgGeneralName { set; get; }//商品名
147
+            public string cDgSpecification { set; get; }//规格
148
+            public decimal iDgMaxstock { set; get; }//最高库存
149
+            public decimal iDgMinstock { set; get; }//最低库存
150
+            public string cDgDescription { set; get; }//药品说明
151
+            public decimal iDgStdPrice { set; get; }//国家限价
152
+            public decimal iDgLocalStdPrice { set; get; }//地区限价
153
+
154
+        }
155
+        public IEnumerable<DictDrug> DictDrugs()
156
+        {
157
+            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
158
+            keyValuePairs.Add("DictDrug", "DictDrug");
159
+            var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictDrug", keyValuePairs.ToJson());
160
+            List<DictDrug> jo = JsonConvert.DeserializeObject<List<DictDrug>>(responseString);
161
+            if (jo != null && jo.Count() > 0)
162
+            {
163
+                foreach (var it in jo)
164
+                {
165
+                    Model.T_Sys_DictDrug dictDrug = new T_Sys_DictDrug();
166
+                    dictDrug.F_DictDrugid  = it.id ;
167
+                    dictDrug.cDgDispCode = it.cDgDispCode;
168
+                    dictDrug.cDgName = it.cDgName;
169
+                    dictDrug.cDgNameCode = it.cDgNameCode;
170
+                    dictDrug.cDgGeneralName = it.cDgGeneralName;
171
+                    dictDrug.cDgSpecification = it.cDgSpecification;
172
+                    dictDrug.iDgMaxstock = it.iDgMaxstock;
173
+                    dictDrug.iDgMinstock = it.iDgMinstock;
174
+                    dictDrug.cDgDescription = it.cDgDescription;
175
+                    dictDrug.iDgStdPrice = it.iDgStdPrice;
176
+                    dictDrug.iDgLocalStdPrice = it.iDgLocalStdPrice;
177
+                    dictDrug.F_IsDelete = 0;
178
+                    dictDrug.F_CreateTime = DateTime.Now;
179
+                    new BLL.T_Sys_DictDrug().Add(dictDrug);
180
+                }
181
+            }
182
+
183
+            return jo;
184
+        }
185
+
196 186
         #endregion
197 187
         #region 获取科室
198 188
         /// <summary>
@@ -212,7 +202,7 @@ namespace RMYY_CallCenter_Api.Controllers
212 202
         {
213 203
             Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
214 204
             keyValuePairs.Add("DictDept", "DictDept");
215
-            var responseString = HttpPost($"http://{ip}:{port}/{master}/webApi/DictDept", keyValuePairs.ToJson());
205
+            var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictDept", keyValuePairs.ToJson());
216 206
             List<DictDept> jo = JsonConvert.DeserializeObject<List<DictDept>>(responseString);
217 207
             var Dept = jo.Where(x => x.nohospital == nohospital && x.useFlag == 1);
218 208
             var list = new Bll.T_Sys_Department().GetModelList("F_State=1");
@@ -309,15 +299,15 @@ namespace RMYY_CallCenter_Api.Controllers
309 299
         {
310 300
             Dictionary<string, string> keyValuePair = new Dictionary<string, string>();
311 301
             keyValuePair.Add("DictSex", "DictSex");
312
-            var responseStrings = HttpPost($"http://{ip}:{port}/{master}/webApi/DictSex", keyValuePair.ToJson());
302
+            var responseStrings = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictSex", keyValuePair.ToJson());
313 303
             List<DictSex> sex = JsonConvert.DeserializeObject<List<DictSex>>(responseStrings);
314 304
             Dictionary<string, string> keyValuePairszhiwu = new Dictionary<string, string>();
315 305
             keyValuePairszhiwu.Add("DictZhiwu", "DictZhiwu");
316
-            var respon = HttpPost($"http://{ip}:{port}/{master}/webApi/DictZhiwu", keyValuePairszhiwu.ToJson());
306
+            var respon = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictZhiwu", keyValuePairszhiwu.ToJson());
317 307
             List<DictZhiwu> zhuwu = JsonConvert.DeserializeObject<List<DictZhiwu>>(respon);
318 308
             Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
319 309
             keyValuePairs.Add("DictStaff", "DictStaff");
320
-            var responseString = HttpPost($"http://{ip}:{port}/{master}/webApi/DictStaff", keyValuePairs.ToJson());
310
+            var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictStaff", keyValuePairs.ToJson());
321 311
             List<DictStaff> jo = JsonConvert.DeserializeObject<List<DictStaff>>(responseString);
322 312
             var user  = jo.Where(x => x.noDept == noDept );
323 313
             var list = new Bll.T_Sys_UserAccount ().GetModelList("F_DeleteFlag=0");
@@ -654,18 +644,18 @@ namespace RMYY_CallCenter_Api.Controllers
654 644
                 DictStaff jo = JsonConvert.DeserializeObject<DictStaff>(RecordInfo);
655 645
                 Dictionary<string, string> keyValuePair = new Dictionary<string, string>();
656 646
                 keyValuePair.Add("DictSex", "DictSex");
657
-                var responseStrings = HttpPost($"http://{ip}:{port}/{master}/webApi/DictSex", keyValuePair.ToJson());
647
+                var responseStrings = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictSex", keyValuePair.ToJson());
658 648
                 List<DictSex> sex = JsonConvert.DeserializeObject<List<DictSex>>(responseStrings);
659 649
                 Dictionary<string, string> keyValuePairszhiwu = new Dictionary<string, string>();
660 650
                 keyValuePairszhiwu.Add("DictZhiwu", "DictZhiwu");
661
-                var respon = HttpPost($"http://{ip}:{port}/{master}/webApi/DictZhiwu", keyValuePairszhiwu.ToJson());
651
+                var respon = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictZhiwu", keyValuePairszhiwu.ToJson());
662 652
                 List<DictZhiwu> zhuwu = JsonConvert.DeserializeObject<List<DictZhiwu>>(respon);
663 653
                
664 654
                 var list = new Bll.T_Sys_UserAccount().GetModelList("F_DeleteFlag=0");
665 655
 
666 656
                 Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
667 657
                 keyValuePairs.Add("DictDept", "DictDept");
668
-                var responseString = HttpPost($"http://{ip}:{port}/{master}/webApi/DictDept", keyValuePairs.ToJson());
658
+                var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictDept", keyValuePairs.ToJson());
669 659
                 List<DictDept> jodept = JsonConvert.DeserializeObject<List<DictDept>>(responseString);
670 660
                 var dept= new Bll.T_Sys_Department().GetModelList("F_State=1 and F_DeptCode="+ jodept.Where (x=>x.noDept  ==
671 661
                 jo .noDept   ) .FirstOrDefault ().deptCode + ")");
@@ -818,6 +808,152 @@ namespace RMYY_CallCenter_Api.Controllers
818 808
                     }
819 809
                 }
820 810
             }
811
+            else if (DictCode == "DictHospitals")
812
+            {
813
+                var list = new BLL . T_Sys_DictDrug().GetModelList  ("F_IsDelete=0");
814
+                DictDrug it = JsonConvert.DeserializeObject<DictDrug>(RecordInfo);
815
+                if (RecordChangeType == "Add")
816
+                {
817
+                    if (list.Where(x => x.F_DictDrugid == it.id ).Count() <= 0)
818
+                    {
819
+                        Model.T_Sys_DictDrug dictDrug = new T_Sys_DictDrug();
820
+                        dictDrug.F_DictDrugid = it.id;
821
+                        dictDrug.cDgDispCode = it.cDgDispCode;
822
+                        dictDrug.cDgName = it.cDgName;
823
+                        dictDrug.cDgNameCode = it.cDgNameCode;
824
+                        dictDrug.cDgGeneralName = it.cDgGeneralName;
825
+                        dictDrug.cDgSpecification = it.cDgSpecification;
826
+                        dictDrug.iDgMaxstock = it.iDgMaxstock;
827
+                        dictDrug.iDgMinstock = it.iDgMinstock;
828
+                        dictDrug.cDgDescription = it.cDgDescription;
829
+                        dictDrug.iDgStdPrice = it.iDgStdPrice;
830
+                        dictDrug.iDgLocalStdPrice = it.iDgLocalStdPrice;
831
+                        dictDrug.F_IsDelete = 0;
832
+                        dictDrug.F_CreateTime = DateTime.Now;
833
+                       int n= new BLL.T_Sys_DictDrug().Add(dictDrug);
834
+                        if (n > 0)
835
+                        {
836
+                            var obj = new
837
+                            {
838
+                                iResult = "1",
839
+                                cResult = "",
840
+                                pk = n
841
+                            };
842
+                            return Content(obj.ToJson());
843
+                        }
844
+                        else
845
+                        {
846
+                            var obj = new
847
+                            {
848
+                                iResult = "0",
849
+                                cResult = "添加失败",
850
+                                pk = ""
851
+                            };
852
+                            return Content(obj.ToJson());
853
+                        }
854
+                    }
855
+                    else
856
+                    {
857
+                        var obj = new
858
+                        {
859
+                            iResult = "0",
860
+                            cResult = "该药品已存在",
861
+                            pk = ""
862
+                        };
863
+                        return Content(obj.ToJson());
864
+                    }
865
+                }
866
+                else if (RecordChangeType == "Modify")
867
+                {
868
+                    var model = list.Where(x => x.F_DictDrugid == it .id );
869
+                    if (model != null && model.Count() >= 0)
870
+                    {
871
+                        var dictDrug = model.FirstOrDefault();
872
+                        dictDrug.F_DictDrugid = it.id;
873
+                        dictDrug.cDgDispCode = it.cDgDispCode;
874
+                        dictDrug.cDgName = it.cDgName;
875
+                        dictDrug.cDgNameCode = it.cDgNameCode;
876
+                        dictDrug.cDgGeneralName = it.cDgGeneralName;
877
+                        dictDrug.cDgSpecification = it.cDgSpecification;
878
+                        dictDrug.iDgMaxstock = it.iDgMaxstock;
879
+                        dictDrug.iDgMinstock = it.iDgMinstock;
880
+                        dictDrug.cDgDescription = it.cDgDescription;
881
+                        dictDrug.iDgStdPrice = it.iDgStdPrice;
882
+                        dictDrug.iDgLocalStdPrice = it.iDgLocalStdPrice;
883
+                        bool n = new BLL.T_Sys_DictDrug().Update(dictDrug);
884
+                        if (n)
885
+                        {
886
+                            var obj = new
887
+                            {
888
+                                iResult = "1",
889
+                                cResult = "",
890
+                                pk = n
891
+                            };
892
+                            return Content(obj.ToJson());
893
+                        }
894
+                        else
895
+                        {
896
+                            var obj = new
897
+                            {
898
+                                iResult = "0",
899
+                                cResult = "修改失败",
900
+                                pk = ""
901
+                            };
902
+                            return Content(obj.ToJson());
903
+                        }
904
+                    }
905
+                    else
906
+                    {
907
+                        var obj = new
908
+                        {
909
+                            iResult = "0",
910
+                            cResult = "该药品不存在",
911
+                            pk = ""
912
+                        };
913
+                        return Content(obj.ToJson());
914
+                    }
915
+                }
916
+                else if (RecordChangeType == "Delete")
917
+                {
918
+                    var model = list.Where(x => x.F_DictDrugid == it.id);
919
+                    if (model != null && model.Count() >= 0)
920
+                    {
921
+                        var dictDrug = model.FirstOrDefault();
922
+                        dictDrug.F_IsDelete  = 1;
923
+                        bool n = new BLL.T_Sys_DictDrug().Update(dictDrug);
924
+                        if (n)
925
+                        {
926
+                            var obj = new
927
+                            {
928
+                                iResult = "1",
929
+                                cResult = "",
930
+                                pk = n
931
+                            };
932
+                            return Content(obj.ToJson());
933
+                        }
934
+                        else
935
+                        {
936
+                            var obj = new
937
+                            {
938
+                                iResult = "0",
939
+                                cResult = "删除失败",
940
+                                pk = ""
941
+                            };
942
+                            return Content(obj.ToJson());
943
+                        }
944
+                    }
945
+                    else
946
+                    {
947
+                        var obj = new
948
+                        {
949
+                            iResult = "0",
950
+                            cResult = "该药品不存在",
951
+                            pk = ""
952
+                        };
953
+                        return Content(obj.ToJson());
954
+                    }
955
+                }
956
+            }
821 957
             var obj1 = new
822 958
             {
823 959
                 iResult = "0",

+ 55 - 0
RMYY_CallCenter_Api/Controllers/PatientController.cs

@@ -0,0 +1,55 @@
1
+using Newtonsoft.Json;
2
+using RMYY_CallCenter_Api.Utility;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Linq;
6
+using System.Web;
7
+using System.Web.Mvc;
8
+
9
+namespace RMYY_CallCenter_Api.Controllers
10
+{
11
+    public class PatientController : BaseController
12
+    {
13
+       private static  string ip = "", port = "";
14
+        private static string url = $"http://{ip}:{port}/winempi/webapi/";
15
+         public class Patient
16
+        {
17
+            public string zsyh { set; get; }//主索引号
18
+            public string hzxm { set; get; }//患者姓名
19
+            public string csrq { set; get; }//出生日期
20
+            public string xbdm { set; get; }//性别代码
21
+            public string xbmc { set; get; }//性别名称
22
+            public string hydm { set; get; }//婚姻代码
23
+            public string hymc { set; get; }//婚姻名称
24
+            public string zjhm { set; get; }//身份证号码
25
+            public string zjlx { set; get; }//身份证类型
26
+            public string lxdh { set; get; }//联系电话
27
+            public string mz { set; get; }//民族
28
+            public string gj { set; get; }//国籍
29
+            public string jtdz { set; get; }//家庭地址
30
+            public string cResult { set; get; }//返回结果描述
31
+            public string ncount { set; get; }//符合查询的数量
32
+        }
33
+
34
+
35
+        public ActionResult GetModelList(string zsyh,string hzxm,string sfzh,string zlkh,string jzlx,string jzh,string lxdh)
36
+        {
37
+            Dictionary<string, string> values = new Dictionary<string, string>();
38
+            values.Add("zsyh", zsyh);//主索引号
39
+            values.Add("hzxm", hzxm);//患者姓名
40
+            values.Add("sfzh", sfzh);//身份证号
41
+            values.Add("zlkh", zlkh);//诊疗卡号
42
+            values.Add("jzlx", jzlx);//就诊类型
43
+            values.Add("jzh", jzlx);//就诊号
44
+            values.Add("lxdh", lxdh);//联系电话
45
+            var responseString = HttpMethods.HttpPost(url + "QueryPatient", values.ToJson(), "application/json;charset=UTF-8");
46
+            List<Patient> jo =JsonConvert.DeserializeObject<List <Patient>>(responseString);
47
+            var obj = new
48
+            {
49
+                rows = jo
50
+            };
51
+            return Content(obj.ToJson());
52
+
53
+        }
54
+    }
55
+}

+ 2 - 0
RMYY_CallCenter_Api/RMYY_CallCenter_Api.csproj

@@ -160,6 +160,7 @@
160 160
     <Compile Include="Controllers\HospitalUserController.cs" />
161 161
     <Compile Include="Controllers\information\NoticeController.cs" />
162 162
     <Compile Include="Controllers\InternalMessagesController.cs" />
163
+    <Compile Include="Controllers\PatientController.cs" />
163 164
     <Compile Include="Controllers\PushMessageController.cs" />
164 165
     <Compile Include="Controllers\Quality\DaysTalkTimeController.cs" />
165 166
     <Compile Include="Controllers\Quality\IndexBaseController.cs" />
@@ -251,6 +252,7 @@
251 252
     <Folder Include="Views\CustomFiled\" />
252 253
     <Folder Include="Views\HospitalUser\" />
253 254
     <Folder Include="Views\InternalMessages\" />
255
+    <Folder Include="Views\Patient\" />
254 256
     <Folder Include="Views\PushMessage\" />
255 257
     <Folder Include="Views\SMS\" />
256 258
     <Folder Include="Views\WorkOrderBase\" />