Quellcode durchsuchen

微信管理,短信管理

zhupei vor 4 Jahren
Ursprung
Commit
262cb1ec31

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

@@ -52,6 +52,7 @@
52 52
     <Compile Include="his\sf_yihuxx.cs" />
53 53
     <Compile Include="his\o_sf_zhenduan.cs" />
54 54
     <Compile Include="his\sf_zhenduan.cs" />
55
+    <Compile Include="NewsMassge.cs" />
55 56
     <Compile Include="orders.cs" />
56 57
     <Compile Include="PagerBLL.cs" />
57 58
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -145,6 +146,7 @@
145 146
     <Compile Include="T_Wo_WorkOrder_Logs.cs" />
146 147
     <Compile Include="T_Wo_WorkOrder_Que_Map.cs" />
147 148
     <Compile Include="UserAccount.cs" />
149
+    <Compile Include="UserLeaveMes.cs" />
148 150
   </ItemGroup>
149 151
   <ItemGroup>
150 152
     <ProjectReference Include="..\CallCenterApi.DAL\CallCenterApi.DAL.csproj">

+ 56 - 0
codegit/CallCenterApi/CallCenterApi.BLL/NewsMassge.cs

@@ -0,0 +1,56 @@
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
+namespace CallCenterApi.BLL
8
+{
9
+   public partial class NewsMassge
10
+    {
11
+        private readonly CallCenterApi.DAL.NewsMassge dal = new CallCenterApi.DAL.NewsMassge();
12
+        public NewsMassge()
13
+        { }
14
+        /// <summary>
15
+        /// 增加一条数据
16
+        /// </summary>
17
+        public int Add(CallCenterApi.Model.NewsMassge model)
18
+        {
19
+            return dal.Add(model);
20
+
21
+        }
22
+ 
23
+
24
+        /// <summary>
25
+        /// 更新一条数据
26
+        /// </summary>
27
+        public bool Update(CallCenterApi.Model.NewsMassge model)
28
+        {
29
+            return dal.Update(model);
30
+        }
31
+        /// <summary>
32
+        /// 得到一个对象实体
33
+        /// </summary>
34
+        public CallCenterApi.Model.NewsMassge GetModel(int ID)
35
+        {
36
+
37
+            return dal.GetModel(ID);
38
+        }
39
+        /// <summary>
40
+        /// 删除一条数据
41
+        /// </summary>
42
+        public bool Delete(int ID)
43
+        {
44
+
45
+            return dal.Delete(ID);
46
+        }
47
+        /// <summary>
48
+        /// 删除一条数据
49
+        /// </summary>
50
+        public bool DeleteList(string IDlist)
51
+        {
52
+            return dal.DeleteList(IDlist);
53
+        }
54
+
55
+    }
56
+}

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.BLL/T_SMS_Template.cs

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
7 7
 
8 8
 namespace CallCenterApi.BLL
