Просмотр исходного кода

Merge branch 'master' of http://192.168.1.222:3000/duhongyu/Anyang_api

duhongyu лет назад: 4
Родитель
Сommit
1b2b700a48

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

@@ -120,6 +120,7 @@
120 120
     <Compile Include="T_Repository_List_log.cs" />
121 121
     <Compile Include="T_Repository_Operation.cs" />
122 122
     <Compile Include="T_SMS_InternalMessages.cs" />
123
+    <Compile Include="T_SMS_Receive.cs" />
123 124
     <Compile Include="T_SMS_RecvSMS.cs" />
124 125
     <Compile Include="T_SMS_SendSMSTask.cs" />
125 126
     <Compile Include="T_SMS_SentSMS.cs" />

+ 128 - 0
CallCenterApi/CallCenterApi.BLL/T_SMS_Receive.cs

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

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

@@ -120,6 +120,7 @@
120 120
     <Compile Include="T_Repository_List_log.cs" />
121 121
     <Compile Include="T_Repository_Operation.cs" />
122 122
     <Compile Include="T_SMS_InternalMessages.cs" />
123
+    <Compile Include="T_SMS_Receive.cs" />
123 124
     <Compile Include="T_SMS_RecvSMS.cs" />
124 125
     <Compile Include="T_SMS_SendSMSTask.cs" />
125 126
     <Compile Include="T_SMS_SentSMS.cs" />

+ 291 - 0
CallCenterApi/CallCenterApi.DAL/T_SMS_Receive.cs

