Bladeren bron

登录加密

gaobingyue 5 jaren geleden
bovenliggende
commit
6921407cfb

+ 28 - 0
codegit/CallCenterApi/CallCenterApi.BLL/T_Bus_WorkOrder_GriddingWO_logs.cs

@@ -0,0 +1,28 @@
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.BLL
8
+{
9
+    /// <summary>
10
+	/// 反馈表
11
+	/// </summary>
12
+	public partial class T_Bus_WorkOrder_GriddingWO_logs
13
+    {
14
+        private readonly CallCenterApi.DAL.T_Bus_WorkOrder_GriddingWO_logs dal = new CallCenterApi.DAL.T_Bus_WorkOrder_GriddingWO_logs();
15
+        public T_Bus_WorkOrder_GriddingWO_logs()
16
+        { }
17
+        #region  Method
18
+        /// <summary>
19
+        /// 增加一条数据
20
+        /// </summary>
21
+        public int Add(CallCenterApi.Model.T_Bus_WorkOrder_GriddingWO_logs model)
22
+        {
23
+            return dal.Add(model);
24
+        }
25
+
26
+        #endregion  Method
27
+    }
28
+}

+ 50 - 0
codegit/CallCenterApi/CallCenterApi.Common/CodeValidate.cs

@@ -0,0 +1,50 @@
1
+using CallCenter.Utility;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Configuration;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Threading.Tasks;
8
+
9
+namespace CallCenterApi.Common
10
+{
11
+    public  class CodeValidate
12
+    {
13
+        /// <summary>
14
+        /// 安全参数
15
+        /// </summary>
16
+        /// <param name="obj">对象</param>
17
+        /// <returns></returns>
18
+        public static bool ICodeValidate(string strParams, string ICode)
19
+        {
20
+            string SecurityCode = Configs.GetValue("SecurityCode"); //ConfigurationManager.AppSettings["SecurityCode"];
21
+            string pwd = CommonHelper.MD5(SecurityCode + strParams);
22
+            return pwd.Equals(ICode);
23
+            //return true;
24
+        }
25
+
26
+        /// <summary>
27
+        /// 安全参数
28
+        /// </summary>
29
+        /// <param name="obj">对象</param>
30
+        /// <returns></returns>
31
+        public static bool ICodeValidateGridding(string strParams, string ICode)
32
+        {
33
+            string SecurityCode = Configs.GetValue("GriddingCode"); //ConfigurationManager.AppSettings["SecurityCode"];
34
+            string pwd = CommonHelper.MD5(SecurityCode + strParams);
35
+            return pwd.Equals(ICode);
36
+            //return true;
37
+        }
38
+
39
+        /// <summary>
40
+        /// 安全参数
41
+        /// </summary>
42
+        /// <param name="obj">对象</param>
43
+        /// <returns></returns>
44
+        public static string ICodeValidateGriddingT(string strParams, string ICode)
45
+        {
46
+            string SecurityCode = Configs.GetValue("GriddingCode"); //ConfigurationManager.AppSettings["SecurityCode"];
47
+            return CommonHelper.MD5(SecurityCode + strParams);
48
+        }
49
+    }
50
+}

+ 108 - 0
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder_GriddingWO_logs.cs