9 9
 {
10
-    class T_SMS_Template
10
+    public partial class T_SMS_Template
11 11
     {
12 12
         private readonly CallCenterApi.DAL.T_SMS_Template dal = new CallCenterApi.DAL.T_SMS_Template();
13 13
         public T_SMS_Template()

+ 30 - 0
codegit/CallCenterApi/CallCenterApi.BLL/UserLeaveMes.cs

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

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

@@ -53,6 +53,7 @@
53 53
     <Compile Include="his\sf_shoushuxx.cs" />
54 54
     <Compile Include="his\sf_yihuxx.cs" />
55 55
     <Compile Include="his\sf_zhenduan.cs" />
56
+    <Compile Include="NewsMassge.cs" />
56 57
     <Compile Include="orders.cs" />
57 58
     <Compile Include="PagerDAL.cs" />
58 59
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -146,6 +147,7 @@
146 147
     <Compile Include="T_Wo_WorkOrder_Logs.cs" />
147 148
     <Compile Include="T_Wo_WorkOrder_Que_Map.cs" />
148 149
     <Compile Include="UserAccount.cs" />
150
+    <Compile Include="UserLeaveMes.cs" />
149 151
   </ItemGroup>
150 152
   <ItemGroup>
151 153
     <ProjectReference Include="..\CallCenterApi.DB\CallCenterApi.DB.csproj">

+ 187 - 0
codegit/CallCenterApi/CallCenterApi.DAL/NewsMassge.cs

@@ -0,0 +1,187 @@
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
+namespace CallCenterApi.DAL
10
+{
11
+   public partial class NewsMassge
12
+    {
13
+        public NewsMassge()
14
+        { }
15
+
16
+
17
+        /// <summary>
18
+        /// 增加一条数据
19
+        /// </summary>
20
+        public int Add(CallCenterApi.Model.NewsMassge model)
21
+        {
22
+            StringBuilder strSql = new StringBuilder();
23
+            strSql.Append("insert into NewsMassge(");
24
+            strSql.Append("Title,Contents,FabuCode,FabuName,FabuDate");
25
+            strSql.Append(") values (");
26
+            strSql.Append("@Title,@Contents,@FabuCode,@FabuName,@FabuDate");
27
+            strSql.Append(") ");
28
+            strSql.Append(";select @@IDENTITY");
29
+            SqlParameter[] parameters = {
30
+                        new SqlParameter("@Title", SqlDbType.VarChar,100) ,
31
+                        new SqlParameter("@Contents", SqlDbType.VarChar,100) ,
32
+                        new SqlParameter("@FabuCode", SqlDbType.VarChar,50 ) ,
33
+                        new SqlParameter("@FabuName", SqlDbType.VarChar,50) ,
34
+                        new SqlParameter("@FabuDate", SqlDbType.DateTime)
35
+
36
+            };
37
+
38
+            parameters[0].Value = model.Title;
39
+            parameters[1].Value = model.Contents;
40
+            parameters[2].Value = model.FabuCode;
41
+            parameters[3].Value = model.FabuName;
42
+            parameters[4].Value = model.FabuDate;
43
+
44
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
45
+            if (obj == null)
46
+            {
47
+                return 0;
48
+            }
49
+            else
50
+            {
51
+
52
+                return Convert.ToInt32(obj);
53
+
54
+            }
55
+
56
+        }
57
+
58
+
59
+        /// <summary>
60
+        /// 得到一个对象实体
61
+        /// </summary>
62
+        public CallCenterApi.Model.NewsMassge GetModel(int ID)
63
+        {
64
+
65
+            StringBuilder strSql = new StringBuilder();
66
+            strSql.Append("select *  ");
67
+            strSql.Append("  from NewsMassge ");
68
+            strSql.Append(" where Id=@ID");
69
+            SqlParameter[] parameters = {
70
+                    new SqlParameter("@ID", SqlDbType.Int,4)
71
+            };
72
+            parameters[0].Value = ID;
73
+
74
+
75
+            CallCenterApi.Model.NewsMassge model = new CallCenterApi.Model.NewsMassge();
76
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
77
+
78
+            if (ds.Tables[0].Rows.Count > 0)
79
+            {
80
+                if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
81
+                {
82
+                    model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
83
+                }
84
+                model.Title = ds.Tables[0].Rows[0]["Title"].ToString();
85
+                model.Contents = ds.Tables[0].Rows[0]["Contents"].ToString();
86
+                model.FabuCode = ds.Tables[0].Rows[0]["FabuCode"].ToString();
87
+                model.FabuName = ds.Tables[0].Rows[0]["FabuName"].ToString();
88
+                if (ds.Tables[0].Rows[0]["FabuDate"].ToString() != "")
89
+                {
90
+                    model.FabuDate = DateTime.Parse(ds.Tables[0].Rows[0]["FabuDate"].ToString());
91
+                }
92
+                if (ds.Tables[0].Rows[0]["UpdateTime"].ToString() != "")
93
+                {
94
+                    model.FabuDate = DateTime.Parse(ds.Tables[0].Rows[0]["UpdateTime"].ToString());
95
+                }
96
+
97
+                return model;
98
+            }
99
+            else
100
+            {
101
+                return null;
102
+            }
103
+        }
104
+
105
+
106
+
107
+        /// <summary>
108
+        /// 删除一条数据
109
+        /// </summary>
110
+        public bool Delete(int ID)
111
+        {
112
+
113
+            StringBuilder strSql = new StringBuilder();
114
+            strSql.Append("delete from NewsMassge ");
115
+            strSql.Append(" where Id=@ID");
116
+            SqlParameter[] parameters = {
117
+                    new SqlParameter("@ID", SqlDbType.Int,4)
118
+            };
119
+            parameters[0].Value = ID;
120
+
121
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
122
+            if (rows > 0)
123
+            {
124
+                return true;
125
+            }
126
+            else
127
+            {
128
+                return false;
129
+            }
130
+        }
131
+        /// <summary>
132
+        /// 批量删除数据
133
+        /// </summary>
134
+        public bool DeleteList(string IDlist)
135
+        {
136
+            StringBuilder strSql = new StringBuilder();
137
+            strSql.Append("delete from NewsMassge ");
138
+            strSql.Append(" where ID in (" + IDlist + ")  ");
139
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
140
+            if (rows > 0)
141
+            {
142
+                return true;
143
+            }
144
+            else
145
+            {
146
+                return false;
147
+            }
148
+        }
149
+
150
+
151
+        /// <summary>
152
+        /// 更新一条数据
153
+        /// </summary>
154
+        public bool Update(CallCenterApi.Model.NewsMassge model)
155
+        {
156
+            StringBuilder strSql = new StringBuilder();
157
+            strSql.Append("update NewsMassge set ");
158
+            strSql.Append("Title=@Title,");
159
+            strSql.Append("Contents=@Contents,");
160
+            strSql.Append("UpdateTime=@UpdateTime");
161
+            strSql.Append(" where Id=@ID");
162
+            SqlParameter[] parameters = {
163
+                    new SqlParameter("@Title", SqlDbType.VarChar,100),
164
+                    new SqlParameter("@Contents", SqlDbType.VarChar,1000),
165
+                    new SqlParameter("@UpdateTime", SqlDbType.DateTime),
166
+                    new SqlParameter("@ID", SqlDbType.Int,4)};
167
+            parameters[0].Value = model.Title;
168
+            parameters[1].Value = model.Contents;
169
+            parameters[2].Value = model.UpdateTime;
170
+            parameters[3].Value = model.Id;
171
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
172
+            if (rows > 0)
173
+            {
174
+                return true;
175
+            }
176
+            else
177
+            {
178
+                return false;
179
+            }
180
+        }
181
+
182
+
183
+
184
+
185
+
186
+    }
187
+}

+ 109 - 0
codegit/CallCenterApi/CallCenterApi.DAL/UserLeaveMes.cs

@@ -0,0 +1,109 @@
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
+namespace CallCenterApi.DAL
10
+{
11
+  public partial  class UserLeaveMes
12
+    {
13
+        public UserLeaveMes()
14
+        { }
15
+
16
+        /// <summary>
17
+        /// 增加一条数据
18
+        /// </summary>
19
+        public int Add(CallCenterApi.Model.UserLeaveMes model)
20
+        {
21
+            StringBuilder strSql = new StringBuilder();
22
+            strSql.Append("insert into UserLeaveMes(");
23
+            strSql.Append("Code,Contents,CreateTime");
24
+            strSql.Append(") values (");
25
+            strSql.Append("@Code,@Contents,@CreateTime");
26
+            strSql.Append(") ");
27
+            strSql.Append(";select @@IDENTITY");
28
+            SqlParameter[] parameters = {
29
+                        new SqlParameter("@Code", SqlDbType.VarChar,50) ,
30
+                        new SqlParameter("@Contents", SqlDbType.VarChar,1000) ,
31
+                        new SqlParameter("@CreateTime", SqlDbType.DateTime)
32
+
33
+            };
34
+
35
+            parameters[0].Value = model.Code;
36
+            parameters[1].Value = model.Contents;
37
+            parameters[2].Value = model.CreateTime;
38
+
39
+
40
+            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
41
+            if (obj == null)
42
+            {
43
+                return 0;
44
+            }
45
+            else
46
+            {
47
+
48
+                return Convert.ToInt32(obj);
49
+
50
+            }
51
+
52
+        }
53
+
54
+        /// <summary>
55
+        /// 得到一个对象实体
56
+        /// </summary>
57
+        public CallCenterApi.Model.UserLeaveMes GetModel(int id)
58
+        {
59
+
60
+            StringBuilder strSql = new StringBuilder();
61
+            strSql.Append("select  top 1 * from UserLeaveMes ");
62
+            strSql.Append(" where Id=@id");
63
+            SqlParameter[] parameters = {
64
+                    new SqlParameter("@id", SqlDbType.Int,4)
65
+            };
66
+            parameters[0].Value = id;
67
+
68
+            CallCenterApi.Model.UserLeaveMes model = new CallCenterApi.Model.UserLeaveMes();
69
+            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
70
+            if (ds.Tables[0].Rows.Count > 0)
71
+            {
72
+                return DataRowToModel(ds.Tables[0].Rows[0]);
73
+            }
74
+            else
75
+            {
76
+                return null;
77
+            }
78
+        }
79
+
80
+
81
+        /// <summary>
82
+        /// 得到一个对象实体
83
+        /// </summary>
84
+        public CallCenterApi.Model.UserLeaveMes DataRowToModel(DataRow row)
85
+        {
86
+            CallCenterApi.Model.UserLeaveMes model = new CallCenterApi.Model.UserLeaveMes();
87
+            if (row != null)
88
+            {
89
+                if (row["Id"] != null && row["Id"].ToString() != "")
90
+                {
91
+                    model.Id = int.Parse(row["Id"].ToString());
92
+                }
93
+                if (row["Code"] != null)
94
+                {
95
+                    model.Code = row["Code"].ToString();
96
+                }
97
+                if (row["Contents"] != null)
98
+                {
99
+                    model.Contents = row["Contents"].ToString();
100
+                }
101
+                if (row["CreateTime"] != null && row["CreateTime"].ToString() != "")
102
+                {
103
+                    model.CreateTime = DateTime.Parse(row["CreateTime"].ToString());
104
+                }              
105
+            }
106
+            return model;
107
+        }
108
+    }
109
+}

+ 13 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/App_Start/WechatActionFilter.cs

@@ -14,16 +14,21 @@ namespace CallCenterApi.Interface.App_Start
14 14
         public override void OnActionExecuting(ActionExecutingContext filterContext)
15 15
         {
16 16
             var openid = filterContext.HttpContext.Request["openid"];
17
-            var model = userBLL.GetModel(openid);
18
-            var modelCus = customerBLL.GetModelList(" F_WxOpenId='"+openid+"'").FirstOrDefault();//.GetModelByOpenid(openid);
19
-            if (model == null)
17
+            //var model = userBLL.GetModel(openid);
18
+            //var modelCus = customerBLL.GetModelList(" F_WxOpenId='"+openid+"'").FirstOrDefault();//.GetModelByOpenid(openid);
19
+            //if (model == null)
20
+            //{
21
+            //if (modelCus == null)
22
+            //{
23
+            //    filterContext.Result = new ContentResult() { Content = new AjaxResult { state = ResultTypes.notoken.ToString(), message = "操作失败,请重新进入公众号" }.ToJson() };
24
+            if (openid==null)
20 25
             {
21
-                if (modelCus == null)
22
-                {
23
-                    filterContext.Result = new ContentResult() { Content = new AjaxResult { state = ResultTypes.notoken.ToString(), message = "操作失败,请重新进入公众号" }.ToJson() };
24
-                    return;
25
-                }
26
+                filterContext.Result = new ContentResult() { Content = new AjaxResult { state = ResultTypes.notoken.ToString(), message = "操作失败,请重新进入公众号" }.ToJson() };
27
+                return;
26 28
             }
29
+                   
30
+            //    }
31
+            //}
27 32
             base.OnActionExecuting(filterContext);
28 33
         }
29 34
     }

+ 81 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/LeaveMessagController.cs

@@ -0,0 +1,81 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.Common;
3
+using CallCenterApi.DB;
4
+using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Model;
6
+using System;
7
+using System.Collections.Generic;
8
+using System.Data;
9
+using System.Linq;
10
+using System.Web;
11
+using System.Web.Mvc;
12
+
13
+namespace CallCenterApi.Interface.Controllers
14
+{
15
+    public class LeaveMessagController : BaseController
16
+    {
17
+        /// <summary>
18
+        /// 获取新闻列表
19
+        /// </summary>
20
+        /// <param name="keywords"></param>
21
+        /// <param name="page"></param>
22
+        /// <param name="pagesize"></param>
23
+        /// <returns></returns>
24
+        public ActionResult GetList(string keywords = "", int page = 1, int pagesize = 5)
25
+        {
26
+            ActionResult res = NoToken("未知错误,请重新登录");
27
+            if (Request.IsAuthenticated)
28
+            {
29
+
30
+                DataTable dt = new DataTable();
31
+            string sql = "";
32
+            if (!string.IsNullOrEmpty(keywords))
33
+            {
34
+                sql = $" and Contents like '" + keywords.Trim() + "'";
35
+            }
36
+            int recordCount = 0;
37
+            dt = BLL.PagerBLL.GetListPager(
38
+                "UserLeaveMes",
39
+                "UserLeaveMes.Id",
40
+                "*",
41
+                sql,
42
+                "ORDER BY UserLeaveMes.Id desc",
43
+                pagesize,
44
+                page,
45
+                true,
46
+                out recordCount
47
+                );
48
+            var obj = new
49
+            {
50
+                state = "success",
51
+                message = "成功",
52
+                rows = dt,
53
+                total = recordCount
54
+            };
55
+            return Content(obj.ToJson());
56
+            }
57
+            return res;
58
+        }
59
+
60
+        public ActionResult LookMs(int id)
61
+        {
62
+            ActionResult res = NoToken("未知错误,请重新登陆");
63
+            if (Request.IsAuthenticated)
64
+            {
65
+              Model.UserLeaveMes nmodel = new UserLeaveMes();
66
+            if (id > 0)
67
+            {
68
+                nmodel = new BLL.UserLeaveMes().GetModel(id);
69
+            }
70
+            if (nmodel != null)
71
+            {
72
+                return Success("获取成功", nmodel);
73
+            }
74
+            else return  Error("获取失败!");
75
+
76
+            }
77
+            return res;
78
+        }
79
+
80
+    }
81
+}

+ 974 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/MessageController.cs

@@ -0,0 +1,974 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Web;
5
+using System.Web.Mvc;
6
+using CallCenterApi.Interface.Controllers.Base;
7
+using System.Data;
8
+using CallCenter.Utility;
9
+using System.Configuration;
10
+using Top.Api;
11
+using Top.Api.Request;
12
+using Top.Api.Response;
13
+using CallCenterApi.Common;
14
+using System.Security.Cryptography;
15
+using System.Text;
16
+using Newtonsoft.Json.Linq;
17
+using Newtonsoft.Json;
18
+using System.IO;
19
+
20
+namespace CallCenterApi.Interface.Controllers
21
+{
22
+    public class MessageController : BaseController
23
+    {
24
+        // GET: Message
25
+        #region 接收短信
26
+        //string url = "http://47.92.26.244/sms.aspx?";
27
+        //string account = "yhyy"; string password = "yhyy190903";
28
+        string url = "";
29
+        string accName = ""; string password = "";
30
+
31
+        // string accName = "13783690587"; string password = "yhyy66";
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
+        }
50
+        /// <summary>
51
+        /// 发送短信
52
+        /// </summary>
53
+        /// <param name="mobile"></param>
54
+        /// <param name="time"></param>
55
+        /// <param name="timeslot"></param>
56
+        /// <param name="department"></param>
57
+        /// <param name="doctor"></param>
58
+        /// <param name="floor"></param>
59
+        /// <param name="name"></param>
60
+        /// <param name="content"></param>
61
+        /// <param name="type"></param>
62
+        /// <returns></returns>
63
+
64
+        public string SendSMS(string mobile, string sendTime, string content, int sendWay, int MBID)
65
+        {
66
+            string[] tel = mobile.Split(',');
67
+            content += "【周口郸城医院】";
68
+            foreach (var item in tel)
69
+            {
70
+                string param = string.Empty;
71
+                string mbid = DateTime.Now.ToString("yyyyMMddHHmmss");
72
+                if (!string.IsNullOrEmpty(sendTime))
73
+                {
74
+                    string st = Convert.ToDateTime(sendTime).ToString("yyyy-MM-dd HH:mm:ss");
75
+                    param = "accName=" + accName + "&accPwd=" + Md5(password) + "&aimcodes=" + item.Trim() + "&content=" + content.Trim() + "&schTime=" + st + "&dataType=json& msgId=" + mbid;
76
+                }
77
+                else
78
+                {
79
+                    param = "accName=" + accName + "&accPwd=" + Md5(password) + "&aimcodes=" + item.Trim() + "&content=" + content.Trim() + "&schTime=" + "&dataType=json& msgId=" + mbid;
80
+                }
81
+                string Dataaa = HttpMethods.HttpPost(url + "send", param);
82
+                JObject jo = (JObject)JsonConvert.DeserializeObject(Dataaa);
83
+                string replyCode = jo["replyCode"].ToString();
84
+                string replyMsg = jo["replyMsg"].ToString();
85
+                int code = 0;
86
+                int.TryParse(replyCode, out code);
87
+                if (sendWay == 0)//立即发送
88
+                {
89
+                    AddSMSList(sendWay, null, DateTime.Now, code, item, content, MBID);
90
+                }
91
+                else //定时发送
92
+                {
93
+                    AddSMSList(sendWay, Convert.ToDateTime(sendTime), Convert.ToDateTime(sendTime), code, item, content, MBID);
94
+                }
95
+            }
96
+            return "发送成功";
97
+        }
98
+
99
+        public class CreateOrderReturnResult
100
+        {
101
+            public string state { get; set; }
102
+            public string message { get; set; }
103
+            public SmS data { get; set; }
104
+        }
105
+        public class SmS
106
+        {
107
+            public string returnstatus;
108
+            public string message;
109
+            public string remainpoint;
110
+            public string taskID;
111
+            public string successCounts;
112
+        }
113
+
114
+        /// <summary>
115
+        /// 新增短信模板
116
+        /// </summary>
117
+        /// <param name="name"></param>
118
+        /// <param name="cont"></param>
119
+        /// <param name="mName"></param>
120
+        /// <returns></returns>
121
+        public ActionResult AddTemplate(string name, string cont)
122
+        {
123
+
124
+            //int userId = CurrentUser.F_UserId;
125
+            int userId = CurrentUser.UserData.F_UserId;
126
+            if (userId != 0)
127
+            {
128
+                Model.T_SMS_Template dModel = new Model.T_SMS_Template();
129
+                Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
130
+                string MID = ""; string MName = "";
131
+                if (ua != null)
132
+                {
133
+                    MID = ua.F_UserCode;
134
+                    MName = ua.F_UserName;
135
+                }
136
+                dModel.Detail = cont.Trim();
137
+                dModel.Name = name.Trim();
138
+                dModel.MID = MID.Trim();
139
+                dModel.MName = MName.Trim();
140
+                dModel.CreateDate = DateTime.Now;
141
+                dModel.IsEnable = 0;
142
+                int b = new BLL.T_SMS_Template().Add(dModel);
143
+                if (b > 0)
144
+                {
145
+                    return Success("添加成功");
146
+                }
147
+                else
148
+                {
149
+                    return Success("添加失败");
150
+                }
151
+            }
152
+            else
153
+                return Error("无操作权限!");
154
+        }
155
+        /// <summary>
156
+        /// 修改短信模板
157
+        /// </summary>
158
+        /// <param name="name"></param>
159
+        /// <param name="cont"></param>
160
+        /// <param name="mName"></param>
161
+        /// <returns></returns>
162
+        public ActionResult UpdateTemplate(int id, string name, string cont)
163
+        {
164
+            int userId = CurrentUser.UserData.F_UserId;
165
+            if (userId != 0)
166
+            {
167
+
168
+
169
+                if (id <= 0)
170
+                    return Error("参数错误!");
171
+                var model = new BLL.T_SMS_Template().GetModel(id);
172
+                if (model == null)
173
+                    return Error("查询不到此模板!");
174
+                Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
175
+                string MID = ""; string MName = "";
176
+                if (ua != null)
177
+                {
178
+                    MID = ua.F_UserCode;
179
+                    MName = ua.F_UserName;
180
+                }
181
+                model.Detail = cont.Trim();
182
+                model.Name = name.Trim();
183
+                model.MID = MID.Trim();
184
+                model.MName = MName.Trim();
185
+                model.CreateDate = DateTime.Now;
186
+                model.IsEnable = 0;
187
+                if (new BLL.T_SMS_Template().Update(model))
188
+                {
189
+                    return Success("修改成功");
190
+                }
191
+                else
192
+                {
193
+                    return Error("修改失败");
194
+                }
195
+            }
196
+            else
197
+                return Error("无操作权限!");
198
+        }
199
+        /// <summary>
200
+        /// 删除短信模板
201
+        /// </summary>
202
+        /// <param name="ids"></param>
203
+        /// <returns></returns>
204
+        public ActionResult DelTemplate(string[] ids)
205
+        {
206
+            int userId = CurrentUser.UserData.F_UserId;
207
+            if (userId != 0)
208
+            {
209
+
210
+                if (ids != null && ids.Length > 0)
211
+                {
212
+                    bool res = true;
213
+                    string idd = " ";
214
+                    foreach (string str in ids)
215
+                    {
216
+                        idd += str + ",";
217
+                    }
218
+
219
+                    if (!string.IsNullOrEmpty(idd.Trim()))
220
+                    {
221
+                        if (new BLL.T_SMS_Template().DeleteList(idd.TrimEnd(',')))
222
+                        {
223
+                            if (new BLL.T_SMS_Template().DeleteList(idd.TrimEnd(',')))
224
+                            {
225
+
226
+                                return Success("设置成功");
227
+
228
+                            }
229
+                            else
230
+                            {
231
+                                return Error("设置失败");
232
+                            }
233
+                        }
234
+                        else
235
+                        {
236
+                            return Error("设置失败");
237
+                        }
238
+
239
+                    }
240
+                    else
241
+                    {
242
+                        return Error("请选择工单");
243
+                    }
244
+                }
245
+                else
246
+                {
247
+                    return Error("获取参数失败");
248
+                }
249
+            }
250
+            else
251
+            {
252
+                return Error("无操作权限!");
253
+            }
254
+        }
255
+        /// <summary>
256
+        /// 删除短信记录列表
257
+        /// </summary>
258
+        /// <param name="ids"></param>
259
+        /// <returns></returns>
260
+        public ActionResult DelSMSList(string[] ids)
261
+        {
262
+            int userId = CurrentUser.UserData.F_UserId;
263
+            if (userId != 0)
264
+            {
265
+
266
+                if (ids != null && ids.Length > 0)
267
+                {
268
+                    bool res = true;
269
+                    string idd = " ";
270
+                    foreach (string str in ids)
271
+                    {
272
+                        idd += str + ",";
273
+                    }
274
+
275
+                    if (!string.IsNullOrEmpty(idd.Trim()))
276
+                    {
277
+                        if (new BLL.T_SMS_List().DeleteList(idd.TrimEnd(',')))
278
+                        {
279
+                            if (new BLL.T_SMS_List().DeleteList(idd.TrimEnd(',')))
280
+                            {
281
+
282
+                                return Success("设置成功");
283
+
284
+                            }
285
+                            else
286
+                            {
287
+                                return Error("设置失败");
288
+                            }
289
+                        }
290
+                        else
291
+                        {
292
+                            return Error("设置失败");
293
+                        }
294
+
295
+                    }
296
+                    else
297
+                    {
298
+                        return Error("请选择工单");
299
+                    }
300
+                }
301
+                else
302
+                {
303
+                    return Error("获取参数失败");
304
+                }
305
+            }
306
+            else
307
+            {
308
+                return Error("无操作权限!");
309
+            }
310
+        }
311
+
312
+        /// <summary>
313
+        /// 获取短信模板列表
314
+        /// </summary>
315
+        /// <returns></returns>
316
+        public ActionResult GetTemplateList(string name, string keywords, int page = 1, int pagesize = 5)
317
+        {
318
+            int userId = CurrentUser.UserData.F_UserId;
319
+            if (userId != 0)
320
+            {
321
+                DataTable dt = new DataTable();
322
+                string sql = $" and IsEnable=0";
323
+                if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
324
+                    sql += $"  and ( Detail like '%" + keywords.Trim() + "%'or Name like '%" + keywords.Trim() + "%' or MName like '%" + keywords.Trim() + "%' ) ";
325
+                if (!string.IsNullOrWhiteSpace(name))//
326
+                    sql += $" and Name like '%" + name.Trim() + "%'";
327
+                // var modellist = new BLL.T_SMS_Template().GetModelList(sql);
328
+
329
+                int recordCount = 0;
330
+                dt = BLL.PagerBLL.GetListPager(
331
+                        "T_SMS_Template",
332
+                        "T_SMS_Template.ID",
333
+                        "*",
334
+                        sql,
335
+                       "ORDER BY T_SMS_Template.ID desc",
336
+                        pagesize,
337
+                        page,
338
+                        true,
339
+                        out recordCount);
340
+                List<Model.T_SMS_Template> modlelist = new BLL.T_SMS_Template().DataTableToList(dt);
341
+                List<Sms> sms = Template(modlelist);
342
+                var obj = new
343
+                {
344
+                    state = "success",
345
+                    message = "成功",
346
+                    rows = sms,
347
+                    total = recordCount
348
+
349
+                };
350
+
351
+                return Content(obj.ToJson());
352
+            }
353
+            else
354
+                return Error("无操作权限!");
355
+        }
356
+        /// <summary>
357
+        /// 获取模板详情
358
+        /// </summary>
359
+        /// <param name="id"></param>
360
+        /// <returns></returns>
361
+        public ActionResult GetContentTemp(string name)
362
+        {
363
+            int userId = CurrentUser.UserData.F_UserId;
364
+            if (userId != 0)
365
+            {
366
+                Model.T_SMS_Template dModel = new Model.T_SMS_Template();
367
+                string NameTyoe = "";
368
+                if (string.IsNullOrEmpty(name.Trim()))
369
+                    return Error("短信类型不能为空!");
370
+                var model = new BLL.T_SMS_Template().GetModelList($"Name like '%" + name.Trim() + "%'").FirstOrDefault();
371
+
372
+                if (model == null)
373
+                    return Error("查询不到此模板!");
374
+                Sms sms = Template(model);
375
+
376
+                return Success("获取成功", sms);
377
+            }
378
+            else
379
+                return Error("无操作权限!");
380
+        }
381
+        public List<Sms> Template(List<Model.T_SMS_Template> sms)
382
+        {
383
+
384
+            List<Sms> SMS = new List<Sms>();
385
+            if (sms != null)
386
+            {
387
+                foreach (var it in sms)
388
+                {
389
+                    Sms t_SMS = new Sms();
390
+                    t_SMS.ID = it.ID;
391
+                    t_SMS.Name = it.Name;
392
+                    t_SMS.Detail = it.Detail;
393
+                    t_SMS.IsEnable = it.IsEnable;
394
+                    t_SMS.MID = it.MID;
395
+                    t_SMS.MName = it.MName;
396
+                    t_SMS.CreateDate = it.CreateDate;
397
+                    string NameType = "";
398
+                    try
399
+                    {
400
+                        var dic = new BLL.T_Sys_DictionaryValue().GetModel(int.Parse(it.Name));
401
+                        if (dic != null)
402
+                            NameType = dic.F_Name;
403
+                    }
404
+                    catch
405
+                    {
406
+                        NameType = it.Name;
407
+                    }
408
+                    t_SMS.NameType = NameType;
409
+                    SMS.Add(t_SMS);
410
+                }
411
+            }
412
+
413
+            return SMS;
414
+        }
415
+        public Sms Template(Model.T_SMS_Template sms)
416
+        {
417
+            Sms t_SMS = new Sms();
418
+            t_SMS.ID = sms.ID;
419
+            t_SMS.Name = sms.Name;
420
+            t_SMS.Detail = sms.Detail;
421
+            t_SMS.IsEnable = sms.IsEnable;
422
+            t_SMS.MID = sms.MID;
423
+            t_SMS.MName = sms.MName;
424
+            t_SMS.CreateDate = sms.CreateDate;
425
+            string NameType = "";
426
+            try
427
+            {
428
+                var dic = new BLL.T_Sys_DictionaryValue().GetModel(int.Parse(sms.Name));
429
+                if (dic != null)
430
+                    NameType = dic.F_Name;
431
+            }
432
+            catch
433
+            {
434
+                NameType = sms.Name;
435
+            }
436
+            t_SMS.NameType = NameType;
437
+            return t_SMS;
438
+        }
439
+        /// <summary>
440
+        /// 获取模板详情
441
+        /// </summary>
442
+        /// <param name="id"></param>
443
+        /// <returns></returns>
444
+        public ActionResult GetDetailsTemp(int id)
445
+        {
446
+            int userId = CurrentUser.UserData.F_UserId;
447
+            if (userId != 0)
448
+            {
449
+                Model.T_SMS_Template dModel = new Model.T_SMS_Template();
450
+                string NameTyoe = "";
451
+                if (id <= 0)
452
+                    return Error("参数错误!");
453
+                var model = new BLL.T_SMS_Template().GetModel(id);
454
+                if (model == null)
455
+                    return Error("查询不到此模板!");
456
+                Sms sms = Template(model);
457
+
458
+
459
+                return Success("获取成功", sms);
460
+            }
461
+            else
462
+                return Error("无操作权限!");
463
+        }
464
+        public class Sms
465
+        {
466
+            public int ID
467
+            {
468
+                get; set;
469
+            }
470
+            public string Name
471
+            {
472
+                get; set;
473
+            }
474
+
475
+            public string Detail
476
+            {
477
+                get; set;
478
+            }
479
+            public int? IsEnable
480
+            {
481
+                get; set;
482
+            }
483
+
484
+            public string MID
485
+            {
486
+                get; set;
487
+            }
488
+
489
+            public string MName
490
+            {
491
+                get; set;
492
+            }
493
+            public DateTime? CreateDate
494
+            {
495
+                get; set;
496
+            }
497
+            public string NameType
498
+            {
499
+                get; set;
500
+            }
501
+        }
502
+        /// <summary>
503
+        /// 导入excel
504
+        /// </summary>
505
+        public ActionResult ImportExcel()
506
+        {
507
+            int userId = CurrentUser.UserData.F_UserId;
508
+            if (userId != 0)
509
+            {
510
+                string usercode = CurrentUser.UserData.F_UserCode;
511
+                string ip = DTRequest.GetIP();
512
+                if (!string.IsNullOrWhiteSpace(usercode))
513
+                {
514
+                    HttpPostedFile _upFile = RequestString.GetFile("upFile");
515
+                    if (_upFile != null)
516
+                    {
517
+                        int headrow = 0;
518
+                        #region 上传文件
519
+                        string filepath = "";
520
+                        string datepath = DateTime.Now.ToString("yyyyMMddHHMMss");
521
+                        string aLastName = Path.GetExtension(_upFile.FileName);
522
+                        string oriname = Path.GetFileNameWithoutExtension(_upFile.FileName);
523
+                        if (aLastName != ".xls" && aLastName != ".xlsx")
524
+                        {
525
+                            return Error("文件类型错误,请选择Excel文件");
526
+                        }
527
+                        string newpath = datepath + "_" + _upFile.FileName;
528
+                        if (!Directory.Exists(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData")))
529
+                        {
530
+                            Directory.CreateDirectory(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData"));
531
+                        }
532
+                        filepath = this.Request.ApplicationPath + "/ExcelData/" + newpath;
533
+                        string PhysicalPath = Server.MapPath(filepath);
534
+                        _upFile.SaveAs(PhysicalPath);
535
+                        #endregion
536
+                        #region 添加附件日志
537
+                        Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
538
+                        model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
539
+                        model_T_Sys_Accessories.F_FileName = newpath;//附件名称
540
+                        model_T_Sys_Accessories.F_FileType = aLastName;//附件类型
541
+                        model_T_Sys_Accessories.F_FileUrl = filepath;//附件地址
542
+                        model_T_Sys_Accessories.F_UserCode = usercode;//上传人  
543
+                        int fid = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
544
+                        #endregion
545
+                        NPOIHelper np = new NPOIHelper();
546
+                        DataTable dt = np.ExcelToTable(_upFile, headrow);
547
+                        string msg = string.Empty;
548
+                        if (dt == null || dt.Rows.Count == 0)
549
+                            return Error("文件没有数据");
550
+                        else
551
+                        {
552
+                            Model.T_SMS_Template dModel = new Model.T_SMS_Template();
553
+                            Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
554
+                            string MID = ""; string MName = "";
555
+                            if (ua != null)
556
+                            {
557
+                                MID = ua.F_UserCode;
558
+                                MName = ua.F_UserName;
559
+                            }
560
+                            dModel.MID = MID.Trim();
561
+                            dModel.MName = MName.Trim();
562
+                            dModel.CreateDate = DateTime.Now;
563
+                            dModel.IsEnable = 0;
564
+                            foreach (DataRow dr in dt.Rows)
565
+                            {
566
+                                #region 数据入库
567
+                                headrow = headrow + 1;
568
+
569
+                                if (dr["短信类型"].ToString() != "")
570
+                                {
571
+                                    if (!getunique(dr["短信类型"].ToString()))
572
+                                    {
573
+                                        dModel.Name = dr["短信类型"].ToString();
574
+                                        dModel.Detail = dr["短信内容"].ToString();
575
+                                        var res = new BLL.T_SMS_Template().Add(dModel);
576
+                                        if (res < 0)
577
+                                        {
578
+                                            msg = msg + "第" + headrow + "行,导入失败<br>";
579
+                                        }
580
+                                    }
581
+                                    else
582
+                                    {
583
+                                        msg = msg + "第" + headrow + "行,短信类型重复,未导入<br>";
584
+                                    }
585
+                                }
586
+                                else
587
+                                    msg = msg + "第" + headrow + "行,短信类型为空或格式不正确,未导入<br>";
588
+                                #endregion
589
+                            }
590
+                            if (string.IsNullOrEmpty(msg))
591
+                                return Success("导入成功 ");
592
+                            else
593
+                                return Error(msg);
594
+                        }
595
+                    }
596
+                    return Error("数据源上传失败");
597
+                }
598
+            }
599
+            return Error("用户登录失败,请重新登录");
600
+        }
601
+        /// <summary>
602
+        /// 验证短信类型是否唯一
603
+        /// </summary>
604
+        private bool getunique(string Name)
605
+        {
606
+            var sql = " IsEnable=0 ";
607
+            sql += "and (Name='" + Name + "')";
608
+            var count = new BLL.T_SMS_Template().GetModelList(sql).Count();
609
+            return count > 0;
610
+        }
611
+        /// <summary>
612
+        /// 新增短信记录
613
+        /// </summary>
614
+        /// <returns></returns>
615
+        public bool AddSMSList(int SendWay, DateTime? DSSendTime, DateTime SendTime, int IsSend,
616
+          string Telephone, string Detail, int MBID)
617
+        {
618
+            int userId = CurrentUser.UserData.F_UserId;
619
+            Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
620
+            string MID = ""; string MName = "";
621
+            if (ua != null)
622
+            {
623
+                MID = ua.F_UserCode;
624
+                MName = ua.F_UserName;
625
+            }
626
+            Model.T_SMS_List dModel = new Model.T_SMS_List();
627
+            dModel.SendWay = SendWay;
628
+            dModel.DSSendTime = DSSendTime;
629
+            dModel.SendTime = SendTime;
630
+            dModel.IsSend = IsSend;
631
+            dModel.Telephone = Telephone;
632
+            dModel.Detail = Detail;
633
+            dModel.MBID = MBID;
634
+            dModel.MID = MID;
635
+            dModel.MName = MName;
636
+            dModel.F_IsDelete = 0;
637
+            dModel.CreateDate = DateTime.Now;
638
+            int b = new BLL.T_SMS_List().Add(dModel);
639
+            if (b > 0)
640
+            {
641
+                return true;
642
+            }
643
+            else
644
+            {
645
+                return false;
646
+            }
647
+        }
648
+        /// <summary>
649
+        /// 导出短信记录
650
+        /// </summary>
651
+        /// <param name="stime"></param>
652
+        /// <param name="endtime"></param>
653
+        /// <returns></returns>
654
+        public ActionResult ExitTypelist(string name, string phone, string creatname, int SendWay = -1, int IsSend = -1)
655
+        {
656
+            DataTable dt = new DataTable();
657
+            string sql = $"   F_IsDelete=0";
658
+            if (!string.IsNullOrEmpty(name))
659
+            {
660
+                var model = new BLL.T_SMS_Template().GetModelList($"Name like '%" + name.Trim() + "%'").FirstOrDefault();
661
+                if (model != null)
662
+                {
663
+                    sql += " and MBID=" + model.ID;
664
+                }
665
+            }
666
+            if (!string.IsNullOrEmpty(phone))
667
+                sql += " and Telephone=" + phone;
668
+            if (SendWay >= 0)
669
+                sql += " and SendWay=" + SendWay;
670
+            if (IsSend >= 0)
671
+                sql += " and IsSend=" + IsSend;
672
+            if (!string.IsNullOrEmpty(creatname))
673
+                sql += $"  and ( MID like '%" + creatname.Trim() + "%'or MName like '%" + creatname.Trim() + "%') ";
674
+            dt.Columns.Add("编号");
675
+            dt.Columns.Add("接收号码");
676
+            dt.Columns.Add("发送内容");
677
+            dt.Columns.Add("发送方式");
678
+            dt.Columns.Add("发送状态");
679
+            dt.Columns.Add("发送时间");
680
+            dt.Columns.Add("短信类型");
681
+            dt.Columns.Add("发送人");
682
+            var itemlist = new BLL.T_SMS_List().GetModelList(sql + "order by ID desc");
683
+            int i = 1;
684
+            foreach (var it in itemlist)
685
+            {
686
+
687
+                DataRow drNew = dt.NewRow();
688
+                drNew["编号"] = i++;
689
+                drNew["接收号码"] = it.Telephone;
690
+                drNew["发送内容"] = it.Detail;
691
+                if (it.SendWay == 0)
692
+                    drNew["发送方式"] = "立即发送";
693
+                else
694
+                    drNew["发送方式"] = "定时发送";
695
+                drNew["发送时间"] = it.SendTime;
696
+                if (it.SendTime < DateTime.Now && it.IsSend == 1)
697
+                    //if (it.IsSend==1)
698
+                    drNew["发送状态"] = "已发送";
699
+                else
700
+                    drNew["发送状态"] = "未发送";
701
+                if (it.MBID > 0)
702
+                {
703
+                    var model = new BLL.T_SMS_Template().GetModel(int.Parse(it.MBID.ToString()));
704
+                    if (model != null)
705
+                    {
706
+                        drNew["短信类型"] = model.Name;
707
+                    }
708
+                }
709
+                drNew["发送人"] = it.MID + "(" + it.MName + ")";
710
+                dt.Rows.Add(drNew);
711
+            }
712
+            NPOIHelper npoi = new NPOIHelper();
713
+            if (npoi.ExportToExcel("短信记录", dt) == "")
714
+            {
715
+                return Success("导出成功");
716
+            }
717
+            else
718
+            {
719
+                return Error("导出失败");
720
+
721
+            }
722
+        }
723
+        /// <summary>
724
+        /// 修改短信记录列表
725
+        /// </summary>
726
+        /// <returns></returns>
727
+        public ActionResult UpdateSMSList(int id, int SendWay, DateTime DSSendTime, DateTime SendTime, int IsSend,
728
+          string Telephone, string Detail, int MBID, DateTime CreateDate)
729
+        {
730
+
731
+            int userId = CurrentUser.UserData.F_UserId;
732
+            if (userId != 0)
733
+            {
734
+                if (id <= 0)
735
+                    return Error("参数错误!");
736
+                var model = new BLL.T_SMS_List().GetModel(id);
737
+                if (model == null)
738
+                    return Error("查询不到此模板!");
739
+                Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
740
+                string MID = ""; string MName = "";
741
+                if (ua != null)
742
+                {
743
+                    MID = ua.F_UserCode;
744
+                    MName = ua.F_UserName;
745
+                }
746
+                model.SendWay = SendWay;
747
+                model.DSSendTime = DSSendTime;
748
+                model.SendTime = SendTime;
749
+                model.IsSend = IsSend;
750
+                model.Telephone = Telephone;
751
+                model.Detail = Detail;
752
+                model.MBID = MBID;
753
+                model.MID = MID;
754
+                model.MName = MName;
755
+                model.CreateDate = DateTime.Now;
756
+                bool b = new BLL.T_SMS_List().Update(model);
757
+                if (b)
758
+                {
759
+                    return Success("修改成功");
760
+                }
761
+                else
762
+                {
763
+                    return Error("修改失败");
764
+                }
765
+            }
766
+            else
767
+                return Error("无操作权限");
768
+
769
+        }
770
+        /// <summary>
771
+        /// 获取短信记录列表
772
+        /// </summary>
773
+        /// <returns></returns>
774
+        public ActionResult GetSMSList(string name, string phone, string creatname, int SendWay = -1, int IsSend = -1, int page = 1, int pagesize = 10)
775
+        {
776
+            DataTable dt = new DataTable();
777
+            int userId = CurrentUser.UserData.F_UserId;
778
+            if (userId != 0)
779
+            {
780
+
781
+                string sql = $"and  F_IsDelete=0";
782
+                if (!string.IsNullOrEmpty(name))
783
+                {
784
+                    var model = new BLL.T_SMS_Template().GetModelList($"Name like '%" + name.Trim() + "%'").FirstOrDefault();
785
+                    if (model != null)
786
+                    {
787
+                        sql += " and MBID=" + model.ID;
788
+                    }
789
+                }
790
+                if (!string.IsNullOrEmpty(phone))
791
+                    sql += " and Telephone like'%" + phone + "%'";
792
+                if (SendWay >= 0)
793
+                    sql += " and SendWay=" + SendWay;
794
+                if (IsSend >= 0)
795
+                    sql += " and IsSend=" + IsSend;
796
+                if (!string.IsNullOrEmpty(creatname))
797
+                    sql += $"  and ( MID like '%" + creatname.Trim() + "%'or MName like '%" + creatname.Trim() + "%') ";
798
+                int recordCount = 0;
799
+                if (!string.IsNullOrWhiteSpace(sql))
800
+                {
801
+
802
+                    dt = BLL.PagerBLL.GetListPager(
803
+                        "T_SMS_List",
804
+                        "T_SMS_List.ID",
805
+                        "*",
806
+                        sql,
807
+                        "ORDER BY T_SMS_List.ID desc",
808
+                        pagesize,
809
+                        page,
810
+                        true,
811
+                        out recordCount);
812
+                }
813
+                var modlelist = new BLL.T_SMS_List().DataTableToList(dt);
814
+                //var modellist = new BLL.T_SMS_List().GetModelList(sql);
815
+                var obj = new
816
+                {
817
+                    state = "success",
818
+                    message = "成功",
819
+                    rows = ModeltoSMSList(modlelist),
820
+                    total = recordCount
821
+                };
822
+
823
+                return Content(obj.ToJson());
824
+            }
825
+            else
826
+                return Error("无操作权限");
827
+
828
+        }
829
+        public List<SMSList> ModeltoSMSList(List<Model.T_SMS_List> list)
830
+        {
831
+            List<SMSList> modellist = new List<SMSList>();
832
+            foreach (var it in list)
833
+            {
834
+                SMSList model = new SMSList();
835
+                model.ID = it.ID;
836
+                if (it.SendWay == 0)
837
+                    model.SendWay = "立即发送";
838
+                else
839
+                    model.SendWay = "定时发送";
840
+                model.DSSendTime = it.DSSendTime?.ToString() ?? "";
841
+                model.SendTime = it.SendTime?.ToString() ?? "";
842
+                if (it.SendTime < DateTime.Now && it.IsSend == 1)
843
+                    //  if (it.IsSend == 0)
844
+                    model.IsSend = "已发送";
845
+                else
846
+                    model.IsSend = "未发送";
847
+                model.Telephone = it.Telephone;
848
+                model.Detail = it.Detail;
849
+                if (it.MBID > 0)
850
+                {
851
+                    var MID = new BLL.T_SMS_Template().GetModel(int.Parse(it.MBID.ToString()));
852
+                    if (MID != null)
853
+                    {
854
+                        // model.MBDetail = MID.Name;
855
+                        int t = 0;
856
+                        if (Int32.TryParse(MID.Name, out t))
857
+                        {
858
+                            var typeName = new BLL.T_Sys_DictionaryValue().GetModel(Convert.ToInt32(MID.Name));
859
+                            if (typeName != null)
860
+                                model.MBDetail = typeName.F_Name;
861
+                        }
862
+                    }
863
+
864
+
865
+
866
+                }
867
+                model.MID = it.MID;
868
+                model.MName = it.MName;
869
+                model.CreateDate = it.CreateDate?.ToString() ?? "";
870
+                modellist.Add(model);
871
+            }
872
+            return modellist;
873
+        }
874
+        /// <summary>
875
+        /// 导入号码
876
+        /// </summary>
877
+        /// <returns></returns>
878
+        public ActionResult ImportSend()
879
+        {
880
+            int userId = CurrentUser.UserData.F_UserId;
881
+            if (userId != 0)
882
+            {
883
+                string usercode = CurrentUser.UserData.F_UserCode;
884
+                string ip = DTRequest.GetIP();
885
+                if (!string.IsNullOrWhiteSpace(usercode))
886
+                {
887
+                    HttpPostedFile _upFile = RequestString.GetFile("upFile");
888
+                    if (_upFile != null)
889
+                    {
890
+                        int headrow = 0;
891
+                        #region 上传文件
892
+                        string filepath = "";
893
+                        string datepath = DateTime.Now.ToString("yyyyMMddHHMMss");
894
+                        string aLastName = Path.GetExtension(_upFile.FileName);
895
+                        string oriname = Path.GetFileNameWithoutExtension(_upFile.FileName);
896
+                        if (aLastName != ".xls" && aLastName != ".xlsx")
897
+                        {
898
+                            return Error("文件类型错误,请选择Excel文件");
899
+                        }
900
+                        string newpath = datepath + "_" + _upFile.FileName;
901
+                        if (!Directory.Exists(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData")))
902
+                        {
903
+                            Directory.CreateDirectory(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData"));
904
+                        }
905
+                        filepath = this.Request.ApplicationPath + "/ExcelData/" + newpath;
906
+                        string PhysicalPath = Server.MapPath(filepath);
907
+                        _upFile.SaveAs(PhysicalPath);
908
+                        #endregion
909
+                        #region 添加附件日志
910
+                        Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
911
+                        model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
912
+                        model_T_Sys_Accessories.F_FileName = newpath;//附件名称
913
+                        model_T_Sys_Accessories.F_FileType = aLastName;//附件类型
914
+                        model_T_Sys_Accessories.F_FileUrl = filepath;//附件地址
915
+                        model_T_Sys_Accessories.F_UserCode = usercode;//上传人  
916
+                        int fid = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
917
+                        #endregion
918
+                        NPOIHelper np = new NPOIHelper();
919
+                        DataTable dt = np.ExcelToTable(_upFile, headrow);
920
+                        string msg = string.Empty;
921
+                        string tels = string.Empty;
922
+                        if (dt == null || dt.Rows.Count == 0)
923
+                            return Error("文件没有数据");
924
+                        else
925
+                        {
926
+                            foreach (DataRow dr in dt.Rows)
927
+                            {
928
+                                #region 数据入库
929
+                                headrow = headrow + 1;
930
+
931
+                                if (dr["号码"].ToString() != "")
932
+                                {
933
+                                    if (string.IsNullOrEmpty(tels))
934
+                                    {
935
+                                        tels = dr["号码"].ToString();
936
+                                    }
937
+                                    else
938
+                                    {
939
+                                        tels = tels + "," + dr["号码"].ToString();
940
+                                    }
941
+                                }
942
+                                else
943
+                                    msg = msg + "第" + headrow + "行,号码为空或格式不正确,未导入<br>";
944
+                                #endregion
945
+                            }
946
+                            if (string.IsNullOrEmpty(msg))
947
+                                return Success("获取成功 ", tels);
948
+                            else
949
+                                return Error(msg);
950
+                        }
951
+                    }
952
+                    return Error("数据源上传失败");
953
+                }
954
+            }
955
+            return Error("用户登录失败,请重新登录");
956
+        }
957
+        #endregion
958
+
959
+        public class SMSList
960
+        {
961
+            public int ID;
962
+            public string SendWay;
963
+            public string DSSendTime;
964
+            public string SendTime;
965
+            public string IsSend;
966
+            public string Telephone;
967
+            public string Detail;
968
+            public string MBDetail;
969
+            public string MID;
970
+            public string MName;
971
+            public string CreateDate;
972
+        }
973
+    }
974
+}

+ 255 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/NewsController.cs

@@ -0,0 +1,255 @@
1
+using CallCenter.Utility;
2
+using CallCenterApi.Common;
3
+using CallCenterApi.DB;
4
+using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Model;
6
+using System;
7
+using System.Collections.Generic;
8
+using System.Data;
9
+using System.Linq;
10
+using System.Web;
11
+using System.Web.Mvc;
12
+
13
+namespace CallCenterApi.Interface.Controllers
14
+{
15
+    public class NewsController : BaseController
16
+    {
17
+        /// <summary>
18
+        /// 获取新闻列表
19
+        /// </summary>
20
+        /// <param name="keywords"></param>
21
+        /// <param name="page"></param>
22
+        /// <param name="pagesize"></param>
23
+        /// <returns></returns>
24
+        public ActionResult GetList(string keywords = "", int page = 1, int pagesize = 5)
25
+        {
26
+            ActionResult res = NoToken("未知错误,请重新登录");
27
+            if (Request.IsAuthenticated)
28
+            {
29
+
30
+                DataTable dt = new DataTable();
31
+                string sql = "";
32
+                if (!string.IsNullOrEmpty(keywords))
33
+                {
34
+                    sql = $" and Title like '" + keywords.Trim() + "'";
35
+                }
36
+                int recordCount = 0;
37
+                dt = BLL.PagerBLL.GetListPager(
38
+                    "NewsMassge",
39
+                    "NewsMassge.Id",
40
+                    "*",
41
+                    sql,
42
+                    "ORDER BY NewsMassge.Id desc",
43
+                    pagesize,
44
+                    page,
45
+                    true,
46
+                    out recordCount
47
+                    );
48
+                var obj = new
49
+                {
50
+                    state = "success",
51
+                    message = "成功",
52
+                    rows = dt,
53
+                    total = recordCount
54
+                };
55
+                return Content(obj.ToJson());
56
+            }
57
+            return res;
58
+        }
59
+
60
+
61
+        public ActionResult AddNew(string title, string cont)
62
+        {
63
+            ActionResult res = NoToken("未知错误,请重新登陆");
64
+            if (Request.IsAuthenticated)
65
+            {
66
+                int userid = CurrentUser.UserData.F_UserId;
67
+                Model.NewsMassge nmodel = new NewsMassge();
68
+                Model.T_Sys_UserAccount us = new BLL.T_Sys_UserAccount().GetModel(userid);
69
+                string MID = ""; string MName = "";
70
+                if (us != null)
71
+                {
72
+                    MID = us.F_UserCode;
73
+                    MName = us.F_UserName;
74
+                }
75
+                nmodel.Title = title.Trim();
76
+                nmodel.Contents = cont.Trim();
77
+                nmodel.FabuCode = MID;
78
+                nmodel.FabuName = MName;
79
+                nmodel.FabuDate = DateTime.Now;
80
+                if (new BLL.NewsMassge().Add(nmodel) > 0)
81
+                {
82
+                    return Success("新增成功!");
83
+                }
84
+                else
85
+                {
86
+                    return Error("新增失败!");
87
+                }
88
+
89
+            }
90
+            return res;
91
+        }
92
+
93
+        /// <summary>
94
+        /// 获取新闻详情
95
+        /// </summary>
96
+        /// <param name="id"></param>
97
+        /// <returns></returns>
98
+        public ActionResult GetNew(int id)
99
+        {
100
+            ActionResult res = NoToken("未知错误,请重新登陆");
101
+            if (Request.IsAuthenticated)
102
+            {
103
+                int userid = CurrentUser.UserData.F_UserId;
104
+                if (id > 0)
105
+                {
106
+                    Model.NewsMassge nmodel = new NewsMassge();
107
+                    nmodel = new BLL.NewsMassge().GetModel(id);
108
+
109
+                    if (nmodel != null)
110
+                    {
111
+                        return Success("获取成功!", nmodel);
112
+                    }
113
+                    else
114
+                    {
115
+                        return Error("获取失败!");
116
+                    }
117
+                }
118
+                else return Error("请选择要修改的数据!");
119
+            }
120
+            return res;
121
+        }
122
+
123
+
124
+
125
+        /// <summary>
126
+        /// 修改新闻消息
127
+        /// </summary>
128
+        /// <param name="name"></param>
129
+        /// <param name="cont"></param>
130
+        /// <param name="mName"></param>
131
+        /// <returns></returns>
132
+        public ActionResult UpdateNew(int id, string title, string cont)
133
+        {
134
+            ActionResult res = NoToken("未知错误,请重新登陆");
135
+            if (Request.IsAuthenticated)
136
+            {
137
+                int userId = CurrentUser.UserData.F_UserId;
138
+                if (userId != 0)
139
+                {
140
+
141
+                    if (id <= 0)
142
+                        return Error("参数错误!");
143
+                    var model = new BLL.NewsMassge().GetModel(id);
144
+                    if (model == null)
145
+                        return Error("查询不到此模板!");
146
+                    Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
147
+                    string MID = ""; string MName = "";
148
+                    if (ua != null)
149
+                    {
150
+                        MID = ua.F_UserCode;
151
+                        MName = ua.F_UserName;
152
+                    }
153
+                    model.Title = title.Trim();
154
+                    model.Contents = cont.Trim();
155
+                    model.FabuCode = MID;
156
+                    model.FabuName = MName.Trim();
157
+                    model.UpdateTime = DateTime.Now;
158
+                    if (new BLL.NewsMassge().Update(model))
159
+                    {
160
+                        return Success("修改成功");
161
+                    }
162
+                    else
163
+                    {
164
+                        return Error("修改失败");
165
+                    }
166
+                }
167
+                else
168
+                    return Error("无操作权限!");
169
+            }
170
+            return res;
171
+        }
172
+
173
+        /// <summary>
174
+        /// 批量删除新闻消息
175
+        /// </summary>
176
+        /// <param name="ids"></param>
177
+        /// <returns></returns>
178
+        public ActionResult DelNesItems(string[] ids)
179
+        {
180
+            ActionResult res = NoToken("未知错误,请重新登录");
181
+            if (Request.IsAuthenticated)
182
+            {
183
+                if (ids != null && ids.Length > 0)
184
+                {
185
+                    string idd = " ";
186
+                    foreach (string str in ids)
187
+                    {
188
+                        idd += str + ",";
189
+                    }
190
+
191
+                    if (!string.IsNullOrEmpty(idd.Trim()))
192
+                    {
193
+                        if (new BLL.NewsMassge().DeleteList(idd.TrimEnd(',')))
194
+                        {
195
+
196
+                            return Success("删除成功");
197
+
198
+                        }
199
+                        else
200
+                        {
201
+                            return Error("删除失败");
202
+                        }
203
+
204
+
205
+                    }
206
+                    else
207
+                    {
208
+                        return Error("请选择要删除新闻");
209
+                    }
210
+                }
211
+
212
+            }
213
+
214
+            return res;
215
+        }
216
+
217
+
218
+
219
+        /// <summary>
220
+        /// 删除新闻消息
221
+        /// </summary>
222
+        /// <param name="ids"></param>
223
+        /// <returns></returns>
224
+        public ActionResult DelNes(int id)
225
+        {
226
+            ActionResult res = NoToken("未知错误,请重新登录");
227
+            if (Request.IsAuthenticated)
228
+            {
229
+
230
+                if (id > 0)
231
+                {
232
+
233
+                    if (new BLL.NewsMassge().Delete(id))
234
+                    {
235
+
236
+                        return Success("删除成功");
237
+
238
+                    }
239
+                    else
240
+                    {
241
+                        return Error("删除失败");
242
+                    }
243
+
244
+                }
245
+                else
246
+                {
247
+                    return Error("请选择要删除新闻");
248
+                }
249
+
250
+            }
251
+            return res;
252
+
253
+        }
254
+    }
255
+}

+ 168 - 80
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -335,92 +335,92 @@ namespace CallCenterApi.Interface.Controllers.weixin
335 335
                 wld.OpenId = temp.OpenId;
336 336
 
337 337
                 #region 获取是否绑定用户表
338
-                //获取是否绑定用户表
339
-                var usertemp = new BLL.T_Sys_UserAccount().GetModelByOpenid(wld.OpenId);
338
+                ////获取是否绑定用户表
339
+                //var usertemp = new BLL.T_Sys_UserAccount().GetModelByOpenid(wld.OpenId);
340 340
 
341
-                if (usertemp != null)
342
-                {
343
-                    //部门
344
-                    Model.T_Sys_Department modelDep = new BLL.T_Sys_Department().GetModel(usertemp.F_DeptId);
345
-                    if (modelDep == null)
346
-                        return Error("获取失败!");
347
-                    wld.UserCode = usertemp.F_UserCode;
348
-                    #region 读取角色code
349
-                    var rolemodel = roleBLL.GetModel(usertemp.F_RoleId);
350
-                    if (rolemodel != null)
351
-                        wld.RoleCode = rolemodel.F_RoleCode;
352
-                    #endregion
353
-                    #region 部门角色
354
-                    if (usertemp.F_RoleId == 17)
355
-                    {
356
-                        //-1管理员
357
-                        wld.UserType = -1;
358
-                    }
359
-                    else
360
-                    {
361
-                        wld.UserType = 0;
362
-                        #region
363
-                        ////部门操作权限:1接待部,2办理人员,3区域客服,4监管
364
-                        //if (modelDep.F_Type == 1)
365
-                        //{
366
-                        //    //1--接待部
367
-                        //    wld.UserType = 1;
368
-                        //}
369
-                        //else if (modelDep.F_Type == 2)
370
-                        //{
371
-                        //    //2--办理人员
372
-                        //    wld.UserType = 2;
373
-                        //}
374
-                        //else if (modelDep.F_Type == 3)
375
-                        //{
376
-                        //    //3--区域客服
377
-                        //    wld.UserType = 3;
378
-                        //}
379
-                        //else if (modelDep.F_Type == 4)
380
-                        //{
381
-                        //    //4--监管
382
-                        //    wld.UserType = 4;
383
-                        //}
384
-                        //else
385
-                        //{
386
-                        //    wld.UserType = 0;
387
-                        //}
388
-                        #endregion
389
-                    }
390
-                    #endregion
391
-                }
392
-                else
393
-                {
394
-                    var customertemp = customerBaseBLL.GetModelByOpenid(wld.OpenId);
395
-                    if (customertemp != null)
396
-                    {
397
-                        wld.UserCode = customertemp.F_CustomerCode;
398
-                        //5--业主(客户档案会员)
399
-                        wld.UserType = 5;
400
-                    }
401
-                    else
402
-                    {
403
-                        wld.UserCode = "";
404
-                    }
405
-                    //wld.UserCode = "";
406
-                }
341
+                //if (usertemp != null)
342
+                //{
343
+                //    //部门
344
+                //    Model.T_Sys_Department modelDep = new BLL.T_Sys_Department().GetModel(usertemp.F_DeptId);
345
+                //    if (modelDep == null)
346
+                //        return Error("获取失败!");
347
+                //    wld.UserCode = usertemp.F_UserCode;
348
+                //    #region 读取角色code
349
+                //    var rolemodel = roleBLL.GetModel(usertemp.F_RoleId);
350
+                //    if (rolemodel != null)
351
+                //        wld.RoleCode = rolemodel.F_RoleCode;
352
+                //    #endregion
353
+                //    #region 部门角色
354
+                //    if (usertemp.F_RoleId == 17)
355
+                //    {
356
+                //        //-1管理员
357
+                //        wld.UserType = -1;
358
+                //    }
359
+                //    else
360
+                //    {
361
+                //        wld.UserType = 0;
362
+                //        #region
363
+                //        ////部门操作权限:1接待部,2办理人员,3区域客服,4监管
364
+                //        //if (modelDep.F_Type == 1)
365
+                //        //{
366
+                //        //    //1--接待部
367
+                //        //    wld.UserType = 1;
368
+                //        //}
369
+                //        //else if (modelDep.F_Type == 2)
370
+                //        //{
371
+                //        //    //2--办理人员
372
+                //        //    wld.UserType = 2;
373
+                //        //}
374
+                //        //else if (modelDep.F_Type == 3)
375
+                //        //{
376
+                //        //    //3--区域客服
377
+                //        //    wld.UserType = 3;
378
+                //        //}
379
+                //        //else if (modelDep.F_Type == 4)
380
+                //        //{
381
+                //        //    //4--监管
382
+                //        //    wld.UserType = 4;
383
+                //        //}
384
+                //        //else
385
+                //        //{
386
+                //        //    wld.UserType = 0;
387
+                //        //}
388
+                //        #endregion
389
+                //    }
390
+                //    #endregion
391
+                //}
392
+                //else
393
+                //{
394
+                //    var customertemp = customerBaseBLL.GetModelByOpenid(wld.OpenId);
395
+                //    if (customertemp != null)
396
+                //    {
397
+                //        wld.UserCode = customertemp.F_CustomerCode;
398
+                //        //5--业主(客户档案会员)
399
+                //        wld.UserType = 5;
400
+                //    }
401
+                //    else
402
+                //    {
403
+                //        wld.UserCode = "";
404
+                //    }
405
+                //    //wld.UserCode = "";
406
+                //}
407 407
                 #endregion
408 408
             }
409
-            var model = new BLL.T_Sys_Users().GetModel(wld.OpenId);
410
-            if (model == null)
411
-            {
412
-                model = new Model.T_Sys_Users();
413
-                model.F_OpenId = wld.OpenId;
414
-                model.F_Type = 1;
415
-                model.F_CreateTime = DateTime.Now;
416
-                new BLL.T_Sys_Users().Add(model);
417
-            }
409
+            //var model = new BLL.T_Sys_Users().GetModel(wld.OpenId);
410
+            //if (model == null)
411
+            //{
412
+            //    model = new Model.T_Sys_Users();
413
+            //    model.F_OpenId = wld.OpenId;
414
+            //    model.F_Type = 1;
415
+            //    model.F_CreateTime = DateTime.Now;
416
+            //    new BLL.T_Sys_Users().Add(model);
417
+            //}
418 418
             var newobj = new
419 419
             {
420 420
                 openid = wld.OpenId,
421
-                usercode = wld.UserCode,
422
-                usertype = wld.UserType,
423
-                rolecode = wld.RoleCode,
421
+                //usercode = wld.UserCode,
422
+                //usertype = wld.UserType,
423
+                //rolecode = wld.RoleCode,
424 424
             };
425 425
             return Success("成功", newobj);
426 426
         }
@@ -2441,5 +2441,93 @@ namespace CallCenterApi.Interface.Controllers.weixin
2441 2441
             }
2442 2442
         }
2443 2443
         #endregion
2444
+        #region 用户留言
2445
+        /// <summary>
2446
+        /// 用户留言
2447
+        /// </summary>
2448
+        /// <returns></returns>
2449
+        [WechatActionFilter]
2450
+        public ActionResult AddLeaveMS(string cont)
2451
+        {
2452
+            //ActionExecutingContext filterContext = new ActionExecutingContext();
2453
+            //var openid = filterContext.HttpContext.Request["openid"];
2454
+            //if (openid == null)
2455
+            //{
2456
+            //    return new ContentResult() { Content = new AjaxResult { state = ResultTypes.notoken.ToString(), message = "操作失败,请重新进入公众号" }.ToJson() };
2457
+            //}            
2458
+            string stropenid = HttpUtility.UrlDecode(RequestString.GetFormString("openid"));
2459
+            Model.UserLeaveMes dModel = new Model.UserLeaveMes();
2460
+            #region 保存基本信息
2461
+            dModel.Code = stropenid;
2462
+            dModel.Contents = cont;
2463
+            dModel.CreateTime = DateTime.Now;
2464
+            #endregion
2465
+            if (new BLL.UserLeaveMes().Add(dModel) > 0)
2466
+                return Redirect("保存成功");
2467
+            else
2468
+                return Error("保存失败");
2469
+        }
2470
+        #endregion
2471
+
2472
+        #region
2473
+        /// <summary>
2474
+        /// 获取新闻列表
2475
+        /// </summary>
2476
+        /// <param name="page"></param>
2477
+        /// <param name="pagesize"></param>
2478
+        /// <returns></returns>
2479
+        public ActionResult GetList(int page = 1, int pagesize = 5)
2480
+        {
2481
+            DataTable dt = new DataTable();
2482
+            int recordCount = 0;
2483
+            dt = BLL.PagerBLL.GetListPager(
2484
+                "NewsMassge",
2485
+                "NewsMassge.Id",
2486
+                "*",
2487
+                "",
2488
+                "ORDER BY NewsMassge.Id desc",
2489
+                pagesize,
2490
+                page,
2491
+                true,
2492
+                out recordCount
2493
+                );
2494
+            var obj = new
2495
+            {
2496
+                state = "success",
2497
+                message = "成功",
2498
+                rows = dt,
2499
+                total = recordCount
2500
+            };
2501
+            return Content(obj.ToJson());
2502
+
2503
+        }
2504
+        #endregion
2505
+
2506
+        #region
2507
+        /// <summary>
2508
+        /// 获取新闻详情
2509
+        /// </summary>
2510
+        /// <param name="id"></param>
2511
+        /// <returns></returns>
2512
+        public ActionResult GetNew(int id)
2513
+        {
2514
+
2515
+            if (id > 0)
2516
+            {
2517
+                Model.NewsMassge nmodel = new Model.NewsMassge();
2518
+                nmodel = new BLL.NewsMassge().GetModel(id);
2519
+                if (nmodel != null)
2520
+                {
2521
+                    return Success("获取成功!", nmodel);
2522
+                }
2523
+                else
2524
+                {
2525
+                    return Error("获取失败!");
2526
+                }
2527
+            }
2528
+            else return Error("请选择要修改的数据!");
2529
+
2530
+        }
2531
+        #endregion
2444 2532
     }
2445 2533
 }

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