@@ -0,0 +1,291 @@
1
+using System;
2
+using System.Data;
3
+using System.Text;
4
+using System.Data.SqlClient;
5
+using CallCenterApi.DB;
6
+
7
+namespace CallCenterApi.DAL
8
+{
9
+    /// <summary>
10
+    /// 数据访问类:T_SMS_Receive
11
+    /// </summary>
12
+    public partial class T_SMS_Receive
13
+    {
14
+        public T_SMS_Receive()
15
+        { }
16
+        #region  BasicMethod
17
+        /// <summary>
18
+        /// 是否存在该记录
19
+        /// </summary>
20
+        public bool Exists(int F_Id)
21
+        {
22
+            StringBuilder strSql = new StringBuilder();
23
+            strSql.Append("select count(1) from T_SMS_Receive with(nolock)");
24
+            strSql.Append(" where F_Id=@F_Id");
25
+            SqlParameter[] parameters = {
26
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
27
+            };
28
+            parameters[0].Value = F_Id;
29
+
30
+            return DbHelperSQL.Exists(strSql.ToString(), parameters);
31
+        }
32
+
33
+
34
+        /// <summary>
35
+        /// 增加一条数据
36
+        /// </summary>
37
+        public int Add(CallCenterApi.Model.T_SMS_Receive model)
38
+        {
39
+            StringBuilder strSql = new StringBuilder();
40
+            strSql.Append("insert into T_SMS_Receive(");
41
+            strSql.Append("F_Telephone,F_Content,F_Time,F_ApiKey,F_AccessNo,F_State,F_CreateTime)");
42
+            strSql.Append(" values (");
43
+            strSql.Append("@F_Telephone,@F_Content,@F_Time,@F_ApiKey,@F_AccessNo,@F_State,@F_CreateTime)");
44
+            strSql.Append(";select @@IDENTITY");
45
+            SqlParameter[] parameters = {
46
+                    new SqlParameter("@F_Telephone", SqlDbType.VarChar,20),
47
+                    new SqlParameter("@F_Content", SqlDbType.NVarChar,1000),
48
+                    new SqlParameter("@F_Time", SqlDbType.DateTime),
49
+                    new SqlParameter("@F_ApiKey", SqlDbType.VarChar,50),
50
+                    new SqlParameter("@F_AccessNo", SqlDbType.VarChar,20),
51
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
52
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime)};
53
+            parameters[0].Value = model.F_Telephone;
54
+            parameters[1].Value = model.F_Content;
55
+            parameters[2].Value = model.F_Time;
56
+            parameters[3].Value = model.F_ApiKey;
57
+            parameters[4].Value = model.F_AccessNo;
58
+            parameters[5].Value = model.F_State;
59
+            parameters[6].Value = model.F_CreateTime;
60
+
61
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
62
+            if (obj == null)
63
+            {
64
+                return 0;
65
+            }
66
+            else
67
+            {
68
+                return Convert.ToInt32(obj);
69
+            }
70
+        }
71
+        /// <summary>
72
+        /// 更新一条数据
73
+        /// </summary>
74
+        public bool Update(CallCenterApi.Model.T_SMS_Receive model)
75
+        {
76
+            StringBuilder strSql = new StringBuilder();
77
+            strSql.Append("update T_SMS_Receive set ");
78
+            strSql.Append("F_Telephone=@F_Telephone,");
79
+            strSql.Append("F_Content=@F_Content,");
80
+            strSql.Append("F_Time=@F_Time,");
81
+            strSql.Append("F_ApiKey=@F_ApiKey,");
82
+            strSql.Append("F_AccessNo=@F_AccessNo,");
83
+            strSql.Append("F_State=@F_State,");
84
+            strSql.Append("F_CreateTime=@F_CreateTime");
85
+            strSql.Append(" where F_Id=@F_Id");
86
+            SqlParameter[] parameters = {
87
+                    new SqlParameter("@F_Telephone", SqlDbType.VarChar,20),
88
+                    new SqlParameter("@F_Content", SqlDbType.NVarChar,1000),
89
+                    new SqlParameter("@F_Time", SqlDbType.DateTime),
90
+                    new SqlParameter("@F_ApiKey", SqlDbType.VarChar,50),
91
+                    new SqlParameter("@F_AccessNo", SqlDbType.VarChar,20),
92
+                    new SqlParameter("@F_State", SqlDbType.Int,4),
93
+                    new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
94
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)};
95
+            parameters[0].Value = model.F_Telephone;
96
+            parameters[1].Value = model.F_Content;
97
+            parameters[2].Value = model.F_Time;
98
+            parameters[3].Value = model.F_ApiKey;
99
+            parameters[4].Value = model.F_AccessNo;
100
+            parameters[5].Value = model.F_State;
101
+            parameters[6].Value = model.F_CreateTime;
102
+            parameters[7].Value = model.F_Id;
103
+
104
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
105
+            if (rows > 0)
106
+            {
107
+                return true;
108
+            }
109
+            else
110
+            {
111
+                return false;
112
+            }
113
+        }
114
+
115
+        /// <summary>
116
+        /// 删除一条数据
117
+        /// </summary>
118
+        public bool Delete(int F_Id)
119
+        {
120
+
121
+            StringBuilder strSql = new StringBuilder();
122
+            strSql.Append("delete from T_SMS_Receive ");
123
+            strSql.Append(" where F_Id=@F_Id");
124
+            SqlParameter[] parameters = {
125
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
126
+            };
127
+            parameters[0].Value = F_Id;
128
+
129
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
130
+            if (rows > 0)
131
+            {
132
+                return true;
133
+            }
134
+            else
135
+            {
136
+                return false;
137
+            }
138
+        }
139
+        /// <summary>
140
+        /// 批量删除数据
141
+        /// </summary>
142
+        public bool DeleteList(string F_Idlist)
143
+        {
144
+            StringBuilder strSql = new StringBuilder();
145
+            strSql.Append("delete from T_SMS_Receive ");
146
+            strSql.Append(" where F_Id in (" + F_Idlist + ")  ");
147
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
148
+            if (rows > 0)
149
+            {
150
+                return true;
151
+            }
152
+            else
153
+            {
154
+                return false;
155
+            }
156
+        }
157
+
158
+
159
+        /// <summary>
160
+        /// 得到一个对象实体
161
+        /// </summary>
162
+        public CallCenterApi.Model.T_SMS_Receive GetModel(int F_Id)
163
+        {
164
+
165
+            StringBuilder strSql = new StringBuilder();
166
+            strSql.Append("select  top 1 F_Id,F_Telephone,F_Content,F_Time,F_ApiKey,F_AccessNo,F_State,F_CreateTime from T_SMS_Receive with(nolock)");
167
+            strSql.Append(" where F_Id=@F_Id");
168
+            SqlParameter[] parameters = {
169
+                    new SqlParameter("@F_Id", SqlDbType.Int,4)
170
+            };
171
+            parameters[0].Value = F_Id;
172
+
173
+            CallCenterApi.Model.T_SMS_Receive model = new CallCenterApi.Model.T_SMS_Receive();
174
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
175
+            if (ds.Tables[0].Rows.Count > 0)
176
+            {
177
+                return DataRowToModel(ds.Tables[0].Rows[0]);
178
+            }
179
+            else
180
+            {
181
+                return null;
182
+            }
183
+        }
184
+
185
+
186
+        /// <summary>
187
+        /// 得到一个对象实体
188
+        /// </summary>
189
+        public CallCenterApi.Model.T_SMS_Receive DataRowToModel(DataRow row)
190
+        {
191
+            CallCenterApi.Model.T_SMS_Receive model = new CallCenterApi.Model.T_SMS_Receive();
192
+            if (row != null)
193
+            {
194
+                if (row["F_Id"] != null && row["F_Id"].ToString() != "")
195
+                {
196
+                    model.F_Id = int.Parse(row["F_Id"].ToString());
197
+                }
198
+                if (row["F_Telephone"] != null)
199
+                {
200
+                    model.F_Telephone = row["F_Telephone"].ToString();
201
+                }
202
+                if (row["F_Content"] != null)
203
+                {
204
+                    model.F_Content = row["F_Content"].ToString();
205
+                }
206
+                if (row["F_Time"] != null && row["F_Time"].ToString() != "")
207
+                {
208
+                    model.F_Time = DateTime.Parse(row["F_Time"].ToString());
209
+                }
210
+                if (row["F_ApiKey"] != null)
211
+                {
212
+                    model.F_ApiKey = row["F_ApiKey"].ToString();
213
+                }
214
+                if (row["F_AccessNo"] != null)
215
+                {
216
+                    model.F_AccessNo = row["F_AccessNo"].ToString();
217
+                }
218
+                if (row["F_State"] != null && row["F_State"].ToString() != "")
219
+                {
220
+                    model.F_State = int.Parse(row["F_State"].ToString());
221
+                }
222
+                if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
223
+                {
224
+                    model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
225
+                }
226
+            }
227
+            return model;
228
+        }
229
+
230
+        /// <summary>
231
+        /// 获得数据列表
232
+        /// </summary>
233
+        public DataSet GetList(string strWhere)
234
+        {
235
+            StringBuilder strSql = new StringBuilder();
236
+            strSql.Append("select F_Id,F_Telephone,F_Content,F_Time,F_ApiKey,F_AccessNo,F_State,F_CreateTime ");
237
+            strSql.Append(" FROM T_SMS_Receive with(nolock)");
238
+            if (strWhere.Trim() != "")
239
+            {
240
+                strSql.Append(" where " + strWhere);
241
+            }
242
+            return DbHelperSQL.Query(strSql.ToString());
243
+        }
244
+
245
+        /// <summary>
246
+        /// 获得前几行数据
247
+        /// </summary>
248
+        public DataSet GetList(int Top, string strWhere, string filedOrder)
249
+        {
250
+            StringBuilder strSql = new StringBuilder();
251
+            strSql.Append("select ");
252
+            if (Top > 0)
253
+            {
254
+                strSql.Append(" top " + Top.ToString());
255
+            }
256
+            strSql.Append(" F_Id,F_Telephone,F_Content,F_Time,F_ApiKey,F_AccessNo,F_State,F_CreateTime ");
257
+            strSql.Append(" FROM T_SMS_Receive with(nolock)");
258
+            if (strWhere.Trim() != "")
259
+            {
260
+                strSql.Append(" where " + strWhere);
261
+            }
262
+            strSql.Append(" order by " + filedOrder);
263
+            return DbHelperSQL.Query(strSql.ToString());
264
+        }
265
+
266
+        /// <summary>
267
+        /// 获取记录总数
268
+        /// </summary>
269
+        public int GetRecordCount(string strWhere)
270
+        {
271
+            StringBuilder strSql = new StringBuilder();
272
+            strSql.Append("select count(1) FROM T_SMS_Receive with(nolock)");
273
+            if (strWhere.Trim() != "")
274
+            {
275
+                strSql.Append(" where " + strWhere);
276
+            }
277
+            object obj = DbHelperSQL.GetSingle(strSql.ToString());
278
+            if (obj == null)
279
+            {
280
+                return 0;
281
+            }
282
+            else
283
+            {
284
+                return Convert.ToInt32(obj);
285
+            }
286
+        }
287
+
288
+        #endregion  BasicMethod
289
+    }
290
+}
291
+

