Преглед на файлове

事件管理-火灾告警处置相关接口开发

jichaobo преди 2 години
родител
ревизия
f266651d0a

+ 9 - 3
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java

@@ -13,6 +13,7 @@ import com.usky.fire.mapper.PatrolInspectionContentMapper;
 import com.usky.fire.service.PatrolInspectionContentOptionService;
 import com.usky.fire.service.PatrolInspectionContentService;
 import com.usky.fire.service.PatrolInspectionSiteContentService;
+import com.usky.fire.service.util.OnlineMethod;
 import com.usky.fire.service.vo.PatrolInspectionContentExportVo;
 import com.usky.fire.service.vo.PatrolInspectionContentVo;
 import com.usky.system.model.LoginUser;
@@ -163,9 +164,14 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
         if (id != 0 && id != null) {
             queryWrapper.eq(PatrolInspectionContent::getId, id);
         }
+        Integer total = this.count(queryWrapper);
         queryWrapper.orderByDesc(PatrolInspectionContent::getId);
+        if (pageNum != null && pageNum != 0 && pageSize != null && pageSize != 0) {
+            Integer startFate = OnlineMethod.getStartFate(pageNum, pageSize);
+            queryWrapper.last("limit " + startFate + ","+pageSize);
+        }
         List<PatrolInspectionContent> patrolInspectionContentList = this.list(queryWrapper);
-        List<PatrolInspectionContentVo> list = new ArrayList<>();
+//        List<PatrolInspectionContentVo> list = new ArrayList<>();
         List<PatrolInspectionContentVo> patrolInspectionContentVoList = new ArrayList<>();
         if (patrolInspectionContentList.size() > 0) {
             List<Integer> idList = new ArrayList<>();
@@ -197,10 +203,10 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
                 patrolInspectionContentVo.setContentOptionList(contentOptionListOne);
                 patrolInspectionContentVoList.add(patrolInspectionContentVo);
             }
-            list = patrolInspectionContentVoList.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+//            list = patrolInspectionContentVoList.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
 
         }
-        return new CommonPage<>(list, patrolInspectionContentVoList.size(), pageSize, pageNum);
+        return new CommonPage<>(patrolInspectionContentVoList, total, pageSize, pageNum);
     }
 
 

+ 10 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPersonnelServiceImpl.java

@@ -7,10 +7,7 @@ import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.exception.BusinessException;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
-import com.usky.fire.domain.PatrolInspectionArea;
-import com.usky.fire.domain.PatrolInspectionPersonnel;
-import com.usky.fire.domain.PatrolInspectionSite;
-import com.usky.fire.domain.PlanSchedule;
+import com.usky.fire.domain.*;
 import com.usky.fire.mapper.PatrolInspectionPersonnelMapper;
 import com.usky.fire.service.PatrolInspectionAreaService;
 import com.usky.fire.service.PatrolInspectionPersonnelService;
@@ -111,6 +108,13 @@ public class PatrolInspectionPersonnelServiceImpl extends AbstractCrudService<Pa
         if (areaId != 0 && areaId != null) {
             queryWrapper.eq(PatrolInspectionPersonnel::getAreaId, areaId);
         }
+
+        Integer total = this.count(queryWrapper);
+        queryWrapper.orderByDesc(PatrolInspectionPersonnel::getId);
+        if (pageNum != null && pageNum != 0 && pageSize != null && pageSize != 0) {
+            Integer startFate = OnlineMethod.getStartFate(pageNum, pageSize);
+            queryWrapper.last("limit " + startFate + ","+pageSize);
+        }
         List<PatrolInspectionPersonnel> list = this.list(queryWrapper);
         List<PatrolInspectionPersonnelVo> list1 = new ArrayList<>();
         if (list.size() > 0) {
@@ -134,8 +138,8 @@ public class PatrolInspectionPersonnelServiceImpl extends AbstractCrudService<Pa
                 list1.add(patrolInspectionPersonnelVo);
             }
         }
-        List<PatrolInspectionPersonnelVo> list2 = list1.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
-        return new CommonPage<>(list2, list1.size(), pageSize,pageNum);
+//        List<PatrolInspectionPersonnelVo> list2 = list1.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+        return new CommonPage<>(list1, total, pageSize,pageNum);
     }
 
 

+ 9 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java

@@ -535,6 +535,13 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
             queryWrapper.eq(PatrolInspectionPlan::getAreaId, areaId);
         }
         queryWrapper.orderByDesc(PatrolInspectionPlan::getId);
