/** * 商品查询综合表----更新跳转 * * @param model * @param productSelect * @return */ @RequestMapping(value = "updateForward") public String updateForward(Model model, ProductSelect productSelect) { try { ProductSelect productSelectResult = productSelectService.getProductSelectById(productSelect.getId()); model.addAttribute("productSelect", productSelectResult); } catch (Exception e) { LOG.error("productSelect updateForward has error.", e); } return viewPrefix + "/update"; }
/** * 商品查询综合表----删除 * * @param productSelect * @return */ @RequestMapping(value = "delete") @ResponseBody public Wrapper<?> delete(ProductSelect productSelect) { try { productSelect.setUpdateUser(getLoginUserCnName()); if (productSelectService.delete(productSelect)) { return WrapMapper.wrap(Wrapper.SUCCESS_CODE, "删除成功!"); } else { return WrapMapper.wrap(Wrapper.ERROR_CODE, "删除失败!"); } } catch (Exception e) { LOG.error("productSelect delete has error.", e); return WrapMapper.error(); } }
/** * 商品查询综合表----添加 * * @param productSelect * @return */ @RequestMapping(value = "add") @ResponseBody public Wrapper<?> add(ProductSelect productSelect) { try { productSelect.setCreateUser(getLoginUserCnName()); if (productSelectService.insert(productSelect)) { return WrapMapper.wrap(Wrapper.SUCCESS_CODE, "添加成功!"); } else { return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败!"); } } catch (ExistedException e) { LOG.warn("productSelect add fail, exist productSelect."); return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败,已经存在"); } catch (Exception e) { LOG.error("productSelect add has error.", e); return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败!"); } }