+ 66 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Sms/SmsNewController.cs

@@ -1,7 +1,9 @@
1
-using CallCenterApi.Interface.Controllers.Base;
1
+using CallCenter.Utility;
2
+using CallCenterApi.Interface.Controllers.Base;
2 3
 using CallCenterApi.Interface.Models.Input;
3 4
 using System;
4 5
 using System.Collections.Generic;
6
+using System.Data;
5 7
 using System.Linq;
6 8
 using System.Web;
7 9
 using System.Web.Mvc;
@@ -23,8 +25,71 @@ namespace CallCenterApi.Interface.Controllers.Sms
23 25
         /// <returns></returns>
24 26
         public ActionResult Receive(SmsInput data)
25 27
         {
28
+            LogFactory.GetLogger("SmsNew/Receive").Debug(data.ToJson());
26 29
             //存入数据库
30
+            if (data != null && data.data!=null && data.data.Count>0)
31
+            {
32
+                foreach (var item in data.data)
33
+                {
34
+                    Model.T_SMS_Receive model = new Model.T_SMS_Receive();
35
+                    model.F_Telephone = item.tel;
36
+                    model.F_Content = item.content;
37
+                    DateTime dt = DateTime.ParseExact(item.arriveTime, "yyMMddHHmm", System.Globalization.CultureInfo.CurrentCulture);
38
+                    model.F_Time = dt;
39
+                    model.F_State = 0;
40
+                    model.F_CreateTime = DateTime.Now;
41
+                    new BLL.T_SMS_Receive().Add(model);
42
+                }
43
+            }
27 44
             return Content("");
28 45
         }
