| | |
| | | import com.java110.po.room.RoomPo; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.utils.util.*; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | |
| | | List<RoomDto> rooms = BeanConvertUtil.covertBeanList(roomServiceDaoImpl.getRoomInfoByCommunityId(BeanConvertUtil.beanCovertMap(roomDto)), RoomDto.class); |
| | | |
| | | if (rooms == null || rooms.size() == 0) { |
| | | if (ListUtil.isNull(rooms)) { |
| | | return rooms; |
| | | } |
| | | |
| | |
| | | |
| | | for (RoomDto room : rooms) { |
| | | try { |
| | | room.setApartmentName(MappingCache.getValue(room.getApartment().substring(0, 2).toString()) + MappingCache.getValue(room.getApartment().substring(2, 5).toString())); |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setRoomId(room.getRoomId()); |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | try { |
| | | Assert.listOnlyOne(ownerRoomRelDtos, "查询业主房屋关系表错误!"); |
| | | room.setApartmentName(MappingCache.getValue(room.getApartment().substring(0, 2).toString()) + MappingCache.getValue(room.getApartment().substring(2, 5).toString())); |
| | | room.setOwnerId(ownerRoomRelDtos.get(0).getOwnerId()); |
| | | room.setOwnerName(ownerRoomRelDtos.get(0).getOwnerName()); |
| | | } catch (Exception ignored) {} |
| | | } catch (Exception e) { |
| | | logger.error("设置房屋户型失败", e); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (roomAttrDtos == null || roomAttrDtos.size() == 0) { |
| | | if (ListUtil.isNull(roomAttrDtos)) { |
| | | return; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<RoomDto> queryRoomsByOwner(@RequestBody RoomDto roomDto) { |
| | | |
| | | // List<RoomDto> rooms = BeanConvertUtil.covertBeanList(roomServiceDaoImpl.getRoomInfoByOwner(BeanConvertUtil.beanCovertMap(roomDto)), |
| | | // RoomDto.class); |
| | | // |
| | | // if (rooms == null || rooms.size() == 0) { |
| | | // return rooms; |
| | | // } |
| | | |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setOwnerId(roomDto.getOwnerId()); |
| | | ownerRoomRelDto.setOwnerNameLike(roomDto.getOwnerNameLike()); |
| | | ownerRoomRelDto.setStatusCd(roomDto.getStatusCd()); |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) { |
| | | if (ListUtil.isNull(ownerRoomRelDtos)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | RoomDto tmpRoomDto = new RoomDto(); |
| | | List<String> roomIds = new ArrayList<>(); |
| | | for (OwnerRoomRelDto tmpOwnerRoomRelDto : ownerRoomRelDtos) { |
| | | roomIds.add(tmpOwnerRoomRelDto.getRoomId()); |
| | | tmpRoomDto.setOwnerId(tmpOwnerRoomRelDto.getOwnerId()); |
| | | tmpRoomDto.setOwnerName(tmpOwnerRoomRelDto.getOwnerName()); |
| | | } |
| | | RoomDto tmpRoomDto = new RoomDto(); |
| | | tmpRoomDto.setRoomIds(roomIds.toArray(new String[roomIds.size()])); |
| | | tmpRoomDto.setRoomNum(roomDto.getRoomNum()); |
| | | tmpRoomDto.setCommunityId(roomDto.getCommunityId()); |
| | | return queryRooms(tmpRoomDto); |
| | | List<RoomDto> roomDtos = queryRooms(tmpRoomDto); |
| | | if(ListUtil.isNull(roomDtos)){ |
| | | return roomDtos; |
| | | } |
| | | for (OwnerRoomRelDto tmpOwnerRoomRelDto : ownerRoomRelDtos) { |
| | | for(RoomDto tRoomDto:roomDtos){ |
| | | if(!tmpOwnerRoomRelDto.getRoomId().equals(tRoomDto.getRoomId())){ |
| | | continue; |
| | | } |
| | | tRoomDto.setStartTime(tmpOwnerRoomRelDto.getStartTime()); |
| | | tRoomDto.setEndTime(tmpOwnerRoomRelDto.getEndTime()); |
| | | } |
| | | } |
| | | |
| | | return roomDtos; |
| | | |
| | | } |
| | | |
| | |
| | | importRoomFee.setFloorNum(infos.get(0).get("floorNum").toString()); |
| | | importRoomFee.setUnitNum(infos.get(0).get("unitNum").toString()); |
| | | importRoomFee.setRoomNum(infos.get(0).get("roomNum").toString()); |
| | | importRoomFee.setRoomName(importRoomFee.getFloorNum()+"-"+importRoomFee.getUnitNum()+"-"+importRoomFee.getRoomNum()); |
| | | importRoomFee.setRoomName(importRoomFee.getFloorNum() + "-" + importRoomFee.getUnitNum() + "-" + importRoomFee.getRoomNum()); |
| | | |
| | | } |
| | | return importRoomFees; |
| | |
| | | return importCustomCreateFeeDtos; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> queryRoomsAsReport(RoomDto roomDto) { |
| | | return roomServiceDaoImpl.queryRoomsAsReport(BeanConvertUtil.beanCovertMap(roomDto)); |
| | | } |
| | | |
| | | public IRoomServiceDao getRoomServiceDaoImpl() { |
| | | return roomServiceDaoImpl; |
| | | } |