|
@ -1,8 +1,10 @@ |
|
|
package com.epmet.service.org.impl; |
|
|
package com.epmet.service.org.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
import com.epmet.dao.org.CustomerGridDao; |
|
|
import com.epmet.dao.org.CustomerGridDao; |
|
|
import com.epmet.dto.group.AgencyDTO; |
|
|
import com.epmet.dto.group.AgencyDTO; |
|
@ -18,12 +20,13 @@ import com.epmet.dto.user.result.GridUserInfoDTO; |
|
|
import com.epmet.entity.org.CustomerGridEntity; |
|
|
import com.epmet.entity.org.CustomerGridEntity; |
|
|
import com.epmet.service.Issue.IssueService; |
|
|
import com.epmet.service.Issue.IssueService; |
|
|
import com.epmet.service.org.CustomerGridService; |
|
|
import com.epmet.service.org.CustomerGridService; |
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.*; |
|
|
import java.util.Date; |
|
|
import java.util.function.Function; |
|
|
import java.util.List; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
@DataSource(DataSourceConstant.GOV_ORG) |
|
|
@DataSource(DataSourceConstant.GOV_ORG) |
|
@ -157,4 +160,20 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu |
|
|
return customerGridDao.gridListByCustomerId(customerId); |
|
|
return customerGridDao.gridListByCustomerId(customerId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public CustomerGridDTO getGridById(String gridId) { |
|
|
|
|
|
return ConvertUtils.sourceToTarget(baseDao.selectById(gridId), CustomerGridDTO.class); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Map<String, CustomerGridDTO> getGridMap(String customerId) { |
|
|
|
|
|
LambdaQueryWrapper<CustomerGridEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(CustomerGridEntity::getCustomerId, customerId); |
|
|
|
|
|
List<CustomerGridEntity> list = baseDao.selectList(wrapper); |
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
|
|
return Collections.emptyMap(); |
|
|
|
|
|
} |
|
|
|
|
|
return ConvertUtils.sourceToTarget(list, CustomerGridDTO.class).stream().collect(Collectors.toMap(CustomerGridDTO::getId, Function.identity())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|