Selaa lähdekoodia

公告消息bug调整

zhengbingbing 6 vuotta sitten
vanhempi
commit
006ca8bdae

+ 0 - 2
codegit/CallCenterApi/CallCenterApi.DAL/T_Msg_NoticeInfo.cs

@@ -83,8 +83,6 @@ namespace CallCenterApi.DAL
83 83
             SqlParameter[] parameters = {
84 84
                     new SqlParameter("@F_Title", SqlDbType.NVarChar,100),
85 85
                     new SqlParameter("@F_Content", SqlDbType.NText),
86
-                    new SqlParameter("@F_StartDate", SqlDbType.DateTime),
87
-                    new SqlParameter("@F_EndDate", SqlDbType.DateTime),
88 86
                     new SqlParameter("@F_CreateOn", SqlDbType.DateTime),
89 87
                     new SqlParameter("@F_CreateBy", SqlDbType.Int,4),
90 88
                     new SqlParameter("@F_ModifyBy", SqlDbType.Int,4),

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/MsgController.cs

@@ -382,7 +382,7 @@ namespace CallCenterApi.Interface.Controllers
382 382
                 new BLL.T_Msg_List().Add(msg);
383 383
             }
384 384
             #endregion
385
-            var msgListnew = new BLL.T_Msg_List().GetModelList(" ToUser='" + usercode + "' and Type in (2,4) and State=0 and IsDel=0 ");
385
+            var msgListnew = new BLL.T_Msg_List().GetModelList(" ToUser='" + usercode + "' and Type in (2,4,5) and State=0 and IsDel=0 order by CreateDate desc");
386 386
             return Success("获取消息", msgListnew);
387 387
         }
388 388
 

+ 10 - 6
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/information/NoticeController.cs

@@ -63,7 +63,7 @@ namespace CallCenterApi.Interface.Controllers.information
63 63
             dtrole = rolebll.GetAllList().Tables[0];
64 64
 
65 65
             var users = ""; var roles = "";
66
-            if (noticeid != null)
66
+            if (noticeid != null && noticeid.Trim()!="")
67 67
             {
68 68
                 Model.T_Msg_NoticeInfo dModel = dBLL.GetModel(int.Parse(noticeid.Trim()));
69 69
                 if (dModel != null)
@@ -116,12 +116,12 @@ namespace CallCenterApi.Interface.Controllers.information
116 116
             }
117 117
             return Success("获取角色用户成功", newdt);
118 118
         }
119
-
119
+        
120 120
         // 获取公告列表
121 121
         public ActionResult GetList(string sdate,string edate,int pageindex=1,int pagesize=10)