46
+
47
+        /// <summary>
48
+        /// 获取接收短信列表
49
+        /// </summary>
50
+        /// <returns></returns>
51
+        public ActionResult GetReceiveList(string tel, string content, string starttime,string endtime, int page =1,int pagesize=10)
52
+        {
53
+            string sql = "";
54
+            DataTable dt = new DataTable();
55
+
56
+
57
+            if (tel!=null&& tel.Trim() != "" && tel != "undefined")
58
+            {
59
+                sql += " and F_Telephone= '" + tel.Trim() + "' ";
60
+            }
61
+            if (content != null && content.Trim() != "" && content != "undefined")
62
+            {
63
+                sql += " and F_Content like '%" + content.Trim() + "%' ";
64
+            }
65
+            if (starttime != null && starttime.Trim() != "" && starttime != "undefined")
66
+            {
67
+                sql += " and F_CreateTime >= '" + Convert.ToDateTime(starttime.Trim()) + "' ";
68
+            }
69
+            if (endtime != null && endtime.Trim() != "" && endtime != "undefined")
70
+            {
71
+                sql += " and F_CreateTime <= '" + Convert.ToDateTime(endtime.Trim()) + "' ";
72
+            }
73
+
74
+            int recordCount = 0;
75
+            dt = BLL.PagerBLL.GetListPager(
76
+                "T_SMS_Receive",
77
+                "F_Id",
78
+                "*",
79
+                sql,
80
+                "ORDER BY F_Id desc",
81
+                pagesize,
82
+                page,
83
+                true,
84
+                out recordCount);
85
+
86
+            var obj = new
87
+            {
88
+                rows = dt,
89
+                total = recordCount
90
+            };
91
+            
92
+            return Content(obj.ToJson());
93
+        }
29 94
     }
30 95
 }

+ 88 - 86
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -11017,7 +11017,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
11017 11017
                 if (limittime > 0)
11018 11018
                 {
11019 11019
                     string resdate = DateTime.Now.Date.ToString("yyyy-MM-dd");
11020
-                    DataTable dt = DbHelperSQL.Query("select top " + limittime + " F_OffDate from  T_Sys_WorkOFFDays  where F_OffState = 1   and F_OffDate>'" + resdate + "' order by F_OffDate").Tables[0];
11020
+                    DataTable dt = DbHelperSQL.Query("select top " + limittime + " F_OffDate from  T_Sys_WorkOFFDays  with(nolock) where F_OffState = 1   and F_OffDate>'" + resdate + "' order by F_OffDate").Tables[0];
11021 11021
                     resdatetime = dt.Rows[dt.Rows.Count - 1]["F_OffDate"].ToString();
11022 11022
                 }