@@ -53,6 +53,7 @@
53 53
     <Compile Include="his\SF_SHOUSHUXX.cs" />
54 54
     <Compile Include="his\SF_YIHUXX.cs" />
55 55
     <Compile Include="his\SF_ZHENDUAN.cs" />
56
+    <Compile Include="NewsMassge.cs" />
56 57
     <Compile Include="orders.cs" />
57 58
     <Compile Include="order_goods.cs" />
58 59
     <Compile Include="PageData.cs" />
@@ -151,6 +152,7 @@
151 152
     <Compile Include="T_Wo_WorkOrder_Logs.cs" />
152 153
     <Compile Include="T_Wo_WorkOrder_Que_Map.cs" />
153 154
     <Compile Include="UserAccount.cs" />
155
+    <Compile Include="UserLeaveMes.cs" />
154 156
     <Compile Include="vw_CTI_TaskPager.cs" />
155 157
   </ItemGroup>
156 158
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 60 - 0
codegit/CallCenterApi/CallCenterApi.Model/NewsMassge.cs

@@ -0,0 +1,60 @@
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
+    [Serializable]
10
+    public partial class NewsMassge
11
+    {
12
+        public NewsMassge()
13
+        { }
14
+        #region Model
15
+        private int _id;
16
+        private string _title;
17
+        private string _contents;
18
+        private string _fabu;
19
+        private string _name;
20
+        private DateTime? _date;
21
+        private DateTime? _update;
22
+        public int Id
23
+        {
24
+            set { _id = value; }
25
+            get { return _id; }
26
+        }
27
+        public string Title
28
+        {
29
+            set { _title = value; }
30
+            get { return _title; }
31
+        }
32
+        public string Contents
33
+        {
34
+            set { _contents = value; }
35
+            get { return _contents; }
36
+        }
37
+        public string FabuCode
38
+        {
39
+            set { _fabu = value; }
40
+            get { return _fabu; }
41
+        }
42
+        public string FabuName
43
+        {
44
+            set { _name = value; }
45
+            get { return _name; }
46
+        }
47
+        public DateTime? FabuDate
48
+        {
49
+            set { _date = value; }
50
+            get { return _date; }
51
+        }
52
+        public DateTime? UpdateTime
53
+        {
54
+            set { _update = value; }
55
+            get { return _update; }
56
+        }
57
+
58
+        #endregion
59
+    }
60
+}

