ZhangLiuYang лет назад: 4
Родитель
Сommit
79cb5ecfc0

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

@@ -103,6 +103,7 @@
103 103
     <Compile Include="T_Sys_MobileData.cs" />
104 104
     <Compile Include="T_Sys_ModuleInfo.cs" />
105 105
     <Compile Include="T_Sys_ModuleFunctions.cs" />
106
+    <Compile Include="T_Sys_Patirnt.cs" />
106 107
     <Compile Include="T_Sys_RoleFunction.cs" />
107 108
     <Compile Include="T_Sys_RoleInfo.cs" />
108 109
     <Compile Include="T_Sys_SeatGroup.cs" />

+ 48 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Sys_Patirnt.cs

@@ -0,0 +1,48 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Data;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace CallCenterApi.BLL
9
+{
10
+    public partial class T_Sys_Patirnt
11
+    {
12
+        private readonly CallCenterApi.DAL.T_Sys_Patirnt dal = new DAL.T_Sys_Patirnt();
13
+        public T_Sys_Patirnt()
14
+        { }
15
+
16
+        public
17
+            List<CallCenterApi.Model.T_Sys_Patirnt> DataTableToList(DataTable dt)
18
+        {
19
+            List<CallCenterApi.Model.T_Sys_Patirnt>
20
+                modelList = new List<Model.T_Sys_Patirnt>();
21
+            int rowsCount = dt.Rows.Count;
22
+            if (rowsCount > 0)
23
+            {
24
+                CallCenterApi.Model.T_Sys_Patirnt model;
25
+                for (int n = 0; n < rowsCount; n++)
26
+                {
27
+                    model = dal.DataRowToModel(dt.Rows[n]);
28
+                    if (model != null)
29
+                    {
30
+                        modelList.Add(model);
31
+                    }
32
+                }
33
+            }
34
+            return modelList;
35
+        }
36
+
37
+
38
+        public CallCenterApi.Model.T_Sys_Patirnt GetModel(int PatirntID)
39
+        {
40
+
41
+            return dal.GetModel(PatirntID);
42
+        }
43
+
44
+         
45
+
46
+
47
+    }
48
+}

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

@@ -103,6 +103,7 @@
103 103
     <Compile Include="T_Sys_MobileData.cs" />
104 104
     <Compile Include="T_Sys_ModuleInfo.cs" />
105 105
     <Compile Include="T_Sys_ModuleFunctions.cs" />
106
+    <Compile Include="T_Sys_Patirnt.cs" />
106 107
     <Compile Include="T_Sys_RoleFunction.cs" />
107 108
     <Compile Include="T_Sys_RoleInfo.cs" />
108 109
     <Compile Include="T_Sys_SeatGroup.cs" />

+ 158 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Sys_Patirnt.cs

