| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseInsertAdminDTO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | //查询该房屋下人员的关联信息的关系 |
| | | for (ComMngPopulationHouseUserDO houseUser : houseUserList) { |
| | | population = comMngPopulationDAO.selectById(houseUser.getPopulId()); |
| | | if(population.getIsRent().equals(ComMngPopulationDO.isOk.yes)){ |
| | | if(population != null){ |
| | | if(population.getIsRent() != null && population.getIsRent().equals(ComMngPopulationDO.isOk.yes)){ |
| | | houseUser.setRelationId(ComMngPopulationHouseUserDO.relationId.zuhu); |
| | | }else { |
| | | houseUser.setRelationId(ComMngPopulationHouseUserDO.relationId.zuzhu); |
| | |
| | | updateHouseUserList.add(houseUser); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //查看房子的楼层排序 |
| | | if(house.getFloorNum() == null){ |
| | | if(house.getFloorNum() == null && StringUtils.isNotEmpty(house.getHouseNo())){ |
| | | boolean result = house.getHouseNo().matches("[0-9]+"); |
| | | if (result) {// 该字段为纯数字 |
| | | if (house.getHouseNo().length() == 4) { |
| | | house.setFloorNum(Integer.parseInt(house.getHouseNo().substring(0, 2).replaceAll("^(0+)", ""))); |
| | | String floorNum = house.getHouseNo().substring(0, 2).replaceAll("^(0+)", ""); |
| | | if(StringUtils.isNotEmpty(floorNum)){ |
| | | house.setFloorNum(Integer.parseInt(floorNum)); |
| | | } |
| | | } else if (house.getHouseNo().length() == 3) { |
| | | house.setFloorNum(Integer.parseInt(house.getHouseNo().substring(0, 1).replaceAll("^(0+)", ""))); |
| | | String floorNum = house.getHouseNo().substring(0, 1).replaceAll("^(0+)", ""); |
| | | if(StringUtils.isNotEmpty(floorNum)){ |
| | | house.setFloorNum(Integer.parseInt(floorNum)); |
| | | } |
| | | } |
| | | } |
| | | } |