private void generateDemoAudit() throws Exception {
    EnterpriseAudit auditModel = audit;
    EnterpriseBaseModel baseModel = audit.getBaseModel();
    String declareYear = (String) application.get(Constants.OPTION_SFDECLARE_YEAR);
    declareYear = Integer.parseInt(declareYear) + 1 + "";

    auditModel.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue());
    auditModel.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.Pass.getValue());
    /*
     * modified 2.21
     */
    // int count = auditService.getCount(baseModel, auditModel);
    if (baseModel.getEnterpriseStyle() == EnterpriseBaseModel.EStyle.Example.getValue()
        && Integer.parseInt((String) application.get(Constants.OPTION_SFDECLARE_YEAR))
                - Integer.parseInt(baseModel.getEnterpriseExpeYear())
            > 2) {
      EnterpriseAudit newDemAudit = new EnterpriseAudit();
      newDemAudit.setAuditEnterprise(baseModel.getEnterpriseName());
      newDemAudit.setAuditSecondStatus(EnterpriseAudit.EStatus.NotAudite.getValue());
      newDemAudit.setAuditStatus(EnterpriseAudit.EStatus.NotAudite.getValue());
      newDemAudit.setAuditType(2);
      java.util.Date date = new java.util.Date();
      DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
      newDemAudit.setDeclareDate(Date.valueOf(dateFormat.format(date)));
      newDemAudit.setEditable(true);
      newDemAudit.setBaseModel(baseModel);
      newDemAudit.setDeclareYear(declareYear);
      auditService.saveOrUpdate(newDemAudit);
    }
  }
  public String save() throws Exception {
    String list = servletRequest.getParameter("idList");
    String[] auditList = list.split(";");
    audit = new EnterpriseAudit();
    for (String id : auditList) {
      audit = auditService.get(id);
      audit.setAuditSecondStatus(state);

      if (state == 1) audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.Pass.getValue());
      else if (state == 2)
        audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.NotPass.getValue());
      // 退回市局
      else if (state == 4) {
        audit.setAuditStatusBackup(null);
        audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.NotTj.getValue());
        audit.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue());
        // 退回企业
      } else if (state == 7) {
        audit.setAuditStatusBackup(null);
        audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.Check.getValue());
        // audit.setAuditStatus(EnterpriseAudit.EStatus.Check.getValue());
        // 查阅完毕
      } else {
        audit.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.NotTj.getValue());
        // audit.setAuditStatus(EnterpriseAudit.EStatus.NotAudite.getValue());
        // modified 4.25
        // 标记从科技厅退回
        audit.setAuditStatusBackup(1);
        rejectToEnt((String) application.get(Constants.OPTION_SDDECLARE_YEAR));
      }

      if (audit.getAuditType() == 1) { // 试点企业审核
        if (state == 1) { // 审核通过
          audit.getBaseModel().setEnterpriseStyle(EnterpriseBaseModel.EStyle.Example.getValue());
          audit
              .getBaseModel()
              .setEnterpriseExpeYear(audit.getDeclareYear()); // add EnterpriseExpeYear 11.1
        } else {
          audit.getBaseModel().setEnterpriseStyle(EnterpriseBaseModel.EStyle.NONE.getValue());
          audit.getBaseModel().setEnterpriseExpeYear(null);
          rejectService.expReject(
              audit.getBaseModel().getEnterpriseId(),
              (String) application.get(Constants.OPTION_SDDECLARE_YEAR));
        }
        // 不是 退回市局
        if (state != 4)
          audit.getBaseModel().setEnterpriseState(EnterpriseBaseModel.EStatus.NotApply.getValue());
      } else if (audit.getAuditType() == 2) { // 示范企业审核
        if (state == 1) { // 审核通过
          audit
              .getBaseModel()
              .setEnterpriseStyle(EnterpriseBaseModel.EStyle.demonstrate.getValue());
          audit
              .getBaseModel()
              .setEnterpriseDemoYear(audit.getDeclareYear()); // add EnterpriseExpeYear 11.1
        } else {
          audit.getBaseModel().setEnterpriseStyle(EnterpriseBaseModel.EStyle.NONE.getValue());
          audit.getBaseModel().setEnterpriseExpeYear(null);
        }
      } else if (audit.getAuditType() == 3) { // 年度审核
        // 不是 退回市局
        if (state != 4)
          audit.getBaseModel().setEnterpriseState(EnterpriseBaseModel.EStatus.NotApply.getValue());
        generateDemoAudit();
      }
      auditService.saveOrUpdate(audit);

      // 记录日志
      UserModel userModel = (UserModel) session.get("USER");
      eventService.saveSystemEvent(
          getMessageFromResource(
              "second.tijiao",
              new String[] {
                state == 1 ? getText("pass") : getText("notpass"),
                EnterpriseAudit.EStyle.values()[audit.getAuditType() - 1].getText(),
                audit.getAuditEnterprise()
              }),
          userModel);
    }
    return null;
  }