|
|
@@ -20,10 +20,10 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
20
|
20
|
|
|
21
|
21
|
public class HospitalUserController : BaseController
|
|
22
|
22
|
{
|
|
23
|
|
- private string ip = "";
|
|
24
|
|
- private string port = "";
|
|
25
|
|
- private string master = "";
|
|
26
|
|
-
|
|
|
23
|
+ private string ip = ConfigHelper.GetValue ("HospitalUserip");
|
|
|
24
|
+ private string port = ConfigHelper.GetValue("HospitalUserport");
|
|
|
25
|
+ private string master = ConfigHelper.GetValue("HospitalUsermaster");
|
|
|
26
|
+
|
|
27
|
27
|
#region 术语查询接口
|
|
28
|
28
|
public class Term
|
|
29
|
29
|
{
|
|
|
@@ -36,7 +36,9 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
36
|
36
|
public ActionResult TermQuery()
|
|
37
|
37
|
{
|
|
38
|
38
|
var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/mdm/domain",null );
|
|
|
39
|
+ LogHelper.Warn("TermQuery-responseString:" + responseString);
|
|
39
|
40
|
List <Term> jo = JsonConvert.DeserializeObject<List<Term>>(responseString);
|
|
|
41
|
+ LogHelper.Warn("TermQuery-jo:" + jo.ToJson ());
|
|
40
|
42
|
return Success("获取成功", jo);
|
|
41
|
43
|
}
|
|
42
|
44
|
#endregion
|
|
|
@@ -54,7 +56,9 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
54
|
56
|
public ActionResult TermrangeQuery()
|
|
55
|
57
|
{
|
|
56
|
58
|
var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/mdm/domain", null);
|
|
|
59
|
+ LogHelper.Warn("TermrangeQuery-responseString:" + responseString);
|
|
57
|
60
|
List<Termrange> jo = JsonConvert.DeserializeObject<List<Termrange>>(responseString);
|
|
|
61
|
+ LogHelper.Warn("TermrangeQuery-jo:" + jo.ToJson ());
|
|
58
|
62
|
return Success("获取成功", jo);
|
|
59
|
63
|
}
|
|
60
|
64
|
#endregion
|
|
|
@@ -72,14 +76,27 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
72
|
76
|
public string cHosLisCode { set; get; }//检验条码专用机构编码
|
|
73
|
77
|
public int useFlag { set; get; }//启用停用
|
|
74
|
78
|
}
|
|
75
|
|
-
|
|
76
|
|
- public List <pubDictHospital> MechanismHospitals()
|
|
|
79
|
+
|
|
|
80
|
+ public ActionResult MechanismHospitals()
|
|
77
|
81
|
{
|
|
78
|
82
|
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
|
79
|
83
|
keyValuePairs.Add("pubDictHospital", "pubDictHospital");
|
|
80
|
84
|
var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/pubDictHospital", keyValuePairs.ToJson());
|
|
|
85
|
+ LogHelper.Warn("MechanismHospitals-responseString:" + responseString);
|
|
81
|
86
|
List<pubDictHospital> jo = JsonConvert.DeserializeObject<List<pubDictHospital>>(responseString);
|
|
82
|
|
- return jo;
|
|
|
87
|
+ LogHelper.Warn("MechanismHospitals-jo:" + jo.ToJson ());
|
|
|
88
|
+ try
|
|
|
89
|
+ {
|
|
|
90
|
+ foreach (var it in jo)
|
|
|
91
|
+ {
|
|
|
92
|
+ YardHospitals(it.cHelpCode);
|
|
|
93
|
+ }
|
|
|
94
|
+ }
|
|
|
95
|
+ catch(Exception e)
|
|
|
96
|
+ {
|
|
|
97
|
+ LogHelper.Error(e.Message);
|
|
|
98
|
+ }
|
|
|
99
|
+ return Success ("");
|
|
83
|
100
|
}
|
|
84
|
101
|
#endregion
|
|
85
|
102
|
#region 获取院区
|
|
|
@@ -104,7 +121,9 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
104
|
121
|
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
|
105
|
122
|
keyValuePairs.Add("DictHospitals", "DictHospitals");
|
|
106
|
123
|
var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictHospitals", keyValuePairs.ToJson());
|
|
|
124
|
+ LogHelper.Warn("YardHospitals-responseString:" + responseString);
|
|
107
|
125
|
List<DictHospitals> jo = JsonConvert.DeserializeObject<List<DictHospitals>>(responseString);
|
|
|
126
|
+ LogHelper.Warn("YardHospitals-jo:" + jo.ToJson ());
|
|
108
|
127
|
var Hospitals = jo.Where (x => x.cHosCode == cHosCode && x.useFlag == 1);
|
|
109
|
128
|
var list = new T_Wowo_repairyqbll().GetListall();
|
|
110
|
129
|
if (Hospitals!=null && Hospitals.Count ()>0)
|
|
|
@@ -128,7 +147,17 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
128
|
147
|
}
|
|
129
|
148
|
}
|
|
130
|
149
|
}
|
|
131
|
|
-
|
|
|
150
|
+ try
|
|
|
151
|
+ {
|
|
|
152
|
+ foreach (var it in Hospitals)
|
|
|
153
|
+ {
|
|
|
154
|
+ Department(it.noHospital, it .HosSectionName);
|
|
|
155
|
+ }
|
|
|
156
|
+ }
|
|
|
157
|
+ catch (Exception e)
|
|
|
158
|
+ {
|
|
|
159
|
+ LogHelper.Error(e.Message);
|
|
|
160
|
+ }
|
|
132
|
161
|
return Hospitals;
|
|
133
|
162
|
}
|
|
134
|
163
|
|
|
|
@@ -153,12 +182,14 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
153
|
182
|
public decimal iDgLocalStdPrice { set; get; }//地区限价
|
|
154
|
183
|
|
|
155
|
184
|
}
|
|
156
|
|
- public IEnumerable<DictDrug> DictDrugs()
|
|
|
185
|
+ public ActionResult DictDrugs()
|
|
157
|
186
|
{
|
|
158
|
187
|
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
|
159
|
188
|
keyValuePairs.Add("DictDrug", "DictDrug");
|
|
160
|
189
|
var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictDrug", keyValuePairs.ToJson());
|
|
|
190
|
+ LogHelper.Warn("DictDrugs-responseString:" + responseString);
|
|
161
|
191
|
List<DictDrug> jo = JsonConvert.DeserializeObject<List<DictDrug>>(responseString);
|
|
|
192
|
+ LogHelper.Warn("DictDrugs-jo:" + jo.ToJson ());
|
|
162
|
193
|
if (jo != null && jo.Count() > 0)
|
|
163
|
194
|
{
|
|
164
|
195
|
foreach (var it in jo)
|
|
|
@@ -181,7 +212,7 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
181
|
212
|
}
|
|
182
|
213
|
}
|
|
183
|
214
|
|
|
184
|
|
- return jo;
|
|
|
215
|
+ return Success ("");
|
|
185
|
216
|
}
|
|
186
|
217
|
|
|
187
|
218
|
#endregion
|
|
|
@@ -204,7 +235,9 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
204
|
235
|
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
|
205
|
236
|
keyValuePairs.Add("DictDept", "DictDept");
|
|
206
|
237
|
var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictDept", keyValuePairs.ToJson());
|
|
|
238
|
+ LogHelper.Warn("Department-responseString:" + responseString);
|
|
207
|
239
|
List<DictDept> jo = JsonConvert.DeserializeObject<List<DictDept>>(responseString);
|
|
|
240
|
+ LogHelper.Warn("Department-jo:" + jo.ToJson ());
|
|
208
|
241
|
var Dept = jo.Where(x => x.nohospital == nohospital && x.useFlag == 1);
|
|
209
|
242
|
var list = new Bll.T_Sys_Department().GetModelList("F_State=1");
|
|
210
|
243
|
var Wowo = new T_Wowo_repairyqbll().GetListall();
|
|
|
@@ -219,33 +252,52 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
219
|
252
|
{
|
|
220
|
253
|
if (it.useFlag != 1)
|
|
221
|
254
|
continue;
|
|
222
|
|
- if (list.Where(x => x.F_DeptName == it.deptname).Count() > 0)
|
|
223
|
|
- continue;
|
|
224
|
255
|
Model.T_Sys_Department dModel = new Model.T_Sys_Department();
|
|
225
|
|
- if (!string .IsNullOrEmpty (it .deptParentCode))
|
|
|
256
|
+ if (list.Where(x => x.F_DeptName == it.deptname).Count() > 0)
|
|
|
257
|
+ {
|
|
|
258
|
+ dModel = list.Where(x => x.F_DeptName == it.deptname).First();
|
|
|
259
|
+ }
|
|
|
260
|
+ else
|
|
|
261
|
+ {
|
|
|
262
|
+
|
|
|
263
|
+ if (!string.IsNullOrEmpty(it.deptParentCode))
|
|
|
264
|
+ {
|
|
|
265
|
+ var deptParent = list.Where(x => x.F_DeptCode == it.deptParentCode);
|
|
|
266
|
+ if (deptParent != null && deptParent.Count() > 0)
|
|
|
267
|
+ dModel.F_ParentId = deptParent.FirstOrDefault().F_DeptId;
|
|
|
268
|
+ }
|
|
|
269
|
+ dModel.F_Sort = 0;
|
|
|
270
|
+ dModel.F_DeptCode = it.deptCode;
|
|
|
271
|
+ dModel.F_DeptName = it.deptname;
|
|
|
272
|
+ dModel.F_State = 1;
|
|
|
273
|
+ dModel.F_CreateTime = DateTime.Now;
|
|
|
274
|
+ dModel.F_CreateUser = User.F_UserCode;
|
|
|
275
|
+ dModel.T_Woid = model.First().T_Woid;
|
|
|
276
|
+ dModel.F_Location = "";
|
|
|
277
|
+ dModel.F_FloorDistribution = "";
|
|
|
278
|
+ dModel.F_OfficeTelephone = "";
|
|
|
279
|
+ int n = new Bll.T_Sys_Department().Add(dModel);
|
|
|
280
|
+ dModel.F_DeptId = n;
|
|
|
281
|
+ }
|
|
|
282
|
+
|
|
|
283
|
+ try
|
|
|
284
|
+ {
|
|
|
285
|
+ foreach (var v in Dept)
|
|
|
286
|
+ {
|
|
|
287
|
+ Staff(v.noDept, dModel.F_DeptId);
|
|
|
288
|
+ }
|
|
|
289
|
+ }
|
|
|
290
|
+ catch (Exception e)
|
|
226
|
291
|
{
|
|
227
|
|
- var deptParent = list.Where(x => x.F_DeptCode == it.deptParentCode);
|
|
228
|
|
- if (deptParent!=null && deptParent.Count ()>0)
|
|
229
|
|
- dModel.F_ParentId = deptParent.FirstOrDefault ().F_DeptId ;
|
|
|
292
|
+ LogHelper.Error(e.Message);
|
|
230
|
293
|
}
|
|
231
|
|
- dModel.F_Sort = 0;
|
|
232
|
|
- dModel.F_DeptCode = it.deptCode;
|
|
233
|
|
- dModel.F_DeptName = it.deptname;
|
|
234
|
|
- dModel.F_State = 1;
|
|
235
|
|
- dModel.F_CreateTime = DateTime.Now;
|
|
236
|
|
- dModel.F_CreateUser = User.F_UserCode;
|
|
237
|
|
- dModel.T_Woid = model.First().T_Woid;
|
|
238
|
|
- dModel.F_Location = "";
|
|
239
|
|
- dModel.F_FloorDistribution = "";
|
|
240
|
|
- dModel.F_OfficeTelephone = "";
|
|
241
|
|
- int n = new Bll.T_Sys_Department().Add(dModel);
|
|
242
|
294
|
}
|
|
243
|
295
|
}
|
|
244
|
296
|
}
|
|
245
|
297
|
}
|
|
246
|
298
|
else
|
|
247
|
299
|
return null;
|
|
248
|
|
-
|
|
|
300
|
+
|
|
249
|
301
|
return Dept;
|
|
250
|
302
|
}
|
|
251
|
303
|
#endregion
|
|
|
@@ -301,15 +353,21 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
301
|
353
|
Dictionary<string, string> keyValuePair = new Dictionary<string, string>();
|
|
302
|
354
|
keyValuePair.Add("DictSex", "DictSex");
|
|
303
|
355
|
var responseStrings = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictSex", keyValuePair.ToJson());
|
|
|
356
|
+ LogHelper.Warn("Staff-responseStrings:" + responseStrings);
|
|
304
|
357
|
List<DictSex> sex = JsonConvert.DeserializeObject<List<DictSex>>(responseStrings);
|
|
|
358
|
+ LogHelper.Warn("Staff-sex:" + sex.ToJson ());
|
|
305
|
359
|
Dictionary<string, string> keyValuePairszhiwu = new Dictionary<string, string>();
|
|
306
|
360
|
keyValuePairszhiwu.Add("DictZhiwu", "DictZhiwu");
|
|
307
|
361
|
var respon = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictZhiwu", keyValuePairszhiwu.ToJson());
|
|
|
362
|
+ LogHelper.Warn("Staff-respon:" + respon);
|
|
308
|
363
|
List<DictZhiwu> zhuwu = JsonConvert.DeserializeObject<List<DictZhiwu>>(respon);
|
|
|
364
|
+ LogHelper.Warn("Staff-zhuwu:" + zhuwu.ToJson ());
|
|
309
|
365
|
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
|
310
|
366
|
keyValuePairs.Add("DictStaff", "DictStaff");
|
|
311
|
367
|
var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictStaff", keyValuePairs.ToJson());
|
|
|
368
|
+ LogHelper.Warn("Staff-responseString:" + responseString);
|
|
312
|
369
|
List<DictStaff> jo = JsonConvert.DeserializeObject<List<DictStaff>>(responseString);
|
|
|
370
|
+ LogHelper.Warn("Staff-jo:" + jo.ToJson ());
|
|
313
|
371
|
var user = jo.Where(x => x.noDept == noDept );
|
|
314
|
372
|
var list = new Bll.T_Sys_UserAccount ().GetModelList("F_DeleteFlag=0");
|
|
315
|
373
|
if (user != null && user.Count() > 0)
|
|
|
@@ -357,10 +415,14 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
357
|
415
|
var postString = reader.ReadToEnd();
|
|
358
|
416
|
JObject paras = null;
|
|
359
|
417
|
paras = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(postString);
|
|
|
418
|
+ LogHelper.Warn("synchronization-paras:" + paras.ToJson ());
|
|
360
|
419
|
var DictInfo = paras["DictInfo"].ToString();
|
|
361
|
420
|
var result = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(DictInfo);
|
|
|
421
|
+ LogHelper.Warn("synchronization-result:" + result.ToJson());
|
|
362
|
422
|
var DictCode = result["DictCode"].ToString();
|
|
|
423
|
+ LogHelper.Warn("synchronization-DictCode:"+DictCode);
|
|
363
|
424
|
var RecordChangeType = result["RecordChangeType"].ToString();
|
|
|
425
|
+ LogHelper.Warn("synchronization-RecordChangeType:" + RecordChangeType);
|
|
364
|
426
|
var RecordInfo= result["RecordInfo"] == null ? "" : result["RecordInfo"].ToString();
|
|
365
|
427
|
if (DictCode== "DictHospitals")
|
|
366
|
428
|
{
|
|
|
@@ -642,22 +704,28 @@ namespace RMYY_CallCenter_Api.Controllers
|
|
642
|
704
|
}
|
|
643
|
705
|
else if (DictCode == "DictStaff")
|
|
644
|
706
|
{
|
|
|
707
|
+ LogHelper.Warn("synchronization-RecordInfo:" + RecordInfo.ToJson ());
|
|
645
|
708
|
DictStaff jo = JsonConvert.DeserializeObject<DictStaff>(RecordInfo);
|
|
646
|
709
|
Dictionary<string, string> keyValuePair = new Dictionary<string, string>();
|
|
647
|
710
|
keyValuePair.Add("DictSex", "DictSex");
|
|
648
|
711
|
var responseStrings = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictSex", keyValuePair.ToJson());
|
|
|
712
|
+ LogHelper.Warn("synchronization-responseStrings:" + responseStrings);
|
|
649
|
713
|
List<DictSex> sex = JsonConvert.DeserializeObject<List<DictSex>>(responseStrings);
|
|
|
714
|
+ LogHelper.Warn("synchronization-sex:" + sex.ToJson ());
|
|
650
|
715
|
Dictionary<string, string> keyValuePairszhiwu = new Dictionary<string, string>();
|
|
651
|
716
|
keyValuePairszhiwu.Add("DictZhiwu", "DictZhiwu");
|
|
652
|
717
|
var respon = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictZhiwu", keyValuePairszhiwu.ToJson());
|
|
|
718
|
+ LogHelper.Warn("synchronization-respon:" + respon);
|
|
653
|
719
|
List<DictZhiwu> zhuwu = JsonConvert.DeserializeObject<List<DictZhiwu>>(respon);
|
|
654
|
|
-
|
|
|
720
|
+ LogHelper.Warn("synchronization-zhuwu:" + zhuwu.ToJson ());
|
|
655
|
721
|
var list = new Bll.T_Sys_UserAccount().GetModelList("F_DeleteFlag=0");
|
|
656
|
722
|
|
|
657
|
723
|
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
|
|
658
|
724
|
keyValuePairs.Add("DictDept", "DictDept");
|
|
659
|
725
|
var responseString = HttpMethods.HttpPost($"http://{ip}:{port}/{master}/webApi/DictDept", keyValuePairs.ToJson());
|
|
|
726
|
+ LogHelper.Warn("synchronization-responseString:" + responseString);
|
|
660
|
727
|
List<DictDept> jodept = JsonConvert.DeserializeObject<List<DictDept>>(responseString);
|
|
|
728
|
+ LogHelper.Warn("synchronization-jodept:" + jodept);
|
|
661
|
729
|
var dept= new Bll.T_Sys_Department().GetModelList("F_State=1 and F_DeptCode="+ jodept.Where (x=>x.noDept ==
|
|
662
|
730
|
jo .noDept ) .FirstOrDefault ().deptCode + ")");
|
|
663
|
731
|
if (RecordChangeType == "Add")
|