|
@@ -2,7 +2,6 @@ package com.usky.fire.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
-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;
|
|
@@ -66,7 +65,7 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
|
|
|
queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
|
|
|
.eq(PatrolInspectionArea::getId, patrolInspectionArea.getAreaFid());
|
|
|
List<PatrolInspectionArea> list = this.list(queryWrapper);
|
|
|
- if (list.size()<=0){
|
|
|
+ if (list.size() <= 0) {
|
|
|
throw new BusinessException("父级ID不存在");
|
|
|
}
|
|
|
patrolInspectionArea.setCompanyId(list.get(0).getCompanyId());
|
|
@@ -117,15 +116,13 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
|
|
|
*
|
|
|
* @param id 区域ID
|
|
|
* @param areaName 区域名称
|
|
|
- * @param pageNum 当前页
|
|
|
- * @param pageSize 每页条数
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public CommonPage<PatrolInspectionArea> patrolInspectionAreaList(Integer id, String areaName, Integer pageNum, Integer pageSize) {
|
|
|
+ public List<PatrolInspectionArea> patrolInspectionAreaList(Integer id, String areaName) {
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
String userType = null;
|
|
|
- if (loginUser!=null&&!"".equals(loginUser)){
|
|
|
+ if (loginUser != null && !"".equals(loginUser)) {
|
|
|
userType = loginUser.getUserType();
|
|
|
}
|
|
|
LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
|
|
@@ -140,15 +137,9 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
|
|
|
if (!"".equals(areaName) && areaName != null) {
|
|
|
queryWrapper.like(PatrolInspectionArea::getAreaName, areaName);
|
|
|
}
|
|
|
- Integer total = this.count(queryWrapper);
|
|
|
queryWrapper.orderByDesc(PatrolInspectionArea::getId);
|
|
|
- if (pageNum != null && pageNum != 0 && pageSize != null && pageSize != 0) {
|
|
|
- Integer startFate = OnlineMethod.getStartFate(pageNum, pageSize);
|
|
|
- queryWrapper.last("limit " + startFate + ","+pageSize);
|
|
|
- }
|
|
|
List<PatrolInspectionArea> list = this.list(queryWrapper);
|
|
|
-
|
|
|
- return new CommonPage<>(list, total, pageSize, pageNum);
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -161,7 +152,7 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
|
|
|
public List<PatrolInspectionArea> patrolInspectionAreaSelect(Integer areaFid) {
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
String userType = null;
|
|
|
- if (loginUser!=null&&!"".equals(loginUser)){
|
|
|
+ if (loginUser != null && !"".equals(loginUser)) {
|
|
|
userType = loginUser.getUserType();
|
|
|
}
|
|
|
LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
|