Przeglądaj źródła

修改成已读

liyuanyuan 3 lat temu
rodzic
commit
6c802f1b67

+ 21 - 12
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/SystemManageController.cs

@@ -1626,25 +1626,34 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
1626 1626
         }
1627 1627
 
1628 1628
 
1629
-        [ActionName("noticeData")]
1630
-        [HttpGet]
1631
-        public string noticeListData()
1629
+        public string GetUnreadData()
1632 1630
         {
1633
-            int id = F_UserID;
1634
-            //数据结果集
1635
-            ResponseData dataModel = new ResponseData();
1636
-            string sql = " select top 1 * from T_SYS_Time";
1637
-            DataTable dt = DbHelperSQL.Query(sql).Tables[0];
1631
+            DataTable dt = new YTSoft.BaseCallCenter.BLL.T_Msg_NoticeUsers().GetList("1=1 and F_ReadDate is null and  F_UserId= " + F_UserID + "order by F_ReadDate desc").Tables[0];
1638 1632
 
1633
+            DataTable dtinfo = new DataTable();
1634
+            if (dt.Rows.Count > 0)
1635
+            {
1636
+
1637
+                List<int> noticelist = (from r in dt.AsEnumerable() select r.Field<int>("F_NoticeId")).ToList<int>();
1638
+               dtinfo = new YTSoft.BaseCallCenter.BLL.T_Msg_NoticeInfo().GetList("1=1 and F_State=1 and  F_NoticeId in (  '" + string.Join("','", noticelist) + "')  order by  ISNULL(F_ModifyDate,F_CreateOn) desc").Tables[0];
1639
+            }
1640
+                return JsonConvert.SerializeObject(dtinfo);
1641
+        }
1642
+
1643
+        public bool readNoticeData(int noticeid)
1644
+        {
1645
+            BLL.T_Msg_NoticeUsers noticeUsers = new BLL.T_Msg_NoticeUsers();
1646
+            Model.T_Msg_NoticeUsers model= noticeUsers.GetModel(noticeid,F_UserID);
1647
+            model.F_ReadDate = DateTime.Now;
1648
+            noticeUsers.Update(model);
1649
+            return true;
1639 1650
 
1640
-            dataModel.code = 0;
1641
-            dataModel.count = 1;
1642
-            dataModel.data = dt;
1643 1651
 
1644
-            return JsonConvert.SerializeObject(dataModel);
1645 1652
         }
1646 1653
 
1647 1654
 
1655
+
1656
+
1648 1657
     }
1649 1658
 
1650 1659
     #region 接口基本信息