| | |
| | | import com.java110.job.adapt.hcGov.HcGovConstant; |
| | | import com.java110.job.adapt.hcGov.asyn.BaseHcGovSendAsyn; |
| | | import com.java110.po.floor.FloorPo; |
| | | import com.java110.po.owner.OwnerPo; |
| | | import com.java110.po.room.RoomPo; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | @Override |
| | | public void execute(Business business, List<Business> businesses) { |
| | | JSONObject data = business.getData(); |
| | | if (data.containsKey(FloorPo.class.getSimpleName())) { |
| | | Object bObj = data.get(FloorPo.class.getSimpleName()); |
| | | JSONArray businessOwnerCars = null; |
| | | if (data.containsKey(RoomPo.class.getSimpleName())) { |
| | | Object bObj = data.get(RoomPo.class.getSimpleName()); |
| | | JSONArray businessRoom = null; |
| | | if (bObj instanceof JSONObject) { |
| | | businessOwnerCars = new JSONArray(); |
| | | businessOwnerCars.add(bObj); |
| | | businessRoom = new JSONArray(); |
| | | businessRoom.add(bObj); |
| | | } else if (bObj instanceof List) { |
| | | businessOwnerCars = JSONArray.parseArray(JSONObject.toJSONString(bObj)); |
| | | businessRoom = JSONArray.parseArray(JSONObject.toJSONString(bObj)); |
| | | } else { |
| | | businessOwnerCars = (JSONArray) bObj; |
| | | businessRoom = (JSONArray) bObj; |
| | | } |
| | | //JSONObject businessOwnerCar = data.getJSONObject("businessOwnerCar"); |
| | | for (int bOwnerCarIndex = 0; bOwnerCarIndex < businessOwnerCars.size(); bOwnerCarIndex++) { |
| | | JSONObject businessOwnerCar = businessOwnerCars.getJSONObject(bOwnerCarIndex); |
| | | for (int bRoomIndex = 0; bRoomIndex < businessRoom.size(); bRoomIndex++) { |
| | | JSONObject businessOwnerCar = businessRoom.getJSONObject(bRoomIndex); |
| | | doAddRoom(business, businessOwnerCar); |
| | | |
| | | } |
| | |
| | | roomDto.setCommunityId( roomPo.getCommunityId() ); |
| | | List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms( roomDto ); |
| | | Assert.listNotNull(roomDtos, "未查询到房屋信息"); |
| | | roomPo = BeanConvertUtil.covertBean(roomDtos.get(0), RoomPo.class); |
| | | |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityId(roomPo.getCommunityId()); |
| | | List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | Assert.listNotNull(communityDtos, "未包含小区信息"); |
| | | |
| | | UnitDto unitDto = new UnitDto(); |
| | | unitDto.setUnitId( roomPo.getUnitId() ); |
| | | unitDto.setCommunityId( roomPo.getCommunityId() ); |
| | | List<UnitDto> unitDtos = unitInnerServiceSMOImpl.queryUnits( unitDto ); |
| | | Assert.listNotNull(unitDtos, "未包含单元信息"); |
| | | |
| | | unitDto = new UnitDto(); |
| | | unitDto.setCommunityId( unitDtos.get( 0 ).getCommunityId() ); |
| | | unitDto.setFloorId( unitDtos.get( 0 ).getFloorId() ); |
| | |
| | | floorDto.setCommunityId( unitDtos.get( 0 ).getCommunityId() ); |
| | | floorDto.setFloorId( unitDtos.get( 0 ).getFloorId() ); |
| | | List<FloorDto> floorDtos = floorInnerServiceSMOImpl.queryFloors( floorDto ); |
| | | Assert.listNotNull(floorDtos, "未通过单元所属ID查到楼栋数据,请检查数据"); |
| | | if(floorDtos == null || floorDtos.size() < 1){ |
| | | return; |
| | | } |
| | | |
| | | FloorDto tmpFloorDto = floorDtos.get(0); |
| | | for (FloorAttrDto floorAttrDto : tmpFloorDto.getFloorAttrDto()) { |