Example #1
0
 /** @return */
 public String resetPassword() {
   this.volunteer = (VolunteerBean) getBusiness().getLeaf(getId()).getResponseData();
   this.listSource = (List<SourceCodeBean>) SOURBUS.getAllLeaves().getResponseData();
   if (volunteer != null) {
     SystemSettingBean systemSetting = ssb.getLeaf();
     volunteer.setPassword(StringUtil.toMD5(systemSetting.getDefaultPassword()));
     getBusiness().updateLeaf(volunteer, volunteer);
     addActionMessage("密码重置成功!");
   } else {
     addActionError("获取用户失败!重置密码失败!");
   }
   return SUCCESS;
 }
Example #2
0
  @Override
  public String save() throws Exception {

    this.listSource = (List<SourceCodeBean>) SOURBUS.getAllLeaves().getResponseData();
    BusinessResult result = getBusiness().save(getRequest(), volunteer);
    if (result.getErrors().size() > 0) {
      for (Object error : result.getErrors()) {
        addActionError(error.toString());
      }
      return INPUT;
    }
    if (result.getMessages().size() > 0) {
      for (Object message : result.getMessages()) {
        addActionMessage(message.toString());
      }
      return SUCCESS;
    }
    return SUCCESS;
  }
Example #3
0
 @Override
 public String add() {
   this.listSource = (List<SourceCodeBean>) SOURBUS.getAllLeaves().getResponseData();
   volunteer = new VolunteerBean();
   return SUCCESS;
 }
Example #4
0
 @Override
 public String edit() throws Exception {
   this.listSource = (List<SourceCodeBean>) SOURBUS.getAllLeaves().getResponseData();
   volunteer = (VolunteerBean) getBusiness().getLeaf(getId()).getResponseData();
   return SUCCESS;
 }
Example #5
0
 /**
  * @return
  * @throws Exception
  */
 public String index() throws Exception {
   this.listSource = (List<SourceCodeBean>) SOURBUS.getAllLeaves().getResponseData();
   return INDEX_SUCCESS;
 }
Example #6
0
  @Override
  public TableInitVo getTableInit() {
    TableInitVo init = new TableInitVo();
    init.getAoColumns().add(new TableHeaderVo("name", "志愿者").enableSearch());
    init.getAoColumns().add(new TableHeaderVo("code", "工号").enableSearch());
    init.getAoColumns().add(new TableHeaderVo("identityCard", "证件号").enableSearch());
    init.getAoColumns()
        .add(
            new TableHeaderVo("status", "状态")
                .enableSearch()
                .addSearchOptions(
                    new String[][] {
                      {"0", "1", "2", "3", "4"}, {"已注册", "通过审核", "通过面试", "未通过审核", "未通过面试"}
                    }));

    List<SourceCodeBean> sourceList =
        (List<SourceCodeBean>) SOURBUS.getAllLeaves().getResponseData();
    String[][] sources = new String[2][sourceList.size()];
    if (sourceList.size() > 0) {
      for (int i = 0; i < sourceList.size(); i++) {
        sources[0][i] = sourceList.get(i).getCode();
        sources[1][i] = sourceList.get(i).getName();
      }
    } else {
      sources = null;
    }
    init.getAoColumns()
        .add(new TableHeaderVo("occupation", "来源").addSearchOptions(sources).enableSearch());
    init.getAoColumns()
        .add(
            new TableHeaderVo("registerFrom", "渠道")
                .addSearchOptions(new String[][] {{"1", "2"}, {"医院", "微信"}})
                .enableSearch());
    init.getAoColumns()
        .add(
            new TableHeaderVo("sex", "性别")
                .addSearchOptions(new String[][] {{"1", "2"}, {"男", "女"}}));

    init.getAoColumns()
        .add(
            new TableHeaderVo("iconpath", "图像")
                .setHiddenColumn(true)
                .enableSearch()
                .addSearchOptions(new String[][] {{"null", "!null"}, {"没有", "有"}}));
    init.getAoColumns()
        .add(
            new TableHeaderVo("fingerpath", "指纹")
                .setHiddenColumn(true)
                .enableSearch()
                .addSearchOptions(new String[][] {{"null", "!null"}, {"没有", "有"}}));

    init.getAoColumns().add(new TableHeaderVo("cellPhone", "手机", false));
    init.getAoColumns()
        .add(
            new TableHeaderVo("wechat", "微信", false)
                .addSearchOptions(new String[][] {{"null", "!null"}, {"没有", "有"}})
                .enableSearch());
    init.getAoColumns().add(new TableHeaderVo("email", "邮箱", false));
    init.getAoColumns()
        .add(
            new TableHeaderVo("trainCounter_eq", "培训记录(=)", false)
                .setHiddenColumn(true)
                .enableSearch());
    init.getAoColumns()
        .add(
            new TableHeaderVo("trainCounter_gt", "培训记录(>)", false)
                .setHiddenColumn(true)
                .enableSearch());
    init.getAoColumns().add(new TableHeaderVo("trainCounter", "培训记录"));
    init.getAoColumns()
        .add(new TableHeaderVo("createTime_gteq", "注册时间").setHiddenColumn(true).enableSearch());
    init.getAoColumns()
        .add(new TableHeaderVo("createTime_lteq", "注册时间").setHiddenColumn(true).enableSearch());
    init.getAoColumns()
        .add(new TableHeaderVo("modifyTime_gteq", "更新时间").setHiddenColumn(true).enableSearch());
    init.getAoColumns()
        .add(new TableHeaderVo("modifyTime_lteq", "更新时间").setHiddenColumn(true).enableSearch());

    init.getAoColumns().add(new TableHeaderVo("createTime", "注册时间"));
    init.getAoColumns().add(new TableHeaderVo("modifyTime", "更新时间"));

    return init;
  }