|
@ -18,6 +18,7 @@ |
|
|
package com.epmet.service.impl; |
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
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.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
@ -25,6 +26,7 @@ import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
|
|
import com.epmet.commons.tools.dto.result.OptionResultDTO; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
@ -50,6 +52,7 @@ import com.epmet.service.CustomerAgencyService; |
|
|
import com.epmet.service.CustomerGridService; |
|
|
import com.epmet.service.CustomerGridService; |
|
|
import com.epmet.util.ModuleConstant; |
|
|
import com.epmet.util.ModuleConstant; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
@ -818,4 +821,42 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu |
|
|
public List<String> selectOrgsByUserId(String userId) { |
|
|
public List<String> selectOrgsByUserId(String userId) { |
|
|
return baseDao.selectOrgsByUserId(userId); |
|
|
return baseDao.selectOrgsByUserId(userId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @Description 获取组织下网格树 |
|
|
|
|
|
* @Param formDTO |
|
|
|
|
|
* @Return {@link List<GridTreeResultDTO>} |
|
|
|
|
|
* @Author zhaoqifeng |
|
|
|
|
|
* @Date 2021/10/25 16:28 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<GridTreeResultDTO> getGridTree(AgencyIdFormDTO formDTO) { |
|
|
|
|
|
return baseDao.selectGridTree(formDTO.getAgencyId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param agencyId |
|
|
|
|
|
* @Description 获取组织下网格选项 |
|
|
|
|
|
* @Param agencyId |
|
|
|
|
|
* @Return {@link List< OptionResultDTO >} |
|
|
|
|
|
* @Author zhaoqifeng |
|
|
|
|
|
* @Date 2021/10/26 14:01 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<OptionResultDTO> getGridOption(String agencyId) { |
|
|
|
|
|
LambdaQueryWrapper<CustomerGridEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(CustomerGridEntity::getPid, agencyId); |
|
|
|
|
|
wrapper.last("ORDER BY CONVERT ( GRID_NAME USING gbk ) ASC"); |
|
|
|
|
|
List<CustomerGridEntity> list = baseDao.selectList(wrapper); |
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
|
} |
|
|
|
|
|
return list.stream().map(item -> { |
|
|
|
|
|
OptionResultDTO dto = new OptionResultDTO(); |
|
|
|
|
|
dto.setLabel(item.getGridName()); |
|
|
|
|
|
dto.setValue(item.getId()); |
|
|
|
|
|
return dto; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|