+ 6 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_SMS_List.cs

@@ -23,6 +23,7 @@ namespace CallCenterApi.Model
23 23
         private string _mname;
24 24
         private DateTime? _createdate;
25 25
         private string _batchno;
26
+        private int _f_IsDelete;
26 27
         /// <summary>
27 28
         /// 短信ID
28 29
         /// </summary>
@@ -127,6 +128,11 @@ namespace CallCenterApi.Model
127 128
             set { _batchno = value; }
128 129
             get { return _batchno; }
129 130
         }
131
+        public int F_IsDelete
132
+        {
133
+            set { _f_IsDelete = value; }
134
+            get { return _f_IsDelete; }
135
+        }
130 136
         #endregion Model
131 137
 
132 138
     }

+ 42 - 0
codegit/CallCenterApi/CallCenterApi.Model/UserLeaveMes.cs

@@ -0,0 +1,42 @@
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
+    [Serializable]
10
+    public partial class UserLeaveMes
11
+    {
12
+        public UserLeaveMes()
13
+        { }
14
+        #region Model
15
+        private int _id;
16
+        private string _code;
17
+        private string _contents;
18
+        private DateTime? _date;
19
+        public int Id
20
+        {
21
+            set { _id = value; }
22
+            get { return _id; }
23
+        }
24
+        public string Code
25
+        {
26
+            set { _code = value; }
27
+            get { return _code; }
28
+        }
29
+        public string Contents
30
+        {
31
+            set { _contents = value; }
32
+            get { return _contents; }
33
+        }
34
+        public DateTime? CreateTime
35
+        {
36
+            set { _date = value; }
37
+            get { return _date; }
38
+        }
39
+
40
+        #endregion
41
+    }
42
+}