Пример #1
0
  @Log(message = "批量删除了id={0}。")
  @RequiresPermissions("ClassifyInfo:delete")
  @RequestMapping(value = "/delete", method = RequestMethod.POST)
  public @ResponseBody String deleteMany(Long[] ids) {
    for (int i = 0; i < ids.length; i++) {
      ClassifyInfo classifyInfo = classifyInfoService.get(ids[i]);
      classifyInfoService.delete(classifyInfo.getId());
    }

    LogUitls.putArgs(LogMessageObject.newWrite().setObjects(new Object[] {Arrays.toString(ids)}));
    return AjaxObject.newOk("删除成功!").setCallbackType("").toString();
  }
Пример #2
0
 @RequiresPermissions("ClassifyInfo:edit")
 @RequestMapping(value = "/update/{id}", method = RequestMethod.GET)
 public String preUpdate(@PathVariable Long id, Map<String, Object> map) {
   ClassifyInfo classifyInfo = classifyInfoService.get(id);
   map.put("classifyInfo", classifyInfo);
   mapPutCostsCategoriess(map);
   return UPDATE;
 }
Пример #3
0
 @ModelAttribute("preloadClassifyInfo")
 public ClassifyInfo preload(@RequestParam(value = "id", required = false) Long id) {
   if (id != null) {
     ClassifyInfo classifyInfo = classifyInfoService.get(id);
     return classifyInfo;
   }
   return null;
 }
Пример #4
0
 @RequiresPermissions("ClassifyInfo:view")
 @RequestMapping(
     value = "/view/{id}",
     method = {RequestMethod.GET})
 public String view(@PathVariable Long id, Map<String, Object> map) {
   ClassifyInfo classifyInfo = classifyInfoService.get(id);
   map.put("classifyInfo", classifyInfo);
   return VIEW;
 }
Пример #5
0
  @Log(message = "删除了id={0}。")
  @RequiresPermissions("ClassifyInfo:delete")
  @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
  public @ResponseBody String delete(@PathVariable Long id) {
    classifyInfoService.delete(id);

    LogUitls.putArgs(LogMessageObject.newWrite().setObjects(new Object[] {id}));
    return AjaxObject.newOk("删除成功!").setCallbackType("").toString();
  }
Пример #6
0
  @Log(message = "添加了id={0}。")
  @RequiresPermissions("ClassifyInfo:save")
  @RequestMapping(value = "/create", method = RequestMethod.POST)
  public @ResponseBody String create(@Valid ClassifyInfo classifyInfo) {
    if (null != classifyInfo) {
      classifyInfo.setFinanceCostsCategories(
          financeCostsCategoriesService.get(classifyInfo.getFinanceCostsCategoriesId()));
    }

    classifyInfoService.saveOrUpdate(classifyInfo);

    LogUitls.putArgs(LogMessageObject.newWrite().setObjects(new Object[] {classifyInfo.getId()}));
    return AjaxObject.newOk("添加成功!").toString();
  }
Пример #7
0
  @RequiresPermissions("ClassifyInfo:view")
  @RequestMapping(
      value = "/list",
      method = {RequestMethod.GET, RequestMethod.POST})
  public String list(ServletRequest request, Page page, Map<String, Object> map) {
    Specification<ClassifyInfo> specification =
        DynamicSpecifications.bySearchFilter(request, ClassifyInfo.class);
    List<ClassifyInfo> classifyInfos = classifyInfoService.findByExample(specification, page);

    map.put("page", page);
    map.put("classifyInfos", classifyInfos);
    mapPutCostsCategoriess(map);
    return LIST;
  }