@@ -0,0 +1,158 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+using CallCenterApi.DB;
7
+using System.Data;
8
+using System.Data.SqlClient;
9
+
10
+namespace CallCenterApi.DAL
11
+{
12
+    public class T_Sys_Patirnt
13
+    {
14
+        public T_Sys_Patirnt()
15
+        { }
16
+
17
+
18
+        public CallCenterApi.Model.T_Sys_Patirnt DataRowToModel(DataRow row)
19
+        {
20
+            CallCenterApi.Model.T_Sys_Patirnt model = new Model.T_Sys_Patirnt();
21
+            if (row != null)
22
+            {
23
+                if (row["PatirntID"] != null && row["PatirntID"].ToString() != "")
24
+                {
25
+                    model.PatirntID = int.Parse(row["PatirntID"].ToString());
26
+                }
27
+
28
+
29
+
30
+                if (row["Department"] != null)
31
+                {
32
+                    model.Department = row["Department"].ToString();
33
+                }
34
+
35
+
36
+
37
+                if (row["PatirntName"] != null)
38
+                {
39
+                    model.PatirntName = row["PatirntName"].ToString();
40
+                }
41
+
42
+
43
+
44
+                if (row["PTime"] != null && row["PTime"].ToString() != "")
45
+                {
46
+                    model.PTime = DateTime.Parse(row["PTime"].ToString());
47
+                }
48
+
49
+
50
+              
51
+
52
+                if (row["Phone"] != null)
53
+                {
54
+                    model.Phone = row["Phone"].ToString();
55
+                }
56
+
57
+
58
+                if (row["Sex"] != null && row["Sex"].ToString() != "")
59
+                {
60
+                    model.Sex = int.Parse(row["Sex"].ToString());
61
+                }
62
+
63
+
64
+                if (row["Age"] != null && row["Age"].ToString() != "")
65
+                {
66
+                    model.Age = int.Parse(row["Age"].ToString());
67
+                }
68
+
69
+
70
+                if (row["Diagnosis"] != null)
71
+                {
72
+                    model.Diagnosis = row["Diagnosis"].ToString();
73
+                }
74
+
75
+
76
+
77
+                if (row["Doctor"] != null)
78
+                {
79
+                    model.Doctor = row["Doctor"].ToString();
80
+                }
81
+
82
+                if (row["FollowUp"] != null)
83
+                {
84
+                    model.FollowUp = int.Parse(row["FollowUp"].ToString());
85
+                }
86
+
87
+                if (row["DeleteFlag"] != null)
88
+                {
89
+                    model.DeleteFlag = int.Parse(row["DeleteFlag"].ToString());
90
+                }
91
+
92
+                if (row["Satisfaction"] != null)
93
+                {
94
+                    if (!string.IsNullOrEmpty(row["Satisfaction"].ToString()))
95
+                    {
96
+                        model.Satisfaction = int.Parse(row["Satisfaction"].ToString());
97
+                    }
98
+
99
+                }
100
+
101
+
102
+                if (row["Note"] != null)
103
+                {
104
+                    model.Note = row["Note"].ToString();
105
+                }
106
+
107
+
108
+        
109
+
110
+
111
+                if (row["FollowUpTime"] != null && row["FollowUpTime"].ToString() != "")
112
+                {
113
+                    model.PTime = DateTime.Parse(row["FollowUpTime"].ToString());
114
+                }
115
+
116
+                if (row["CallId"] != null)
117
+                {
118
+                    model.CallId =Convert.ToInt32(row["CallId"].ToString());
119
+                }
120
+
121
+                if (row["ActionID"] != null)
122
+                {
123
+                    if (!string.IsNullOrEmpty(row["ActionID"].ToString()))
124
+                    {
125
+                        model.ActionID = Convert.ToInt32(row["ActionID"].ToString());
126
+                    }
127
+                    
128
+                }
129
+            }
130
+            return model;
131
+
132
+        }
133
+
134
+         
135
+        public CallCenterApi.Model.T_Sys_Patirnt GetModel(int PatirntID)
136
+        {
137
+
138
+            StringBuilder strSql = new StringBuilder();
139
+            strSql.Append("select  top 1 * from T_Sys_Patirnt ");
140
+            strSql.Append(" where PatirntID=@PatirntID");
141
+            SqlParameter[] parameters = {
142
+                    new SqlParameter("@PatirntID", SqlDbType.Int,4)
143
+            };
144
+            parameters[0].Value = PatirntID;
145
+
146
+            CallCenterApi.Model.T_Sys_Patirnt model = new CallCenterApi.Model.T_Sys_Patirnt();
147
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
148
+            if (ds.Tables[0].Rows.Count > 0)
149
+            {
150
+                return DataRowToModel(ds.Tables[0].Rows[0]);
151
+            }
152
+            else
153
+            {
154
+                return null;
155
+            }
156
+        }
157
+    }
158
+}

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Login/LoginController.cs

@@ -72,7 +72,7 @@ namespace CallCenterApi.Interface.Controllers
72 72
                     var token = FormsPrincipal<Cache.Models.CurrentUserInfo>.GetCookieValue(currentUserInfo.F_UserCode, currentUserInfo);