11023 11023
                 resdatetime = Convert.ToDateTime(resdatetime).ToString("yyyy-MM-dd") + " 23:59:59 ";
@@ -11060,7 +11060,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
11060 11060
 
11061 11061
                 string userinfo = User.depname + "(" + User.F_UserCode + ")";
11062 11062
                 Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = workorderBLL.GetModel(workorderid);
11063
-                Model.T_Bus_WorkOrder tempT_Bus_WorkOrder = workorderBLL.GetModel(workorderid);
11063
+                Model.T_Bus_WorkOrder tempT_Bus_WorkOrder = modelT_Bus_WorkOrder.ToJson().ToObject<Model.T_Bus_WorkOrder>();
11064 11064
                 Model.T_Bus_AssignedInfo modelT_Bus_AssignedInfo = new Model.T_Bus_AssignedInfo();
11065 11065
                 if (modelT_Bus_WorkOrder != null && deptlist != null && deptlist.Count > 0)
11066 11066
                 {
@@ -11146,7 +11146,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
11146 11146
 
11147 11147
                                 #endregion
11148 11148
                             }
11149
-                            if (modelT_Bus_AssignedInfo != null && modelT_Bus_AssignedInfo.F_State == 1)
11149
+
11150
+                            trans.Complete();
11151
+                        }
11152
+                        if (modelT_Bus_AssignedInfo != null && modelT_Bus_AssignedInfo.F_State == 1)
11153
+                        {
11154
+                            Task.Run(() =>
11150 11155
                             {
11151 11156
                                 #region 保存工单信息
11152 11157
                                 modelT_Bus_WorkOrder.F_WorkState = (int)EnumWorkState.receive;//待查收
@@ -11158,12 +11163,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
11158 11163
                                 {
11159 11164
                                     modelT_Bus_WorkOrder.F_LimitTime = Convert.ToDateTime(resdatetime);
11160 11165
                                 }
11161
-                                if (maindept.F_IsDept ==2)
11162
-                                modelT_Bus_WorkOrder.F_MainDeptId = premodeldept .F_DeptId;
11166
+                                if (maindept.F_IsDept == 2)
11167
+                                    modelT_Bus_WorkOrder.F_MainDeptId = premodeldept.F_DeptId;
11163 11168
                                 else
11164 11169
                                     modelT_Bus_WorkOrder.F_MainDeptId = maindept.F_DeptId;
11165 11170
                                 modelT_Bus_WorkOrder.F_OtherDeptIds = otherdeptids;
11166
-                                modelT_Bus_WorkOrder.F_AssignUser = User.F_UserCode;
11171
+                                modelT_Bus_WorkOrder.F_AssignUser = curuser.F_UserCode;
11167 11172
                                 modelT_Bus_WorkOrder.F_AssignTime = DateTime.Now;
11168 11173
                                 if (maindept.F_IsDept == 2)
11169 11174
                                     modelT_Bus_WorkOrder.F_WorkState = 4;
@@ -11172,98 +11177,95 @@ namespace CallCenterApi.Interface.Controllers.workorder
11172 11177
                                 workorderBLL.Update(modelT_Bus_WorkOrder);
11173 11178
 
11174 11179
                                 #endregion
11175
-                            }
11176
-                            trans.Complete();
11177
-                        }
11178
-                        if (modelT_Bus_AssignedInfo != null && modelT_Bus_AssignedInfo.F_State == 1)
11179
-                        {
11180
-                            string DeptName = "";
11181
-                            if (maindept.F_IsDept == 2)
11182
-                            {
11183
-                                DeptName = premodeldept .F_DeptName;
11184
-                            }
11185
-                            else
11186
-                                DeptName = maindept.F_DeptName;
11187
-                                                            var msgss = userinfo + " 交办了工单,主办单位:" + DeptName;
11188
-                            if (!string.IsNullOrEmpty(otherdeptids))
11189
-                            {
11190
-                                string sql = "select dbo.GetDeptNames('" + otherdeptids + "')";
11191
-                                msgss += ",协办单位:" + DbHelperSQL.GetSingle(sql);
11192
-                            }
11193
-                         
11194
-                            if (maindept.F_IsDept == 2)
11180
+                            }).ContinueWith(q =>
11195 11181
                             {
11196
-                                addoptlog(modelT_Bus_WorkOrder.F_WorkOrderId, modelT_Bus_WorkOrder.F_WorkState, modelT_Bus_AssignedInfo.F_Id, msgss, curuser.F_UserCode);
11197
-                                SplitOrderNew(modelT_Bus_WorkOrder, maindept, Convert.ToDateTime(resdatetime), modelT_Bus_AssignedInfo, assignedopinion, curuser).ContinueWith(p =>
11182
+                                LogFactory.GetLogger("test").Error("2-" + modelT_Bus_WorkOrder.ToJson());
11183
+                                string DeptName = "";
11184
+                                if (maindept.F_IsDept == 2)
11198 11185
                                 {
11199
-                                    
11200
-                                }).ContinueWith(p =>
11186
+                                    DeptName = premodeldept.F_DeptName;
11187
+                                }
11188
+                                else
11189
+                                    DeptName = maindept.F_DeptName;
11190
+
11191
+                                var msgss = userinfo + " 交办了工单,主办单位:" + DeptName;
11192
+                                if (!string.IsNullOrEmpty(otherdeptids))
11201 11193
                                 {
11202
-                                    System.Diagnostics.Debug.WriteLine(DateTime.Now);
11203
-                                });
11204
-                            }
11205
-                            else
11206
-                            {
11207
-                                Task.Run(() =>
11194
+                                    string sql = "select dbo.GetDeptNames('" + otherdeptids + "')";
11195
+                                    msgss += ",协办单位:" + DbHelperSQL.GetSingle(sql);
11196
+                                }
11197
+
11198
+                                if (maindept.F_IsDept == 2)
11208 11199
                                 {
11209 11200
                                     addoptlog(modelT_Bus_WorkOrder.F_WorkOrderId, modelT_Bus_WorkOrder.F_WorkState, modelT_Bus_AssignedInfo.F_Id, msgss, curuser.F_UserCode);
11210
-                                }).ContinueWith(p =>
11211
-                                {
11212
-                                    System.Diagnostics.Debug.WriteLine(DateTime.Now);
11213
-                                });
11214
-                            }
11215
-
11216
-                            Task.Run(() =>
11217
-                            {
11218
-                                #region 删除草稿信息
11219
-                                var cglist = assignBLL.GetModelList(" F_IsDelete=0 and F_State=0 and F_WorkOrderId='" + modelT_Bus_WorkOrder.F_WorkOrderId + "'");
11220
-
11221
-                                foreach (var cg in cglist)
11201
+                                    SplitOrderNew(modelT_Bus_WorkOrder, maindept, Convert.ToDateTime(resdatetime), modelT_Bus_AssignedInfo, assignedopinion, curuser).ContinueWith(p =>
11202
+                                    {
11203
+                                        System.Diagnostics.Debug.WriteLine(DateTime.Now);
11204
+                                    });
11205
+                                }
11206
+                                else
11222 11207
                                 {
11223
-                                    cg.F_IsDelete = 1;
11224
-                                    cg.F_DeleteUser = curuser.F_UserCode;
11225
-                                    cg.F_DeleteTime = DateTime.Now;
11226
-
11227
-                                    assignBLL.Update(cg);
11208
+                                    Task.Run(() =>
11209
+                                    {
11210
+                                        addoptlog(modelT_Bus_WorkOrder.F_WorkOrderId, modelT_Bus_WorkOrder.F_WorkState, modelT_Bus_AssignedInfo.F_Id, msgss, curuser.F_UserCode);
11211
+                                    }).ContinueWith(p =>
11212
+                                    {
11213
+                                        System.Diagnostics.Debug.WriteLine(DateTime.Now);
11214
+                                    });
11228 11215
                                 }
11229
-                                #endregion
11230
-                            }).ContinueWith(p =>
11231
-                            {
11232
-                                System.Diagnostics.Debug.WriteLine(DateTime.Now);
11233
-                            });
11234 11216
 
