ソースを参照

添加获取随访列表接口

mengjie 6 年 前
コミット
20570e4ce2

+ 65 - 44
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/MedicalFollowup/FollowUpController.cs

@@ -1,4 +1,5 @@
1 1
 using CallCenter.Utility;
2
+using CallCenterApi.DB;
2 3
 using System;
3 4
 using System.Collections.Generic;
4 5
 using System.Data;
@@ -20,70 +21,102 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
20 21
         /// 获取随访列表
21 22
         /// </summary>
22 23
         /// <returns></returns>
23
-        /*public ActionResult GetListAll()
24
+        public ActionResult GetListAll()
24 25
         {
25
-            string sql = " and isdel=0 ";
26
+            string sql = " and F_IsDel=0 ";
26 27
             DataTable dt = new DataTable();
27 28
 
28 29
             string dischargedept = HttpUtility.UrlDecode(RequestString.GetQueryString("dischargedept"));//出院科室
29 30
             string strstate = HttpUtility.UrlDecode(RequestString.GetQueryString("state"));//状态
30
-            string strtype = HttpUtility.UrlDecode(RequestString.GetQueryString("type"));//病案号
31
-            string strkey = HttpUtility.UrlDecode(RequestString.GetQueryString("key"));//手术名称
31
+            string strcode = HttpUtility.UrlDecode(RequestString.GetQueryString("code"));//病案号
32
+            string stropename = HttpUtility.UrlDecode(RequestString.GetQueryString("opename"));//手术名称
32 33
             //来电号码
33
-            string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));//联系人电话
34
+            string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("phone"));//联系人电话
34 35
             string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));//姓名
35
-            string strname = HttpUtility.UrlDecode(RequestString.GetQueryString("name"));//管床医生
36
-            //坐席工号
37
-            string strcode = HttpUtility.UrlDecode(RequestString.GetQueryString("code"));//诊断名称
36
+            string strdoctor = HttpUtility.UrlDecode(RequestString.GetQueryString("tubedoctor"));//管床医生
37
+            //诊断名称
38
+            string strzdmc = HttpUtility.UrlDecode(RequestString.GetQueryString("zdmc"));//诊断名称
38 39
             //出院日期
39
-            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
40
-            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
40
+            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));//查询起始时间
41
+            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));//查询截止时间
41 42
             //总费用
42
-            string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
43
-            string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
43
+            string strcosts = HttpUtility.UrlDecode(RequestString.GetQueryString("costs"));
44
+            string strcoste = HttpUtility.UrlDecode(RequestString.GetQueryString("coste"));
44 45
             //随访日期
45 46
             string strtime = HttpUtility.UrlDecode(RequestString.GetQueryString("sftime"));
47
+            //仅包含随访结束的
48
+            string strsfend = HttpUtility.UrlDecode(RequestString.GetQueryString("sfend"));
49
+            //仅二级随访未完成
50
+            string strejwwc = HttpUtility.UrlDecode(RequestString.GetQueryString("secondlevel"));
46 51
 
47 52
             string strpageindex = RequestString.GetQueryString("page");
48 53
             int pageindex = 1;
49 54
             string strpagesize = RequestString.GetQueryString("pagesize");
50 55
             int pagesize = 10;
51 56
 
52
-            if (strorderid.Trim() != "" && strorderid != "undefined")
57
+            if (dischargedept.Trim() != "" && dischargedept != "undefined")
53 58
             {
54
-                sql += " and WorkOrderID like '%" + strorderid.Trim() + "%' ";
59
+                sql += " and F_DischargeDept like '%" + dischargedept.Trim() + "%' ";
55 60
             }
56 61
             if (strstate.Trim() != "" && strstate != "undefined")
57 62
             {
58
-                sql += " and State = '" + strstate.Trim() + "' ";
63
+                sql += " and F_State = '" + strstate.Trim() + "' ";
59 64
             }
60
-            if (strtype.Trim() != "" && strtype != "undefined")
65
+            if (strcode.Trim() != "" && strcode != "undefined")
61 66
             {
62
-                sql += " and Type = '" + strtype.Trim() + "' ";
67
+                sql += " and F_Code = '" + strcode.Trim() + "' ";
63 68
             }
64
-            if (strkey.Trim() != "" && strkey != "undefined")
69
+            if (stropename.Trim() != "" && stropename != "undefined")
65 70
             {
66
-                sql += " and Detail like '%" + strkey.Trim() + "%' ";
71
+                sql += " and F_OpeName like '%" + stropename.Trim() + "%' ";
67 72
             }
68
-            if (strcode.Trim() != "" && strcode != "undefined")
73
+            if (strname.Trim() != "" && strname != "undefined")
69 74
             {
70
-                sql += " and CreateUser = '" + strcode.Trim() + "' ";
75
+                sql += " and F_Name = '" + strname.Trim() + "' ";
71 76
             }
72
-            if (strname.Trim() != "" && strname != "undefined")
77
+            if (strdoctor.Trim() != "" && strdoctor != "undefined")
73 78
             {
74
-                sql += " and Customer like '%" + strname.Trim() + "%' ";
79
+                sql += " and F_TubeDoctor like '%" + strdoctor.Trim() + "%' ";
75 80
             }
76 81
             if (strtel.Trim() != "" && strtel != "undefined")
77 82
             {
78
-                sql += " and CustomerTel like '%" + strtel + "%'  ";
83
+                sql += " and F_Phone like '%" + strtel + "%'  ";
79 84
             }
80 85
             if (strstarttime.Trim() != "" && strstarttime != "undefined")
81 86
             {
82
-                sql += " and datediff(day,CreateTime,'" + strstarttime + "')<=0 ";
87
+                sql += " and datediff(day,F_OutDate,'" + strstarttime + "')<=0 ";
83 88
             }
84 89
             if (strendtime.Trim() != "" && strendtime != "undefined")
85 90
             {
86
-                sql += " and datediff(day,CreateTime,'" + strendtime + "')>=0   ";
91
+                sql += " and datediff(day,F_OutDate,'" + strendtime + "')>=0   ";
92
+            }
93
+
94
+            if (strzdmc.Trim() != "" && strzdmc != "undefined")
95
+            {
96
+                sql += " and F_ZDMC = '" + strzdmc.Trim() + "' ";
97
+            }
98
+
99
+            if (strcosts.Trim() != "" && strcosts != "undefined")
100
+            {
101
+                sql += " and F_TotalCosts >= '" + strzdmc.Trim() + "' ";
102
+            }
103
+            if (strcoste.Trim() != "" && strcoste != "undefined")
104
+            {
105
+                sql += " and F_TotalCosts <= '" + strzdmc.Trim() + "' ";
106
+            }
107
+            if (strtime.Trim() != "" && strtime != "undefined")
108
+            {
109
+                sql += " and datediff(day,F_SFDate,'" + strtime + "')=0 ";
110
+            }
111
+
112
+            if (strsfend.Trim() != "" && strsfend != "undefined")
113
+            {
114
+                sql += " and F_State = 3 ";//随访完成状态
115
+            }
116
+
117
+            if (strejwwc.Trim() != "" && strejwwc != "undefined")
118
+            {
119
+                sql += " and F_State = 2 ";//随访完成状态
87 120
             }
88 121
 
89 122
             if (strpageindex.Trim() != "")
@@ -97,28 +130,16 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
97 130
             }
98 131
             int recordCount = 0;
99 132
             dt = BLL.PagerBLL.GetListPager(
100
-                "T_Wo_WorkOrder",
101
-                "T_Wo_WorkOrder.ID",
102
-                "*,dbo.GetDictionaryName(source) as SourceName,dbo.GetDictionaryName(Type) as TypeName,dbo.GetDictionaryName(TypeClass) as TypeClassName,dbo.GetUserName(CreateUser) as CreateUserName, dbo.GetDeptName(ResponDept) as ResponDeptName,dbo.GetUserName(ResponUser) as ResponUserName,convert(decimal(18,2),DATEDIFF(minute, CreateTime, ISNULL(LastDealTime, GETDATE()))/60.00) as totalhour",
133
+                "T_Med_FollowUp",
134
+                "T_Med_FollowUp.F_Id",
135
+                "*",
103 136
                 sql,
104
-                "ORDER BY T_Wo_WorkOrder.ID desc",
137
+                "ORDER BY T_Med_FollowUp.F_Id desc",
105 138
                 pagesize,
106 139
                 pageindex,
107 140
                 true,
108 141
                 out recordCount);
109
-            dt.Columns.Add("CLDeptName", typeof(String));
110
-            dt.Columns.Add("CLUserName", typeof(String));
111
-            foreach (DataRow dr in dt.Rows)
112
-            {
113
-                string sqlitem = "select top 1 dbo.GetUserName(F_NextUser) as ToUserName, dbo.GetDeptName(F_NextDept) as ToDeptName from T_Wo_WorkOrderItem_New where F_WoID ='" + dr["ID"].ToString() + "' and F_ItemType=" + (int)EnumItemType.deal + " and F_IsUsed = 0 order by F_CreateTime desc";
114
-                var item = DbHelperSQL.Query(sqlitem).Tables[0];
115
-                if (item.Rows.Count > 0)
116
-                {
117
-                    dr["CLUserName"] = item.Rows[0]["ToUserName"].ToString();
118
-                    dr["CLDeptName"] = item.Rows[0]["ToDeptName"].ToString();
119
-                }
120
-            }
121
-
142
+            
122 143
             var obj = new
123 144
             {
124 145
                 state = "success",
@@ -128,6 +149,6 @@ namespace CallCenterApi.Interface.Controllers.MedicalFollowup
128 149
             };
129 150
 
130 151
             return Content(obj.ToJson());
131
-        }*/
152
+        }
132 153
     }