73 73
 
74 74
                     //放入缓存
75
-                    CacheHelper.Insert(token, currentUserInfo, 1440);
75
+                    CacheHelper.Insert(token, currentUserInfo, 1440*7);
76 76
                     return Success("登录成功", new
77 77
                     {
78 78
                         token = token

+ 34 - 56
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs

@@ -17,15 +17,36 @@ using System.Text;
17 17
 using Newtonsoft.Json;
18 18
 using System.Xml;
19 19
 using System.IO;
20
+using System.Security.Cryptography;
21
+using Newtonsoft.Json.Linq;
20 22
 
21 23
 namespace CallCenterApi.Interface.Controllers
22 24
 {
23 25
     public class SMSController : BaseController
24 26
     {
25 27
         #region 接收短信
26
-        string url = "http://47.92.26.244/sms.aspx?";
27
-        string account = "yhyy"; string password = "yhyy190903";
28
-
28
+        //string url = "http://47.92.26.244/sms.aspx?";
29
+        //string account = "yhyy"; string password = "yhyy190903";
30
+        string url = "http://sdk.lx198.com/sdk/";                                      
31
+        string accName = "15003877636"; string password = "759089";
32
+        /// <summary>
33
+        /// MD5加密
34
+        /// </summary>
35
+        /// <param name="txt"></param>
36
+        /// <returns></returns>
37
+        public static string Md5(string txt)
38
+        {
39
+            byte[] sor = Encoding.UTF8.GetBytes(txt);
40
+            MD5 md5 = MD5.Create();
41
+            byte[] result = md5.ComputeHash(sor);
42
+            StringBuilder strbul = new StringBuilder(40);
43
+            for (int i = 0; i < result.Length; i++)
44
+            {
45
+                //加密结果"x2"结果为32位,"x3"结果为48位,"x4"结果为64位
46
+                strbul.Append(result[i].ToString("x2"));
47
+            }
48
+            return strbul.ToString().ToUpper();
49
+        }
29 50
         /// <summary>
30 51
         /// 发送短信
31 52
         /// </summary>
@@ -40,65 +61,22 @@ namespace CallCenterApi.Interface.Controllers
40 61
         /// <param name="type"></param>
41 62
         /// <returns></returns>
42 63
 
43
-        public ActionResult SendSMS(string mobile, string time, string timeslot, string department, string doctor, string floor, string sendTime, string name, string content, int MBID, int sendWay = 0)
64
+        public string SendSMS(string mobile,  string sendTime, string content)
44 65
         {
45 66
             WebClient web = new WebClient();
46 67
             web.Encoding = Encoding.UTF8;
47 68
             content += "【郑州颐和医院】";
48
-            url += "action=send&userid=&account=" + account.Trim() + "&password=" + password.Trim() + "&mobile=" + mobile.Trim() + "&content=" + content.Trim() + "& sendTime=" + sendTime.Trim() + "& extno=";
69
+            url += "send?accName="+ accName + "&accPwd="+ Md5 (password) + "&aimcodes=" + mobile.Trim() + "&content=" + content.Trim() + "&schTime=" + DateTime .Now .ToString ("yyyy-MM-dd HH:mm:ss") + "&dataType=json& msgId=" + sendTime.Trim() + "454163135423543";
49 70
             string Dataaa = web.DownloadString(url);//这一句话就能请求到数据了
50
-
51
-            var result = new CreateOrderReturnResult();
52
-            try
53
-            {
54
-                DataSet ds = new DataSet();
55
-                StringReader stream = new StringReader(Dataaa);//读取字符串为数据量
56
-                XmlTextReader reader = new XmlTextReader(stream);//对XML的数据流的只进只读访问
57
-                ds.ReadXml(reader);//吧数据读入DataSet
58
-                DataTable dt = ds.Tables["returnsms"];
59
-                result.state = "success";
60
-                result.message = "发送成功";
61
-
62
-
63
-                result.data = new SmS();
64
-                if (dt.Rows.Count > 0)
65
-                {
66
-                    for (int i = 0; i < dt.Rows.Count; i++)
67
-                    {
68
-                        DataRow dr = ds.Tables[0].Rows[i];
69
-                        result.data.returnstatus = dr["returnstatus"].ToString();
70
-                        result.data.message = dr["message"].ToString();
71
-                        result.data.remainpoint = dr["remainpoint"].ToString();
72
-                        result.data.taskID = dr["taskID"].ToString();
73
-                        result.data.successCounts = dr["successCounts"].ToString();
74
-                    }
75
-                }
76
-                int IsSend = 0;
77
-                if (result.data.returnstatus == "Success")
78
-                {
79
-                    IsSend = 1;
80
-                }
81
-
82
-                DateTime DSSendTime = DateTime.Now;
83
-
84
-                if (!string.IsNullOrEmpty(sendTime.Trim()))
85
-                {
86
-                    DSSendTime = DateTime.Parse(sendTime.Trim());
87
-                }
88
-                AddSMSList(sendWay, DSSendTime, DSSendTime, IsSend, mobile, content, MBID);
89
-                if (result.data.returnstatus != "Success")
90
-                {
91
-                    return Error(result.data.message);
92
-                }
93
-
94
-            }
95
-            catch (Exception ex)
96
-            {
97
-                return Error(ex.Message);
98
-            }
99
-            return Content(result.ToJson());
71
+            JObject jo = (JObject)JsonConvert.DeserializeObject(Dataaa);
72
+            string replyCode = jo["replyCode"].ToString();
73
+            string replyMsg = jo["replyMsg"].ToString();
74
+            if (replyCode == "1")
75
+                return "发送成功";
76
+            else
77
+                return "发送失败";
100 78
         }
101
-       
79
+      
102 80
         public class CreateOrderReturnResult
103 81
         {
104 82
             public string state { get; set; }

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

@@ -109,6 +109,7 @@
109 109
     <Compile Include="T_Sys_MobileData.cs" />
110 110
     <Compile Include="T_Sys_ModuleFunctions.cs" />
111 111
     <Compile Include="T_Sys_ModuleInfo.cs" />
112
+    <Compile Include="T_Sys_Patirnt.cs" />
112 113
     <Compile Include="T_Sys_RoleFunction.cs" />
113 114
     <Compile Include="T_Sys_RoleInfo.cs" />
114 115
     <Compile Include="T_Sys_SeatGroup.cs" />

+ 190 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Sys_Patirnt.cs

@@ -0,0 +1,190 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace CallCenterApi.Model
8
+{
9
+    /// <summary>
10
+    /// 患者信息表
11
+    /// </summary>
12
+    [Serializable]
13
+    public class T_Sys_Patirnt
14
+
15
+    {
16
+        public T_Sys_Patirnt()
17
+        { }
18
+        #region Model
19
+        private int _f_patirntid; 
20
+        private string _f_department; 
21
+        private string _f_patirntname; 
22
+        private DateTime _f_ptime;
23
+        private string _f_phone;
24
+        private int _f_sex;
25
+        private int _f_age;
26
+        private string _f_diagnosis;
27
+        private string _f_doctor;
28
+        private int _f_followUp;
29
+        private int _f_deleteFlag;
30
+        private int _f_satisfaction;
31
+        private string _f_note;
32
+        private DateTime _f_followUpTime;
33
+        private int _f_callId;
34
+        private string _f_lvyin;
35
+        private int _f_actionid;
36
+
37
+        /// <summary>
38
+        /// 患者id
39
+        /// </summary>
40
+        public int PatirntID
41
+        {
42
+            set { _f_patirntid = value; }
43
+            get { return _f_patirntid; }
44
+        }
45
+
46
+        /// <summary>
47
+        /// 科室
48
+        /// </summary>
49
+        public string Department
50
+        {
51
+            set { _f_department = value; }
52
+            get { return _f_department; }
53
+        }
54
+
55
+        /// <summary>
56
+        /// 患者姓名
57
+        /// </summary>
58
+        public string PatirntName
59
+        {
60
+            set { _f_patirntname = value; }
61
+            get { return _f_patirntname; }
62
+        }
63
+
64
+        /// <summary>
65
+        /// 时间
66
+        /// </summary>
67
+        public DateTime PTime
68
+        {
69
+            set { _f_ptime = value; }
70
+            get { return _f_ptime; }
71
+        }
72
+        /// <summary>
73
+        /// 电话
74
+        /// </summary>
75
+        public string Phone
76
+        {
77
+            set { _f_phone = value; }
78
+            get { return _f_phone; }
79
+        }
80
+        
81
+        /// <summary>
82
+        /// 性别   1:男 2:女
83
+        /// </summary>
84
+        public int Sex
85
+        {
86
+            set { _f_sex = value; }
87
+            get { return _f_sex; }
88
+        }
89
+
90
+        /// <summary>
91
+        /// 年龄
92
+        /// </summary>
93
+        public int Age
94
+        {
95
+            set { _f_age = value; }
96
+            get { return _f_age; }
97
+        }
98
+
99
+        /// <summary>
100
+        /// 诊断
101
+        /// </summary>
102
+        public string Diagnosis
103
+        {
104
+            set { _f_diagnosis = value; }
105
+            get { return _f_diagnosis; }
106
+        }
107
+
108
+        /// <summary>
109
+        /// 医生
110
+        /// </summary>
111
+        public string Doctor
112
+        {
113
+            set { _f_doctor = value; }
114
+            get { return _f_doctor; }
115
+        }
116
+
117
+        /// <summary>
118
+        /// 随访状态  0:未随访 1:已随访
119
+        /// </summary>
120
+        public int FollowUp
121
+        {
122
+            set { _f_followUp = value; }
123
+            get { return _f_followUp; }
124
+        }
125
+
126
+        /// <summary>
127
+        /// 是否删除 0:未删除 1:删除
128
+        /// </summary>
129
+        public int DeleteFlag
130
+        {
131
+            set { _f_deleteFlag = value;}
132
+            get { return _f_deleteFlag; }
133
+        }
134
+
135
+        /// <summary>
136
+        /// 满意度 0:不满意 1:满意 2:表扬
137
+        /// </summary>
138
+        public int Satisfaction
139
+        {
140
+            set { _f_satisfaction = value; }
141
+            get { return _f_satisfaction; }
142
+        }
143
+
144
+        /// <summary>
145
+        /// 备注
146
+        /// </summary>
147
+        public string Note
148
+        {
149
+            set { _f_note = value; }
150
+            get { return _f_note; }
151
+        }
152
+
153
+        /// <summary>
154
+        /// 录音
155
+        /// </summary>
156
+        public string Lvyin
157
+        {
158
+            set { _f_lvyin = value; }
159
+            get { return _f_lvyin; }
160
+        }
161
+
162
+        
163
+        /// <summary>
164
+        /// 随访时间
165
+        /// </summary>
166
+        public DateTime FollowUpTime
167
+        {
168
+            set { _f_followUpTime = value; }
169
+            get { return _f_followUpTime; }
170
+        }
171
+        
172
+        /// <summary>
173
+        /// 通话记录Id
174
+        /// </summary>
175
+        public int CallId
176
+        {
177
+            set { _f_callId = value; }
178
+            get { return _f_callId; }
179
+        }
180
+
181
+        public int ActionID
182
+        {
183
+            set { _f_actionid = value; }
184
+            get { return _f_actionid; }
185
+        }
186
+        public string lvlj { set; get; }
187
+
188
+        #endregion Model
189
+    }
190
+}