| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.entity.HouseholdEntity; |
| | | import org.springblade.modules.house.vo.HouseParam; |
| | | import org.springblade.modules.house.vo.HouseTree; |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.house.mapper.HouseMapper; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springblade.modules.system.excel.HouseExcel; |
| | | import org.springblade.modules.system.excel.HouseHoldExcel; |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class HouseServiceImpl extends ServiceImpl<HouseMapper, HouseEntity> implements IHouseService { |
| | | |
| | | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Override |
| | | public IPage<HouseVO> selectHousePage(IPage<HouseVO> page, HouseVO house) { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导入房屋数据 |
| | | * @param data |
| | | * @param isCovered |
| | | */ |
| | | @Override |
| | | public void importUserHouse(List<HouseExcel> data, Boolean isCovered) { |
| | | data.forEach(houseExcel -> { |
| | |
| | | List<HouseExcel> houseExcels = baseMapper.export(household); |
| | | return houseExcels; |
| | | } |
| | | |
| | | /** |
| | | * 查询房屋树 |
| | | * @param houseParam |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<HouseTree> getHouseTree(HouseParam houseParam) { |
| | | List<String> houseCodeList = getHouseCodeList(houseParam); |
| | | return NodeTreeUtil.getHouseTree(baseMapper.getHouseTree(houseParam,houseCodeList)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据角色获取地址编号集合 |
| | | * @param houseParam |
| | | * @return |
| | | */ |
| | | private List<String> getHouseCodeList(HouseParam houseParam) { |
| | | List<String> stringList = new ArrayList<>(); |
| | | if (null != houseParam.getRoleName() && !houseParam.getRoleName().equals("")) { |
| | | if (houseParam.getRoleName().equals("网格员")) { |
| | | // 查询对应的房屋地址code |
| | | stringList = gridService.getAddressCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | return stringList; |
| | | } |
| | | } |