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;
  }
Esempio n. 2
0
 @RequestMapping("/getOnLinePECompanyList")
 @ResponseBody
 public Map<String, Object> getOnLinePECompanyList() {
   Map<String, Object> result = new HashMap<String, Object>();
   result = peProductService.getOnLinePECompanyList();
   return result;
 }
Esempio n. 3
0
 @RequestMapping("/view")
 public String view(PEProduct paraPEProduct, PEProductCtrlModel peProductCtrlModel, Model model) {
   PEProduct peProduct = peProductService.getPEProductById(paraPEProduct.getId());
   model.addAttribute("peProduct", peProduct);
   model.addAttribute("ctrlData", peProductCtrlModel);
   return "admin/pe/peProduct/view";
 }
Esempio n. 4
0
 @RequestMapping("/insertData")
 @ResponseBody
 public Map<String, Object> insertData(
     PEProduct peProduct, PEProductCtrlModel peProductCtrlModel, Model model) {
   Map<String, Object> result = new HashMap<String, Object>();
   if ("0".equals(peProduct.getId())) {
     peProduct.setId(UUIDUtils.getUUIDString());
     int id = peProductService.insertPEProduct(peProduct, peProductCtrlModel);
     result.put("code", "0");
     result.put("bizData", peProduct);
   } else {
     peProductService.updatePEProduct(peProduct, peProductCtrlModel);
     result.put("code", "0");
     result.put("bizData", peProduct);
   }
   return result;
 }
Esempio n. 5
0
  @RequestMapping("/updateData")
  @ResponseBody
  public Map<String, Object> updateData(
      PEProduct peProduct, PEProductCtrlModel peProductCtrlModel, Model model) {
    Map<String, Object> result = new HashMap<String, Object>();
    int id = peProductService.updatePEProduct(peProduct, peProductCtrlModel);
    result.put("code", "0");
    result.put("bizData", peProduct);

    return result;
  }
Esempio n. 6
0
  @RequestMapping("/listData")
  public String listData(PEProductCtrlModel peProductCtrlModel, Model model)
      throws UnsupportedEncodingException {
    if (StringUtils.isNotBlank(peProductCtrlModel.getKeyWord())) {
      String paramsTrans =
          new String(peProductCtrlModel.getKeyWord().getBytes("ISO-8859-1"), "UTF-8");
      peProductCtrlModel.setKeyWord(java.net.URLDecoder.decode(paramsTrans, "UTF-8"));
    }

    List<PEProduct> showData = new ArrayList<PEProduct>();
    showData = peProductService.getPEProductList(peProductCtrlModel);

    model.addAttribute("showData", showData);
    model.addAttribute("ctrlData", peProductCtrlModel);

    return "admin/pe/peProduct/listData";
  }
Esempio n. 7
0
  @RequestMapping("/listDataCount")
  @ResponseBody
  public Map<String, Integer> listDataCount(PEProductCtrlModel peProductCtrlModel)
      throws UnsupportedEncodingException {
    if (StringUtils.isNotBlank(peProductCtrlModel.getKeyWord())) {
      String paramsTrans =
          new String(peProductCtrlModel.getKeyWord().getBytes("ISO-8859-1"), "UTF-8");
      peProductCtrlModel.setKeyWord(java.net.URLDecoder.decode(paramsTrans, "UTF-8"));
    }

    Map<String, Integer> result = new HashMap<String, Integer>();

    Integer total = peProductService.selectListCount(peProductCtrlModel);

    result.put("total", total);

    return result;
  }