11235
-                            Task.Run(() =>
11236
-                            {
11237
-                                #region 插入推送消息
11238
-                                if (maindept.F_IsDept ==2)
11217
+                                Task.Run(() =>
11239 11218
                                 {
11240
-                                    var users = userBLL.GetModelList(" F_DeptId='" + premodeldept .F_DeptId + "' ");
11219
+                                    #region 删除草稿信息
11220
+                                    var cglist = assignBLL.GetModelList(" F_IsDelete=0 and F_State=0 and F_WorkOrderId='" + modelT_Bus_WorkOrder.F_WorkOrderId + "'");
11241 11221
 
11242
-                                    foreach (var u in users)
11222
+                                    foreach (var cg in cglist)
11243 11223
                                     {
11244
-                                        string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
11245
-                                        string msgcount = modelT_Bus_WorkOrder.F_WorkOrderId;
11246
-                                        bool n = SMSController.AddSmS(0, msgcount, count, u.F_Mobile, "153305", "");
11247
-                                        msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
11224
+                                        cg.F_IsDelete = 1;
11225
+                                        cg.F_DeleteUser = curuser.F_UserCode;
11226
+                                        cg.F_DeleteTime = DateTime.Now;
11227
+
11228
+                                        assignBLL.Update(cg);
11248 11229
                                     }
11249
-                                }
11250
-                                else
11230
+                                    #endregion
11231
+                                }).ContinueWith(p =>
11251 11232
                                 {
11252
-                                    var users = userBLL.GetModelList(" F_DeptId='" + maindept.F_DeptId + "' ");
11233
+                                    System.Diagnostics.Debug.WriteLine(DateTime.Now);
11234
+                                });
11253 11235
 
11254
-                                    foreach (var u in users)
11236
+                                Task.Run(() =>
11237
+                                {
11238
+                                    #region 插入推送消息
11239
+                                    if (maindept.F_IsDept == 2)
11255 11240
                                     {
11256
-                                        string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
11257
-                                        string msgcount = modelT_Bus_WorkOrder.F_WorkOrderId;
11258
-                                        bool n = SMSController.AddSmS(0, msgcount, count, u.F_Mobile, "153305", "");
11259
-                                        msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
11241
+                                        var users = userBLL.GetModelList(" F_DeptId='" + premodeldept.F_DeptId + "' ");
11242
+
11243
+                                        foreach (var u in users)
11244
+                                        {
11245
+                                            string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
11246
+                                            string msgcount = modelT_Bus_WorkOrder.F_WorkOrderId;
11247
+                                            bool n = SMSController.AddSmS(0, msgcount, count, u.F_Mobile, "153305", "");
11248
+                                            msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
11249
+                                        }
11260 11250
                                     }
11261
-                                }
11262
-                               
11263
-                                #endregion
11264
-                            }).ContinueWith(p =>
11265
-                            {
11266
-                                System.Diagnostics.Debug.WriteLine(DateTime.Now);
11251
+                                    else
11252
+                                    {
11253
+                                        var users = userBLL.GetModelList(" F_DeptId='" + maindept.F_DeptId + "' ");
11254
+
11255
+                                        foreach (var u in users)
11256
+                                        {
11257
+                                            string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
11258
+                                            string msgcount = modelT_Bus_WorkOrder.F_WorkOrderId;
11259
+                                            bool n = SMSController.AddSmS(0, msgcount, count, u.F_Mobile, "153305", "");
11260
+                                            msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
11261
+                                        }
11262
+                                    }
11263
+
11264
+                                    #endregion
11265
+                                }).ContinueWith(p =>
11266
+                                {
11267
+                                    System.Diagnostics.Debug.WriteLine(DateTime.Now);
11268
+                                });
11267 11269
                             });