@@ -0,0 +1,108 @@
1
+using CallCenterApi.DB;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Data.SqlClient;
6
+using System.Linq;
7
+using System.Text;
8
+using System.Threading.Tasks;
9
+
10
+namespace CallCenterApi.DAL
11
+{
12
+    /// <summary>
13
+	/// 数据访问类:T_Bus_WorkOrder_GriddingWO_logs
14
+	/// </summary>
15
+	public partial class T_Bus_WorkOrder_GriddingWO_logs
16
+    {
17
+        public T_Bus_WorkOrder_GriddingWO_logs()
18
+        { }
19
+        #region  Method
20
+
21
+        /// <summary>
22
+        /// 增加一条数据
23
+        /// </summary>
24
+        public int Add(CallCenterApi.Model.T_Bus_WorkOrder_GriddingWO_logs model)
25
+        {
26
+            StringBuilder strSql = new StringBuilder();
27
+            strSql.Append("insert into T_Bus_WorkOrder_GriddingWO_logs(");
28
+            strSql.Append(@"F_WorkOrderId,F_Result,F_Usercode,F_dealman,F_Files,F_ProSituation,
29
+F_DealContact,F_ConnectTime,F_ConnectMode,F_Duties,F_Situation,F_State,F_FeedbackID,F_IsProResult,
30
+F_IsSatisfied,F_uuid,F_port_password,F_MapID,F_Direction,F_AddTime,F_Message,
31
+F_OperatContent,F_OperatType,F_results,F_resultsCOntent
32
+)");
33
+            strSql.Append(" values (");
34
+            strSql.Append("@F_WorkOrderId,@F_Result,@F_Usercode,@F_dealman,@F_Files," +
35
+                "@F_ProSituation,@F_DealContact,@F_ConnectTime," +
36
+                "@F_ConnectMode,@F_Duties,@F_Situation,@F_State," +
37
+                "@F_FeedbackID,@F_IsProResult,@F_IsSatisfied,@F_uuid," +
38
+                "@F_port_password,@F_MapID,@F_Direction,@F_AddTime," +
39
+                "@F_Message," +
40
+                "@F_OperatContent,@F_OperatType,@F_results,@F_resultsCOntent)");
41
+            strSql.Append(";select @@IDENTITY");
42
+            SqlParameter[] parameters = {
43
+                    new SqlParameter("@F_WorkOrderId", SqlDbType.NVarChar,20),
44
+                    new SqlParameter("@F_Result", SqlDbType.NVarChar),
45
+                    new SqlParameter("@F_Usercode", SqlDbType.NVarChar,50),
46
+                    new SqlParameter("@F_dealman", SqlDbType.NVarChar,50),
47
+                    new SqlParameter("@F_Files", SqlDbType.VarChar,500),
48
+                    new SqlParameter("@F_ProSituation", SqlDbType.NVarChar),
49
+                    new SqlParameter("@F_DealContact", SqlDbType.NVarChar,200),
50
+                    new SqlParameter("@F_ConnectTime", SqlDbType.NVarChar,200),
51
+                    new SqlParameter("@F_ConnectMode", SqlDbType.NVarChar,500),
52
+                    new SqlParameter("@F_Duties", SqlDbType.NVarChar,200),
53
+                    new SqlParameter("@F_Situation", SqlDbType.NVarChar),
54
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
55
+                    new SqlParameter("@F_FeedbackID", SqlDbType.Int,4),
56
+                    new SqlParameter("@F_IsProResult", SqlDbType.Int,4),
57
+                    new SqlParameter("@F_IsSatisfied", SqlDbType.Int,4),
58
+                    new SqlParameter("@F_uuid", SqlDbType.NVarChar,50),
59
+                    new SqlParameter("@F_port_password", SqlDbType.NVarChar,200),
60
+                    new SqlParameter("@F_MapID", SqlDbType.Int,4),
61
+                    new SqlParameter("@F_Direction", SqlDbType.NVarChar,20),
62
+                    new SqlParameter("@F_AddTime", SqlDbType.DateTime),
63
+                    new SqlParameter("@F_Message", SqlDbType.NVarChar),
64
+
65
+                    new SqlParameter("@F_OperatContent", SqlDbType.NVarChar,20),
66
+                    new SqlParameter("@F_OperatType", SqlDbType.NVarChar,20),
67
+                    new SqlParameter("@F_results", SqlDbType.NVarChar,20),
68
+                     new SqlParameter("@F_resultsCOntent", SqlDbType.NVarChar)
69
+            };
70
+            parameters[0].Value = model.F_WorkOrderId;
71
+            parameters[1].Value = model.F_Result;
72
+            parameters[2].Value = model.F_Usercode;
73
+            parameters[3].Value = model.F_dealman;
74
+            parameters[4].Value = model.F_Files;
75
+            parameters[5].Value = model.F_ProSituation;
76
+            parameters[6].Value = model.F_DealContact;
77
+            parameters[7].Value = model.F_ConnectTime;
78
+            parameters[8].Value = model.F_ConnectMode;
79
+            parameters[9].Value = model.F_Duties;
80
+            parameters[10].Value = model.F_Situation;
81
+            parameters[11].Value = model.F_State;
82
+            parameters[12].Value = model.F_FeedbackID;
83
+            parameters[13].Value = model.F_IsProResult;
84
+            parameters[14].Value = model.F_IsSatisfied;
85
+            parameters[15].Value = model.F_uuid;
86
+            parameters[16].Value = model.F_port_password;
87
+            parameters[17].Value = model.F_MapID;
88
+            parameters[18].Value = model.F_Direction;
89
+            parameters[19].Value = model.F_AddTime;
90
+            parameters[20].Value = model.F_Message;
91
+
92
+            parameters[21].Value = model.F_OperatContent;
93
+            parameters[22].Value = model.F_OperatType;
94
+            parameters[23].Value = model.F_results;
95
+            parameters[24].Value = model.F_resultsCOntent;
96
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
97
+            if (obj == null)
98
+            {
99
+                return 0;
100
+            }
101
+            else
102
+            {
103
+                return Convert.ToInt32(obj);
104
+            }
105
+        }
106
+        #endregion  Method
107
+    }
108
+}

+ 6 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Configs/system.config

@@ -15,4 +15,10 @@
15 15
   <add key="Redis_Defaultdatabase" value="2" />
16 16
   <!-- 录音存储地址 -->
17 17
   <add key="Sound_recording" value="D:\CallCenter_Sound\" />