122 122
         {
123 123
             DataTable dt = new DataTable();
124
-            string sql = " ";
124
+            string sql = " and F_isDel=0 ";
125 125
             if (sdate != null && sdate.Trim() != "")
126 126
             {
127 127
                 sql += " and Datediff(day,F_CreateOn,'" + sdate.Trim() + "')>=0";
@@ -178,7 +178,7 @@ namespace CallCenterApi.Interface.Controllers.information
178 178
             int roleId = CurrentUser.UserData.F_RoleId;
179 179
             DataTable dt = new DataTable();
180 180
             
181
-            string sql = " 1 = 1 and (ISNULL(F_UserId,'') = '' or ISNULL(F_UserId,'') like '%," + userID + ",%') ";
181
+            string sql = " F_isDel=0 and (ISNULL(F_UserId,'') = '' or ISNULL(F_UserId,'') like '%," + userID + ",%') ";
182 182
             dt = new BLL.T_Msg_NoticeInfo().GetList(top, sql, " F_NoticeId desc ").Tables[0];
183 183
             int recordCount = dt.Rows.Count;
184 184
             var obj = new
@@ -231,7 +231,7 @@ namespace CallCenterApi.Interface.Controllers.information
231 231
             if (title != null)
232 232
                 dModel.F_Title = title.Trim();
233 233
             if (content != null)
234
-                dModel.F_Content = WebHelper.UrlDecode(content);
234
+                dModel.F_Content = content.Trim();
235 235
             dModel.F_isCus = iscus;
236 236
             //添加权限
237 237
             dModel.F_RoleId = "," + roleid + ",";
@@ -297,7 +297,7 @@ namespace CallCenterApi.Interface.Controllers.information
297 297
                     if (title != null)
298 298
                         dModel.F_Title = title.Trim();
299 299
                     if (content != null)
300
-                        dModel.F_Content = WebHelper.UrlDecode(content);
300
+                        dModel.F_Content = content.Trim();
301 301
                     dModel.F_isCus = iscus;
302 302
                     //添加权限
303 303
                     dModel.F_RoleId = "," + roleid.Trim() + ",";//= roleid
@@ -383,7 +383,11 @@ namespace CallCenterApi.Interface.Controllers.information
383 383
                 bool r = dBLL.DeleteList(idds.Trim(','));
384 384
 
385 385
                 if (r)
386
+                {
387
+                    //若通知删除则取消消息提醒
388
+                    DbHelperSQL.ExecuteSql("update T_Msg_List set IsDel=1 where ToID in (" + idds.Trim(',') + ") and Type=5");
386 389
                     return Success("删除成功");
390
+                }
387 391
                 else
388 392
                 {
389 393
                     return Error("删除失败");

+ 42 - 6
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -958,11 +958,27 @@ namespace CallCenterApi.Interface.Controllers.weixin
958 958
             pageindex,
959 959
             true,
960 960
             out recordCount);
961
+            List<Model.T_Msg_NoticeInfo> msgList = new BLL.T_Msg_NoticeInfo().DataTableToList(dt);
962
+            List<Model.T_Sys_UserAccount> userList = new BLL.T_Sys_UserAccount().GetModelList("");
961 963
             var obj = new
962 964
             {
963
-                state = "success",
964
-                message = "成功",
965
-                rows = dt,
965
+                rows = msgList.Select(m =>
966
+                {
967
+                    Model.T_Sys_UserAccount usermodel = userList.Where(u => u.F_UserId == m.F_CreateBy.Value).FirstOrDefault();
968
+                    var uname = "";
969
+                    if (usermodel != null)
970
+                        uname = usermodel.F_UserName;
971
+                    return new
972
+                    {
973
+                        F_NoticeId = m.F_NoticeId,
974
+                        F_Title = m.F_Title,
975
+                        F_Content = m.F_Content,
976
+                        F_isCus = m.F_isCus,
977
+                        F_CreateOn = m.F_CreateOn,
978
+                        F_CreateBy = m.F_CreateBy,
979
+                        F_CreateByName = uname
980
+                    };
981
+                }),
966 982
                 total = recordCount
967 983
             };
968 984
             return Content(obj.ToJson());
@@ -980,9 +996,29 @@ namespace CallCenterApi.Interface.Controllers.weixin
980 996
                 return Error("参数错误");
981 997
             if (string.IsNullOrEmpty(stropenid))
982 998
                 return Error("参数错误!");
983
-            var model = new BLL.T_Msg_NoticeInfo().GetModel(int.Parse(strnoticeid.Trim()));
984
-            if (model != null)
985
-                return Success("获取公告详情成功", model);
999
+            var dModel = new BLL.T_Msg_NoticeInfo().GetModel(int.Parse(strnoticeid.Trim()));
1000
+            Model.T_Sys_UserAccount userModel = new Model.T_Sys_UserAccount();
1001
+            if (dModel != null)
1002
+            {
1003
+                if (dModel.F_CreateBy != null)
1004
+                    userModel = new BLL.T_Sys_UserAccount().GetModel(dModel.F_CreateBy.Value);
1005
+                var uname = "";
1006
+                if (userModel != null)
1007
+                    uname = userModel.F_UserName;
1008
+                var obj = new
1009
+                {
1010
+                    F_NoticeId = dModel.F_NoticeId,
1011
+                    F_Title = dModel.F_Title,
1012
+                    F_Content = dModel.F_Content,
1013
+                    F_isCus = dModel.F_isCus,
1014
+                    F_CreateOn = dModel.F_CreateOn,
1015
+                    F_CreateBy = dModel.F_CreateBy,
1016
+                    F_CreateByName = uname,
1017
+                    F_UserId = dModel.F_UserId,
1018
+                    F_RoleId = dModel.F_RoleId,
1019
+                };
1020
+                return Success("获取公告详情成功", dModel);
1021
+            }
986 1022
             else
987 1023
                 return Error("获取公告详情失败");
988 1024
         }