| | |
| | | import org.springblade.modules.house.mapper.HouseholdMapper; |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class HouseholdServiceImpl extends ServiceImpl<HouseholdMapper, HouseholdEntity> implements IHouseholdService { |
| | | |
| | | @Autowired |
| | | private IDictBizService dictBizService; |
| | | |
| | | @Override |
| | | public IPage<HouseholdVO> selectHouseholdPage(IPage<HouseholdVO> page, HouseholdVO household) { |
| | |
| | | */ |
| | | @Override |
| | | public List<HouseholdVO> getHouseholdListByCode(String code) { |
| | | return baseMapper.getHouseholdListByCode(code); |
| | | // 查询 |
| | | List<HouseholdVO> householdList = baseMapper.getHouseholdListByCode(code); |
| | | // 处理字典 |
| | | handleDictBiz(householdList); |
| | | // 返回 |
| | | return householdList; |
| | | } |
| | | |
| | | /** |
| | | * 处理字典 |
| | | * @param householdList |
| | | */ |
| | | private void handleDictBiz(List<HouseholdVO> householdList) { |
| | | if (householdList.size()>0){ |
| | | // 查询角色关系字典 |
| | | List<DictBiz> dictBizList = dictBizService.getList("roleRelation"); |
| | | if (dictBizList.size()>0) { |
| | | // 遍历 |
| | | for (HouseholdVO householdVO : householdList) { |
| | | if (null != householdVO.getRelationship()) { |
| | | for (DictBiz dictBiz : dictBizList) { |
| | | if (householdVO.getRelationship().toString().equals(dictBiz.getDictKey())) { |
| | | householdVO.setRoleRelationName(dictBiz.getDictValue()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |