/** * @Title: readCinema @Description: TODO * * @param * @return void * @throws */ public void readCinema() { String hql = "from Cinema t where t.cinemaCode like ?"; List<Cinema> findAll = generalDAO.findByJPQL(hql, new Object[] {"65%"}).result(Cinema.class); for (Cinema cinema : findAll) { resolveCinema(cinema); } }
/** * @Title: resolveCinema @Description: TODO * * @param @param cinema * @return void * @throws */ public void resolveCinema(Cinema cinema) { String cityCode = StringUtils.left(cinema.getCinemaCode().toString(), 4); String provinceCode = StringUtils.left(cityCode, 2); String cityString = StringUtils.rightPad(cityCode, cityCode.length() + 2, "0"); CityCode province = generalDAO.findById( CityCode.class, StringUtils.rightPad(provinceCode, provinceCode.length() + 4, "0")); CityCode city = generalDAO.findById(CityCode.class, cityString); if (province != null && city != null) { String proName = province.getName() + province.getSuffix(); String cityName = city.getName() + city.getSuffix(); String newName = removeSymbolList(cinema.getCinemaName()); if (proName.equals(cityName)) { one(province, cinema, newName); } else { two(province, city, cinema, newName); } } }