18
+
19
+
20
+  <!-- ================== 6:高新区管委会通讯记录对接 ================== -->
21
+  <add key="GriddingCode" value="gaoxinquguanweihui666%#@6" />
22
+  <!--<add key="GriddingUrl" value="http://120.194.198.148:83/CapturePhoto.asmx?op=ReportDispute12345" />-->
23
+  
18 24
 </appSettings>

+ 209 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/BusinessDockController.cs

@@ -0,0 +1,209 @@
1
+using CallCenter.Utility;
2
+using CallCenter.Utility.log;
3
+using CallCenterApi.Common;
4
+using CallCenterApi.DB;
5
+using CallCenterApi.Interface.Controllers.Base;
6
+using CallCenterApi.Interface.Controllers.tel;
7
+using Newtonsoft.Json.Linq;
8
+using System;
9
+using System.Collections.Generic;
10
+using System.Data;
11
+using System.Linq;
12
+using System.Transactions;
13
+using System.Web;
14
+using System.Web.Mvc;
15
+
16
+namespace CallCenterApi.Interface.Controllers.workorder
17
+{
18
+    public class BusinessDockController : BaseController
19
+    {
20
+        
21
+        private BLL.T_Sys_SystemConfig configBll = new BLL.T_Sys_SystemConfig();
22
+        private AjaxResult ajresult = new AjaxResult();
23
+       // private FileUp fileup = new FileUp();
24
+
25
+       
26
+
27
+        /// <summary>
28
+        /// 成功的消息格式化
29
+        /// </summary>
30
+        /// <param name="message"></param>
31
+        /// <returns></returns>
32
+        protected virtual ActionResult Process()
33
+        {
34
+            string methodName = new System.Diagnostics.StackTrace(true).GetFrame(1).GetMethod().Name;   //事件源
35
+           //验证文件是否存在
36
+            // LogInterface.WriteLog(this.GetType().ToString() + " -- " + methodName + "\r\n" + ajresult.state + "|" + ajresult.data + ajresult.message); //日志
37
+            var jsonMsg = new AjaxResult { state = ajresult.state, message = ajresult.message, data = ajresult.data }.ToJson();
38
+            return Content(jsonMsg);
39
+        }
40
+
41
+
42
+        
43
+
44
+        /// <summary>
45
+        /// 状态枚举
46
+        /// </summary>
47
+        enum CodeStatus
48
+        {
49
+            SUCCESS = 200,
50
+            安全验证未通过 = 400,
51
+            无法预测的程序错误 = 501,
52
+            参数格式错误 = 100,
53
+            必填字段为空 = 101,
54
+            字符串超出长度 = 102,
55
+            数据库错误 = 103,
56
+            执行超时 = 104,
57
+            参数逻辑错误 = 105,
58
+            ID不存在 = 106,
59
+            无可上传文件=107,
60
+            执行失败 = 108,
61
+            用户已禁用 = 120,
62
+            
63
+            异常结果类型 = 500
64
+
65
+        }
66
+
67
+        /// <summary>
68
+        /// 添加日志
69
+        /// </summary>
70
+        public void AddGriddingLogs(string uuid, string port_password,
71
+            string direction, string msg, string usercode,
72
+            string workorderid, string dealman, string result,
73
+            string files, string prosituation, string dealcontact,
74
+            string connecttime, string connectmode, string replycontent,
75
+            string duties, string situation,
76
+             string F_resultsCOntent, string F_OperatContent,string F_OperatType,
77
+            int state = 0, int feedbackid = 0,
78
+            int isproresult = 0, int isstaisfied = 0, int mapid = 0
79
+            )
80
+        {
81
+            Model.T_Bus_WorkOrder_GriddingWO_logs logs = new Model.T_Bus_WorkOrder_GriddingWO_logs();
82
+            logs.F_WorkOrderId = workorderid;
83
+            logs.F_uuid = uuid;
84
+            logs.F_port_password = port_password;
85
+            logs.F_MapID = mapid;
86
+            logs.F_Direction = direction;
87
+            logs.F_AddTime = DateTime.Now;
88
+            logs.F_Message = msg;
89
+
90
+            logs.F_Result = result;
91
+
92
+            logs.F_Usercode = usercode;
93
+            logs.F_dealman = dealman;
94
+            logs.F_Files = files;
95
+            logs.F_ProSituation = prosituation;
96
+
97
+            logs.F_DealContact = dealcontact;
98
+            logs.F_ConnectTime = connecttime;
99
+            logs.F_ConnectMode = connectmode;
100
+            logs.F_Duties = duties;
101
+            logs.F_Situation = situation;
102
+
103
+            logs.F_State = state;
104
+            logs.F_FeedbackID = feedbackid;
105
+            logs.F_IsProResult = isproresult;
106
+            logs.F_IsSatisfied = isstaisfied;
107
+            //结果返回数据
108
+            logs.F_resultsCOntent = F_resultsCOntent;
109
+            //操作内容
110
+            logs.F_OperatContent = F_OperatContent;
111
+            //操作类型
112
+            logs.F_OperatType = F_OperatType;
113
+
114
+
115
+            new BLL.T_Bus_WorkOrder_GriddingWO_logs().Add(logs);
116
+        }
117
+
118
+        /// <summary>
119
+        /// 查收接口
120
+        ///port_password: 对方以相同方式生成的md5 密码
121
+        ///uuid:         对方给的随机数
122
+        ///usercode:用户账号
123
+        ///
124
+        /// </summary>
125
+        /// <returns></returns>
126
+        public ActionResult ReceiveWorkOrder()
127
+        {
128
+            string port_password = RequestString.GetFormString("port_password");   //加密信息(安全验证用)
129
+            string uuid = RequestString.GetFormString("uuid");          //客户唯一标识(安全验证用)
130
+            string content = RequestString.GetFormString("content");//查收详情
131
+            string usercode = RequestString.GetFormString("usercode");
132
+
133
+            //request.QueryString("abc")
134
+
135
+
136
+            using (TransactionScope trans = new TransactionScope())
137
+            {
138
+                #region 参数验证
139
+                if (string.IsNullOrEmpty(uuid))
140
+                {
141
+                    ajresult.state = (int)CodeStatus.ID不存在;
142
+                    ajresult.message = "客户唯一标识不能为空";
143
+                    return Process();
144
+                }
145
+                else if (uuid.Length > 50)
146
+                {
147
+                    ajresult.state = (int)CodeStatus.字符串超出长度;
148
+                    ajresult.message = "客户唯一标识超出长度";
149
+                    return Process();
150
+                }
151
+                //if (string.IsNullOrEmpty(workorderid))
152
+                //{
153
+                //    ajresult.state = (int)CodeStatus.必填字段为空;
154
+                //    ajresult.message = "工单编号不能为空";
155
+                //    return Process();
156
+                //}
157
+                if (string.IsNullOrEmpty(usercode))
158
+                {
159
+                    ajresult.state = (int)CodeStatus.必填字段为空;
160
+                    ajresult.message = "工号不能为空";
161
+                    return Process();
162
+                }
163
+
164
+                //if (!Common.CodeValidate.ICodeValidateGridding(uuid, port_password))
165
+                //{
166
+                //    ajresult.state = (int)CodeStatus.安全验证未通过;
167
+                //    ajresult.message = "安全验证未通过";
168
+                //    return Process();
169
+                //}
170
+                #endregion
171
+                //通话记录
172
+                CallrecordsController wo = new CallrecordsController();
173
+
174
+                //通话记录   BusinessDockCurrentUserGetList
175
+
176
+                object[] obj1 = wo.GetBusinessDockList(usercode, content);
177
+               
178
+                    if (obj1[0].ToString()  == "false")
179
+                    {
180
+                        ajresult.state = (int)CodeStatus.执行失败;
181
+                        ajresult.message = "操作失败," + obj1[1].ToString();
182
+                    }
183
+                    else
184
+                    {
185
+                        ajresult.state = (int)CodeStatus.SUCCESS;
186
+                        ajresult.message = "操作成功";
187
+                        ajresult.data = obj1[2];  //反馈ID
188
+                    }
189
+
190
+                //通话记录数据拼接记录查询内容obj1[3]
191
+
192
+
193
+
194
+                //添加操作记录
195
+                 AddGriddingLogs(uuid, port_password, "search", " Callrecords:" + ajresult.message + "||" + content + "||" + ajresult.state, usercode, "0", "", "", "", "", "", "", "", "", "", "",
196
+                     obj1[3].ToString(), "通讯记录", "查询表单",
197
+                     0, 0, 0, 0, 0);
198
+                trans.Complete();
199
+            }
200
+            return Process();
201
+        }
202
+
203
+
204
+
205
+
206
+
207
+
208
+    }
209
+}

