|
@ -18,7 +18,6 @@ |
|
|
package com.epmet.service.impl; |
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
@ -34,6 +33,8 @@ import com.epmet.redis.GovRoleRedis; |
|
|
import com.epmet.service.GovRoleMenuService; |
|
|
import com.epmet.service.GovRoleMenuService; |
|
|
import com.epmet.service.GovRoleService; |
|
|
import com.epmet.service.GovRoleService; |
|
|
import com.epmet.service.GovRoleUserService; |
|
|
import com.epmet.service.GovRoleUserService; |
|
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -64,11 +65,20 @@ public class GovRoleServiceImpl extends BaseServiceImpl<GovRoleDao, GovRoleEntit |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<GovRoleDTO> page(Map<String, Object> params) { |
|
|
public PageData<GovRoleDTO> page(Map<String, Object> params) { |
|
|
IPage<GovRoleEntity> page = baseDao.selectPage( |
|
|
Integer pageNo = Integer.valueOf((String) params.get("pageNo")); |
|
|
getPage(params, FieldConstant.CREATED_TIME, false), |
|
|
Integer pageSize = Integer.valueOf((String) params.get("pageSize")); |
|
|
getWrapper(params) |
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
); |
|
|
String name = (String) params.get(FieldConstant.NAME_HUMP); |
|
|
return getPageData(page, GovRoleDTO.class); |
|
|
String customerId = (String) params.get(FieldConstant.CUSTOMER_ID_HUMP); |
|
|
|
|
|
QueryWrapper<GovRoleEntity> wrapper = new QueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id) |
|
|
|
|
|
.like(StringUtils.isNotBlank(name), FieldConstant.NAME, name) |
|
|
|
|
|
.eq(StringUtils.isNotBlank(customerId), FieldConstant.CUSTOMER_ID, customerId); |
|
|
|
|
|
PageHelper.startPage(pageNo, pageSize); |
|
|
|
|
|
List<GovRoleEntity> list = baseDao.selectList(wrapper); |
|
|
|
|
|
List<GovRoleDTO> resList = ConvertUtils.sourceToTarget(list, GovRoleDTO.class); |
|
|
|
|
|
PageInfo<GovRoleDTO> pageInfo = new PageInfo<>(resList); |
|
|
|
|
|
return new PageData<>(resList, pageInfo.getTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|