11268 11270
                         }
11269 11271
                         return Success("操作成功", modelT_Bus_AssignedInfo.F_Id);
@@ -12098,9 +12100,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
12098 12100
                     modelT_Bus_AssignedInfo_Next.F_IsOverdue = 0;
12099 12101
                     modelT_Bus_AssignedInfo_Next.F_IsSure = 0;
12100 12102
                     modelT_Bus_AssignedInfo_Next.F_IsReload = 0;
12101
-                    modelT_Bus_AssignedInfo.F_IsNext = 1;
12102
-                    modelT_Bus_AssignedInfo.F_NextUser = User.F_UserCode;
12103
-                    modelT_Bus_AssignedInfo.F_NextTime = DateTime.Now;
12103
+                    
12104 12104
                     modelT_Bus_AssignedInfo_Next.F_Id = new BLL.T_Bus_AssignedInfo_Next().Add(modelT_Bus_AssignedInfo_Next);
12105 12105
                     #endregion
12106 12106
 
@@ -12115,7 +12115,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
12115 12115
                             modelT_Bus_WorkOrder.F_WorkState = 4;
12116 12116
                             new BLL.T_Bus_WorkOrder ().Update(modelT_Bus_WorkOrder);
12117 12117
 
12118
-                           
12118
+                            modelT_Bus_AssignedInfo.F_IsNext = 1;
12119
+                            modelT_Bus_AssignedInfo.F_NextUser = User.F_UserCode;
12120
+                            modelT_Bus_AssignedInfo.F_NextTime = DateTime.Now;
12119 12121
                             new BLL.T_Bus_AssignedInfo ().Update(modelT_Bus_AssignedInfo);