133 154
 }

+ 37 - 1
codegit/CallCenterApi/CallCenterApi.Model/T_Med_FollowUp.cs

@@ -37,7 +37,10 @@ namespace CallCenterApi.Model
37 37
         private string _f_costsnature;
38 38
         private int _f_followupnum;
39 39
         private string _f_addr;
40
-
40
+        private int _f_isdel=0;
41
+        private string _f_zdmc;
42
+        private decimal  _f_totalcosts;
43
+        private DateTime _f_sfdate;
41 44
         /// <summary>
42 45
         /// id
43 46
         /// </summary>
@@ -210,5 +213,38 @@ namespace CallCenterApi.Model
210 213
             set { _f_followupnum = value; }
211 214
             get { return _f_followupnum; }
212 215
         }
216
+        
217
+        /// <summary>
218
+        /// 是否删除
219
+        /// </summary>
220
+        public int F_IsDel
221
+        {
222
+            set { _f_isdel = value; }
223
+            get { return _f_isdel; }
224
+        }
225
+        /// <summary>
226
+        /// 诊断名称
227
+        /// </summary>
228
+        public string F_ZDMC
229
+        {
230
+            set { _f_zdmc = value; }
231
+            get { return _f_zdmc; }
232
+        }
233
+        /// <summary>
234
+        /// 总费用
235
+        /// </summary>
236
+        public decimal F_TotalCosts
237
+        {
238
+            set { _f_totalcosts = value; }
239
+            get { return _f_totalcosts; }
240
+        }
241
+        /// <summary>
242
+        /// 随访时间
243
+        /// </summary>
244
+        public DateTime  F_SFDate
245
+        {
246
+            set { _f_sfdate = value; }
247
+            get { return _f_sfdate; }
248
+        }
213 249
     }
214 250
 }