+ 137 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Login/AES256Controller.cs

@@ -0,0 +1,137 @@
1
+using CallCenterApi.Interface.Controllers.Base;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Linq;
5
+using System.Security.Cryptography;
6
+using System.Text;
7
+using System.Web;
8
+using System.Web.Mvc;
9
+
10
+namespace CallCenterApi.Interface.Controllers.Login
11
+{
12
+    public class AES256Controller : BaseController
13
+    {
14
+        // GET: AES256
15
+        public ActionResult Index()
16
+        {
17
+            return View();
18
+
19
+        }
20
+
21
+        private static string Key
22
+        {
23
+            //get { return @")O[NB]6,YF}+efcaj{+oESb9d8>Z'e9M"; }
24
+            get { return @")O[9d]6,YF}+efcaj{+8>Z'e9M"; }
25
+        }
26
+
27
+        #region 注释掉
28
+        /*private static string IV
29
+        {
30
+            get { return @"L+\~f4,Ir)b$=pkf"; }
31
+        }
32
+
33
+        
34
+        /// <summary>
35
+        /// AES加密
36
+        /// </summary>
37
+        /// <param name="plainStr">明文字符串</param>
38
+        /// <returns>密文</returns>
39
+        public static string AESEncrypt(string plainStr)
40
+        {
41
+            byte[] bKey = Encoding.UTF8.GetBytes(Key);
42
+            byte[] bIV = Encoding.UTF8.GetBytes(IV);
43
+            byte[] byteArray = Encoding.UTF8.GetBytes(plainStr);
44
+
45
+            string encrypt = null;
46
+            Rijndael aes = Rijndael.Create();
47
+            using (MemoryStream mStream = new MemoryStream())
48
+            {
49
+                using (CryptoStream cStream = new CryptoStream(mStream, aes.CreateEncryptor(bKey, bIV), CryptoStreamMode.Write))
50
+                {
51
+                    cStream.Write(byteArray, 0, byteArray.Length);
52
+                    cStream.FlushFinalBlock();
53
+                    encrypt = Convert.ToBase64String(mStream.ToArray());
54
+                }
55
+            }
56
+            aes.Clear();
57
+            return encrypt;
58
+        }
59
+
60
+        public static string AESDecrypt(string encryptStr)
61
+        {
62
+            byte[] bKey = Encoding.UTF8.GetBytes(Key);
63
+            byte[] bIV = Encoding.UTF8.GetBytes(IV);
64
+            byte[] byteArray = Convert.FromBase64String(encryptStr);
65
+
66
+            string decrypt = null;
67
+            Rijndael aes = Rijndael.Create();
68
+            // 开辟一块内存流
69
+            using (MemoryStream mStream = new MemoryStream())
70
+            {
71
+                // 把内存流对象包装成加密流对象
72
+                using (CryptoStream cStream = new CryptoStream(mStream, aes.CreateDecryptor(bKey, bIV), CryptoStreamMode.Write))
73
+                {
74
+                    // 明文数据写入加密流
75
+                    cStream.Write(byteArray, 0, byteArray.Length);
76
+                    cStream.FlushFinalBlock();
77
+                    decrypt = Encoding.UTF8.GetString(mStream.ToArray());
78
+                }
79
+            }
80
+            aes.Clear();
81
+            return decrypt;
82
+        }
83
+
84
+        public ActionResult Encryption(string str)
85
+        {
86
+            var text = AESEncrypt(str);
87
+            return Json(text, JsonRequestBehavior.AllowGet);
88
+        }
89
+
90
+        public ActionResult Decode(string str)
91
+        {
92
+            var text = AESDecrypt(str);
93
+            return Json(text, JsonRequestBehavior.AllowGet);
94
+        }*/
95
+        #endregion
96
+
97
+
98
+        /// <summary>
99
+        /// AES加密
100
+        /// </summary>
101
+        /// <param name="encryptStr">明文</param>
102
+        /// <param name="key">32位密钥</param>
103
+        /// <returns></returns>
104
+        public  string Encrypt(string encryptStr,string ltime)
105
+        {
106
+            byte[] keyArray = UTF8Encoding.UTF8.GetBytes(Key+ltime);
107
+            byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(encryptStr);
108
+            RijndaelManaged rDel = new RijndaelManaged();
109
+            rDel.Key = keyArray;
110
+            rDel.Mode = CipherMode.ECB;
111
+            rDel.Padding = PaddingMode.PKCS7;
112
+            ICryptoTransform cTransform = rDel.CreateEncryptor();
113
+            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
114
+            return Convert.ToBase64String(resultArray, 0, resultArray.Length);
115
+        }
116
+
117
+        /// <summary>
118
+        /// AES解密
119
+        /// </summary>
120
+        /// <param name="decryptStr">密文</param>
121
+        /// <param name="key">密钥</param>
122
+        /// <returns></returns>
123
+        public  string Decrypt(string decryptStr, string ltime)
124
+        {
125
+            byte[] keyArray = UTF8Encoding.UTF8.GetBytes(Key+ltime );
126
+            byte[] toEncryptArray = Convert.FromBase64String(decryptStr);
127
+            RijndaelManaged rDel = new RijndaelManaged();
128
+            rDel.Key = keyArray;
129
+            rDel.Mode = CipherMode.ECB;
130
+            rDel.Padding = PaddingMode.PKCS7;
131
+            ICryptoTransform cTransform = rDel.CreateDecryptor();
132
+            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
133
+            return UTF8Encoding.UTF8.GetString(resultArray);
134
+        }
135
+
136
+    }
137
+}

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

