private List<Expert> getResults4() { List<Expert> list = new ArrayList<>(); for (int i = 0; i < this.pageSize; i++) { Expert expert = new Expert(); expert.setName("专家" + i); expert.setWorkUnit("农业部"); expert.setAreaName("山东,济南,历下" + i); expert.setAttention(100); expert.setDept("果蔬加工部门"); expert.setProfessionalTitle("教授"); expert.setLogo( "http://static.fundview.cn/thumb/comp/logo/20140929/2014092909563543921_104_78.png"); expert.setRecommendNum(123); expert.setTradeName("果蔬加工"); expert.setUpdateDate(new Date().getTime()); expert.setId(100 + i); list.add(expert); } return list; }
/** 处理结果 */ @Override protected void doHandleResult() { int type = Integer.parseInt(map.get("type")); webView.loadUrl("javascript:Page.cleanData(" + map.get("type") + ")"); if (type == 0) { expertList = getResults4(); if (null != expertList && expertList.size() > 0) { // 循环加载项目 for (Expert item : expertList) { String oldLogoName = item.getLogoLocalPath(); if (oldLogoName != null && oldLogoName.trim() != "") { oldLogoName = oldLogoName.substring(oldLogoName.lastIndexOf("/") + 1); } // expertId, logo, expertName, professionalTitle, trade, /*workUnit, dept, */area, // updateDate, oldFileName String js = JsMethod.createJs( "javascript:Page.addExpert(${id}, ${logo}, ${name}, ${professionalTitle}, ${trade}, ${area}, ${time},${oldFileName});", item.getId(), item.getLogo(), item.getName(), item.getProfessionalTitle(), item.getTradeName(), item.getAreaName(), item.getUpdateDate(), item.getLogoLocalPath()); webView.loadUrl(js); } totalPage = 10; if (page < totalPage) { webView.loadUrl("javascript:Page.moreBtn('true');"); } else { webView.loadUrl("javascript:Page.moreBtn('false');"); } webView.loadUrl("javascript:Page.hintError(" + false + ");"); } else { // 加载失败 webView.loadUrl("javascript:Page.hintError(" + true + ");"); } } else if (type == 1) { // 填充成果 achvList = getResults1(); if (null != achvList && achvList.size() > 0) { // 循环加载项目 for (Achv item : achvList) { String oldLogoName = item.getOldLocalPath(); if (oldLogoName != null && oldLogoName.trim() != "") { oldLogoName = oldLogoName.substring(oldLogoName.lastIndexOf("/") + 1); } // achvId, logo, name, trade, price, ownerName, lastModify String js = JsMethod.createJs( "javascript:Page.addItem(${id}, ${logo}, ${name}, ${trade}, ${price}, ${ownerName}, ${time});", item.getId(), item.getLogo(), item.getName(), item.getTradeName(), item.getPrice(), item.getOwnerName(), item.getUpdataDate()); webView.loadUrl(js); } totalPage = 10; if (page < totalPage) { webView.loadUrl("javascript:Page.moreBtn('true');"); } else { webView.loadUrl("javascript:Page.moreBtn('false');"); } webView.loadUrl("javascript:Page.hintError(" + false + ");"); } else { // 加载失败 webView.loadUrl("javascript:Page.hintError(" + true + ");"); } } else if (type == 2) { // 填充企业 compList = getResults2(); if (null != compList && compList.size() > 0) { // 循环加载项目 for (Company item : compList) { String oldLogoName = item.getLocalLogo(); if (oldLogoName != null && oldLogoName.trim() != "") { oldLogoName = oldLogoName.substring(oldLogoName.lastIndexOf("/") + 1); } // compId, logo, compName, trade, area, updateDate, oldLogo, expoNo String js = JsMethod.createJs( "javascript:Page.addCompany(${id}, ${logo}, ${name}, ${trade}, ${area}, ${time}, ${oldFileName},${expoNo});", item.getId(), item.getLogo(), item.getName(), item.getTradeName(), item.getAreaName(), item.getUpdateDate(), oldLogoName, item.getExpoNo()); System.out.println(js); webView.loadUrl(js); } totalPage = 10; if (page < totalPage) { webView.loadUrl("javascript:Page.moreBtn('true');"); } else { webView.loadUrl("javascript:Page.moreBtn('false');"); } webView.loadUrl("javascript:Page.hintError(" + false + ");"); } else { // 加载失败 webView.loadUrl("javascript:Page.hintError(" + true + ");"); } } else if (type == 3) { // 填充需求 requList = getResults3(); if (null != requList && requList.size() > 0) { // 循环加载项目 for (Requ item : requList) { String oldLogoName = item.getLogoLocalPath(); if (oldLogoName != null && oldLogoName.trim() != "") { oldLogoName = oldLogoName.substring(oldLogoName.lastIndexOf("/") + 1); } // requId, logo, name, hj, price, oldLogo, ownerName,lastModify String js = JsMethod.createJs( "javascript:Page.addRequ(${id}, ${logo}, ${name}, ${hj},${price},${oldLogo}, ${ownerName}, ${time});", item.getId(), item.getLogo(), item.getName(), item.getHj(), item.getFinPlan(), item.getLogoLocalPath(), item.getOwnerName(), item.getUpdateTime()); webView.loadUrl(js); } totalPage = 10; if (page < totalPage) { webView.loadUrl("javascript:Page.moreBtn('true');"); } else { webView.loadUrl("javascript:Page.moreBtn('false');"); } webView.loadUrl("javascript:Page.hintError(" + false + ");"); } else { // 加载失败 webView.loadUrl("javascript:Page.hintError(" + true + ");"); } } this.closeWaitDialog(); }