@RequestMapping(value = {"/chushou"}) public void getHouseSecondInformation( Model model, HttpServletRequest request, HttpServletResponse response) { List<PartnerBaiduHouseSecond> houseList = partnerBaiduHouseSecondService.getHouseList(BATCH_ROW_COUNT); if (houseList == null) houseList = new ArrayList<PartnerBaiduHouseSecond>(); cn.hshb.web.partner.baidu.entity.newest.houseSecond.Urlset urlset = cn.hshb.web.partner.baidu.entity.newest.houseSecond.Urlset.fromHouse(houseList); renderMergedOutputModel(urlset, request, response, SALE, ""); // 更新状态 partnerBaiduHouseSecondService.updateHouseInformation(houseList); }
@RequestMapping(value = {"/chushouDel"}) public void DelHouseSecondInformation( Model model, HttpServletRequest request, HttpServletResponse response) { List<PartnerBaiduHouseSecond> houseList = partnerBaiduHouseSecondService.getDeleteHouseList(); if (houseList == null) houseList = new ArrayList<PartnerBaiduHouseSecond>(); cn.hshb.web.partner.baidu.entity.newest.houseSecondDel.Urlset urlset = cn.hshb.web.partner.baidu.entity.newest.houseSecondDel.Urlset.fromHouse(houseList); try { String xmlContent = urlset.toXML("saleDel"); // 测试 // String url = "http://localhost:8080/ddhb/postxml"; // 正式 // String url = // "http://ping.baidu.com/sitemap?site=www.hshb.cn&resource_name=SecondHandHouseDeletehouseproperty&access_token=Hpy8pyXE"; // String respStr = HttpConnectionUtil.postXML(url, xmlContent, "UTF-8", "UTF-8"); String respStr = HttpConnectionUtil.postXML(PUSH_URL_CHUSHOU_DEL, xmlContent, "UTF-8", "UTF-8"); printXML(respStr, response); recordDelXmlContent("chushouDel", respStr); } catch (Exception ex) { log.error("提交删除代码失败", ex); } partnerBaiduHouseSecondService.updateHouseInformation(houseList); }