@@ -11,6 +11,7 @@ using CallCenterApi.Common;
11 11
 using CallCenterApi.Interface.Models.Common;
12 12
 using CallCenterApi.Model;
13 13
 using CallCenterApi.Interface.Models.Input;
14
+using CallCenterApi.Interface.Controllers.Login;
14 15
 
15 16
 namespace CallCenterApi.Interface.Controllers
16 17
 {
@@ -30,7 +31,25 @@ namespace CallCenterApi.Interface.Controllers
30 31
             bool appResult = LoodLoop();
31 32
             if (!appResult)
32 33
                 return Error("授权过期,请联系系统厂家。");
33
-            Model.T_Sys_UserAccount loginUser = new BLL.T_Sys_UserAccount().LoginGetModel(login.Username, login.Password);
34
+
35
+            #region 密码解密
36
+            string st = DateTime.Parse(login.LoginTime).ToString("HHmmss");
37
+            var otherController = DependencyResolver.Current.GetService<AES256Controller>();
38
+            string pw = "";
39
+            try
40
+            {
41
+                pw = otherController.Decrypt(login.Password.Trim(), st);
42
+
43
+            }
44
+            catch (Exception e)
45
+            {
46
+                return Error("错误:" + e.Message);
47
+            }
48
+            #endregion
49
+
50
+
51
+
52
+            Model.T_Sys_UserAccount loginUser = new BLL.T_Sys_UserAccount().LoginGetModel(login.Username, pw);
34 53
 
35 54
             if (loginUser == null)
36 55
             {

+ 84 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -8,6 +8,7 @@ using System.Data;
8 8
 using System.IO;
9 9
 using System.Linq;
10 10
 using System.Net;
11
+using System.Transactions;
11 12
 using System.Web;
12 13
 using System.Web.Mvc;
13 14
 
@@ -17,7 +18,7 @@ namespace CallCenterApi.Interface.Controllers.tel
17 18
     {
18 19
         BLL.T_Call_CallRecords bll = new BLL.T_Call_CallRecords();
19 20
         //获取通话记录列表
20
-        public ActionResult GetList(string phone, string usercode,string workordercode)
21
+        public ActionResult GetList(string phone, string usercode,string workordercode,string BusinessDockCode = "")
21 22
         {
22 23
             int userId = CurrentUser.UserData.F_UserId;
23 24
             Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
@@ -793,5 +794,87 @@ namespace CallCenterApi.Interface.Controllers.tel
793 794
             }
794 795
         }
795 796
         #endregion
797
+
798
+        //业务对接获取通话记录
799
+        public object[]  GetBusinessDockList(string userCode, string content)
800
+        {
801
+            //返回数据信息
802
+            //var returns = "";
803
+            
804
+            //报错 或者 执行成功信息
805
+            var msgss = "";
806
+            // 状态
807
+            var state = "";
808
+            //data
809
+            DataTable dt = new DataTable();
810
+            //tableinfo
811
+            string tableInfo = "";
812
+            using (TransactionScope trans = new TransactionScope())
813
+            {
814
+                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userCode);
815
+
816
+                if (userModel!=null) {
817
+                    //获取通话记录信息 
818
+
819
+                    string sql = @"select 
820
+CallNumber,FilePath,CallType,DealType,CallState,
821
+UserCode,UserName,BeginTime,TalkStartTime,TalkEndTime,TalkLongTime,
822
+(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d
823
+ where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName
824
+
825
+ from  T_Call_CallRecords WITH(NOLOCK) 
826
+ left join T_Sys_UserAccount on UserCode=F_UserCode where 1=1 ORDER BY CallRecordsId desc ";
827
+                    DataSet ds =DbHelperSQL.Query(sql,null);
828
+                    dt = ds.Tables[0];
829
+                    //tableInfo
830
+                    //行
831
+                    for (int i = 0; i < dt.Rows.Count; i++)
832
+                    {
833
+                        //列
834
+                        for (int j = 0; j < dt.Columns.Count; j++)
835
+                        {
836
+                            tableInfo += dt.Rows[i][0].ToString() + ",";
837
+                        }
838
+                        tableInfo += "|";
839
+                    }
840
+
841
+
842
+
843
+
844
+                            //                    int recordCount = 0;
845
+                            //                     dt = BLL.PagerBLL.GetListPager(
846
+                            //                        "T_Call_CallRecords WITH(NOLOCK) left join T_Sys_UserAccount on UserCode=F_UserCode  ",
847
+                            //                        "CallRecordsId",
848
+                            //                        @"CallNumber,FilePath,CallType,DealType,CallState,
849
+                            //UserCode,UserName,BeginTime,TalkStartTime,TalkEndTime,TalkLongTime,
850
+                            //(select d.f_deptName from T_Sys_UserAccount u,[dbo].[T_Sys_Department] d
851
+                            // where u.F_DeptId=d.F_DeptId and u.F_UserCode= UserCode) AS CusDepName",
852
+                            //                        "",
853
+                            //                        "ORDER BY CallRecordsId desc",
854
+                            //                        1,
855
+                            //                        100000,
856
+                            //                        true,
857
+                            //                        out recordCount);
858
+                            state = "true";
859
+                    msgss = "获取成功";
860
+
861
+
862
+                }
863
+                else
864
+                {
865
+                    state = "false";
866
+                    msgss = "无法获取userCode工号信息,工号为" + userCode ;
867
+                    
868
+                }
869
+
870
+            }
871
+
872
+            //状态,信息,数据,
873
+            object[] returns = { state , msgss , dt, tableInfo };
874
+            return returns;
875
+        }
876
+
877
+
878
+
796 879
     }
797 880
 }

