Esempio n. 1
0
  @RequestMapping("getOnLinePEManagerList")
  @ResponseBody
  public Map<String, Object> getOnLinePEManagerList(
      @RequestParam(value = "companyId", required = false) String companyId,
      @RequestParam(value = "keyword", required = false) String keyword)
      throws UnsupportedEncodingException {

    if (StringUtils.isNotBlank(keyword)) {
      String paramsTrans = new String(keyword.getBytes("ISO-8859-1"), "UTF-8");
      keyword = java.net.URLDecoder.decode(paramsTrans, "UTF-8");
    }

    Map<String, Object> result = new HashMap<String, Object>();
    List<PEManager> lstPeManager = peProductService.selectOnLinePEManager(companyId, keyword);
    result.put("total", lstPeManager != null ? lstPeManager.size() : 0);
    List<Lable> lstLable = new ArrayList<Lable>();
    for (PEManager peManager : lstPeManager) {
      Lable lable = new Lable();
      lable.setId(peManager.getId().toString());
      lable.setTitle(peManager.getCompanyName() + ":" + peManager.getName());
      lstLable.add(lable);
    }
    result.put("data", lstLable);
    return result;
  }