12120 12122
                             #endregion
12121 12123
                         });

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

@@ -88,6 +88,7 @@
88 88
     <Compile Include="T_Repository_List_Demands.cs" />
89 89
     <Compile Include="T_Repository_List_log.cs" />
90 90
     <Compile Include="T_Repository_Operation.cs" />
91
+    <Compile Include="T_SMS_Receive.cs" />
91 92
     <Compile Include="T_Sys_Achievements.cs" />
92 93
     <Compile Include="T_Sys_Class.cs" />
93 94
     <Compile Include="T_Msg_Chat.cs" />

+ 89 - 0
CallCenterApi/CallCenterApi.Model/T_SMS_Receive.cs

@@ -0,0 +1,89 @@
1
+using System;
2
+namespace CallCenterApi.Model
3
+{
4
+    /// <summary>
5
+    /// T_SMS_Receive:实体类(属性说明自动提取数据库字段的描述信息)
6
+    /// </summary>
7
+    [Serializable]
8
+    public partial class T_SMS_Receive
9
+    {
10
+        public T_SMS_Receive()
11
+        { }
12
+        #region Model
13
+        private int _f_id;
14
+        private string _f_telephone;
15
+        private string _f_content;
16
+        private DateTime? _f_time;
17
+        private string _f_apikey;
18
+        private string _f_accessno;
19
+        private int? _f_state;
20
+        private DateTime? _f_createtime;
21
+        /// <summary>
22
+        /// 
23
+        /// </summary>
24
+        public int F_Id
25
+        {
26
+            set { _f_id = value; }
27
+            get { return _f_id; }
28
+        }
29
+        /// <summary>
30
+        /// 
31
+        /// </summary>
32
+        public string F_Telephone
33
+        {
34
+            set { _f_telephone = value; }
35
+            get { return _f_telephone; }
36
+        }
37
+        /// <summary>
38
+        /// 
39
+        /// </summary>
40
+        public string F_Content
41
+        {
42
+            set { _f_content = value; }
43
+            get { return _f_content; }
44
+        }
45
+        /// <summary>
46
+        /// 
47
+        /// </summary>
48
+        public DateTime? F_Time
49
+        {
50
+            set { _f_time = value; }
51
+            get { return _f_time; }
52
+        }
53
+        /// <summary>
54
+        /// 
55
+        /// </summary>
56
+        public string F_ApiKey
57
+        {
58
+            set { _f_apikey = value; }
59
+            get { return _f_apikey; }
60
+        }
61
+        /// <summary>
62
+        /// 
63
+        /// </summary>
64
+        public string F_AccessNo
65
+        {
66
+            set { _f_accessno = value; }
67
+            get { return _f_accessno; }
68
+        }
69
+        /// <summary>
70
+        /// 
71
+        /// </summary>
72
+        public int? F_State
73
+        {
74
+            set { _f_state = value; }
75
+            get { return _f_state; }
76
+        }
77
+        /// <summary>
78
+        /// 
79
+        /// </summary>
80
+        public DateTime? F_CreateTime
81
+        {
82
+            set { _f_createtime = value; }
83
+            get { return _f_createtime; }
84
+        }
85
+        #endregion Model
86
+
87
+    }
88
+}
89
+