+ 1 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/LoginModel.cs

@@ -10,5 +10,6 @@ namespace CallCenterApi.Interface.Models.Input
10 10
         public string Username { get; set; }
11 11
         public string ExtensionPhone { get; set; }
12 12
         public string Password { get; set; }
13
+        public string LoginTime { get; set; }
13 14
     }
14 15
 }

+ 257 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder_GriddingWO_logs.cs

@@ -0,0 +1,257 @@
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 partial class T_Bus_WorkOrder_GriddingWO_logs
14
+    {
15
+        public T_Bus_WorkOrder_GriddingWO_logs()
16
+        { }
17
+        #region Model
18
+        private int _f_id;
19
+        private string _f_workorderid;
20
+        private string _f_result;
21
+        private string _f_usercode;
22
+        private string _f_dealman;
23
+        private string _f_files;
24
+        private string _f_prosituation;
25
+        private string _f_dealcontact;
26
+        private string _f_connecttime;
27
+        private string _f_connectmode;
28
+        private string _f_duties;
29
+        private string _f_situation;
30
+        private int? _f_state;
31
+        private int? _f_feedbackid;
32
+        private int? _f_isproresult;
33
+        private int? _f_issatisfied;
34
+        private string _f_uuid;
35
+        private string _f_port_password;
36
+        private int? _f_mapid;
37
+        private string _f_direction;
38
+        private DateTime? _f_addtime;
39
+        private string _f_message;
40
+
41
+        private string _F_OperatContent;
42
+        private string _F_OperatType;
43
+        private string _F_results;
44
+        private string _F_resultsCOntent;
45
+
46
+        /// <summary>
47
+        /// 操作内容 通讯记录
48
+        /// </summary>
49
+        public string F_OperatContent
50
+        {
51
+            set { _F_OperatContent = value; }
52
+            get { return _F_OperatContent; }
53
+        }
54
+        /// <summary>
55
+        /// 操作类型:查询表单
56
+        /// </summary>
57
+        public string F_OperatType
58
+        {
59
+            set { _F_OperatType = value; }
60
+            get { return _F_OperatType; }
61
+        }
62
+        /// <summary>
63
+        /// 操作成果(true,false)
64
+        /// </summary>
65
+        public string F_results
66
+        {
67
+            set { _F_results = value; }
68
+            get { return _F_results; }
69
+        }
70
+        /// <summary>
71
+        /// 操作结果(表单内容)
72
+        /// </summary>
73
+        public string F_resultsCOntent
74
+        {
75
+            set { _F_resultsCOntent = value; }
76
+            get { return _F_resultsCOntent; }
77
+        }
78
+
79
+        /// <summary>
80
+        /// 
81
+        /// </summary>
82
+        public int F_Id
83
+        {
84
+            set { _f_id = value; }
85
+            get { return _f_id; }
86
+        }
87
+        /// <summary>
88
+        /// 登记流水号
89
+        /// </summary>
90
+        public string F_WorkOrderId
91
+        {
92
+            set { _f_workorderid = value; }
93
+            get { return _f_workorderid; }
94
+        }
95
+        /// <summary>
96
+        /// 处理结果(反馈内容)
97
+        /// </summary>
98
+        public string F_Result
99
+        {
100
+            set { _f_result = value; }
101
+            get { return _f_result; }
102
+        }
103
+        /// <summary>
104
+        /// 反馈人工号
105
+        /// </summary>
106
+        public string F_Usercode
107
+        {
108
+            set { _f_usercode = value; }
109
+            get { return _f_usercode; }
110
+        }
111
+        /// <summary>
112
+        /// 承办人姓名
113
+        /// </summary>
114
+        public string F_dealman
115
+        {
116
+            set { _f_dealman = value; }
117
+            get { return _f_dealman; }
118
+        }
119
+        /// <summary>
120
+        /// 附件id,多个用英文逗号,隔开
121
+        /// </summary>
122
+        public string F_Files
123
+        {
124
+            set { _f_files = value; }
125
+            get { return _f_files; }
126
+        }
127
+        /// <summary>
128
+        /// 处理情况/方案/进程
129
+        /// </summary>
130
+        public string F_ProSituation
131
+        {
132
+            set { _f_prosituation = value; }
133
+            get { return _f_prosituation; }
134
+        }
135
+        /// <summary>
136
+        /// 承办人联系方式
137
+        /// </summary>
138
+        public string F_DealContact
139
+        {
140
+            set { _f_dealcontact = value; }
141
+            get { return _f_dealcontact; }
142
+        }
143
+        /// <summary>
144
+        /// 沟通时间
145
+        /// </summary>
146
+        public string F_ConnectTime
147
+        {
148
+            set { _f_connecttime = value; }
149
+            get { return _f_connecttime; }
150
+        }
151
+        /// <summary>
152
+        /// 沟通方式
153
+        /// </summary>
154
+        public string F_ConnectMode
155
+        {
156
+            set { _f_connectmode = value; }
157
+            get { return _f_connectmode; }
158
+        }
159
+        /// <summary>
160
+        /// 承办人职务
161
+        /// </summary>
162
+        public string F_Duties
163
+        {
164
+            set { _f_duties = value; }
165
+            get { return _f_duties; }
166
+        }
167
+        /// <summary>
168
+        /// 处理情况
169
+        /// </summary>
170
+        public string F_Situation
171
+        {
172
+            set { _f_situation = value; }
173
+            get { return _f_situation; }
174
+        }
175
+        /// <summary>
176
+        /// 0:草稿   1:正式
177
+        /// </summary>
178
+        public int? F_State
179
+        {
180
+            set { _f_state = value; }
181
+            get { return _f_state; }
182
+        }
183
+        /// <summary>
184
+        /// 反馈ID
185
+        /// </summary>
186
+        public int? F_FeedbackID
187
+        {
188
+            set { _f_feedbackid = value; }
189
+            get { return _f_feedbackid; }
190
+        }
191
+        /// <summary>
192
+        /// 是否有处理结果:0默认,1是,2否
193
+        /// </summary>
194
+        public int? F_IsProResult
195
+        {
196
+            set { _f_isproresult = value; }
197
+            get { return _f_isproresult; }
198
+        }
199
+        /// <summary>
200
+        /// 是否满意:0未评价,1满意,2基本满意,3不满意
201
+        /// </summary>
202
+        public int? F_IsSatisfied
203
+        {
204
+            set { _f_issatisfied = value; }
205
+            get { return _f_issatisfied; }
206
+        }
207
+        /// <summary>
208
+        /// uuid
209
+        /// </summary>
210
+        public string F_uuid
211
+        {
212
+            set { _f_uuid = value; }
213
+            get { return _f_uuid; }
214
+        }
215
+        /// <summary>
216
+        /// port_password
217
+        /// </summary>
218
+        public string F_port_password
219
+        {
220
+            set { _f_port_password = value; }
221
+            get { return _f_port_password; }
222
+        }
223
+        /// <summary>
224
+        /// MapID
225
+        /// </summary>
226
+        public int? F_MapID
227
+        {
228
+            set { _f_mapid = value; }
229
+            get { return _f_mapid; }
230
+        }
231
+        /// <summary>
232
+        /// 方向:receive send
233
+        /// </summary>
234
+        public string F_Direction
235
+        {
236
+            set { _f_direction = value; }
237
+            get { return _f_direction; }
238
+        }
239
+        /// <summary>
240
+        /// 添加时间
241
+        /// </summary>
242
+        public DateTime? F_AddTime
243
+        {
244
+            set { _f_addtime = value; }
245
+            get { return _f_addtime; }
246
+        }
247
+        /// <summary>
248
+        /// 消息内容
249
+        /// </summary>
250
+        public string F_Message
251
+        {
252
+            set { _f_message = value; }
253
+            get { return _f_message; }
254
+        }
255
+        #endregion Model
256
+    }
257
+}

