Exemplo n.º 1
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();
  }
Exemplo n.º 2
0
  @Log(message = "修改了{0}组织的信息。")
  @RequiresPermissions("Organization:edit")
  @RequestMapping(value = "/update", method = RequestMethod.POST)
  public @ResponseBody String update(
      @Valid @ModelAttribute("preloadOrg") Organization organization) {
    organizationService.saveOrUpdate(organization);

    LogUitls.putArgs(LogMessageObject.newWrite().setObjects(new Object[] {organization.getName()}));
    return AjaxObject.newOk("修改组织成功!").toString();
  }
Exemplo n.º 3
0
 @Log(message = "添加了{0}组织。")
 @RequiresPermissions("Organization:save")
 @RequestMapping(value = "/create", method = RequestMethod.POST)
 public @ResponseBody String create(@Valid Organization organization) {
   try {
     organizationService.saveOrUpdate(organization);
   } catch (ServiceException e) {
     return AjaxObject.newError("添加组织失败:" + e.getMessage()).toString();
   }
   LogUitls.putArgs(LogMessageObject.newWrite().setObjects(new Object[] {organization.getName()}));
   return AjaxObject.newOk("添加组织成功!").toString();
 }
Exemplo n.º 4
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();
  }
Exemplo n.º 5
0
  /**
   * 给组织分配权限 描述
   *
   * @param userRole
   */
  @Log(message = "向{0}组织分配了{1}的角色。")
  @RequiresPermissions("Organization:assign")
  @RequestMapping(
      value = "/create/organizationRole",
      method = {RequestMethod.POST})
  public @ResponseBody void assignRole(OrganizationRole organizationRole) {
    organizationRoleService.saveOrUpdate(organizationRole);

    Organization organization = organizationService.get(organizationRole.getOrganization().getId());
    Role role = roleService.get(organizationRole.getRole().getId());
    LogUitls.putArgs(
        LogMessageObject.newWrite()
            .setObjects(new Object[] {organization.getName(), role.getName()}));
  }
Exemplo n.º 6
0
  @Log(message = "删除了{0}组织。")
  @RequiresPermissions("Organization:delete")
  @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
  public @ResponseBody String delete(@PathVariable Long id) {
    Organization organization = organizationService.get(id);
    try {
      organizationService.delete(id);
    } catch (ServiceException e) {
      return AjaxObject.newError("删除组织失败:" + e.getMessage()).setCallbackType("").toString();
    }

    LogUitls.putArgs(LogMessageObject.newWrite().setObjects(new Object[] {organization.getName()}));
    return AjaxObject.newOk("删除组织成功!").setCallbackType("").toString();
  }
Exemplo n.º 7
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();
  }
Exemplo n.º 8
0
  /**
   * 删除组织分配的角色 描述
   *
   * @param organizationId
   */
  @Log(message = "撤销了{0}组织的{1}角色。")
  @RequiresPermissions("Organization:assign")
  @RequestMapping(
      value = "/delete/organizationRole/{organizationRoleId}",
      method = {RequestMethod.POST})
  public @ResponseBody void deleteOrganizationRole(@PathVariable Long organizationRoleId) {
    OrganizationRole organizationRole = organizationRoleService.get(organizationRoleId);
    LogUitls.putArgs(
        LogMessageObject.newWrite()
            .setObjects(
                new Object[] {
                  organizationRole.getOrganization().getName(), organizationRole.getRole().getName()
                }));

    organizationRoleService.delete(organizationRoleId);
  }