Browse Source

利率公告

zmm 6 years ago
parent
commit
f041a75bf0

+ 6 - 2
CZKJ.GBRS2.WebMVC/Controllers/PriceAnnouncementController.cs

@@ -20,15 +20,19 @@ namespace CZKJ.GBRS2.WebMVC.Controllers
20 20
             _galleryLogic = galleryLogic;
21 21
             _typeLogic = typeLogic;
22 22
         }
23
-        public IActionResult Index(int typeId, DateTime? startTime, DateTime? endTime)
23
+        public IActionResult Index(int typeId, DateTime? startTime, DateTime? endTime, int pageIndex = 1, int pageSize = 20)
24 24
         {
25 25
             var model = new PriceAnnouncementIndexModel();
26
+            int rowsCount;
26 27
             model.Banner = _galleryLogic.GetGallery(176);
27 28
             model.TypeList = _typeLogic.GetListByParentId(172);
28
-            model.List = _priceAnnouncementLgoic.GetList(typeId, startTime, endTime);
29
+            model.List = _priceAnnouncementLgoic.GetList(typeId, startTime, endTime, pageIndex, pageSize, out rowsCount);
29 30
             model.TypeId = typeId;
30 31
             model.StartTime = startTime;
31 32
             model.EndTime = endTime;
33
+            model.PageIndex = pageIndex;
34
+            model.PageSize = pageSize;
35
+            model.RowsCount = rowsCount;
32 36
             return View(model);
33 37
         }
34 38
     }

+ 7 - 1
CZKJ.GBRS2.WebMVC/Models/PriceAnnouncementIndexModel.cs

@@ -15,10 +15,16 @@ namespace CZKJ.GBRS2.WebMVC.Models
15 15
         /// </summary>
16 16
         public GalleryEntity Banner { get; set; }
17 17
         public NavigationModel NavigationModel { get; set; }
18
-        public IList<TypeEntity> TypeList{get;set;}
18
+        public IList<TypeEntity> TypeList { get; set; }
19 19
         public IList<PriceAnnouncementEntity> List { get; set; }
20 20
         public int TypeId { get; set; }
21 21
         public DateTime? StartTime { get; set; }
22 22
         public DateTime? EndTime { get; set; }
23
+        public int MaxYear { get; set; }
24
+        public int MinYeat { get; set; }
25
+
26
+        public int PageIndex { get; set; }
27
+        public int PageSize { get; set; }
28
+        public int RowsCount { get; set; }
23 29
     }
24 30
 }

+ 3 - 3
CZKJ.GBRS2.WebMVC/Views/PriceAnnouncement/Index.cshtml

@@ -145,9 +145,9 @@
145 145
             {
146 146
                 field: document.getElementById('date_start'),
147 147
                 firstDay: 1,
148
-                minDate: new Date(2001, 0, 1),
149
-                maxDate: new Date(2020, 12, 31),
150
-                yearRange: [2001, 2020],
148
+                minDate: new Date(2016, 0, 1),
149
+                maxDate: new Date(2040, 12, 31),
150
+                yearRange: [2016, 2040],
151 151
                 i18n: i18n,
152 152
                 onSelect: function (e) {
153 153
                     $('#date_start').attr('date-start', e.toJSON());

+ 1 - 1
CZKJ.GBRS2/Interface/IPriceAnnouncement.cs

@@ -12,6 +12,6 @@ namespace CZKJ.GBRS2.Interface
12 12
     public interface IPriceAnnouncement : ILogicBase<PriceAnnouncementEntity>
13 13
     {
14 14
         IList<PriceAnnouncementEntity> GetTableList(int? typeId,int pageIndex,int pageSize, out int rowsCount);
15
-        IList<PriceAnnouncementEntity> GetList(int typeId, DateTime? startTime, DateTime? endTime);
15
+        IList<PriceAnnouncementEntity> GetList(int typeId, DateTime? startTime, DateTime? endTime, int pageIndex, int pageSize, out int rowsCount);
16 16
     }
17 17
 }

+ 3 - 2
CZKJ.GBRS2/Logic/PriceAnnouncementLogic.cs

@@ -11,7 +11,7 @@ namespace CZKJ.GBRS2.Logic
11 11
 {
12 12
     public class PriceAnnouncementLogic : LogicBase<PriceAnnouncementEntity>, IPriceAnnouncement
13 13
     {
14
-        public IList<PriceAnnouncementEntity> GetList(int typeId, DateTime? startTime, DateTime? endTime)
14
+        public IList<PriceAnnouncementEntity> GetList(int typeId, DateTime? startTime, DateTime? endTime,int pageIndex, int pageSize, out int rowsCount)
15 15
         {
16 16
             IQueryable<PriceAnnouncementEntity> query = DbContext.Set<PriceAnnouncementEntity>();
17 17
             if (typeId != 0)
@@ -22,7 +22,8 @@ namespace CZKJ.GBRS2.Logic
22 22
             {
23 23
                 query = query.Where(x => x.DateTime >= startTime && x.DateTime <= endTime);
24 24
             }
25
-            var result = query.Join(DbContext.Set<TypeEntity>(), x => x.Typeofinsuance, y => y.Id, (x, y) => new { x, y.Name }).OrderByDescending(x => x.x.DateTime).ToList();
25
+            rowsCount = query.Count();
26
+            var result = query.Join(DbContext.Set<TypeEntity>(), x => x.Typeofinsuance, y => y.Id, (x, y) => new { x, y.Name }).OrderByDescending(x => x.x.DateTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
26 27
             return result.Select(x => new PriceAnnouncementEntity
27 28
             {
28 29
                 TypeName = x.Name,