+ 41 - 0
codegit/CallCenterCommon/CallCenter.Utility/log/LogInterface.cs

@@ -0,0 +1,41 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.IO;
4
+using System.Linq;
5
+using System.Text;
6
+using System.Threading.Tasks;
7
+
8
+namespace CallCenter.Utility.log
9
+{
10
+    public class LogInterface
11
+    {
12
+        //科大讯飞接口调用 日志
13
+        public static void WriteLog(string strLog)
14
+        {
15
+            //string sFilePath = System.Web.HttpContext.Current.Server.MapPath("\\Log\\" + DateTime.Now.ToString("yyyyMM"));
16
+            string sFilePath = "D:\\CallCenter_log\\LogInterface\\" + DateTime.Now.ToString("yyyy-MM");
17
+            string sFileName = "" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt";
18
+            sFileName = sFilePath + "\\" + sFileName; //文件的绝对路径
19
+            if (!Directory.Exists(sFilePath))//验证路径是否存在
20
+            {
21
+                Directory.CreateDirectory(sFilePath);
22
+                //不存在则创建
23
+            }
24
+            FileStream fs;
25
+            StreamWriter sw;
26
+            if (File.Exists(sFileName))
27
+            //验证文件是否存在,有则追加,无则创建
28
+            {
29
+                fs = new FileStream(sFileName, FileMode.Append, FileAccess.Write);
30
+            }
31
+            else
32
+            {
33
+                fs = new FileStream(sFileName, FileMode.Create, FileAccess.Write);
34
+            }
35
+            sw = new StreamWriter(fs);
36
+            sw.WriteLine("记录时间:[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "] -- "+ RequestString.GetIP() + "  " + strLog + "\r\n");
37
+            sw.Close();
38
+            fs.Close();
39
+        }
40
+    }
41
+}