@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"; }
@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; }