private ShopSearch populateShopSearch(DataInfo dataInfo) { ShopSearch shop = new ShopSearch(); shop.setId(dataInfo.getColumnStringValue("id")); shop.setName(dataInfo.getColumnStringValue("name")); shop.setLogo(dataInfo.getColumnStringValue("logo")); shop.setSellerId(dataInfo.getColumnStringValue("seller_id")); shop.setActivityType(dataInfo.getColumnIntegerValue("activity_type")); shop.setCreateTime(dataInfo.getColumnDateValue("create_time")); Seller seller = sellerDao.selectByPrimaryKey(shop.getSellerId()); if (seller != null) { shop.setSellerName(seller.getName()); } return shop; }
private void setAreaInfo(ShopSearch shop) { Seller seller = sellerDao.selectByPrimaryKey(shop.getSellerId()); if (seller != null) { shop.setCityCode(seller.getCityCode()); shop.setCityName(areaCache.findNameById(seller.getCityCode())); shop.setProvinceCode(seller.getProvinceCode()); shop.setProvinceName(areaCache.findNameById(seller.getProvinceCode())); shop.setRegionCode(seller.getRegionCode()); shop.setRegionName(areaCache.findNameById(seller.getRegionCode())); } }