+
+        Integer total = this.count(queryWrapper);
+        queryWrapper.orderByDesc(PatrolInspectionPlan::getId);
+        if (pageNum != null && pageNum != 0 && pageSize != null && pageSize != 0) {
+            Integer startFate = OnlineMethod.getStartFate(pageNum, pageSize);
+            queryWrapper.last("limit " + startFate + ","+pageSize);
+        }
         List<PatrolInspectionPlan> patrolInspectionPlanSonList = this.list(queryWrapper);
         List<PlanSchedule> planScheduleList = planScheduleService.list();
         List<PatrolInspectionPersonnelVo> personnelList = patrolInspectionPersonnelService.patrolInspectionPersonnelSelect(areaId);
@@ -598,8 +605,8 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
             }
             list1.add(patrolInspectionPlanDataVo);
         }
-        List<PatrolInspectionPlanDataVo> list3 = list1.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
-        return new CommonPage<>(list3, list1.size(), pageSize, pageNum);
+//        List<PatrolInspectionPlanDataVo> list3 = list1.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+        return new CommonPage<>(list1, total, pageSize, pageNum);
     }
 
 

+ 10 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionRecordServiceImpl.java

@@ -8,6 +8,7 @@ import com.usky.common.security.utils.SecurityUtils;
 import com.usky.fire.domain.*;
 import com.usky.fire.mapper.PatrolInspectionRecordMapper;
 import com.usky.fire.service.*;
+import com.usky.fire.service.util.OnlineMethod;
 import com.usky.fire.service.vo.*;
 import com.usky.system.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -78,10 +79,17 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
         if (startDateTime != null && "".equals(startDateTime) && endDateTime != null && "".equals(endDateTime)) {
             queryWrapper.between(PatrolInspectionRecord::getCreateTime, startDateTime, endDateTime);
         }
+
+        Integer total = this.count(queryWrapper);
         queryWrapper.orderByDesc(PatrolInspectionRecord::getId);
+        if (pageNum != null && pageNum != 0 && pageSize != null && pageSize != 0) {
+            Integer startFate = OnlineMethod.getStartFate(pageNum, pageSize);
+            queryWrapper.last("limit " + startFate + ","+pageSize);
+        }
+
         List<PatrolInspectionRecord> patrolInspectionRecordList = this.list(queryWrapper);
-        List<PatrolInspectionRecord> list = patrolInspectionRecordList.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
-        return new CommonPage<>(list, patrolInspectionRecordList.size(), pageSize, pageNum);
+//        List<PatrolInspectionRecord> list = patrolInspectionRecordList.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+        return new CommonPage<>(patrolInspectionRecordList, total, pageSize, pageNum);
     }
 
 

+ 11 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java

@@ -6,10 +6,7 @@ import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.exception.BusinessException;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
-import com.usky.fire.domain.PatrolInspectionArea;
-import com.usky.fire.domain.PatrolInspectionSite;
-import com.usky.fire.domain.PlanSite;
-import com.usky.fire.domain.PatrolInspectionSiteContent;
+import com.usky.fire.domain.*;
 import com.usky.fire.mapper.PatrolInspectionSiteMapper;
 import com.usky.fire.service.PatrolInspectionAreaService;
 import com.usky.fire.service.PatrolInspectionSiteService;
@@ -133,10 +130,18 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
         if (siteName != null && !"".equals(siteName)) {
             queryWrapper.like(PatrolInspectionSite::getSiteName, siteName);
         }
+
+
+        Integer total = this.count(queryWrapper);
         queryWrapper.orderByDesc(PatrolInspectionSite::getId);
+        if (pageNum != null && pageNum != 0 && pageSize != null && pageSize != 0) {
+            Integer startFate = OnlineMethod.getStartFate(pageNum, pageSize);
+            queryWrapper.last("limit " + startFate + ","+pageSize);
+        }
+
         List<PatrolInspectionSite> patrolInspectionSiteList = this.list(queryWrapper);
-        List<PatrolInspectionSite> list = patrolInspectionSiteList.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
-        return new CommonPage<>(list, patrolInspectionSiteList.size(), pageNum, pageSize);
+//        List<PatrolInspectionSite> list = patrolInspectionSiteList.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+        return new CommonPage<>(patrolInspectionSiteList, total, pageNum, pageSize);
     }